[clang] [llvm] [RISCV] Xqccmp Code Generation (PR #128815)

Sam Elliott via cfe-commits cfe-commits at lists.llvm.org
Tue Feb 25 21:36:13 PST 2025


================
@@ -120,12 +144,7 @@ bool RISCVPushPopOpt::runOnMachineFunction(MachineFunction &Fn) {
 
   // If Zcmp extension is not supported, abort.
   const RISCVSubtarget *Subtarget = &Fn.getSubtarget<RISCVSubtarget>();
-  if (!Subtarget->hasStdExtZcmp())
-    return false;
-
-  // If frame pointer elimination has been disabled, abort to avoid breaking the
-  // ABI.
-  if (Fn.getTarget().Options.DisableFramePointerElim(Fn))
----------------
lenary wrote:

This was an optimisation for the pass. Before, Push/Pop instructions wouldn't have been introduced if there was a frame pointer, as I understand.

Now, Xqccmp might introduce some push/pop instructions if there's a frame pointer, which is fine but needs this check not to exist so we can actually look at the instructions we want.

Maybe I should add a check that the pop has a framedestroy flag, as some kind of check that it's part of the prolog/epilog?

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


More information about the cfe-commits mailing list