Index: include/llvm/Target/TargetSubtargetInfo.h =================================================================== --- include/llvm/Target/TargetSubtargetInfo.h +++ include/llvm/Target/TargetSubtargetInfo.h @@ -25,6 +25,7 @@ class DataLayout; class MachineFunction; class MachineInstr; +class ScheduleDAGInstrs; class SDep; class SUnit; class TargetFrameLowering; @@ -154,6 +155,9 @@ // dependency. virtual void adjustSchedDependency(SUnit *def, SUnit *use, SDep &dep) const {} + // \brief Perform target-specific postprocessing of the schedule graph. + virtual void postprocessSchedGraph(ScheduleDAGInstrs &DAG) const {} + // For use with PostRAScheduling: get the anti-dependence breaking that should // be performed before post-RA scheduling. virtual AntiDepBreakMode getAntiDepBreakMode() const { return ANTIDEP_NONE; } Index: lib/CodeGen/ScheduleDAGInstrs.cpp =================================================================== --- lib/CodeGen/ScheduleDAGInstrs.cpp +++ lib/CodeGen/ScheduleDAGInstrs.cpp @@ -1091,6 +1091,8 @@ Uses.clear(); CurrentVRegDefs.clear(); CurrentVRegUses.clear(); + + ST.postprocessSchedGraph(*this); } raw_ostream &llvm::operator<<(raw_ostream &OS, const PseudoSourceValue* PSV) {