]> granicus.if.org Git - llvm/commitdiff
added a function and a member to the TargetSchedInfo class
authorGuochun Shi <gshi1@uiuc.edu>
Mon, 7 Apr 2003 00:00:36 +0000 (00:00 +0000)
committerGuochun Shi <gshi1@uiuc.edu>
Mon, 7 Apr 2003 00:00:36 +0000 (00:00 +0000)
which is used  by Modulo Scheduling pass

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@5766 91177308-0d34-0410-b5e6-96231b3b80d8

include/llvm/Target/TargetSchedInfo.h

index c1375655564d5d8cc75f3e3365ab8f5774d0fcc0..22d8045ae58be65728becbfdb676c9d1b1997f42 100644 (file)
@@ -267,6 +267,15 @@ public:
     return getInstrRUsage(opCode).numBubbles;
   }
   
+  inline unsigned getCPUResourceNum(int rd)const{
+    for(unsigned i=0;i<resourceNumVector.size();i++){
+      if(resourceNumVector[i].first == rd) return resourceNumVector[i].second;
+    }
+    assert( 0&&"resource not found");
+    return 0;
+  }
+  
+
 protected:
   virtual void initializeResources     ();
   
@@ -281,6 +290,9 @@ private:
     toGaps[toOp] = gap;
   }
   
+public:
+  std::vector<pair<int,int> > resourceNumVector;
+  
 protected:
   unsigned                numSchedClasses;
   const TargetInstrInfo*   mii;
@@ -294,6 +306,12 @@ protected:
   std::vector<std::vector<int> > issueGaps; // indexed by [opcode1][opcode2]
   std::vector<std::vector<MachineOpCode> >
                           conflictLists;   // indexed by [opcode]
+
+
+
+  friend class ModuloSchedGraph;
+  friend class ModuloScheduling;
+  
 };
 
 #endif