diff options
author | Mon P Wang <wangmp@apple.com> | 2008-07-02 17:07:12 +0000 |
---|---|---|
committer | Mon P Wang <wangmp@apple.com> | 2008-07-02 17:07:12 +0000 |
commit | 4b7c1acf26b85bda27e73c497fedf6a47c9d1824 (patch) | |
tree | b38092b7b23aa2b112768a1042c40fd5a6ce219e /llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp | |
parent | 6b2c4f6143bea4a28e5a8816842d79d7b11b382c (diff) | |
download | bcm5719-llvm-4b7c1acf26b85bda27e73c497fedf6a47c9d1824.tar.gz bcm5719-llvm-4b7c1acf26b85bda27e73c497fedf6a47c9d1824.zip |
Fixed problem in EmitStackConvert where the source and target type
have different alignment by creating a stack slot with the max
alignment of source and target type.
llvm-svn: 53031
Diffstat (limited to 'llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp')
-rw-r--r-- | llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp b/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp index b22bf1dc621..e23e0459e8b 100644 --- a/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp +++ b/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp @@ -1080,16 +1080,17 @@ SDOperand SelectionDAG::getMemOperand(const MachineMemOperand &MO) { /// CreateStackTemporary - Create a stack temporary, suitable for holding the /// specified value type. -SDOperand SelectionDAG::CreateStackTemporary(MVT VT) { +SDOperand SelectionDAG::CreateStackTemporary(MVT VT, unsigned minAlign) { MachineFrameInfo *FrameInfo = getMachineFunction().getFrameInfo(); unsigned ByteSize = VT.getSizeInBits()/8; const Type *Ty = VT.getTypeForMVT(); - unsigned StackAlign = (unsigned)TLI.getTargetData()->getPrefTypeAlignment(Ty); + unsigned StackAlign = + std::max((unsigned)TLI.getTargetData()->getPrefTypeAlignment(Ty), minAlign); + int FrameIdx = FrameInfo->CreateStackObject(ByteSize, StackAlign); return getFrameIndex(FrameIdx, TLI.getPointerTy()); } - SDOperand SelectionDAG::FoldSetCC(MVT VT, SDOperand N1, SDOperand N2, ISD::CondCode Cond) { // These setcc operations always fold. |