Skip to content

Commit e1071a8

Browse files
committed
Add comments to explain why we skip scalar cost.
1 parent c6f9b3e commit e1071a8

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+
// The VPlan-based cost model is designed for computing vector cost.
4331+
// Quering VPlan-based cost model with scarlar VF will cause some error
4332+
// because we expect the VF is vector for most of the widen recipes.
43304333
if (VF.isScalar())
43314334
continue;
43324335

0 commit comments

Comments
 (0)