Skip to content

Commit 9ef8f20

Browse files
committed
Set MaxVF without loop if MaxVectorElementCount <= MaxVectorElementCountMaxBW
1 parent 6bd6461 commit 9ef8f20

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

42164216
// Set the max VF to the largest viable vectorization factor less than or
42174217
// equal to the max vector element count.
4218-
for (ElementCount VS = MaxVectorElementCount * 2;
4219-
ElementCount::isKnownLE(VS, MaxVectorElementCountMaxBW); VS *= 2)
4220-
MaxVF = VS;
4218+
if (ElementCount::isKnownLE(MaxVectorElementCount,
4219+
MaxVectorElementCountMaxBW))
4220+
MaxVF = MaxVectorElementCountMaxBW;
42214221

42224222
if (ElementCount MinVF =
42234223
TTI.getMinimumVF(SmallestType, ComputeScalableMaxVF)) {

0 commit comments

Comments
 (0)