Skip to content

JIT: Replace promoted fields after morphing indirs in local morph - #130401

Merged
jakobbotsch merged 1 commit into
dotnet:mainfrom
jakobbotsch:fix-117416
Jul 10, 2026
Merged

jakobbotsch merged 1 commit into
dotnet:mainfrom
jakobbotsch:fix-117416

Conversation

@jakobbotsch

Copy link
Copy Markdown
Member

Fix #117416

Copilot AI review requested due to automatic review settings July 9, 2026 09:23
@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 Jul 9, 2026
@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.

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.

Pull request overview

This PR adjusts local morph’s handling of indirections that are transformed into GT_LCL_FLD/GT_STORE_LCL_FLD so that promoted-field substitution happens immediately (via the existing MorphLocalField helper) rather than being missed due to control flow in PreOrderVisit.

Changes:

  • When MorphLocalIndir turns an indir into a GT_LCL_FLD/GT_STORE_LCL_FLD for non-TYP_STRUCT accesses, it now calls MorphLocalField right away.
  • Keeps the existing “don’t force DNER for TYP_STRUCT fields” behavior so global morph can still potentially turn those into enregisterable locals later.

@jakobbotsch
jakobbotsch marked this pull request as ready for review July 9, 2026 12:18
@jakobbotsch

Copy link
Copy Markdown
Member Author

cc @dotnet/jit-contrib PTAL @EgorBo

Diffs

@jakobbotsch
jakobbotsch requested a review from EgorBo July 9, 2026 14:51
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

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.

JIT spills struct field to stack when used with ternary in compound assignment

3 participants