aboutsummaryrefslogtreecommitdiff
path: root/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp
diff options
context:
space:
mode:
authorRafael Espindola <rafael.espindola@gmail.com>2007-09-07 14:52:14 +0000
committerRafael Espindola <rafael.espindola@gmail.com>2007-09-07 14:52:14 +0000
commit588af2fb99bf255c350fcfc582e475cf4840c606 (patch)
tree811e0d3ca7f2f49004c349f4bc2d147ba859ebe2 /lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp
parent8806c7b1f5317a9679a5779ffc08c552f2091bce (diff)
Add support for having different alignment for objects on call frames.
The x86-64 ABI states that objects passed on the stack have 8 byte alignment. Implement that. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@41768 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp')
-rw-r--r--lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp b/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp
index d512ef9b1d..e18beb5018 100644
--- a/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp
+++ b/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp
@@ -3870,7 +3870,8 @@ TargetLowering::LowerArguments(Function &F, SelectionDAG &DAG) {
Flags |= ISD::ParamFlags::ByVal;
const PointerType *Ty = cast<PointerType>(I->getType());
const StructType *STy = cast<StructType>(Ty->getElementType());
- unsigned StructAlign = Log2_32(getTargetData()->getABITypeAlignment(STy));
+ unsigned StructAlign =
+ Log2_32(getTargetData()->getCallFrameTypeAlignment(STy));
unsigned StructSize = getTargetData()->getTypeSize(STy);
Flags |= (StructAlign << ISD::ParamFlags::ByValAlignOffs);
Flags |= (StructSize << ISD::ParamFlags::ByValSizeOffs);
@@ -3999,7 +4000,8 @@ TargetLowering::LowerCallTo(SDOperand Chain, const Type *RetTy,
Flags |= ISD::ParamFlags::ByVal;
const PointerType *Ty = cast<PointerType>(Args[i].Ty);
const StructType *STy = cast<StructType>(Ty->getElementType());
- unsigned StructAlign = Log2_32(getTargetData()->getABITypeAlignment(STy));
+ unsigned StructAlign =
+ Log2_32(getTargetData()->getCallFrameTypeAlignment(STy));
unsigned StructSize = getTargetData()->getTypeSize(STy);
Flags |= (StructAlign << ISD::ParamFlags::ByValAlignOffs);
Flags |= (StructSize << ISD::ParamFlags::ByValSizeOffs);