[PATCH] D150416: [RISCV] Add a pass to combine `cm.pop` and `ret` insts

Jessica Clarke via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue May 30 16:09:39 PDT 2023


jrtc27 added inline comments.


================
Comment at: llvm/lib/Target/RISCV/RISCVPushPopOptimizer.cpp:140
+  // If frame pointer elimination has been disabled,
+  // abort to avoid breaking the ABI.
+  if (Fn.getTarget().Options.DisableFramePointerElim(Fn)) {
----------------
craig.topper wrote:
> jrtc27 wrote:
> > craig.topper wrote:
> > > craig.topper wrote:
> > > > How does it break the ABI?
> > > This question was not answered.
> > https://github.com/riscv/riscv-code-size-reduction/issues/194 and https://github.com/riscv-non-isa/riscv-elf-psabi-doc/issues/18#issuecomment-1304496707 onwards
> As far as I can tell, this patch just fuses the cm.pop with ret. Wouldn't the ABI break occur at the creation of cm.pop not at the formation of cm.popret?
Yes, using cm.push/pop is the issue, not fusing ones that already exist. Haven't looked at the content of the patch other than the few lines of context here.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D150416



More information about the llvm-commits mailing list