misched: TargetSchedule interface for machine resources.
[oota-llvm.git] / include / llvm / CodeGen / ScheduleDAGInstrs.h
index b4496a0515e9f998dd3b486dafbaa8073d800eb6..4bcd35a834c39ae8c8b669ca5ede5aeb2d8a27d3 100644 (file)
@@ -189,6 +189,13 @@ namespace llvm {
     /// \brief Get the machine model for instruction scheduling.
     const TargetSchedModel *getSchedModel() const { return &SchedModel; }
 
+    /// \brief Resolve and cache a resolved scheduling class for an SUnit.
+    const MCSchedClassDesc *getSchedClass(SUnit *SU) const {
+      if (!SU->SchedClass)
+        SU->SchedClass = SchedModel.resolveSchedClass(SU->getInstr());
+      return SU->SchedClass;
+    }
+
     /// begin - Return an iterator to the top of the current scheduling region.
     MachineBasicBlock::iterator begin() const { return RegionBegin; }