[llvm] [RISC-V] Fix incorrect epilogue_begin (PR #120623)
Venkata Ramanaiah Nalamothu via llvm-commits
llvm-commits at lists.llvm.org
Sun Jan 26 22:48:09 PST 2025
================
@@ -1000,20 +1005,20 @@ void RISCVFrameLowering::emitEpilogue(MachineFunction &MF,
// If RestoreSPFromFP the stack pointer will be restored using the frame
// pointer value.
if (!RestoreSPFromFP)
- RI->adjustReg(MBB, LastFrameDestroy, DL, SPReg, SPReg,
+ RI->adjustReg(MBB, LastScalarFrameDestroy, DL, SPReg, SPReg,
----------------
RamNalamothu wrote:
> I still don't understand why you need "Scalar" in the variable name. What if we're restoring a vector register first? Is it different somehow?
After this patch, _LastFrameDestroy_ name doesn't make sense anymore because the reference point instruction we picked here is neither the last instruction in the frame nor the only instruction with the _FrameDestroy_ flag and, with new name, I tried to appropriately tag the particular instruction that the existing logic here was using as a reference point instruction to move around within the _MBB_ (we could choose a different reference point instruction and achieve the same result, of course, with all the relevant changes wherever needed in the existing logic).
If the new name doesn't make sense, please feel free to suggest one.
https://github.com/llvm/llvm-project/pull/120623
More information about the llvm-commits
mailing list