Skip to content

Commit 52e98f6

Browse files
committed
[Alignment] Remove unnecessary getValueOrABITypeAlignment calls (NFC)
Now that load/store alignment is required, we no longer need most of them. Also switch the getLoadStoreAlignment() helper to return Align instead of MaybeAlign.
1 parent fde8eb0 commit 52e98f6

File tree

14 files changed

+58
-146
lines changed

14 files changed

+58
-146
lines changed

llvm/include/llvm/IR/Instructions.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5151,12 +5151,12 @@ inline Value *getPointerOperand(Value *V) {
51515151
}
51525152

51535153
/// A helper function that returns the alignment of load or store instruction.
5154-
inline MaybeAlign getLoadStoreAlignment(Value *I) {
5154+
inline Align getLoadStoreAlignment(Value *I) {
51555155
assert((isa<LoadInst>(I) || isa<StoreInst>(I)) &&
51565156
"Expected Load or Store instruction");
51575157
if (auto *LI = dyn_cast<LoadInst>(I))
5158-
return MaybeAlign(LI->getAlignment());
5159-
return MaybeAlign(cast<StoreInst>(I)->getAlignment());
5158+
return LI->getAlign();
5159+
return cast<StoreInst>(I)->getAlign();
51605160
}
51615161

51625162
/// A helper function that returns the address space of the pointer operand of

llvm/lib/Analysis/Loads.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -210,8 +210,7 @@ bool llvm::isDereferenceableAndAlignedInLoop(LoadInst *LI, Loop *L,
210210

211211
APInt EltSize(DL.getIndexTypeSizeInBits(Ptr->getType()),
212212
DL.getTypeStoreSize(LI->getType()));
213-
const Align Alignment = DL.getValueOrABITypeAlignment(
214-
MaybeAlign(LI->getAlignment()), LI->getType());
213+
const Align Alignment = LI->getAlign();
215214

216215
Instruction *HeaderFirstNonPHI = L->getHeader()->getFirstNonPHI();
217216

llvm/lib/Analysis/VectorUtils.cpp

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -946,13 +946,8 @@ void InterleavedAccessInfo::collectConstStrideAccesses(
946946
const SCEV *Scev = replaceSymbolicStrideSCEV(PSE, Strides, Ptr);
947947
PointerType *PtrTy = cast<PointerType>(Ptr->getType());
948948
uint64_t Size = DL.getTypeAllocSize(PtrTy->getElementType());
949-
950-
// An alignment of 0 means target ABI alignment.
951-
MaybeAlign Alignment = MaybeAlign(getLoadStoreAlignment(&I));
952-
if (!Alignment)
953-
Alignment = Align(DL.getABITypeAlignment(PtrTy->getElementType()));
954-
955-
AccessStrideInfo[&I] = StrideDescriptor(Stride, Scev, Size, *Alignment);
949+
AccessStrideInfo[&I] = StrideDescriptor(Stride, Scev, Size,
950+
getLoadStoreAlignment(&I));
956951
}
957952
}
958953

llvm/lib/CodeGen/GlobalISel/IRTranslator.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -247,7 +247,7 @@ Align IRTranslator::getMemOpAlign(const Instruction &I) {
247247
if (const StoreInst *SI = dyn_cast<StoreInst>(&I))
248248
return SI->getAlign();
249249
if (const LoadInst *LI = dyn_cast<LoadInst>(&I)) {
250-
return DL->getValueOrABITypeAlignment(LI->getAlign(), LI->getType());
250+
return LI->getAlign();
251251
}
252252
if (const AtomicCmpXchgInst *AI = dyn_cast<AtomicCmpXchgInst>(&I)) {
253253
// TODO(PR27168): This instruction has no alignment attribute, but unlike

llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3956,7 +3956,7 @@ void SelectionDAGBuilder::visitLoad(const LoadInst &I) {
39563956
SDValue Ptr = getValue(SV);
39573957

39583958
Type *Ty = I.getType();
3959-
Align Alignment = DL->getValueOrABITypeAlignment(I.getAlign(), Ty);
3959+
Align Alignment = I.getAlign();
39603960

39613961
AAMDNodes AAInfo;
39623962
I.getAAMetadata(AAInfo);
@@ -4149,8 +4149,7 @@ void SelectionDAGBuilder::visitStore(const StoreInst &I) {
41494149
SDValue Root = I.isVolatile() ? getRoot() : getMemoryRoot();
41504150
SmallVector<SDValue, 4> Chains(std::min(MaxParallelChains, NumValues));
41514151
SDLoc dl = getCurSDLoc();
4152-
Align Alignment =
4153-
DL->getValueOrABITypeAlignment(I.getAlign(), SrcV->getType());
4152+
Align Alignment = I.getAlign();
41544153
AAMDNodes AAInfo;
41554154
I.getAAMetadata(AAInfo);
41564155

llvm/lib/Target/X86/X86FastISel.cpp

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3930,14 +3930,12 @@ bool X86FastISel::tryToFoldLoadIntoMI(MachineInstr *MI, unsigned OpNo,
39303930
const X86InstrInfo &XII = (const X86InstrInfo &)TII;
39313931

39323932
unsigned Size = DL.getTypeAllocSize(LI->getType());
3933-
Align Alignment =
3934-
DL.getValueOrABITypeAlignment(LI->getAlign(), LI->getType());
39353933

39363934
SmallVector<MachineOperand, 8> AddrOps;
39373935
AM.getFullAddress(AddrOps);
39383936

39393937
MachineInstr *Result = XII.foldMemoryOperandImpl(
3940-
*FuncInfo.MF, *MI, OpNo, AddrOps, FuncInfo.InsertPt, Size, Alignment,
3938+
*FuncInfo.MF, *MI, OpNo, AddrOps, FuncInfo.InsertPt, Size, LI->getAlign(),
39413939
/*AllowCommute=*/true);
39423940
if (!Result)
39433941
return false;

llvm/lib/Transforms/Instrumentation/DataFlowSanitizer.cpp

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1441,17 +1441,14 @@ void DFSanVisitor::visitStoreInst(StoreInst &SI) {
14411441
if (Size == 0)
14421442
return;
14431443

1444-
const Align Alignement =
1445-
ClPreserveAlignment ? DL.getValueOrABITypeAlignment(
1446-
SI.getAlign(), SI.getValueOperand()->getType())
1447-
: Align(1);
1444+
const Align Alignment = ClPreserveAlignment ? SI.getAlign() : Align(1);
14481445

14491446
Value* Shadow = DFSF.getShadow(SI.getValueOperand());
14501447
if (ClCombinePointerLabelsOnStore) {
14511448
Value *PtrShadow = DFSF.getShadow(SI.getPointerOperand());
14521449
Shadow = DFSF.combineShadows(Shadow, PtrShadow, &SI);
14531450
}
1454-
DFSF.storeShadow(SI.getPointerOperand(), Size, Alignement, Shadow, &SI);
1451+
DFSF.storeShadow(SI.getPointerOperand(), Size, Alignment, Shadow, &SI);
14551452
if (ClEventCallbacks) {
14561453
IRBuilder<> IRB(&SI);
14571454
IRB.CreateCall(DFSF.DFS.DFSanStoreCallbackFn, Shadow);

llvm/lib/Transforms/Scalar/AlignmentFromAssumptions.cpp

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -320,24 +320,19 @@ bool AlignmentFromAssumptionsPass::processAssumption(CallInst *ACall) {
320320
WorkList.push_back(K);
321321
}
322322

323-
const DataLayout &DL = SE->getDataLayout();
324323
while (!WorkList.empty()) {
325324
Instruction *J = WorkList.pop_back_val();
326325
if (LoadInst *LI = dyn_cast<LoadInst>(J)) {
327326
Align NewAlignment = getNewAlignment(AASCEV, AlignSCEV, OffSCEV,
328327
LI->getPointerOperand(), SE);
329-
Align OldAlignment =
330-
DL.getValueOrABITypeAlignment(LI->getAlign(), LI->getType());
331-
if (NewAlignment > OldAlignment) {
328+
if (NewAlignment > LI->getAlign()) {
332329
LI->setAlignment(NewAlignment);
333330
++NumLoadAlignChanged;
334331
}
335332
} else if (StoreInst *SI = dyn_cast<StoreInst>(J)) {
336333
Align NewAlignment = getNewAlignment(AASCEV, AlignSCEV, OffSCEV,
337334
SI->getPointerOperand(), SE);
338-
Align OldAlignment = DL.getValueOrABITypeAlignment(
339-
SI->getAlign(), SI->getOperand(0)->getType());
340-
if (NewAlignment > OldAlignment) {
335+
if (NewAlignment > SI->getAlign()) {
341336
SI->setAlignment(NewAlignment);
342337
++NumStoreAlignChanged;
343338
}

llvm/lib/Transforms/Scalar/MemCpyOptimizer.cpp

Lines changed: 8 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -143,23 +143,6 @@ bool MemsetRange::isProfitableToUseMemset(const DataLayout &DL) const {
143143
return TheStores.size() > NumPointerStores+NumByteStores;
144144
}
145145

146-
147-
static Align findStoreAlignment(const DataLayout &DL, const StoreInst *SI) {
148-
return DL.getValueOrABITypeAlignment(SI->getAlign(),
149-
SI->getOperand(0)->getType());
150-
}
151-
152-
static Align findLoadAlignment(const DataLayout &DL, const LoadInst *LI) {
153-
return DL.getValueOrABITypeAlignment(LI->getAlign(), LI->getType());
154-
}
155-
156-
static Align findCommonAlignment(const DataLayout &DL, const StoreInst *SI,
157-
const LoadInst *LI) {
158-
Align StoreAlign = findStoreAlignment(DL, SI);
159-
Align LoadAlign = findLoadAlignment(DL, LI);
160-
return commonAlignment(StoreAlign, LoadAlign);
161-
}
162-
163146
namespace {
164147

165148
class MemsetRanges {
@@ -190,7 +173,7 @@ class MemsetRanges {
190173
int64_t StoreSize = DL.getTypeStoreSize(SI->getOperand(0)->getType());
191174

192175
addRange(OffsetFromFirst, StoreSize, SI->getPointerOperand(),
193-
findStoreAlignment(DL, SI).value(), SI);
176+
SI->getAlign().value(), SI);
194177
}
195178

196179
void addMemSet(int64_t OffsetFromFirst, MemSetInst *MSI) {
@@ -579,12 +562,12 @@ bool MemCpyOptPass::processStore(StoreInst *SI, BasicBlock::iterator &BBI) {
579562
Instruction *M;
580563
if (UseMemMove)
581564
M = Builder.CreateMemMove(
582-
SI->getPointerOperand(), findStoreAlignment(DL, SI),
583-
LI->getPointerOperand(), findLoadAlignment(DL, LI), Size);
565+
SI->getPointerOperand(), SI->getAlign(),
566+
LI->getPointerOperand(), LI->getAlign(), Size);
584567
else
585568
M = Builder.CreateMemCpy(
586-
SI->getPointerOperand(), findStoreAlignment(DL, SI),
587-
LI->getPointerOperand(), findLoadAlignment(DL, LI), Size);
569+
SI->getPointerOperand(), SI->getAlign(),
570+
LI->getPointerOperand(), LI->getAlign(), Size);
588571

589572
LLVM_DEBUG(dbgs() << "Promoting " << *LI << " to " << *SI << " => "
590573
<< *M << "\n");
@@ -636,7 +619,7 @@ bool MemCpyOptPass::processStore(StoreInst *SI, BasicBlock::iterator &BBI) {
636619
LI, SI->getPointerOperand()->stripPointerCasts(),
637620
LI->getPointerOperand()->stripPointerCasts(),
638621
DL.getTypeStoreSize(SI->getOperand(0)->getType()),
639-
findCommonAlignment(DL, SI, LI), C);
622+
commonAlignment(SI->getAlign(), LI->getAlign()), C);
640623
if (changed) {
641624
MD->removeInstruction(SI);
642625
SI->eraseFromParent();
@@ -669,11 +652,9 @@ bool MemCpyOptPass::processStore(StoreInst *SI, BasicBlock::iterator &BBI) {
669652
auto *T = V->getType();
670653
if (T->isAggregateType()) {
671654
uint64_t Size = DL.getTypeStoreSize(T);
672-
const Align MA =
673-
DL.getValueOrABITypeAlignment(MaybeAlign(SI->getAlignment()), T);
674655
IRBuilder<> Builder(SI);
675-
auto *M =
676-
Builder.CreateMemSet(SI->getPointerOperand(), ByteVal, Size, MA);
656+
auto *M = Builder.CreateMemSet(SI->getPointerOperand(), ByteVal, Size,
657+
SI->getAlign());
677658

678659
LLVM_DEBUG(dbgs() << "Promoting " << *SI << " to " << *M << "\n");
679660

llvm/lib/Transforms/Scalar/SROA.cpp

Lines changed: 18 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -1267,7 +1267,6 @@ static void speculatePHINodeLoads(PHINode &PN) {
12671267

12681268
LoadInst *SomeLoad = cast<LoadInst>(PN.user_back());
12691269
Type *LoadTy = SomeLoad->getType();
1270-
const DataLayout &DL = PN.getModule()->getDataLayout();
12711270
IRBuilderTy PHIBuilder(&PN);
12721271
PHINode *NewPN = PHIBuilder.CreatePHI(LoadTy, PN.getNumIncomingValues(),
12731272
PN.getName() + ".sroa.speculated");
@@ -1276,8 +1275,7 @@ static void speculatePHINodeLoads(PHINode &PN) {
12761275
// matter which one we get and if any differ.
12771276
AAMDNodes AATags;
12781277
SomeLoad->getAAMetadata(AATags);
1279-
Align Alignment =
1280-
DL.getValueOrABITypeAlignment(SomeLoad->getAlign(), SomeLoad->getType());
1278+
Align Alignment = SomeLoad->getAlign();
12811279

12821280
// Rewrite all loads of the PN to use the new PHI.
12831281
while (!PN.use_empty()) {
@@ -1304,11 +1302,10 @@ static void speculatePHINodeLoads(PHINode &PN) {
13041302
Instruction *TI = Pred->getTerminator();
13051303
IRBuilderTy PredBuilder(TI);
13061304

1307-
LoadInst *Load = PredBuilder.CreateLoad(
1308-
LoadTy, InVal,
1305+
LoadInst *Load = PredBuilder.CreateAlignedLoad(
1306+
LoadTy, InVal, Alignment,
13091307
(PN.getName() + ".sroa.speculate.load." + Pred->getName()));
13101308
++NumLoadsSpeculated;
1311-
Load->setAlignment(Alignment);
13121309
if (AATags)
13131310
Load->setAAMetadata(AATags);
13141311
NewPN->addIncoming(Load, Pred);
@@ -1688,20 +1685,8 @@ static Value *getAdjustedPtr(IRBuilderTy &IRB, const DataLayout &DL, Value *Ptr,
16881685
}
16891686

16901687
/// Compute the adjusted alignment for a load or store from an offset.
1691-
static Align getAdjustedAlignment(Instruction *I, uint64_t Offset,
1692-
const DataLayout &DL) {
1693-
MaybeAlign Alignment;
1694-
Type *Ty;
1695-
if (auto *LI = dyn_cast<LoadInst>(I)) {
1696-
Alignment = MaybeAlign(LI->getAlignment());
1697-
Ty = LI->getType();
1698-
} else if (auto *SI = dyn_cast<StoreInst>(I)) {
1699-
Alignment = MaybeAlign(SI->getAlignment());
1700-
Ty = SI->getValueOperand()->getType();
1701-
} else {
1702-
llvm_unreachable("Only loads and stores are allowed!");
1703-
}
1704-
return commonAlignment(DL.getValueOrABITypeAlignment(Alignment, Ty), Offset);
1688+
static Align getAdjustedAlignment(Instruction *I, uint64_t Offset) {
1689+
return commonAlignment(getLoadStoreAlignment(I), Offset);
17051690
}
17061691

17071692
/// Test whether we can convert a value from the old to the new type.
@@ -2448,9 +2433,8 @@ class llvm::sroa::AllocaSliceRewriter
24482433
/// You can optionally pass a type to this routine and if that type's ABI
24492434
/// alignment is itself suitable, this will return zero.
24502435
Align getSliceAlign() {
2451-
Align NewAIAlign = DL.getValueOrABITypeAlignment(
2452-
MaybeAlign(NewAI.getAlignment()), NewAI.getAllocatedType());
2453-
return commonAlignment(NewAIAlign, NewBeginOffset - NewAllocaBeginOffset);
2436+
return commonAlignment(NewAI.getAlign(),
2437+
NewBeginOffset - NewAllocaBeginOffset);
24542438
}
24552439

24562440
unsigned getIndex(uint64_t Offset) {
@@ -3139,17 +3123,12 @@ class llvm::sroa::AllocaSliceRewriter
31393123
Instruction *I = Uses.pop_back_val();
31403124

31413125
if (LoadInst *LI = dyn_cast<LoadInst>(I)) {
3142-
Align LoadAlign =
3143-
DL.getValueOrABITypeAlignment(LI->getAlign(), LI->getType());
3144-
LI->setAlignment(std::min(LoadAlign, getSliceAlign()));
3126+
LI->setAlignment(std::min(LI->getAlign(), getSliceAlign()));
31453127
continue;
31463128
}
31473129
if (StoreInst *SI = dyn_cast<StoreInst>(I)) {
3148-
Value *Op = SI->getOperand(0);
3149-
Align StoreAlign = DL.getValueOrABITypeAlignment(
3150-
MaybeAlign(SI->getAlignment()), Op->getType());
3151-
SI->setAlignment(std::min(StoreAlign, getSliceAlign()));
3152-
continue;
3130+
SI->setAlignment(std::min(SI->getAlign(), getSliceAlign()));
3131+
continue;
31533132
}
31543133

31553134
assert(isa<BitCastInst>(I) || isa<AddrSpaceCastInst>(I) ||
@@ -3399,7 +3378,7 @@ class AggLoadStoreRewriter : public InstVisitor<AggLoadStoreRewriter, bool> {
33993378
AAMDNodes AATags;
34003379
LI.getAAMetadata(AATags);
34013380
LoadOpSplitter Splitter(&LI, *U, LI.getType(), AATags,
3402-
getAdjustedAlignment(&LI, 0, DL), DL);
3381+
getAdjustedAlignment(&LI, 0), DL);
34033382
Value *V = UndefValue::get(LI.getType());
34043383
Splitter.emitSplitOps(LI.getType(), V, LI.getName() + ".fca");
34053384
LI.replaceAllUsesWith(V);
@@ -3446,7 +3425,7 @@ class AggLoadStoreRewriter : public InstVisitor<AggLoadStoreRewriter, bool> {
34463425
AAMDNodes AATags;
34473426
SI.getAAMetadata(AATags);
34483427
StoreOpSplitter Splitter(&SI, *U, V->getType(), AATags,
3449-
getAdjustedAlignment(&SI, 0, DL), DL);
3428+
getAdjustedAlignment(&SI, 0), DL);
34503429
Splitter.emitSplitOps(V->getType(), V, V->getName() + ".fca");
34513430
SI.eraseFromParent();
34523431
return true;
@@ -3895,7 +3874,7 @@ bool SROA::presplitLoadsAndStores(AllocaInst &AI, AllocaSlices &AS) {
38953874
getAdjustedPtr(IRB, DL, BasePtr,
38963875
APInt(DL.getIndexSizeInBits(AS), PartOffset),
38973876
PartPtrTy, BasePtr->getName() + "."),
3898-
getAdjustedAlignment(LI, PartOffset, DL),
3877+
getAdjustedAlignment(LI, PartOffset),
38993878
/*IsVolatile*/ false, LI->getName());
39003879
PLoad->copyMetadata(*LI, {LLVMContext::MD_mem_parallel_loop_access,
39013880
LLVMContext::MD_access_group});
@@ -3953,7 +3932,7 @@ bool SROA::presplitLoadsAndStores(AllocaInst &AI, AllocaSlices &AS) {
39533932
getAdjustedPtr(IRB, DL, StoreBasePtr,
39543933
APInt(DL.getIndexSizeInBits(AS), PartOffset),
39553934
PartPtrTy, StoreBasePtr->getName() + "."),
3956-
getAdjustedAlignment(SI, PartOffset, DL),
3935+
getAdjustedAlignment(SI, PartOffset),
39573936
/*IsVolatile*/ false);
39583937
PStore->copyMetadata(*LI, {LLVMContext::MD_mem_parallel_loop_access,
39593938
LLVMContext::MD_access_group});
@@ -4038,7 +4017,7 @@ bool SROA::presplitLoadsAndStores(AllocaInst &AI, AllocaSlices &AS) {
40384017
getAdjustedPtr(IRB, DL, LoadBasePtr,
40394018
APInt(DL.getIndexSizeInBits(AS), PartOffset),
40404019
LoadPartPtrTy, LoadBasePtr->getName() + "."),
4041-
getAdjustedAlignment(LI, PartOffset, DL),
4020+
getAdjustedAlignment(LI, PartOffset),
40424021
/*IsVolatile*/ false, LI->getName());
40434022
}
40444023

@@ -4050,7 +4029,7 @@ bool SROA::presplitLoadsAndStores(AllocaInst &AI, AllocaSlices &AS) {
40504029
getAdjustedPtr(IRB, DL, StoreBasePtr,
40514030
APInt(DL.getIndexSizeInBits(AS), PartOffset),
40524031
StorePartPtrTy, StoreBasePtr->getName() + "."),
4053-
getAdjustedAlignment(SI, PartOffset, DL),
4032+
getAdjustedAlignment(SI, PartOffset),
40544033
/*IsVolatile*/ false);
40554034

40564035
// Now build a new slice for the alloca.
@@ -4186,13 +4165,8 @@ AllocaInst *SROA::rewritePartition(AllocaInst &AI, AllocaSlices &AS,
41864165
// FIXME: We might want to defer PHI speculation until after here.
41874166
// FIXME: return nullptr;
41884167
} else {
4189-
// If alignment is unspecified we fallback on the one required by the ABI
4190-
// for this type. We also make sure the alignment is compatible with
4191-
// P.beginOffset().
4192-
const Align Alignment = commonAlignment(
4193-
DL.getValueOrABITypeAlignment(MaybeAlign(AI.getAlignment()),
4194-
AI.getAllocatedType()),
4195-
P.beginOffset());
4168+
// Make sure the alignment is compatible with P.beginOffset().
4169+
const Align Alignment = commonAlignment(AI.getAlign(), P.beginOffset());
41964170
// If we will get at least this much alignment from the type alone, leave
41974171
// the alloca's alignment unconstrained.
41984172
const bool IsUnconstrained = Alignment <= DL.getABITypeAlignment(SliceTy);

llvm/lib/Transforms/Vectorize/LoadStoreVectorizer.cpp

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -128,15 +128,6 @@ class Vectorizer {
128128
private:
129129
unsigned getPointerAddressSpace(Value *I);
130130

131-
Align getAlign(LoadInst *LI) const {
132-
return DL.getValueOrABITypeAlignment(LI->getAlign(), LI->getType());
133-
}
134-
135-
Align getAlign(StoreInst *SI) const {
136-
return DL.getValueOrABITypeAlignment(SI->getAlign(),
137-
SI->getValueOperand()->getType());
138-
}
139-
140131
static const unsigned MaxDepth = 3;
141132

142133
bool isConsecutiveAccess(Value *A, Value *B);
@@ -950,7 +941,7 @@ bool Vectorizer::vectorizeStoreChain(
950941
unsigned VecRegSize = TTI.getLoadStoreVecRegBitWidth(AS);
951942
unsigned VF = VecRegSize / Sz;
952943
unsigned ChainSize = Chain.size();
953-
Align Alignment = getAlign(S0);
944+
Align Alignment = S0->getAlign();
954945

955946
if (!isPowerOf2_32(Sz) || VF < 2 || ChainSize < 2) {
956947
InstructionsProcessed->insert(Chain.begin(), Chain.end());
@@ -1103,7 +1094,7 @@ bool Vectorizer::vectorizeLoadChain(
11031094
unsigned VecRegSize = TTI.getLoadStoreVecRegBitWidth(AS);
11041095
unsigned VF = VecRegSize / Sz;
11051096
unsigned ChainSize = Chain.size();
1106-
Align Alignment = getAlign(L0);
1097+
Align Alignment = L0->getAlign();
11071098

11081099
if (!isPowerOf2_32(Sz) || VF < 2 || ChainSize < 2) {
11091100
InstructionsProcessed->insert(Chain.begin(), Chain.end());

0 commit comments

Comments
 (0)