Skip to content

Commit 7881f91

Browse files
committed
Set MaxVF without loop if MaxVectorElementCount <= MaxVectorElementCountMaxBW
1 parent deadd91 commit 7881f91

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

llvm/lib/Transforms/Vectorize/LoopVectorize.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4212,9 +4212,9 @@ ElementCount LoopVectorizationCostModel::getMaximizedVFForTarget(
42124212

42134213
// Set the max VF to the largest viable vectorization factor less than or
42144214
// equal to the max vector element count.
4215-
for (ElementCount VS = MaxVectorElementCount * 2;
4216-
ElementCount::isKnownLE(VS, MaxVectorElementCountMaxBW); VS *= 2)
4217-
MaxVF = VS;
4215+
if (ElementCount::isKnownLE(MaxVectorElementCount,
4216+
MaxVectorElementCountMaxBW))
4217+
MaxVF = MaxVectorElementCountMaxBW;
42184218

42194219
if (ElementCount MinVF =
42204220
TTI.getMinimumVF(SmallestType, ComputeScalableMaxVF)) {

0 commit comments

Comments
 (0)