[llvm] [RISCV] Mark SiFive CLIC epilogue instructions as frame-destroy (PR #218338)

Zeyi Xu via llvm-commits llvm-commits at lists.llvm.org
Mon Aug 24 00:54:48 PDT 2026


================
@@ -1002,7 +1003,7 @@ void RISCVFrameLowering::emitPrologue(MachineFunction &MF,
     return;
 
   // SiFive CLIC needs to swap `sp` into `sf.mscratchcsw`
-  emitSiFiveCLICStackSwap(MF, MBB, MBBI, DL);
+  emitSiFiveCLICStackSwap(MF, MBB, MBBI, DL, MachineInstr::FrameSetup);
----------------
zeyi2 wrote:

The stack-swap instruction establishes the interrupt stack in the prologue but restores the interrupted stack in the epilogue, so its frame flag needs to be selected by the caller.

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


More information about the llvm-commits mailing list