diff options
| author | Rafael Espindola <rafael.espindola@gmail.com> | 2007-09-07 14:52:14 +0000 |
|---|---|---|
| committer | Rafael Espindola <rafael.espindola@gmail.com> | 2007-09-07 14:52:14 +0000 |
| commit | 1de0c86717244cd9e430efe2265b4c4bac884b58 (patch) | |
| tree | ebc9f301c049b51787a98bc36db42f89fd1c0581 /llvm/lib/CodeGen | |
| parent | ec7531c9f6c1ee6463f442e90252433b71d25b3c (diff) | |
| download | bcm5719-llvm-1de0c86717244cd9e430efe2265b4c4bac884b58.tar.gz bcm5719-llvm-1de0c86717244cd9e430efe2265b4c4bac884b58.zip | |
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.
llvm-svn: 41768
Diffstat (limited to 'llvm/lib/CodeGen')
| -rw-r--r-- | llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp b/llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp index d512ef9b1d1..e18beb5018a 100644 --- a/llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp +++ b/llvm/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); |

