[llvm] [RISCV] Align stack size down to a multiple of 16 before using cm.push/pop. (PR #86073)

Wang Pengcheng via llvm-commits llvm-commits at lists.llvm.org
Tue Mar 26 20:22:59 PDT 2024


================
@@ -776,8 +778,10 @@ void RISCVFrameLowering::emitEpilogue(MachineFunction &MF,
   if (RVFI->isPushable(MF) && MBBI != MBB.end() &&
       MBBI->getOpcode() == RISCV::CM_POP) {
     // Use available stack adjustment in pop instruction to deallocate stack
-    // space.
-    uint64_t Spimm = std::min(StackSize, (uint64_t)48);
+    // space. Align the stack size down to a multiple of 16. This is needed for
+    // RVE.
+    // FIXME: Can we increase the stack size to a multiple of 16 insead?
----------------
wangpc-pp wrote:

ditto.

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


More information about the llvm-commits mailing list