Skip to content

JIT: Ensure the importer does not reorder GTF_ORDER_SIDEEFF with GTF_GLOB_REF - #134140

Merged
jakobbotsch merged 1 commit into
dotnet:mainfrom
jakobbotsch:importer-reorder-ordersideeff
Sep 18, 2026
Merged

jakobbotsch merged 1 commit into
dotnet:mainfrom
jakobbotsch:importer-reorder-ordersideeff

Conversation

@jakobbotsch

Copy link
Copy Markdown
Member

GTF_ORDER_SIDEEFF should not be reordered with GTF_GLOB_REF. However, the importer's spill handling did not check for this case.

Minimal diffs expected.

…GLOB_REF

`GTF_ORDER_SIDEEFF` should not be reordered with `GTF_GLOB_REF`.
However, the importer's spill handling did not check for this case.

Minimal diffs expected.
@github-actions github-actions Bot added the area-CodeGen-coreclr CLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMI label Sep 17, 2026
@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 5 pipeline(s).
11 pipeline(s) were filtered out due to trigger conditions.
There may be pipelines that require an authorized user to comment /azp run to run.

@dotnet-policy-service

Copy link
Copy Markdown
Contributor

Tagging subscribers to this area: @JulieLeeMSFT, @jakobbotsch
See info in area-owners.md if you want to be subscribed.

@jakobbotsch

Copy link
Copy Markdown
Member Author

cc @dotnet/jit-contrib PTAL @EgorBo

Minor diffs

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 5 pipeline(s).
11 pipeline(s) were filtered out due to trigger conditions.
There may be pipelines that require an authorized user to comment /azp run to run.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

Add a focused regression test covering the ordering combination.

Get a fresh assessment by requesting another Copilot review.

Pull request overview

Updates JIT importer spill handling to preserve GTF_ORDER_SIDEEFF ordering relative to global reads.

Changes:

  • Includes ordering side effects in spill analysis.
  • Applies full spill checks to vectorization comparison temporaries.
File summaries
File Summary
src/coreclr/jit/importervectorization.cpp Applies full spill handling to generated comparison temporaries.
src/coreclr/jit/importer.cpp Preserves ordering side effects during importer spills.
Review details
  • Files reviewed: 2/2 changed files
  • Comments generated: 1
  • Review effort level: Lite

Comment thread src/coreclr/jit/importer.cpp
Comment thread src/coreclr/jit/importer.cpp
Comment thread src/coreclr/jit/importer.cpp

@tannergooding tannergooding left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. I think there's just one place we're being overly conservative, but its probably not super critical.

@EgorBo

EgorBo commented Sep 17, 2026

Copy link
Copy Markdown
Member

we're being overly conservative

Given the most popular category among the 110+ bugs I filed is essentially "wrong eval order" (from AI's analysis), I suspect we'd rather be conservative 😐

@tannergooding

Copy link
Copy Markdown
Member

I suspect we'd rather be conservative

I'm not so sure.

I would guess most of the bugs are rather from historical buildup, complexity, and people working around things because the general logic is often too conservative and they can't use the existing helpers.

I'd think that if we set things up to be correct and centralized, then the risk and bugs goes down substantially at the same time.

--- Not saying it needs to be done here or now, just that as long as we have the main helpers being "subpar" we're going to continue having risk for future areas here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area-CodeGen-coreclr CLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMI

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants