[llvm] r307574 - AMDGPU: Remove unnecessary check for constant operands
Matt Arsenault via llvm-commits
llvm-commits at lists.llvm.org
Mon Jul 10 12:33:38 PDT 2017
Author: arsenm
Date: Mon Jul 10 12:33:38 2017
New Revision: 307574
URL: http://llvm.org/viewvc/llvm-project?rev=307574&view=rev
Log:
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.
Modified:
llvm/trunk/lib/Target/AMDGPU/SIShrinkInstructions.cpp
Modified: llvm/trunk/lib/Target/AMDGPU/SIShrinkInstructions.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/AMDGPU/SIShrinkInstructions.cpp?rev=307574&r1=307573&r2=307574&view=diff
==============================================================================
--- llvm/trunk/lib/Target/AMDGPU/SIShrinkInstructions.cpp (original)
+++ llvm/trunk/lib/Target/AMDGPU/SIShrinkInstructions.cpp Mon Jul 10 12:33:38 2017
@@ -138,11 +138,6 @@ static void foldImmediates(MachineInstr
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())) {
More information about the llvm-commits
mailing list