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

Alexey Bataev via llvm-commits llvm-commits at lists.llvm.org
Tue Jul 21 05:47:58 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:

What if VF is less than the previous VF? Shall we also store all Vfs less than the one we just checked?

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


More information about the llvm-commits mailing list