[llvm] [AMDGPU] Ensure non-reserved CSR spilled regs are live-in (PR #146427)

via llvm-commits llvm-commits at lists.llvm.org
Wed Jul 2 05:02:25 PDT 2025


================
@@ -995,6 +996,12 @@ void SIFrameLowering::emitCSRSpillStores(
         }
       };
 
+  for (const Register &Reg : make_first_range(WWMScratchRegs)) {
+    if (!MRI.isReserved(Reg)) {
+      MRI.addLiveIn(Reg);
+      MBB.addLiveIn(Reg);
+    }
----------------
macurtis-amd wrote:

Reg is `$agpr13`.
Where would you expect it to get reserved? [`SIMachineFunctionInfo::allocateWWMSpill()`](https://github.com/llvm/llvm-project/blob/5fe63ae9a3fb7502ce7ed076ea14def97d79e85e/llvm/lib/Target/AMDGPU/SIMachineFunctionInfo.cpp#L291)?

https://github.com/llvm/llvm-project/pull/146427


More information about the llvm-commits mailing list