Skip to content

Commit 6b819b9

Browse files
committed
[LV] Prevent query the computeCost() when VF=1 in emitInvalidCostRemarks().
1 parent fc4210f commit 6b819b9

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

llvm/lib/Transforms/Vectorize/LoopVectorize.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4350,6 +4350,9 @@ void LoopVectorizationPlanner::emitInvalidCostRemarks(
43504350
SmallVector<RecipeVFPair> InvalidCosts;
43514351
for (const auto &Plan : VPlans) {
43524352
for (ElementCount VF : Plan->vectorFactors()) {
4353+
if (VF.isScalar())
4354+
continue;
4355+
43534356
VPCostContext CostCtx(CM.TTI, *CM.TLI, Legal->getWidestInductionType(),
43544357
CM, CM.CostKind);
43554358
precomputeCosts(*Plan, VF, CostCtx);

0 commit comments

Comments
 (0)