[llvm] [SLP] Bail out on store-to-load forwarding hazards (PR #199606)
via llvm-commits
llvm-commits at lists.llvm.org
Fri Aug 7 21:21:42 PDT 2026
================
@@ -28257,6 +28285,109 @@ bool SLPVectorizerPass::runImpl(Function &F, ScalarEvolution *SE_,
return Changed;
}
+bool BoUpSLP::findStoreLoadForwardingConflict(StoreInst *BaseStore,
+ unsigned VF) {
+ if (!BaseStore)
+ return false;
+
+ StoreInst *FirstStore = BaseStore;
+
+ // Memoize per (store, VF); the entry is re-costed repeatedly.
+ auto Key = std::make_pair(FirstStore, VF);
+ auto CacheIt = StlfConflictCache.find(Key);
+ if (CacheIt != StlfConflictCache.end())
+ return CacheIt->second;
+
+ auto CacheAndReturn = [&](bool Result) -> bool {
+ StlfConflictCache[Key] = Result;
+ // No conflict at VF implies none at any smaller power-of-2 VF, so seed
+ // those entries too. Conflicts do not propagate downward.
+ if (!Result && isPowerOf2_32(VF))
+ for (unsigned V = VF / 2; V >= 2; V /= 2)
+ StlfConflictCache.try_emplace(std::make_pair(FirstStore, V), false);
+ return Result;
----------------
mbhade-amd wrote:
I have extended it for non pow2.
https://github.com/llvm/llvm-project/pull/199606
More information about the llvm-commits
mailing list