AMDGPU: Remove unnecessary check for constant operands

An instruction that has an immediate operand can't reach
this point. This is only called for a freshly shrunk instruction,
which prevously couldn't have had a literal constant operand.
This was also not conservative enough since it woudl also have
had to filter other constant-like inputs like frame indexes.

llvm-svn: 307574
This commit is contained in:
Matt Arsenault 2017-07-10 19:33:38 +00:00
parent a46241909a
commit fda5318204
1 changed files with 0 additions and 5 deletions

View File

@ -138,11 +138,6 @@ static void foldImmediates(MachineInstr &MI, const SIInstrInfo *TII,
int Src0Idx = AMDGPU::getNamedOperandIdx(MI.getOpcode(), AMDGPU::OpName::src0);
// Only one literal constant is allowed per instruction, so if src0 is a
// literal constant then we can't do any folding.
if (TII->isLiteralConstant(MI, Src0Idx))
return;
// Try to fold Src0
MachineOperand &Src0 = MI.getOperand(Src0Idx);
if (Src0.isReg() && MRI.hasOneUse(Src0.getReg())) {