File tree Expand file tree Collapse file tree 1 file changed +5
-4
lines changed
llvm/lib/Transforms/Vectorize Expand file tree Collapse file tree 1 file changed +5
-4
lines changed Original file line number Diff line number Diff line change @@ -5813,10 +5813,11 @@ void LoopVectorizationCostModel::collectInstsToScalarize(ElementCount VF) {
5813
5813
for (Instruction &I : *BB)
5814
5814
if (isScalarWithPredication (&I, VF)) {
5815
5815
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.
5820
5821
if (!isScalarAfterVectorization (&I, VF) && !VF.isScalable () &&
5821
5822
!useEmulatedMaskMemRefHack (&I, VF) &&
5822
5823
computePredInstDiscount (&I, ScalarCosts, VF) >= 0 )
You can’t perform that action at this time.
0 commit comments