Skip to content

Commit 4995fb6

Browse files
arsenmeasyonaadit
authored andcommitted
AMDGPU: Permit more frame index operands in verifier (llvm#101691)
Treat FI operands more like a register. When it gets materialized, we will typically need to introduce a scavenged register anyway. Add baseline tests for folding frame indexes into add/or.
1 parent a10c2ea commit 4995fb6

File tree

5 files changed

+2126
-2
lines changed

5 files changed

+2126
-2
lines changed

llvm/lib/Target/AMDGPU/SIInstrInfo.cpp

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4665,6 +4665,10 @@ static bool shouldReadExec(const MachineInstr &MI) {
46654665
return true;
46664666
}
46674667

4668+
static bool isRegOrFI(const MachineOperand &MO) {
4669+
return MO.isReg() || MO.isFI();
4670+
}
4671+
46684672
static bool isSubRegOf(const SIRegisterInfo &TRI,
46694673
const MachineOperand &SuperVec,
46704674
const MachineOperand &SubReg) {
@@ -4999,7 +5003,7 @@ bool SIInstrInfo::verifyInstruction(const MachineInstr &MI,
49995003
++ConstantBusCount;
50005004
SGPRsUsed.push_back(SGPRUsed);
50015005
}
5002-
} else {
5006+
} else if (!MO.isFI()) { // Treat FI like a register.
50035007
if (!UsesLiteral) {
50045008
++ConstantBusCount;
50055009
UsesLiteral = true;
@@ -5092,7 +5096,7 @@ bool SIInstrInfo::verifyInstruction(const MachineInstr &MI,
50925096
const MachineOperand &Src0 = MI.getOperand(Src0Idx);
50935097
const MachineOperand &Src1 = MI.getOperand(Src1Idx);
50945098

5095-
if (!Src0.isReg() && !Src1.isReg() &&
5099+
if (!isRegOrFI(Src0) && !isRegOrFI(Src1) &&
50965100
!isInlineConstant(Src0, Desc.operands()[Src0Idx]) &&
50975101
!isInlineConstant(Src1, Desc.operands()[Src1Idx]) &&
50985102
!Src0.isIdenticalTo(Src1)) {

0 commit comments

Comments
 (0)