summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.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
commit207bcbacca638d9d9f6c61e4d4c34c8d4d4f7dd0 (patch)
tree430550f469fb408af1e34fc0725ee3d53196c4ad /llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp
parent8c71e9265af6bc19cfca82c9c9f27ef498855676 (diff)
downloadbcm5719-llvm-207bcbacca638d9d9f6c61e4d4c34c8d4d4f7dd0.tar.gz
bcm5719-llvm-207bcbacca638d9d9f6c61e4d4c34c8d4d4f7dd0.zip
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 llvm-svn: 172027
Diffstat (limited to 'llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp')
-rw-r--r--llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp b/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp
index 8c22db35cb1..ee98b00e2b5 100644
--- a/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp
+++ b/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp
@@ -3259,7 +3259,8 @@ void SelectionDAGBuilder::visitAlloca(const AllocaInst &I) {
// Inform the Frame Information that we have just allocated a variable-sized
// object.
- FuncInfo.MF->getFrameInfo()->CreateVariableSizedObject(Align ? Align : 1);
+ FuncInfo.MF->getFrameInfo()->CreateVariableSizedObject(Align ? Align : 1,
+ I.getAlignment(), &I);
}
void SelectionDAGBuilder::visitLoad(const LoadInst &I) {
OpenPOWER on IntegriCloud