Skip to content

Commit cd9e9f6

Browse files
committed
For consistency, remove the delaying of load/store alignment upgrading
1 parent b905f1c commit cd9e9f6

File tree

2 files changed

+2
-9
lines changed

2 files changed

+2
-9
lines changed

llvm/lib/Transforms/Vectorize/LoadStoreVectorizer.cpp

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -834,6 +834,7 @@ std::vector<Chain> Vectorizer::splitChainByAlignment(Chain &C) {
834834
<< Alignment.value() << " to " << NewAlign.value()
835835
<< "\n");
836836
Alignment = NewAlign;
837+
setLoadStoreAlignment(C[CBegin].Inst, Alignment);
837838
}
838839
}
839840

@@ -891,14 +892,6 @@ bool Vectorizer::vectorizeChain(Chain &C) {
891892
VecElemTy, 8 * ChainBytes / DL.getTypeSizeInBits(VecElemTy));
892893

893894
Align Alignment = getLoadStoreAlignment(C[0].Inst);
894-
// If this is a load/store of an alloca, we might have upgraded the alloca's
895-
// alignment earlier. Get the new alignment.
896-
if (AS == DL.getAllocaAddrSpace()) {
897-
Alignment = std::max(
898-
Alignment,
899-
getOrEnforceKnownAlignment(getLoadStorePointerOperand(C[0].Inst),
900-
MaybeAlign(), DL, C[0].Inst, nullptr, &DT));
901-
}
902895

903896
// All elements of the chain must have the same scalar-type size.
904897
#ifndef NDEBUG

llvm/test/Transforms/LoadStoreVectorizer/X86/massive_indirection.ll

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,7 @@ define void @variadics1(ptr %vlist) {
155155
; CHECK-NEXT: [[ARGP_NEXT12:%.*]] = getelementptr i8, ptr [[ARGP_CUR11_ALIGNED]], i64 8
156156
; CHECK-NEXT: [[X2:%.*]] = getelementptr i8, ptr [[ARGP_NEXT12]], i32 7
157157
; CHECK-NEXT: [[ARGP_CUR16_ALIGNED:%.*]] = call ptr @llvm.ptrmask.p0.i64(ptr [[X2]], i64 0)
158-
; CHECK-NEXT: [[TMP1:%.*]] = load <2 x double>, ptr [[ARGP_CUR16_ALIGNED]], align 4294967296
158+
; CHECK-NEXT: [[TMP1:%.*]] = load <2 x double>, ptr [[ARGP_CUR16_ALIGNED]], align 8
159159
; CHECK-NEXT: [[X31:%.*]] = extractelement <2 x double> [[TMP1]], i32 0
160160
; CHECK-NEXT: [[X42:%.*]] = extractelement <2 x double> [[TMP1]], i32 1
161161
; CHECK-NEXT: [[X5:%.*]] = fadd double [[X42]], [[X31]]

0 commit comments

Comments
 (0)