[PATCH] D126861: [RISCV] Fix missing stack pointer recover

Roger Ferrer Ibanez via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jun 8 23:13:06 PDT 2022


rogfer01 added inline comments.


================
Comment at: llvm/lib/Target/RISCV/RISCVFrameLowering.cpp:648
+  if (RI->hasStackRealignment(MF) || MFI.hasVarSizedObjects() ||
+      !hasReservedCallFrame(MF)) {
     assert(hasFP(MF) && "frame pointer should not have been eliminated");
----------------
rogfer01 wrote:
> I assume that the exceptional path doesn't execute the `add sp, sp, 32` after `call _Z3fooiiiiiiiiiiPi at plt`, instead we directly land to `.LBB0_2: # %lpad`. If this is th case, it does leaves the stack unaligned.
> 
> However, the expansion of `!hasReservedCallFrame(MF)` results in checking `hasFP(MF) && hasRVVFrameObject(MF)`.
> 
> Isn't this an issue that happens irrespective of vectors and it is caused by having a `fp`? E.g. when using something like `-fno-omit-frame-pointer`.
Answering myself here: when not using `v` then we account the callee arguments as part of the caller stack frame.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D126861/new/

https://reviews.llvm.org/D126861



More information about the llvm-commits mailing list