aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEric Christopher <echristo@apple.com>2010-07-17 00:28:22 +0000
committerEric Christopher <echristo@apple.com>2010-07-17 00:28:22 +0000
commit2b8271e0298f4218d6dddc80b49b51b38a646353 (patch)
treedb44867300795b3f121562a0c58cfd8e7b272b6d
parentd4c36cec1db81b4ee48cd4ab462262615d78f22c (diff)
Propagate alloca alignment information via variable size object frame
information. No functional change yet. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@108583 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--include/llvm/CodeGen/MachineFrameInfo.h5
-rw-r--r--lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp2
2 files changed, 4 insertions, 3 deletions
diff --git a/include/llvm/CodeGen/MachineFrameInfo.h b/include/llvm/CodeGen/MachineFrameInfo.h
index 9471316d25..86fb23787b 100644
--- a/include/llvm/CodeGen/MachineFrameInfo.h
+++ b/include/llvm/CodeGen/MachineFrameInfo.h
@@ -417,9 +417,10 @@ public:
/// variable sized object is created, whether or not the index returned is
/// actually used.
///
- int CreateVariableSizedObject() {
+ int CreateVariableSizedObject(unsigned Alignment) {
HasVarSizedObjects = true;
- Objects.push_back(StackObject(0, 1, 0, false, false));
+ Objects.push_back(StackObject(0, Alignment, 0, false, false));
+ MaxAlignment = std::max(MaxAlignment, Alignment);
return (int)Objects.size()-NumFixedObjects-1;
}
diff --git a/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp b/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp
index 4a0004a86c..723e0f0a91 100644
--- a/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp
+++ b/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp
@@ -2848,7 +2848,7 @@ void SelectionDAGBuilder::visitAlloca(const AllocaInst &I) {
// Inform the Frame Information that we have just allocated a variable-sized
// object.
- FuncInfo.MF->getFrameInfo()->CreateVariableSizedObject();
+ FuncInfo.MF->getFrameInfo()->CreateVariableSizedObject(Align ? Align : 1);
}
void SelectionDAGBuilder::visitLoad(const LoadInst &I) {