[llvm] [LoadStoreVectorizer] Propagate alignment through contiguous chain (PR #145733)
Alex MacLean via llvm-commits
llvm-commits at lists.llvm.org
Wed Jun 25 09:44:57 PDT 2025
================
@@ -1634,3 +1645,27 @@ std::optional<APInt> Vectorizer::getConstantOffset(Value *PtrA, Value *PtrB,
.sextOrTrunc(OrigBitWidth);
return std::nullopt;
}
+
+void Vectorizer::propagateBestAlignmentsInChain(ArrayRef<ChainElem> C) const {
+ ChainElem BestAlignedElem = C[0];
+ Align BestAlignSoFar = getLoadStoreAlignment(C[0].Inst);
+
+ for (const ChainElem &E : C) {
+ Align OrigAlign = getLoadStoreAlignment(E.Inst);
+ if (OrigAlign > BestAlignSoFar) {
+ BestAlignedElem = E;
+ BestAlignSoFar = OrigAlign;
----------------
AlexMaclean wrote:
Should we continue here? or move the rest of this loop into an else?
https://github.com/llvm/llvm-project/pull/145733
More information about the llvm-commits
mailing list