[llvm] [AMDGPU] Initialize FrameOffsetReg for amdgpu_cs_chain functions (PR #165518)

via llvm-commits llvm-commits at lists.llvm.org
Mon Nov 17 07:20:20 PST 2025


================
@@ -2170,13 +2171,13 @@ bool SIFrameLowering::hasFPImpl(const MachineFunction &MF) const {
     return MFI.getStackSize() != 0;
   }
 
-  return (frameTriviallyRequiresSP(MFI) &&
-          !MF.getInfo<SIMachineFunctionInfo>()->isChainFunction()) ||
-         MFI.isFrameAddressTaken() ||
-         MF.getSubtarget<GCNSubtarget>().getRegisterInfo()->hasStackRealignment(
-             MF) ||
-         mayReserveScratchForCWSR(MF) ||
-         MF.getTarget().Options.DisableFramePointerElim(MF);
+  return !MF.getInfo<SIMachineFunctionInfo>()->isChainFunction() &&
+         (frameTriviallyRequiresSP(MFI) || MFI.isFrameAddressTaken() ||
+          MF.getSubtarget<GCNSubtarget>()
+              .getRegisterInfo()
+              ->hasStackRealignment(MF) ||
+          mayReserveScratchForCWSR(MF) ||
+          MF.getTarget().Options.DisableFramePointerElim(MF));
----------------
jofrn wrote:

Alright, will add a test for frameaddress. I will take CWSR into consideration...

You may work on it if you'd like as well.

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


More information about the llvm-commits mailing list