diff options
author | Mon P Wang <wangmp@apple.com> | 2008-07-05 20:40:31 +0000 |
---|---|---|
committer | Mon P Wang <wangmp@apple.com> | 2008-07-05 20:40:31 +0000 |
commit | 364d73ddab43b699ab90240f11b7a2eb5cf69bd8 (patch) | |
tree | 30eeb56942e5f8572f47c1bb8de7d590e76e10af /lib/CodeGen/SelectionDAG/SelectionDAG.cpp | |
parent | 225ca9cdd70de3d12641b0aba7daf6cb568a7ebd (diff) |
Fixed generating incorrect aligned stores that I backout of r53031
that fixed problems 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.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53150 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/SelectionDAG/SelectionDAG.cpp')
-rw-r--r-- | lib/CodeGen/SelectionDAG/SelectionDAG.cpp | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/lib/CodeGen/SelectionDAG/SelectionDAG.cpp b/lib/CodeGen/SelectionDAG/SelectionDAG.cpp index c457c4bb76..d6a38be667 100644 --- a/lib/CodeGen/SelectionDAG/SelectionDAG.cpp +++ b/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. |