[llvm] [LoadStoreVectorizer] Fill gaps in load/store chains to enable vectorization (PR #159388)
Artem Belevich via llvm-commits
llvm-commits at lists.llvm.org
Thu Dec 4 11:28:19 PST 2025
================
@@ -1641,3 +1829,146 @@ std::optional<APInt> Vectorizer::getConstantOffset(Value *PtrA, Value *PtrB,
.sextOrTrunc(OrigBitWidth);
return std::nullopt;
}
+
+bool Vectorizer::accessIsAllowedAndFast(unsigned SizeBytes, unsigned AS,
+ Align Alignment,
+ unsigned VecElemBits) const {
+ if (Alignment.value() % SizeBytes == 0)
----------------
Artem-B wrote:
> (we already have "Element-wise access _might_ be faster than misaligned vector accesses.")
I'd rephrase along the lines of "ask TTI whether misaligned accesses are faster as vercor or elementwise", as it may go either way.
https://github.com/llvm/llvm-project/pull/159388
More information about the llvm-commits
mailing list