[llvm-commits] CVS: llvm/lib/CodeGen/InstrSched/InstrScheduling.cpp

Vikram Adve vadve at cs.uiuc.edu
Sat Oct 12 19:41:00 PDT 2002


Changes in directory llvm/lib/CodeGen/InstrSched:

InstrScheduling.cpp updated: 1.41 -> 1.42

---
Log message:

Use vectors instead of hash_maps for issueGaps and conflictLists.
These hash lookups were a major sink of time because they happen so often!
Also, add option to disable scheduling.


---
Diffs of the changes:

Index: llvm/lib/CodeGen/InstrSched/InstrScheduling.cpp
diff -u llvm/lib/CodeGen/InstrSched/InstrScheduling.cpp:1.41 llvm/lib/CodeGen/InstrSched/InstrScheduling.cpp:1.42
--- llvm/lib/CodeGen/InstrSched/InstrScheduling.cpp:1.41	Fri Aug  9 15:07:53 2002
+++ llvm/lib/CodeGen/InstrSched/InstrScheduling.cpp	Sat Oct 12 19:40:37 2002
@@ -25,7 +25,6 @@
         cl::desc("enable instruction scheduling debugging information"),
         cl::values(
  clEnumValN(Sched_NoDebugInfo,      "n", "disable debug output"),
- clEnumValN(Sched_Disable,        "off", "disable instruction scheduling"),
  clEnumValN(Sched_PrintMachineCode, "y", "print machine code after scheduling"),
  clEnumValN(Sched_PrintSchedTrace,  "t", "print trace of scheduling actions"),
  clEnumValN(Sched_PrintSchedGraphs, "g", "print scheduling graphs"),
@@ -549,19 +548,17 @@
 		  curTime + 1 + schedInfo.numBubblesAfter(node->getOpCode()));
     }
   
-  const vector<MachineOpCode>*
+  const std::vector<MachineOpCode>&
     conflictVec = schedInfo.getConflictList(node->getOpCode());
   
-  if (conflictVec != NULL)
-    for (unsigned i=0; i < conflictVec->size(); i++)
-      {
-	MachineOpCode toOp = (*conflictVec)[i];
-	cycles_t est = schedTime + schedInfo.getMinIssueGap(node->getOpCode(),
-							    toOp);
-	assert(toOp < (int) nextEarliestStartTime.size());
-	if (nextEarliestStartTime[toOp] < est)
-	  nextEarliestStartTime[toOp] = est;
-      }
+  for (unsigned i=0; i < conflictVec.size(); i++)
+    {
+      MachineOpCode toOp = conflictVec[i];
+      cycles_t est=schedTime + schedInfo.getMinIssueGap(node->getOpCode(),toOp);
+      assert(toOp < (int) nextEarliestStartTime.size());
+      if (nextEarliestStartTime[toOp] < est)
+        nextEarliestStartTime[toOp] = est;
+    }
 }
 
 //************************* Internal Functions *****************************/
@@ -1511,9 +1508,6 @@
 
 bool InstructionSchedulingWithSSA::runOnFunction(Function &F)
 {
-  if (SchedDebugLevel == Sched_Disable)
-    return false;
-  
   SchedGraphSet graphSet(&F, target);	
   
   if (SchedDebugLevel >= Sched_PrintSchedGraphs)





More information about the llvm-commits mailing list