diff options
author | Dale Johannesen <dalej@apple.com> | 2008-03-10 02:17:22 +0000 |
---|---|---|
committer | Dale Johannesen <dalej@apple.com> | 2008-03-10 02:17:22 +0000 |
commit | 4e622ec86d8b4b8e40dcf3c8dcfd405190a31bbb (patch) | |
tree | 5733d27417818263b54a8c9b5c4263ee2377ec88 /llvm/lib/Target/X86/X86ISelLowering.cpp | |
parent | 148562f13e787d7c4d5862ee473234e4bf0a1258 (diff) | |
download | bcm5719-llvm-4e622ec86d8b4b8e40dcf3c8dcfd405190a31bbb.tar.gz bcm5719-llvm-4e622ec86d8b4b8e40dcf3c8dcfd405190a31bbb.zip |
Increase ISD::ParamFlags to 64 bits. Increase the ByValSize
field to 32 bits, thus enabling correct handling of ByVal
structs bigger than 0x1ffff. Abstract interface a bit.
Fixes gcc.c-torture/execute/pr23135.c and
gcc.c-torture/execute/pr28982b.c in gcc testsuite (were ICE'ing
on ppc32, quietly producing wrong code on x86-32.)
llvm-svn: 48122
Diffstat (limited to 'llvm/lib/Target/X86/X86ISelLowering.cpp')
-rw-r--r-- | llvm/lib/Target/X86/X86ISelLowering.cpp | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/llvm/lib/Target/X86/X86ISelLowering.cpp b/llvm/lib/Target/X86/X86ISelLowering.cpp index a49418253c1..087c981b03f 100644 --- a/llvm/lib/Target/X86/X86ISelLowering.cpp +++ b/llvm/lib/Target/X86/X86ISelLowering.cpp @@ -1145,8 +1145,9 @@ CopyTailCallClobberedArgumentsToVRegs(SDOperand Chain, /// parameter. static SDOperand CreateCopyOfByValArgument(SDOperand Src, SDOperand Dst, SDOperand Chain, - unsigned Flags, SelectionDAG &DAG) { - unsigned Align = 1 << + ISD::ParamFlags::ParamFlagsTy Flags, + SelectionDAG &DAG) { + unsigned Align = ISD::ParamFlags::One << ((Flags & ISD::ParamFlags::ByValAlign) >> ISD::ParamFlags::ByValAlignOffs); unsigned Size = (Flags & ISD::ParamFlags::ByValSize) >> ISD::ParamFlags::ByValSizeOffs; @@ -1162,7 +1163,8 @@ SDOperand X86TargetLowering::LowerMemArgument(SDOperand Op, SelectionDAG &DAG, unsigned CC, SDOperand Root, unsigned i) { // Create the nodes corresponding to a load from this parameter slot. - unsigned Flags = cast<ConstantSDNode>(Op.getOperand(3 + i))->getValue(); + ISD::ParamFlags::ParamFlagsTy Flags = + cast<ConstantSDNode>(Op.getOperand(3 + i))->getValue(); bool AlwaysUseMutable = (CC==CallingConv::Fast) && PerformTailCallOpt; bool isByVal = Flags & ISD::ParamFlags::ByVal; bool isImmutable = !AlwaysUseMutable && !isByVal; @@ -1380,7 +1382,8 @@ X86TargetLowering::LowerMemOpCallTo(SDOperand Op, SelectionDAG &DAG, SDOperand PtrOff = DAG.getIntPtrConstant(LocMemOffset); PtrOff = DAG.getNode(ISD::ADD, getPointerTy(), StackPtr, PtrOff); SDOperand FlagsOp = Op.getOperand(6+2*VA.getValNo()); - unsigned Flags = cast<ConstantSDNode>(FlagsOp)->getValue(); + ISD::ParamFlags::ParamFlagsTy Flags = + cast<ConstantSDNode>(FlagsOp)->getValue(); if (Flags & ISD::ParamFlags::ByVal) { return CreateCopyOfByValArgument(Arg, PtrOff, Chain, Flags, DAG); } @@ -1642,7 +1645,8 @@ SDOperand X86TargetLowering::LowerCALL(SDOperand Op, SelectionDAG &DAG) { assert(VA.isMemLoc()); SDOperand Arg = Op.getOperand(5+2*VA.getValNo()); SDOperand FlagsOp = Op.getOperand(6+2*VA.getValNo()); - unsigned Flags = cast<ConstantSDNode>(FlagsOp)->getValue(); + ISD::ParamFlags::ParamFlagsTy Flags = + cast<ConstantSDNode>(FlagsOp)->getValue(); // Create frame index. int32_t Offset = VA.getLocMemOffset()+FPDiff; uint32_t OpSize = (MVT::getSizeInBits(VA.getLocVT())+7)/8; |