[llvm] cb5724c - [CGP] Remove unnecessary MaybeAlign use (NFC)

Nikita Popov via llvm-commits llvm-commits at lists.llvm.org
Fri Jun 5 14:20:18 PDT 2020


Author: Nikita Popov
Date: 2020-06-05T23:18:26+02:00
New Revision: cb5724c71e396729b7c0dd6a2a8aff20444dee09

URL: https://github.com/llvm/llvm-project/commit/cb5724c71e396729b7c0dd6a2a8aff20444dee09
DIFF: https://github.com/llvm/llvm-project/commit/cb5724c71e396729b7c0dd6a2a8aff20444dee09.diff

LOG: [CGP] Remove unnecessary MaybeAlign use (NFC)

Stores now always have an alignment.

Added: 
    

Modified: 
    llvm/lib/CodeGen/CodeGenPrepare.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/lib/CodeGen/CodeGenPrepare.cpp b/llvm/lib/CodeGen/CodeGenPrepare.cpp
index 345b3d77d53d..4ed49757733c 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.


        


More information about the llvm-commits mailing list