Skip to content

Commit 7730ebc

Browse files
committed
[SLP]Do not to try to revectorize previously vectorized phis in loops
No need to try to revectorize previously vectorized phis in loops, it leads to a compile time blow-up. Fixes #155998
1 parent b1d2c62 commit 7730ebc

File tree

2 files changed

+197
-1
lines changed

2 files changed

+197
-1
lines changed

llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11023,7 +11023,10 @@ BoUpSLP::ScalarsVectorizationLegality BoUpSLP::getScalarsVectorizationLegality(
1102311023
}
1102411024
SmallPtrSet<Value *, 8> Values(llvm::from_range, E->Scalars);
1102511025
if (all_of(VL, [&](Value *V) {
11026-
return isa<PoisonValue>(V) || Values.contains(V);
11026+
return isa<PoisonValue>(V) || Values.contains(V) ||
11027+
(S.getOpcode() == Instruction::PHI && isa<PHINode>(V) &&
11028+
LI->getLoopFor(S.getMainOp()->getParent()) &&
11029+
isVectorized(V));
1102711030
})) {
1102811031
LLVM_DEBUG(dbgs() << "SLP: Gathering due to full overlap.\n");
1102911032
return ScalarsVectorizationLegality(S, /*IsLegal=*/false);

0 commit comments

Comments
 (0)