[llvm] [LoadStoreVectorizer] Fill gaps in load/store chains to enable vectorization (PR #159388)

Drew Kersnar via llvm-commits llvm-commits at lists.llvm.org
Wed Nov 5 08:38:52 PST 2025


================
@@ -721,6 +834,12 @@ std::vector<Chain> Vectorizer::splitChainByAlignment(Chain &C) {
   unsigned AS = getLoadStoreAddressSpace(C[0].Inst);
   unsigned VecRegBytes = TTI.getLoadStoreVecRegBitWidth(AS) / 8;
 
+  // For compile time reasons, we cache whether or not the superset
+  // of all candidate chains contains any extra loads/stores from earlier gap
+  // filling.
+  bool CandidateChainsMayContainExtraLoadsStores = any_of(
+      C, [this](const ChainElem &E) { return ExtraElements.contains(E.Inst); });
+
   std::vector<Chain> Ret;
----------------
dakersnar wrote:

Ret is used in multiple iterations of the immediately following for loop, right?

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


More information about the llvm-commits mailing list