Skip to content

Arm64: Fix consecutive register wraparound - #136642

Merged
dhartglassMSFT merged 2 commits into
dotnet:mainfrom
SwapnilGaikwad:github-fix-wraparound-assert
Oct 31, 2026
Merged

dhartglassMSFT merged 2 commits into
dotnet:mainfrom
SwapnilGaikwad:github-fix-wraparound-assert

Conversation

@SwapnilGaikwad

@SwapnilGaikwad SwapnilGaikwad commented Oct 29, 2026 •

Copy link
Copy Markdown
Contributor

Require every register in a wraparound sequence to be available before selecting the sequence. Avoids matching subsets.
Correct the masks for four-register sequences starting at V30 and V31.

For example, when four consecutive registers are needed, V29, V30, V31, V0 is a valid range only when all four registers are available. Previously, the wraparound checks could select the range when only some registers, such as V30, V31, V0, were available. This could cause LSRA to select busy V29 and assert later.

cc: @dotnet/arm64-contrib @dhartglassMSFT @EgorBo

fixes #135508

Require every register in a wraparound sequence to be available before selecting the sequence.
Avoids matching subsets.
Correct the masks for four-register sequences starting at V30 and V31.
@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 Oct 29, 2026
@dotnet-policy-service dotnet-policy-service Bot added the community-contribution Indicates that the PR has been added by a community member label Oct 29, 2026
@azure-pipelines

Copy link
Copy Markdown
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.

@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.

@dhartglassMSFT

Copy link
Copy Markdown
Contributor

@SwapnilGaikwad double checking this is meant to fix #135508

@dhartglassMSFT
dhartglassMSFT merged commit 22adabc into dotnet:main Oct 31, 2026
145 checks passed
@dhartglassMSFT

Copy link
Copy Markdown
Contributor

@SwapnilGaikwad double checking this is meant to fix #135508

@SwapnilGaikwad Anyway, I linked this to 135508 to get this change in. If it isn't meant to fix 135508 somehow, then can you reopen that issue?

@SwapnilGaikwad
SwapnilGaikwad deleted the github-fix-wraparound-assert branch November 2, 2026 13:04
@SwapnilGaikwad

Copy link
Copy Markdown
Contributor Author

@SwapnilGaikwad double checking this is meant to fix #135508

@SwapnilGaikwad Anyway, I linked this to 135508 to get this change in. If it isn't meant to fix 135508 somehow, then can you reopen that issue?

I meant to fix the bugs in wraparound issue while accessing consecutive registers. The original check accepted when a subset was available. This could lead to the using a busy register incorrectly.
I've confirmed the repro for #135508 and this patch fixes it. 👍

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 community-contribution Indicates that the PR has been added by a community member

Projects

None yet

2 participants