[PATCH] D96869: [AMDGPU] Fix saving fp and bp

Matt Arsenault via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Feb 17 11:35:54 PST 2021


arsenm added a comment.

Should comment why the register isn't considered killed



================
Comment at: llvm/lib/Target/AMDGPU/SIFrameLowering.cpp:882
+    // Reserve temporary stack slot
+    if (!FuncInfo->SpillSGPRTmpIndex.hasValue()) {
+      assert(IsProlog && "Frame index should have been reserved in the prolog");
----------------
Don't need hasValue


================
Comment at: llvm/lib/Target/AMDGPU/SIFrameLowering.cpp:894
+                     FuncInfo->getScratchRSrcReg(), StackPtrReg,
+                     FuncInfo->SpillSGPRTmpIndex.getValue(), false);
+  }
----------------
* instead of getValue


================
Comment at: llvm/lib/Target/AMDGPU/SIFrameLowering.cpp:981
+    buildSpillLoadStore(LiveRegs, FuncInfo, ST, TII, MFI, MRI, MF, MBB, MBBI,
+                        true, StackPtrReg, ScratchExecCopy, TmpVGPR,
+                        FramePtrReg,
----------------
Comment the isKill


================
Comment at: llvm/lib/Target/AMDGPU/SIFrameLowering.cpp:997
+                      FuncInfo->SpillSGPRTmpIndex.getValue());
+    // If TmpVGPR is set, ScratchExecCopy must also be set. We add an imlicit
+    // use and kill to the exec restore below, so this reload cannot get
----------------
Typo imlicit


================
Comment at: llvm/lib/Target/AMDGPU/SIFrameLowering.cpp:1210
+      buildSpillLoadStore(LiveRegs, FuncInfo, ST, TII, MFI, MRI, MF, MBB, MBBI,
+                          false, StackPtrReg, ScratchExecCopy, TmpVGPR,
+                          FramePtrReg, FI);
----------------
Comment isKill


================
Comment at: llvm/lib/Target/AMDGPU/SIFrameLowering.cpp:1225
   if (HasBPSaveIndex) {
-    const int BasePtrFI = *FuncInfo->BasePointerSaveIndex;
-    assert(!MFI.isDeadObjectIndex(BasePtrFI));
+    const int FI = FuncInfo->BasePointerSaveIndex.getValue();
+    assert(!MFI.isDeadObjectIndex(FI));
----------------
* instead of getValue


================
Comment at: llvm/lib/Target/AMDGPU/SIFrameLowering.cpp:1261
+                      FuncInfo->SpillSGPRTmpIndex.getValue());
+    // If TmpVGPR is set, ScratchExecCopy must also be set. We add an imlicit
+    // use and kill to the exec restore below, so this reload cannot get
----------------
Typo imlicit


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D96869



More information about the llvm-commits mailing list