Skip to content

Commit 352dc7d

Browse files
committed
[LV] Propagate PredicatedBBsAfterVectorization to predecessors.
This fixes some cases where predicated BBs where missed previously, leading to under-estimating the cost of those blocks.
1 parent 502bea2 commit 352dc7d

File tree

2 files changed

+17
-248
lines changed

2 files changed

+17
-248
lines changed

llvm/lib/Transforms/Vectorize/LoopVectorize.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5824,6 +5824,10 @@ void LoopVectorizationCostModel::collectInstsToScalarize(ElementCount VF) {
58245824
ScalarCostsVF.insert(ScalarCosts.begin(), ScalarCosts.end());
58255825
// Remember that BB will remain after vectorization.
58265826
PredicatedBBsAfterVectorization[VF].insert(BB);
5827+
for (auto *Pred : predecessors(BB)) {
5828+
if (Pred->getSingleSuccessor() == BB)
5829+
PredicatedBBsAfterVectorization[VF].insert(Pred);
5830+
}
58275831
}
58285832
}
58295833
}

0 commit comments

Comments
 (0)