AMDGPU: Remove another unnecessary check from commuteInstruction
[oota-llvm.git] / lib / Target / AMDGPU / SIInstrInfo.cpp
index e2b6d3c14037751e5ebf2f657e03a71c79868dfb..f021e0fd4fed2d6161af36ee15f8b7ba42a946e4 100644 (file)
@@ -790,17 +790,12 @@ MachineInstr *SIInstrInfo::commuteInstruction(MachineInstr *MI,
 
   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.