Remove some redundant checks, add a couple of new ones. This allows us to
[oota-llvm.git] / lib / Target / TargetSchedInfo.cpp
index 4d2b5ed9f9ce343ac4be240cf1da0aaac8329860..b2f66dbdee1864f48c46aee5b155784074893f56 100644 (file)
@@ -61,22 +61,22 @@ RUConflict(const std::vector<resourceId_t>& fromRVec,
 }
 
 
-static cycles_t
+static CycleCount_t
 ComputeMinGap(const InstrRUsage &fromRU, 
              const InstrRUsage &toRU)
 {
-  cycles_t minGap = 0;
+  CycleCount_t minGap = 0;
   
   if (fromRU.numBubbles > 0)
     minGap = fromRU.numBubbles;
   
   if (minGap < fromRU.numCycles) {
     // only need to check from cycle `minGap' onwards
-    for (cycles_t gap=minGap; gap <= fromRU.numCycles-1; gap++) {
+    for (CycleCount_t gap=minGap; gap <= fromRU.numCycles-1; gap++) {
       // check if instr. #2 can start executing `gap' cycles after #1
       // by checking for resource conflicts in each overlapping cycle
-      cycles_t numOverlap =std::min(fromRU.numCycles - gap, toRU.numCycles);
-      for (cycles_t c = 0; c <= numOverlap-1; c++)
+      CycleCount_t numOverlap =std::min(fromRU.numCycles - gap, toRU.numCycles);
+      for (CycleCount_t c = 0; c <= numOverlap-1; c++)
         if (RUConflict(fromRU.resourcesByCycle[gap + c],
                        toRU.resourcesByCycle[c])) {
           // conflict found so minGap must be more than `gap'
@@ -170,9 +170,6 @@ TargetSchedInfo::computeIssueGaps(const std::vector<InstrRUsage>&
   issueGaps.resize(numOpCodes);
   conflictLists.resize(numOpCodes);
 
-  assert(numOpCodes < (1 << MAX_OPCODE_SIZE) - 1
-         && "numOpCodes invalid for implementation of class OpCodePair!");
-
   // First, compute issue gaps between pairs of classes based on common
   // resources usages for each class, because most instruction pairs will
   // usually behave the same as their class.