Commit 1b4d042
authored
Move RBM_SAVED_LOCALLOC_SP reservation from compCompile to setFrameType in LSRA (#121745)
Move the code that adds `RBM_SAVED_LOCALLOC_SP` to `rsMaskResvd` from
`compCompile` into `setFrameType` in LSRA
## Plan
- [x] Understand the problem: Need to move ARM-specific code that
reserves a register for localloc stack unwinding
- [x] Locate source code:
- Code to move: `compiler.cpp` lines 4953-4959 (inside `compCompile`)
- Destination: `lsra.cpp` `setFrameType()` function after line 2718
- [x] Verify baseline build (CoreCLR) succeeds
- [x] Make the code change:
- Removed the code block from `compiler.cpp` (lines 4953-4959)
- Added the code block to `lsra.cpp` in `setFrameType()` after existing
`rsMaskResvd` setting
- [x] Build CoreCLR to verify compilation succeeds
- [x] Address review feedback: Add JITDUMP statement for register
reservation
- [x] Build CoreCLR again to verify JITDUMP addition
- [x] Run CodeQL security scan - No issues found
- [x] Complete
## Changes Made
- **src/coreclr/jit/compiler.cpp**: Removed the `#ifdef TARGET_ARM`
block that sets `RBM_SAVED_LOCALLOC_SP` in `rsMaskResvd` from the
`compCompile` function
- **src/coreclr/jit/lsra.cpp**: Added the same block to `setFrameType()`
after the existing code that sets `rsMaskResvd` for large frame offsets
- **src/coreclr/jit/lsra.cpp**: Added JITDUMP statement to log when
`REG_SAVED_LOCALLOC_SP` is reserved
## Build 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.
<!-- START COPILOT CODING AGENT SUFFIX -->
<details>
<summary>Original prompt</summary>
> Move the code that adds `RBM_SAVED_LOCALLOC_SP` to `rsMaskResvd` from
`compCompile` into `setFrameType` in LSRA, next to the existing code
that sets `rsMaskResvd`
</details>
<!-- START COPILOT CODING AGENT TIPS -->
---
✨ Let Copilot coding agent [set things up for
you](https://github.com/dotnet/runtime/issues/new?title=✨+Set+up+Copilot+instructions&body=Configure%20instructions%20for%20this%20repository%20as%20documented%20in%20%5BBest%20practices%20for%20Copilot%20coding%20agent%20in%20your%20repository%5D%28https://gh.io/copilot-coding-agent-tips%29%2E%0A%0A%3COnboard%20this%20repo%3E&assignees=copilot)
— coding agent works faster and does higher quality work when set up for
your repo.1 parent 5478a0e commit 1b4d042
2 files changed
+10
-8
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4950 | 4950 | | |
4951 | 4951 | | |
4952 | 4952 | | |
4953 | | - | |
4954 | | - | |
4955 | | - | |
4956 | | - | |
4957 | | - | |
4958 | | - | |
4959 | | - | |
4960 | | - | |
4961 | 4953 | | |
4962 | 4954 | | |
4963 | 4955 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2588 | 2588 | | |
2589 | 2589 | | |
2590 | 2590 | | |
| 2591 | + | |
| 2592 | + | |
| 2593 | + | |
| 2594 | + | |
| 2595 | + | |
| 2596 | + | |
| 2597 | + | |
| 2598 | + | |
| 2599 | + | |
| 2600 | + | |
2591 | 2601 | | |
2592 | 2602 | | |
2593 | 2603 | | |
| |||
0 commit comments