@@ -852,7 +852,7 @@ class IGLPStrategy {
852
852
virtual void applyIGLPStrategy (
853
853
DenseMap<int , SUnitsToCandidateSGsMap> &SyncedInstrs,
854
854
DenseMap<int , SmallVector<SchedGroup, 4 >> &SyncedSchedGroups,
855
- bool IsReentry ) = 0;
855
+ IGLPPhase Phase ) = 0;
856
856
857
857
// Returns true if this strategy should be applied to a ScheduleDAG.
858
858
virtual bool shouldApplyStrategy (ScheduleDAGInstrs *DAG) = 0;
@@ -871,7 +871,7 @@ class MFMASmallGemmOpt final : public IGLPStrategy {
871
871
void applyIGLPStrategy (
872
872
DenseMap<int , SUnitsToCandidateSGsMap> &SyncedInstrs,
873
873
DenseMap<int , SmallVector<SchedGroup, 4 >> &SyncedSchedGroups,
874
- bool IsReentry ) override ;
874
+ IGLPPhase Phase ) override ;
875
875
876
876
bool shouldApplyStrategy (ScheduleDAGInstrs *DAG) override { return true ; }
877
877
@@ -884,7 +884,7 @@ class MFMASmallGemmOpt final : public IGLPStrategy {
884
884
void MFMASmallGemmOpt::applyIGLPStrategy (
885
885
DenseMap<int , SUnitsToCandidateSGsMap> &SyncedInstrs,
886
886
DenseMap<int , SmallVector<SchedGroup, 4 >> &SyncedSchedGroups,
887
- bool IsReentry ) {
887
+ IGLPPhase Phase ) {
888
888
// Count the number of MFMA instructions.
889
889
unsigned MFMACount = 0 ;
890
890
for (const MachineInstr &I : *DAG)
@@ -1101,7 +1101,7 @@ class MFMASmallGemmSingleWaveOpt final : public IGLPStrategy {
1101
1101
void applyIGLPStrategy (
1102
1102
DenseMap<int , SUnitsToCandidateSGsMap> &SyncedInstrs,
1103
1103
DenseMap<int , SmallVector<SchedGroup, 4 >> &SyncedSchedGroups,
1104
- bool IsReentry ) override ;
1104
+ IGLPPhase Phase ) override ;
1105
1105
1106
1106
bool shouldApplyStrategy (ScheduleDAGInstrs *DAG) override { return true ; }
1107
1107
@@ -1118,11 +1118,11 @@ static unsigned DSWWithSharedVMEMCount = 0;
1118
1118
void MFMASmallGemmSingleWaveOpt::applyIGLPStrategy (
1119
1119
DenseMap<int , SUnitsToCandidateSGsMap> &SyncedInstrs,
1120
1120
DenseMap<int , SmallVector<SchedGroup, 4 >> &SyncedSchedGroups,
1121
- bool IsReentry ) {
1121
+ IGLPPhase Phase ) {
1122
1122
unsigned MFMACount = 0 ;
1123
1123
unsigned DSRCount = 0 ;
1124
1124
1125
- assert ((IsReentry || (DSWCount == 0 && DSWWithPermCount == 0 &&
1125
+ assert ((Phase != IGLPPhase::Initial || (DSWCount == 0 && DSWWithPermCount == 0 &&
1126
1126
DSWWithSharedVMEMCount == 0 )) &&
1127
1127
" DSWCounters should be zero in pre-RA scheduling!" );
1128
1128
SmallVector<SUnit *, 6 > DSWithPerms;
@@ -1133,7 +1133,7 @@ void MFMASmallGemmSingleWaveOpt::applyIGLPStrategy(
1133
1133
else if (TII->isDS (*I)) {
1134
1134
if (I->mayLoad ())
1135
1135
++DSRCount;
1136
- else if (I->mayStore () && !IsReentry ) {
1136
+ else if (I->mayStore () && Phase == IGLPPhase::Initial ) {
1137
1137
++DSWCount;
1138
1138
for (auto Pred : SU.Preds ) {
1139
1139
if (Pred.getSUnit ()->getInstr ()->getOpcode () ==
@@ -1146,7 +1146,7 @@ void MFMASmallGemmSingleWaveOpt::applyIGLPStrategy(
1146
1146
}
1147
1147
}
1148
1148
1149
- if (!IsReentry ) {
1149
+ if (Phase == IGLPPhase::Initial ) {
1150
1150
DSWWithPermCount = DSWithPerms.size ();
1151
1151
auto I = DSWithPerms.begin ();
1152
1152
auto E = DSWithPerms.end ();
@@ -1414,10 +1414,10 @@ class IGroupLPDAGMutation : public ScheduleDAGMutation {
1414
1414
bool IsBottomUp = 1 ;
1415
1415
1416
1416
// Whether or not this is a reentry into the IGroupLPDAGMutation.
1417
- bool IsReentry = false ;
1417
+ IGLPPhase Phase = IGLPPhase::Initial ;
1418
1418
1419
1419
IGroupLPDAGMutation () = default ;
1420
- IGroupLPDAGMutation (bool IsReentry ) : IsReentry(IsReentry ) {}
1420
+ IGroupLPDAGMutation (IGLPPhase Phase ) : Phase(Phase ) {}
1421
1421
};
1422
1422
1423
1423
unsigned SchedGroup::NumSchedGroups = 0 ;
@@ -1717,21 +1717,21 @@ void IGroupLPDAGMutation::initIGLPOpt(SUnit &SU) {
1717
1717
auto S = createIGLPStrategy (StrategyID, DAG, TII);
1718
1718
if (S->shouldApplyStrategy (DAG)) {
1719
1719
IsBottomUp = S->IsBottomUp ;
1720
- S->applyIGLPStrategy (SyncedInstrs, SyncedSchedGroups, IsReentry );
1720
+ S->applyIGLPStrategy (SyncedInstrs, SyncedSchedGroups, Phase );
1721
1721
}
1722
1722
}
1723
1723
1724
1724
} // namespace
1725
1725
1726
1726
namespace llvm {
1727
1727
1728
- // / \p IsReentry specifes whether or not this is a reentry into the
1728
+ // / \p Phase specifes whether or not this is a reentry into the
1729
1729
// / IGroupLPDAGMutation. Since there may be multiple scheduling passes on the
1730
1730
// / same scheduling region (e.g. pre and post-RA scheduling / multiple
1731
1731
// / scheduling "phases"), we can reenter this mutation framework more than once
1732
1732
// / for a given region.
1733
- std::unique_ptr<ScheduleDAGMutation> createIGroupLPDAGMutation (bool IsReentry ) {
1734
- return std::make_unique<IGroupLPDAGMutation>(IsReentry );
1733
+ std::unique_ptr<ScheduleDAGMutation> createIGroupLPDAGMutation (IGLPPhase Phase ) {
1734
+ return std::make_unique<IGroupLPDAGMutation>(Phase );
1735
1735
}
1736
1736
1737
1737
} // end namespace llvm
0 commit comments