@@ -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 ;
@@ -1086,11 +1082,19 @@ MachineBasicBlock *AIEPreRASchedStrategy::nextBlock() {
10861082 auto Skip = [](MachineBasicBlock *Block) {
10871083 if (!Block)
10881084 return false ;
1089- bool PrePipelinerDisabled =
1090- AIELoopUtils::getPipelinerDisabled (*Block) ||
1091- !Block->getParent ()->getSubtarget ().enableMachinePipeliner ();
1092- return PreSchedFollowsSkipPipeliner &&
1093- AIELoopUtils::isSingleMBBLoop (Block) && PrePipelinerDisabled;
1085+
1086+ auto *TII = static_cast <const AIEBaseInstrInfo *>(
1087+ Block->getParent ()->getSubtarget ().getInstrInfo ());
1088+ const AIEBaseSubtarget &STI = AIEBaseSubtarget::get (*Block->getParent ());
1089+
1090+ if (AIELoopUtils::isPostSWPCandidate (*TII, Block)) {
1091+ bool ShouldSkip = !STI.shouldPreSchedPostSWPCandidates ();
1092+ LLVM_DEBUG (dbgs () << " Skip pre-sched of post-SWP candidate "
1093+ << Block->getName () << " :" << ShouldSkip << " \n " );
1094+ return ShouldSkip;
1095+ }
1096+
1097+ return false ;
10941098 };
10951099
10961100 do {
0 commit comments