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

Drew Kersnar via llvm-commits llvm-commits at lists.llvm.org
Fri Jul 11 08:40:54 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.
----------------
dakersnar wrote:

>Analysis implies that we collect the information, but we're not making any actual changes to the IR.
Collecting the chains would fit that description. Collecting the chains and applying new alignment would become a transformation.

Yeah you're totally right, 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. Theoretically we could instead add an "alignment" field to each ChainElem in the chain data structure and upgrade the alignment in memory without touching the IR until the final vectorized load/store is created (do we theoretically like this idea more?). Just wanted to point out this detail in case that changes the equation.

> I appreciate your patience answering my questions and entertaining my half-baked ideas and hypothetical scenarios.

Totally, this is worth thinking through!

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


More information about the llvm-commits mailing list