[llvm] [llvm] Consistently respect `naked` fn attribute in `TargetFrameLowering::hasFP()` (PR #106014)

Alex Rønne Petersen via llvm-commits llvm-commits at lists.llvm.org
Fri Oct 25 10:33:59 PDT 2024


================
@@ -1449,7 +1449,12 @@ void SystemZXPLINKFrameLowering::inlineStackProbe(
   fullyRecomputeLiveIns({StackExtMBB, NextMBB});
 }
 
-bool SystemZXPLINKFrameLowering::hasFP(const MachineFunction &MF) const {
+bool SystemZXPLINKFrameLowering::hasFPImpl(const MachineFunction &MF) const {
+  // Naked functions have no stack frame pushed, so we don't have a frame
+  // pointer.
+  if (MF.getFunction().hasFnAttribute(Attribute::Naked))
+    return false;
+
----------------
alexrp wrote:

Ah, yeah, looks like a leftover from an earlier version of the patch. I guess I missed it because there are two implementations of `hasFPImpl()` in this file.

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


More information about the llvm-commits mailing list