From 5cb2db3b51c2a9d516d57bd2f07d9899bd5fdae7 Mon Sep 17 00:00:00 2001 From: vporpo Date: Sat, 25 Jan 2025 08:19:27 -0800 Subject: [SandboxVec][Scheduler] Forbid crossing BBs (#124369) This patch updates the scheduler to forbid scheduling across BBs. It should eventually be able to handle this, but we disable it for now. --- llvm/lib/Transforms/Vectorize/SandboxVectorizer/Scheduler.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'llvm/lib') diff --git a/llvm/lib/Transforms/Vectorize/SandboxVectorizer/Scheduler.cpp b/llvm/lib/Transforms/Vectorize/SandboxVectorizer/Scheduler.cpp index 496521b..06c1ef6b 100644 --- a/llvm/lib/Transforms/Vectorize/SandboxVectorizer/Scheduler.cpp +++ b/llvm/lib/Transforms/Vectorize/SandboxVectorizer/Scheduler.cpp @@ -189,7 +189,13 @@ bool Scheduler::trySchedule(ArrayRef Instrs) { [Instrs](Instruction *I) { return I->getParent() == (*Instrs.begin())->getParent(); }) && - "Instrs not in the same BB!"); + "Instrs not in the same BB, should have been rejected by Legality!"); + if (ScheduledBB == nullptr) + ScheduledBB = Instrs[0]->getParent(); + // We don't support crossing BBs for now. + if (any_of(Instrs, + [this](Instruction *I) { return I->getParent() != ScheduledBB; })) + return false; auto SchedState = getBndlSchedState(Instrs); switch (SchedState) { case BndlSchedState::FullyScheduled: -- cgit v1.1