Fix a case where we incorrectly returned hasComputableLoopEvolution for
[oota-llvm.git] / include / llvm / Target / TargetSchedInfo.h
index f2a3560496cd1239690380858fa94d328d21c973..bd2f828e4debe86159179bf6d021a37a02614811 100644 (file)
 
 namespace llvm {
 
-typedef long long cycles_t; 
-static const cycles_t HUGE_LATENCY = ~((long long) 1 << (sizeof(cycles_t)-2));
-static const cycles_t INVALID_LATENCY = -HUGE_LATENCY; 
-static const unsigned MAX_OPCODE_SIZE = 16;
-
-class OpCodePair {
-public:
-  long val;                    // make long by concatenating two opcodes
-  OpCodePair(MachineOpCode op1, MachineOpCode op2)
-    : val((op1 < 0 || op2 < 0)?
-       -1 : (long)((((unsigned) op1) << MAX_OPCODE_SIZE) | (unsigned) op2)) {}
-  bool operator==(const OpCodePair& op) const {
-    return val == op.val;
-  }
-private:
-  OpCodePair();                        // disable for now
-};
-
-} // End llvm namespace
-
-namespace HASH_NAMESPACE {
-  template <> struct hash<llvm::OpCodePair> {
-    size_t operator()(const llvm::OpCodePair& pair) const {
-      return hash<long>()(pair.val);
-    }
-  };
-} // End HASH_NAMESPACE (a macro) namespace
-
-namespace llvm {
+typedef long long CycleCount_t; 
+static const CycleCount_t HUGE_LATENCY = ~((long long) 1 << (sizeof(CycleCount_t)-2));
+static const CycleCount_t INVALID_LATENCY = -HUGE_LATENCY; 
 
 //---------------------------------------------------------------------------
 // class MachineResource 
@@ -104,7 +78,7 @@ struct InstrClassRUsage {
   unsigned      maxNumIssue;
   bool         isSingleIssue;
   bool         breaksGroup;
-  cycles_t      numBubbles;
+  CycleCount_t      numBubbles;
   
   // Feasible slots to use for instructions in this class.
   // The size of vector S[] is `numSlots'.
@@ -135,7 +109,7 @@ struct InstrIssueDelta {
   MachineOpCode        opCode;
   bool         isSingleIssue;
   bool         breaksGroup;
-  cycles_t     numBubbles;
+  CycleCount_t numBubbles;
 };
 
 
@@ -145,13 +119,13 @@ struct InstrRUsage {
   // Issue restrictions for this instruction
   bool         isSingleIssue;
   bool         breaksGroup;
-  cycles_t     numBubbles;
+  CycleCount_t numBubbles;
   
   // Feasible slots to use for this instruction.
   std::vector<bool> feasibleSlots;
   
   // Resource usages for this instruction, with one resource vector per cycle.
-  cycles_t     numCycles;
+  CycleCount_t numCycles;
   std::vector<std::vector<resourceId_t> > resourcesByCycle;
   
 private:
@@ -178,7 +152,8 @@ private:
 /// TargetSchedInfo - Common interface to machine information for 
 /// instruction scheduling
 ///
-struct TargetSchedInfo {
+class TargetSchedInfo {
+public:
   const TargetMachine& target;
   
   unsigned maxNumIssueTotal;