Home | History | Annotate | Download | only in SelectionDAG

Lines Matching refs:VT

79 bool ConstantFPSDNode::isValueValidForType(EVT VT,
81 assert(VT.isFloatingPoint() && "Can only convert between FP types");
86 (void) Val2.convert(SelectionDAG::EVTToAPFloatSemantics(VT),
673 EVT VT = cast<VTSDNode>(N)->getVT();
674 if (VT.isExtended()) {
675 Erased = ExtendedValueTypeNodes.erase(VT);
677 Erased = ValueTypeNodes[VT.getSimpleVT().SimpleTy] != 0;
678 ValueTypeNodes[VT.getSimpleVT().SimpleTy] = 0;
793 EVT VT = N->getValueType(0);
795 assert(!VT.isVector() && (VT.isInteger() || VT.isFloatingPoint()) &&
800 assert(N->getOperand(0).getValueType().isInteger() == VT.isInteger() &&
802 assert(VT.getSizeInBits() == 2 * N->getOperand(0).getValueSizeInBits() &&
866 unsigned SelectionDAG::getEVTAlignment(EVT VT) const {
867 Type *Ty = VT == MVT::iPTR ?
869 VT.getTypeForEVT(*getContext());
925 SDValue SelectionDAG::getAnyExtOrTrunc(SDValue Op, DebugLoc DL, EVT VT) {
926 return VT.bitsGT(Op.getValueType()) ?
927 getNode(ISD::ANY_EXTEND, DL, VT, Op) :
928 getNode(ISD::TRUNCATE, DL, VT, Op);
931 SDValue SelectionDAG::getSExtOrTrunc(SDValue Op, DebugLoc DL, EVT VT) {
932 return VT.bitsGT(Op.getValueType()) ?
933 getNode(ISD::SIGN_EXTEND, DL, VT, Op) :
934 getNode(ISD::TRUNCATE, DL, VT, Op);
937 SDValue SelectionDAG::getZExtOrTrunc(SDValue Op, DebugLoc DL, EVT VT) {
938 return VT.bitsGT(Op.getValueType()) ?
939 getNode(ISD::ZERO_EXTEND, DL, VT, Op) :
940 getNode(ISD::TRUNCATE, DL, VT, Op);
943 SDValue SelectionDAG::getZeroExtendInReg(SDValue Op, DebugLoc DL, EVT VT) {
944 assert(!VT.isVector() &&
947 if (Op.getValueType() == VT) return Op;
950 VT.getSizeInBits());
957 SDValue SelectionDAG::getNOT(DebugLoc DL, SDValue Val, EVT VT) {
958 EVT EltVT = VT.getScalarType();
960 getConstant(APInt::getAllOnesValue(EltVT.getSizeInBits()), VT);
961 return getNode(ISD::XOR, DL, VT, Val, NegOne);
964 SDValue SelectionDAG::getConstant(uint64_t Val, EVT VT, bool isT) {
965 EVT EltVT = VT.getScalarType();
969 return getConstant(APInt(EltVT.getSizeInBits(), Val), VT, isT);
972 SDValue SelectionDAG::getConstant(const APInt &Val, EVT VT, bool isT) {
973 return getConstant(*ConstantInt::get(*Context, Val), VT, isT);
976 SDValue SelectionDAG::getConstant(const ConstantInt &Val, EVT VT, bool isT) {
977 assert(VT.isInteger() && "Cannot create FP integer constant!");
979 EVT EltVT = VT.getScalarType();
986 if (VT.isVector() && TLI.getTypeAction(*getContext(), EltVT) ==
1002 if (!VT.isVector())
1012 if (VT.isVector()) {
1014 Ops.assign(VT.getVectorNumElements(), Result);
1015 Result = getNode(ISD::BUILD_VECTOR, DebugLoc(), VT, &Ops[0], Ops.size());
1025 SDValue SelectionDAG::getConstantFP(const APFloat& V, EVT VT, bool isTarget) {
1026 return getConstantFP(*ConstantFP::get(*getContext(), V), VT, isTarget);
1029 SDValue SelectionDAG::getConstantFP(const ConstantFP& V, EVT VT, bool isTarget){
1030 assert(VT.isFloatingPoint() && "Cannot create integer FP constant!");
1032 EVT EltVT = VT.getScalarType();
1044 if (!VT.isVector())
1054 if (VT.isVector()) {
1056 Ops.assign(VT.getVectorNumElements(), Result);
1058 Result = getNode(ISD::BUILD_VECTOR, DebugLoc(), VT, &Ops[0], Ops.size());
1063 SDValue SelectionDAG::getConstantFP(double Val, EVT VT, bool isTarget) {
1064 EVT EltVT = VT.getScalarType();
1066 return getConstantFP(APFloat((float)Val), VT, isTarget);
1068 return getConstantFP(APFloat(Val), VT, isTarget);
1075 return getConstantFP(apf, VT, isTarget);
1081 EVT VT, int64_t Offset,
1106 AddNodeIDNode(ID, Opc, getVTList(VT), 0, 0);
1115 SDNode *N = new (NodeAllocator) GlobalAddressSDNode(Opc, DL, GV, VT,
1122 SDValue SelectionDAG::getFrameIndex(int FI, EVT VT, bool isTarget) {
1125 AddNodeIDNode(ID, Opc, getVTList(VT), 0, 0);
1131 SDNode *N = new (NodeAllocator) FrameIndexSDNode(FI, VT, isTarget);
1137 SDValue SelectionDAG::getJumpTable(int JTI, EVT VT, bool isTarget,
1143 AddNodeIDNode(ID, Opc, getVTList(VT), 0, 0);
1150 SDNode *N = new (NodeAllocator) JumpTableSDNode(JTI, VT, isTarget,
1157 SDValue SelectionDAG::getConstantPool(const Constant *C, EVT VT,
1167 AddNodeIDNode(ID, Opc, getVTList(VT), 0, 0);
1176 SDNode *N = new (NodeAllocator) ConstantPoolSDNode(isTarget, C, VT, Offset,
1184 SDValue SelectionDAG::getConstantPool(MachineConstantPoolValue *C, EVT VT,
1194 AddNodeIDNode(ID, Opc, getVTList(VT), 0, 0);
1203 SDNode *N = new (NodeAllocator) ConstantPoolSDNode(isTarget, C, VT, Offset,
1210 SDValue SelectionDAG::getTargetIndex(int Index, EVT VT, int64_t Offset,
1213 AddNodeIDNode(ID, ISD::TargetIndex, getVTList(VT), 0, 0);
1221 SDNode *N = new (NodeAllocator) TargetIndexSDNode(Index, VT, Offset,
1242 SDValue SelectionDAG::getValueType(EVT VT) {
1243 if (VT.isSimple() && (unsigned)VT.getSimpleVT().SimpleTy >=
1245 ValueTypeNodes.resize(VT.getSimpleVT().SimpleTy+1);
1247 SDNode *&N = VT.isExtended() ?
1248 ExtendedValueTypeNodes[VT] : ValueTypeNodes[VT.getSimpleVT().SimpleTy];
1251 N = new (NodeAllocator) VTSDNode(VT);
1256 SDValue SelectionDAG::getExternalSymbol(const char *Sym, EVT VT) {
1259 N = new (NodeAllocator) ExternalSymbolSDNode(false, Sym, 0, VT);
1264 SDValue SelectionDAG::getTargetExternalSymbol(const char *Sym, EVT VT,
1270 N = new (NodeAllocator) ExternalSymbolSDNode(true, Sym, TargetFlags, VT);
1302 SDValue SelectionDAG::getVectorShuffle(EVT VT, DebugLoc dl, SDValue N1,
1305 assert(VT.isVector() && N1.getValueType().isVector() &&
1307 assert(VT.getVectorElementType() == N1.getValueType().getVectorElementType()
1312 return getUNDEF(VT);
1316 unsigned NElts = VT.getVectorNumElements();
1325 N2 = getUNDEF(VT);
1349 return getUNDEF(VT);
1351 N2 = getUNDEF(VT);
1353 N1 = getUNDEF(VT);
1367 return getUNDEF(VT);
1371 AddNodeIDNode(ID, ISD::VECTOR_SHUFFLE, getVTList(VT), Ops, 2);
1386 new (NodeAllocator) ShuffleVectorSDNode(VT, dl, N1, N2, MaskAlloc);
1392 SDValue SelectionDAG::getConvertRndSat(EVT VT, DebugLoc dl,
1404 AddNodeIDNode(ID, ISD::CONVERT_RNDSAT, getVTList(VT), &Ops[0], 5);
1409 CvtRndSatSDNode *N = new (NodeAllocator) CvtRndSatSDNode(VT, dl, Ops, 5,
1416 SDValue SelectionDAG::getRegister(unsigned RegNo, EVT VT) {
1418 AddNodeIDNode(ID, ISD::Register, getVTList(VT), 0, 0);
1424 SDNode *N = new (NodeAllocator) RegisterSDNode(RegNo, VT);
1460 SDValue SelectionDAG::getBlockAddress(const BlockAddress *BA, EVT VT,
1467 AddNodeIDNode(ID, Opc, getVTList(VT), 0, 0);
1475 SDNode *N = new (NodeAllocator) BlockAddressSDNode(Opc, VT, BA, Offset,
1530 SDValue SelectionDAG::CreateStackTemporary(EVT VT, unsigned minAlign) {
1532 unsigned ByteSize = VT.getStoreSize();
1533 Type *Ty = VT.getTypeForEVT(*getContext());
1557 SDValue SelectionDAG::FoldSetCC(EVT VT, SDValue N1,
1563 case ISD::SETFALSE2: return getConstant(0, VT);
1565 case ISD::SETTRUE2: return getConstant(1, VT);
1588 case ISD::SETEQ: return getConstant(C1 == C2, VT);
1589 case ISD::SETNE: return getConstant(C1 != C2, VT);
1590 case ISD::SETULT: return getConstant(C1.ult(C2), VT);
1591 case ISD::SETUGT: return getConstant(C1.ugt(C2), VT);
1592 case ISD::SETULE: return getConstant(C1.ule(C2), VT);
1593 case ISD::SETUGE: return getConstant(C1.uge(C2), VT);
1594 case ISD::SETLT: return getConstant(C1.slt(C2), VT);
1595 case ISD::SETGT: return getConstant(C1.sgt(C2), VT);
1596 case ISD::SETLE: return getConstant(C1.sle(C2), VT);
1597 case ISD::SETGE: return getConstant(C1.sge(C2), VT);
1607 return getUNDEF(VT);
1609 case ISD::SETOEQ: return getConstant(R==APFloat::cmpEqual, VT);
1611 return getUNDEF(VT);
1614 R==APFloat::cmpLessThan, VT);
1616 return getUNDEF(VT);
1618 case ISD::SETOLT: return getConstant(R==APFloat::cmpLessThan, VT);
1620 return getUNDEF(VT);
1622 case ISD::SETOGT: return getConstant(R==APFloat::cmpGreaterThan, VT);
1624 return getUNDEF(VT);
1627 R==APFloat::cmpEqual, VT);
1629 return getUNDEF(VT);
1632 R==APFloat::cmpEqual, VT);
1633 case ISD::SETO: return getConstant(R!=APFloat::cmpUnordered, VT);
1634 case ISD::SETUO: return getConstant(R==APFloat::cmpUnordered, VT);
1636 R==APFloat::cmpEqual, VT);
1637 case ISD::SETUNE: return getConstant(R!=APFloat::cmpEqual, VT);
1639 R==APFloat::cmpLessThan, VT);
1641 R==APFloat::cmpUnordered, VT);
1642 case ISD::SETULE: return getConstant(R!=APFloat::cmpGreaterThan, VT);
1643 case ISD::SETUGE: return getConstant(R!=APFloat::cmpLessThan, VT);
1647 return getSetCC(dl, VT, N2, N1, ISD::getSetCCSwappedOperands(Cond));
1921 EVT VT = LD->getMemoryVT();
1922 unsigned MemBits = VT.getScalarType().getSizeInBits();
1989 EVT VT = cast<VTSDNode>(Op.getOperand(1))->getVT();
1990 APInt InMask = APInt::getLowBitsSet(BitWidth, VT.getSizeInBits());
2127 EVT VT = Op.getValueType();
2128 assert(VT.isInteger() && "Invalid VT!");
2129 unsigned VTBits = VT.getScalarType().getSizeInBits();
2402 SDValue SelectionDAG::getNode(unsigned Opcode, DebugLoc DL, EVT VT) {
2404 AddNodeIDNode(ID, Opcode, getVTList(VT), 0, 0);
2409 SDNode *N = new (NodeAllocator) SDNode(Opcode, DL, getVTList(VT));
2420 EVT VT, SDValue Operand) {
2427 return getConstant(Val.sextOrTrunc(VT.getSizeInBits()), VT);
2431 return getConstant(Val.zextOrTrunc(VT.getSizeInBits()), VT);
2434 APFloat apf(EVTToAPFloatSemantics(VT),
2435 APInt::getNullValue(VT.getSizeInBits()));
2439 return getConstantFP(apf, VT);
2442 if (VT == MVT::f32 && C->getValueType(0) == MVT::i32)
2443 return getConstantFP(APFloat(APFloat::IEEEsingle, Val), VT);
2444 else if (VT == MVT::f64 && C->getValueType(0) == MVT::i64)
2445 return getConstantFP(APFloat(APFloat::IEEEdouble, Val), VT);
2448 return getConstant(Val.byteSwap(), VT);
2450 return getConstant(Val.countPopulation(), VT);
2453 return getConstant(Val.countLeadingZeros(), VT);
2456 return getConstant(Val.countTrailingZeros(), VT);
2466 return getConstantFP(V, VT);
2469 return getConstantFP(V, VT);
2473 return getConstantFP(V, VT);
2479 return getConstantFP(V, VT);
2485 return getConstantFP(V, VT);
2492 (void)V.convert(EVTToAPFloatSemantics(VT),
2494 return getConstantFP(V, VT);
2502 APFloat::opStatus s = V.convertToInteger(x, VT.getSizeInBits(),
2507 APInt api(VT.getSizeInBits(), x);
2508 return getConstant(api, VT);
2511 if (VT == MVT::i32 && C->getValueType(0) == MVT::f32)
2512 return getConstant((uint32_t)V.bitcastToAPInt().getZExtValue(), VT);
2513 else if (VT == MVT::i64 && C->getValueType(0) == MVT::f64)
2514 return getConstant(V.bitcastToAPInt().getZExtValue(), VT);
2527 assert(VT.isFloatingPoint() &&
2529 if (Operand.getValueType() == VT) return Operand; // noop conversion.
2530 assert((!VT.isVector() ||
2531 VT.getVectorNumElements() ==
2535 return getUNDEF(VT);
2538 assert(VT.isInteger() && Operand.getValueType().isInteger() &&
2540 if (Operand.getValueType() == VT) return Operand; // noop extension
2541 assert(Operand.getValueType().getScalarType().bitsLT(VT.getScalarType()) &&
2543 assert((!VT.isVector() ||
2544 VT.getVectorNumElements() ==
2548 return getNode(OpOpcode, DL, VT, Operand.getNode()->getOperand(0));
2551 return getConstant(0, VT);
2554 assert(VT.isInteger() && Operand.getValueType().isInteger() &&
2556 if (Operand.getValueType() == VT) return Operand; // noop extension
2557 assert(Operand.getValueType().getScalarType().bitsLT(VT.getScalarType()) &&
2559 assert((!VT.isVector() ||
2560 VT.getVectorNumElements() ==
2564 return getNode(ISD::ZERO_EXTEND, DL, VT,
2568 return getConstant(0, VT);
2571 assert(VT.isInteger() && Operand.getValueType().isInteger() &&
2573 if (Operand.getValueType() == VT) return Operand; // noop extension
2574 assert(Operand.getValueType().getScalarType().bitsLT(VT.getScalarType()) &&
2576 assert((!VT.isVector() ||
2577 VT.getVectorNumElements() ==
2584 return getNode(OpOpcode, DL, VT, Operand.getNode()->getOperand(0));
2586 return getUNDEF(VT);
2591 if (OpOp.getValueType() == VT)
2596 assert(VT.isInteger() && Operand.getValueType().isInteger() &&
2598 if (Operand.getValueType() == VT) return Operand; // noop truncate
2599 assert(Operand.getValueType().getScalarType().bitsGT(VT.getScalarType()) &&
2601 assert((!VT.isVector() ||
2602 VT.getVectorNumElements() ==
2606 return getNode(ISD::TRUNCATE, DL, VT, Operand.getNode()->getOperand(0));
2611 .bitsLT(VT.getScalarType()))
2612 return getNode(OpOpcode, DL, VT, Operand.getNode()->getOperand(0));
2613 if (Operand.getNode()->getOperand(0).getValueType().bitsGT(VT))
2614 return getNode(ISD::TRUNCATE, DL, VT, Operand.getNode()->getOperand(0));
2618 return getUNDEF(VT);
2622 assert(VT.getSizeInBits() == Operand.getValueType().getSizeInBits()
2624 if (VT == Operand.getValueType()) return Operand; // noop conversion.
2626 return getNode(ISD::BITCAST, DL, VT, Operand.getOperand(0));
2628 return getUNDEF(VT);
2631 assert(VT.isVector() && !Operand.getValueType().isVector() &&
2632 (VT.getVectorElementType() == Operand.getValueType() ||
2633 (VT.getVectorElementType().isInteger() &&
2635 VT.getVectorElementType().bitsLE(Operand.getValueType()))) &&
2638 return getUNDEF(VT);
2643 Operand.getOperand(0).getValueType() == VT)
2649 return getNode(ISD::FSUB, DL, VT, Operand.getNode()->getOperand(1),
2656 return getNode(ISD::FABS, DL, VT, Operand.getNode()->getOperand(0));
2661 SDVTList VTs = getVTList(VT);
2662 if (VT != MVT::Glue) { // Don't CSE flag producing nodes
2683 SDValue SelectionDAG::FoldConstantArithmetic(unsigned Opcode, EVT VT,
2687 EVT SVT = VT.getScalarType();
2788 return getNode(ISD::BUILD_VECTOR, DebugLoc(), VT, Outputs.data(),
2792 SDValue SelectionDAG::getNode(unsigned Opcode, DebugLoc DL, EVT VT, SDValue N1,
2799 assert(VT == MVT::Other && N1.getValueType() == MVT::Other &&
2810 return getUNDEF(VT);
2819 return getNode(ISD::BUILD_VECTOR, DL, VT, &Elts[0], Elts.size());
2823 assert(VT.isInteger() && "This operator does not apply to FP types!");
2825 N1.getValueType() == VT && "Binary operator types must match!");
2837 assert(VT.isInteger() && "This operator does not apply to FP types!");
2839 N1.getValueType() == VT && "Binary operator types must match!");
2852 assert(VT.isInteger() && "This operator does not apply to FP types!");
2854 N1.getValueType() == VT && "Binary operator types must match!");
2896 assert(VT.isFloatingPoint() && "This operator only applies to FP types!");
2898 N1.getValueType() == VT && "Binary operator types must match!");
2901 assert(N1.getValueType() == VT &&
2911 assert(VT == N1.getValueType() &&
2913 assert(VT.isInteger() && N2.getValueType().isInteger() &&
2915 assert((!VT.isVector() || VT == N2.getValueType()) &&
2917 // Verify that the shift amount VT is bit enough to hold valid shift
2928 if (VT == MVT::i1)
2935 assert(VT == N1.getValueType() && "Not an inreg round!");
2936 assert(VT.isFloatingPoint() && EVT.isFloatingPoint() &&
2938 assert(EVT.isVector() == VT.isVector() &&
2942 EVT.getVectorNumElements() == VT.getVectorNumElements()) &&
2944 assert(EVT.bitsLE(VT) && "Not rounding down!");
2946 if (cast<VTSDNode>(N2)->getVT() == VT) return N1; // Not actually rounding.
2950 assert(VT.isFloatingPoint() &&
2952 VT.bitsLE(N1.getValueType()) &&
2954 if (N1.getValueType() == VT) return N1; // noop conversion.
2959 assert(VT == N1.getValueType() && "Not an inreg extend!");
2960 assert(VT.isInteger() && EVT.isInteger() &&
2965 assert(EVT.bitsLE(VT) && "Not extending!");
2966 if (VT == EVT) return N1; // noop assertion.
2971 assert(VT == N1.getValueType() && "Not an inreg extend!");
2972 assert(VT.isInteger() && EVT.isInteger() &&
2974 assert(EVT.isVector() == VT.isVector() &&
2978 EVT.getVectorNumElements() == VT.getVectorNumElements()) &&
2980 assert(EVT.bitsLE(VT) && "Not extending!");
2981 if (EVT == VT) return N1; // Not actually extending
2988 return getConstant(Val, VT);
2995 return getUNDEF(VT);
3004 return getNode(ISD::EXTRACT_VECTOR_ELT, DL, VT,
3015 if (VT != Elt.getValueType())
3019 Elt = getAnyExtOrTrunc(Elt, DL, VT);
3035 if (VT == N1.getOperand(1).getValueType())
3038 return getSExtOrTrunc(N1.getOperand(1), DL, VT);
3041 return getNode(ISD::EXTRACT_VECTOR_ELT, DL, VT, N1.getOperand(0), N2);
3047 assert(!N1.getValueType().isVector() && !VT.isVector() &&
3048 (N1.getValueType().isInteger() == VT.isInteger()) &&
3049 N1.getValueType() != VT &&
3060 unsigned ElementSize = VT.getSizeInBits();
3063 return getConstant(ShiftedVal.trunc(ElementSize), VT);
3068 if (VT.isSimple() && N1.getValueType().isSimple()) {
3069 assert(VT
3071 assert(VT.getVectorElementType() == N1.getValueType().getVectorElementType() &&
3073 assert(VT.getSimpleVT() <= N1.getValueType().getSimpleVT() &&
3077 assert((VT.getVectorNumElements() +
3084 if (VT.getSimpleVT() == N1.getValueType().getSimpleVT())
3092 SDValue SV = FoldConstantArithmetic(Opcode, VT, N1.getNode(), N2.getNode());
3116 return getConstantFP(V1, VT);
3121 return getConstantFP(V1, VT);
3126 return getConstantFP(V1, VT);
3131 return getConstantFP(V1, VT);
3136 return getConstantFP(V1, VT);
3140 return getConstantFP(V1, VT);
3150 (void)V.convert(EVTToAPFloatSemantics(VT),
3152 return getConstantFP(V, VT);
3176 if (!VT.isVector())
3177 return getConstant(0, VT); // fold op(undef, arg2) -> 0
3192 return getConstant(0, VT);
3215 if (!VT.isVector())
3216 return getConstant(0, VT); // fold op(arg1, undef) -> 0
3221 if (!VT.isVector())
3222 return getConstant(APInt::getAllOnesValue(VT.getSizeInBits()), VT);
3233 SDVTList VTs = getVTList(VT);
3234 if (VT != MVT::Glue) {
3255 SDValue SelectionDAG::getNode(unsigned Opcode, DebugLoc DL, EVT VT,
3270 return getNode(ISD::BUILD_VECTOR, DL, VT, &Elts[0], Elts.size());
3275 SDValue Simp = FoldSetCC(VT, N1, N2, cast<CondCodeSDNode>(N3)->get(), DL);
3292 if (VT.isSimple() && N1.getValueType().isSimple()
3294 assert(VT.isVector() && N1.getValueType().isVector() &&
3297 assert(VT == N1.getValueType() &&
3304 <= VT.getVectorNumElements())
3309 if (VT.getSimpleVT() == N2.getValueType().getSimpleVT())
3316 if (N1.getValueType() == VT)
3323 SDVTList VTs = getVTList(VT);
3324 if (VT != MVT::Glue) {
3345 SDValue SelectionDAG::getNode(unsigned Opcode, DebugLoc DL, EVT VT,
3349 return getNode(Opcode, DL, VT, Ops, 4);
3352 SDValue SelectionDAG::getNode(unsigned Opcode, DebugLoc DL, EVT VT,
3356 return getNode(Opcode, DL, VT, Ops, 5);
3384 static SDValue getMemsetValue(SDValue Value, EVT VT, SelectionDAG &DAG,
3388 unsigned NumBits = VT.getScalarType().getSizeInBits();
3392 if (VT.isInteger())
3393 return DAG.getConstant(Val, VT);
3394 return DAG.getConstantFP(APFloat(DAG.EVTToAPFloatSemantics(VT), Val), VT);
3397 Value = DAG.getNode(ISD::ZERO_EXTEND, dl, VT, Value);
3402 Value = DAG.getNode(ISD::MUL, dl, VT, Value, DAG.getConstant(Magic, VT));
3411 static SDValue getMemsetStringVal(EVT VT, DebugLoc dl, SelectionDAG &DAG,
3415 if (VT.isInteger())
3416 return DAG.getConstant(0, VT);
3417 else if (VT == MVT::f32 || VT == MVT::f64)
3418 return DAG.getConstantFP(0.0, VT);
3419 else if (VT.isVector()) {
3420 unsigned NumElts = VT.getVectorNumElements();
3421 MVT EltVT = (VT.getVectorElementType() == MVT::f32) ? MVT::i32 : MVT::i64;
3422 return DAG.getNode(ISD::BITCAST, dl, VT,
3429 assert(!VT.isVector() && "Can't handle vector type here!");
3430 unsigned NumVTBits = VT.getSizeInBits();
3446 if (TTI->getIntImmCost(Val, VT.getTypeForEVT(*DAG.getContext())) < 2)
3447 return DAG.getConstant(Val, VT);
3455 EVT VT = Base.getValueType();
3457 VT, Base, DAG.getConstant(Offset, VT));
3501 EVT VT = TLI.getOptimalMemOpType(Size, DstAlign, SrcAlign,
3505 if (VT == MVT::Other) {
3507 TLI.allowsUnalignedMemoryAccesses(VT)) {
3508 VT = TLI.getPointerTy();
3511 case 0: VT = MVT::i64; break;
3512 case 4: VT = MVT::i32; break;
3513 case 2: VT = MVT::i16; break;
3514 default: VT = MVT::i8; break;
3523 if (VT.bitsGT(LVT))
3524 VT = LVT;
3529 unsigned VTSize = VT.getSizeInBits() / 8;
3532 EVT NewVT = VT;
3536 if (VT.isVector() || VT.isFloatingPoint()) {
3537 NewVT = (VT.getSizeInBits() > 64) ? MVT::i64 : MVT::i32;
3559 // If the new VT cannot cover all of the remaining bits, then consider
3566 TLI.allowsUnalignedMemoryAccesses(VT, &Fast) && Fast)
3569 VT = NewVT;
3577 MemOps.push_back(VT);
3648 EVT VT = MemOps[i];
3649 unsigned VTSize = VT.getSizeInBits() / 8;
3661 (isZeroStr || (VT.isInteger() && !VT.isVector()))) {
3667 Value = getMemsetStringVal(VT, dl, DAG, TLI, Str.substr(SrcOff));
3679 // to Load/Store if NVT==VT.
3681 EVT NVT = TLI.getTypeToTransformTo(*DAG.getContext(), VT);
3682 assert(NVT.bitsGE(VT));
3685 SrcPtrInfo.getWithOffset(SrcOff), VT, isVol, false,
3689 DstPtrInfo.getWithOffset(DstOff), VT, isVol,
3752 EVT VT = MemOps[i];
3753 unsigned VTSize = VT.getSizeInBits() / 8;
3756 Value = DAG.getLoad(VT, dl, Chain,
3768 EVT VT = MemOps[i];
3769 unsigned VTSize = VT.getSizeInBits() / 8;
3834 EVT VT = MemOps[i];
3835 unsigned VTSize = VT.getSizeInBits() / 8;
3846 if (VT.bitsLT(LargestVT)) {
3847 if (!LargestVT.isVector() && !VT.isVector() &&
3848 TLI.isTruncateFree(LargestVT, VT))
3849 Value = DAG.getNode(ISD::TRUNCATE, dl, VT, MemSetValue);
3851 Value = getMemsetValue(Src, VT, DAG, dl);
3853 assert(Value.getValueType() == VT && "Value with wrong type.");
3859 DstOff += VT.getSizeInBits() / 8;
4092 EVT VT = Cmp.getValueType();
4094 SDVTList VTs = getVTList(VT, MVT::Other);
4164 EVT VT = Val.getValueType();
4167 getVTList(VT, MVT::Other);
4187 EVT VT, SDValue Chain,
4213 return getAtomic(Opcode, dl, MemVT, VT, Chain, Ptr, MMO,
4218 EVT VT, SDValue Chain,
4225 SDVTList VTs = getVTList(VT, MVT::Other);
4364 EVT VT, DebugLoc dl, SDValue Chain,
4373 Alignment = getEVTAlignment(VT);
4392 return getLoad(AM, ExtType, VT, dl, Chain, Ptr, Offset, MemVT, MMO);
4397 EVT VT, DebugLoc dl, SDValue Chain,
4400 if (VT == MemVT) {
4403 assert(VT == MemVT && "Non-extending load from different memory type!");
4406 assert(MemVT.getScalarType().bitsLT(VT.getScalarType()) &&
4408 assert(VT.isInteger() == MemVT.isInteger() &&
4410 assert(VT.isVector() == MemVT.isVector() &&
4412 assert((!VT.isVector() ||
4413 VT.getVectorNumElements() == MemVT.getVectorNumElements()) &&
4422 getVTList(VT, Ptr.getValueType(), MVT::Other) : getVTList(VT, MVT::Other);
4443 SDValue SelectionDAG::getLoad(EVT VT, DebugLoc dl,
4451 return getLoad(ISD::UNINDEXED, ISD::NON_EXTLOAD, VT, dl, Chain, Ptr, Undef,
4452 PtrInfo, VT, isVolatile, isNonTemporal, isInvariant, Alignment,
4456 SDValue SelectionDAG::getExtLoad(ISD::LoadExtType ExtType, DebugLoc dl, EVT VT,
4462 return getLoad(ISD::UNINDEXED, ExtType, VT, dl, Chain, Ptr, Undef,
4511 EVT VT = Val.getValueType();
4517 ID.AddInteger(VT.getRawBits());
4527 false, VT, MMO);
4563 EVT VT = Val.getValueType();
4567 if (VT == SVT)
4570 assert(SVT.getScalarType().bitsLT(VT.getScalarType()) &&
4572 assert(VT.isInteger() == SVT.isInteger() &&
4574 assert(VT.isVector() == SVT.isVector() &&
4576 assert((!VT.isVector() ||
4577 VT.getVectorNumElements() == SVT.getVectorNumElements()) &&
4627 SDValue SelectionDAG::getVAArg(EVT VT, DebugLoc dl,
4632 return getNode(ISD::VAARG, dl, getVTList(VT, MVT::Other), Ops, 4);
4635 SDValue SelectionDAG::getNode(unsigned Opcode, DebugLoc DL, EVT VT,
4638 case 0: return getNode(Opcode, DL, VT);
4639 case 1: return getNode(Opcode, DL, VT, Ops[0]);
4640 case 2: return getNode(Opcode, DL, VT, Ops[0], Ops[1]);
4641 case 3: return getNode(Opcode, DL, VT, Ops[0], Ops[1], Ops[2]);
4648 return getNode(Opcode, DL, VT, &NewOps[0], NumOps);
4651 SDValue SelectionDAG::getNode(unsigned Opcode, DebugLoc DL, EVT VT,
4654 case 0: return getNode(Opcode, DL, VT);
4655 case 1: return getNode(Opcode, DL, VT, Ops[0]);
4656 case 2: return getNode(Opcode, DL, VT, Ops[0], Ops[1]);
4657 case 3: return getNode(Opcode, DL, VT, Ops[0], Ops[1], Ops[2]);
4669 assert(Ops[2].getValueType() == VT &&
4683 SDVTList VTs = getVTList(VT);
4685 if (VT != MVT::Glue) {
4736 return getNode(Opcode, DL, VT, N1, N2, N3.getOperand(0));
4741 unsigned NumBits = VT.getScalarType().getSizeInBits()*2;
4743 return getNode(Opcode, DL, VT, N1, N2, N3.getOperand(0));
4824 SDVTList SelectionDAG::getVTList(EVT VT) {
4825 return makeVTList(SDNode::getValueTypeList(VT), 1);
5032 EVT VT) {
5033 SDVTList VTs = getVTList(VT);
5038 EVT VT, SDValue Op1) {
5039 SDVTList VTs = getVTList(VT);
5045 EVT VT, SDValue Op1,
5047 SDVTList VTs = getVTList(VT);
5053 EVT VT, SDValue Op1,
5055 SDVTList VTs = getVTList(VT);
5061 EVT VT, const SDValue *Ops,
5063 SDVTList VTs = getVTList(VT);
5249 SelectionDAG::getMachineNode(unsigned Opcode, DebugLoc dl, EVT VT) {
5250 SDVTList VTs = getVTList(VT);
5255 SelectionDAG::getMachineNode(unsigned Opcode, DebugLoc dl, EVT VT, SDValue Op1) {
5256 SDVTList VTs = getVTList(VT);
5262 SelectionDAG::getMachineNode(unsigned Opcode, DebugLoc dl, EVT VT,
5264 SDVTList VTs = getVTList(VT);
5270 SelectionDAG::getMachineNode(unsigned Opcode, DebugLoc dl, EVT VT,
5272 SDVTList VTs = getVTList(VT);
5278 SelectionDAG::getMachineNode(unsigned Opcode, DebugLoc dl, EVT VT,
5280 SDVTList VTs = getVTList(VT);
5408 SelectionDAG::getTargetExtractSubreg(int SRIdx, DebugLoc DL, EVT VT,
5412 VT, Operand, SRIdxVal);
5419 SelectionDAG::getTargetInsertSubreg(int SRIdx, DebugLoc DL, EVT VT,
5423 VT, Operand, Subreg, SRIdxVal);
5895 EVT VT, int64_t o, unsigned char TF)
5896 : SDNode(Opc, DL, getSDVTList(VT)), Offset(o), TargetFlags(TF) {
5946 const EVT *SDNode::getValueTypeList(EVT VT) {
5947 if (VT.isExtended()) {
5949 return &(*EVTs->insert(VT).first);
5951 assert(VT.getSimpleVT() < MVT::LAST_VALUETYPE &&
5953 return &SimpleVTArray->VTs[VT.getSimpleVT().SimpleTy];
6097 EVT VT = N->getValueType(0);
6098 unsigned NE = VT.getVectorNumElements();
6099 EVT EltVT = VT.getVectorElementType();
6173 EVT VT = LD->getValueType(0);
6174 if (VT.getSizeInBits() / 8 != Bytes)
6266 EVT VT = getValueType(0);
6267 assert(VT.isVector() && "Expected a vector type");
6268 unsigned sz = VT.getSizeInBits();
6281 unsigned EltBitSize = VT.getVectorElementType().getSizeInBits();
6326 bool ShuffleVectorSDNode::isSplatMask(const int *Mask, EVT VT) {
6329 for (i = 0, e = VT.getVectorNumElements(); i != e && Mask[i] < 0; ++i)