Skip to content

Ensure other cases of lzcnt/tzcnt/popcount are handled by rangecheck#128620

Open
tannergooding wants to merge 2 commits into
dotnet:mainfrom
tannergooding:better-rngchk
Open

Ensure other cases of lzcnt/tzcnt/popcount are handled by rangecheck#128620
tannergooding wants to merge 2 commits into
dotnet:mainfrom
tannergooding:better-rngchk

Conversation

@tannergooding
Copy link
Copy Markdown
Member

No description provided.

Copilot AI review requested due to automatic review settings May 27, 2026 04:05
@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 May 27, 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.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This change updates JIT range analysis (RangeCheck::GetRangeFromAssertionsWorker) to recognize additional lzcnt/tzcnt/popcount value-numbering function cases and to tighten the inferred constant upper bound from a fixed 64 to 32 or 64 depending on bit-width.

Changes:

  • Adds target-conditional switch cases intended to cover additional xarch/arm64 LZCNT/TZCNT/POPCNT-related VN function IDs.
  • Adjusts the inferred upper bound for {LeadingZeroCount, TrailingZeroCount, PopCount} from a constant 64 to 32 vs 64 based on type.

Comment thread src/coreclr/jit/rangecheck.cpp Outdated
Comment thread src/coreclr/jit/rangecheck.cpp
Copilot AI review requested due to automatic review settings May 27, 2026 04:25
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 1 out of 1 changed files in this pull request and generated no new comments.

Comment thread src/coreclr/jit/rangecheck.cpp
Comment thread src/coreclr/jit/rangecheck.cpp
@tannergooding tannergooding enabled auto-merge (squash) May 27, 2026 13:37
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.

4 participants