Skip to content

Commit c6f9b3e

Browse files
committed
[LV] Prevent query the computeCost() when VF=1 in emitInvalidCostRemarks().
1 parent 79231a8 commit c6f9b3e

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
@@ -4327,6 +4327,9 @@ void LoopVectorizationPlanner::emitInvalidCostRemarks(
43274327
SmallVector<RecipeVFPair> InvalidCosts;
43284328
for (const auto &Plan : VPlans) {
43294329
for (ElementCount VF : Plan->vectorFactors()) {
4330+
if (VF.isScalar())
4331+
continue;
4332+
43304333
VPCostContext CostCtx(CM.TTI, *CM.TLI, Legal->getWidestInductionType(),
43314334
CM, CM.CostKind);
43324335
precomputeCosts(*Plan, VF, CostCtx);

0 commit comments

Comments
 (0)