@@ -91,10 +91,6 @@ static cl::opt<bool> UseLoopHeuristics(
9191 " aie-loop-sched-heuristics" , cl::init(true ),
9292 cl::desc(" Use special picking heuristics when scheduling a loop region" ));
9393
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-
9894namespace {
9995// A sentinel value to represent an unknown SUnit.
10096const constexpr unsigned UnknownSUNum = ~0 ;
@@ -1082,11 +1078,19 @@ MachineBasicBlock *AIEPreRASchedStrategy::nextBlock() {
10821078 auto Skip = [](MachineBasicBlock *Block) {
10831079 if (!Block)
10841080 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 ;
10901094 };
10911095
10921096 do {
0 commit comments