Repository navigation
arm64: Avoid unused vector constant temps and prefer no-op casts - #136705
Merged
tannergooding merged 3 commits intoNov 25, 2026
Merged
tannergooding merged 3 commits into
tannergooding merged 3 commits into
Conversation
- Related to dotnet#136694 Match the vector immediate checks when building register requirements, so encodable constants do not reserve an unused integer temporary. Prefer the source register for non-overflowing int-to-int casts that can be elided when source and destination share a register. SuperPMI asm diffs against main (294b271), using Release JITs and six published Linux ARM64 collections, show 184 fewer generated code bytes. Of 60 changed compilation contexts, 45 became smaller and none grew.
|
Azure Pipelines: Successfully started running 7 pipeline(s). 9 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 |
JulieLeeMSFT
approved these changes
Nov 2, 2026
JulieLeeMSFT
left a comment
Member
There was a problem hiding this comment.
LGTM.
The new canEncode check in LSRA matches CodeGen::genSetRegToConst: same is8 SIMD8/SIMD16 split and the same i32/i16/i8 MOVI checks.
The int temp is reserved only when codegen takes the memory-load fallback (emitIns_R_C).
The int -> int cast change is consistent with the existing long -> int handling.
Optionally, a shared helper for the MOVI check would remove the duplication, but that can be a follow-up.
2 of 27 tasks
This was referenced Nov 17, 2026
Contributor
|
Hi @tannergooding , is there anything we can do to push this further? |
tannergooding
approved these changes
Nov 25, 2026
Member
|
/ba-g unrelated timeout |
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.
Match the vector immediate checks when building register requirements, so encodable constants do not reserve an unused integer temporary. Prefer the source register for non-overflowing int-to-int casts that can be elided when source and destination share a register.
SuperPMI asm diffs against main (294b271), using Release JITs and six published Linux ARM64 collections, show 184 fewer generated code bytes. Of 60 changed compilation contexts, 45 became smaller and none grew.