Move RBM_SAVED_LOCALLOC_SP reservation from compCompile to setFrameType in LSRA#121745
Merged
jakobbotsch merged 4 commits intomainfrom Jan 2, 2026
Merged
Move RBM_SAVED_LOCALLOC_SP reservation from compCompile to setFrameType in LSRA#121745jakobbotsch merged 4 commits intomainfrom
jakobbotsch merged 4 commits intomainfrom
Conversation
Contributor
|
Tagging subscribers to this area: @JulieLeeMSFT, @jakobbotsch |
Co-authored-by: jakobbotsch <[email protected]>
Copilot
AI
changed the title
[WIP] Move RBM_SAVED_LOCALLOC_SP assignment to setFrameType
Move RBM_SAVED_LOCALLOC_SP reservation from compCompile to setFrameType in LSRA
Nov 18, 2025
jakobbotsch
reviewed
Nov 18, 2025
Co-authored-by: jakobbotsch <[email protected]>
jakobbotsch
approved these changes
Nov 18, 2025
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR relocates ARM-specific register reservation code from the compCompile function to the setFrameType function in LSRA. The change moves the logic that reserves RBM_SAVED_LOCALLOC_SP (R9 on ARM) for stack unwinding when localloc is used, placing it closer to related register reservation code.
Key changes:
- Removes the
#ifdef TARGET_ARMblock fromcompCompileincompiler.cpp - Adds the same logic to
setFrameTypeinlsra.cpp, positioned after theRBM_OPT_RSVDreservation code - Includes a new JITDUMP statement for debugging visibility when the register is reserved
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| src/coreclr/jit/compiler.cpp | Removed ARM-specific register reservation block from compCompile function |
| src/coreclr/jit/lsra.cpp | Added ARM-specific register reservation to setFrameType with JITDUMP logging |
Co-authored-by: Copilot <[email protected]>
Member
|
PTAL @dotnet/jit-contrib |
Member
|
Ping @dotnet/jit-contrib |
AndyAyersMS
approved these changes
Dec 12, 2025
This was referenced Jan 9, 2026
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
Move the code that adds
RBM_SAVED_LOCALLOC_SPtorsMaskResvdfromcompCompileintosetFrameTypein LSRAPlan
compiler.cpplines 4953-4959 (insidecompCompile)lsra.cppsetFrameType()function after line 2718compiler.cpp(lines 4953-4959)lsra.cppinsetFrameType()after existingrsMaskResvdsettingChanges Made
#ifdef TARGET_ARMblock that setsRBM_SAVED_LOCALLOC_SPinrsMaskResvdfrom thecompCompilefunctionsetFrameType()after the existing code that setsrsMaskResvdfor large frame offsetsREG_SAVED_LOCALLOC_SPis reservedBuild Status
✅ CoreCLR build succeeded with changes
✅ CoreCLR build succeeded with JITDUMP addition
✅ No CodeQL security issues detected
Security Summary
No security vulnerabilities were introduced or detected in this change. The code is a straightforward refactoring that moves existing logic to a more appropriate location without changing its behavior.
Original prompt
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.