From: Matt Arsenault Date: Mon, 10 Jul 2017 19:33:38 +0000 (+0000) Subject: AMDGPU: Remove unnecessary check for constant operands X-Git-Tag: android-x86-7.1-r4~13757 X-Git-Url: http://git.osdn.net/view?a=commitdiff_plain;h=723196608916531f9a61e834f649f083964bb83f;p=android-x86%2Fexternal-llvm.git 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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@307574 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Target/AMDGPU/SIShrinkInstructions.cpp b/lib/Target/AMDGPU/SIShrinkInstructions.cpp index 6bff2c5fb79..327e745dee1 100644 --- a/lib/Target/AMDGPU/SIShrinkInstructions.cpp +++ b/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())) {