diff options
author | Eli Friedman <efriedma@quicinc.com> | 2020-05-15 13:23:14 -0700 |
---|---|---|
committer | Eli Friedman <efriedma@quicinc.com> | 2020-05-16 14:53:16 -0700 |
commit | 4f04db4b5439f390c48408f9b94875810e88ffc6 (patch) | |
tree | 72b1cdccd1d20e5d5081cfabeeaa5b3ea90b3c18 /llvm/lib/CodeGen/CodeGenPrepare.cpp | |
parent | 135b877874fae96b4372c8a3fbfaa8ff44ff86e3 (diff) | |
download | llvm-4f04db4b5439f390c48408f9b94875810e88ffc6.zip llvm-4f04db4b5439f390c48408f9b94875810e88ffc6.tar.gz llvm-4f04db4b5439f390c48408f9b94875810e88ffc6.tar.bz2 |
AllocaInst should store Align instead of MaybeAlign.
Along the lines of D77454 and D79968. Unlike loads and stores, the
default alignment is getPrefTypeAlign, to match the existing handling in
various places, including SelectionDAG and InstCombine.
Differential Revision: https://reviews.llvm.org/D80044
Diffstat (limited to 'llvm/lib/CodeGen/CodeGenPrepare.cpp')
-rw-r--r-- | llvm/lib/CodeGen/CodeGenPrepare.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/llvm/lib/CodeGen/CodeGenPrepare.cpp b/llvm/lib/CodeGen/CodeGenPrepare.cpp index 1c547ab..59cbaf4 100644 --- a/llvm/lib/CodeGen/CodeGenPrepare.cpp +++ b/llvm/lib/CodeGen/CodeGenPrepare.cpp @@ -1959,7 +1959,7 @@ bool CodeGenPrepare::optimizeCallInst(CallInst *CI, bool &ModifiedDT) { AllocaInst *AI; if ((AI = dyn_cast<AllocaInst>(Val)) && AI->getAlignment() < PrefAlign && DL->getTypeAllocSize(AI->getAllocatedType()) >= MinSize + Offset2) - AI->setAlignment(MaybeAlign(PrefAlign)); + AI->setAlignment(Align(PrefAlign)); // Global variables can only be aligned if they are defined in this // object (i.e. they are uniquely initialized in this object), and // over-aligning global variables that have an explicit section is |