[PATCH] D134526: [AMDGPU] Preserve only the inactive lanes of scratch vgprs
    Matt Arsenault via Phabricator via llvm-commits 
    llvm-commits at lists.llvm.org
       
    Wed Sep 28 13:02:24 PDT 2022
    
    
  
arsenm accepted this revision.
arsenm added inline comments.
This revision is now accepted and ready to land.
================
Comment at: llvm/lib/Target/AMDGPU/SIMachineFunctionInfo.cpp:285-288
+void SIMachineFunctionInfo::splitWWMSpillRegisters(
+    MachineFunction &MF,
+    SmallVectorImpl<std::pair<Register, int>> &CalleeSavedRegs,
+    SmallVectorImpl<std::pair<Register, int>> &ScratchRegs) const {
----------------
I don't really like having to split these into two arrays like this but I don't have a better suggestion
================
Comment at: llvm/lib/Target/AMDGPU/SIMachineFunctionInfo.cpp:291
+  for (auto &Reg : WWMSpills) {
+    if (TRI->isCalleeSavedPhysReg(Reg.first, MF))
+      CalleeSavedRegs.push_back(Reg);
----------------
arsenm wrote:
> This needs to check the MRI callee saved regs, not TRI directly for dynamically changed CSRs
Actually I've seen this mistake too many times. We should probably rename the TRI version and hide it
Repository:
  rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D134526/new/
https://reviews.llvm.org/D134526
    
    
More information about the llvm-commits
mailing list