[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 06:50:27 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 =
----------------
dakersnar wrote:
PrevSzBytes is inside a loop, but ASPtrBits is loop invariant, so I was thinking having the call to getIndexSizeInBits outside the loop would be better for compile time. Is this reasoning correct, or are you thinking that the call will be optimized such that it does not matter?
https://github.com/llvm/llvm-project/pull/159388
More information about the llvm-commits
mailing list