aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/CodeGen/CodeGenPrepare.cpp
diff options
context:
space:
mode:
authorNikita Popov <nikita.ppv@gmail.com>2020-06-05 23:18:26 +0200
committerNikita Popov <nikita.ppv@gmail.com>2020-06-05 23:18:26 +0200
commitcb5724c71e396729b7c0dd6a2a8aff20444dee09 (patch)
tree3b44b9e2cc4faa2ad78fa2a81f3de12555996b9e /llvm/lib/CodeGen/CodeGenPrepare.cpp
parentbff94a8e2bb93267a561ca96287f570af499b090 (diff)
downloadllvm-cb5724c71e396729b7c0dd6a2a8aff20444dee09.zip
llvm-cb5724c71e396729b7c0dd6a2a8aff20444dee09.tar.gz
llvm-cb5724c71e396729b7c0dd6a2a8aff20444dee09.tar.bz2
[CGP] Remove unnecessary MaybeAlign use (NFC)
Stores now always have an alignment.
Diffstat (limited to 'llvm/lib/CodeGen/CodeGenPrepare.cpp')
-rw-r--r--llvm/lib/CodeGen/CodeGenPrepare.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/llvm/lib/CodeGen/CodeGenPrepare.cpp b/llvm/lib/CodeGen/CodeGenPrepare.cpp
index 345b3d7..4ed4975 100644
--- a/llvm/lib/CodeGen/CodeGenPrepare.cpp
+++ b/llvm/lib/CodeGen/CodeGenPrepare.cpp
@@ -7083,13 +7083,13 @@ static bool splitMergedValStore(StoreInst &SI, const DataLayout &DL,
Value *Addr = Builder.CreateBitCast(
SI.getOperand(1),
SplitStoreType->getPointerTo(SI.getPointerAddressSpace()));
+ Align Alignment = SI.getAlign();
const bool IsOffsetStore = (IsLE && Upper) || (!IsLE && !Upper);
- if (IsOffsetStore)
+ if (IsOffsetStore) {
Addr = Builder.CreateGEP(
SplitStoreType, Addr,
ConstantInt::get(Type::getInt32Ty(SI.getContext()), 1));
- MaybeAlign Alignment = SI.getAlign();
- if (IsOffsetStore && Alignment) {
+
// When splitting the store in half, naturally one half will retain the
// alignment of the original wider store, regardless of whether it was
// over-aligned or not, while the other will require adjustment.