[llvm] [LoadStoreVectorizer] Propagate alignment through contiguous chain (PR #145733)

Artem Belevich via llvm-commits llvm-commits at lists.llvm.org
Fri Jul 11 11:40:20 PDT 2025


================
@@ -0,0 +1,450 @@
+; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --version 5
+; RUN: opt -passes=load-store-vectorizer -S < %s | FileCheck %s
+
+; The IR has the first float3 labeled with align 16, and that 16 should
+; be propagated such that the second set of 4 values
+; can also be vectorized together.
----------------
Artem-B wrote:

> what I meant was in this case I think the alignment upgrading transformation is a bit of an implementation hack to carry the computed alignment through to the end of the pass, at which point it will be assigned to the newly created vectorized load. 

I think it may be another way to say what I said above -- we've established that the change is sensible, it just may not be the best place/time for it to be done in LSV. 

So, yes, at the moment the upgraded alignment is only used by LSV, but that's exactly the reason why it may not be the best place for it. Having better (or just known) alignment info is generally helpful and we want to make it visible to other passes, independently of LSV. E.g. there may be cases where LSV would not be able to help much, but we could still improve lowering of non-vectorized loads/stores.


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


More information about the llvm-commits mailing list