[llvm] [RISCV] Support Push/Pop with Xqci (PR #134191)

Sam Elliott via llvm-commits llvm-commits at lists.llvm.org
Wed Apr 2 22:26:26 PDT 2025


================
@@ -1868,10 +1893,13 @@ bool RISCVFrameLowering::assignCalleeSavedSpillSlots(
   auto *RVFI = MF.getInfo<RISCVMachineFunctionInfo>();
   if (RVFI->useQCIInterrupt(MF)) {
     RVFI->setQCIInterruptStackSize(QCIInterruptPushAmount);
-  } else if (RVFI->isPushable(MF)) {
+  }
+
+  if (RVFI->isPushable(MF)) {
     // Determine how many GPRs we need to push and save it to RVFI.
     unsigned PushedRegNum = getNumPushPopRegs(CSI);
-    if (PushedRegNum) {
+    unsigned PushMoreThan = RVFI->useQCIInterrupt(MF) ? 2 : 0;
----------------
lenary wrote:

This probably needs more comments. If we have qci interrupts, then `ra` and `s0` are already pushed by `qc.c.mienter`, so we only need to push if we need to save `s1`-`s12`.

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


More information about the llvm-commits mailing list