[llvm] [LoadStoreVectorizer] Batch alias analysis results to improve compile time (PR #147555)

Matt Arsenault via llvm-commits llvm-commits at lists.llvm.org
Tue Jul 8 08:51:40 PDT 2025


================
@@ -0,0 +1,2583 @@
+; RUN: opt -S < %s -passes=load-store-vectorizer --capture-tracking-max-uses-to-explore=1024 | FileCheck %s
+
+; Without using batching alias analysis, this test takes 6 seconds to compile. With, less than a second.
+; This is because the mechanism that proves NoAlias in this case is very expensive (CaptureTracking.cpp),
+; and caching the result leads to 2 calls to that mechanism instead of ~300,000 (run with -stats to see the difference)
+
+; This test only demonstrates the compile time issue if capture-tracking-max-uses-to-explore is set to at least 1024,
+; because with the default value of 100, the CaptureTracking analysis is not run, NoAlias is not proven, and the vectorizer gives up early.
+
+ at global_mem = external global i8
+
+define void @compile-time-test() {
+; CHECK-LABEL: define void @compile-time-test() {
+entry:
+  ; Create base pointer to a global variable with the inefficient pattern that Alias Analysis cannot easily traverse through.
----------------
arsenm wrote:

Should add a few checks showing any vectorization happened. CHECK-N style for vector load/store? 

https://github.com/llvm/llvm-project/pull/147555


More information about the llvm-commits mailing list