Skip to content

Commit d7ef34b

Browse files
authored
[LV] update comment following 63d8058 (NFC) (#91120)
Address a review comment post landing 63d8058 (LoopVectorize: guard appending InstsToScalarize; fix bug) to update a comment.
1 parent 7b1b127 commit d7ef34b

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

llvm/lib/Transforms/Vectorize/LoopVectorize.cpp

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5813,10 +5813,11 @@ void LoopVectorizationCostModel::collectInstsToScalarize(ElementCount VF) {
58135813
for (Instruction &I : *BB)
58145814
if (isScalarWithPredication(&I, VF)) {
58155815
ScalarCostsTy ScalarCosts;
5816-
// Do not apply discount if scalable, because that would lead to
5817-
// invalid scalarization costs.
5818-
// Do not apply discount logic if hacked cost is needed
5819-
// for emulated masked memrefs.
5816+
// Do not apply discount logic for:
5817+
// 1. Scalars after vectorization, as there will only be a single copy
5818+
// of the instruction.
5819+
// 2. Scalable VF, as that would lead to invalid scalarization costs.
5820+
// 3. Emulated masked memrefs, if a hacked cost is needed.
58205821
if (!isScalarAfterVectorization(&I, VF) && !VF.isScalable() &&
58215822
!useEmulatedMaskMemRefHack(&I, VF) &&
58225823
computePredInstDiscount(&I, ScalarCosts, VF) >= 0)

0 commit comments

Comments
 (0)