diff options
author | Nikita Popov <nikita.ppv@gmail.com> | 2020-05-17 22:14:42 +0200 |
---|---|---|
committer | Nikita Popov <nikita.ppv@gmail.com> | 2020-05-17 22:19:15 +0200 |
commit | 52e98f620caf29f75c6d41f51a45610c26f68c65 (patch) | |
tree | 00e7ef3cc5936bb9e266a98a18065d4a0605bea0 /llvm/lib/Transforms/Scalar/AlignmentFromAssumptions.cpp | |
parent | fde8eb00e1466cecd0fc6697f8c2ab837c5b7cf3 (diff) | |
download | llvm-52e98f620caf29f75c6d41f51a45610c26f68c65.zip llvm-52e98f620caf29f75c6d41f51a45610c26f68c65.tar.gz llvm-52e98f620caf29f75c6d41f51a45610c26f68c65.tar.bz2 |
[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.
Diffstat (limited to 'llvm/lib/Transforms/Scalar/AlignmentFromAssumptions.cpp')
-rw-r--r-- | llvm/lib/Transforms/Scalar/AlignmentFromAssumptions.cpp | 9 |
1 files changed, 2 insertions, 7 deletions
diff --git a/llvm/lib/Transforms/Scalar/AlignmentFromAssumptions.cpp b/llvm/lib/Transforms/Scalar/AlignmentFromAssumptions.cpp index 91f1ee5..6f59638 100644 --- a/llvm/lib/Transforms/Scalar/AlignmentFromAssumptions.cpp +++ b/llvm/lib/Transforms/Scalar/AlignmentFromAssumptions.cpp @@ -320,24 +320,19 @@ bool AlignmentFromAssumptionsPass::processAssumption(CallInst *ACall) { WorkList.push_back(K); } - const DataLayout &DL = SE->getDataLayout(); while (!WorkList.empty()) { Instruction *J = WorkList.pop_back_val(); if (LoadInst *LI = dyn_cast<LoadInst>(J)) { Align NewAlignment = getNewAlignment(AASCEV, AlignSCEV, OffSCEV, LI->getPointerOperand(), SE); - Align OldAlignment = - DL.getValueOrABITypeAlignment(LI->getAlign(), LI->getType()); - if (NewAlignment > OldAlignment) { + if (NewAlignment > LI->getAlign()) { LI->setAlignment(NewAlignment); ++NumLoadAlignChanged; } } else if (StoreInst *SI = dyn_cast<StoreInst>(J)) { Align NewAlignment = getNewAlignment(AASCEV, AlignSCEV, OffSCEV, SI->getPointerOperand(), SE); - Align OldAlignment = DL.getValueOrABITypeAlignment( - SI->getAlign(), SI->getOperand(0)->getType()); - if (NewAlignment > OldAlignment) { + if (NewAlignment > SI->getAlign()) { SI->setAlignment(NewAlignment); ++NumStoreAlignChanged; } |