LLVM API Documentation

LegalizeTypesGeneric.cpp

Go to the documentation of this file.
00001 //===-------- LegalizeTypesGeneric.cpp - Generic type legalization --------===//
00002 //
00003 //                     The LLVM Compiler Infrastructure
00004 //
00005 // This file is distributed under the University of Illinois Open Source
00006 // License. See LICENSE.TXT for details.
00007 //
00008 //===----------------------------------------------------------------------===//
00009 //
00010 // This file implements generic type expansion and splitting for LegalizeTypes.
00011 // The routines here perform legalization when the details of the type (such as
00012 // whether it is an integer or a float) do not matter.
00013 // Expansion is the act of changing a computation in an illegal type to be a
00014 // computation in two identical registers of a smaller type.  The Lo/Hi part
00015 // is required to be stored first in memory on little/big-endian machines.
00016 // Splitting is the act of changing a computation in an illegal type to be a
00017 // computation in two not necessarily identical registers of a smaller type.
00018 // There are no requirements on how the type is represented in memory.
00019 //
00020 //===----------------------------------------------------------------------===//
00021 
00022 #include "LegalizeTypes.h"
00023 #include "llvm/Target/TargetData.h"
00024 #include "llvm/CodeGen/PseudoSourceValue.h"
00025 using namespace llvm;
00026 
00027 //===----------------------------------------------------------------------===//
00028 // Generic Result Expansion.
00029 //===----------------------------------------------------------------------===//
00030 
00031 // These routines assume that the Lo/Hi part is stored first in memory on
00032 // little/big-endian machines, followed by the Hi/Lo part.  This means that
00033 // they cannot be used as is on vectors, for which Lo is always stored first.
00034 
00035 void DAGTypeLegalizer::ExpandRes_BIT_CONVERT(SDNode *N, SDValue &Lo,
00036                                              SDValue &Hi) {
00037   EVT OutVT = N->getValueType(0);
00038   EVT NOutVT = TLI.getTypeToTransformTo(*DAG.getContext(), OutVT);
00039   SDValue InOp = N->getOperand(0);
00040   EVT InVT = InOp.getValueType();
00041   DebugLoc dl = N->getDebugLoc();
00042 
00043   // Handle some special cases efficiently.
00044   switch (getTypeAction(InVT)) {
00045     default:
00046       assert(false && "Unknown type action!");
00047     case Legal:
00048     case PromoteInteger:
00049       break;
00050     case SoftenFloat:
00051       // Convert the integer operand instead.
00052       SplitInteger(GetSoftenedFloat(InOp), Lo, Hi);
00053       Lo = DAG.getNode(ISD::BIT_CONVERT, dl, NOutVT, Lo);
00054       Hi = DAG.getNode(ISD::BIT_CONVERT, dl, NOutVT, Hi);
00055       return;
00056     case ExpandInteger:
00057     case ExpandFloat:
00058       // Convert the expanded pieces of the input.
00059       GetExpandedOp(InOp, Lo, Hi);
00060       Lo = DAG.getNode(ISD::BIT_CONVERT, dl, NOutVT, Lo);
00061       Hi = DAG.getNode(ISD::BIT_CONVERT, dl, NOutVT, Hi);
00062       return;
00063     case SplitVector:
00064       GetSplitVector(InOp, Lo, Hi);
00065       if (TLI.isBigEndian())
00066         std::swap(Lo, Hi);
00067       Lo = DAG.getNode(ISD::BIT_CONVERT, dl, NOutVT, Lo);
00068       Hi = DAG.getNode(ISD::BIT_CONVERT, dl, NOutVT, Hi);
00069       return;
00070     case ScalarizeVector:
00071       // Convert the element instead.
00072       SplitInteger(BitConvertToInteger(GetScalarizedVector(InOp)), Lo, Hi);
00073       Lo = DAG.getNode(ISD::BIT_CONVERT, dl, NOutVT, Lo);
00074       Hi = DAG.getNode(ISD::BIT_CONVERT, dl, NOutVT, Hi);
00075       return;
00076     case WidenVector: {
00077       assert(!(InVT.getVectorNumElements() & 1) && "Unsupported BIT_CONVERT");
00078       InOp = GetWidenedVector(InOp);
00079       EVT InNVT = EVT::getVectorVT(*DAG.getContext(), InVT.getVectorElementType(),
00080                                    InVT.getVectorNumElements()/2);
00081       Lo = DAG.getNode(ISD::EXTRACT_SUBVECTOR, dl, InNVT, InOp,
00082                        DAG.getIntPtrConstant(0));
00083       Hi = DAG.getNode(ISD::EXTRACT_SUBVECTOR, dl, InNVT, InOp,
00084                        DAG.getIntPtrConstant(InNVT.getVectorNumElements()));
00085       if (TLI.isBigEndian())
00086         std::swap(Lo, Hi);
00087       Lo = DAG.getNode(ISD::BIT_CONVERT, dl, NOutVT, Lo);
00088       Hi = DAG.getNode(ISD::BIT_CONVERT, dl, NOutVT, Hi);
00089       return;
00090     }
00091   }
00092 
00093   if (InVT.isVector() && OutVT.isInteger()) {
00094     // Handle cases like i64 = BIT_CONVERT v1i64 on x86, where the operand
00095     // is legal but the result is not.
00096     EVT NVT = EVT::getVectorVT(*DAG.getContext(), NOutVT, 2);
00097 
00098     if (isTypeLegal(NVT)) {
00099       SDValue CastInOp = DAG.getNode(ISD::BIT_CONVERT, dl, NVT, InOp);
00100       Lo = DAG.getNode(ISD::EXTRACT_VECTOR_ELT, dl, NOutVT, CastInOp,
00101                        DAG.getIntPtrConstant(0));
00102       Hi = DAG.getNode(ISD::EXTRACT_VECTOR_ELT, dl, NOutVT, CastInOp,
00103                        DAG.getIntPtrConstant(1));
00104 
00105       if (TLI.isBigEndian())
00106         std::swap(Lo, Hi);
00107 
00108       return;
00109     }
00110   }
00111 
00112   // Lower the bit-convert to a store/load from the stack.
00113   assert(NOutVT.isByteSized() && "Expanded type not byte sized!");
00114 
00115   // Create the stack frame object.  Make sure it is aligned for both
00116   // the source and expanded destination types.
00117   unsigned Alignment =
00118     TLI.getTargetData()->getPrefTypeAlignment(NOutVT.getTypeForEVT(*DAG.getContext()));
00119   SDValue StackPtr = DAG.CreateStackTemporary(InVT, Alignment);
00120   int SPFI = cast<FrameIndexSDNode>(StackPtr.getNode())->getIndex();
00121   const Value *SV = PseudoSourceValue::getFixedStack(SPFI);
00122 
00123   // Emit a store to the stack slot.
00124   SDValue Store = DAG.getStore(DAG.getEntryNode(), dl, InOp, StackPtr, SV, 0);
00125 
00126   // Load the first half from the stack slot.
00127   Lo = DAG.getLoad(NOutVT, dl, Store, StackPtr, SV, 0);
00128 
00129   // Increment the pointer to the other half.
00130   unsigned IncrementSize = NOutVT.getSizeInBits() / 8;
00131   StackPtr = DAG.getNode(ISD::ADD, dl, StackPtr.getValueType(), StackPtr,
00132                          DAG.getIntPtrConstant(IncrementSize));
00133 
00134   // Load the second half from the stack slot.
00135   Hi = DAG.getLoad(NOutVT, dl, Store, StackPtr, SV, IncrementSize, false,
00136                    MinAlign(Alignment, IncrementSize));
00137 
00138   // Handle endianness of the load.
00139   if (TLI.isBigEndian())
00140     std::swap(Lo, Hi);
00141 }
00142 
00143 void DAGTypeLegalizer::ExpandRes_BUILD_PAIR(SDNode *N, SDValue &Lo,
00144                                             SDValue &Hi) {
00145   // Return the operands.
00146   Lo = N->getOperand(0);
00147   Hi = N->getOperand(1);
00148 }
00149 
00150 void DAGTypeLegalizer::ExpandRes_EXTRACT_ELEMENT(SDNode *N, SDValue &Lo,
00151                                                  SDValue &Hi) {
00152   GetExpandedOp(N->getOperand(0), Lo, Hi);
00153   SDValue Part = cast<ConstantSDNode>(N->getOperand(1))->getZExtValue() ?
00154                    Hi : Lo;
00155 
00156   assert(Part.getValueType() == N->getValueType(0) &&
00157          "Type twice as big as expanded type not itself expanded!");
00158 
00159   GetPairElements(Part, Lo, Hi);
00160 }
00161 
00162 void DAGTypeLegalizer::ExpandRes_EXTRACT_VECTOR_ELT(SDNode *N, SDValue &Lo,
00163                                                     SDValue &Hi) {
00164   SDValue OldVec = N->getOperand(0);
00165   unsigned OldElts = OldVec.getValueType().getVectorNumElements();
00166   DebugLoc dl = N->getDebugLoc();
00167 
00168   // Convert to a vector of the expanded element type, for example
00169   // <3 x i64> -> <6 x i32>.
00170   EVT OldVT = N->getValueType(0);
00171   EVT NewVT = TLI.getTypeToTransformTo(*DAG.getContext(), OldVT);
00172 
00173   SDValue NewVec = DAG.getNode(ISD::BIT_CONVERT, dl,
00174                                  EVT::getVectorVT(*DAG.getContext(), NewVT, 2*OldElts),
00175                                  OldVec);
00176 
00177   // Extract the elements at 2 * Idx and 2 * Idx + 1 from the new vector.
00178   SDValue Idx = N->getOperand(1);
00179 
00180   // Make sure the type of Idx is big enough to hold the new values.
00181   if (Idx.getValueType().bitsLT(TLI.getPointerTy()))
00182     Idx = DAG.getNode(ISD::ZERO_EXTEND, dl, TLI.getPointerTy(), Idx);
00183 
00184   Idx = DAG.getNode(ISD::ADD, dl, Idx.getValueType(), Idx, Idx);
00185   Lo = DAG.getNode(ISD::EXTRACT_VECTOR_ELT, dl, NewVT, NewVec, Idx);
00186 
00187   Idx = DAG.getNode(ISD::ADD, dl, Idx.getValueType(), Idx,
00188                     DAG.getConstant(1, Idx.getValueType()));
00189   Hi = DAG.getNode(ISD::EXTRACT_VECTOR_ELT, dl, NewVT, NewVec, Idx);
00190 
00191   if (TLI.isBigEndian())
00192     std::swap(Lo, Hi);
00193 }
00194 
00195 void DAGTypeLegalizer::ExpandRes_NormalLoad(SDNode *N, SDValue &Lo,
00196                                             SDValue &Hi) {
00197   assert(ISD::isNormalLoad(N) && "This routine only for normal loads!");
00198   DebugLoc dl = N->getDebugLoc();
00199 
00200   LoadSDNode *LD = cast<LoadSDNode>(N);
00201   EVT NVT = TLI.getTypeToTransformTo(*DAG.getContext(), LD->getValueType(0));
00202   SDValue Chain = LD->getChain();
00203   SDValue Ptr = LD->getBasePtr();
00204   int SVOffset = LD->getSrcValueOffset();
00205   unsigned Alignment = LD->getAlignment();
00206   bool isVolatile = LD->isVolatile();
00207 
00208   assert(NVT.isByteSized() && "Expanded type not byte sized!");
00209 
00210   Lo = DAG.getLoad(NVT, dl, Chain, Ptr, LD->getSrcValue(), SVOffset,
00211                    isVolatile, Alignment);
00212 
00213   // Increment the pointer to the other half.
00214   unsigned IncrementSize = NVT.getSizeInBits() / 8;
00215   Ptr = DAG.getNode(ISD::ADD, dl, Ptr.getValueType(), Ptr,
00216                     DAG.getIntPtrConstant(IncrementSize));
00217   Hi = DAG.getLoad(NVT, dl, Chain, Ptr, LD->getSrcValue(),
00218                    SVOffset+IncrementSize,
00219                    isVolatile, MinAlign(Alignment, IncrementSize));
00220 
00221   // Build a factor node to remember that this load is independent of the
00222   // other one.
00223   Chain = DAG.getNode(ISD::TokenFactor, dl, MVT::Other, Lo.getValue(1),
00224                       Hi.getValue(1));
00225 
00226   // Handle endianness of the load.
00227   if (TLI.isBigEndian())
00228     std::swap(Lo, Hi);
00229 
00230   // Modified the chain - switch anything that used the old chain to use
00231   // the new one.
00232   ReplaceValueWith(SDValue(N, 1), Chain);
00233 }
00234 
00235 void DAGTypeLegalizer::ExpandRes_VAARG(SDNode *N, SDValue &Lo, SDValue &Hi) {
00236   EVT NVT = TLI.getTypeToTransformTo(*DAG.getContext(), N->getValueType(0));
00237   SDValue Chain = N->getOperand(0);
00238   SDValue Ptr = N->getOperand(1);
00239   DebugLoc dl = N->getDebugLoc();
00240 
00241   Lo = DAG.getVAArg(NVT, dl, Chain, Ptr, N->getOperand(2));
00242   Hi = DAG.getVAArg(NVT, dl, Lo.getValue(1), Ptr, N->getOperand(2));
00243 
00244   // Handle endianness of the load.
00245   if (TLI.isBigEndian())
00246     std::swap(Lo, Hi);
00247 
00248   // Modified the chain - switch anything that used the old chain to use
00249   // the new one.
00250   ReplaceValueWith(SDValue(N, 1), Hi.getValue(1));
00251 }
00252 
00253 
00254 //===--------------------------------------------------------------------===//
00255 // Generic Operand Expansion.
00256 //===--------------------------------------------------------------------===//
00257 
00258 SDValue DAGTypeLegalizer::ExpandOp_BIT_CONVERT(SDNode *N) {
00259   DebugLoc dl = N->getDebugLoc();
00260   if (N->getValueType(0).isVector()) {
00261     // An illegal expanding type is being converted to a legal vector type.
00262     // Make a two element vector out of the expanded parts and convert that
00263     // instead, but only if the new vector type is legal (otherwise there
00264     // is no point, and it might create expansion loops).  For example, on
00265     // x86 this turns v1i64 = BIT_CONVERT i64 into v1i64 = BIT_CONVERT v2i32.
00266     EVT OVT = N->getOperand(0).getValueType();
00267     EVT NVT = EVT::getVectorVT(*DAG.getContext(), TLI.getTypeToTransformTo(*DAG.getContext(), OVT), 2);
00268 
00269     if (isTypeLegal(NVT)) {
00270       SDValue Parts[2];
00271       GetExpandedOp(N->getOperand(0), Parts[0], Parts[1]);
00272 
00273       if (TLI.isBigEndian())
00274         std::swap(Parts[0], Parts[1]);
00275 
00276       SDValue Vec = DAG.getNode(ISD::BUILD_VECTOR, dl, NVT, Parts, 2);
00277       return DAG.getNode(ISD::BIT_CONVERT, dl, N->getValueType(0), Vec);
00278     }
00279   }
00280 
00281   // Otherwise, store to a temporary and load out again as the new type.
00282   return CreateStackStoreLoad(N->getOperand(0), N->getValueType(0));
00283 }
00284 
00285 SDValue DAGTypeLegalizer::ExpandOp_BUILD_VECTOR(SDNode *N) {
00286   // The vector type is legal but the element type needs expansion.
00287   EVT VecVT = N->getValueType(0);
00288   unsigned NumElts = VecVT.getVectorNumElements();
00289   EVT OldVT = N->getOperand(0).getValueType();
00290   EVT NewVT = TLI.getTypeToTransformTo(*DAG.getContext(), OldVT);
00291   DebugLoc dl = N->getDebugLoc();
00292 
00293   assert(OldVT == VecVT.getVectorElementType() &&
00294          "BUILD_VECTOR operand type doesn't match vector element type!");
00295 
00296   // Build a vector of twice the length out of the expanded elements.
00297   // For example <3 x i64> -> <6 x i32>.
00298   std::vector<SDValue> NewElts;
00299   NewElts.reserve(NumElts*2);
00300 
00301   for (unsigned i = 0; i < NumElts; ++i) {
00302     SDValue Lo, Hi;
00303     GetExpandedOp(N->getOperand(i), Lo, Hi);
00304     if (TLI.isBigEndian())
00305       std::swap(Lo, Hi);
00306     NewElts.push_back(Lo);
00307     NewElts.push_back(Hi);
00308   }
00309 
00310   SDValue NewVec = DAG.getNode(ISD::BUILD_VECTOR, dl,
00311                                  EVT::getVectorVT(*DAG.getContext(), NewVT, NewElts.size()),
00312                                  &NewElts[0], NewElts.size());
00313 
00314   // Convert the new vector to the old vector type.
00315   return DAG.getNode(ISD::BIT_CONVERT, dl, VecVT, NewVec);
00316 }
00317 
00318 SDValue DAGTypeLegalizer::ExpandOp_EXTRACT_ELEMENT(SDNode *N) {
00319   SDValue Lo, Hi;
00320   GetExpandedOp(N->getOperand(0), Lo, Hi);
00321   return cast<ConstantSDNode>(N->getOperand(1))->getZExtValue() ? Hi : Lo;
00322 }
00323 
00324 SDValue DAGTypeLegalizer::ExpandOp_INSERT_VECTOR_ELT(SDNode *N) {
00325   // The vector type is legal but the element type needs expansion.
00326   EVT VecVT = N->getValueType(0);
00327   unsigned NumElts = VecVT.getVectorNumElements();
00328   DebugLoc dl = N->getDebugLoc();
00329 
00330   SDValue Val = N->getOperand(1);
00331   EVT OldEVT = Val.getValueType();
00332   EVT NewEVT = TLI.getTypeToTransformTo(*DAG.getContext(), OldEVT);
00333 
00334   assert(OldEVT == VecVT.getVectorElementType() &&
00335          "Inserted element type doesn't match vector element type!");
00336 
00337   // Bitconvert to a vector of twice the length with elements of the expanded
00338   // type, insert the expanded vector elements, and then convert back.
00339   EVT NewVecVT = EVT::getVectorVT(*DAG.getContext(), NewEVT, NumElts*2);
00340   SDValue NewVec = DAG.getNode(ISD::BIT_CONVERT, dl,
00341                                NewVecVT, N->getOperand(0));
00342 
00343   SDValue Lo, Hi;
00344   GetExpandedOp(Val, Lo, Hi);
00345   if (TLI.isBigEndian())
00346     std::swap(Lo, Hi);
00347 
00348   SDValue Idx = N->getOperand(2);
00349   Idx = DAG.getNode(ISD::ADD, dl, Idx.getValueType(), Idx, Idx);
00350   NewVec = DAG.getNode(ISD::INSERT_VECTOR_ELT, dl, NewVecVT, NewVec, Lo, Idx);
00351   Idx = DAG.getNode(ISD::ADD, dl,
00352                     Idx.getValueType(), Idx, DAG.getIntPtrConstant(1));
00353   NewVec =  DAG.getNode(ISD::INSERT_VECTOR_ELT, dl, NewVecVT, NewVec, Hi, Idx);
00354 
00355   // Convert the new vector to the old vector type.
00356   return DAG.getNode(ISD::BIT_CONVERT, dl, VecVT, NewVec);
00357 }
00358 
00359 SDValue DAGTypeLegalizer::ExpandOp_SCALAR_TO_VECTOR(SDNode *N) {
00360   DebugLoc dl = N->getDebugLoc();
00361   EVT VT = N->getValueType(0);
00362   assert(VT.getVectorElementType() == N->getOperand(0).getValueType() &&
00363          "SCALAR_TO_VECTOR operand type doesn't match vector element type!");
00364   unsigned NumElts = VT.getVectorNumElements();
00365   SmallVector<SDValue, 16> Ops(NumElts);
00366   Ops[0] = N->getOperand(0);
00367   SDValue UndefVal = DAG.getUNDEF(Ops[0].getValueType());
00368   for (unsigned i = 1; i < NumElts; ++i)
00369     Ops[i] = UndefVal;
00370   return DAG.getNode(ISD::BUILD_VECTOR, dl, VT, &Ops[0], NumElts);
00371 }
00372 
00373 SDValue DAGTypeLegalizer::ExpandOp_NormalStore(SDNode *N, unsigned OpNo) {
00374   assert(ISD::isNormalStore(N) && "This routine only for normal stores!");
00375   assert(OpNo == 1 && "Can only expand the stored value so far");
00376   DebugLoc dl = N->getDebugLoc();
00377 
00378   StoreSDNode *St = cast<StoreSDNode>(N);
00379   EVT NVT = TLI.getTypeToTransformTo(*DAG.getContext(), St->getValue().getValueType());
00380   SDValue Chain = St->getChain();
00381   SDValue Ptr = St->getBasePtr();
00382   int SVOffset = St->getSrcValueOffset();
00383   unsigned Alignment = St->getAlignment();
00384   bool isVolatile = St->isVolatile();
00385 
00386   assert(NVT.isByteSized() && "Expanded type not byte sized!");
00387   unsigned IncrementSize = NVT.getSizeInBits() / 8;
00388 
00389   SDValue Lo, Hi;
00390   GetExpandedOp(St->getValue(), Lo, Hi);
00391 
00392   if (TLI.isBigEndian())
00393     std::swap(Lo, Hi);
00394 
00395   Lo = DAG.getStore(Chain, dl, Lo, Ptr, St->getSrcValue(), SVOffset,
00396                     isVolatile, Alignment);
00397 
00398   Ptr = DAG.getNode(ISD::ADD, dl, Ptr.getValueType(), Ptr,
00399                     DAG.getIntPtrConstant(IncrementSize));
00400   assert(isTypeLegal(Ptr.getValueType()) && "Pointers must be legal!");
00401   Hi = DAG.getStore(Chain, dl, Hi, Ptr, St->getSrcValue(),
00402                     SVOffset + IncrementSize,
00403                     isVolatile, MinAlign(Alignment, IncrementSize));
00404 
00405   return DAG.getNode(ISD::TokenFactor, dl, MVT::Other, Lo, Hi);
00406 }
00407 
00408 
00409 //===--------------------------------------------------------------------===//
00410 // Generic Result Splitting.
00411 //===--------------------------------------------------------------------===//
00412 
00413 // Be careful to make no assumptions about which of Lo/Hi is stored first in
00414 // memory (for vectors it is always Lo first followed by Hi in the following
00415 // bytes; for integers and floats it is Lo first if and only if the machine is
00416 // little-endian).
00417 
00418 void DAGTypeLegalizer::SplitRes_MERGE_VALUES(SDNode *N,
00419                                              SDValue &Lo, SDValue &Hi) {
00420   // A MERGE_VALUES node can produce any number of values.  We know that the
00421   // first illegal one needs to be expanded into Lo/Hi.
00422   unsigned i;
00423 
00424   // The string of legal results gets turned into input operands, which have
00425   // the same type.
00426   for (i = 0; isTypeLegal(N->getValueType(i)); ++i)
00427     ReplaceValueWith(SDValue(N, i), SDValue(N->getOperand(i)));
00428 
00429   // The first illegal result must be the one that needs to be expanded.
00430   GetSplitOp(N->getOperand(i), Lo, Hi);
00431 
00432   // Legalize the rest of the results into the input operands whether they are
00433   // legal or not.
00434   unsigned e = N->getNumValues();
00435   for (++i; i != e; ++i)
00436     ReplaceValueWith(SDValue(N, i), SDValue(N->getOperand(i)));
00437 }
00438 
00439 void DAGTypeLegalizer::SplitRes_SELECT(SDNode *N, SDValue &Lo,
00440                                        SDValue &Hi) {
00441   SDValue LL, LH, RL, RH;
00442   DebugLoc dl = N->getDebugLoc();
00443   GetSplitOp(N->getOperand(1), LL, LH);
00444   GetSplitOp(N->getOperand(2), RL, RH);
00445 
00446   SDValue Cond = N->getOperand(0);
00447   Lo = DAG.getNode(ISD::SELECT, dl, LL.getValueType(), Cond, LL, RL);
00448   Hi = DAG.getNode(ISD::SELECT, dl, LH.getValueType(), Cond, LH, RH);
00449 }
00450 
00451 void DAGTypeLegalizer::SplitRes_SELECT_CC(SDNode *N, SDValue &Lo,
00452                                           SDValue &Hi) {
00453   SDValue LL, LH, RL, RH;
00454   DebugLoc dl = N->getDebugLoc();
00455   GetSplitOp(N->getOperand(2), LL, LH);
00456   GetSplitOp(N->getOperand(3), RL, RH);
00457 
00458   Lo = DAG.getNode(ISD::SELECT_CC, dl, LL.getValueType(), N->getOperand(0),
00459                    N->getOperand(1), LL, RL, N->getOperand(4));
00460   Hi = DAG.getNode(ISD::SELECT_CC, dl, LH.getValueType(), N->getOperand(0),
00461                    N->getOperand(1), LH, RH, N->getOperand(4));
00462 }
00463 
00464 void DAGTypeLegalizer::SplitRes_UNDEF(SDNode *N, SDValue &Lo, SDValue &Hi) {
00465   EVT LoVT, HiVT;
00466   DebugLoc dl = N->getDebugLoc();
00467   GetSplitDestVTs(N->getValueType(0), LoVT, HiVT);
00468   Lo = DAG.getUNDEF(LoVT);
00469   Hi = DAG.getUNDEF(HiVT);
00470 }