Skip to content

Commit daed12d

Browse files
authored
AMDGPU: Remove unnecessary AGPR legalize logic (#159491)
The manual legalizeOperands code only need to consider cases that require full instruction context to know if the operand is legal. This does not need to handle basic operand register class constraints.
1 parent 54677d6 commit daed12d

File tree

1 file changed

+0
-13
lines changed

1 file changed

+0
-13
lines changed

llvm/lib/Target/AMDGPU/SIInstrInfo.cpp

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -6371,13 +6371,6 @@ void SIInstrInfo::legalizeOperandsVOP2(MachineRegisterInfo &MRI,
63716371
return;
63726372
}
63736373

6374-
// No VOP2 instructions support AGPRs.
6375-
if (Src0.isReg() && RI.isAGPR(MRI, Src0.getReg()))
6376-
legalizeOpWithMove(MI, Src0Idx);
6377-
6378-
if (Src1.isReg() && RI.isAGPR(MRI, Src1.getReg()))
6379-
legalizeOpWithMove(MI, Src1Idx);
6380-
63816374
// Special case: V_FMAC_F32 and V_FMAC_F16 have src2.
63826375
if (Opc == AMDGPU::V_FMAC_F32_e32 || Opc == AMDGPU::V_FMAC_F16_e32) {
63836376
int Src2Idx = AMDGPU::getNamedOperandIdx(Opc, AMDGPU::OpName::src2);
@@ -6518,12 +6511,6 @@ void SIInstrInfo::legalizeOperandsVOP3(MachineRegisterInfo &MRI,
65186511
continue;
65196512
}
65206513

6521-
if (RI.hasAGPRs(RI.getRegClassForReg(MRI, MO.getReg())) &&
6522-
!isOperandLegal(MI, Idx, &MO)) {
6523-
legalizeOpWithMove(MI, Idx);
6524-
continue;
6525-
}
6526-
65276514
if (!RI.isSGPRClass(RI.getRegClassForReg(MRI, MO.getReg())))
65286515
continue; // VGPRs are legal
65296516

0 commit comments

Comments
 (0)