aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib
diff options
context:
space:
mode:
authorvporpo <vporpodas@google.com>2025-01-25 08:19:27 -0800
committerGitHub <noreply@github.com>2025-01-25 08:19:27 -0800
commit5cb2db3b51c2a9d516d57bd2f07d9899bd5fdae7 (patch)
treef18cd3c2b988e181c27dc3947bdfd5869382c0cd /llvm/lib
parent21f04b1458c52ba875a23b58b02cf6b1f8db0661 (diff)
downloadllvm-5cb2db3b51c2a9d516d57bd2f07d9899bd5fdae7.zip
llvm-5cb2db3b51c2a9d516d57bd2f07d9899bd5fdae7.tar.gz
llvm-5cb2db3b51c2a9d516d57bd2f07d9899bd5fdae7.tar.bz2
[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.
Diffstat (limited to 'llvm/lib')
-rw-r--r--llvm/lib/Transforms/Vectorize/SandboxVectorizer/Scheduler.cpp8
1 files changed, 7 insertions, 1 deletions
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<Instruction *> 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: