[llvm] r248475 - AMDGPU: Remove another unnecessary check from commuteInstruction

Matt Arsenault via llvm-commits llvm-commits at lists.llvm.org
Thu Sep 24 00:51:25 PDT 2015


Author: arsenm
Date: Thu Sep 24 02:51:25 2015
New Revision: 248475

URL: http://llvm.org/viewvc/llvm-project?rev=248475&view=rev
Log:
AMDGPU: Remove another unnecessary check from commuteInstruction

Modified:
    llvm/trunk/lib/Target/AMDGPU/SIInstrInfo.cpp

Modified: llvm/trunk/lib/Target/AMDGPU/SIInstrInfo.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/AMDGPU/SIInstrInfo.cpp?rev=248475&r1=248474&r2=248475&view=diff
==============================================================================
--- llvm/trunk/lib/Target/AMDGPU/SIInstrInfo.cpp (original)
+++ llvm/trunk/lib/Target/AMDGPU/SIInstrInfo.cpp Thu Sep 24 02:51:25 2015
@@ -790,17 +790,12 @@ MachineInstr *SIInstrInfo::commuteInstru
 
   int Src0Idx = AMDGPU::getNamedOperandIdx(MI->getOpcode(),
                                            AMDGPU::OpName::src0);
-  assert(Src0Idx != -1 && "Should always have src0 operand");
-
   MachineOperand &Src0 = MI->getOperand(Src0Idx);
   if (!Src0.isReg())
     return nullptr;
 
   int Src1Idx = AMDGPU::getNamedOperandIdx(MI->getOpcode(),
                                            AMDGPU::OpName::src1);
-  if (Src1Idx == -1)
-    return nullptr;
-
   MachineOperand &Src1 = MI->getOperand(Src1Idx);
 
   // Make sure it's legal to commute operands for VOP2.




More information about the llvm-commits mailing list