Repository navigation
JIT: Keep index casts available for address-mode optimization - #137513
Open
NinoFloris wants to merge 1 commit into
Open
NinoFloris wants to merge 1 commit into
NinoFloris wants to merge 1 commit into
Conversation
|
Azure Pipelines: Successfully started running 5 pipeline(s). 10 pipeline(s) were filtered out due to trigger conditions. There may be pipelines that require an authorized user to comment /azp run to run. |
Contributor
|
Tagging subscribers to this area: @JulieLeeMSFT, @jakobbotsch |
NinoFloris
force-pushed
the
jit/cse-addrmode-index-cast
branch
from
November 13, 2026 19:40
ad5df9d to
e6a951a
Compare
NinoFloris
marked this pull request as ready for review
November 13, 2026 21:07
NinoFloris
force-pushed
the
jit/cse-addrmode-index-cast
branch
from
November 13, 2026 21:15
e6a951a to
18f6da9
Compare
Keep unchecked int-to-native-int casts in scaled and unscaled address indices out of CSE so lowering can eliminate or fold them. On xarch, only zero-extending casts qualify; arm64 also supports sign extension in its address forms. Marking is per occurrence, so non-address uses remain eligible for CSE.
NinoFloris
force-pushed
the
jit/cse-addrmode-index-cast
branch
from
November 13, 2026 21:19
18f6da9 to
15cc57d
Compare
This was referenced Nov 14, 2026
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Extend GTF_ADDRMODE_NO_CSE marking to unchecked (int or smaller)-to-native-int casts beneath scaled and unscaled indices on xarch and arm64. This keeps the casts available for lowering to eliminate or fold into the address instead of materializing CSE temps. Marking is per occurrence, so non-address uses remain eligible for CSE.
RISC-V already has a similar rule:
https://github.com/NinoFloris/dotnet-runtime/blob/ad5df9d0712b11c81f78e36519429576b33c1451/src/coreclr/jit/gentree.cpp#L5965-L5986
CI results, aggregated across collections. PerfScore is the geomean over all paired compilations; lower is better in every column.