[llvm] [LoadStoreVectorizer] Propagate alignment through contiguous chain (PR #145733)
Nikita Popov via llvm-commits
llvm-commits at lists.llvm.org
Fri Jul 11 01:16:31 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.
----------------
nikic wrote:
I don't think this *needs* to be expensive? I'd expect the implementation in InferAlignments would basically look like this: Walk the block and for all accesses on constant offset GEPs remember the largest implied alignment for the base (without offset) and use that to increase alignment on future accesses with the same base.
There are more sophisticated things one could do, but I'd expect that to cover most of the value?
https://github.com/llvm/llvm-project/pull/145733
More information about the llvm-commits
mailing list