Skip to content

JIT: Remove unused promoted loop definitions - #133447

Merged
jakobbotsch merged 2 commits into
dotnet:mainfrom
jakobbotsch:remove-unused-promoted-loop-definitions
Nov 2, 2026
Merged

jakobbotsch merged 2 commits into
dotnet:mainfrom
jakobbotsch:remove-unused-promoted-loop-definitions

Conversation

@jakobbotsch

Copy link
Copy Markdown
Member

LCL_ADDR propagation only records assertions for locals that are neither promoted nor struct fields. Expanding loop stores into promoted parents and field locals therefore adds map entries that can never invalidate an assertion.

Early versions of LCL_ADDR propagation attempted to support promoted locals and their fields, which required this bookkeeping. Remove it now that those assertions are not supported.

`LCL_ADDR` propagation only records assertions for locals that are neither
promoted nor struct fields. Expanding loop stores into promoted parents and
field locals therefore adds map entries that can never invalidate an
assertion.

Early versions of `LCL_ADDR` propagation attempted to support promoted locals
and their fields, which required this bookkeeping. Remove it now that those
assertions are not supported.

Co-authored-by: Copilot <[email protected]>
Copilot-Session: a64a400a-c6c5-492a-9e23-2de29e4612ce
@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 8, 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
jakobbotsch marked this pull request as ready for review September 15, 2026 09:19
Copilot AI lite review requested due to automatic review settings September 15, 2026 09:19
@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.

🟢 Approval recommended

No unresolved review issues were identified.

Pull request overview

Removes obsolete promoted-local and struct-field bookkeeping from JIT loop-definition tracking.

Changes:

  • Retains direct local-store definitions.
  • Simplifies LoopDefinitions::GetOrCreateMap.
File summaries
File Description
src/coreclr/jit/lclmorph.cpp Removes unused promoted-local and field map entries.
Review details
  • Files reviewed: 1/1 changed files
  • Comments generated: 0
  • Review effort level: Lite

@JulieLeeMSFT

Copy link
Copy Markdown
Member

LGTM. Assertions are only keyed by DestLclNum/AddressLclNum, never by promoted-parent or struct-field locals. So, the deleted map entries were write-only/unread and the change is behavior-preserving.

Loop body IR walk (LocalsVisitor)
     │
     ├─ LCL_VAR store to V05  ──► map.Set(V05)
     │
     │   [REMOVED] if V05 is promoted parent:
     │       ├─ map.Set(field V05.0)
     │       ├─ map.Set(field V05.1)
     │       └─ ...
     │   [REMOVED] if V05 is a struct field:
     │       └─ map.Set(parent lclNum)
     │
     ▼
map only ever consulted by assertion-prop's Clear(),
which only clears assertions for non-promoted, non-field locals.

@jakobbotsch

Copy link
Copy Markdown
Member Author

/azp run runtime-coreclr superpmi-diffs

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 1 pipeline(s).

@jakobbotsch
jakobbotsch merged commit b4548da into dotnet:main Nov 2, 2026
134 of 137 checks passed
@jakobbotsch
jakobbotsch deleted the remove-unused-promoted-loop-definitions branch November 2, 2026 10:30
@dotnet-milestone-bot dotnet-milestone-bot Bot added this to the 12.0-preview1 milestone Nov 4, 2026
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.

3 participants