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

Nikita Popov via llvm-commits llvm-commits at lists.llvm.org
Wed Jul 9 04:09:43 PDT 2025


================
@@ -543,6 +544,10 @@ std::vector<Chain> Vectorizer::splitChainByMayAliasInstrs(Chain &C) {
   for (const auto &E : C)
     ChainOffsets.insert({&*E.Inst, E.OffsetFromLeader});
 
+  // Across a single invocation of this function the IR is not changing, so
+  // using a batched Alias Analysis is safe and can reduce compile time.
+  BatchAAResults BatchAA(AA);
----------------
nikic wrote:

This is a good starting point. A possible follow up would be to raise this up to runOnEquivalenceClass(). This includes IR modifications, but this should still be safe due to deferral of instruction erasure via the ToErase set.

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


More information about the llvm-commits mailing list