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

Akshay Deodhar via llvm-commits llvm-commits at lists.llvm.org
Wed Nov 5 11:01:26 PST 2025


================
@@ -623,6 +663,25 @@ std::vector<Chain> Vectorizer::splitChainByContiguity(Chain &C) {
     dumpChain(C);
   });
 
+  // If the chain is not contiguous, we try to fill the gap with "extra"
+  // elements to artificially make it contiguous, to try to enable
+  // vectorization. We only fill gaps if there is a potentially legal masked
+  // load/store for the target. If later on, we don't end up with a chain that
+  // could be vectorized into a legal masked load/store, the chains with extra
+  // elements will be filtered out in splitChainByAlignment.
+  bool TryFillGaps = shouldAttemptMaskedLoadStore(C);
+
+  unsigned ASPtrBits =
----------------
akshayrdeodhar wrote:

Makes sense. 

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


More information about the llvm-commits mailing list