[AMDGPU] Be more specific in needsFrameBaseReg
authorStanislav Mekhanoshin <Stanislav.Mekhanoshin@amd.com>
Fri, 29 Jan 2021 22:38:29 +0000 (14:38 -0800)
committerStanislav Mekhanoshin <Stanislav.Mekhanoshin@amd.com>
Fri, 29 Jan 2021 22:40:25 +0000 (14:40 -0800)
A condition "mayLoadOrStore" is too broad for that function.

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

llvm/lib/Target/AMDGPU/SIRegisterInfo.cpp

index 7a45d8c..44d23eb 100644 (file)
@@ -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);