From fda531820484369b48e657abbbeaa969d4a94002 Mon Sep 17 00:00:00 2001 From: Matt Arsenault Date: Mon, 10 Jul 2017 19:33:38 +0000 Subject: [PATCH] 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 --- llvm/lib/Target/AMDGPU/SIShrinkInstructions.cpp | 5 ----- 1 file changed, 5 deletions(-) diff --git a/llvm/lib/Target/AMDGPU/SIShrinkInstructions.cpp b/llvm/lib/Target/AMDGPU/SIShrinkInstructions.cpp index 6bff2c5fb79e..327e745dee11 100644 --- a/llvm/lib/Target/AMDGPU/SIShrinkInstructions.cpp +++ b/llvm/lib/Target/AMDGPU/SIShrinkInstructions.cpp @@ -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())) {