@@ -3804,6 +3804,12 @@ ScheduleDAGMILive *llvm::createGenericSchedLive(MachineSchedContext *C) {
3804
3804
// data and pass it to later mutations. Have a single mutation that gathers
3805
3805
// the interesting nodes in one pass.
3806
3806
DAG->addMutation (createCopyConstrainDAGMutation (DAG->TII , DAG->TRI ));
3807
+
3808
+ const TargetSubtargetInfo &STI = C->MF ->getSubtarget ();
3809
+ // Add MacroFusion mutation if fusions are not empty.
3810
+ const auto &MacroFusions = STI.getMacroFusions ();
3811
+ if (!MacroFusions.empty ())
3812
+ DAG->addMutation (createMacroFusionDAGMutation (MacroFusions));
3807
3813
return DAG;
3808
3814
}
3809
3815
@@ -3953,8 +3959,15 @@ void PostGenericScheduler::schedNode(SUnit *SU, bool IsTopNode) {
3953
3959
}
3954
3960
3955
3961
ScheduleDAGMI *llvm::createGenericSchedPostRA (MachineSchedContext *C) {
3956
- return new ScheduleDAGMI (C, std::make_unique<PostGenericScheduler>(C),
3957
- /* RemoveKillFlags=*/ true );
3962
+ ScheduleDAGMI *DAG =
3963
+ new ScheduleDAGMI (C, std::make_unique<PostGenericScheduler>(C),
3964
+ /* RemoveKillFlags=*/ true );
3965
+ const TargetSubtargetInfo &STI = C->MF ->getSubtarget ();
3966
+ // Add MacroFusion mutation if fusions are not empty.
3967
+ const auto &MacroFusions = STI.getMacroFusions ();
3968
+ if (!MacroFusions.empty ())
3969
+ DAG->addMutation (createMacroFusionDAGMutation (MacroFusions));
3970
+ return DAG;
3958
3971
}
3959
3972
3960
3973
// ===----------------------------------------------------------------------===//
0 commit comments