[llvm] 9dbe736 - [AMDGPU] Be more specific in needsFrameBaseReg

Stanislav Mekhanoshin via llvm-commits llvm-commits at lists.llvm.org
Fri Jan 29 14:53:26 PST 2021


Author: Stanislav Mekhanoshin
Date: 2021-01-29T14:40:25-08:00
New Revision: 9dbe736cbd2c6a0c3d62a6fd6a2cf31c9ffc9577

URL: https://github.com/llvm/llvm-project/commit/9dbe736cbd2c6a0c3d62a6fd6a2cf31c9ffc9577
DIFF: https://github.com/llvm/llvm-project/commit/9dbe736cbd2c6a0c3d62a6fd6a2cf31c9ffc9577.diff

LOG: [AMDGPU] Be more specific in needsFrameBaseReg

A condition "mayLoadOrStore" is too broad for that function.

Differential Revision: https://reviews.llvm.org/D95700

Added: 
    

Modified: 
    llvm/lib/Target/AMDGPU/SIRegisterInfo.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/lib/Target/AMDGPU/SIRegisterInfo.cpp b/llvm/lib/Target/AMDGPU/SIRegisterInfo.cpp
index 7a45d8c54f9a..44d23ebc4f36 100644
--- a/llvm/lib/Target/AMDGPU/SIRegisterInfo.cpp
+++ b/llvm/lib/Target/AMDGPU/SIRegisterInfo.cpp
@@ -408,7 +408,7 @@ int64_t SIRegisterInfo::getFrameIndexInstrOffset(const MachineInstr *MI,
 }
 
 bool SIRegisterInfo::needsFrameBaseReg(MachineInstr *MI, int64_t Offset) const {
-  if (!MI->mayLoadOrStore())
+  if (!SIInstrInfo::isMUBUF(*MI) && !SIInstrInfo::isFLATScratch(*MI))
     return false;
 
   int64_t FullOffset = Offset + getScratchInstrOffset(MI);


        


More information about the llvm-commits mailing list