Home | History | Annotate | Download | only in SelectionDAG

Lines Matching defs:DAG

1 //===-- SelectionDAGBuilder.cpp - Selection-DAG building ------------------===//
74 // Limit the width of DAG chains. This is important in general to prevent
75 // prevent DAG-based analysis from blowing up. For example, alias analysis and
78 // future analyses are likely to have the same behavior. Limiting DAG width is
90 static SDValue getCopyFromPartsVector(SelectionDAG &DAG, DebugLoc DL,
99 static SDValue getCopyFromParts(SelectionDAG &DAG, DebugLoc DL,
104 return getCopyFromPartsVector(DAG, DL, Parts, NumParts, PartVT, ValueVT);
107 const TargetLowering &TLI = DAG.getTargetLoweringInfo();
121 ValueVT : EVT::getIntegerVT(*DAG.getContext(), RoundBits);
124 EVT HalfVT = EVT::getIntegerVT(*DAG.getContext(), RoundBits/2);
127 Lo = getCopyFromParts(DAG, DL, Parts, RoundParts / 2,
129 Hi = getCopyFromParts(DAG, DL, Parts + RoundParts / 2,
132 Lo = DAG.getNode(ISD::BITCAST, DL, HalfVT, Parts[0]);
133 Hi = DAG.getNode(ISD::BITCAST, DL, HalfVT, Parts[1]);
139 Val = DAG.getNode(ISD::BUILD_PAIR, DL, RoundVT, Lo, Hi);
144 EVT OddVT = EVT::getIntegerVT(*DAG.getContext(), OddParts * PartBits);
145 Hi = getCopyFromParts(DAG, DL,
152 EVT TotalVT = EVT::getIntegerVT(*DAG.getContext(), NumParts * PartBits);
153 Hi = DAG.getNode(ISD::ANY_EXTEND, DL, TotalVT, Hi);
154 Hi = DAG.getNode(ISD::SHL, DL, TotalVT, Hi,
155 DAG.getConstant(Lo.getValueType().getSizeInBits(),
157 Lo = DAG.getNode(ISD::ZERO_EXTEND, DL, TotalVT, Lo);
158 Val = DAG.getNode(ISD::OR, DL, TotalVT, Lo, Hi);
165 Lo = DAG.getNode(ISD::BITCAST, DL, EVT(MVT::f64), Parts[0]);
166 Hi = DAG.getNode(ISD::BITCAST, DL, EVT(MVT::f64), Parts[1]);
169 Val = DAG.getNode(ISD::BUILD_PAIR, DL, ValueVT, Lo, Hi);
174 EVT IntVT = EVT::getIntegerVT(*DAG.getContext(), ValueVT.getSizeInBits());
175 Val = getCopyFromParts(DAG, DL, Parts, NumParts, PartVT, IntVT);
191 Val = DAG.getNode(AssertOp, DL, PartVT, Val,
192 DAG.getValueType(ValueVT));
193 return DAG.getNode(ISD::TRUNCATE, DL, ValueVT, Val);
195 return DAG.getNode(ISD::ANY_EXTEND, DL, ValueVT, Val);
201 return DAG.getNode(ISD::FP_ROUND, DL, ValueVT, Val,
202 DAG.getTargetConstant(1, TLI.getPointerTy()));
204 return DAG.getNode(ISD::FP_EXTEND, DL, ValueVT, Val);
208 return DAG.getNode(ISD::BITCAST, DL, ValueVT, Val);
218 static SDValue getCopyFromPartsVector(SelectionDAG &DAG, DebugLoc DL,
223 const TargetLowering &TLI = DAG.getTargetLoweringInfo();
231 TLI.getVectorTypeBreakdown(*DAG.getContext(), ValueVT, IntermediateVT,
245 Ops[i] = getCopyFromParts(DAG, DL, &Parts[i], 1,
254 Ops[i] = getCopyFromParts(DAG, DL, &Parts[i * Factor], Factor,
260 Val = DAG.getNode(IntermediateVT.isVector() ?
279 return DAG.getNode(ISD::EXTRACT_SUBVECTOR, DL, ValueVT, Val,
280 DAG.getIntPtrConstant(0));
285 return DAG.getNode(ISD::BITCAST, DL, ValueVT, Val);
291 return DAG.getNode((Smaller ? ISD::TRUNCATE : ISD::ANY_EXTEND),
300 return DAG.getNode(ISD::BITCAST, DL, ValueVT, Val);
309 Val = DAG.getNode((Smaller ? ISD::TRUNCATE : ISD::ANY_EXTEND),
313 return DAG.getNode(ISD::BUILD_VECTOR, DL, ValueVT, Val);
319 static void getCopyToPartsVector(SelectionDAG &DAG, DebugLoc dl,
326 static void getCopyToParts(SelectionDAG &DAG, DebugLoc DL,
334 return getCopyToPartsVector(DAG, DL, Val, Parts, NumParts, PartVT);
336 const TargetLowering &TLI = DAG.getTargetLoweringInfo();
355 Val = DAG.getNode(ISD::FP_EXTEND, DL, PartVT, Val);
360 ValueVT = EVT::getIntegerVT(*DAG.getContext(), NumParts * PartBits);
361 Val = DAG.getNode(ExtendKind, DL, ValueVT, Val);
363 Val = DAG.getNode(ISD::BITCAST, DL, PartVT, Val);
368 Val = DAG.getNode(ISD::BITCAST, DL, PartVT, Val);
374 ValueVT = EVT::getIntegerVT(*DAG.getContext(), NumParts * PartBits);
375 Val = DAG.getNode(ISD::TRUNCATE, DL, ValueVT, Val);
377 Val = DAG.getNode(ISD::BITCAST, DL, PartVT, Val);
399 SDValue OddVal = DAG.getNode(ISD::SRL, DL, ValueVT, Val,
400 DAG.getIntPtrConstant(RoundBits));
401 getCopyToParts(DAG, DL, OddVal, Parts + RoundParts, OddParts, PartVT);
408 ValueVT = EVT::getIntegerVT(*DAG.getContext(), NumParts * PartBits);
409 Val = DAG.getNode(ISD::TRUNCATE, DL, ValueVT, Val);
414 Parts[0] = DAG.getNode(ISD::BITCAST, DL,
415 EVT::getIntegerVT(*DAG.getContext(),
422 EVT ThisVT = EVT::getIntegerVT(*DAG.getContext(), ThisBits);
426 Part1 = DAG.getNode(ISD::EXTRACT_ELEMENT, DL,
427 ThisVT, Part0, DAG.getIntPtrConstant(1));
428 Part0 = DAG.getNode(ISD::EXTRACT_ELEMENT, DL,
429 ThisVT, Part0, DAG.getIntPtrConstant(0));
432 Part0 = DAG.getNode(ISD::BITCAST, DL, PartVT, Part0);
433 Part1 = DAG.getNode(ISD::BITCAST, DL, PartVT, Part1);
445 static void getCopyToPartsVector(SelectionDAG &DAG, DebugLoc DL,
450 const TargetLowering &TLI = DAG.getTargetLoweringInfo();
457 Val = DAG.getNode(ISD::BITCAST, DL, PartVT, Val);
466 Ops.push_back(DAG.getNode(ISD::EXTRACT_VECTOR_ELT, DL,
467 ElementVT, Val, DAG.getIntPtrConstant(i)));
471 Ops.push_back(DAG.getUNDEF(ElementVT));
473 Val = DAG.getNode(ISD::BUILD_VECTOR, DL, PartVT, &Ops[0], Ops.size());
477 //SDValue UndefElts = DAG.getUNDEF(VectorTy);
478 //Val = DAG.getNode(ISD::CONCAT_VECTORS, DL, PartVT, Val, UndefElts);
486 Val = DAG.getNode((Smaller ? ISD::TRUNCATE : ISD::ANY_EXTEND),
492 Val = DAG.getNode(ISD::EXTRACT_VECTOR_ELT, DL,
493 PartVT, Val, DAG.getIntPtrConstant(0));
496 Val = DAG.getNode((Smaller ? ISD::TRUNCATE : ISD::ANY_EXTEND),
507 unsigned NumRegs = TLI.getVectorTypeBreakdown(*DAG.getContext(), ValueVT,
520 Ops[i] = DAG.getNode(ISD::EXTRACT_SUBVECTOR, DL,
522 DAG.getIntPtrConstant(i * (NumElements / NumIntermediates)));
524 Ops[i] = DAG.getNode(ISD::EXTRACT_VECTOR_ELT, DL,
525 IntermediateVT, Val, DAG.getIntPtrConstant(i));
533 getCopyToParts(DAG, DL, Ops[i], &Parts[i], 1, PartVT);
541 getCopyToParts(DAG, DL, Ops[i], &Parts[i*Factor], Factor, PartVT);
623 SDValue getCopyFromRegs(SelectionDAG &DAG, FunctionLoweringInfo &FuncInfo,
631 void getCopyToRegs(SDValue Val, SelectionDAG &DAG, DebugLoc dl,
639 SelectionDAG &DAG,
648 SDValue RegsForValue::getCopyFromRegs(SelectionDAG &DAG,
656 const TargetLowering &TLI = DAG.getTargetLoweringInfo();
664 unsigned NumRegs = TLI.getNumRegisters(*DAG.getContext(), ValueVT);
671 P = DAG.getCopyFromReg(Chain, dl, Regs[Part+i], RegisterVT);
673 P = DAG.getCopyFromReg(Chain, dl, Regs[Part+i], RegisterVT, *Flag);
695 // FIXME: We capture more information than the dag can represent. For
720 Parts[i] = DAG.getNode(isSExt ? ISD::AssertSext : ISD::AssertZext, dl,
721 RegisterVT, P, DAG.getValueType(FromVT));
724 Values[Value] = getCopyFromParts(DAG, dl, Parts.begin(),
730 return DAG.getNode(ISD::MERGE_VALUES, dl,
731 DAG.getVTList(&ValueVTs[0], ValueVTs.size()),
739 void RegsForValue::getCopyToRegs(SDValue Val, SelectionDAG &DAG, DebugLoc dl,
741 const TargetLowering &TLI = DAG.getTargetLoweringInfo();
748 unsigned NumParts = TLI.getNumRegisters(*DAG.getContext(), ValueVT);
751 getCopyToParts(DAG, dl, Val.getValue(Val.getResNo() + Value),
761 Part = DAG.getCopyToReg(Chain, dl, Regs[i], Parts[i]);
763 Part = DAG.getCopyToReg(Chain, dl, Regs[i], Parts[i], *Flag);
783 Chain = DAG.getNode(ISD::TokenFactor, dl, MVT::Other, &Chains[0], NumRegs);
791 SelectionDAG &DAG,
793 const TargetLowering &TLI = DAG.getTargetLoweringInfo();
805 const MachineRegisterInfo &MRI = DAG.getMachineFunction().getRegInfo();
810 SDValue Res = DAG.getTargetConstant(Flag, MVT::i32);
814 unsigned NumRegs = TLI.getNumRegisters(*DAG.getContext(), ValueVTs[Value]);
818 Ops.push_back(DAG.getRegister(Regs[Reg++], RegisterVT));
828 TD = DAG.getTarget().getTargetData();
829 Context = DAG.getContext();
858 /// getRoot - Return the current virtual root of the Selection DAG,
865 return DAG.getRoot();
869 DAG.setRoot(Root);
875 SDValue Root = DAG.getNode(ISD::TokenFactor, getCurDebugLoc(), MVT::Other,
878 DAG.setRoot(Root);
887 SDValue Root = DAG.getRoot();
905 Root = DAG.getNode(ISD::TokenFactor, getCurDebugLoc(), MVT::Other,
909 DAG.setRoot(Root);
914 if (DAG.GetOrdering(Node) != 0) return; // Already has ordering.
915 DAG.AssignOrdering(Node, SDNodeOrder);
951 // Assign the ordering to the freshly created DAG nodes.
972 SDV = DAG.getDbgValue(Variable, Val.getNode(),
974 DAG.AddDbgValue(SDV, Val.getNode(), false);
995 RegsForValue RFV(*DAG.getContext(), TLI, InReg, V->getType());
996 SDValue Chain = DAG.getEntryNode();
997 N = RFV.getCopyFromRegs(DAG, FuncInfo, getCurDebugLoc(), Chain, NULL);
1030 return DAG.getConstant(*CI, VT);
1033 return DAG.getGlobalAddress(GV, getCurDebugLoc(), VT);
1036 return DAG.getConstant(0, TLI.getPointerTy());
1039 return DAG.getConstantFP(*CFP, VT);
1042 return DAG.getUNDEF(VT);
1064 return DAG.getMergeValues(&Constants[0], Constants.size(),
1080 return DAG.getMergeValues(&Ops[0], Ops.size(), getCurDebugLoc());
1081 return NodeMap[V] = DAG.getNode(ISD::BUILD_VECTOR, getCurDebugLoc(),
1098 Constants[i] = DAG.getUNDEF(EltVT);
1100 Constants[i] = DAG.getConstantFP(0, EltVT);
1102 Constants[i] = DAG.getConstant(0, EltVT);
1105 return DAG.getMergeValues(&Constants[0], NumElts,
1110 return DAG.getBlockAddress(BA, VT);
1127 Op = DAG.getConstantFP(0, EltVT);
1129 Op = DAG.getConstant(0, EltVT);
1134 return NodeMap[V] = DAG.getNode(ISD::BUILD_VECTOR, getCurDebugLoc(),
1144 return DAG.getFrameIndex(SI->second, TLI.getPointerTy());
1150 RegsForValue RFV(*DAG.getContext(), TLI, InReg, Inst->getType());
1151 SDValue Chain = DAG.getEntryNode();
1152 return RFV.getCopyFromRegs(DAG, FuncInfo, getCurDebugLoc(), Chain, NULL);
1174 SDValue RetPtr = DAG.getRegister(DemoteReg, PtrValueVTs[0]);
1184 SDValue Add = DAG.getNode(ISD::ADD, getCurDebugLoc(),
1186 DAG.getIntPtrConstant(Offsets[i]));
1188 DAG.getStore(Chain, getCurDebugLoc(),
1194 Chain = DAG.getNode(ISD::TokenFactor, getCurDebugLoc(),
1214 VT = TLI.getTypeForExtArgOrReturn(*DAG.getContext(), VT, ExtendKind);
1216 unsigned NumParts = TLI.getNumRegisters(*DAG.getContext(), VT);
1217 EVT PartVT = TLI.getRegisterType(*DAG.getContext(), VT);
1219 getCopyToParts(DAG, getCurDebugLoc(),
1243 bool isVarArg = DAG.getMachineFunction().getFunction()->isVarArg();
1245 DAG.getMachineFunction().getFunction()->getCallingConv();
1247 Outs, OutVals, getCurDebugLoc(), DAG);
1253 // Update the DAG with the new chain value resulting from return lowering.
1254 DAG.setRoot(Chain);
1380 CaseBlock CB(ISD::SETEQ, Cond, ConstantInt::getTrue(*DAG.getContext()),
1405 MachineFunction &MF = DAG.getMachineFunction();
1491 DAG.setRoot(DAG.getNode(ISD::BR, getCurDebugLoc(),
1493 DAG.getBasicBlock(Succ0MBB)));
1554 CaseBlock CB(ISD::SETEQ, CondVal, ConstantInt::getTrue(*DAG.getContext()),
1574 if (CB.CmpRHS == ConstantInt::getTrue(*DAG.getContext()) &&
1577 else if (CB.CmpRHS == ConstantInt::getFalse(*DAG.getContext()) &&
1579 SDValue True = DAG.getConstant(1, CondLHS.getValueType());
1580 Cond = DAG.getNode(ISD::XOR, dl, CondLHS.getValueType(), CondLHS, True);
1582 Cond = DAG.getSetCC(dl, MVT::i1, CondLHS, getValue(CB.CmpRHS), CB.CC);
1594 Cond = DAG.getSetCC(dl, MVT::i1, CmpOp, DAG.getConstant(High, VT),
1597 SDValue SUB = DAG.getNode(ISD::SUB, dl,
1598 VT, CmpOp, DAG.getConstant(Low, VT));
1599 Cond = DAG.getSetCC(dl, MVT::i1, SUB,
1600 DAG.getConstant(High-Low, VT), ISD::SETULE);
1622 SDValue True = DAG.getConstant(1, Cond.getValueType());
1623 Cond = DAG.getNode(ISD::XOR, dl, Cond.getValueType(), Cond, True);
1626 SDValue BrCond = DAG.getNode(ISD::BRCOND, dl,
1628 DAG.getBasicBlock(CB.TrueBB));
1631 // this makes it easier to do DAG optimizations which require inverting
1633 BrCond = DAG.getNode(ISD::BR, dl, MVT::Other, BrCond,
1634 DAG.getBasicBlock(CB.FalseBB));
1636 DAG.setRoot(BrCond);
1644 SDValue Index = DAG.getCopyFromReg(getControlRoot(), getCurDebugLoc(),
1646 SDValue Table = DAG.getJumpTable(JT.JTI, PTy);
1647 SDValue BrJumpTable = DAG.getNode(ISD::BR_JT, getCurDebugLoc(),
1650 DAG.setRoot(BrJumpTable);
1663 SDValue Sub = DAG.getNode(ISD::SUB, getCurDebugLoc(), VT, SwitchOp,
1664 DAG.getConstant(JTH.First, VT));
1671 SwitchOp = DAG.getZExtOrTrunc(Sub, getCurDebugLoc(), TLI.getPointerTy());
1674 SDValue CopyTo = DAG.getCopyToReg(getControlRoot(), getCurDebugLoc(),
1681 SDValue CMP = DAG.getSetCC(getCurDebugLoc(),
1683 DAG.getConstant(JTH.Last-JTH.First,VT),
1694 SDValue BrCond = DAG.getNode(ISD::BRCOND, getCurDebugLoc(),
1696 DAG.getBasicBlock(JT.Default));
1699 BrCond = DAG.getNode(ISD::BR, getCurDebugLoc(), MVT::Other, BrCond,
1700 DAG.getBasicBlock(JT.MBB));
1702 DAG.setRoot(BrCond);
1712 SDValue Sub = DAG.getNode(ISD::SUB, getCurDebugLoc(), VT, SwitchOp,
1713 DAG.getConstant(B.First, VT));
1716 SDValue RangeCmp = DAG.getSetCC(getCurDebugLoc(),
1718 Sub, DAG.getConstant(B.Range, VT),
1736 Sub = DAG.getZExtOrTrunc(Sub, getCurDebugLoc(), VT);
1741 SDValue CopyTo = DAG.getCopyToReg(getControlRoot(), getCurDebugLoc(),
1756 SDValue BrRange = DAG.getNode(ISD::BRCOND, getCurDebugLoc(),
1758 DAG.getBasicBlock(B.Default));
1761 BrRange = DAG.getNode(ISD::BR, getCurDebugLoc(), MVT::Other, CopyTo,
1762 DAG.getBasicBlock(MBB));
1764 DAG.setRoot(BrRange);
1775 SDValue ShiftOp = DAG.getCopyFromReg(getControlRoot(), getCurDebugLoc(),
1782 Cmp = DAG.getSetCC(getCurDebugLoc(),
1785 DAG.getConstant(CountTrailingZeros_64(B.Mask), VT),
1789 Cmp = DAG.getSetCC(getCurDebugLoc(),
1792 DAG.getConstant(CountTrailingOnes_64(B.Mask), VT),
1796 SDValue SwitchVal = DAG.getNode(ISD::SHL, getCurDebugLoc(), VT,
1797 DAG.getConstant(1, VT), ShiftOp);
1800 SDValue AndOp = DAG.getNode(ISD::AND, getCurDebugLoc(),
1801 VT, SwitchVal, DAG.getConstant(B.Mask, VT));
1802 Cmp = DAG.getSetCC(getCurDebugLoc(),
1804 AndOp, DAG.getConstant(0, VT),
1813 SDValue BrAnd = DAG.getNode(ISD::BRCOND, getCurDebugLoc(),
1815 Cmp, DAG.getBasicBlock(B.TargetBB));
1825 BrAnd = DAG.getNode(ISD::BR, getCurDebugLoc(), MVT::Other, BrAnd,
1826 DAG.getBasicBlock(NextMBB));
1828 DAG.setRoot(BrAnd);
1857 DAG.setRoot(DAG.getNode(ISD::BR, getCurDebugLoc(),
1859 DAG.getBasicBlock(Return)));
1871 MachineModuleInfo &MMI = DAG.getMachineFunction().getMMI();
1875 // exceptions), then don't bother to create these DAG nodes.
1886 SDVTList VTs = DAG.getVTList(TLI.getPointerTy(), MVT::Other);
1888 Ops[0] = DAG.getRoot();
1889 SDValue Op1 = DAG.getNode(ISD::EXCEPTIONADDR, getCurDebugLoc(), VTs, Ops, 1);
1893 VTs = DAG.getVTList(TLI.getPointerTy(), MVT::Other);
1896 SDValue Op2 = DAG.getNode(ISD::EHSELECTION, getCurDebugLoc(), VTs, Ops, 2);
1898 Op2 = DAG.getSExtOrTrunc(Op2, getCurDebugLoc(), MVT::i32);
1902 SDValue Res = DAG.getNode(ISD::MERGE_VALUES, getCurDebugLoc(),
1903 DAG.getVTList(&ValueVTs[0], ValueVTs.size()),
1908 DAG.setRoot(RetPair.second);
1961 SDValue Or = DAG.getNode(ISD::OR, DL, VT, CondLHS,
1962 DAG.getConstant(CommonBit, VT));
1963 SDValue Cond = DAG.getSetCC(DL, MVT::i1,
1964 Or, DAG.getConstant(BigValue, VT),
1976 SDValue BrCond = DAG.getNode(ISD::BRCOND, DL, MVT::Other,
1978 DAG.getBasicBlock(Small.BB));
1981 BrCond = DAG.getNode(ISD::BR, DL, MVT::Other, BrCond,
1982 DAG.getBasicBlock(Default));
1984 DAG.setRoot(BrCond);
2529 DAG.setRoot(DAG.getNode(ISD::BR, getCurDebugLoc(),
2531 DAG.getBasicBlock(Default)));
2595 DAG.setRoot(DAG.getNode(ISD::BRIND, getCurDebugLoc(),
2606 setValue(&I, DAG.getNode(ISD::FNEG, getCurDebugLoc(),
2617 setValue(&I, DAG.getNode(OpCode, getCurDebugLoc(),
2635 Op2 = DAG.getNode(ISD::ZERO_EXTEND, DL, ShiftTy, Op2);
2642 Op2 = DAG.getNode(ISD::TRUNCATE, DL, ShiftTy, Op2);
2646 Op2 = DAG.getZExtOrTrunc(Op2, DL, MVT::i32);
2649 setValue(&I, DAG.getNode(Opcode, getCurDebugLoc(),
2663 setValue(&I, TLI.BuildExactSDIV(Op1, Op2, getCurDebugLoc(), DAG));
2665 setValue(&I, DAG.getNode(ISD::SDIV, getCurDebugLoc(), Op1.getValueType(),
2680 setValue(&I, DAG.getSetCC(getCurDebugLoc(), DestVT, Op1, Op2, Opcode));
2695 setValue(&I, DAG.getSetCC(getCurDebugLoc(), DestVT, Op1, Op2, Condition));
2712 Values[i] = DAG.getNode(OpCode, getCurDebugLoc(),
2720 setValue(&I, DAG.getNode(ISD::MERGE_VALUES, getCurDebugLoc(),
2721 DAG.getVTList(&ValueVTs[0], NumValues),
2729 setValue(&I, DAG.getNode(ISD::TRUNCATE, getCurDebugLoc(), DestVT, N));
2737 setValue(&I, DAG.getNode(ISD::ZERO_EXTEND, getCurDebugLoc(), DestVT, N));
2745 setValue(&I, DAG.getNode(ISD::SIGN_EXTEND, getCurDebugLoc(), DestVT, N));
2752 setValue(&I, DAG.getNode(ISD::FP_ROUND, getCurDebugLoc(),
2754 DAG.getTargetConstant(0, TLI.getPointerTy())));
2761 setValue(&I, DAG.getNode(ISD::FP_EXTEND, getCurDebugLoc(), DestVT, N));
2768 setValue(&I, DAG.getNode(ISD::FP_TO_UINT, getCurDebugLoc(), DestVT, N));
2775 setValue(&I, DAG.getNode(ISD::FP_TO_SINT, getCurDebugLoc(), DestVT, N));
2782 setValue(&I, DAG.getNode(ISD::UINT_TO_FP, getCurDebugLoc(), DestVT, N));
2789 setValue(&I, DAG.getNode(ISD::SINT_TO_FP, getCurDebugLoc(), DestVT, N));
2797 setValue(&I, DAG.getZExtOrTrunc(N, getCurDebugLoc(), DestVT));
2805 setValue(&I, DAG.getZExtOrTrunc(N, getCurDebugLoc(), DestVT));
2815 setValue(&I, DAG.getNode(ISD::BITCAST, getCurDebugLoc(),
2824 SDValue InIdx = DAG.getNode(ISD::ZERO_EXTEND, getCurDebugLoc(),
2827 setValue(&I, DAG.getNode(ISD::INSERT_VECTOR_ELT, getCurDebugLoc(),
2834 SDValue InIdx = DAG.getNode(ISD::ZERO_EXTEND, getCurDebugLoc(),
2837 setValue(&I, DAG.getNode(ISD::EXTRACT_VECTOR_ELT, getCurDebugLoc(),
2865 setValue(&I, DAG.getVectorShuffle(VT, getCurDebugLoc(), Src1, Src2,
2880 setValue(&I, DAG.getNode(ISD::CONCAT_VECTORS, getCurDebugLoc(),
2888 setValue(&I, DAG.getNode(ISD::CONCAT_VECTORS, getCurDebugLoc(),
2898 SDValue UndefVal = DAG.getUNDEF(SrcVT);
2905 Src1 = Src1U ? DAG.getUNDEF(VT) : DAG.getNode(ISD::CONCAT_VECTORS,
2908 Src2 = Src2U ? DAG.getUNDEF(VT) : DAG.getNode(ISD::CONCAT_VECTORS,
2921 setValue(&I, DAG.getVectorShuffle(VT, getCurDebugLoc(), Src1, Src2,
2971 setValue(&I, DAG.getUNDEF(VT)); // Vectors are not used.
2979 Src = DAG.getUNDEF(VT);
2981 Src = DAG.getNode(ISD::EXTRACT_SUBVECTOR, getCurDebugLoc(), VT,
2982 Src, DAG.getIntPtrConstant(StartIdx[Input]));
2998 setValue(&I, DAG.getVectorShuffle(VT, getCurDebugLoc(), Src1, Src2,
3015 Res = DAG.getUNDEF(EltVT);
3020 Res = DAG.getNode(ISD::EXTRACT_VECTOR_ELT, getCurDebugLoc(),
3021 EltVT, Src, DAG.getConstant(Idx, PtrVT));
3027 setValue(&I, DAG.getNode(ISD::BUILD_VECTOR, getCurDebugLoc(),
3054 Values[i] = IntoUndef ? DAG.getUNDEF(AggValueVTs[i]) :
3060 Values[i] = FromUndef ? DAG.getUNDEF(AggValueVTs[i]) :
3065 Values[i] = IntoUndef ? DAG.getUNDEF(AggValueVTs[i]) :
3068 setValue(&I, DAG.getNode(ISD::MERGE_VALUES, getCurDebugLoc(),
3069 DAG.getVTList(&AggValueVTs[0], NumAggValues),
3088 setValue(&I, DAG.getUNDEF(MVT(MVT::Other)));
3099 DAG.getUNDEF(Agg.getNode()->getValueType(Agg.getResNo() + i)) :
3102 setValue(&I, DAG.getNode(ISD::MERGE_VALUES, getCurDebugLoc(),
3103 DAG.getVTList(&ValValueVTs[0], NumValValues),
3121 N = DAG.getNode(ISD::ADD, getCurDebugLoc(), N.getValueType(), N,
3122 DAG.getIntPtrConstant(Offset));
3138 OffsVal = DAG.getNode(ISD::TRUNCATE, getCurDebugLoc(),
3140 DAG.getConstant(Offs, MVT::i64));
3142 OffsVal = DAG.getIntPtrConstant(Offs);
3144 N = DAG.getNode(ISD::ADD, getCurDebugLoc(), N.getValueType(), N,
3156 IdxN = DAG.getSExtOrTrunc(IdxN, getCurDebugLoc(), N.getValueType());
3163 IdxN = DAG.getNode(ISD::SHL, getCurDebugLoc(),
3165 DAG.getConstant(Amt, IdxN.getValueType()));
3167 SDValue Scale = DAG.getConstant(ElementSize, TLI.getPointerTy());
3168 IdxN = DAG.getNode(ISD::MUL, getCurDebugLoc(),
3173 N = DAG.getNode(ISD::ADD, getCurDebugLoc(),
3197 AllocSize = DAG.getZExtOrTrunc(AllocSize, getCurDebugLoc(), IntPtr);
3199 AllocSize = DAG.getNode(ISD::MUL, getCurDebugLoc(), IntPtr,
3201 DAG.getConstant(TySize, IntPtr));
3212 AllocSize = DAG.getNode(ISD::ADD, getCurDebugLoc(),
3214 DAG.getIntPtrConstant(StackAlign-1));
3217 AllocSize = DAG.getNode(ISD::AND, getCurDebugLoc(),
3219 DAG.getIntPtrConstant(~(uint64_t)(StackAlign-1)));
3221 SDValue Ops[] = { getRoot(), AllocSize, DAG.getIntPtrConstant(Align) };
3222 SDVTList VTs = DAG.getVTList(AllocSize.getValueType(), MVT::Other);
3223 SDValue DSA = DAG.getNode(ISD::DYNAMIC_STACKALLOC, getCurDebugLoc(),
3226 DAG.setRoot(DSA.getValue(1));
3264 Root = DAG.getEntryNode();
3268 Root = DAG.getRoot();
3285 SDValue Chain = DAG.getNode(ISD::TokenFactor, getCurDebugLoc(),
3290 SDValue A = DAG.getNode(ISD::ADD, getCurDebugLoc(),
3292 DAG.getConstant(Offsets[i], PtrVT));
3293 SDValue L = DAG.getLoad(ValueVTs[i], getCurDebugLoc(), Root,
3303 SDValue Chain = DAG.getNode(ISD::TokenFactor, getCurDebugLoc(),
3306 DAG.setRoot(Chain);
3311 setValue(&I, DAG.getNode(ISD::MERGE_VALUES, getCurDebugLoc(),
3312 DAG.getVTList(&ValueVTs[0], NumValues),
3349 SDValue Chain = DAG.getNode(ISD::TokenFactor, getCurDebugLoc(),
3354 SDValue Add = DAG.getNode(ISD::ADD, getCurDebugLoc(), PtrVT, Ptr,
3355 DAG.getConstant(Offsets[i], PtrVT));
3356 SDValue St = DAG.getStore(Root, getCurDebugLoc(),
3363 SDValue StoreNode = DAG.getNode(ISD::TokenFactor, getCurDebugLoc(),
3367 DAG.setRoot(StoreNode);
3373 SelectionDAG &DAG,
3389 Ops[1] = DAG.getConstant(Order, TLI.getPointerTy());
3390 Ops[2] = DAG.getConstant(Scope, TLI.getPointerTy());
3391 return DAG.getNode(ISD::ATOMIC_FENCE, dl, MVT::Other, Ops, 3);
3403 DAG, TLI);
3406 DAG.getAtomic(ISD::ATOMIC_CMP_SWAP, dl,
3420 DAG, TLI);
3423 DAG.setRoot(OutChain);
3450 DAG, TLI);
3453 DAG.getAtomic(NT, dl,
3466 DAG, TLI);
3469 DAG.setRoot(OutChain);
3476 Ops[1] = DAG.getConstant(I.getOrdering(), TLI.getPointerTy());
3477 Ops[2] = DAG.getConstant(I.getSynchScope(), TLI.getPointerTy());
3478 DAG.setRoot(DAG.getNode(ISD::ATOMIC_FENCE, dl, MVT::Other, Ops, 3));
3494 DAG.getAtomic(ISD::ATOMIC_LOAD, dl, VT, VT, InChain,
3504 DAG, TLI);
3507 DAG.setRoot(OutChain);
3525 DAG, TLI);
3528 DAG.getAtomic(ISD::ATOMIC_STORE, dl, VT,
3538 DAG, TLI);
3540 DAG.setRoot(OutChain);
3555 Ops.push_back(DAG.getRoot());
3568 Ops.push_back(DAG.getTargetConstant(Intrinsic, TLI.getPointerTy()));
3582 SDVTList VTs = DAG.getVTList(ValueVTs.data(), ValueVTs.size());
3588 Result = DAG.getMemIntrinsicNode(Info.opc, getCurDebugLoc(),
3595 Result = DAG.getNode(ISD::INTRINSIC_WO_CHAIN, getCurDebugLoc(),
3598 Result = DAG.getNode(ISD::INTRINSIC_W_CHAIN, getCurDebugLoc(),
3601 Result = DAG.getNode(ISD::INTRINSIC_VOID, getCurDebugLoc(),
3610 DAG.setRoot(Chain);
3616 Result = DAG.getNode(ISD::BITCAST, getCurDebugLoc(), VT, Result);
3636 GetSignificand(SelectionDAG &DAG, SDValue Op, DebugLoc dl) {
3637 SDValue t1 = DAG.getNode(ISD::AND, dl, MVT::i32, Op,
3638 DAG.getConstant(0x007fffff, MVT::i32));
3639 SDValue t2 = DAG.getNode(ISD::OR, dl, MVT::i32, t1,
3640 DAG.getConstant(0x3f800000, MVT::i32));
3641 return DAG.getNode(ISD::BITCAST, dl, MVT::f32, t2);
3650 GetExponent(SelectionDAG &DAG, SDValue Op, const TargetLowering &TLI,
3652 SDValue t0 = DAG.getNode(ISD::AND, dl, MVT::i32, Op,
3653 DAG.getConstant(0x7f800000, MVT::i32));
3654 SDValue t1 = DAG.getNode(ISD::SRL, dl, MVT::i32, t0,
3655 DAG.getConstant(23, TLI.getPointerTy()));
3656 SDValue t2 = DAG.getNode(ISD::SUB, dl, MVT::i32, t1,
3657 DAG.getConstant(127, MVT::i32));
3658 return DAG.getNode(ISD::SINT_TO_FP, dl, MVT::f32, t2);
3663 getF32Constant(SelectionDAG &DAG, unsigned Flt) {
3664 return DAG.getConstantFP(APFloat(APInt(32, Flt)), MVT::f32);
3683 SDValue t0 = DAG.getNode(ISD::FMUL, dl, MVT::f32, Op,
3684 getF32Constant(DAG, 0x3fb8aa3b));
3685 SDValue IntegerPartOfX = DAG.getNode(ISD::FP_TO_SINT, dl, MVT::i32, t0);
3688 SDValue t1 = DAG.getNode(ISD::SINT_TO_FP, dl, MVT::f32, IntegerPartOfX);
3689 SDValue X = DAG.getNode(ISD::FSUB, dl, MVT::f32, t0, t1);
3692 IntegerPartOfX = DAG.getNode(ISD::SHL, dl, MVT::i32, IntegerPartOfX,
3693 DAG.getConstant(23, TLI.getPointerTy()));
3703 SDValue t2 = DAG.getNode(ISD::FMUL, dl, MVT::f32, X,
3704 getF32Constant(DAG, 0x3e814304));
3705 SDValue t3 = DAG.getNode(ISD::FADD, dl, MVT::f32, t2,
3706 getF32Constant(DAG, 0x3f3c50c8));
3707 SDValue t4 = DAG.getNode(ISD::FMUL, dl, MVT::f32, t3, X);
3708 SDValue t5 = DAG.getNode(ISD::FADD, dl, MVT::f32, t4,
3709 getF32Constant(DAG, 0x3f7f5e7e));
3710 SDValue TwoToFracPartOfX = DAG.getNode(ISD::BITCAST, dl,MVT::i32, t5);
3713 SDValue t6 = DAG.getNode(ISD::ADD, dl, MVT::i32,
3716 result = DAG.getNode(ISD::BITCAST, dl, MVT::f32, t6);
3726 SDValue t2 = DAG.getNode(ISD::FMUL, dl, MVT::f32, X,
3727 getF32Constant(DAG, 0x3da235e3));
3728 SDValue t3 = DAG.getNode(ISD::FADD, dl, MVT::f32, t2,
3729 getF32Constant(DAG, 0x3e65b8f3));
3730 SDValue t4 = DAG.getNode(ISD::FMUL, dl, MVT::f32, t3, X);
3731 SDValue t5 = DAG.getNode(ISD::FADD, dl, MVT::f32, t4,
3732 getF32Constant(DAG, 0x3f324b07));
3733 SDValue t6 = DAG.getNode(ISD::FMUL, dl, MVT::f32, t5, X);
3734 SDValue t7 = DAG.getNode(ISD::FADD, dl, MVT::f32, t6,
3735 getF32Constant(DAG, 0x3f7ff8fd));
3736 SDValue TwoToFracPartOfX = DAG.getNode(ISD::BITCAST, dl,MVT::i32, t7);
3739 SDValue t8 = DAG.getNode(ISD::ADD, dl, MVT::i32,
3742 result = DAG.getNode(ISD::BITCAST, dl, MVT::f32, t8);
3755 SDValue t2 = DAG.getNode(ISD::FMUL, dl, MVT::f32, X,
3756 getF32Constant(DAG, 0x3924b03e));
3757 SDValue t3 = DAG.getNode(ISD::FADD, dl, MVT::f32, t2,
3758 DAG, 0x3ab24b87));
3759 SDValue t4 = DAG.getNode(ISD::FMUL, dl, MVT::f32, t3, X);
3760 SDValue t5 = DAG.getNode(ISD::FADD, dl, MVT::f32, t4,
3761 getF32Constant(DAG, 0x3c1d8c17));
3762 SDValue t6 = DAG.getNode(ISD::FMUL, dl, MVT::f32, t5, X);
3763 SDValue t7 = DAG.getNode(ISD::FADD, dl, MVT::f32, t6,
3764 getF32Constant(DAG, 0x3d634a1d));
3765 SDValue t8 = DAG.getNode(ISD::FMUL, dl, MVT::f32, t7, X);
3766 SDValue t9 = DAG.getNode(ISD::FADD, dl, MVT::f32, t8,
3767 getF32Constant(DAG, 0x3e75fe14));
3768 SDValue t10 = DAG.getNode(ISD::FMUL, dl, MVT::f32, t9, X);
3769 SDValue t11 = DAG.getNode(ISD::FADD, dl, MVT::f32, t10,
3770 getF32Constant(DAG, 0x3f317234));
3771 SDValue t12 = DAG.getNode(ISD::FMUL, dl, MVT::f32, t11, X);
3772 SDValue t13 = DAG.getNode(ISD::FADD, dl, MVT::f32, t12,
3773 getF32Constant(DAG, 0x3f800000));
3774 SDValue TwoToFracPartOfX = DAG.getNode(ISD::BITCAST, dl,
3778 SDValue t14 = DAG.getNode(ISD::ADD, dl, MVT::i32,
3781 result = DAG.getNode(ISD::BITCAST, dl, MVT::f32, t14);
3785 result = DAG.getNode(ISD::FEXP, dl,
3803 SDValue Op1 = DAG.getNode(ISD::BITCAST, dl, MVT::i32, Op);
3806 SDValue Exp = GetExponent(DAG, Op1, TLI, dl);
3807 SDValue LogOfExponent = DAG.getNode(ISD::FMUL, dl, MVT::f32, Exp,
3808 getF32Constant(DAG, 0x3f317218));
3812 SDValue X = GetSignificand(DAG, Op1, dl);
3822 SDValue t0 = DAG.getNode(ISD::FMUL, dl, MVT::f32, X,
3823 getF32Constant(DAG, 0xbe74c456));
3824 SDValue t1 = DAG.getNode(ISD::FADD, dl, MVT::f32, t0,
3825 getF32Constant(DAG, 0x3fb3a2b1));
3826 SDValue t2 = DAG.getNode(ISD::FMUL, dl, MVT::f32, t1, X);
3827 SDValue LogOfMantissa = DAG.getNode(ISD::FSUB, dl, MVT::f32, t2,
3828 getF32Constant(DAG, 0x3f949a29));
3830 result = DAG.getNode(ISD::FADD, dl,
3842 SDValue t0 = DAG.getNode(ISD::FMUL, dl, MVT::f32, X,
3843 getF32Constant(DAG, 0xbd67b6d6));
3844 SDValue t1 = DAG.getNode(ISD::FADD, dl, MVT::f32, t0,
3845 getF32Constant(DAG, 0x3ee4f4b8));
3846 SDValue t2 = DAG.getNode(ISD::FMUL, dl, MVT::f32, t1, X);
3847 SDValue t3 = DAG.getNode(ISD::FSUB, dl, MVT::f32, t2,
3848 getF32Constant(DAG, 0x3fbc278b));
3849 SDValue t4 = DAG.getNode(ISD::FMUL, dl, MVT::f32, t3, X);
3850 SDValue t5 = DAG.getNode(ISD::FADD, dl, MVT::f32, t4,
3851 getF32Constant(DAG, 0x40348e95));
3852 SDValue t6 = DAG.getNode(ISD::FMUL, dl, MVT::f32, t5, X);
3853 SDValue LogOfMantissa = DAG.getNode(ISD::FSUB, dl, MVT::f32, t6,
3854 getF32Constant(DAG, 0x3fdef31a));
3856 result = DAG.getNode(ISD::FADD, dl,
3870 SDValue t0 = DAG.getNode(ISD::FMUL, dl, MVT::f32, X,
3871 getF32Constant(DAG, 0xbc91e5ac));
3872 SDValue t1 = DAG.getNode(ISD::FADD, dl, MVT::f32, t0,
3873 getF32Constant(DAG, 0x3e4350aa));
3874 SDValue t2 = DAG.getNode(ISD::FMUL, dl, MVT::f32, t1, X);
3875 SDValue t3 = DAG.getNode(ISD::FSUB, dl, MVT::f32, t2,
3876 getF32Constant(DAG, 0x3f60d3e3));
3877 SDValue t4 = DAG.getNode(ISD::FMUL, dl, MVT::f32, t3, X);
3878 SDValue t5 = DAG.getNode(ISD::FADD, dl, MVT::f32, t4,
3879 getF32Constant(DAG, 0x4011cdf0));
3880 SDValue t6 = DAG.getNode(ISD::FMUL, dl, MVT::f32, t5, X);
3881 SDValue t7 = DAG.getNode(ISD::FSUB, dl, MVT::f32, t6,
3882 getF32Constant(DAG, 0x406cfd1c));
3883 SDValue t8 = DAG.getNode(ISD::FMUL, dl, MVT::f32, t7, X);
3884 SDValue t9 = DAG.getNode(ISD::FADD, dl, MVT::f32, t8,
3885 getF32Constant(DAG, 0x408797cb));
3886 SDValue t10 = DAG.getNode(ISD::FMUL, dl, MVT::f32, t9, X);
3887 SDValue LogOfMantissa = DAG.getNode(ISD::FSUB, dl, MVT::f32, t10,
3888 getF32Constant(DAG, 0x4006dcab));
3890 result = DAG.getNode(ISD::FADD, dl,
3895 result = DAG.getNode(ISD::FLOG, dl,
3913 SDValue Op1 = DAG.getNode(ISD::BITCAST, dl, MVT::i32, Op);
3916 SDValue LogOfExponent = GetExponent(DAG, Op1, TLI, dl);
3920 SDValue X = GetSignificand(DAG, Op1, dl);
3930 SDValue t0 = DAG.getNode(ISD::FMUL, dl, MVT::f32, X,
3931 getF32Constant(DAG, 0xbeb08fe0));
3932 SDValue t1 = DAG.getNode(ISD::FADD, dl, MVT::f32, t0,
3933 getF32Constant(DAG, 0x40019463));
3934 SDValue t2 = DAG.getNode(ISD::FMUL, dl, MVT::f32, t1, X);
3935 SDValue Log2ofMantissa = DAG.getNode(ISD::FSUB, dl, MVT::f32, t2,
3936 getF32Constant(DAG, 0x3fd6633d));
3938 result = DAG.getNode(ISD::FADD, dl,
3950 SDValue t0 = DAG.getNode(ISD::FMUL, dl, MVT::f32, X,
3951 getF32Constant(DAG, 0xbda7262e));
3952 SDValue t1 = DAG.getNode(ISD::FADD, dl, MVT::f32, t0,
3953 getF32Constant(DAG, 0x3f25280b));
3954 SDValue t2 = DAG.getNode(ISD::FMUL, dl, MVT::f32, t1, X);
3955 SDValue t3 = DAG.getNode(ISD::FSUB, dl, MVT::f32, t2,
3956 getF32Constant(DAG, 0x4007b923));
3957 SDValue t4 = DAG.getNode(ISD::FMUL, dl, MVT::f32, t3, X);
3958 SDValue t5 = DAG.getNode(ISD::FADD, dl, MVT::f32, t4,
3959 getF32Constant(DAG, 0x40823e2f));
3960 SDValue t6 = DAG.getNode(ISD::FMUL, dl, MVT::f32, t5, X);
3961 SDValue Log2ofMantissa = DAG.getNode(ISD::FSUB, dl, MVT::f32, t6,
3962 getF32Constant(DAG, 0x4020d29c));
3964 result = DAG.getNode(ISD::FADD, dl,
3979 SDValue t0 = DAG.getNode(ISD::FMUL, dl, MVT::f32, X,
3980 getF32Constant(DAG, 0xbcd2769e));
3981 SDValue t1 = DAG.getNode(ISD::FADD, dl, MVT::f32, t0,
3982 getF32Constant(DAG, 0x3e8ce0b9));
3983 SDValue t2 = DAG.getNode(ISD::FMUL, dl, MVT::f32, t1, X);
3984 SDValue t3 = DAG.getNode(ISD::FSUB, dl, MVT::f32, t2,
3985 getF32Constant(DAG, 0x3fa22ae7));
3986 SDValue t4 = DAG.getNode(ISD::FMUL, dl, MVT::f32, t3, X);
3987 SDValue t5 = DAG.getNode(ISD::FADD, dl, MVT::f32, t4,
3988 getF32Constant(DAG, 0x40525723));
3989 SDValue t6 = DAG.getNode(ISD::FMUL, dl, MVT::f32, t5, X);
3990 SDValue t7 = DAG.getNode(ISD::FSUB, dl, MVT::f32, t6,
3991 getF32Constant(DAG, 0x40aaf200));
3992 SDValue t8 = DAG.getNode(ISD::FMUL, dl, MVT::f32, t7, X);
3993 SDValue t9 = DAG.getNode(ISD::FADD, dl, MVT::f32, t8,
3994 getF32Constant(DAG, 0x40c39dad));
3995 SDValue t10 = DAG.getNode(ISD::FMUL, dl, MVT::f32, t9, X);
3996 SDValue Log2ofMantissa = DAG.getNode(ISD::FSUB, dl, MVT::f32, t10,
3997 getF32Constant(DAG, 0x4042902c));
3999 result = DAG.getNode(ISD::FADD, dl,
4004 result = DAG.getNode(ISD::FLOG2, dl,
4022 SDValue Op1 = DAG.getNode(ISD::BITCAST, dl, MVT::i32, Op);
4025 SDValue Exp = GetExponent(DAG, Op1, TLI, dl);
4026 SDValue LogOfExponent = DAG.getNode(ISD::FMUL, dl, MVT::f32, Exp,
4027 getF32Constant(DAG, 0x3e9a209a));
4031 SDValue X = GetSignificand(DAG, Op1, dl);
4041 SDValue t0 = DAG.getNode(ISD::FMUL, dl, MVT::f32, X,
4042 getF32Constant(DAG, 0xbdd49a13));
4043 SDValue t1 = DAG.getNode(ISD::FADD, dl, MVT::f32, t0,
4044 getF32Constant(DAG, 0x3f1c0789));
4045 SDValue t2 = DAG.getNode(ISD::FMUL, dl, MVT::f32, t1, X);
4046 SDValue Log10ofMantissa = DAG.getNode(ISD::FSUB, dl, MVT::f32, t2,
4047 getF32Constant(DAG, 0x3f011300));
4049 result = DAG.getNode(ISD::FADD, dl,
4060 SDValue t0 = DAG.getNode(ISD::FMUL, dl, MVT::f32, X,
4061 getF32Constant(DAG, 0x3d431f31));
4062 SDValue t1 = DAG.getNode(ISD::FSUB, dl, MVT::f32, t0,
4063 getF32Constant(DAG, 0x3ea21fb2));
4064 SDValue t2 = DAG.getNode(ISD::FMUL, dl, MVT::f32, t1, X);
4065 SDValue t3 = DAG.getNode(ISD::FADD, dl, MVT::f32, t2,
4066 getF32Constant(DAG, 0x3f6ae232));
4067 SDValue t4 = DAG.getNode(ISD::FMUL, dl, MVT::f32, t3, X);
4068 SDValue Log10ofMantissa = DAG.getNode(ISD::FSUB, dl, MVT::f32, t4,
4069 getF32Constant(DAG, 0x3f25f7c3));
4071 result = DAG.getNode(ISD::FADD, dl,
4084 SDValue t0 = DAG.getNode(ISD::FMUL, dl, MVT::f32, X,
4085 getF32Constant(DAG, 0x3c5d51ce));
4086 SDValue t1 = DAG.getNode(ISD::FSUB, dl, MVT::f32, t0,
4087 getF32Constant(DAG, 0x3e00685a));
4088 SDValue t2 = DAG.getNode(ISD::FMUL, dl, MVT::f32, t1, X);
4089 SDValue t3 = DAG.getNode(ISD::FADD, dl, MVT::f32, t2,
4090 getF32Constant(DAG, 0x3efb6798));
4091 SDValue t4 = DAG.getNode(ISD::FMUL, dl, MVT::f32, t3, X);
4092 SDValue t5 = DAG.getNode(ISD::FSUB, dl, MVT::f32, t4,
4093 getF32Constant(DAG, 0x3f88d192));
4094 SDValue t6 = DAG.getNode(ISD::FMUL, dl, MVT::f32, t5, X);
4095 SDValue t7 = DAG.getNode(ISD::FADD, dl, MVT::f32, t6,
4096 getF32Constant(DAG, 0x3fc4316c));
4097 SDValue t8 = DAG.getNode(ISD::FMUL, dl, MVT::f32, t7, X);
4098 SDValue Log10ofMantissa = DAG.getNode(ISD::FSUB, dl, MVT::f32, t8,
4099 getF32Constant(DAG, 0x3f57ce70));
4101 result = DAG.getNode(ISD::FADD, dl,
4106 result = DAG.getNode(ISD::FLOG10, dl,
4125 SDValue IntegerPartOfX = DAG.getNode(ISD::FP_TO_SINT, dl, MVT::i32, Op);
4128 SDValue t1 = DAG.getNode(ISD::SINT_TO_FP, dl, MVT::f32, IntegerPartOfX);
4129 SDValue X = DAG.getNode(ISD::FSUB, dl, MVT::f32, Op, t1);
4132 IntegerPartOfX = DAG.getNode(ISD::SHL, dl, MVT::i32, IntegerPartOfX,
4133 DAG.getConstant(23, TLI.getPointerTy()));
4143 SDValue t2 = DAG.getNode(ISD::FMUL, dl, MVT::f32, X,
4144 getF32Constant(DAG, 0x3e814304));
4145 SDValue t3 = DAG.getNode(ISD::FADD, dl, MVT::f32, t2,
4146 getF32Constant(DAG, 0x3f3c50c8));
4147 SDValue t4 = DAG.getNode(ISD::FMUL, dl, MVT::f32, t3, X);
4148 SDValue t5 = DAG.getNode(ISD::FADD, dl, MVT::f32, t4,
4149 getF32Constant(DAG, 0x3f7f5e7e));
4150 SDValue t6 = DAG.getNode(ISD::BITCAST, dl, MVT::i32, t5);
4152 DAG.getNode(ISD::ADD, dl, MVT::i32, t6, IntegerPartOfX);
4154 result = DAG.getNode(ISD::BITCAST, dl,
4165 SDValue t2 = DAG.getNode(ISD::FMUL, dl, MVT::f32, X,
4166 getF32Constant(DAG, 0x3da235e3));
4167 SDValue t3 = DAG.getNode(ISD::FADD, dl, MVT::f32, t2,
4168 getF32Constant(DAG, 0x3e65b8f3));
4169 SDValue t4 = DAG.getNode(ISD::FMUL, dl, MVT::f32, t3, X);
4170 SDValue t5 = DAG.getNode(ISD::FADD, dl, MVT::f32, t4,
4171 getF32Constant(DAG, 0x3f324b07));
4172 SDValue t6 = DAG.getNode(ISD::FMUL, dl, MVT::f32, t5, X);
4173 SDValue t7 = DAG.getNode(ISD::FADD, dl, MVT::f32, t6,
4174 getF32Constant(DAG, 0x3f7ff8fd));
4175 SDValue t8 = DAG.getNode(ISD::BITCAST, dl, MVT::i32, t7);
4177 DAG.getNode(ISD::ADD, dl, MVT::i32, t8, IntegerPartOfX);
4179 result = DAG.getNode(ISD::BITCAST, dl,
4192 SDValue t2 = DAG.getNode(ISD::FMUL, dl, MVT::f32, X,
4193 getF32Constant(DAG, 0x3924b03e));
4194 SDValue t3 = DAG.getNode(ISD::FADD, dl, MVT::f32, t2,
4195 getF32Constant(DAG, 0x3ab24b87));
4196 SDValue t4 = DAG.getNode(ISD::FMUL, dl, MVT::f32, t3, X);
4197 SDValue t5 = DAG.getNode(ISD::FADD, dl, MVT::f32, t4,
4198 getF32Constant(DAG, 0x3c1d8c17));
4199 SDValue t6 = DAG.getNode(ISD::FMUL, dl, MVT::f32, t5, X);
4200 SDValue t7 = DAG.getNode(ISD::FADD, dl, MVT::f32, t6,
4201 getF32Constant(DAG, 0x3d634a1d));
4202 SDValue t8 = DAG.getNode(ISD::FMUL, dl, MVT::f32, t7, X);
4203 SDValue t9 = DAG.getNode(ISD::FADD, dl, MVT::f32, t8,
4204 getF32Constant(DAG, 0x3e75fe14));
4205 SDValue t10 = DAG.getNode(ISD::FMUL, dl, MVT::f32, t9, X);
4206 SDValue t11 = DAG.getNode(ISD::FADD, dl, MVT::f32, t10,
4207 getF32Constant(DAG, 0x3f317234));
4208 SDValue t12 = DAG.getNode(ISD::FMUL, dl, MVT::f32, t11, X);
4209 SDValue t13 = DAG.getNode(ISD::FADD, dl, MVT::f32, t12,
4210 getF32Constant(DAG, 0x3f800000));
4211 SDValue t14 = DAG.getNode(ISD::BITCAST, dl, MVT::i32, t13);
4213 DAG.getNode(ISD::ADD, dl, MVT::i32, t14, IntegerPartOfX);
4215 result = DAG.getNode(ISD::BITCAST, dl,
4220 result = DAG.getNode(ISD::FEXP2, dl,
4256 SDValue t0 = DAG.getNode(ISD::FMUL, dl, MVT::f32, Op,
4257 getF32Constant(DAG, 0x40549a78));
4258 SDValue IntegerPartOfX = DAG.getNode(ISD::FP_TO_SINT, dl, MVT::i32, t0);
4261 SDValue t1 = DAG.getNode(ISD::SINT_TO_FP, dl, MVT::f32, IntegerPartOfX);
4262 SDValue X = DAG.getNode(ISD::FSUB, dl, MVT::f32, t0, t1);
4265 IntegerPartOfX = DAG.getNode(ISD::SHL, dl, MVT::i32, IntegerPartOfX,
4266 DAG.getConstant(23, TLI.getPointerTy()));
4276 SDValue t2 = DAG.getNode(ISD::FMUL, dl, MVT::f32, X,
4277 getF32Constant(DAG, 0x3e814304));
4278 SDValue t3 = DAG.getNode(ISD::FADD, dl, MVT::f32, t2,
4279 getF32Constant(DAG, 0x3f3c50c8));
4280 SDValue t4 = DAG.getNode(ISD::FMUL, dl, MVT::f32, t3, X);
4281 SDValue t5 = DAG.getNode(ISD::FADD, dl, MVT::f32, t4,
4282 getF32Constant(DAG, 0x3f7f5e7e));
4283 SDValue t6 = DAG.getNode(ISD::BITCAST, dl, MVT::i32, t5);
4285 DAG.getNode(ISD::ADD, dl, MVT::i32, t6, IntegerPartOfX);
4287 result = DAG.getNode(ISD::BITCAST, dl,
4298 SDValue t2 = DAG.getNode(ISD::FMUL, dl, MVT::f32, X,
4299 getF32Constant(DAG, 0x3da235e3));
4300 SDValue t3 = DAG.getNode(ISD::FADD, dl, MVT::f32, t2,
4301 getF32Constant(DAG, 0x3e65b8f3));
4302 SDValue t4 = DAG.getNode(ISD::FMUL, dl, MVT::f32, t3, X);
4303 SDValue t5 = DAG.getNode(ISD::FADD, dl, MVT::f32, t4,
4304 getF32Constant(DAG, 0x3f324b07));
4305 SDValue t6 = DAG.getNode(ISD::FMUL, dl, MVT::f32, t5, X);
4306 SDValue t7 = DAG.getNode(ISD::FADD, dl, MVT::f32, t6,
4307 getF32Constant(DAG, 0x3f7ff8fd));
4308 SDValue t8 = DAG.getNode(ISD::BITCAST, dl, MVT::i32, t7);
4310 DAG.getNode(ISD::ADD, dl, MVT::i32, t8, IntegerPartOfX);
4312 result = DAG.getNode(ISD::BITCAST, dl,
4325 SDValue t2 = DAG.getNode(ISD::FMUL, dl, MVT::f32, X,
4326 getF32Constant(DAG, 0x3924b03e));
4327 SDValue t3 = DAG.getNode(ISD::FADD, dl, MVT::f32, t2,
4328 getF32Constant(DAG, 0x3ab24b87));
4329 SDValue t4 = DAG.getNode(ISD::FMUL, dl, MVT::f32, t3, X);
4330 SDValue t5 = DAG.getNode(ISD::FADD, dl, MVT::f32, t4,
4331 getF32Constant(DAG, 0x3c1d8c17));
4332 SDValue t6 = DAG.getNode(ISD::FMUL, dl, MVT::f32, t5, X);
4333 SDValue t7 = DAG.getNode(ISD::FADD, dl, MVT::f32, t6,
4334 getF32Constant(DAG, 0x3d634a1d));
4335 SDValue t8 = DAG.getNode(ISD::FMUL, dl, MVT::f32, t7, X);
4336 SDValue t9 = DAG.getNode(ISD::FADD, dl, MVT::f32, t8,
4337 getF32Constant(DAG, 0x3e75fe14));
4338 SDValue t10 = DAG.getNode(ISD::FMUL, dl, MVT::f32, t9, X);
4339 SDValue t11 = DAG.getNode(ISD::FADD, dl, MVT::f32, t10,
4340 getF32Constant(DAG, 0x3f317234));
4341 SDValue t12 = DAG.getNode(ISD::FMUL, dl, MVT::f32, t11, X);
4342 SDValue t13 = DAG.getNode(ISD::FADD, dl, MVT::f32, t12,
4343 getF32Constant(DAG, 0x3f800000));
4344 SDValue t14 = DAG.getNode(ISD::BITCAST, dl, MVT::i32, t13);
4346 DAG.getNode(ISD::ADD, dl, MVT::i32, t14, IntegerPartOfX);
4348 result = DAG.getNode(ISD::BITCAST, dl,
4353 result = DAG.getNode(ISD::FPOW, dl,
4365 SelectionDAG &DAG) {
4377 return DAG.getConstantFP(1.0, LHS.getValueType());
4379 const Function *F = DAG.getMachineFunction().getFunction();
4393 Res = DAG.getNode(ISD::FMUL, DL,Res.getValueType(), Res, CurSquare);
4398 CurSquare = DAG.getNode(ISD::FMUL, DL, CurSquare.getValueType(),
4405 Res = DAG.getNode(ISD::FDIV, DL, LHS.getValueType(),
4406 DAG.getConstantFP(1.0, LHS.getValueType()), Res);
4412 return DAG.getNode(ISD::FPOWI, DL, LHS.getValueType(), LHS, RHS);
4443 MachineFunction &MF = DAG.getMachineFunction();
4444 const TargetInstrInfo *TII = DAG.getTarget().getInstrInfo();
4445 const TargetRegisterInfo *TRI = DAG.getTarget().getRegisterInfo();
4523 setValue(&I, DAG.getNode(ISD::RETURNADDR, dl, TLI.getPointerTy(),
4527 setValue(&I, DAG.getNode(ISD::FRAMEADDR, dl, TLI.getPointerTy(),
4547 DAG.setRoot(DAG.getMemcpy(getRoot(), dl, Op1, Op2, Op3, Align, isVol, false,
4563 DAG.setRoot(DAG.getMemset(getRoot(), dl, Op1, Op2, Op3, Align, isVol,
4580 DAG.setRoot(DAG.getMemmove(getRoot(), dl, Op1, Op2, Op3, Align, isVol,
4626 SDV = DAG.getDbgValue(Variable, FINode->getIndex(),
4635 SDV = DAG.getDbgValue(Variable, N.getNode(), N.getResNo(),
4644 DAG.AddDbgValue(SDV, N.getNode(), isParameter);
4656 SDV = DAG.getDbgValue(Variable, SI->second,
4658 DAG.AddDbgValue(SDV, 0, false);
4686 SDV = DAG.getDbgValue(Variable, V, Offset, dl, SDNodeOrder);
4687 DAG.AddDbgValue(SDV, 0, false);
4697 SDV = DAG.getDbgValue(Variable, N.getNode(),
4699 DAG.AddDbgValue(SDV, N.getNode(), false);
4729 MachineModuleInfo &MMI = DAG.getMachineFunction().getMMI();
4738 unsigned TypeID = DAG.getMachineFunction().getMMI().getTypeIDFor(GV);
4739 Res = DAG.getConstant(TypeID, MVT::i32);
4746 DAG.getMachineFunction().getMMI().setCallsEHReturn(true);
4747 DAG.setRoot(DAG.getNode(ISD::EH_RETURN, dl,
4754 DAG.getMachineFunction().getMMI().setCallsUnwindInit(true);
4757 SDValue CfaArg = DAG.getSExtOrTrunc(getValue(I.getArgOperand(0)), dl,
4759 SDValue Offset = DAG.getNode(ISD::ADD, dl,
4761 DAG.getNode(ISD::FRAME_TO_ARGS_OFFSET, dl,
4764 SDValue FA = DAG.getNode(ISD::FRAMEADDR, dl,
4766 DAG.getConstant(0, TLI.getPointerTy()));
4767 setValue(&I, DAG.getNode(ISD::ADD, dl, TLI.getPointerTy(),
4772 MachineModuleInfo &MMI = DAG.getMachineFunction().getMMI();
4782 MachineFrameInfo *MFI = DAG.getMachineFunction().getFrameInfo();
4793 SDValue Op = DAG.getNode(ISD::EH_SJLJ_SETJMP, dl,
4794 DAG.getVTList(MVT::i32, MVT::Other),
4797 DAG.setRoot(Op.getValue(1));
4801 DAG.setRoot(DAG.getNode(ISD::EH_SJLJ_LONGJMP, dl, MVT::Other,
4856 ShOps[1] = DAG.getConstant(0, MVT::i32);
4857 ShAmt = DAG.getNode(ISD::BUILD_VECTOR, dl, ShAmtVT, &ShOps[0], 2);
4859 ShAmt = DAG.getNode(ISD::BITCAST, dl, DestVT, ShAmt);
4860 Res = DAG.getNode(ISD::INTRINSIC_WO_CHAIN, dl, DestVT,
4861 DAG.getConstant(NewIntrinsic, MVT::i32),
4875 Res = DAG.getNode(ISD::INSERT_SUBVECTOR, dl, DestVT,
4878 DAG.getIntPtrConstant(Idx));
4890 Res = DAG.getNode(ISD::EXTRACT_SUBVECTOR, dl, DestVT,
4892 DAG.getIntPtrConstant(Idx));
4920 Res = DAG.getConvertRndSat(DestVT, getCurDebugLoc(), getValue(Op1),
4921 DAG.getValueType(DestVT),
4922 DAG.getValueType(getValue(Op1).getValueType()),
4930 setValue(&I, DAG.getNode(ISD::FSQRT, dl,
4936 getValue(I.getArgOperand(1)), DAG));
4939 setValue(&I, DAG.getNode(ISD::FSIN, dl,
4944 setValue(&I, DAG.getNode(ISD::FCOS, dl,
4967 setValue(&I, DAG.getNode(ISD::FABS, dl,
4972 setValue(&I, DAG.getNode(ISD::FFLOOR, dl,
4977 setValue(&I, DAG.getNode(ISD::FMA, dl,
4988 setValue(&I, DAG.getNode(ISD::FMA, dl,
4994 SDValue Mul = DAG.getNode(ISD::FMUL, dl,
4998 SDValue Add = DAG.getNode(ISD::FADD, dl,
5007 setValue(&I, DAG.getNode(ISD::FP32_TO_FP16, dl,
5011 setValue(&I, DAG.getNode(ISD::FP16_TO_FP32, dl,
5016 DAG.setRoot(DAG.getNode(ISD::PCMARKER, dl, MVT::Other, getRoot(), Tmp));
5021 Res = DAG.getNode(ISD::READCYCLECOUNTER, dl,
5022 DAG.getVTList(MVT::i64, MVT::Other),
5025 DAG.setRoot(Res.getValue(1));
5029 setValue(&I, DAG.getNode(ISD::BSWAP, dl,
5037 setValue(&I, DAG.getNode(CI->isZero() ? ISD::CTTZ : ISD::CTTZ_ZERO_UNDEF,
5045 setValue(&I, DAG.getNode(CI->isZero() ? ISD::CTLZ : ISD::CTLZ_ZERO_UNDEF,
5052 setValue(&I, DAG.getNode(ISD::CTPOP, dl, Ty, Arg));
5057 Res = DAG.getNode(ISD::STACKSAVE, dl,
5058 DAG.getVTList(TLI.getPointerTy(), MVT::Other), &Op, 1);
5060 DAG.setRoot(Res.getValue(1));
5065 DAG.setRoot(DAG.getNode(ISD::STACKRESTORE, dl, MVT::Other, getRoot(), Res));
5069 // Emit code into the DAG to store the stack guard onto the stack.
5070 MachineFunction &MF = DAG.getMachineFunction();
5080 SDValue FIN = DAG.getFrameIndex(FI, PtrTy);
5083 Res = DAG.getStore(getRoot(), getCurDebugLoc(), Src, FIN,
5087 DAG.setRoot(Res);
5100 Res = DAG.getConstant(-1ULL, Ty);
5102 Res = DAG.getConstant(0, Ty);
5119 Ops[4] = DAG.getSrcValue(I.getArgOperand(0));
5120 Ops[5] = DAG.getSrcValue(F);
5122 Res = DAG.getNode(ISD::INIT_TRAMPOLINE, dl, MVT::Other, Ops, 6);
5124 DAG.setRoot(Res);
5128 setValue(&I, DAG.getNode(ISD::ADJUST_TRAMPOLINE, dl,
5146 setValue(&I, DAG.getNode(ISD::FLT_ROUNDS_, dl, MVT::i32));
5158 DAG.setRoot(DAG.getNode(ISD::TRAP, dl,MVT::Other, getRoot()));
5167 DAG.getExternalSymbol(TrapFuncName.data(), TLI.getPointerTy()),
5168 Args, DAG, getCurDebugLoc());
5170 DAG.setRoot(Result.second);
5174 DAG.setRoot(DAG.getNode(ISD::DEBUGTRAP, dl,MVT::Other, getRoot()));
5196 SDVTList VTs = DAG.getVTList(Op1.getValueType(), MVT::i1);
5197 setValue(&I, DAG.getNode(Op, getCurDebugLoc(), VTs, Op1, Op2));
5208 DAG.setRoot(DAG.getMemIntrinsicNode(ISD::PREFETCH, dl,
5209 DAG.getVTList(MVT::Other),
5241 Ops[1] = DAG.getFrameIndex(FI, TLI.getPointerTy(), true);
5244 Res = DAG.getNode(Opcode, dl, MVT::Other, Ops, 2);
5245 DAG.setRoot(Res);
5250 setValue(&I, DAG.getUNDEF(TLI.getPointerTy()));
5267 MachineModuleInfo &MMI = DAG.getMachineFunction().getMMI();
5280 DAG.getMachineFunction(),
5292 MachineFunction &MF = DAG.getMachineFunction();
5296 DemoteStackSlot = DAG.getFrameIndex(DemoteStackIdx, TLI.getPointerTy());
5351 DAG.setRoot(DAG.getEHLabel(getCurDebugLoc(), getControlRoot(), BeginLabel));
5366 CallLoweringInfo CLI(getRoot(), RetTy, FTy, isTailCall, Callee, Args, DAG,
5395 SDValue Add = DAG.getNode(ISD::ADD, getCurDebugLoc(), PtrVT,
5397 DAG.getConstant(Offsets[i], PtrVT));
5398 SDValue L = DAG.getLoad(RetTys[i], getCurDebugLoc(), Result.second, Add,
5405 SDValue Chain = DAG.getNode(ISD::TokenFactor, getCurDebugLoc(),
5410 DAG.getNode(ISD::MERGE_VALUES, getCurDebugLoc(),
5411 DAG.getVTList(&RetTys[0], RetTys.size()),
5419 // the DAG root is already updated.
5422 AssignOrderingToNode(DAG.getRoot().getNode());
5424 DAG.setRoot(Result.second);
5433 DAG.setRoot(DAG.getEHLabel(getCurDebugLoc(), getRoot(), EndLabel));
5480 Root = Builder.DAG.getEntryNode();
5484 Root = Builder.DAG.getRoot();
5488 SDValue LoadVal = Builder.DAG.getLoad(LoadVT, Builder.getCurDebugLoc(), Root,
5567 SDValue Res = DAG.getSetCC(getCurDebugLoc(), MVT::i1, LHSVal, RHSVal,
5570 setValue(&I, DAG.getZExtOrTrunc(Res, getCurDebugLoc(), CallVT));
5592 setValue(&I, DAG.getNode(Opcode, getCurDebugLoc(), Tmp.getValueType(), Tmp));
5603 MachineModuleInfo &MMI = DAG.getMachineFunction().getMMI();
5641 setValue(&I, DAG.getNode(ISD::FCOPYSIGN, getCurDebugLoc(),
5724 Callee = DAG.getExternalSymbol(RenameFn, TLI.getPointerTy());
5811 static void GetRegistersForValue(SelectionDAG &DAG,
5815 LLVMContext &Context = *DAG.getContext();
5817 MachineFunction &MF = DAG.getMachineFunction();
5838 OpInfo.CallOperand = DAG.getNode(ISD::BITCAST, DL,
5848 OpInfo.CallOperand = DAG.getNode(ISD::BITCAST, DL,
5965 OpInfo.CallOperand = DAG.getBasicBlock(FuncInfo.MBBMap[BB]);
5970 OpVT = OpInfo.getCallOperandValEVT(*DAG.getContext(), TLI, TD);
5997 Chain = DAG.getRoot();
6030 TLI.ComputeConstraintToUse(OpInfo, OpInfo.CallOperand, &DAG);
6053 OpInfo.CallOperand = DAG.getConstantPool(cast<Constant>(OpVal),
6061 MachineFunction &MF = DAG.getMachineFunction();
6063 SDValue StackSlot = DAG.getFrameIndex(SSFI, TLI.getPointerTy());
6064 Chain = DAG.getStore(Chain, getCurDebugLoc(),
6081 GetRegistersForValue(DAG, TLI, getCurDebugLoc(), OpInfo);
6092 GetRegistersForValue(DAG, TLI, getCurDebugLoc(), OpInfo);
6099 DAG.getTargetExternalSymbol(IA->getAsmString().c_str(),
6106 AsmNodeOperands.push_back(DAG.getMDNode(SrcLoc));
6116 AsmNodeOperands.push_back(DAG.getTargetConstant(ExtraInfo,
6138 AsmNodeOperands.push_back(DAG.getTargetConstant(OpFlags,
6149 LLVMContext &Ctx = *DAG.getContext();
6175 DAG,
6207 LLVMContext &Ctx = *DAG.getContext();
6217 MachineRegisterInfo &RegInfo = DAG.getMachineFunction().getRegInfo();
6224 MatchedRegs.getCopyToRegs(InOperandVal, DAG, getCurDebugLoc(),
6228 DAG, AsmNodeOperands);
6239 AsmNodeOperands.push_back(DAG.getTargetConstant(OpFlag,
6253 Ops, DAG);
6255 LLVMContext &Ctx = *DAG.getContext();
6265 AsmNodeOperands.push_back(DAG.getTargetConstant(ResOpType,
6278 AsmNodeOperands.push_back(DAG.getTargetConstant(ResOpType,
6290 LLVMContext &Ctx = *DAG.getContext();
6299 LLVMContext &Ctx = *DAG.getContext();
6306 OpInfo.AssignedRegs.getCopyToRegs(InOperandVal, DAG, getCurDebugLoc(),
6310 DAG, AsmNodeOperands);
6318 false, 0, DAG,
6329 Chain = DAG.getNode(ISD::INLINEASM, getCurDebugLoc(),
6330 DAG.getVTList(MVT::Other, MVT::Glue),
6337 SDValue Val = RetValRegs.getCopyFromRegs(DAG, FuncInfo, getCurDebugLoc(),
6350 Val = DAG.getNode(ISD::BITCAST, getCurDebugLoc(),
6358 Val = DAG.getNode(ISD::TRUNCATE, getCurDebugLoc(), ResultType, Val);
6377 SDValue OutVal = OutRegs.getCopyFromRegs(DAG, FuncInfo, getCurDebugLoc(),
6385 SDValue Val = DAG.getStore(Chain, getCurDebugLoc(),
6394 Chain = DAG.getNode(ISD::TokenFactor, getCurDebugLoc(), MVT::Other,
6397 DAG.setRoot(Chain);
6401 DAG.setRoot(DAG.getNode(ISD::VASTART, getCurDebugLoc(),
6404 DAG.getSrcValue(I.getArgOperand(0))));
6409 SDValue V = DAG.getVAArg(TLI.getValueType(I.getType()), getCurDebugLoc(),
6411 DAG.getSrcValue(I.getOperand(0)),
6414 DAG.setRoot(V.getValue(1));
6418 DAG.setRoot(DAG.getNode(ISD::VAEND, getCurDebugLoc(),
6421 DAG.getSrcValue(I.getArgOperand(0))));
6425 DAG.setRoot(DAG.getNode(ISD::VACOPY, getCurDebugLoc(),
6429 DAG.getSrcValue(I.getArgOperand(0)),
6430 DAG.getSrcValue(I.getArgOperand(1))));
6492 getCopyToParts(CLI.DAG, CLI.DL, Op, &Parts[0], NumParts,
6544 // any nodes in the DAG representing it. Return a special value to
6548 CLI.DAG.setRoot(CLI.Chain);
6573 ReturnValues.push_back(getCopyFromParts(CLI.DAG, CLI.DL, &InVals[CurReg],
6585 SDValue Res = CLI.DAG.getNode(ISD::MERGE_VALUES, CLI.DL,
6586 CLI.DAG.getVTList(&RetTys[0], RetTys.size()),
6593 DAG) const {
6594 SDValue Res = LowerOperation(SDValue(N, 0), DAG);
6599 SDValue TargetLowering::LowerOperation(SDValue Op, SelectionDAG &DAG) const {
6612 SDValue Chain = DAG.getEntryNode();
6613 RFV.getCopyToRegs(Op, DAG, getCurDebugLoc(), Chain, 0);
6641 SelectionDAG &DAG = SDB->DAG;
6660 EVT RegisterVT = TLI.getRegisterType(*DAG.getContext(), ValueVTs[0]);
6675 Type *ArgTy = VT.getTypeForEVT(*DAG.getContext());
6722 SDValue NewRoot = TLI.LowerFormalArguments(DAG.getRoot(), F.getCallingConv(),
6724 dl, DAG, InVals);
6740 // Update the DAG with the new chain value resulting from argument lowering.
6741 DAG.setRoot(NewRoot);
6754 SDValue ArgValue = getCopyFromParts(DAG, dl, &InVals[0], 1,
6757 MachineFunction& MF = SDB->DAG.getMachineFunction();
6761 NewRoot = SDB->DAG.getCopyToReg(NewRoot, SDB->getCurDebugLoc(),
6763 DAG.setRoot(NewRoot);
6794 ArgValues.push_back(getCopyFromParts(DAG, dl, &InVals[i],
6811 SDValue Res = DAG.getMergeValues(&ArgValues[0], NumValues,
6845 // FIXME: this should insert code into the DAG!
6917 unsigned NumRegisters = TLI.getNumRegisters(*DAG.getContext(), VT);