Skip to content

JIT: remove duplicate node uniqueness check - #132624

Merged
jakobbotsch merged 1 commit into
dotnet:mainfrom
jakobbotsch:jit-dedup-uniqueness-check
Aug 24, 2026
Merged

jakobbotsch merged 1 commit into
dotnet:mainfrom
jakobbotsch:jit-dedup-uniqueness-check

Conversation

@jakobbotsch

@jakobbotsch jakobbotsch commented Aug 21, 2026 •

Copy link
Copy Markdown
Member

Phase::PostPhase runs fgDebugCheckNodesUniqueness under CHECK_UNIQUE and then fgDebugCheckLinks under CHECK_IR, which ran it a second time. CHECK_UNIQUE is enabled before importation and CHECK_IR only after morph, so CHECK_IR is never active without CHECK_UNIQUE and the inner call is always redundant.

Checked JIT instructions retired:

  benchmarks.run                -5.82%
  benchmarks.run_pgo            -5.57%
  benchmarks.run_pgo_optrepeat  -5.82%
  libraries.pmi                 -5.54%

benchmarks.run replay wall clock: 67.38s -> 65.11s (-3.37%).

Copilot AI lite review requested due to automatic review settings August 21, 2026 14:37
@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 Aug 21, 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.

Phase::PostPhase runs fgDebugCheckNodesUniqueness under CHECK_UNIQUE and
then fgDebugCheckLinks under CHECK_IR, which ran it a second time.
CHECK_UNIQUE is enabled before importation and CHECK_IR only after
morph, so CHECK_IR is never active without CHECK_UNIQUE and the inner
call is always redundant.

Checked JIT instructions retired:

  benchmarks.run                -5.82%
  benchmarks.run_pgo            -5.57%
  benchmarks.run_pgo_optrepeat  -5.82%
  libraries.pmi                 -5.54%

benchmarks.run replay wall clock: 67.38s -> 65.11s (-3.37%).

Co-authored-by: Copilot <[email protected]>
Copilot-Session: 064035bf-fb1f-450e-afd2-08a7700aa736
@jakobbotsch
jakobbotsch force-pushed the jit-dedup-uniqueness-check branch from aa63786 to 5ac11f6 Compare August 21, 2026 14:38

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 removes a redundant IR debug-validation pass in the JIT by eliminating an unconditional fgDebugCheckNodesUniqueness() call from Compiler::fgDebugCheckLinks(), relying instead on the existing Phase::PostPhase CHECK_UNIQUE/CHECK_IR sequencing to avoid double work.

Changes:

  • Remove the unconditional fgDebugCheckNodesUniqueness() call from Compiler::fgDebugCheckLinks().
  • Preserve uniqueness checking via Phase::PostPhase when PhaseChecks::CHECK_UNIQUE is enabled (and link checking via CHECK_IR), avoiding duplicate full-IR walks.

@jakobbotsch

Copy link
Copy Markdown
Member Author

PTAL @dotnet/jit-contrib

@jakobbotsch
jakobbotsch merged commit 3bd6cca into dotnet:main Aug 24, 2026
126 of 128 checks passed
@jakobbotsch
jakobbotsch deleted the jit-dedup-uniqueness-check branch August 24, 2026 11:45
@dotnet-milestone-bot dotnet-milestone-bot Bot added this to the 12.0-preview1 milestone Aug 25, 2026
@github-actions github-actions Bot locked and limited conversation to collaborators Sep 24, 2026
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.

3 participants