Revert "Make NumMicroOps a variable in the subtarget's instruction itinerary."
[oota-llvm.git] / lib / Target / ARM / ARMBaseInstrInfo.cpp
index b3fef2909316aaa0bf9e9029e037ad59edd06dce..3a180dfa2793041a2a36e0c5a84f5fac314a58f7 100644 (file)
@@ -2176,9 +2176,9 @@ ARMBaseInstrInfo::getNumMicroOps(const InstrItineraryData *ItinData,
 
   const MCInstrDesc &Desc = MI->getDesc();
   unsigned Class = Desc.getSchedClass();
-  int ItinUOps = ItinData->Itineraries[Class].NumMicroOps;
-  if (ItinUOps >= 0)
-    return ItinUOps;
+  unsigned UOps = ItinData->Itineraries[Class].NumMicroOps;
+  if (UOps)
+    return UOps;
 
   unsigned Opc = MI->getOpcode();
   switch (Opc) {
@@ -2252,19 +2252,19 @@ ARMBaseInstrInfo::getNumMicroOps(const InstrItineraryData *ItinData,
         return 2;
       // 4 registers would be issued: 2, 2.
       // 5 registers would be issued: 2, 2, 1.
-      int A8UOps = (NumRegs / 2);
+      UOps = (NumRegs / 2);
       if (NumRegs % 2)
-        ++A8UOps;
-      return A8UOps;
+        ++UOps;
+      return UOps;
     } else if (Subtarget.isCortexA9()) {
-      int A9UOps = (NumRegs / 2);
+      UOps = (NumRegs / 2);
       // If there are odd number of registers or if it's not 64-bit aligned,
       // then it takes an extra AGU (Address Generation Unit) cycle.
       if ((NumRegs % 2) ||
           !MI->hasOneMemOperand() ||
           (*MI->memoperands_begin())->getAlignment() < 8)
-        ++A9UOps;
-      return A9UOps;
+        ++UOps;
+      return UOps;
     } else {
       // Assume the worst.
       return NumRegs;