Minor speed tweak.
authorEvan Cheng <evan.cheng@apple.com>
Wed, 25 Apr 2007 07:24:13 +0000 (07:24 +0000)
committerEvan Cheng <evan.cheng@apple.com>
Wed, 25 Apr 2007 07:24:13 +0000 (07:24 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36432 91177308-0d34-0410-b5e6-96231b3b80d8

include/llvm/CodeGen/MachineInstr.h

index f6eaac07581bbeb55f28621b2c4cafe792665aa9..4f252673e776f88a9bad386615f1b8c218716fc9 100644 (file)
@@ -517,13 +517,12 @@ private:
   MachineOperand &AddNewOperand(bool IsImp = false) {
     assert((IsImp || !OperandsComplete()) &&
            "Trying to add an operand to a machine instr that is already done!");
-    if (NumImplicitOps == 0) { // This is true most of the time.
+    if (IsImp || NumImplicitOps == 0) { // This is true most of the time.
       Operands.push_back(MachineOperand());
       return Operands.back();
-    } else {
-      return *Operands.insert(Operands.begin()+Operands.size()-NumImplicitOps,
-                              MachineOperand());
     }
+    return *Operands.insert(Operands.begin()+Operands.size()-NumImplicitOps,
+                            MachineOperand());
   }
 
   /// addImplicitDefUseOperands - Add all implicit def and use operands to