Reapply "Make NumMicroOps a variable in the subtarget's instruction itinerary."

Reapplies r159406 with minor cleanup. The regressions appear to have been spurious.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@159541 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/CodeGen/TargetInstrInfoImpl.cpp b/lib/CodeGen/TargetInstrInfoImpl.cpp
index 7af08f5..54be88a 100644
--- a/lib/CodeGen/TargetInstrInfoImpl.cpp
+++ b/lib/CodeGen/TargetInstrInfoImpl.cpp
@@ -560,8 +560,8 @@
     return 1;
 
   unsigned Class = MI->getDesc().getSchedClass();
-  unsigned UOps = ItinData->Itineraries[Class].NumMicroOps;
-  if (UOps)
+  int UOps = ItinData->Itineraries[Class].NumMicroOps;
+  if (UOps >= 0)
     return UOps;
 
   // The # of u-ops is dynamically determined. The specific target should