[llvm-commits] CVS: llvm/lib/Target/SparcV9/InstrSched/InstrScheduling.cpp SchedPriorities.cpp SchedPriorities.h

Chris Lattner lattner at cs.uiuc.edu
Sat Jan 15 20:20:45 PST 2005



Changes in directory llvm/lib/Target/SparcV9/InstrSched:

InstrScheduling.cpp updated: 1.79 -> 1.80
SchedPriorities.cpp updated: 1.35 -> 1.36
SchedPriorities.h updated: 1.27 -> 1.28
---
Log message:

cycles_t -> CycleCount_t


---
Diffs of the changes:  (+54 -54)

Index: llvm/lib/Target/SparcV9/InstrSched/InstrScheduling.cpp
diff -u llvm/lib/Target/SparcV9/InstrSched/InstrScheduling.cpp:1.79 llvm/lib/Target/SparcV9/InstrSched/InstrScheduling.cpp:1.80
--- llvm/lib/Target/SparcV9/InstrSched/InstrScheduling.cpp:1.79	Fri Oct  8 13:30:21 2004
+++ llvm/lib/Target/SparcV9/InstrSched/InstrScheduling.cpp	Sat Jan 15 22:20:30 2005
@@ -142,7 +142,7 @@
   const unsigned int nslots;
   unsigned int numInstr;
   std::vector<InstrGroup*> groups;		// indexed by cycle number
-  std::vector<cycles_t> startTime;		// indexed by node id
+  std::vector<CycleCount_t> startTime;		// indexed by node id
 
   InstrSchedule(InstrSchedule&);   // DO NOT IMPLEMENT
   void operator=(InstrSchedule&);  // DO NOT IMPLEMENT
@@ -163,12 +163,12 @@
   
 public: // accessor functions to query chosen schedule
   const SchedGraphNode* getInstr	(unsigned int slotNum,
-					 cycles_t c) const {
+					 CycleCount_t c) const {
     const InstrGroup* igroup = this->getIGroup(c);
     return (igroup == NULL)? NULL : (*igroup)[slotNum];
   }
   
