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

Craig Topper via llvm-commits llvm-commits at lists.llvm.org
Tue Mar 26 20:43:01 PDT 2024


================
@@ -554,8 +554,10 @@ void RISCVFrameLowering::emitPrologue(MachineFunction &MF,
   if (RVFI->isPushable(MF) && FirstFrameSetup != MBB.end() &&
       FirstFrameSetup->getOpcode() == RISCV::CM_PUSH) {
     // Use available stack adjustment in push instruction to allocate additional
-    // stack space.
-    uint64_t Spimm = std::min(StackSize, (uint64_t)48);
+    // stack space. Align the stack size down to a multiple of 16. This is
+    // needed for RVE.
----------------
topperc wrote:

RVE stack alignment is XLen-bytes not 16-bytes

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


More information about the llvm-commits mailing list