From 1b74ec63efe627bdc8dba482d36db51f4444e2a7 Mon Sep 17 00:00:00 2001 From: Martien de Jong Date: Thu, 7 Nov 2024 09:39:09 +0100 Subject: [PATCH] [AIE] add option to separate prepipeliner and prescheduler skip --- llvm/lib/Target/AIE/AIEMachineScheduler.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/llvm/lib/Target/AIE/AIEMachineScheduler.cpp b/llvm/lib/Target/AIE/AIEMachineScheduler.cpp index 00b7b8e03a99..6c23868b8daa 100644 --- a/llvm/lib/Target/AIE/AIEMachineScheduler.cpp +++ b/llvm/lib/Target/AIE/AIEMachineScheduler.cpp @@ -89,6 +89,10 @@ static cl::opt UseLoopHeuristics( "aie-loop-sched-heuristics", cl::init(true), cl::desc("Use special picking heuristics when scheduling a loop region")); +static cl::opt PreSchedFollowsSkipPipeliner( + "aie-presched-follows-skip-pipeliner", cl::init(true), + cl::desc("Don't run the prescheduler if the pipeliner is skipped")); + namespace { // A sentinel value to represent an unknown SUnit. const constexpr unsigned UnknownSUNum = ~0; @@ -860,7 +864,8 @@ MachineBasicBlock *AIEPreRASchedStrategy::nextBlock() { // The prescheduler also clutters the view of the postpipeliner, so we skip // such blocks here. auto Skip = [](MachineBasicBlock *Block) { - return Block && AIELoopUtils::isSingleMBBLoop(Block) && + return PreSchedFollowsSkipPipeliner && Block && + AIELoopUtils::isSingleMBBLoop(Block) && AIELoopUtils::getPipelinerDisabled(*Block); };