[llvm] [LV] Increase vectorize-memory-check-threshold to 256 (PR #151712)
Igor Kirillov via llvm-commits
llvm-commits at lists.llvm.org
Fri Aug 1 08:29:50 PDT 2025
https://github.com/igogo-x86 created https://github.com/llvm/llvm-project/pull/151712
We have a benchmark with large loops that benefit from vectorisation; however, they currently require several thousands runtime checks due to the way `LoopAccessAnalysis` is implemented. I would like to improve LAA to enable vectorisation with significantly fewer checks - though still somewhat more than the current limit of 128. Before committing to this task, I need to know whether we can raise this threshold. I checked and found that increasing it to 256 caused no performance or compile-time regressions, including when using the benchmarks from https://llvm-compile-time-tracker.com/
>From 6972dbe47cef9622eaca220b269b801871296593 Mon Sep 17 00:00:00 2001
From: "Igor.Kirillov at arm.com"
<igokir01 at ip-10-248-7-180.eu-central-1.compute.internal>
Date: Fri, 1 Aug 2025 11:51:48 +0000
Subject: [PATCH] [LV] Increase vectorize-memory-check-threshold to 256
---
llvm/lib/Transforms/Vectorize/LoopVectorize.cpp | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp b/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp
index 850c4a11edc67..45460003f4a4e 100644
--- a/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp
+++ b/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp
@@ -203,7 +203,7 @@ static cl::opt<unsigned> TinyTripCountVectorThreshold(
"are incurred."));
static cl::opt<unsigned> VectorizeMemoryCheckThreshold(
- "vectorize-memory-check-threshold", cl::init(128), cl::Hidden,
+ "vectorize-memory-check-threshold", cl::init(256), cl::Hidden,
cl::desc("The maximum allowed number of runtime memory checks"));
// Option prefer-predicate-over-epilogue indicates that an epilogue is undesired,
More information about the llvm-commits
mailing list