[llvm] 0ef8a79 - [LoopVectorize] Add non-zero check for MaxPowerOf2RuntimeVF in computeMaxVF
David Sherwood via llvm-commits
llvm-commits at lists.llvm.org
Wed Mar 29 03:08:53 PDT 2023
Author: David Sherwood
Date: 2023-03-29T10:08:32Z
New Revision: 0ef8a79b12f6edf5faa698e444b1dcc561634252
URL: https://github.com/llvm/llvm-project/commit/0ef8a79b12f6edf5faa698e444b1dcc561634252
DIFF: https://github.com/llvm/llvm-project/commit/0ef8a79b12f6edf5faa698e444b1dcc561634252.diff
LOG: [LoopVectorize] Add non-zero check for MaxPowerOf2RuntimeVF in computeMaxVF
This one-line patch just tightens up the code added in
1c4fedfa35aeb8b456e2d8f4f826c0e026b9d863
where we try to avoid tail-folding if we know the runtime
VF will always be a multiple of the trip count.
Added:
Modified:
llvm/lib/Transforms/Vectorize/LoopVectorize.cpp
Removed:
################################################################################
diff --git a/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp b/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp
index c39188220ab43..21858cc1705b6 100644
--- a/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp
+++ b/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp
@@ -5170,7 +5170,7 @@ LoopVectorizationCostModel::computeMaxVF(ElementCount UserVF, unsigned UserIC) {
MaxPowerOf2RuntimeVF = std::nullopt; // Stick with tail-folding for now.
}
- if (MaxPowerOf2RuntimeVF) {
+ if (MaxPowerOf2RuntimeVF && *MaxPowerOf2RuntimeVF > 0) {
assert((UserVF.isNonZero() || isPowerOf2_32(*MaxPowerOf2RuntimeVF)) &&
"MaxFixedVF must be a power of 2");
unsigned MaxVFtimesIC =
More information about the llvm-commits
mailing list