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

Artem Belevich via llvm-commits llvm-commits at lists.llvm.org
Wed Jul 9 15:47:53 PDT 2025


================
@@ -880,14 +892,6 @@ bool Vectorizer::vectorizeChain(Chain &C) {
       VecElemTy, 8 * ChainBytes / DL.getTypeSizeInBits(VecElemTy));
 
   Align Alignment = getLoadStoreAlignment(C[0].Inst);
-  // If this is a load/store of an alloca, we might have upgraded the alloca's
-  // alignment earlier.  Get the new alignment.
-  if (AS == DL.getAllocaAddrSpace()) {
-    Alignment = std::max(
-        Alignment,
-        getOrEnforceKnownAlignment(getLoadStorePointerOperand(C[0].Inst),
-                                   MaybeAlign(), DL, C[0].Inst, nullptr, &DT));
-  }
----------------
Artem-B wrote:

Oh, indeed. I was not looking at the right side of the diff, literally. :-/ No idea why it wasn't done then. Could be an unintentional omission. Alignment was not the primary focus of the patch that brought the change in. If we improve it now -- great!


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


More information about the llvm-commits mailing list