Home | History | Annotate | Download | only in SelectionDAG

Lines Matching refs:VT

77 bool ConstantFPSDNode::isValueValidForType(EVT VT,
79 assert(VT.isFloatingPoint() && "Can only convert between FP types");
84 (void) Val2.convert(SelectionDAG::EVTToAPFloatSemantics(VT),
730 EVT VT = cast<VTSDNode>(N)->getVT();
731 if (VT.isExtended()) {
732 Erased = ExtendedValueTypeNodes.erase(VT);
734 Erased = ValueTypeNodes[VT.getSimpleVT().SimpleTy] != nullptr;
735 ValueTypeNodes[VT.getSimpleVT().SimpleTy] = nullptr;
849 EVT VT = N->getValueType(0);
851 assert(!VT.isVector() && (VT.isInteger() || VT.isFloatingPoint()) &&
856 assert(N->getOperand(0).getValueType().isInteger() == VT.isInteger() &&
858 assert(VT.getSizeInBits() == 2 * N->getOperand(0).getValueSizeInBits() &&
922 unsigned SelectionDAG::getEVTAlignment(EVT VT) const {
923 Type *Ty = VT == MVT::iPTR ?
925 VT.getTypeForEVT(*getContext());
997 SDValue SelectionDAG::getAnyExtOrTrunc(SDValue Op, SDLoc DL, EVT VT) {
998 return VT.bitsGT(Op.getValueType()) ?
999 getNode(ISD::ANY_EXTEND, DL, VT, Op) :
1000 getNode(ISD::TRUNCATE, DL, VT, Op);
1003 SDValue SelectionDAG::getSExtOrTrunc(SDValue Op, SDLoc DL, EVT VT) {
1004 return VT.bitsGT(Op.getValueType()) ?
1005 getNode(ISD::SIGN_EXTEND, DL, VT, Op) :
1006 getNode(ISD::TRUNCATE, DL, VT, Op);
1009 SDValue SelectionDAG::getZExtOrTrunc(SDValue Op, SDLoc DL, EVT VT) {
1010 return VT.bitsGT(Op.getValueType()) ?
1011 getNode(ISD::ZERO_EXTEND, DL, VT, Op) :
1012 getNode(ISD::TRUNCATE, DL, VT, Op);
1015 SDValue SelectionDAG::getBoolExtOrTrunc(SDValue Op, SDLoc SL, EVT VT,
1017 if (VT.bitsLE(Op.getValueType()))
1018 return getNode(ISD::TRUNCATE, SL, VT, Op);
1021 return getNode(TLI->getExtendForContent(BType), SL, VT, Op);
1024 SDValue SelectionDAG::getZeroExtendInReg(SDValue Op, SDLoc DL, EVT VT) {
1025 assert(!VT.isVector() &&
1028 if (Op.getValueType() == VT) return Op;
1031 VT.getSizeInBits());
1036 SDValue SelectionDAG::getAnyExtendVectorInReg(SDValue Op, SDLoc DL, EVT VT) {
1037 assert(VT.isVector() && "This DAG node is restricted to vector types.");
1038 assert(VT.getSizeInBits() == Op.getValueType().getSizeInBits() &&
1041 assert(VT.getVectorNumElements() < Op.getValueType().getVectorNumElements() &&
1043 return getNode(ISD::ANY_EXTEND_VECTOR_INREG, DL, VT, Op);
1046 SDValue SelectionDAG::getSignExtendVectorInReg(SDValue Op, SDLoc DL, EVT VT) {
1047 assert(VT.isVector() && "This DAG node is restricted to vector types.");
1048 assert(VT.getSizeInBits() == Op.getValueType().getSizeInBits() &&
1051 assert(VT.getVectorNumElements() < Op.getValueType().getVectorNumElements() &&
1053 return getNode(ISD::SIGN_EXTEND_VECTOR_INREG, DL, VT, Op);
1056 SDValue SelectionDAG::getZeroExtendVectorInReg(SDValue Op, SDLoc DL, EVT VT) {
1057 assert(VT.isVector() && "This DAG node is restricted to vector types.");
1058 assert(VT.getSizeInBits() == Op.getValueType().getSizeInBits() &&
1061 assert(VT.getVectorNumElements() < Op.getValueType().getVectorNumElements() &&
1063 return getNode(ISD::ZERO_EXTEND_VECTOR_INREG, DL, VT, Op);
1068 SDValue SelectionDAG::getNOT(SDLoc DL, SDValue Val, EVT VT) {
1069 EVT EltVT = VT.getScalarType();
1071 getConstant(APInt::getAllOnesValue(EltVT.getSizeInBits()), VT);
1072 return getNode(ISD::XOR, DL, VT, Val, NegOne);
1075 SDValue SelectionDAG::getLogicalNOT(SDLoc DL, SDValue Val, EVT VT) {
1076 EVT EltVT = VT.getScalarType();
1078 switch (TLI->getBooleanContents(VT)) {
1081 TrueValue = getConstant(1, VT);
1085 VT);
1088 return getNode(ISD::XOR, DL, VT, Val, TrueValue);
1091 SDValue SelectionDAG::getConstant(uint64_t Val, EVT VT, bool isT, bool isO) {
1092 EVT EltVT = VT.getScalarType();
1096 return getConstant(APInt(EltVT.getSizeInBits(), Val), VT, isT, isO);
1099 SDValue SelectionDAG::getConstant(const APInt &Val, EVT VT, bool isT, bool isO)
1101 return getConstant(*ConstantInt::get(*Context, Val), VT, isT, isO);
1104 SDValue SelectionDAG::getConstant(const ConstantInt &Val, EVT VT, bool isT,
1106 assert(VT.isInteger() && "Cannot create FP integer constant!");
1108 EVT EltVT = VT.getScalarType();
1117 if (VT.isVector() && TLI->getTypeAction(*getContext(), EltVT) ==
1129 else if (NewNodesMustHaveLegalTypes && VT.isVector() &&
1135 unsigned ViaVecNumElts = VT.getSizeInBits() / ViaEltSizeInBits;
1141 assert(ViaVecVT.getSizeInBits() == VT.getSizeInBits());
1144 for (unsigned i = 0; i < ViaVecNumElts / VT.getVectorNumElements(); ++i) {
1163 for (unsigned i = 0; i < VT.getVectorNumElements(); ++i)
1166 SDValue Result = getNode(ISD::BITCAST, SDLoc(), VT,
1182 if (!VT.isVector())
1192 if (VT.isVector()) {
1194 Ops.assign(VT.getVectorNumElements(), Result);
1195 Result = getNode(ISD::BUILD_VECTOR, SDLoc(), VT, Ops);
1205 SDValue SelectionDAG::getConstantFP(const APFloat& V, EVT VT, bool isTarget) {
1206 return getConstantFP(*ConstantFP::get(*getContext(), V), VT, isTarget);
1209 SDValue SelectionDAG::getConstantFP(const ConstantFP& V, EVT VT, bool isTarget){
1210 assert(VT.isFloatingPoint() && "Cannot create integer FP constant!");
1212 EVT EltVT = VT.getScalarType();
1224 if (!VT.isVector())
1234 if (VT.isVector()) {
1236 Ops.assign(VT.getVectorNumElements(), Result);
1238 Result = getNode(ISD::BUILD_VECTOR, SDLoc(), VT, Ops);
1243 SDValue SelectionDAG::getConstantFP(double Val, EVT VT, bool isTarget) {
1244 EVT EltVT = VT.getScalarType();
1246 return getConstantFP(APFloat((float)Val), VT, isTarget);
1248 return getConstantFP(APFloat(Val), VT, isTarget);
1255 return getConstantFP(apf, VT, isTarget);
1261 EVT VT, int64_t Offset,
1280 AddNodeIDNode(ID, Opc, getVTList(VT), None);
1290 DL.getDebugLoc(), GV, VT,
1297 SDValue SelectionDAG::getFrameIndex(int FI, EVT VT, bool isTarget) {
1300 AddNodeIDNode(ID, Opc, getVTList(VT), None);
1306 SDNode *N = new (NodeAllocator) FrameIndexSDNode(FI, VT, isTarget);
1312 SDValue SelectionDAG::getJumpTable(int JTI, EVT VT, bool isTarget,
1318 AddNodeIDNode(ID, Opc, getVTList(VT), None);
1325 SDNode *N = new (NodeAllocator) JumpTableSDNode(JTI, VT, isTarget,
1332 SDValue SelectionDAG::getConstantPool(const Constant *C, EVT VT,
1343 AddNodeIDNode(ID, Opc, getVTList(VT), None);
1352 SDNode *N = new (NodeAllocator) ConstantPoolSDNode(isTarget, C, VT, Offset,
1360 SDValue SelectionDAG::getConstantPool(MachineConstantPoolValue *C, EVT VT,
1371 AddNodeIDNode(ID, Opc, getVTList(VT), None);
1380 SDNode *N = new (NodeAllocator) ConstantPoolSDNode(isTarget, C, VT, Offset,
1387 SDValue SelectionDAG::getTargetIndex(int Index, EVT VT, int64_t Offset,
1390 AddNodeIDNode(ID, ISD::TargetIndex, getVTList(VT), None);
1398 SDNode *N = new (NodeAllocator) TargetIndexSDNode(Index, VT, Offset,
1419 SDValue SelectionDAG::getValueType(EVT VT) {
1420 if (VT.isSimple() && (unsigned)VT.getSimpleVT().SimpleTy >=
1422 ValueTypeNodes.resize(VT.getSimpleVT().SimpleTy+1);
1424 SDNode *&N = VT.isExtended() ?
1425 ExtendedValueTypeNodes[VT] : ValueTypeNodes[VT.getSimpleVT().SimpleTy];
1428 N = new (NodeAllocator) VTSDNode(VT);
1433 SDValue SelectionDAG::getExternalSymbol(const char *Sym, EVT VT) {
1436 N = new (NodeAllocator) ExternalSymbolSDNode(false, Sym, 0, VT);
1441 SDValue SelectionDAG::getTargetExternalSymbol(const char *Sym, EVT VT,
1447 N = new (NodeAllocator) ExternalSymbolSDNode(true, Sym, TargetFlags, VT);
1479 SDValue SelectionDAG::getVectorShuffle(EVT VT, SDLoc dl, SDValue N1,
1481 assert(VT == N1.getValueType() && VT == N2.getValueType() &&
1486 return getUNDEF(VT);
1490 unsigned NElts = VT.getVectorNumElements();
1499 N2 = getUNDEF(VT);
1523 return getUNDEF(VT);
1525 N2 = getUNDEF(VT);
1527 N1 = getUNDEF(VT);
1534 return getUNDEF(VT);
1559 return getUNDEF(VT);
1567 VT.getVectorNumElements())
1578 AddNodeIDNode(ID, ISD::VECTOR_SHUFFLE, getVTList(VT), Ops);
1593 new (NodeAllocator) ShuffleVectorSDNode(VT, dl.getIROrder(),
1601 SDValue SelectionDAG::getConvertRndSat(EVT VT, SDLoc dl,
1613 AddNodeIDNode(ID, ISD::CONVERT_RNDSAT, getVTList(VT), Ops);
1618 CvtRndSatSDNode *N = new (NodeAllocator) CvtRndSatSDNode(VT, dl.getIROrder(),
1626 SDValue SelectionDAG::getRegister(unsigned RegNo, EVT VT) {
1628 AddNodeIDNode(ID, ISD::Register, getVTList(VT), None);
1634 SDNode *N = new (NodeAllocator) RegisterSDNode(RegNo, VT);
1671 SDValue SelectionDAG::getBlockAddress(const BlockAddress *BA, EVT VT,
1678 AddNodeIDNode(ID, Opc, getVTList(VT), None);
1686 SDNode *N = new (NodeAllocator) BlockAddressSDNode(Opc, VT, BA, Offset,
1728 SDValue SelectionDAG::getAddrSpaceCast(SDLoc dl, EVT VT, SDValue Ptr,
1732 AddNodeIDNode(ID, ISD::ADDRSPACECAST, getVTList(VT), Ops);
1742 VT, Ptr, SrcAS, DestAS);
1761 SDValue SelectionDAG::CreateStackTemporary(EVT VT, unsigned minAlign) {
1763 unsigned ByteSize = VT.getStoreSize();
1764 Type *Ty = VT.getTypeForEVT(*getContext());
1790 SDValue SelectionDAG::FoldSetCC(EVT VT, SDValue N1,
1796 VT);
1803 Cnt == TargetLowering::ZeroOrNegativeOneBooleanContent ? -1ULL : 1, VT);
1827 case ISD::SETEQ: return getConstant(C1 == C2, VT);
1828 case ISD::SETNE: return getConstant(C1 != C2, VT);
1829 case ISD::SETULT: return getConstant(C1.ult(C2), VT);
1830 case ISD::SETUGT: return getConstant(C1.ugt(C2), VT);
1831 case ISD::SETULE: return getConstant(C1.ule(C2), VT);
1832 case ISD::SETUGE: return getConstant(C1.uge(C2), VT);
1833 case ISD::SETLT: return getConstant(C1.slt(C2), VT);
1834 case ISD::SETGT: return getConstant(C1.sgt(C2), VT);
1835 case ISD::SETLE: return getConstant(C1.sle(C2), VT);
1836 case ISD::SETGE: return getConstant(C1.sge(C2), VT);
1846 return getUNDEF(VT);
1848 case ISD::SETOEQ: return getConstant(R==APFloat::cmpEqual, VT);
1850 return getUNDEF(VT);
1853 R==APFloat::cmpLessThan, VT);
1855 return getUNDEF(VT);
1857 case ISD::SETOLT: return getConstant(R==APFloat::cmpLessThan, VT);
1859 return getUNDEF(VT);
1861 case ISD::SETOGT: return getConstant(R==APFloat::cmpGreaterThan, VT);
1863 return getUNDEF(VT);
1866 R==APFloat::cmpEqual, VT);
1868 return getUNDEF(VT);
1871 R==APFloat::cmpEqual, VT);
1872 case ISD::SETO: return getConstant(R!=APFloat::cmpUnordered, VT);
1873 case ISD::SETUO: return getConstant(R==APFloat::cmpUnordered, VT);
1875 R==APFloat::cmpEqual, VT);
1876 case ISD::SETUNE: return getConstant(R!=APFloat::cmpEqual, VT);
1878 R==APFloat::cmpLessThan, VT);
1880 R==APFloat::cmpUnordered, VT);
1881 case ISD::SETULE: return getConstant(R!=APFloat::cmpGreaterThan, VT);
1882 case ISD::SETUGE: return getConstant(R!=APFloat::cmpLessThan, VT);
1891 return getSetCC(dl, VT, N2, N1, SwappedCond);
2157 EVT VT = LD->getMemoryVT();
2158 unsigned MemBits = VT.getScalarType().getSizeInBits();
2221 EVT VT = cast<VTSDNode>(Op.getOperand(1))->getVT();
2222 APInt InMask = APInt::getLowBitsSet(BitWidth, VT.getSizeInBits());
2361 EVT VT = Op.getValueType();
2362 assert(VT.isInteger() && "Invalid VT!");
2363 unsigned VTBits = VT.getScalarType().getSizeInBits();
2647 SDValue SelectionDAG::getNode(unsigned Opcode, SDLoc DL, EVT VT) {
2649 AddNodeIDNode(ID, Opcode, getVTList(VT), None);
2655 DL.getDebugLoc(), getVTList(VT));
2666 EVT VT, SDValue Operand) {
2677 return getConstant(Val.sextOrTrunc(VT.getSizeInBits()), VT,
2682 return getConstant(Val.zextOrTrunc(VT.getSizeInBits()), VT,
2686 APFloat apf(EVTToAPFloatSemantics(VT),
2687 APInt::getNullValue(VT.getSizeInBits()));
2691 return getConstantFP(apf, VT);
2694 if (VT == MVT::f32 && C->getValueType(0) == MVT::i32)
2695 return getConstantFP(APFloat(APFloat::IEEEsingle, Val), VT);
2696 else if (VT == MVT::f64 && C->getValueType(0) == MVT::i64)
2697 return getConstantFP(APFloat(APFloat::IEEEdouble, Val), VT);
2700 return getConstant(Val.byteSwap(), VT, C->isTargetOpcode(),
2703 return getConstant(Val.countPopulation(), VT, C->isTargetOpcode(),
2707 return getConstant(Val.countLeadingZeros(), VT, C->isTargetOpcode(),
2711 return getConstant(Val.countTrailingZeros(), VT, C->isTargetOpcode(),
2722 return getConstantFP(V, VT);
2725 return getConstantFP(V, VT);
2729 return getConstantFP(V, VT);
2735 return getConstantFP(V, VT);
2741 return getConstantFP(V, VT);
2748 (void)V.convert(EVTToAPFloatSemantics(VT),
2750 return getConstantFP(V, VT);
2758 APFloat::opStatus s = V.convertToInteger(x, VT.getSizeInBits(),
2763 APInt api(VT.getSizeInBits(), x);
2764 return getConstant(api, VT);
2767 if (VT == MVT::i32 && C->getValueType(0) == MVT::f32)
2768 return getConstant((uint32_t)V.bitcastToAPInt().getZExtValue(), VT);
2769 else if (VT == MVT::i64 && C->getValueType(0) == MVT::f64)
2770 return getConstant(V.bitcastToAPInt().getZExtValue(), VT);
2783 assert(VT.isFloatingPoint() &&
2785 if (Operand.getValueType() == VT) return Operand; // noop conversion.
2786 assert((!VT.isVector() ||
2787 VT.getVectorNumElements() ==
2791 return getUNDEF(VT);
2794 assert(VT.isInteger() && Operand.getValueType().isInteger() &&
2796 if (Operand.getValueType() == VT) return Operand; // noop extension
2797 assert(Operand.getValueType().getScalarType().bitsLT(VT.getScalarType()) &&
2799 assert((!VT.isVector() ||
2800 VT.getVectorNumElements() ==
2804 return getNode(OpOpcode, DL, VT, Operand.getNode()->getOperand(0));
2807 return getConstant(0, VT);
2810 assert(VT.isInteger() && Operand.getValueType().isInteger() &&
2812 if (Operand.getValueType() == VT) return Operand; // noop extension
2813 assert(Operand.getValueType().getScalarType().bitsLT(VT.getScalarType()) &&
2815 assert((!VT.isVector() ||
2816 VT.getVectorNumElements() ==
2820 return getNode(ISD::ZERO_EXTEND, DL, VT,
2824 return getConstant(0, VT);
2827 assert(VT.isInteger() && Operand.getValueType().isInteger() &&
2829 if (Operand.getValueType() == VT) return Operand; // noop extension
2830 assert(Operand.getValueType().getScalarType().bitsLT(VT.getScalarType()) &&
2832 assert((!VT.isVector() ||
2833 VT.getVectorNumElements() ==
2840 return getNode(OpOpcode, DL, VT, Operand.getNode()->getOperand(0));
2842 return getUNDEF(VT);
2847 if (OpOp.getValueType() == VT)
2852 assert(VT.isInteger() && Operand.getValueType().isInteger() &&
2854 if (Operand.getValueType() == VT) return Operand; // noop truncate
2855 assert(Operand.getValueType().getScalarType().bitsGT(VT.getScalarType()) &&
2857 assert((!VT.isVector() ||
2858 VT.getVectorNumElements() ==
2862 return getNode(ISD::TRUNCATE, DL, VT, Operand.getNode()->getOperand(0));
2867 .bitsLT(VT.getScalarType()))
2868 return getNode(OpOpcode, DL, VT, Operand.getNode()->getOperand(0));
2869 if (Operand.getNode()->getOperand(0).getValueType().bitsGT(VT))
2870 return getNode(ISD::TRUNCATE, DL, VT, Operand.getNode()->getOperand(0));
2874 return getUNDEF(VT);
2878 assert(VT.getSizeInBits() == Operand.getValueType().getSizeInBits()
2880 if (VT == Operand.getValueType()) return Operand; // noop conversion.
2882 return getNode(ISD::BITCAST, DL, VT, Operand.getOperand(0));
2884 return getUNDEF(VT);
2887 assert(VT.isVector() && !Operand.getValueType().isVector() &&
2888 (VT.getVectorElementType() == Operand.getValueType() ||
2889 (VT.getVectorElementType().isInteger() &&
2891 VT.getVectorElementType().bitsLE(Operand.getValueType()))) &&
2894 return getUNDEF(VT);
2899 Operand.getOperand(0).getValueType() == VT)
2905 return getNode(ISD::FSUB, DL, VT, Operand.getNode()->getOperand(1),
2912 return getNode(ISD::FABS, DL, VT, Operand.getNode()->getOperand(0));
2917 SDVTList VTs = getVTList(VT);
2918 if (VT != MVT::Glue) { // Don't CSE flag producing nodes
2941 SDValue SelectionDAG::FoldConstantArithmetic(unsigned Opcode, EVT VT,
2951 EVT SVT = VT.getScalarType();
3053 assert((Scalar1 && Scalar2) || (VT.getVectorNumElements() == Outputs.size() &&
3057 if (!VT.isVector())
3061 Outputs.resize(VT.getVectorNumElements(), Outputs.back());
3064 return getNode(ISD::BUILD_VECTOR, SDLoc(), VT, Outputs);
3067 SDValue SelectionDAG::getNode(unsigned Opcode, SDLoc DL, EVT VT, SDValue N1,
3074 assert(VT == MVT::Other && N1.getValueType() == MVT::Other &&
3085 return getUNDEF(VT);
3094 return getNode(ISD::BUILD_VECTOR, DL, VT, Elts);
3098 assert(VT.isInteger() && "This operator does not apply to FP types!");
3100 N1.getValueType() == VT && "Binary operator types must match!");
3112 assert(VT.isInteger() && "This operator does not apply to FP types!");
3114 N1.getValueType() == VT && "Binary operator types must match!");
3127 assert(VT.isInteger() && "This operator does not apply to FP types!");
3129 N1.getValueType() == VT && "Binary operator types must match!");
3171 assert(VT.isFloatingPoint() && "This operator only applies to FP types!");
3173 N1.getValueType() == VT && "Binary operator types must match!");
3176 assert(N1.getValueType() == VT &&
3186 assert(VT == N1.getValueType() &&
3188 assert(VT.isInteger() && N2.getValueType().isInteger() &&
3190 assert((!VT.isVector() || VT == N2.getValueType()) &&
3192 // Verify that the shift amount VT is bit enough to hold valid shift
3203 if (VT == MVT::i1)
3210 assert(VT == N1.getValueType() && "Not an inreg round!");
3211 assert(VT.isFloatingPoint() && EVT.isFloatingPoint() &&
3213 assert(EVT.isVector() == VT.isVector() &&
3217 EVT.getVectorNumElements() == VT.getVectorNumElements()) &&
3219 assert(EVT.bitsLE(VT) && "Not rounding down!");
3221 if (cast<VTSDNode>(N2)->getVT() == VT) return N1; // Not actually rounding.
3225 assert(VT.isFloatingPoint() &&
3227 VT.bitsLE(N1.getValueType()) &&
3229 if (N1.getValueType() == VT) return N1; // noop conversion.
3234 assert(VT == N1.getValueType() && "Not an inreg extend!");
3235 assert(VT.isInteger() && EVT.isInteger() &&
3240 assert(EVT.bitsLE(VT) && "Not extending!");
3241 if (VT == EVT) return N1; // noop assertion.
3246 assert(VT == N1.getValueType() && "Not an inreg extend!");
3247 assert(VT.isInteger() && EVT.isInteger() &&
3249 assert(EVT.isVector() == VT.isVector() &&
3253 EVT.getVectorNumElements() == VT.getVectorNumElements()) &&
3255 assert(EVT.bitsLE(VT) && "Not extending!");
3256 if (EVT == VT) return N1; // Not actually extending
3263 return getConstant(Val, VT);
3270 return getUNDEF(VT);
3279 return getNode(ISD::EXTRACT_VECTOR_ELT, DL, VT,
3290 if (VT != Elt.getValueType())
3294 Elt = getAnyExtOrTrunc(Elt, DL, VT);
3310 if (VT == N1.getOperand(1).getValueType())
3313 return getSExtOrTrunc(N1.getOperand(1), DL, VT);
3316 return getNode(ISD::EXTRACT_VECTOR_ELT, DL, VT, N1.getOperand(0), N2);
3322 assert(!N1.getValueType().isVector() && !VT.isVector() &&
3323 (N1.getValueType().isInteger() == VT.isInteger()) &&
3324 N1.getValueType() != VT &&
3335 unsigned ElementSize = VT.getSizeInBits();
3338 return getConstant(ShiftedVal.trunc(ElementSize), VT);
3343 if (VT.isSimple() && N1.getValueType().isSimple()) {
3344 assert(VT.isVector() && N1.getValueType().isVector() &&
3346 assert(VT.getVectorElementType() ==
3349 assert(VT.getSimpleVT() <= N1.getSimpleValueType() &&
3353 assert((VT.getVectorNumElements() +
3360 if (VT.getSimpleVT() == N1.getSimpleValueType())
3368 SDValue SV = FoldConstantArithmetic(Opcode, VT, N1.getNode(), N2.getNode());
3392 return getConstantFP(V1, VT);
3397 return getConstantFP(V1, VT);
3402 return getConstantFP(V1, VT);
3407 return getConstantFP(V1, VT);
3412 return getConstantFP(V1, VT);
3416 return getConstantFP(V1, VT);
3426 (void)V.convert(EVTToAPFloatSemantics(VT),
3428 return getConstantFP(V, VT);
3452 if (!VT.isVector())
3453 return getConstant(0, VT); // fold op(undef, arg2) -> 0
3468 return getConstant(0, VT);
3491 if (!VT.isVector())
3492 return getConstant(0, VT); // fold op(arg1, undef) -> 0
3497 if (!VT.isVector())
3498 return getConstant(APInt::getAllOnesValue(VT.getSizeInBits()), VT);
3509 SDVTList VTs = getVTList(VT);
3511 if (VT != MVT::Glue) {
3536 SDValue SelectionDAG::getNode(unsigned Opcode, SDLoc DL, EVT VT,
3552 return getConstantFP(V1, VT);
3566 return getNode(ISD::BUILD_VECTOR, DL, VT, Elts);
3571 SDValue Simp = FoldSetCC(VT, N1, N2, cast<CondCodeSDNode>(N3)->get(), DL);
3588 if (VT.isSimple() && N1.getValueType().isSimple()
3590 assert(VT.isVector() && N1.getValueType().isVector() &&
3593 assert(VT == N1.getValueType() &&
3600 <= VT.getVectorNumElements())
3605 if (VT.getSimpleVT() == N2.getSimpleValueType())
3612 if (N1.getValueType() == VT)
3619 SDVTList VTs = getVTList(VT);
3620 if (VT != MVT::Glue) {
3643 SDValue SelectionDAG::getNode(unsigned Opcode, SDLoc DL, EVT VT,
3647 return getNode(Opcode, DL, VT, Ops);
3650 SDValue SelectionDAG::getNode(unsigned Opcode, SDLoc DL, EVT VT,
3654 return getNode(Opcode, DL, VT, Ops);
3681 static SDValue getMemsetValue(SDValue Value, EVT VT, SelectionDAG &DAG,
3685 unsigned NumBits = VT.getScalarType().getSizeInBits();
3689 if (VT.isInteger())
3690 return DAG.getConstant(Val, VT);
3691 return DAG.getConstantFP(APFloat(DAG.EVTToAPFloatSemantics(VT), Val), VT);
3694 Value = DAG.getNode(ISD::ZERO_EXTEND, dl, VT, Value);
3699 Value = DAG.getNode(ISD::MUL, dl, VT, Value, DAG.getConstant(Magic, VT));
3708 static SDValue getMemsetStringVal(EVT VT, SDLoc dl, SelectionDAG &DAG,
3712 if (VT.isInteger())
3713 return DAG.getConstant(0, VT);
3714 else if (VT == MVT::f32 || VT == MVT::f64 || VT == MVT::f128)
3715 return DAG.getConstantFP(0.0, VT);
3716 else if (VT.isVector()) {
3717 unsigned NumElts = VT.getVectorNumElements();
3718 MVT EltVT = (VT.getVectorElementType() == MVT::f32) ? MVT::i32 : MVT::i64;
3719 return DAG.getNode(ISD::BITCAST, dl, VT,
3726 assert(!VT.isVector() && "Can't handle vector type here!");
3727 unsigned NumVTBits = VT.getSizeInBits();
3742 Type *Ty = VT.getTypeForEVT(*DAG.getContext());
3744 return DAG.getConstant(Val, VT);
3752 EVT VT = Base.getValueType();
3754 VT, Base, DAG.getConstant(Offset, VT));
3798 EVT VT = TLI.getOptimalMemOpType(Size, DstAlign, SrcAlign,
3802 if (VT == MVT::Other) {
3805 TLI.allowsUnalignedMemoryAccesses(VT, AS)) {
3806 VT = TLI.getPointerTy();
3809 case 0: VT = MVT::i64; break;
3810 case 4: VT = MVT::i32; break;
3811 case 2: VT = MVT::i16; break;
3812 default: VT = MVT::i8; break;
3821 if (VT.bitsGT(LVT))
3822 VT = LVT;
3827 unsigned VTSize = VT.getSizeInBits() / 8;
3830 EVT NewVT = VT;
3834 if (VT.isVector() || VT.isFloatingPoint()) {
3835 NewVT = (VT.getSizeInBits() > 64) ? MVT::i64 : MVT::i32;
3857 // If the new VT cannot cover all of the remaining bits, then consider
3865 TLI.allowsUnalignedMemoryAccesses(VT, AS, &Fast) && Fast)
3868 VT = NewVT;
3876 MemOps.push_back(VT);
3947 EVT VT = MemOps[i];
3948 unsigned VTSize = VT.getSizeInBits() / 8;
3960 (isZeroStr || (VT.isInteger() && !VT.isVector()))) {
3966 Value = getMemsetStringVal(VT, dl, DAG, TLI, Str.substr(SrcOff));
3978 // to Load/Store if NVT==VT.
3980 EVT NVT = TLI.getTypeToTransformTo(*DAG.getContext(), VT);
3981 assert(NVT.bitsGE(VT));
3984 SrcPtrInfo.getWithOffset(SrcOff), VT, isVol, false,
3988 DstPtrInfo.getWithOffset(DstOff), VT, isVol,
4050 EVT VT = MemOps[i];
4051 unsigned VTSize = VT.getSizeInBits() / 8;
4054 Value = DAG.getLoad(VT, dl, Chain,
4065 EVT VT = MemOps[i];
4066 unsigned VTSize = VT.getSizeInBits() / 8;
4148 EVT VT = MemOps[i];
4149 unsigned VTSize = VT.getSizeInBits() / 8;
4160 if (VT.bitsLT(LargestVT)) {
4161 if (!LargestVT.isVector() && !VT.isVector() &&
4162 TLI.isTruncateFree(LargestVT, VT))
4163 Value = DAG.getNode(ISD::TRUNCATE, dl, VT, MemSetValue);
4165 Value = getMemsetValue(Src, VT, DAG, dl);
4167 assert(Value.getValueType() == VT && "Value with wrong type.");
4173 DstOff += VT.getSizeInBits() / 8;
4506 EVT VT = Val.getValueType();
4509 getVTList(VT, MVT::Other);
4515 EVT VT, SDValue Chain,
4522 SDVTList VTs = getVTList(VT, MVT::Other);
4636 EVT VT, SDLoc dl, SDValue Chain,
4645 Alignment = getEVTAlignment(VT);
4664 return getLoad(AM, ExtType, VT, dl, Chain, Ptr, Offset, MemVT, MMO);
4669 EVT VT, SDLoc dl, SDValue Chain,
4672 if (VT == MemVT) {
4675 assert(VT == MemVT && "Non-extending load from different memory type!");
4678 assert(MemVT.getScalarType().bitsLT(VT.getScalarType()) &&
4680 assert(VT.isInteger() == MemVT.isInteger() &&
4682 assert(VT.isVector() == MemVT.isVector() &&
4684 assert((!VT.isVector() ||
4685 VT.getVectorNumElements() == MemVT.getVectorNumElements()) &&
4694 getVTList(VT, Ptr.getValueType(), MVT::Other) : getVTList(VT, MVT::Other);
4716 SDValue SelectionDAG::getLoad(EVT VT, SDLoc dl,
4724 return getLoad(ISD::UNINDEXED, ISD::NON_EXTLOAD, VT
4725 PtrInfo, VT, isVolatile, isNonTemporal, isInvariant, Alignment,
4729 SDValue SelectionDAG::getLoad(EVT VT, SDLoc dl,
4733 return getLoad(ISD::UNINDEXED, ISD::NON_EXTLOAD, VT, dl, Chain, Ptr, Undef,
4734 VT, MMO);
4737 SDValue SelectionDAG::getExtLoad(ISD::LoadExtType ExtType, SDLoc dl, EVT VT,
4743 return getLoad(ISD::UNINDEXED, ExtType, VT, dl, Chain, Ptr, Undef,
4749 SDValue SelectionDAG::getExtLoad(ISD::LoadExtType ExtType, SDLoc dl, EVT VT,
4753 return getLoad(ISD::UNINDEXED, ExtType, VT, dl, Chain, Ptr, Undef,
4800 EVT VT = Val.getValueType();
4806 ID.AddInteger(VT.getRawBits());
4817 ISD::UNINDEXED, false, VT, MMO);
4853 EVT VT = Val.getValueType();
4857 if (VT == SVT)
4860 assert(SVT.getScalarType().bitsLT(VT.getScalarType()) &&
4862 assert(VT.isInteger() == SVT.isInteger() &&
4864 assert(VT.isVector() == SVT.isVector() &&
4866 assert((!VT.isVector() ||
4867 VT.getVectorNumElements() == SVT.getVectorNumElements()) &&
4919 SDValue SelectionDAG::getVAArg(EVT VT, SDLoc dl,
4924 return getNode(ISD::VAARG, dl, getVTList(VT, MVT::Other), Ops);
4927 SDValue SelectionDAG::getNode(unsigned Opcode, SDLoc DL, EVT VT,
4930 case 0: return getNode(Opcode, DL, VT);
4931 case 1: return getNode(Opcode, DL, VT, static_cast<const SDValue>(Ops[0]));
4932 case 2: return getNode(Opcode, DL, VT, Ops[0], Ops[1]);
4933 case 3: return getNode(Opcode, DL, VT, Ops[0], Ops[1], Ops[2]);
4940 return getNode(Opcode, DL, VT, NewOps);
4943 SDValue SelectionDAG::getNode(unsigned Opcode, SDLoc DL, EVT VT,
4947 case 0: return getNode(Opcode, DL, VT);
4948 case 1: return getNode(Opcode, DL, VT, Ops[0]);
4949 case 2: return getNode(Opcode, DL, VT, Ops[0], Ops[1]);
4950 case 3: return getNode(Opcode, DL, VT, Ops[0], Ops[1], Ops[2]);
4962 assert(Ops[2].getValueType() == VT &&
4976 SDVTList VTs = getVTList(VT);
4978 if (VT != MVT::Glue) {
5021 return getNode(Opcode, DL, VT, N1, N2, N3.getOperand(0));
5026 unsigned NumBits = VT.getScalarType().getSizeInBits()*2;
5028 return getNode(Opcode, DL, VT, N1, N2, N3.getOperand(0));
5120 SDVTList SelectionDAG::getVTList(EVT VT) {
5121 return makeVTList(SDNode::getValueTypeList(VT), 1);
5335 EVT VT) {
5336 SDVTList VTs = getVTList(VT);
5341 EVT VT, SDValue Op1) {
5342 SDVTList VTs = getVTList(VT);
5348 EVT VT, SDValue Op1,
5350 SDVTList VTs = getVTList(VT);
5356 EVT VT, SDValue Op1,
5358 SDVTList VTs = getVTList(VT);
5364 EVT VT, ArrayRef<SDValue> Ops) {
5365 SDVTList VTs = getVTList(VT);
5553 SelectionDAG::getMachineNode(unsigned Opcode, SDLoc dl, EVT VT) {
5554 SDVTList VTs = getVTList(VT);
5559 SelectionDAG::getMachineNode(unsigned Opcode, SDLoc dl, EVT VT, SDValue Op1) {
5560 SDVTList VTs = getVTList(VT);
5566 SelectionDAG::getMachineNode(unsigned Opcode, SDLoc dl, EVT VT,
5568 SDVTList VTs = getVTList(VT);
5574 SelectionDAG::getMachineNode(unsigned Opcode, SDLoc dl, EVT VT,
5576 SDVTList VTs = getVTList(VT);
5582 SelectionDAG::getMachineNode(unsigned Opcode, SDLoc dl, EVT VT,
5584 SDVTList VTs = getVTList(VT);
5715 SelectionDAG::getTargetExtractSubreg(int SRIdx, SDLoc DL, EVT VT,
5719 VT, Operand, SRIdxVal);
5726 SelectionDAG::getTargetInsertSubreg(int SRIdx, SDLoc DL, EVT VT,
5730 VT, Operand, Subreg, SRIdxVal);
6201 EVT VT, int64_t o, unsigned char TF)
6202 : SDNode(Opc, Order, DL, getSDVTList(VT)), Offset(o), TargetFlags(TF) {
6206 AddrSpaceCastSDNode::AddrSpaceCastSDNode(unsigned Order, DebugLoc dl, EVT VT,
6209 : UnarySDNode(ISD::ADDRSPACECAST, Order, dl, getSDVTList(VT), X),
6257 const EVT *SDNode::getValueTypeList(EVT VT) {
6258 if (VT.isExtended()) {
6260 return &(*EVTs->insert(VT).first);
6262 assert(VT.getSimpleVT() < MVT::LAST_VALUETYPE &&
6264 return &SimpleVTArray->VTs[VT.getSimpleVT().SimpleTy];
6409 EVT VT = N->getValueType(0);
6410 unsigned NE = VT.getVectorNumElements();
6411 EVT EltVT = VT.getVectorElementType();
6483 EVT VT = LD->getValueType(0);
6484 if (VT.getSizeInBits() / 8 != Bytes)
6562 std::pair<EVT, EVT> SelectionDAG::GetSplitDestVTs(const EVT &VT) const {
6565 if (!VT.isVector()) {
6566 LoVT = HiVT = TLI->getTypeToTransformTo(*getContext(), VT);
6568 unsigned NumElements = VT.getVectorNumElements();
6570 LoVT = HiVT = EVT::getVectorVT(*getContext(), VT.getVectorElementType(),
6595 EVT VT = Op.getValueType();
6597 Count = VT.getVectorNumElements();
6599 EVT EltVT = VT.getVectorElementType();
6626 EVT VT = getValueType(0);
6627 assert(VT.isVector() && "Expected a vector type");
6628 unsigned sz = VT.getSizeInBits();
6641 unsigned EltBitSize = VT.getVectorElementType().getSizeInBits();
6734 bool ShuffleVectorSDNode::isSplatMask(const int *Mask, EVT VT) {
6737 for (i = 0, e = VT.getVectorNumElements(); i != e && Mask[i] < 0; ++i)