Skip to content

Remove the redundant jump in the HW intrinsic jump table fallback - #135685

Merged
tannergooding merged 1 commit into
dotnet:mainfrom
tannergooding:jit-hwintrinsic-jump
Oct 13, 2026
Merged

tannergooding merged 1 commit into
dotnet:mainfrom
tannergooding:jit-hwintrinsic-jump

Conversation

@tannergooding

Copy link
Copy Markdown
Member

Avoid emitting an unconditional jump after the final case in the x64 hardware-intrinsic jump-table fallback. Earlier cases retain their jumps to the switch end.

PMI on the original corpus/base measured a 1,302-byte reduction across 438 methods. This measurement predates the rebase onto current dotnet/main and was not refreshed.

Validation on the combined rebased branch:

  • build.cmd clr+libs -rc Checked -lc Release — passed, 0 warnings and 0 errors.
  • src\tests\build.cmd x64 checked -tree JIT /p:LibrariesConfiguration=Release — passed.
  • src\tests\run.cmd x64 checked -tree JIT — passed, 3,466 passed, 0 failed, 107 skipped (3,573 total).
  • build.cmd clr.jit -c Release — passed, 0 warnings and 0 errors.
  • python3 src/coreclr/scripts/jitformat.py -r . -o windows -a x64 -j D:\repos\jitutils — passed; no formatting changes.

Note

This PR description was generated with GitHub Copilot.

@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 Oct 13, 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.

@tannergooding
tannergooding requested a review from EgorBo October 13, 2026 18:59
@tannergooding

Copy link
Copy Markdown
Member Author

Simple change which handles the pessimization and gets -4053 bytes on Windows x64 and -1919 bytes on Linux x64: https://dev.azure.com/dnceng-public/public/_build/results?buildId=1633857&view=ms.vss-build-web.run-extensions-tab

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

The focused code-generation optimization preserves control flow and has appropriate JIT validation.

0 open findings

What changed in this PR

Removes the redundant final jump from x64 hardware-intrinsic jump-table fallbacks, reducing generated code size without changing behavior.

Changes:

  • Defers case-ending jumps until the next iteration.
  • Allows the final case to fall through directly to the switch end.
File Description
src/​coreclr/​jit/​hwintrinsiccodegenxarch.cpp Omits the redundant jump after the final emitted switch case.

🧠 Review effort: Balanced

@tannergooding

Copy link
Copy Markdown
Member Author

/ba-g unrelated http timeouts

@tannergooding
tannergooding merged commit 5f4e652 into dotnet:main Oct 13, 2026
129 of 131 checks passed
@tannergooding
tannergooding deleted the jit-hwintrinsic-jump branch October 13, 2026 22:13
@dotnet-milestone-bot dotnet-milestone-bot Bot added this to the 12.0-preview1 milestone Oct 14, 2026
@github-actions github-actions Bot locked and limited conversation to collaborators Nov 14, 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