Skip to content

Commit 77384fe

Browse files
committed
Add comments to explain why we skip scalar cost.
1 parent 0c90011 commit 77384fe

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
@@ -4475,6 +4475,9 @@ void LoopVectorizationPlanner::emitInvalidCostRemarks(
44754475
SmallVector<RecipeVFPair> InvalidCosts;
44764476
for (const auto &Plan : VPlans) {
44774477
for (ElementCount VF : Plan->vectorFactors()) {
4478+
// The VPlan-based cost model is designed for computing vector cost.
4479+
// Quering VPlan-based cost model with scarlar VF will cause some error
4480+
// because we expect the VF is vector for most of the widen recipes.
44784481
if (VF.isScalar())
44794482
continue;
44804483

0 commit comments

Comments
 (0)