[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:49 PDT 2026


================
@@ -344,7 +345,7 @@ static void emitSiFiveCLICPreemptibleRestores(MachineFunction &MF,
       .addReg(RISCV::X0, RegState::Define)
       .addImm(RISCVSysReg::mstatus)
       .addImm(8)
-      .setMIFlag(MachineInstr::FrameSetup);
+      .setMIFlag(MachineInstr::FrameDestroy);
----------------
zeyi2 wrote:

>From https://llvm.org/doxygen/MachineInstr_8h_source.html#l00093:
```
FrameDestroy = 1 << 1, // Instruction is used as a part of
                       // function frame destruction code.
```

This instruction begins the interrupt epilogue. Together with the following operations, it disables nested interrupts. Therefore, IMO these instructions should be marked `FrameDestroy` rather than `FrameSetup`.


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


More information about the llvm-commits mailing list