Skip to content

JIT: Preserve 64-bit bit-count value numbers - #133727

Merged
AndyAyersMS merged 2 commits into
dotnet:mainfrom
AndyAyersMS:fix-133560-wasm-bitcount-vn
Sep 12, 2026
Merged

AndyAyersMS merged 2 commits into
dotnet:mainfrom
AndyAyersMS:fix-133560-wasm-bitcount-vn

Conversation

@AndyAyersMS

Copy link
Copy Markdown
Member

Fixes #133560.

Preserve TYP_LONG value numbers when folding 64-bit bit-counting intrinsics, and add regression coverage for signed and unsigned PopCount, LeadingZeroCount, and TrailingZeroCount.

Validation:

  • Checked all-JIT build
  • Targeted native x64 regression test
  • WASM Crossgen2 compilation of the merged regression assembly

Note

This PR description was created by GitHub Copilot.

Fixes dotnet#133560.

Co-authored-by: Copilot <[email protected]>

Copilot-Session: be30cab5-d605-4896-b07e-9758803fed4f
Copilot AI lite review requested due to automatic review settings September 11, 2026 18:00
@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 11, 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.

🟢 Approval recommended

No unresolved blocking issues were identified.

Pull request overview

This PR preserves 64-bit value numbers when folding JIT bit-counting intrinsics and adds regression coverage.

Changes:

  • Preserve TYP_LONG constants during folding.
  • Add signed and unsigned tests for PopCount, LeadingZeroCount, and TrailingZeroCount.
  • Register the regression test.
File summaries
File Description
src/tests/JIT/Regression/Regression_ro_2.csproj Includes the new regression test.
src/tests/JIT/Regression/JitBlue/Runtime_133560/Runtime_133560.cs Adds 64-bit bit-counting regression coverage.
src/coreclr/jit/valuenum.cpp Preserves 64-bit value-number types.
Review details
  • Files reviewed: 3/3 changed files
  • Comments generated: 0
  • Review effort level: Lite

Resolve the regression test layout conflict from dotnet#133591.

Co-authored-by: Copilot <[email protected]>

Copilot-Session: be30cab5-d605-4896-b07e-9758803fed4f
Copilot AI review requested due to automatic review settings September 11, 2026 18:10
@AndyAyersMS

Copy link
Copy Markdown
Member Author

@EgorBo PTAL
fyi @dotnet/jit-contrib

@AndyAyersMS
AndyAyersMS requested a review from EgorBo September 11, 2026 18:14

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 comments were identified.

Review details
  • Files reviewed: 2/2 changed files
  • Comments generated: 0 new
  • Review effort level: Lite

@AndyAyersMS

Copy link
Copy Markdown
Member Author

/ba-g known mono failures

@AndyAyersMS
AndyAyersMS merged commit b9678dc into dotnet:main Sep 12, 2026
140 of 143 checks passed
@dotnet-milestone-bot dotnet-milestone-bot Bot added this to the 12.0-preview1 milestone Sep 14, 2026
jtschuster pushed a commit to jtschuster/runtime that referenced this pull request Sep 18, 2026
Fixes dotnet#133560.

Preserve `TYP_LONG` value numbers when folding 64-bit bit-counting
intrinsics, and add regression coverage for signed and unsigned
`PopCount`, `LeadingZeroCount`, and `TrailingZeroCount`.

Validation:
- Checked all-JIT build
- Targeted native x64 regression test
- WASM Crossgen2 compilation of the merged regression assembly

> [!NOTE]
> This PR description was created by GitHub Copilot.

Copilot-Session: be30cab5-d605-4896-b07e-9758803fed4f
@github-actions github-actions Bot locked and limited conversation to collaborators Oct 15, 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.

JIT: (bug) value numbering asserts when constant-folding 64-bit PopCount/LeadingZeroCount/TrailingZeroCount

3 participants