summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms/IPO
diff options
context:
space:
mode:
authorGuillaume Chatelet <gchatelet@google.com>2019-10-25 22:26:23 +0200
committerGuillaume Chatelet <gchatelet@google.com>2019-10-25 22:41:34 +0200
commite8a0a0904b2b144929312ac424626b3e026bf9fb (patch)
tree4cf92c40bfdf67a1f2f8fe44ca2ede43c5826266 /llvm/lib/Transforms/IPO
parent03de2f84fc4acf06c719cd007b5459c9d4d0a20c (diff)
downloadbcm5719-llvm-e8a0a0904b2b144929312ac424626b3e026bf9fb.tar.gz
bcm5719-llvm-e8a0a0904b2b144929312ac424626b3e026bf9fb.zip
[Alignment][NFC] Convert AllocaInst to MaybeAlign
Summary: This is patch is part of a series to introduce an Alignment type. See this thread for context: http://lists.llvm.org/pipermail/llvm-dev/2019-July/133851.html See this patch for the introduction of the type: https://reviews.llvm.org/D64790 Reviewers: courbet Reviewed By: courbet Subscribers: hiraditya, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D69301
Diffstat (limited to 'llvm/lib/Transforms/IPO')
-rw-r--r--llvm/lib/Transforms/IPO/ArgumentPromotion.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/llvm/lib/Transforms/IPO/ArgumentPromotion.cpp b/llvm/lib/Transforms/IPO/ArgumentPromotion.cpp
index dd9f74a881e..9ec5c5682d0 100644
--- a/llvm/lib/Transforms/IPO/ArgumentPromotion.cpp
+++ b/llvm/lib/Transforms/IPO/ArgumentPromotion.cpp
@@ -386,8 +386,9 @@ doPromotion(Function *F, SmallPtrSetImpl<Argument *> &ArgsToPromote,
// Just add all the struct element types.
Type *AgTy = cast<PointerType>(I->getType())->getElementType();
- Value *TheAlloca = new AllocaInst(AgTy, DL.getAllocaAddrSpace(), nullptr,
- I->getParamAlignment(), "", InsertPt);
+ Value *TheAlloca =
+ new AllocaInst(AgTy, DL.getAllocaAddrSpace(), nullptr,
+ MaybeAlign(I->getParamAlignment()), "", InsertPt);
StructType *STy = cast<StructType>(AgTy);
Value *Idxs[2] = {ConstantInt::get(Type::getInt32Ty(F->getContext()), 0),
nullptr};
OpenPOWER on IntegriCloud