@@ -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 ;
@@ -1086,11 +1082,19 @@ MachineBasicBlock *AIEPreRASchedStrategy::nextBlock() {
1086
1082
auto Skip = [](MachineBasicBlock *Block) {
1087
1083
if (!Block)
1088
1084
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 ;
1094
1098
};
1095
1099
1096
1100
do {
0 commit comments