[PATCH] D91110: [AMDGPU] Remove scratch rsrc from spill pseudos

Stanislav Mekhanoshin via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Nov 10 09:46:37 PST 2020


rampitec added inline comments.


================
Comment at: llvm/lib/Target/AMDGPU/SIInstrInfo.cpp:1391-1393
+    if (Register ScratchRSrcReg = MFI->getScratchRSrcReg()) {
+      MIB.addReg(ScratchRSrcReg, RegState::Implicit);
+    }
----------------
arsenm wrote:
> I don't see why this would be conditional, or why this would need to be added
It is conditional because I do not want to add "implicit $noreg" in case of flat scratch.
It is needed because SIFrameLowering::getEntryFunctionReservedScratchRsrcReg() does that:


```
  if (!ScratchRsrcReg || !MRI.isPhysRegUsed(ScratchRsrcReg))
    return Register();
```

I.e. if register is unused it will not be initialized.


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

https://reviews.llvm.org/D91110



More information about the llvm-commits mailing list