Skip to content

Commit 67d09bd

Browse files
committed
Set MaxVF without loop if MaxVectorElementCount <= MaxVectorElementCountMaxBW
1 parent 0a0cfea commit 67d09bd

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
@@ -4243,9 +4243,9 @@ ElementCount LoopVectorizationCostModel::getMaximizedVFForTarget(
42434243

42444244
// Set the max VF to the largest viable vectorization factor less than or
42454245
// equal to the max vector element count.
4246-
for (ElementCount VS = MaxVectorElementCount * 2;
4247-
ElementCount::isKnownLE(VS, MaxVectorElementCountMaxBW); VS *= 2)
4248-
MaxVF = VS;
4246+
if (ElementCount::isKnownLE(MaxVectorElementCount,
4247+
MaxVectorElementCountMaxBW))
4248+
MaxVF = MaxVectorElementCountMaxBW;
42494249

42504250
if (ElementCount MinVF =
42514251
TTI.getMinimumVF(SmallestType, ComputeScalableMaxVF)) {

0 commit comments

Comments
 (0)