summaryrefslogtreecommitdiff
path: root/lib/CodeGen/SelectionDAG/FunctionLoweringInfo.cpp
diff options
context:
space:
mode:
authorManman Ren <mren@apple.com>2013-01-10 01:10:10 +0000
committerManman Ren <mren@apple.com>2013-01-10 01:10:10 +0000
commit86441169da23959c81d8648c3dfdc7a0bb8d2225 (patch)
tree83dec40a840a61665f75b6052878d06e66bb8709 /lib/CodeGen/SelectionDAG/FunctionLoweringInfo.cpp
parent7932c41884f182ae44a3feacc8a6a462e9097ca1 (diff)
downloadllvm-86441169da23959c81d8648c3dfdc7a0bb8d2225.tar.gz
llvm-86441169da23959c81d8648c3dfdc7a0bb8d2225.tar.bz2
llvm-86441169da23959c81d8648c3dfdc7a0bb8d2225.tar.xz
Stack Alignment: throw error if we can't satisfy the minimal alignment
requirement when creating stack objects in MachineFrameInfo. Add CreateStackObjectWithMinAlign to throw error when the minimal alignment can't be achieved and to clamp the alignment when the preferred alignment can't be achieved. Same is true for CreateVariableSizedObject. Will not emit error in CreateSpillStackObject or CreateStackObject. As long as callers of CreateStackObject do not assume the object will be aligned at the requested alignment, we should not have miscompile since later optimizations which look at the object's alignment will have the correct information. rdar://12713765 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@172027 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/SelectionDAG/FunctionLoweringInfo.cpp')
-rw-r--r--lib/CodeGen/SelectionDAG/FunctionLoweringInfo.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/CodeGen/SelectionDAG/FunctionLoweringInfo.cpp b/lib/CodeGen/SelectionDAG/FunctionLoweringInfo.cpp
index b46edad7a3..229c50be9a 100644
--- a/lib/CodeGen/SelectionDAG/FunctionLoweringInfo.cpp
+++ b/lib/CodeGen/SelectionDAG/FunctionLoweringInfo.cpp
@@ -95,7 +95,8 @@ void FunctionLoweringInfo::set(const Function &fn, MachineFunction &mf) {
(TySize >= 8 && isa<ArrayType>(Ty) &&
cast<ArrayType>(Ty)->getElementType()->isIntegerTy(8)));
StaticAllocaMap[AI] =
- MF->getFrameInfo()->CreateStackObject(TySize, Align, false,
+ MF->getFrameInfo()->CreateStackObjectWithMinAlign(TySize, Align,
+ AI->getAlignment(), false,
MayNeedSP, AI);
}