Skip to content

Conversation

@EgorBo
Copy link
Member

@EgorBo EgorBo commented Jan 15, 2026

diffs

Fixes #122288
Also, enables more branch foldings based on assertions - basically, mimics what SSA-based GetRange does, but based only on VNs.

I recommend reviewing with whitespaces disabled.

@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 Jan 15, 2026
@dotnet-policy-service
Copy link
Contributor

Tagging subscribers to this area: @JulieLeeMSFT, @dotnet/jit-contrib
See info in area-owners.md if you want to be subscribed.

This comment was marked as outdated.

@EgorBo EgorBo force-pushed the refactor-range-ops branch from df7af53 to 7117893 Compare January 21, 2026 11:13
@EgorBo EgorBo force-pushed the refactor-range-ops branch from 74bbb1c to c468b04 Compare January 21, 2026 16:05
@EgorBo
Copy link
Member Author

EgorBo commented Jan 21, 2026

@jakobbotsch PTAL again, I still have a few ideas for a refactoring, but those should be zero diffs and will be in a separate PR. Now I am slowly moving towards repeating what SSA-based GetRange does, but only with VNs

Some 50-100k improvements are expected - diffs - although, there are regressions from previously semi-legal transformations based on half-defined ranges (e.g. [10..unknown])

PS: I think I also spot a few potential bugs when we could perform a multiplication on top of keBinOpArray or add two keBinOpArrays

PS2: I recommend disabling the whitespaces on the review view.

@EgorBo EgorBo requested a review from jakobbotsch January 21, 2026 19:23
@EgorBo EgorBo changed the title Refactor RangeOps Add/Multiply and TryGetRangeFromAssertions Add binary VN funcs to TryGetRangeFromAssertions Jan 21, 2026
@EgorBo
Copy link
Member Author

EgorBo commented Jan 23, 2026

ping @jakobbotsch

@EgorBo EgorBo enabled auto-merge (squash) January 23, 2026 16:22
@EgorBo EgorBo merged commit 4b0b723 into dotnet:main Jan 23, 2026
130 of 132 checks passed
@EgorBo EgorBo deleted the refactor-range-ops branch January 23, 2026 16:22
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.

JIT: Bad codegen with comparisons close to int.MaxValue

2 participants