Skip to content

Commit d197787

Browse files
committed
Add comments to explain why we skip scalar cost.
1 parent 6b819b9 commit d197787

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

0 commit comments

Comments
 (0)