[llvm] r346528 - [AMDGPU] Always pass TRI into findRegister[Use/Def]OperandIdx
Stanislav Mekhanoshin via llvm-commits
llvm-commits at lists.llvm.org
Fri Nov 9 09:58:59 PST 2018
Author: rampitec
Date: Fri Nov 9 09:58:59 2018
New Revision: 346528
URL: http://llvm.org/viewvc/llvm-project?rev=346528&view=rev
Log:
[AMDGPU] Always pass TRI into findRegister[Use/Def]OperandIdx
This only covers AMDGPU BE, hopefully all occurrences.
Differential Revision: https://reviews.llvm.org/D54235
Modified:
llvm/trunk/lib/Target/AMDGPU/AMDGPUMacroFusion.cpp
llvm/trunk/lib/Target/AMDGPU/R600EmitClauseMarkers.cpp
llvm/trunk/lib/Target/AMDGPU/R600InstrInfo.cpp
llvm/trunk/lib/Target/AMDGPU/SIInstrInfo.cpp
Modified: llvm/trunk/lib/Target/AMDGPU/AMDGPUMacroFusion.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/AMDGPU/AMDGPUMacroFusion.cpp?rev=346528&r1=346527&r2=346528&view=diff
==============================================================================
--- llvm/trunk/lib/Target/AMDGPU/AMDGPUMacroFusion.cpp (original)
+++ llvm/trunk/lib/Target/AMDGPU/AMDGPUMacroFusion.cpp Fri Nov 9 09:58:59 2018
@@ -42,9 +42,12 @@ static bool shouldScheduleAdjacent(const
if (!FirstMI)
return true;
+ const MachineBasicBlock &MBB = *FirstMI->getParent();
+ const MachineRegisterInfo &MRI = MBB.getParent()->getRegInfo();
+ const TargetRegisterInfo *TRI = MRI.getTargetRegisterInfo();
const MachineOperand *Src2 = TII.getNamedOperand(SecondMI,
AMDGPU::OpName::src2);
- return FirstMI->definesRegister(Src2->getReg());
+ return FirstMI->definesRegister(Src2->getReg(), TRI);
}
default:
return false;
Modified: llvm/trunk/lib/Target/AMDGPU/R600EmitClauseMarkers.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/AMDGPU/R600EmitClauseMarkers.cpp?rev=346528&r1=346527&r2=346528&view=diff
==============================================================================
--- llvm/trunk/lib/Target/AMDGPU/R600EmitClauseMarkers.cpp (original)
+++ llvm/trunk/lib/Target/AMDGPU/R600EmitClauseMarkers.cpp Fri Nov 9 09:58:59 2018
@@ -226,11 +226,11 @@ private:
// occur in the same basic block as its definition, because
// it is illegal for the scheduler to schedule them in
// different blocks.
- if (UseI->readsRegister(MOI->getReg()))
+ if (UseI->readsRegister(MOI->getReg(), &TRI))
LastUseCount = AluInstCount;
// Exit early if the current use kills the register
- if (UseI != Def && UseI->killsRegister(MOI->getReg()))
+ if (UseI != Def && UseI->killsRegister(MOI->getReg(), &TRI))
break;
}
if (LastUseCount)
Modified: llvm/trunk/lib/Target/AMDGPU/R600InstrInfo.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/AMDGPU/R600InstrInfo.cpp?rev=346528&r1=346527&r2=346528&view=diff
==============================================================================
--- llvm/trunk/lib/Target/AMDGPU/R600InstrInfo.cpp (original)
+++ llvm/trunk/lib/Target/AMDGPU/R600InstrInfo.cpp Fri Nov 9 09:58:59 2018
@@ -229,11 +229,11 @@ bool R600InstrInfo::mustBeLastInClause(u
}
bool R600InstrInfo::usesAddressRegister(MachineInstr &MI) const {
- return MI.findRegisterUseOperandIdx(R600::AR_X) != -1;
+ return MI.findRegisterUseOperandIdx(R600::AR_X, false, &RI) != -1;
}
bool R600InstrInfo::definesAddressRegister(MachineInstr &MI) const {
- return MI.findRegisterDefOperandIdx(R600::AR_X) != -1;
+ return MI.findRegisterDefOperandIdx(R600::AR_X, false, false, &RI) != -1;
}
bool R600InstrInfo::readsLDSSrcReg(const MachineInstr &MI) const {
Modified: llvm/trunk/lib/Target/AMDGPU/SIInstrInfo.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/AMDGPU/SIInstrInfo.cpp?rev=346528&r1=346527&r2=346528&view=diff
==============================================================================
--- llvm/trunk/lib/Target/AMDGPU/SIInstrInfo.cpp (original)
+++ llvm/trunk/lib/Target/AMDGPU/SIInstrInfo.cpp Fri Nov 9 09:58:59 2018
@@ -4934,10 +4934,10 @@ void SIInstrInfo::addSCCDefUsersToVALUWo
make_range(MachineBasicBlock::iterator(SCCDefInst),
SCCDefInst.getParent()->end())) {
// Exit if we find another SCC def.
- if (MI.findRegisterDefOperandIdx(AMDGPU::SCC) != -1)
+ if (MI.findRegisterDefOperandIdx(AMDGPU::SCC, false, false, &RI) != -1)
return;
- if (MI.findRegisterUseOperandIdx(AMDGPU::SCC) != -1)
+ if (MI.findRegisterUseOperandIdx(AMDGPU::SCC, false, &RI) != -1)
Worklist.insert(&MI);
}
}
More information about the llvm-commits
mailing list