[llvm] [SLP] Bail out on store-to-load forwarding hazards (PR #199606)

Alexey Bataev via llvm-commits llvm-commits at lists.llvm.org
Wed Jul 22 05:22:27 PDT 2026


================
@@ -27384,6 +27418,147 @@ bool SLPVectorizerPass::runImpl(Function &F, ScalarEvolution *SE_,
   return Changed;
 }
 
+bool BoUpSLP::findStoreLoadForwardingConflict(StoreInst *BaseStore,
+                                              unsigned VF) {
+  if (!BaseStore || !LAIs)
+    return false;
+
+  StoreInst *FirstStore = BaseStore;
+
+  // Cache lookup: avoid re-walking the LAA dependence list when the same
+  // chain is retried at multiple vector factors.
+  auto Key = std::make_pair(FirstStore, VF);
----------------
alexey-bataev wrote:

My thought was to cache as many results as we can to prevent extra analysis

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


More information about the llvm-commits mailing list