@@ -91,10 +91,6 @@ static cl::opt<bool> UseLoopHeuristics(
91
91
" aie-loop-sched-heuristics" , cl::init(true ),
92
92
cl::desc(" Use special picking heuristics when scheduling a loop region" ));
93
93
94
- static cl::opt<bool > PreSchedFollowsSkipPipeliner (
95
- " aie-presched-follows-skip-pipeliner" , cl::init(true ),
96
- cl::desc(" Don't run the prescheduler if the pipeliner is skipped" ));
97
-
98
94
namespace {
99
95
// A sentinel value to represent an unknown SUnit.
100
96
const constexpr unsigned UnknownSUNum = ~0 ;
@@ -1082,11 +1078,19 @@ MachineBasicBlock *AIEPreRASchedStrategy::nextBlock() {
1082
1078
auto Skip = [](MachineBasicBlock *Block) {
1083
1079
if (!Block)
1084
1080
return false ;
1085
- bool PrePipelinerDisabled =
1086
- AIELoopUtils::getPipelinerDisabled (*Block) ||
1087
- !Block->getParent ()->getSubtarget ().enableMachinePipeliner ();
1088
- return PreSchedFollowsSkipPipeliner &&
1089
- AIELoopUtils::isSingleMBBLoop (Block) && PrePipelinerDisabled;
1081
+
1082
+ auto *TII = static_cast <const AIEBaseInstrInfo *>(
1083
+ Block->getParent ()->getSubtarget ().getInstrInfo ());
1084
+ const AIEBaseSubtarget &STI = AIEBaseSubtarget::get (*Block->getParent ());
1085
+
1086
+ if (AIELoopUtils::isPostSWPCandidate (*TII, Block)) {
1087
+ bool ShouldSkip = !STI.shouldPreSchedPostSWPCandidates ();
1088
+ LLVM_DEBUG (dbgs () << " Skip pre-sched of post-SWP candidate "
1089
+ << Block->getName () << " :" << ShouldSkip << " \n " );
1090
+ return ShouldSkip;
1091
+ }
1092
+
1093
+ return false ;
1090
1094
};
1091
1095
1092
1096
do {
0 commit comments