Home | History | Annotate | Download | only in SelectionDAG

Lines Matching defs:VT

78 bool ConstantFPSDNode::isValueValidForType(EVT VT,
80 assert(VT.isFloatingPoint() && "Can only convert between FP types");
85 (void) Val2.convert(SelectionDAG::EVTToAPFloatSemantics(VT),
669 EVT VT = cast<VTSDNode>(N)->getVT();
670 if (VT.isExtended()) {
671 Erased = ExtendedValueTypeNodes.erase(VT);
673 Erased = ValueTypeNodes[VT.getSimpleVT().SimpleTy] != 0;
674 ValueTypeNodes[VT.getSimpleVT().SimpleTy] = 0;
789 EVT VT = N->getValueType(0);
791 assert(!VT.isVector() && (VT.isInteger() || VT.isFloatingPoint()) &&
796 assert(N->getOperand(0).getValueType().isInteger() == VT.isInteger() &&
798 assert(VT.getSizeInBits() == 2 * N->getOperand(0).getValueSizeInBits() &&
862 unsigned SelectionDAG::getEVTAlignment(EVT VT) const {
863 Type *Ty = VT == MVT::iPTR ?
865 VT.getTypeForEVT(*getContext());
917 SDValue SelectionDAG::getAnyExtOrTrunc(SDValue Op, SDLoc DL, EVT VT) {
918 return VT.bitsGT(Op.getValueType()) ?
919 getNode(ISD::ANY_EXTEND, DL, VT, Op) :
920 getNode(ISD::TRUNCATE, DL, VT, Op);
923 SDValue SelectionDAG::getSExtOrTrunc(SDValue Op, SDLoc DL, EVT VT) {
924 return VT.bitsGT(Op.getValueType()) ?
925 getNode(ISD::SIGN_EXTEND, DL, VT, Op) :
926 getNode(ISD::TRUNCATE, DL, VT, Op);
929 SDValue SelectionDAG::getZExtOrTrunc(SDValue Op, SDLoc DL, EVT VT) {
930 return VT.bitsGT(Op.getValueType()) ?
931 getNode(ISD::ZERO_EXTEND, DL, VT, Op) :
932 getNode(ISD::TRUNCATE, DL, VT, Op);
935 SDValue SelectionDAG::getZeroExtendInReg(SDValue Op, SDLoc DL, EVT VT) {
936 assert(!VT.isVector() &&
939 if (Op.getValueType() == VT) return Op;
942 VT.getSizeInBits());
949 SDValue SelectionDAG::getNOT(SDLoc DL, SDValue Val, EVT VT) {
950 EVT EltVT = VT.getScalarType();
952 getConstant(APInt::getAllOnesValue(EltVT.getSizeInBits()), VT);
953 return getNode(ISD::XOR, DL, VT, Val, NegOne);
956 SDValue SelectionDAG::getConstant(uint64_t Val, EVT VT, bool isT) {
957 EVT EltVT = VT.getScalarType();
961 return getConstant(APInt(EltVT.getSizeInBits(), Val), VT, isT);
964 SDValue SelectionDAG::getConstant(const APInt &Val, EVT VT, bool isT) {
965 return getConstant(*ConstantInt::get(*Context, Val), VT, isT);
968 SDValue SelectionDAG::getConstant(const ConstantInt &Val, EVT VT, bool isT) {
969 assert(VT.isInteger() && "Cannot create FP integer constant!");
971 EVT EltVT = VT.getScalarType();
980 if (VT.isVector() && TLI->getTypeAction(*getContext(), EltVT) ==
996 if (!VT.isVector())
1006 if (VT.isVector()) {
1008 Ops.assign(VT.getVectorNumElements(), Result);
1009 Result = getNode(ISD::BUILD_VECTOR, SDLoc(), VT, &Ops[0], Ops.size());
1019 SDValue SelectionDAG::getConstantFP(const APFloat& V, EVT VT, bool isTarget) {
1020 return getConstantFP(*ConstantFP::get(*getContext(), V), VT, isTarget);
1023 SDValue SelectionDAG::getConstantFP(const ConstantFP& V, EVT VT, bool isTarget){
1024 assert(VT.isFloatingPoint() && "Cannot create integer FP constant!");
1026 EVT EltVT = VT.getScalarType();
1038 if (!VT.isVector())
1048 if (VT.isVector()) {
1050 Ops.assign(VT.getVectorNumElements(), Result);
1052 Result = getNode(ISD::BUILD_VECTOR, SDLoc(), VT, &Ops[0], Ops.size());
1057 SDValue SelectionDAG::getConstantFP(double Val, EVT VT, bool isTarget) {
1058 EVT EltVT = VT.getScalarType();
1060 return getConstantFP(APFloat((float)Val), VT, isTarget);
1062 return getConstantFP(APFloat(Val), VT, isTarget);
1069 return getConstantFP(apf, VT, isTarget);
1075 EVT VT, int64_t Offset,
1100 AddNodeIDNode(ID, Opc, getVTList(VT), 0, 0);
1110 DL.getDebugLoc(), GV, VT,
1117 SDValue SelectionDAG::getFrameIndex(int FI, EVT VT, bool isTarget) {
1120 AddNodeIDNode(ID, Opc, getVTList(VT), 0, 0);
1126 SDNode *N = new (NodeAllocator) FrameIndexSDNode(FI, VT, isTarget);
1132 SDValue SelectionDAG::getJumpTable(int JTI, EVT VT, bool isTarget,
1138 AddNodeIDNode(ID, Opc, getVTList(VT), 0, 0);
1145 SDNode *N = new (NodeAllocator) JumpTableSDNode(JTI, VT, isTarget,
1152 SDValue SelectionDAG::getConstantPool(const Constant *C, EVT VT,
1163 AddNodeIDNode(ID, Opc, getVTList(VT), 0, 0);
1172 SDNode *N = new (NodeAllocator) ConstantPoolSDNode(isTarget, C, VT, Offset,
1180 SDValue SelectionDAG::getConstantPool(MachineConstantPoolValue *C, EVT VT,
1191 AddNodeIDNode(ID, Opc, getVTList(VT), 0, 0);
1200 SDNode *N = new (NodeAllocator) ConstantPoolSDNode(isTarget, C, VT, Offset,
1207 SDValue SelectionDAG::getTargetIndex(int Index, EVT VT, int64_t Offset,
1210 AddNodeIDNode(ID, ISD::TargetIndex, getVTList(VT), 0, 0);
1218 SDNode *N = new (NodeAllocator) TargetIndexSDNode(Index, VT, Offset,
1239 SDValue SelectionDAG::getValueType(EVT VT) {
1240 if (VT.isSimple() && (unsigned)VT.getSimpleVT().SimpleTy >=
1242 ValueTypeNodes.resize(VT.getSimpleVT().SimpleTy+1);
1244 SDNode *&N = VT.isExtended() ?
1245 ExtendedValueTypeNodes[VT] : ValueTypeNodes[VT.getSimpleVT().SimpleTy];
1248 N = new (NodeAllocator) VTSDNode(VT);
1253 SDValue SelectionDAG::getExternalSymbol(const char *Sym, EVT VT) {
1256 N = new (NodeAllocator) ExternalSymbolSDNode(false, Sym, 0, VT);
1261 SDValue SelectionDAG::getTargetExternalSymbol(const char *Sym, EVT VT,
1267 N = new (NodeAllocator) ExternalSymbolSDNode(true, Sym, TargetFlags, VT);
1299 SDValue SelectionDAG::getVectorShuffle(EVT VT, SDLoc dl, SDValue N1,
1302 assert(VT.isVector() && N1.getValueType().isVector() &&
1304 assert(VT.getVectorElementType() == N1.getValueType().getVectorElementType()
1309 return getUNDEF(VT);
1313 unsigned NElts = VT.getVectorNumElements();
1322 N2 = getUNDEF(VT);
1346 return getUNDEF(VT);
1348 N2 = getUNDEF(VT);
1350 N1 = getUNDEF(VT);
1364 return getUNDEF(VT);
1368 AddNodeIDNode(ID, ISD::VECTOR_SHUFFLE, getVTList(VT), Ops, 2);
1383 new (NodeAllocator) ShuffleVectorSDNode(VT, dl.getIROrder(), dl.getDebugLoc(), N1, N2, MaskAlloc);
1389 SDValue SelectionDAG::getConvertRndSat(EVT VT, SDLoc dl,
1401 AddNodeIDNode(ID, ISD::CONVERT_RNDSAT, getVTList(VT), &Ops[0], 5);
1406 CvtRndSatSDNode *N = new (NodeAllocator) CvtRndSatSDNode(VT, dl.getIROrder(), dl.getDebugLoc(), Ops, 5,
1413 SDValue SelectionDAG::getRegister(unsigned RegNo, EVT VT) {
1415 AddNodeIDNode(ID, ISD::Register, getVTList(VT), 0, 0);
1421 SDNode *N = new (NodeAllocator) RegisterSDNode(RegNo, VT);
1457 SDValue SelectionDAG::getBlockAddress(const BlockAddress *BA, EVT VT,
1464 AddNodeIDNode(ID, Opc, getVTList(VT), 0, 0);
1472 SDNode *N = new (NodeAllocator) BlockAddressSDNode(Opc, VT, BA, Offset,
1527 SDValue SelectionDAG::CreateStackTemporary(EVT VT, unsigned minAlign) {
1529 unsigned ByteSize = VT.getStoreSize();
1530 Type *Ty = VT.getTypeForEVT(*getContext());
1556 SDValue SelectionDAG::FoldSetCC(EVT VT, SDValue N1,
1562 case ISD::SETFALSE2: return getConstant(0, VT);
1564 case ISD::SETTRUE2: return getConstant(1, VT);
1587 case ISD::SETEQ: return getConstant(C1 == C2, VT);
1588 case ISD::SETNE: return getConstant(C1 != C2, VT);
1589 case ISD::SETULT: return getConstant(C1.ult(C2), VT);
1590 case ISD::SETUGT: return getConstant(C1.ugt(C2), VT);
1591 case ISD::SETULE: return getConstant(C1.ule(C2), VT);
1592 case ISD::SETUGE: return getConstant(C1.uge(C2), VT);
1593 case ISD::SETLT: return getConstant(C1.slt(C2), VT);
1594 case ISD::SETGT: return getConstant(C1.sgt(C2), VT);
1595 case ISD::SETLE: return getConstant(C1.sle(C2), VT);
1596 case ISD::SETGE: return getConstant(C1.sge(C2), VT);
1606 return getUNDEF(VT);
1608 case ISD::SETOEQ: return getConstant(R==APFloat::cmpEqual, VT);
1610 return getUNDEF(VT);
1613 R==APFloat::cmpLessThan, VT);
1615 return getUNDEF(VT);
1617 case ISD::SETOLT: return getConstant(R==APFloat::cmpLessThan, VT);
1619 return getUNDEF(VT);
1621 case ISD::SETOGT: return getConstant(R==APFloat::cmpGreaterThan, VT);
1623 return getUNDEF(VT);
1626 R==APFloat::cmpEqual, VT);
1628 return getUNDEF(VT);
1631 R==APFloat::cmpEqual, VT);
1632 case ISD::SETO: return getConstant(R!=APFloat::cmpUnordered, VT);
1633 case ISD::SETUO: return getConstant(R==APFloat::cmpUnordered, VT);
1635 R==APFloat::cmpEqual, VT);
1636 case ISD::SETUNE: return getConstant(R!=APFloat::cmpEqual, VT);
1638 R==APFloat::cmpLessThan, VT);
1640 R==APFloat::cmpUnordered, VT);
1641 case ISD::SETULE: return getConstant(R!=APFloat::cmpGreaterThan, VT);
1642 case ISD::SETUGE: return getConstant(R!=APFloat::cmpLessThan, VT);
1646 return getSetCC(dl, VT, N2, N1, ISD::getSetCCSwappedOperands(Cond));
1922 EVT VT = LD->getMemoryVT();
1923 unsigned MemBits = VT.getScalarType().getSizeInBits();
1990 EVT VT = cast<VTSDNode>(Op.getOperand(1))->getVT();
1991 APInt InMask = APInt::getLowBitsSet(BitWidth, VT.getSizeInBits());
2129 EVT VT = Op.getValueType();
2130 assert(VT.isInteger() && "Invalid VT!");
2131 unsigned VTBits = VT.getScalarType().getSizeInBits();
2407 SDValue SelectionDAG::getNode(unsigned Opcode, SDLoc DL, EVT VT) {
2409 AddNodeIDNode(ID, Opcode, getVTList(VT), 0, 0);
2414 SDNode *N = new (NodeAllocator) SDNode(Opcode, DL.getIROrder(), DL.getDebugLoc(), getVTList(VT));
2425 EVT VT, SDValue Operand) {
2432 return getConstant(Val.sextOrTrunc(VT.getSizeInBits()), VT);
2436 return getConstant(Val.zextOrTrunc(VT.getSizeInBits()), VT);
2439 APFloat apf(EVTToAPFloatSemantics(VT),
2440 APInt::getNullValue(VT.getSizeInBits()));
2444 return getConstantFP(apf, VT);
2447 if (VT == MVT::f32 && C->getValueType(0) == MVT::i32)
2448 return getConstantFP(APFloat(APFloat::IEEEsingle, Val), VT);
2449 else if (VT == MVT::f64 && C->getValueType(0) == MVT::i64)
2450 return getConstantFP(APFloat(APFloat::IEEEdouble, Val), VT);
2453 return getConstant(Val.byteSwap(), VT);
2455 return getConstant(Val.countPopulation(), VT);
2458 return getConstant(Val.countLeadingZeros(), VT);
2461 return getConstant(Val.countTrailingZeros(), VT);
2471 return getConstantFP(V, VT);
2474 return getConstantFP(V, VT);
2478 return getConstantFP(V, VT);
2484 return getConstantFP(V, VT);
2490 return getConstantFP(V, VT);
2497 (void)V.convert(EVTToAPFloatSemantics(VT),
2499 return getConstantFP(V, VT);
2507 APFloat::opStatus s = V.convertToInteger(x, VT.getSizeInBits(),
2512 APInt api(VT.getSizeInBits(), x);
2513 return getConstant(api, VT);
2516 if (VT == MVT::i32 && C->getValueType(0) == MVT::f32)
2517 return getConstant((uint32_t)V.bitcastToAPInt().getZExtValue(), VT);
2518 else if (VT == MVT::i64 && C->getValueType(0) == MVT::f64)
2519 return getConstant(V.bitcastToAPInt().getZExtValue(), VT);
2532 assert(VT.isFloatingPoint() &&
2534 if (Operand.getValueType() == VT) return Operand; // noop conversion.
2535 assert((!VT.isVector() ||
2536 VT.getVectorNumElements() ==
2540 return getUNDEF(VT);
2543 assert(VT.isInteger() && Operand.getValueType().isInteger() &&
2545 if (Operand.getValueType() == VT) return Operand; // noop extension
2546 assert(Operand.getValueType().getScalarType().bitsLT(VT.getScalarType()) &&
2548 assert((!VT.isVector() ||
2549 VT.getVectorNumElements() ==
2553 return getNode(OpOpcode, DL, VT, Operand.getNode()->getOperand(0));
2556 return getConstant(0, VT);
2559 assert(VT.isInteger() && Operand.getValueType().isInteger() &&
2561 if (Operand.getValueType() == VT) return Operand; // noop extension
2562 assert(Operand.getValueType().getScalarType().bitsLT(VT.getScalarType()) &&
2564 assert((!VT.isVector() ||
2565 VT.getVectorNumElements() ==
2569 return getNode(ISD::ZERO_EXTEND, DL, VT,
2573 return getConstant(0, VT);
2576 assert(VT.isInteger() && Operand.getValueType().isInteger() &&
2578 if (Operand.getValueType() == VT) return Operand; // noop extension
2579 assert(Operand.getValueType().getScalarType().bitsLT(VT.getScalarType()) &&
2581 assert((!VT.isVector() ||
2582 VT.getVectorNumElements() ==
2589 return getNode(OpOpcode, DL, VT, Operand.getNode()->getOperand(0));
2591 return getUNDEF(VT);
2596 if (OpOp.getValueType() == VT)
2601 assert(VT.isInteger() && Operand.getValueType().isInteger() &&
2603 if (Operand.getValueType() == VT) return Operand; // noop truncate
2604 assert(Operand.getValueType().getScalarType().bitsGT(VT.getScalarType()) &&
2606 assert((!VT.isVector() ||
2607 VT.getVectorNumElements() ==
2611 return getNode(ISD::TRUNCATE, DL, VT, Operand.getNode()->getOperand(0));
2616 .bitsLT(VT.getScalarType()))
2617 return getNode(OpOpcode, DL, VT, Operand.getNode()->getOperand(0));
2618 if (Operand.getNode()->getOperand(0).getValueType().bitsGT(VT))
2619 return getNode(ISD::TRUNCATE, DL, VT, Operand.getNode()->getOperand(0));
2623 return getUNDEF(VT);
2627 assert(VT.getSizeInBits() == Operand.getValueType().getSizeInBits()
2629 if (VT == Operand.getValueType()) return Operand; // noop conversion.
2631 return getNode(ISD::BITCAST, DL, VT, Operand.getOperand(0));
2633 return getUNDEF(VT);
2636 assert(VT.isVector() && !Operand.getValueType().isVector() &&
2637 (VT.getVectorElementType() == Operand.getValueType() ||
2638 (VT.getVectorElementType().isInteger() &&
2640 VT.getVectorElementType().bitsLE(Operand.getValueType()))) &&
2643 return getUNDEF(VT);
2648 Operand.getOperand(0).getValueType() == VT)
2654 return getNode(ISD::FSUB, DL, VT, Operand.getNode()->getOperand(1),
2661 return getNode(ISD::FABS, DL, VT, Operand.getNode()->getOperand(0));
2666 SDVTList VTs = getVTList(VT);
2667 if (VT != MVT::Glue) { // Don't CSE flag producing nodes
2688 SDValue SelectionDAG::FoldConstantArithmetic(unsigned Opcode, EVT VT,
2692 EVT SVT = VT.getScalarType();
2793 return getNode(ISD::BUILD_VECTOR, SDLoc(), VT, Outputs.data(),
2797 SDValue SelectionDAG::getNode(unsigned Opcode, SDLoc DL, EVT VT, SDValue N1,
2804 assert(VT == MVT::Other && N1.getValueType() == MVT::Other &&
2815 return getUNDEF(VT);
2824 return getNode(ISD::BUILD_VECTOR, DL, VT, &Elts[0], Elts.size());
2828 assert(VT.isInteger() && "This operator does not apply to FP types!");
2830 N1.getValueType() == VT && "Binary operator types must match!");
2842 assert(VT.isInteger() && "This operator does not apply to FP types!");
2844 N1.getValueType() == VT && "Binary operator types must match!");
2857 assert(VT.isInteger() && "This operator does not apply to FP types!");
2859 N1.getValueType() == VT && "Binary operator types must match!");
2901 assert(VT.isFloatingPoint() && "This operator only applies to FP types!");
2903 N1.getValueType() == VT && "Binary operator types must match!");
2906 assert(N1.getValueType() == VT &&
2916 assert(VT == N1.getValueType() &&
2918 assert(VT.isInteger() && N2.getValueType().isInteger() &&
2920 assert((!VT.isVector() || VT == N2.getValueType()) &&
2922 // Verify that the shift amount VT is bit enough to hold valid shift
2933 if (VT == MVT::i1)
2940 assert(VT == N1.getValueType() && "Not an inreg round!");
2941 assert(VT.isFloatingPoint() && EVT.isFloatingPoint() &&
2943 assert(EVT.isVector() == VT.isVector() &&
2947 EVT.getVectorNumElements() == VT.getVectorNumElements()) &&
2949 assert(EVT.bitsLE(VT) && "Not rounding down!");
2951 if (cast<VTSDNode>(N2)->getVT() == VT) return N1; // Not actually rounding.
2955 assert(VT.isFloatingPoint() &&
2957 VT.bitsLE(N1.getValueType()) &&
2959 if (N1.getValueType() == VT) return N1; // noop conversion.
2964 assert(VT == N1.getValueType() && "Not an inreg extend!");
2965 assert(VT.isInteger() && EVT.isInteger() &&
2970 assert(EVT.bitsLE(VT) && "Not extending!");
2971 if (VT == EVT) return N1; // noop assertion.
2976 assert(VT == N1.getValueType() && "Not an inreg extend!");
2977 assert(VT.isInteger() && EVT.isInteger() &&
2979 assert(EVT.isVector() == VT.isVector() &&
2983 EVT.getVectorNumElements() == VT.getVectorNumElements()) &&
2985 assert(EVT.bitsLE(VT) && "Not extending!");
2986 if (EVT == VT) return N1; // Not actually extending
2993 return getConstant(Val, VT);
3000 return getUNDEF(VT);
3009 return getNode(ISD::EXTRACT_VECTOR_ELT, DL, VT,
3020 if (VT != Elt.getValueType())
3024 Elt = getAnyExtOrTrunc(Elt, DL, VT);
3040 if (VT == N1.getOperand(1).getValueType())
3043 return getSExtOrTrunc(N1.getOperand(1), DL, VT);
3046 return getNode(ISD::EXTRACT_VECTOR_ELT, DL, VT, N1.getOperand(0), N2);
3052 assert(!N1.getValueType().isVector() && !VT.isVector() &&
3053 (N1.getValueType().isInteger() == VT.isInteger()) &&
3054 N1.getValueType() != VT &&
3065 unsigned ElementSize = VT.getSizeInBits();
3068 return getConstant(ShiftedVal.trunc(ElementSize), VT);
3073 if (VT.isSimple() && N1.getValueType().isSimple()) {
3074 assert(VT.isVector() && N1.getValueType().isVector() &&
3076 assert(VT.getVectorElementType() == N1.getValueType().getVectorElementType() &&
3078 assert(VT.getSimpleVT() <= N1.getValueType().getSimpleVT() &&
3082 assert((VT.getVectorNumElements() +
3089 if (VT.getSimpleVT() == N1.getValueType().getSimpleVT())
3097 SDValue SV = FoldConstantArithmetic(Opcode, VT, N1.getNode(), N2.getNode());
3121 return getConstantFP(V1, VT);
3126 return getConstantFP(V1, VT);
3131 return getConstantFP(V1, VT);
3136 return getConstantFP(V1, VT);
3141 return getConstantFP(V1, VT);
3145 return getConstantFP(V1, VT);
3155 (void)V.convert(EVTToAPFloatSemantics(VT),
3157 return getConstantFP(V, VT);
3181 if (!VT.isVector())
3182 return getConstant(0, VT); // fold op(undef, arg2) -> 0
3197 return getConstant(0, VT);
3220 if (!VT.isVector())
3221 return getConstant(0, VT); // fold op(arg1, undef) -> 0
3226 if (!VT.isVector())
3227 return getConstant(APInt::getAllOnesValue(VT.getSizeInBits()), VT);
3238 SDVTList VTs = getVTList(VT);
3239 if (VT != MVT::Glue) {
3260 SDValue SelectionDAG::getNode(unsigned Opcode, SDLoc DL, EVT VT,
3276 return getConstantFP(V1, VT);
3290 return getNode(ISD::BUILD_VECTOR, DL, VT, &Elts[0], Elts.size());
3295 SDValue Simp = FoldSetCC(VT, N1, N2, cast<CondCodeSDNode>(N3)->get(), DL);
3312 if (VT.isSimple() && N1.getValueType().isSimple()
3314 assert(VT.isVector() && N1.getValueType().isVector() &&
3317 assert(VT == N1.getValueType() &&
3324 <= VT.getVectorNumElements())
3329 if (VT.getSimpleVT() == N2.getValueType().getSimpleVT())
3336 if (N1.getValueType() == VT)
3343 SDVTList VTs = getVTList(VT);
3344 if (VT != MVT::Glue) {
3365 SDValue SelectionDAG::getNode(unsigned Opcode, SDLoc DL, EVT VT,
3369 return getNode(Opcode, DL, VT, Ops, 4);
3372 SDValue SelectionDAG::getNode(unsigned Opcode, SDLoc DL, EVT VT,
3376 return getNode(Opcode, DL, VT, Ops, 5);
3404 static SDValue getMemsetValue(SDValue Value, EVT VT, SelectionDAG &DAG,
3408 unsigned NumBits = VT.getScalarType().getSizeInBits();
3412 if (VT.isInteger())
3413 return DAG.getConstant(Val, VT);
3414 return DAG.getConstantFP(APFloat(DAG.EVTToAPFloatSemantics(VT), Val), VT);
3417 Value = DAG.getNode(ISD::ZERO_EXTEND, dl, VT, Value);
3422 Value = DAG.getNode(ISD::MUL, dl, VT, Value, DAG.getConstant(Magic, VT));
3431 static SDValue getMemsetStringVal(EVT VT, SDLoc dl, SelectionDAG &DAG,
3435 if (VT.isInteger())
3436 return DAG.getConstant(0, VT);
3437 else if (VT == MVT::f32 || VT == MVT::f64)
3438 return DAG.getConstantFP(0.0, VT);
3439 else if (VT.isVector()) {
3440 unsigned NumElts = VT.getVectorNumElements();
3441 MVT EltVT = (VT.getVectorElementType() == MVT::f32) ? MVT::i32 : MVT::i64;
3442 return DAG.getNode(ISD::BITCAST, dl, VT,
3449 assert(!VT.isVector() && "Can't handle vector type here!");
3450 unsigned NumVTBits = VT.getSizeInBits();
3466 if (TTI->getIntImmCost(Val, VT.getTypeForEVT(*DAG.getContext())) < 2)
3467 return DAG.getConstant(Val, VT);
3475 EVT VT = Base.getValueType();
3477 VT, Base, DAG.getConstant(Offset, VT));
3521 EVT VT = TLI.getOptimalMemOpType(Size, DstAlign, SrcAlign,
3525 if (VT == MVT::Other) {
3527 TLI.allowsUnalignedMemoryAccesses(VT)) {
3528 VT = TLI.getPointerTy();
3531 case 0: VT = MVT::i64; break;
3532 case 4: VT = MVT::i32; break;
3533 case 2: VT = MVT::i16; break;
3534 default: VT = MVT::i8; break;
3543 if (VT.bitsGT(LVT))
3544 VT = LVT;
3549 unsigned VTSize = VT.getSizeInBits() / 8;
3552 EVT NewVT = VT;
3556 if (VT.isVector() || VT.isFloatingPoint()) {
3557 NewVT = (VT.getSizeInBits() > 64) ? MVT::i64 : MVT::i32;
3579 // If the new VT cannot cover all of the remaining bits, then consider
3586 TLI.allowsUnalignedMemoryAccesses(VT, &Fast) && Fast)
3589 VT = NewVT;
3597 MemOps.push_back(VT);
3668 EVT VT = MemOps[i];
3669 unsigned VTSize = VT.getSizeInBits() / 8;
3681 (isZeroStr || (VT.isInteger() && !VT.isVector()))) {
3687 Value = getMemsetStringVal(VT, dl, DAG, TLI, Str.substr(SrcOff));
3699 // to Load/Store if NVT==VT.
3701 EVT NVT = TLI.getTypeToTransformTo(*DAG.getContext(), VT);
3702 assert(NVT.bitsGE(VT));
3705 SrcPtrInfo.getWithOffset(SrcOff), VT, isVol, false,
3709 DstPtrInfo.getWithOffset(DstOff), VT, isVol,
3772 EVT VT = MemOps[i];
3773 unsigned VTSize = VT.getSizeInBits() / 8;
3776 Value = DAG.getLoad(VT, dl, Chain,
3788 EVT VT = MemOps[i];
3789 unsigned VTSize = VT.getSizeInBits() / 8;
3854 EVT VT = MemOps[i];
3855 unsigned VTSize = VT.getSizeInBits() / 8;
3866 if (VT.bitsLT(LargestVT)) {
3867 if (!LargestVT.isVector() && !VT.isVector() &&
3868 TLI.isTruncateFree(LargestVT, VT))
3869 Value = DAG.getNode(ISD::TRUNCATE, dl, VT, MemSetValue);
3871 Value = getMemsetValue(Src, VT, DAG, dl);
3873 assert(Value.getValueType() == VT && "Value with wrong type.");
3879 DstOff += VT.getSizeInBits() / 8;
4117 EVT VT = Cmp.getValueType();
4119 SDVTList VTs = getVTList(VT, MVT::Other);
4189 EVT VT = Val.getValueType();
4192 getVTList(VT, MVT::Other);
4212 EVT VT, SDValue Chain,
4238 return getAtomic(Opcode, dl, MemVT, VT, Chain, Ptr, MMO,
4243 EVT VT, SDValue Chain,
4250 SDVTList VTs = getVTList(VT, MVT::Other);
4389 EVT VT, SDLoc dl, SDValue Chain,
4398 Alignment = getEVTAlignment(VT);
4417 return getLoad(AM, ExtType, VT, dl, Chain, Ptr, Offset, MemVT, MMO);
4422 EVT VT, SDLoc dl, SDValue Chain,
4425 if (VT == MemVT) {
4428 assert(VT == MemVT && "Non-extending load from different memory type!");
4431 assert(MemVT.getScalarType().bitsLT(VT.getScalarType()) &&
4433 assert(VT.isInteger() == MemVT.isInteger() &&
4435 assert(VT.isVector() == MemVT.isVector() &&
4437 assert((!VT.isVector() ||
4438 VT.getVectorNumElements() == MemVT.getVectorNumElements()) &&
4447 getVTList(VT, Ptr.getValueType(), MVT::Other) : getVTList(VT, MVT::Other);
4468 SDValue SelectionDAG::getLoad(EVT VT, SDLoc dl,
4476 return getLoad(ISD::UNINDEXED, ISD::NON_EXTLOAD, VT, dl, Chain, Ptr, Undef,
4477 PtrInfo, VT, isVolatile, isNonTemporal, isInvariant, Alignment,
4481 SDValue SelectionDAG::getExtLoad(ISD::LoadExtType ExtType, SDLoc dl, EVT VT,
4487 return getLoad(ISD::UNINDEXED, ExtType, VT, dl, Chain, Ptr, Undef,
4536 EVT VT = Val.getValueType();
4542 ID.AddInteger(VT.getRawBits());
4552 false, VT, MMO);
4588 EVT VT = Val.getValueType();
4592 if (VT == SVT)
4595 assert(SVT.getScalarType().bitsLT(VT.getScalarType()) &&
4597 assert(VT.isInteger() == SVT.isInteger() &&
4599 assert(VT.isVector() == SVT.isVector() &&
4601 assert((!VT.isVector() ||
4602 VT.getVectorNumElements() == SVT.getVectorNumElements()) &&
4652 SDValue SelectionDAG::getVAArg(EVT VT, SDLoc dl,
4657 return getNode(ISD::VAARG, dl, getVTList(VT, MVT::Other), Ops, 4);
4660 SDValue SelectionDAG::getNode(unsigned Opcode, SDLoc DL, EVT VT,
4663 case 0: return getNode(Opcode, DL, VT);
4664 case 1: return getNode(Opcode, DL, VT, Ops[0]);
4665 case 2: return getNode(Opcode, DL, VT, Ops[0], Ops[1]);
4666 case 3: return getNode(Opcode, DL, VT, Ops[0], Ops[1], Ops[2]);
4673 return getNode(Opcode, DL, VT, &NewOps[0], NumOps);
4676 SDValue SelectionDAG::getNode(unsigned Opcode, SDLoc DL, EVT VT,
4679 case 0: return getNode(Opcode, DL, VT);
4680 case 1: return getNode(Opcode, DL, VT, Ops[0]);
4681 case 2: return getNode(Opcode, DL, VT, Ops[0], Ops[1]);
4682 case 3: return getNode(Opcode, DL, VT, Ops[0], Ops[1], Ops[2]);
4694 assert(Ops[2].getValueType() == VT &&
4708 SDVTList VTs = getVTList(VT);
4710 VT != MVT::Glue) {
4761 return getNode(Opcode, DL, VT, N1, N2, N3.getOperand(0));
4766 unsigned NumBits = VT.getScalarType().getSizeInBits()*2;
4768 return getNode(Opcode, DL, VT, N1, N2, N3.getOperand(0));
4849 SDVTList SelectionDAG::getVTList(EVT VT) {
4850 return makeVTList(SDNode::getValueTypeList(VT), 1);
5057 EVT VT) {
5058 SDVTList VTs = getVTList(VT);
5063 EVT VT, SDValue Op1) {
5064 SDVTList VTs = getVTList(VT);
5070 EVT VT, SDValue Op1,
5072 SDVTList VTs = getVTList(VT);
5078 EVT VT, SDValue Op1,
5080 SDVTList VTs = getVTList(VT);
5086 EVT VT, const SDValue *Ops,
5088 SDVTList VTs = getVTList(VT);
5278 SelectionDAG::getMachineNode(unsigned Opcode, SDLoc dl, EVT VT) {
5279 SDVTList VTs = getVTList(VT);
5284 SelectionDAG::getMachineNode(unsigned Opcode, SDLoc dl, EVT VT, SDValue Op1) {
5285 SDVTList VTs = getVTList(VT);
5291 SelectionDAG::getMachineNode(unsigned Opcode, SDLoc dl, EVT VT,
5293 SDVTList VTs = getVTList(VT);
5299 SelectionDAG::getMachineNode(unsigned Opcode, SDLoc dl, EVT VT,
5301 SDVTList VTs = getVTList(VT);
5307 SelectionDAG::getMachineNode(unsigned Opcode, SDLoc dl, EVT VT,
5309 SDVTList VTs = getVTList(VT);
5439 SelectionDAG::getTargetExtractSubreg(int SRIdx, SDLoc DL, EVT VT,
5443 VT, Operand, SRIdxVal);
5450 SelectionDAG::getTargetInsertSubreg(int SRIdx, SDLoc DL, EVT VT,
5454 VT, Operand, Subreg, SRIdxVal);
5914 EVT VT, int64_t o, unsigned char TF)
5915 : SDNode(Opc, Order, DL, getSDVTList(VT)), Offset(o), TargetFlags(TF) {
5965 const EVT *SDNode::getValueTypeList(EVT VT) {
5966 if (VT.isExtended()) {
5968 return &(*EVTs->insert(VT).first);
5970 assert(VT.getSimpleVT() < MVT::LAST_VALUETYPE &&
5972 return &SimpleVTArray->VTs[VT.getSimpleVT().SimpleTy];
6117 EVT VT = N->getValueType(0);
6118 unsigned NE = VT.getVectorNumElements();
6119 EVT EltVT = VT.getVectorElementType();
6194 EVT VT = LD->getValueType(0);
6195 if (VT.getSizeInBits() / 8 != Bytes)
6289 EVT VT = getValueType(0);
6290 assert(VT.isVector() && "Expected a vector type");
6291 unsigned sz = VT.getSizeInBits();
6304 unsigned EltBitSize = VT.getVectorElementType().getSizeInBits();
6349 bool ShuffleVectorSDNode::isSplatMask(const int *Mask, EVT VT) {
6352 for (i = 0, e = VT.getVectorNumElements(); i != e && Mask[i] < 0; ++i)