-  inline InstrGroup*	getIGroup	(cycles_t c) {
+  inline InstrGroup*	getIGroup	(CycleCount_t c) {
     if ((unsigned)c >= groups.size())
       groups.resize(c+1);
     if (groups[c] == NULL)
@@ -176,12 +176,12 @@
     return groups[c];
   }
   
-  inline const InstrGroup* getIGroup	(cycles_t c) const {
+  inline const InstrGroup* getIGroup	(CycleCount_t c) const {
     assert((unsigned)c < groups.size());
     return groups[c];
   }
   
-  inline cycles_t	getStartTime	(unsigned int nodeId) const {
+  inline CycleCount_t	getStartTime	(unsigned int nodeId) const {
     assert(nodeId < startTime.size());
     return startTime[nodeId];
   }
@@ -192,7 +192,7 @@
   
   inline void		scheduleInstr	(const SchedGraphNode* node,
 					 unsigned int slotNum,
-					 cycles_t cycle) {
+					 CycleCount_t cycle) {
     InstrGroup* igroup = this->getIGroup(cycle);
     if (!((*igroup)[slotNum] == NULL)) {
       std::cerr << "Slot already filled?\n";
@@ -222,7 +222,7 @@
   : nslots(_nslots),
     numInstr(0),
     groups(2 * _numNodes / _nslots),		// 2 x lower-bound for #cycles
-    startTime(_numNodes, (cycles_t) -1)		// set all to -1
+    startTime(_numNodes, (CycleCount_t) -1)		// set all to -1
 {
 }
 
@@ -297,7 +297,7 @@
   const SchedGraphNode* brNode;
   unsigned ndelays;
   std::vector<const SchedGraphNode*> delayNodeVec;
-  cycles_t delayedNodeCycle;
+  CycleCount_t delayedNodeCycle;
   unsigned delayedNodeSlotNum;
   
   DelaySlotInfo(const DelaySlotInfo &);  // DO NOT IMPLEMENT
@@ -321,7 +321,7 @@
     assert(delayNodeVec.size() <= ndelays && "Too many delay slot instrs!");
   }
   
-  inline void	recordChosenSlot	(cycles_t cycle, unsigned slotNum) {
+  inline void	recordChosenSlot	(CycleCount_t cycle, unsigned slotNum) {
     delayedNodeCycle = cycle;
     delayedNodeSlotNum = slotNum;
   }
@@ -347,13 +347,13 @@
   
 private:
   unsigned totalInstrCount;
-  cycles_t curTime;
-  cycles_t nextEarliestIssueTime;		// next cycle we can issue
+  CycleCount_t curTime;
+  CycleCount_t nextEarliestIssueTime;		// next cycle we can issue
   // indexed by slot#
   std::vector<hash_set<const SchedGraphNode*> > choicesForSlot;
   std::vector<const SchedGraphNode*> choiceVec;	// indexed by node ptr
   std::vector<int> numInClass;			// indexed by sched class
-  std::vector<cycles_t> nextEarliestStartTime;	// indexed by opCode
+  std::vector<CycleCount_t> nextEarliestStartTime;	// indexed by opCode
   hash_map<const SchedGraphNode*, DelaySlotInfo*> delaySlotInfoForBranches;
 						// indexed by branch node ptr 
   
@@ -379,21 +379,21 @@
   // Interface for checking and updating the current time
   //----------------------------------------------------------------------
   
-  inline cycles_t	getTime			() const {
+  inline CycleCount_t	getTime			() const {
     return curTime;
   }
   
-  inline cycles_t	getEarliestIssueTime() const {
+  inline CycleCount_t	getEarliestIssueTime() const {
     return nextEarliestIssueTime;
   }
   
-  inline cycles_t	getEarliestStartTimeForOp(MachineOpCode opCode) const {
+  inline CycleCount_t	getEarliestStartTimeForOp(MachineOpCode opCode) const {
     assert(opCode < (int) nextEarliestStartTime.size());
     return nextEarliestStartTime[opCode];
   }
   
   // Update current time to specified cycle
-  inline void	updateTime		(cycles_t c) {
+  inline void	updateTime		(CycleCount_t c) {
     curTime = c;
     schedPrio.updateTime(c);
   }
@@ -467,7 +467,7 @@
   
   inline void	scheduleInstr		(const SchedGraphNode* node,
 					 unsigned int slotNum,
-					 cycles_t cycle)
+					 CycleCount_t cycle)
   {
     assert(! isScheduled(node) && "Instruction already scheduled?");
     
@@ -509,7 +509,7 @@
   
 private:
   SchedulingManager();     // DISABLED: DO NOT IMPLEMENT
-  void updateEarliestStartTimes(const SchedGraphNode* node, cycles_t schedTime);
+  void updateEarliestStartTimes(const SchedGraphNode* node, CycleCount_t schedTime);
 };
 
 
@@ -526,7 +526,7 @@
     choicesForSlot(nslots),
     numInClass(target.getSchedInfo()->getNumSchedClasses(), 0),	// set all to 0
     nextEarliestStartTime(target.getInstrInfo()->getNumOpcodes(),
-			  (cycles_t) 0)				// set all to 0
+			  (CycleCount_t) 0)				// set all to 0
 {
   updateTime(0);
   
@@ -540,7 +540,7 @@
 
 void
 SchedulingManager::updateEarliestStartTimes(const SchedGraphNode* node,
-					    cycles_t schedTime)
+					    CycleCount_t schedTime)
 {
   if (schedInfo.numBubblesAfter(node->getOpcode()) > 0)
     { // Update next earliest time before which *nothing* can issue.
@@ -554,7 +554,7 @@
   for (unsigned i=0; i < conflictVec.size(); i++)
     {
       MachineOpCode toOp = conflictVec[i];
-      cycles_t est=schedTime + schedInfo.getMinIssueGap(node->getOpcode(),toOp);
+      CycleCount_t est=schedTime + schedInfo.getMinIssueGap(node->getOpcode(),toOp);
       assert(toOp < (int) nextEarliestStartTime.size());
       if (nextEarliestStartTime[toOp] < est)
         nextEarliestStartTime[toOp] = est;
@@ -569,7 +569,7 @@
 {
   // find the slot to start from, in the current cycle
   unsigned int startSlot = 0;
-  cycles_t curTime = S.getTime();
+  CycleCount_t curTime = S.getTime();
   
   assert(maxIssue > 0 && maxIssue <= S.nslots - startSlot);
   
@@ -850,7 +850,7 @@
     // highest slot used.  But we just mark that for now, and
     // schedule it separately because we want to schedule the delay
     // slots for the node at the same time.
-    cycles_t dcycle = S.getTime();
+    CycleCount_t dcycle = S.getTime();
     unsigned int dslot = highestSlotUsed + 1;
     if (dslot == S.nslots) {
       dslot = 0;
@@ -934,7 +934,7 @@
   assert(S.schedPrio.getNumReady() > 0
 	 && "Don't get here without ready instructions.");
   
-  cycles_t firstCycle = S.getTime();
+  CycleCount_t firstCycle = S.getTime();
   DelaySlotInfo* getDelaySlotInfo = NULL;
   
   // Choose up to `nslots' feasible instructions and their possible slots.
@@ -952,7 +952,7 @@
   
   // Print trace of scheduled instructions before newly ready ones
   if (SchedDebugLevel >= Sched_PrintSchedTrace) {
-    for (cycles_t c = firstCycle; c <= S.getTime(); c++) {
+    for (CycleCount_t c = firstCycle; c <= S.getTime(); c++) {
       std::cerr << "    Cycle " << (long)c <<" : Scheduled instructions:\n";
       const InstrGroup* igroup = S.isched.getIGroup(c);
       for (unsigned int s=0; s < S.nslots; s++) {
@@ -978,7 +978,7 @@
   S.schedPrio.initialize();
   
   while ((N = S.schedPrio.getNumReady()) > 0) {
-    cycles_t nextCycle = S.getTime();
+    CycleCount_t nextCycle = S.getTime();
       
     // Choose one group of instructions for a cycle, plus any delay slot
     // instructions (which may overflow into successive cycles).
@@ -991,7 +991,7 @@
     // Notify the priority manager of scheduled instructions and mark
     // any successors that may now be ready
     // 
-    for (cycles_t c = nextCycle; c <= S.getTime(); c++) {
+    for (CycleCount_t c = nextCycle; c <= S.getTime(); c++) {
       const InstrGroup* igroup = S.isched.getIGroup(c);
       for (unsigned int s=0; s < S.nslots; s++)
         if ((node = (*igroup)[s]) != NULL) {
@@ -1304,7 +1304,7 @@
 	 && "Slot for branch should be empty");
   
   unsigned int nextSlot = delayedNodeSlotNum;
-  cycles_t nextTime = delayedNodeCycle;
+  CycleCount_t nextTime = delayedNodeCycle;
   
   S.scheduleInstr(brNode, nextSlot, nextTime);
   
@@ -1395,7 +1395,7 @@
 static inline bool
 ViolatesMinimumGap(const SchedulingManager& S,
 		   MachineOpCode opCode,
-		   const cycles_t inCycle)
+		   const CycleCount_t inCycle)
 {
   return (inCycle < S.getEarliestStartTimeForOp(opCode));
 }


Index: llvm/lib/Target/SparcV9/InstrSched/SchedPriorities.cpp
diff -u llvm/lib/Target/SparcV9/InstrSched/SchedPriorities.cpp:1.35 llvm/lib/Target/SparcV9/InstrSched/SchedPriorities.cpp:1.36
--- llvm/lib/Target/SparcV9/InstrSched/SchedPriorities.cpp:1.35	Fri Oct  8 13:30:22 2004
+++ llvm/lib/Target/SparcV9/InstrSched/SchedPriorities.cpp	Sat Jan 15 22:20:30 2005
@@ -55,7 +55,7 @@
   po_iterator<const SchedGraph*> poIter = po_begin(graph), poEnd =po_end(graph);
   for ( ; poIter != poEnd; ++poIter) {
     const SchedGraphNode* node = *poIter;
-    cycles_t nodeDelay;
+    CycleCount_t nodeDelay;
     if (node->beginOutEdges() == node->endOutEdges())
       nodeDelay = node->getLatency();
     else {
@@ -63,7 +63,7 @@
       nodeDelay = 0;
       for (SchedGraphNode::const_iterator E=node->beginOutEdges();
            E != node->endOutEdges(); ++E) {
-        cycles_t sinkDelay = getNodeDelay((SchedGraphNode*)(*E)->getSink());
+        CycleCount_t sinkDelay = getNodeDelay((SchedGraphNode*)(*E)->getSink());
         nodeDelay = std::max(nodeDelay, sinkDelay + (*E)->getMinDelay());
       }
     }
@@ -117,7 +117,7 @@
 }
 
 void
-SchedPriorities::issuedReadyNodeAt(cycles_t curTime,
+SchedPriorities::issuedReadyNodeAt(CycleCount_t curTime,
 				   const SchedGraphNode* node) {
   candsAsHeap.removeNode(node);
   candsAsSet.erase(node);
@@ -138,7 +138,7 @@
   // Now update ready times for successors
   for (SchedGraphNode::const_iterator E=node->beginOutEdges();
        E != node->endOutEdges(); ++E) {
-    cycles_t& etime =
+    CycleCount_t& etime =
       getEarliestReadyTimeForNodeRef((SchedGraphNode*)(*E)->getSink());
     etime = std::max(etime, curTime + (*E)->getMinDelay());
   }    
@@ -187,7 +187,7 @@
 
 const SchedGraphNode*
 SchedPriorities::getNextHighest(const SchedulingManager& S,
-				cycles_t curTime) {
+				CycleCount_t curTime) {
   int nextIdx = -1;
   const SchedGraphNode* nextChoice = NULL;
   
@@ -237,7 +237,7 @@
     { // out of choices at current maximum delay;
       // put nodes with next highest delay in mcands
       candIndex next = nextToTry;
-      cycles_t maxDelay = candsAsHeap.getDelay(next);
+      CycleCount_t maxDelay = candsAsHeap.getDelay(next);
       for (; next != candsAsHeap.end()
 	     && candsAsHeap.getDelay(next) == maxDelay; ++next)
 	mcands.push_back(next);


Index: llvm/lib/Target/SparcV9/InstrSched/SchedPriorities.h
diff -u llvm/lib/Target/SparcV9/InstrSched/SchedPriorities.h:1.27 llvm/lib/Target/SparcV9/InstrSched/SchedPriorities.h:1.28
--- llvm/lib/Target/SparcV9/InstrSched/SchedPriorities.h:1.27	Wed Sep  1 17:55:35 2004
+++ llvm/lib/Target/SparcV9/InstrSched/SchedPriorities.h	Sat Jan 15 22:20:30 2005
@@ -61,8 +61,8 @@
 
 struct NodeDelayPair {
   const SchedGraphNode* node;
-  cycles_t delay;
-  NodeDelayPair(const SchedGraphNode* n, cycles_t d) :  node(n), delay(d) {}
+  CycleCount_t delay;
+  NodeDelayPair(const SchedGraphNode* n, CycleCount_t d) :  node(n), delay(d) {}
   inline bool operator<(const NodeDelayPair& np) { return delay < np.delay; }
 };
 
@@ -85,7 +85,7 @@
   inline unsigned       size() const { return _size; }
   
   const SchedGraphNode* getNode	(const_iterator i) const { return (*i)->node; }
-  cycles_t		getDelay(const_iterator i) const { return (*i)->delay;}
+  CycleCount_t		getDelay(const_iterator i) const { return (*i)->delay;}
   
   inline void		makeHeap() { 
     // make_heap(begin(), end(), NDPLessThan);
@@ -108,7 +108,7 @@
       }
   };
   
-  void		  insert(const SchedGraphNode* node, cycles_t delay) {
+  void		  insert(const SchedGraphNode* node, CycleCount_t delay) {
     NodeDelayPair* ndp = new NodeDelayPair(node, delay);
     if (_size == 0 || front()->delay < delay)
       push_front(ndp);
@@ -137,36 +137,36 @@
   // This must be called before scheduling begins.
   void		initialize		();
   
-  cycles_t	getTime			() const { return curTime; }
-  cycles_t	getEarliestReadyTime	() const { return earliestReadyTime; }
+  CycleCount_t	getTime			() const { return curTime; }
+  CycleCount_t	getEarliestReadyTime	() const { return earliestReadyTime; }
   unsigned	getNumReady		() const { return candsAsHeap.size(); }
   bool		nodeIsReady		(const SchedGraphNode* node) const {
     return (candsAsSet.find(node) != candsAsSet.end());
   }
   
-  void		issuedReadyNodeAt	(cycles_t curTime,
+  void		issuedReadyNodeAt	(CycleCount_t curTime,
 					 const SchedGraphNode* node);
   
   void		insertReady		(const SchedGraphNode* node);
   
-  void		updateTime		(cycles_t /*unused*/);
+  void		updateTime		(CycleCount_t /*unused*/);
   
   const SchedGraphNode* getNextHighest	(const SchedulingManager& S,
-					 cycles_t curTime);
+					 CycleCount_t curTime);
 					// choose next highest priority instr
   
 private:
   typedef NodeHeap::iterator candIndex;
   
 private:
-  cycles_t curTime;
+  CycleCount_t curTime;
   const SchedGraph* graph;
   FunctionLiveVarInfo &methodLiveVarInfo;
   hash_map<const MachineInstr*, bool> lastUseMap;
-  std::vector<cycles_t> nodeDelayVec;
-  std::vector<cycles_t> nodeEarliestUseVec;
-  std::vector<cycles_t> earliestReadyTimeForNode;
-  cycles_t earliestReadyTime;
+  std::vector<CycleCount_t> nodeDelayVec;
+  std::vector<CycleCount_t> nodeEarliestUseVec;
+  std::vector<CycleCount_t> earliestReadyTimeForNode;
+  CycleCount_t earliestReadyTime;
   NodeHeap candsAsHeap;				// candidate nodes, ready to go
   hash_set<const SchedGraphNode*> candsAsSet;   //same entries as candsAsHeap,
 						//   but as set for fast lookup
@@ -190,25 +190,25 @@
   
   // NOTE: The next two return references to the actual vector entries.
   //       Use the following two if you don't need to modify the value.
-  cycles_t&	getNodeDelayRef		(const SchedGraphNode* node) {
+  CycleCount_t&	getNodeDelayRef		(const SchedGraphNode* node) {
     assert(node->getNodeId() < nodeDelayVec.size());
     return nodeDelayVec[node->getNodeId()];
   }
-  cycles_t&     getEarliestReadyTimeForNodeRef   (const SchedGraphNode* node) {
+  CycleCount_t&     getEarliestReadyTimeForNodeRef   (const SchedGraphNode* node) {
     assert(node->getNodeId() < earliestReadyTimeForNode.size());
     return earliestReadyTimeForNode[node->getNodeId()];
   }
   
-  cycles_t      getNodeDelay            (const SchedGraphNode* node) const {
+  CycleCount_t      getNodeDelay            (const SchedGraphNode* node) const {
     return ((SchedPriorities*) this)->getNodeDelayRef(node); 
   }
-  cycles_t      getEarliestReadyTimeForNode(const SchedGraphNode* node) const {
+  CycleCount_t      getEarliestReadyTimeForNode(const SchedGraphNode* node) const {
     return ((SchedPriorities*) this)->getEarliestReadyTimeForNodeRef(node);
   }
 };
 
 
-inline void SchedPriorities::updateTime(cycles_t c) {
+inline void SchedPriorities::updateTime(CycleCount_t c) {
   curTime = c;
   nextToTry = candsAsHeap.begin();
   mcands.clear();






More information about the llvm-commits mailing list