Change SUnit's dump method to take a ScheduleDAG* instead of
[oota-llvm.git] / include / llvm / CodeGen / ScheduleDAG.h
index 125f8eaa8cefba552fe7c505813e586f07321282..e90bceb7be50f656df299c28f8adcd97ad7fd9ba 100644 (file)
@@ -22,7 +22,6 @@
 #include "llvm/ADT/SmallSet.h"
 
 namespace llvm {
-  struct InstrStage;
   struct SUnit;
   class MachineConstantPool;
   class MachineFunction;
@@ -30,6 +29,7 @@ namespace llvm {
   class MachineRegisterInfo;
   class MachineInstr;
   class TargetRegisterInfo;
+  class ScheduleDAG;
   class SelectionDAG;
   class SelectionDAGISel;
   class TargetInstrInfo;
@@ -240,8 +240,8 @@ namespace llvm {
       return false;
     }
     
-    void dump(const SelectionDAG *G) const;
-    void dumpAll(const SelectionDAG *G) const;
+    void dump(const ScheduleDAG *G) const;
+    void dumpAll(const ScheduleDAG *G) const;
   };
 
   //===--------------------------------------------------------------------===//
@@ -334,6 +334,14 @@ namespace llvm {
       return &SUnits.back();
     }
 
+    /// NewSUnit - Creates a new SUnit and return a ptr to it.
+    ///
+    SUnit *NewSUnit(MachineInstr *MI) {
+      SUnits.push_back(SUnit(MI, (unsigned)SUnits.size()));
+      SUnits.back().OrigNode = &SUnits.back();
+      return &SUnits.back();
+    }
+
     /// Clone - Creates a clone of the specified SUnit. It does not copy the
     /// predecessors / successors info nor the temporary scheduling states.
     SUnit *Clone(SUnit *N);
@@ -431,6 +439,11 @@ namespace llvm {
     /// and if it has live ins that need to be copied into vregs, emit the
     /// copies into the top of the block.
     void EmitLiveInCopies(MachineBasicBlock *MBB);
+
+    /// BuildSchedUnitsFromMBB - Build SUnits from the MachineBasicBlock.
+    /// This SUnit graph is similar to the pre-regalloc SUnit graph, but represents
+    /// MachineInstrs directly instead of SDNodes.
+    void BuildSchedUnitsFromMBB();
   };
 
   /// createBURRListDAGScheduler - This creates a bottom up register usage