Lines Matching refs:Ty

350 Constant *Constant::getNullValue(Type *Ty) {  in getNullValue()  argument
351 switch (Ty->getTypeID()) { in getNullValue()
353 return ConstantInt::get(Ty, 0); in getNullValue()
361 return ConstantFP::get(Ty->getContext(), in getNullValue()
362 APFloat::getZero(Ty->getFltSemantics())); in getNullValue()
364 return ConstantPointerNull::get(cast<PointerType>(Ty)); in getNullValue()
369 return ConstantAggregateZero::get(Ty); in getNullValue()
371 return ConstantTokenNone::get(Ty->getContext()); in getNullValue()
378 Constant *Constant::getIntegerValue(Type *Ty, const APInt &V) { in getIntegerValue() argument
379 Type *ScalarTy = Ty->getScalarType(); in getIntegerValue()
382 Constant *C = ConstantInt::get(Ty->getContext(), V); in getIntegerValue()
389 if (VectorType *VTy = dyn_cast<VectorType>(Ty)) in getIntegerValue()
395 Constant *Constant::getAllOnesValue(Type *Ty) { in getAllOnesValue() argument
396 if (IntegerType *ITy = dyn_cast<IntegerType>(Ty)) in getAllOnesValue()
397 return ConstantInt::get(Ty->getContext(), in getAllOnesValue()
400 if (Ty->isFloatingPointTy()) { in getAllOnesValue()
401 APFloat FL = APFloat::getAllOnesValue(Ty->getFltSemantics()); in getAllOnesValue()
402 return ConstantFP::get(Ty->getContext(), FL); in getAllOnesValue()
405 VectorType *VTy = cast<VectorType>(Ty); in getAllOnesValue()
749 Type *Ty = C->getType(); in replaceUndefsWith() local
751 assert(Ty == Replacement->getType() && "Expected matching types"); in replaceUndefsWith()
756 auto *VTy = dyn_cast<FixedVectorType>(Ty); in replaceUndefsWith()
776 Type *Ty = C->getType(); in mergeUndefsWith() local
778 return UndefValue::get(Ty); in mergeUndefsWith()
780 auto *VTy = dyn_cast<FixedVectorType>(Ty); in mergeUndefsWith()
822 ConstantInt::ConstantInt(IntegerType *Ty, const APInt &V) in ConstantInt() argument
823 : ConstantData(Ty, ConstantIntVal), Val(V) { in ConstantInt()
824 assert(V.getBitWidth() == Ty->getBitWidth() && "Invalid constant for type"); in ConstantInt()
845 Constant *ConstantInt::getTrue(Type *Ty) { in getTrue() argument
846 assert(Ty->isIntOrIntVectorTy(1) && "Type not i1 or vector of i1."); in getTrue()
847 ConstantInt *TrueC = ConstantInt::getTrue(Ty->getContext()); in getTrue()
848 if (auto *VTy = dyn_cast<VectorType>(Ty)) in getTrue()
853 Constant *ConstantInt::getFalse(Type *Ty) { in getFalse() argument
854 assert(Ty->isIntOrIntVectorTy(1) && "Type not i1 or vector of i1."); in getFalse()
855 ConstantInt *FalseC = ConstantInt::getFalse(Ty->getContext()); in getFalse()
856 if (auto *VTy = dyn_cast<VectorType>(Ty)) in getFalse()
861 Constant *ConstantInt::getBool(Type *Ty, bool V) { in getBool() argument
862 return V ? getTrue(Ty) : getFalse(Ty); in getBool()
879 Constant *ConstantInt::get(Type *Ty, uint64_t V, bool isSigned) { in get() argument
880 Constant *C = get(cast<IntegerType>(Ty->getScalarType()), V, isSigned); in get()
883 if (VectorType *VTy = dyn_cast<VectorType>(Ty)) in get()
889 ConstantInt *ConstantInt::get(IntegerType *Ty, uint64_t V, bool isSigned) { in get() argument
890 return get(Ty->getContext(), APInt(Ty->getBitWidth(), V, isSigned)); in get()
893 ConstantInt *ConstantInt::getSigned(IntegerType *Ty, int64_t V) { in getSigned() argument
894 return get(Ty, V, true); in getSigned()
897 Constant *ConstantInt::getSigned(Type *Ty, int64_t V) { in getSigned() argument
898 return get(Ty, V, true); in getSigned()
901 Constant *ConstantInt::get(Type *Ty, const APInt& V) { in get() argument
902 ConstantInt *C = get(Ty->getContext(), V); in get()
903 assert(C->getType() == Ty->getScalarType() && in get()
907 if (VectorType *VTy = dyn_cast<VectorType>(Ty)) in get()
913 ConstantInt *ConstantInt::get(IntegerType* Ty, StringRef Str, uint8_t radix) { in get() argument
914 return get(Ty->getContext(), APInt(Ty->getBitWidth(), Str, radix)); in get()
926 Constant *ConstantFP::get(Type *Ty, double V) { in get() argument
927 LLVMContext &Context = Ty->getContext(); in get()
931 FV.convert(Ty->getScalarType()->getFltSemantics(), in get()
936 if (VectorType *VTy = dyn_cast<VectorType>(Ty)) in get()
942 Constant *ConstantFP::get(Type *Ty, const APFloat &V) { in get() argument
943 ConstantFP *C = get(Ty->getContext(), V); in get()
944 assert(C->getType() == Ty->getScalarType() && in get()
948 if (auto *VTy = dyn_cast<VectorType>(Ty)) in get()
954 Constant *ConstantFP::get(Type *Ty, StringRef Str) { in get() argument
955 LLVMContext &Context = Ty->getContext(); in get()
957 APFloat FV(Ty->getScalarType()->getFltSemantics(), Str); in get()
961 if (VectorType *VTy = dyn_cast<VectorType>(Ty)) in get()
967 Constant *ConstantFP::getNaN(Type *Ty, bool Negative, uint64_t Payload) { in getNaN() argument
968 const fltSemantics &Semantics = Ty->getScalarType()->getFltSemantics(); in getNaN()
970 Constant *C = get(Ty->getContext(), NaN); in getNaN()
972 if (VectorType *VTy = dyn_cast<VectorType>(Ty)) in getNaN()
978 Constant *ConstantFP::getQNaN(Type *Ty, bool Negative, APInt *Payload) { in getQNaN() argument
979 const fltSemantics &Semantics = Ty->getScalarType()->getFltSemantics(); in getQNaN()
981 Constant *C = get(Ty->getContext(), NaN); in getQNaN()
983 if (VectorType *VTy = dyn_cast<VectorType>(Ty)) in getQNaN()
989 Constant *ConstantFP::getSNaN(Type *Ty, bool Negative, APInt *Payload) { in getSNaN() argument
990 const fltSemantics &Semantics = Ty->getScalarType()->getFltSemantics(); in getSNaN()
992 Constant *C = get(Ty->getContext(), NaN); in getSNaN()
994 if (VectorType *VTy = dyn_cast<VectorType>(Ty)) in getSNaN()
1000 Constant *ConstantFP::getZero(Type *Ty, bool Negative) { in getZero() argument
1001 const fltSemantics &Semantics = Ty->getScalarType()->getFltSemantics(); in getZero()
1003 Constant *C = get(Ty->getContext(), NegZero); in getZero()
1005 if (VectorType *VTy = dyn_cast<VectorType>(Ty)) in getZero()
1011 Constant *ConstantFP::getZeroValueForNegation(Type *Ty) { in getZeroValueForNegation() argument
1012 if (Ty->isFPOrFPVectorTy()) in getZeroValueForNegation()
1013 return getNegativeZero(Ty); in getZeroValueForNegation()
1015 return Constant::getNullValue(Ty); in getZeroValueForNegation()
1026 Type *Ty = Type::getFloatingPointTy(Context, V.getSemantics()); in get() local
1027 Slot.reset(new ConstantFP(Ty, V)); in get()
1033 Constant *ConstantFP::getInfinity(Type *Ty, bool Negative) { in getInfinity() argument
1034 const fltSemantics &Semantics = Ty->getScalarType()->getFltSemantics(); in getInfinity()
1035 Constant *C = get(Ty->getContext(), APFloat::getInf(Semantics, Negative)); in getInfinity()
1037 if (VectorType *VTy = dyn_cast<VectorType>(Ty)) in getInfinity()
1043 ConstantFP::ConstantFP(Type *Ty, const APFloat &V) in ConstantFP() argument
1044 : ConstantData(Ty, ConstantFPVal), Val(V) { in ConstantFP()
1045 assert(&V.getSemantics() == &Ty->getFltSemantics() && in ConstantFP()
1085 Type *Ty = getType(); in getElementCount() local
1086 if (auto *AT = dyn_cast<ArrayType>(Ty)) in getElementCount()
1088 if (auto *VT = dyn_cast<VectorType>(Ty)) in getElementCount()
1090 return ElementCount::getFixed(Ty->getStructNumElements()); in getElementCount()
1120 Type *Ty = getType(); in getNumElements() local
1121 if (auto *AT = dyn_cast<ArrayType>(Ty)) in getNumElements()
1123 if (auto *VT = dyn_cast<VectorType>(Ty)) in getNumElements()
1125 return Ty->getStructNumElements(); in getNumElements()
1241 Constant *ConstantArray::get(ArrayType *Ty, ArrayRef<Constant*> V) { in get() argument
1242 if (Constant *C = getImpl(Ty, V)) in get()
1244 return Ty->getContext().pImpl->ArrayConstants.getOrCreate(Ty, V); in get()
1247 Constant *ConstantArray::getImpl(ArrayType *Ty, ArrayRef<Constant*> V) { in getImpl() argument
1250 return ConstantAggregateZero::get(Ty); in getImpl()
1253 assert(C->getType() == Ty->getElementType() && in getImpl()
1263 return PoisonValue::get(Ty); in getImpl()
1266 return UndefValue::get(Ty); in getImpl()
1269 return ConstantAggregateZero::get(Ty); in getImpl()
1351 auto *Ty = FixedVectorType::get(V.front()->getType(), V.size()); in get() local
1352 return Ty->getContext().pImpl->VectorConstants.getOrCreate(Ty, V); in get()
1456 Constant *ConstantExpr::getWithOperands(ArrayRef<Constant *> Ops, Type *Ty, in getWithOperands() argument
1461 if (Ty == getType() && std::equal(Ops.begin(), Ops.end(), op_begin())) in getWithOperands()
1464 Type *OnlyIfReducedTy = OnlyIfReduced ? Ty : nullptr; in getWithOperands()
1479 return ConstantExpr::getCast(getOpcode(), Ops[0], Ty, OnlyIfReduced); in getWithOperands()
1514 bool ConstantInt::isValueValidForType(Type *Ty, uint64_t Val) { in isValueValidForType() argument
1515 unsigned NumBits = Ty->getIntegerBitWidth(); // assert okay in isValueValidForType()
1516 if (Ty->isIntegerTy(1)) in isValueValidForType()
1521 bool ConstantInt::isValueValidForType(Type *Ty, int64_t Val) { in isValueValidForType() argument
1522 unsigned NumBits = Ty->getIntegerBitWidth(); in isValueValidForType()
1523 if (Ty->isIntegerTy(1)) in isValueValidForType()
1528 bool ConstantFP::isValueValidForType(Type *Ty, const APFloat& Val) { in isValueValidForType() argument
1532 switch (Ty->getTypeID()) { in isValueValidForType()
1589 ConstantAggregateZero *ConstantAggregateZero::get(Type *Ty) { in get() argument
1590 assert((Ty->isStructTy() || Ty->isArrayTy() || Ty->isVectorTy()) && in get()
1594 Ty->getContext().pImpl->CAZConstants[Ty]; in get()
1596 Entry.reset(new ConstantAggregateZero(Ty)); in get()
1696 ConstantPointerNull *ConstantPointerNull::get(PointerType *Ty) { in get() argument
1698 Ty->getContext().pImpl->CPNConstants[Ty]; in get()
1700 Entry.reset(new ConstantPointerNull(Ty)); in get()
1710 UndefValue *UndefValue::get(Type *Ty) { in get() argument
1711 std::unique_ptr<UndefValue> &Entry = Ty->getContext().pImpl->UVConstants[Ty]; in get()
1713 Entry.reset(new UndefValue(Ty)); in get()
1729 PoisonValue *PoisonValue::get(Type *Ty) { in get() argument
1730 std::unique_ptr<PoisonValue> &Entry = Ty->getContext().pImpl->PVConstants[Ty]; in get()
1732 Entry.reset(new PoisonValue(Ty)); in get()
1925 static Constant *getFoldedCast(Instruction::CastOps opc, Constant *C, Type *Ty, in getFoldedCast() argument
1927 assert(Ty->isFirstClassType() && "Cannot cast to an aggregate type!"); in getFoldedCast()
1929 if (Constant *FC = ConstantFoldCastInstruction(opc, C, Ty)) in getFoldedCast()
1935 LLVMContextImpl *pImpl = Ty->getContext().pImpl; in getFoldedCast()
1940 return pImpl->ExprConstants.getOrCreate(Ty, Key); in getFoldedCast()
1943 Constant *ConstantExpr::getCast(unsigned oc, Constant *C, Type *Ty, in getCast() argument
1947 assert(C && Ty && "Null arguments to getCast"); in getCast()
1948 assert(CastInst::castIsValid(opc, C, Ty) && "Invalid constantexpr cast!"); in getCast()
1954 return getTrunc(C, Ty, OnlyIfReduced); in getCast()
1956 return getZExt(C, Ty, OnlyIfReduced); in getCast()
1958 return getSExt(C, Ty, OnlyIfReduced); in getCast()
1960 return getFPTrunc(C, Ty, OnlyIfReduced); in getCast()
1962 return getFPExtend(C, Ty, OnlyIfReduced); in getCast()
1964 return getUIToFP(C, Ty, OnlyIfReduced); in getCast()
1966 return getSIToFP(C, Ty, OnlyIfReduced); in getCast()
1968 return getFPToUI(C, Ty, OnlyIfReduced); in getCast()
1970 return getFPToSI(C, Ty, OnlyIfReduced); in getCast()
1972 return getPtrToInt(C, Ty, OnlyIfReduced); in getCast()
1974 return getIntToPtr(C, Ty, OnlyIfReduced); in getCast()
1976 return getBitCast(C, Ty, OnlyIfReduced); in getCast()
1978 return getAddrSpaceCast(C, Ty, OnlyIfReduced); in getCast()
1982 Constant *ConstantExpr::getZExtOrBitCast(Constant *C, Type *Ty) { in getZExtOrBitCast() argument
1983 if (C->getType()->getScalarSizeInBits() == Ty->getScalarSizeInBits()) in getZExtOrBitCast()
1984 return getBitCast(C, Ty); in getZExtOrBitCast()
1985 return getZExt(C, Ty); in getZExtOrBitCast()
1988 Constant *ConstantExpr::getSExtOrBitCast(Constant *C, Type *Ty) { in getSExtOrBitCast() argument
1989 if (C->getType()->getScalarSizeInBits() == Ty->getScalarSizeInBits()) in getSExtOrBitCast()
1990 return getBitCast(C, Ty); in getSExtOrBitCast()
1991 return getSExt(C, Ty); in getSExtOrBitCast()
1994 Constant *ConstantExpr::getTruncOrBitCast(Constant *C, Type *Ty) { in getTruncOrBitCast() argument
1995 if (C->getType()->getScalarSizeInBits() == Ty->getScalarSizeInBits()) in getTruncOrBitCast()
1996 return getBitCast(C, Ty); in getTruncOrBitCast()
1997 return getTrunc(C, Ty); in getTruncOrBitCast()
2000 Constant *ConstantExpr::getSExtOrTrunc(Constant *C, Type *Ty) { in getSExtOrTrunc() argument
2001 assert(C->getType()->isIntOrIntVectorTy() && Ty->isIntOrIntVectorTy() && in getSExtOrTrunc()
2004 if (CTy->getScalarSizeInBits() < Ty->getScalarSizeInBits()) in getSExtOrTrunc()
2005 return getSExt(C, Ty); in getSExtOrTrunc()
2006 if (CTy->getScalarSizeInBits() > Ty->getScalarSizeInBits()) in getSExtOrTrunc()
2007 return getTrunc(C, Ty); in getSExtOrTrunc()
2011 Constant *ConstantExpr::getPointerCast(Constant *S, Type *Ty) { in getPointerCast() argument
2013 assert((Ty->isIntOrIntVectorTy() || Ty->isPtrOrPtrVectorTy()) && in getPointerCast()
2016 if (Ty->isIntOrIntVectorTy()) in getPointerCast()
2017 return getPtrToInt(S, Ty); in getPointerCast()
2020 if (Ty->isPtrOrPtrVectorTy() && SrcAS != Ty->getPointerAddressSpace()) in getPointerCast()
2021 return getAddrSpaceCast(S, Ty); in getPointerCast()
2023 return getBitCast(S, Ty); in getPointerCast()
2027 Type *Ty) { in getPointerBitCastOrAddrSpaceCast() argument
2029 assert(Ty->isPtrOrPtrVectorTy() && "Invalid cast"); in getPointerBitCastOrAddrSpaceCast()
2031 if (S->getType()->getPointerAddressSpace() != Ty->getPointerAddressSpace()) in getPointerBitCastOrAddrSpaceCast()
2032 return getAddrSpaceCast(S, Ty); in getPointerBitCastOrAddrSpaceCast()
2034 return getBitCast(S, Ty); in getPointerBitCastOrAddrSpaceCast()
2037 Constant *ConstantExpr::getIntegerCast(Constant *C, Type *Ty, bool isSigned) { in getIntegerCast() argument
2039 Ty->isIntOrIntVectorTy() && "Invalid cast"); in getIntegerCast()
2041 unsigned DstBits = Ty->getScalarSizeInBits(); in getIntegerCast()
2046 return getCast(opcode, C, Ty); in getIntegerCast()
2049 Constant *ConstantExpr::getFPCast(Constant *C, Type *Ty) { in getFPCast() argument
2050 assert(C->getType()->isFPOrFPVectorTy() && Ty->isFPOrFPVectorTy() && in getFPCast()
2053 unsigned DstBits = Ty->getScalarSizeInBits(); in getFPCast()
2058 return getCast(opcode, C, Ty); in getFPCast()
2061 Constant *ConstantExpr::getTrunc(Constant *C, Type *Ty, bool OnlyIfReduced) { in getTrunc() argument
2064 bool toVec = isa<VectorType>(Ty); in getTrunc()
2068 assert(Ty->isIntOrIntVectorTy() && "Trunc produces only integral"); in getTrunc()
2069 assert(C->getType()->getScalarSizeInBits() > Ty->getScalarSizeInBits()&& in getTrunc()
2072 return getFoldedCast(Instruction::Trunc, C, Ty, OnlyIfReduced); in getTrunc()
2075 Constant *ConstantExpr::getSExt(Constant *C, Type *Ty, bool OnlyIfReduced) { in getSExt() argument
2078 bool toVec = isa<VectorType>(Ty); in getSExt()
2082 assert(Ty->isIntOrIntVectorTy() && "SExt produces only integer"); in getSExt()
2083 assert(C->getType()->getScalarSizeInBits() < Ty->getScalarSizeInBits()&& in getSExt()
2086 return getFoldedCast(Instruction::SExt, C, Ty, OnlyIfReduced); in getSExt()
2089 Constant *ConstantExpr::getZExt(Constant *C, Type *Ty, bool OnlyIfReduced) { in getZExt() argument
2092 bool toVec = isa<VectorType>(Ty); in getZExt()
2096 assert(Ty->isIntOrIntVectorTy() && "ZExt produces only integer"); in getZExt()
2097 assert(C->getType()->getScalarSizeInBits() < Ty->getScalarSizeInBits()&& in getZExt()
2100 return getFoldedCast(Instruction::ZExt, C, Ty, OnlyIfReduced); in getZExt()
2103 Constant *ConstantExpr::getFPTrunc(Constant *C, Type *Ty, bool OnlyIfReduced) { in getFPTrunc() argument
2106 bool toVec = isa<VectorType>(Ty); in getFPTrunc()
2109 assert(C->getType()->isFPOrFPVectorTy() && Ty->isFPOrFPVectorTy() && in getFPTrunc()
2110 C->getType()->getScalarSizeInBits() > Ty->getScalarSizeInBits()&& in getFPTrunc()
2112 return getFoldedCast(Instruction::FPTrunc, C, Ty, OnlyIfReduced); in getFPTrunc()
2115 Constant *ConstantExpr::getFPExtend(Constant *C, Type *Ty, bool OnlyIfReduced) { in getFPExtend() argument
2118 bool toVec = isa<VectorType>(Ty); in getFPExtend()
2121 assert(C->getType()->isFPOrFPVectorTy() && Ty->isFPOrFPVectorTy() && in getFPExtend()
2122 C->getType()->getScalarSizeInBits() < Ty->getScalarSizeInBits()&& in getFPExtend()
2124 return getFoldedCast(Instruction::FPExt, C, Ty, OnlyIfReduced); in getFPExtend()
2127 Constant *ConstantExpr::getUIToFP(Constant *C, Type *Ty, bool OnlyIfReduced) { in getUIToFP() argument
2130 bool toVec = isa<VectorType>(Ty); in getUIToFP()
2133 assert(C->getType()->isIntOrIntVectorTy() && Ty->isFPOrFPVectorTy() && in getUIToFP()
2135 return getFoldedCast(Instruction::UIToFP, C, Ty, OnlyIfReduced); in getUIToFP()
2138 Constant *ConstantExpr::getSIToFP(Constant *C, Type *Ty, bool OnlyIfReduced) { in getSIToFP() argument
2141 bool toVec = isa<VectorType>(Ty); in getSIToFP()
2144 assert(C->getType()->isIntOrIntVectorTy() && Ty->isFPOrFPVectorTy() && in getSIToFP()
2146 return getFoldedCast(Instruction::SIToFP, C, Ty, OnlyIfReduced); in getSIToFP()
2149 Constant *ConstantExpr::getFPToUI(Constant *C, Type *Ty, bool OnlyIfReduced) { in getFPToUI() argument
2152 bool toVec = isa<VectorType>(Ty); in getFPToUI()
2155 assert(C->getType()->isFPOrFPVectorTy() && Ty->isIntOrIntVectorTy() && in getFPToUI()
2157 return getFoldedCast(Instruction::FPToUI, C, Ty, OnlyIfReduced); in getFPToUI()
2160 Constant *ConstantExpr::getFPToSI(Constant *C, Type *Ty, bool OnlyIfReduced) { in getFPToSI() argument
2163 bool toVec = isa<VectorType>(Ty); in getFPToSI()
2166 assert(C->getType()->isFPOrFPVectorTy() && Ty->isIntOrIntVectorTy() && in getFPToSI()
2168 return getFoldedCast(Instruction::FPToSI, C, Ty, OnlyIfReduced); in getFPToSI()
2379 Constant *ConstantExpr::getSizeOf(Type* Ty) { in getSizeOf() argument
2382 Constant *GEPIdx = ConstantInt::get(Type::getInt32Ty(Ty->getContext()), 1); in getSizeOf()
2384 Ty, Constant::getNullValue(PointerType::getUnqual(Ty)), GEPIdx); in getSizeOf()
2386 Type::getInt64Ty(Ty->getContext())); in getSizeOf()
2389 Constant *ConstantExpr::getAlignOf(Type* Ty) { in getAlignOf() argument
2392 Type *AligningTy = StructType::get(Type::getInt1Ty(Ty->getContext()), Ty); in getAlignOf()
2394 Constant *Zero = ConstantInt::get(Type::getInt64Ty(Ty->getContext()), 0); in getAlignOf()
2395 Constant *One = ConstantInt::get(Type::getInt32Ty(Ty->getContext()), 1); in getAlignOf()
2399 Type::getInt64Ty(Ty->getContext())); in getAlignOf()
2407 Constant *ConstantExpr::getOffsetOf(Type* Ty, Constant *FieldNo) { in getOffsetOf() argument
2411 ConstantInt::get(Type::getInt64Ty(Ty->getContext()), 0), in getOffsetOf()
2415 Ty, Constant::getNullValue(PointerType::getUnqual(Ty)), GEPIdx); in getOffsetOf()
2417 Type::getInt64Ty(Ty->getContext())); in getOffsetOf()
2459 Constant *ConstantExpr::getGetElementPtr(Type *Ty, Constant *C, in getGetElementPtr() argument
2464 assert(Ty && "Must specify element type"); in getGetElementPtr()
2465 assert(OrigPtrTy->isOpaqueOrPointeeTypeMatches(Ty)); in getGetElementPtr()
2468 ConstantFoldGetElementPtr(Ty, C, InBounds, InRangeIndex, Idxs)) in getGetElementPtr()
2472 Type *DestTy = GetElementPtrInst::getIndexedType(Ty, Idxs); in getGetElementPtr()
2497 auto GTI = gep_type_begin(Ty, Idxs), GTE = gep_type_end(Ty, Idxs); in getGetElementPtr()
2518 SubClassOptionalData, None, Ty); in getGetElementPtr()
2720 Type *Ty = C->getType(); in getExactLogBase2() local
2723 return ConstantInt::get(Ty, IVal->logBase2()); in getExactLogBase2()
2726 auto *VecTy = dyn_cast<FixedVectorType>(Ty); in getExactLogBase2()
2737 Elts.push_back(Constant::getNullValue(Ty->getScalarType())); in getExactLogBase2()
2742 Elts.push_back(ConstantInt::get(Ty->getScalarType(), IVal->logBase2())); in getExactLogBase2()
2748 Constant *ConstantExpr::getBinOpIdentity(unsigned Opcode, Type *Ty, in getBinOpIdentity() argument
2758 return Constant::getNullValue(Ty); in getBinOpIdentity()
2760 return ConstantInt::get(Ty, 1); in getBinOpIdentity()
2762 return Constant::getAllOnesValue(Ty); in getBinOpIdentity()
2764 return ConstantFP::getZero(Ty, !NSZ); in getBinOpIdentity()
2766 return ConstantFP::get(Ty, 1.0); in getBinOpIdentity()
2782 return Constant::getNullValue(Ty); in getBinOpIdentity()
2785 return ConstantInt::get(Ty, 1); in getBinOpIdentity()
2787 return ConstantFP::get(Ty, 1.0); in getBinOpIdentity()
2793 Constant *ConstantExpr::getBinOpAbsorber(unsigned Opcode, Type *Ty) { in getBinOpAbsorber() argument
2800 return Constant::getAllOnesValue(Ty); in getBinOpAbsorber()
2804 return Constant::getNullValue(Ty); in getBinOpAbsorber()
2852 bool ConstantDataSequential::isElementTypeCompatible(Type *Ty) { in isElementTypeCompatible() argument
2853 if (Ty->isHalfTy() || Ty->isBFloatTy() || Ty->isFloatTy() || Ty->isDoubleTy()) in isElementTypeCompatible()
2855 if (auto *IT = dyn_cast<IntegerType>(Ty)) { in isElementTypeCompatible()
2898 Constant *ConstantDataSequential::getImpl(StringRef Elements, Type *Ty) { in getImpl() argument
2900 if (ArrayType *ATy = dyn_cast<ArrayType>(Ty)) in getImpl()
2903 assert(isElementTypeCompatible(cast<VectorType>(Ty)->getElementType())); in getImpl()
2908 return ConstantAggregateZero::get(Ty); in getImpl()
2912 *Ty->getContext() in getImpl()
2922 if ((*Entry)->getType() == Ty) in getImpl()
2927 if (isa<ArrayType>(Ty)) { in getImpl()
2929 Entry->reset(new ConstantDataArray(Ty, Slot.first().data())); in getImpl()
2933 assert(isa<VectorType>(Ty)); in getImpl()
2935 Entry->reset(new ConstantDataVector(Ty, Slot.first().data())); in getImpl()
2983 Type *Ty = ArrayType::get(ElementType, Elts.size()); in getFP() local
2985 return getImpl(StringRef(Data, Elts.size() * 2), Ty); in getFP()
2989 Type *Ty = ArrayType::get(ElementType, Elts.size()); in getFP() local
2991 return getImpl(StringRef(Data, Elts.size() * 4), Ty); in getFP()
2996 Type *Ty = ArrayType::get(ElementType, Elts.size()); in getFP() local
2998 return getImpl(StringRef(Data, Elts.size() * 8), Ty); in getFP()
3018 auto *Ty = FixedVectorType::get(Type::getInt8Ty(Context), Elts.size()); in get() local
3020 return getImpl(StringRef(Data, Elts.size() * 1), Ty); in get()
3023 auto *Ty = FixedVectorType::get(Type::getInt16Ty(Context), Elts.size()); in get() local
3025 return getImpl(StringRef(Data, Elts.size() * 2), Ty); in get()
3028 auto *Ty = FixedVectorType::get(Type::getInt32Ty(Context), Elts.size()); in get() local
3030 return getImpl(StringRef(Data, Elts.size() * 4), Ty); in get()
3033 auto *Ty = FixedVectorType::get(Type::getInt64Ty(Context), Elts.size()); in get() local
3035 return getImpl(StringRef(Data, Elts.size() * 8), Ty); in get()
3038 auto *Ty = FixedVectorType::get(Type::getFloatTy(Context), Elts.size()); in get() local
3040 return getImpl(StringRef(Data, Elts.size() * 4), Ty); in get()
3043 auto *Ty = FixedVectorType::get(Type::getDoubleTy(Context), Elts.size()); in get() local
3045 return getImpl(StringRef(Data, Elts.size() * 8), Ty); in get()
3058 auto *Ty = FixedVectorType::get(ElementType, Elts.size()); in getFP() local
3060 return getImpl(StringRef(Data, Elts.size() * 2), Ty); in getFP()
3065 auto *Ty = FixedVectorType::get(ElementType, Elts.size()); in getFP() local
3067 return getImpl(StringRef(Data, Elts.size() * 4), Ty); in getFP()
3073 auto *Ty = FixedVectorType::get(ElementType, Elts.size()); in getFP() local
3075 return getImpl(StringRef(Data, Elts.size() * 8), Ty); in getFP()