Mark all calls as "could throw", when exceptions are enabled. Emit necessary LP info...
[oota-llvm.git] / lib / CodeGen / SelectionDAG / ScheduleDAGSimple.cpp
index 0b10a22fc445f8c3131248276458496ee12640d0..c6187f1109f9c950dc3610c721e6d06e87190709 100644 (file)
@@ -277,7 +277,7 @@ public:
 /// ResourceTally - Manages the use of resources over time intervals.  Each
 /// item (slot) in the tally vector represents the resources used at a given
 /// moment.  A bit set to 1 indicates that a resource is in use, otherwise
-/// available.  An assumption is made that the tally is large enough to schedule 
+/// available.  An assumption is made that the tally is large enough to schedule
 /// all current instructions (asserts otherwise.)
 ///
 template<class T>
@@ -288,9 +288,9 @@ private:
                                         // Tally iterator 
   
   /// SlotsAvailable - Returns true if all units are available.
-       ///
+  ///
   bool SlotsAvailable(Iter Begin, unsigned N, unsigned ResourceSet,
-                                              unsigned &Resource) {
+                      unsigned &Resource) {
     assert(N && "Must check availability with N != 0");
     // Determine end of interval
     Iter End = Begin + N;
@@ -318,23 +318,23 @@ private:
     Resource = 0;
     return false;
   }
-       
-       /// RetrySlot - Finds a good candidate slot to retry search.
+  
+  /// RetrySlot - Finds a good candidate slot to retry search.
   Iter RetrySlot(Iter Begin, unsigned N, unsigned ResourceSet) {
     assert(N && "Must check availability with N != 0");
     // Determine end of interval
     Iter End = Begin + N;
     assert(End <= Tally.end() && "Tally is not large enough for schedule");
-               
-               while (Begin != End--) {
-                       // Clear units in use
-                       ResourceSet &= ~*End;
-                       // If no units left then we should go no further 
-                       if (!ResourceSet) return End + 1;
-               }
-               // Made it all the way through
-               return Begin;
-       }
+    
+    while (Begin != End--) {
+      // Clear units in use
+      ResourceSet &= ~*End;
+      // If no units left then we should go no further 
+      if (!ResourceSet) return End + 1;
+    }
+    // Made it all the way through
+    return Begin;
+  }
   
   /// FindAndReserveStages - Return true if the stages can be completed. If
   /// so mark as busy.
@@ -377,7 +377,7 @@ private:
       // Try at cursor, if successful return position.
       if (FindAndReserveStages(Cursor, StageBegin, StageEnd)) return Cursor;
       // Locate a better position
-                       Cursor = RetrySlot(Cursor + 1, StageBegin->Cycles, StageBegin->Units);
+      Cursor = RetrySlot(Cursor + 1, StageBegin->Cycles, StageBegin->Units);
     }
   }
   
@@ -391,13 +391,13 @@ public:
   // FindAndReserve - Locate an ideal slot for the specified stages and mark
   // as busy.
   unsigned FindAndReserve(unsigned Slot, InstrStage *StageBegin,
-                                         InstrStage *StageEnd) {
-               // Where to begin 
-               Iter Begin = Tally.begin() + Slot;
-               // Find a free slot
-               Iter Where = FindSlots(Begin, StageBegin, StageEnd);
-               // Distance is slot number
-               unsigned Final = Where - Tally.begin();
+                          InstrStage *StageEnd) {
+    // Where to begin 
+    Iter Begin = Tally.begin() + Slot;
+    // Find a free slot
+    Iter Where = FindSlots(Begin, StageBegin, StageEnd);
+    // Distance is slot number
+    unsigned Final = Where - Tally.begin();
     return Final;
   }
 
@@ -487,7 +487,7 @@ private:
   /// printNI - Print node info.
   ///
   void printNI(std::ostream &O, NodeInfo *NI) const;
-  void printNI(std::ostream *O, NodeInfo *NI) const { if (O) printNI(O, NI); }
+  void printNI(std::ostream *O, NodeInfo *NI) const { if (O) printNI(*O, NI); }
   
   /// printChanges - Hilight changes in order caused by scheduling.
   ///
@@ -682,7 +682,7 @@ void ScheduleDAGSimple::EmitAll() {
                           LI->first, RegMap->getRegClass(LI->second));
   }
   
-  std::map<SDNode*, unsigned> VRBaseMap;
+  DenseMap<SDNode*, unsigned> VRBaseMap;
   
   // For each node in the ordering
   for (unsigned i = 0, N = Ordering.size(); i < N; i++) {