[llvm] Rebased save csr in ra (PR #131845)

Michael Maitland via llvm-commits llvm-commits at lists.llvm.org
Tue Mar 18 10:26:54 PDT 2025


================
@@ -1398,17 +1547,55 @@ RISCVFrameLowering::getFrameIndexReference(const MachineFunction &MF, int FI,
   return Offset;
 }
 
-void RISCVFrameLowering::determineCalleeSaves(MachineFunction &MF,
-                                              BitVector &SavedRegs,
-                                              RegScavenger *RS) const {
-  TargetFrameLowering::determineCalleeSaves(MF, SavedRegs, RS);
-  // Unconditionally spill RA and FP only if the function uses a frame
-  // pointer.
+void RISCVFrameLowering::determineMustCalleeSaves(MachineFunction &MF,
+                                                  BitVector &SavedRegs) const {
+  const TargetRegisterInfo &TRI = *MF.getSubtarget().getRegisterInfo();
+
+  // Resize before the early returns. Some backends expect that
----------------
michaelmaitland wrote:

What do you mean some backends expect this? IIUC, there is no other subtarget that has this function and this function for the RISC-V backend.

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


More information about the llvm-commits mailing list