Lines Matching refs:Constant

40 void Constant::anchor() { }  in anchor()
44 bool Constant::isNegativeZeroValue() const { in isNegativeZeroValue()
70 bool Constant::isZeroValue() const { in isZeroValue()
90 bool Constant::isNullValue() const { in isNullValue()
105 bool Constant::isAllOnesValue() const { in isAllOnesValue()
116 if (Constant *Splat = CV->getSplatValue()) in isAllOnesValue()
121 if (Constant *Splat = CV->getSplatValue()) in isAllOnesValue()
127 bool Constant::isOneValue() const { in isOneValue()
138 if (Constant *Splat = CV->getSplatValue()) in isOneValue()
143 if (Constant *Splat = CV->getSplatValue()) in isOneValue()
149 bool Constant::isMinSignedValue() const { in isMinSignedValue()
160 if (Constant *Splat = CV->getSplatValue()) in isMinSignedValue()
165 if (Constant *Splat = CV->getSplatValue()) in isMinSignedValue()
171 bool Constant::isNotMinSignedValue() const { in isNotMinSignedValue()
182 if (Constant *Splat = CV->getSplatValue()) in isNotMinSignedValue()
187 if (Constant *Splat = CV->getSplatValue()) in isNotMinSignedValue()
195 Constant *Constant::getNullValue(Type *Ty) { in getNullValue()
232 Constant *Constant::getIntegerValue(Type *Ty, const APInt &V) { in getIntegerValue()
236 Constant *C = ConstantInt::get(Ty->getContext(), V); in getIntegerValue()
249 Constant *Constant::getAllOnesValue(Type *Ty) { in getAllOnesValue()
265 Constant *Constant::getAggregateElement(unsigned Elt) const { in getAggregateElement()
281 Constant *Constant::getAggregateElement(Constant *Elt) const { in getAggregateElement()
288 void Constant::destroyConstant() { in destroyConstant()
311 if (!isa<Constant>(V)) { in destroyConstant()
317 assert(isa<Constant>(V) && "References remain to Constant being destroyed"); in destroyConstant()
318 cast<Constant>(V)->destroyConstant(); in destroyConstant()
328 static bool canTrapImpl(const Constant *C, in canTrapImpl()
361 bool Constant::canTrap() const { in canTrap()
368 ConstHasGlobalValuePredicate(const Constant *C, in ConstHasGlobalValuePredicate()
370 SmallPtrSet<const Constant *, 8> Visited; in ConstHasGlobalValuePredicate()
371 SmallVector<const Constant *, 8> WorkList; in ConstHasGlobalValuePredicate()
376 const Constant *WorkItem = WorkList.pop_back_val(); in ConstHasGlobalValuePredicate()
381 const Constant *ConstOp = dyn_cast<Constant>(Op); in ConstHasGlobalValuePredicate()
391 bool Constant::isThreadDependent() const { in isThreadDependent()
398 bool Constant::isDLLImportDependent() const { in isDLLImportDependent()
405 bool Constant::isConstantUsed() const { in isConstantUsed()
407 const Constant *UC = dyn_cast<Constant>(U); in isConstantUsed()
417 bool Constant::needsRelocation() const { in needsRelocation()
443 Result |= cast<Constant>(getOperand(i))->needsRelocation(); in needsRelocation()
450 static bool removeDeadUsersOfConstant(const Constant *C) { in removeDeadUsersOfConstant()
454 const Constant *User = dyn_cast<Constant>(C->user_back()); in removeDeadUsersOfConstant()
460 const_cast<Constant*>(C)->destroyConstant(); in removeDeadUsersOfConstant()
465 void Constant::removeDeadConstantUsers() const { in removeDeadConstantUsers()
469 const Constant *User = dyn_cast<Constant>(*I); in removeDeadConstantUsers()
522 Constant *ConstantInt::getTrue(Type *Ty) { in getTrue()
534 Constant *ConstantInt::getFalse(Type *Ty) { in getFalse()
560 Constant *ConstantInt::get(Type *Ty, uint64_t V, bool isSigned) { in get()
561 Constant *C = get(cast<IntegerType>(Ty->getScalarType()), V, isSigned); in get()
578 Constant *ConstantInt::getSigned(Type *Ty, int64_t V) { in getSigned()
582 Constant *ConstantInt::get(Type *Ty, const APInt& V) { in get()
625 Constant *ConstantFP::get(Type *Ty, double V) { in get()
632 Constant *C = get(Context, FV); in get()
642 Constant *ConstantFP::get(Type *Ty, StringRef Str) { in get()
646 Constant *C = get(Context, FV); in get()
655 Constant *ConstantFP::getNaN(Type *Ty, bool Negative, unsigned Type) { in getNaN()
658 Constant *C = get(Ty->getContext(), NaN); in getNaN()
666 Constant *ConstantFP::getNegativeZero(Type *Ty) { in getNegativeZero()
669 Constant *C = get(Ty->getContext(), NegZero); in getNegativeZero()
678 Constant *ConstantFP::getZeroValueForNegation(Type *Ty) { in getZeroValueForNegation()
682 return Constant::getNullValue(Ty); in getZeroValueForNegation()
715 Constant *ConstantFP::getInfinity(Type *Ty, bool Negative) { in getInfinity()
717 Constant *C = get(Ty->getContext(), APFloat::getInf(Semantics, Negative)); in getInfinity()
744 Constant *ConstantAggregateZero::getSequentialElement() const { in getSequentialElement()
745 return Constant::getNullValue(getType()->getSequentialElementType()); in getSequentialElement()
748 Constant *ConstantAggregateZero::getStructElement(unsigned Elt) const { in getStructElement()
749 return Constant::getNullValue(getType()->getStructElementType(Elt)); in getStructElement()
752 Constant *ConstantAggregateZero::getElementValue(Constant *C) const { in getElementValue()
758 Constant *ConstantAggregateZero::getElementValue(unsigned Idx) const { in getElementValue()
785 UndefValue *UndefValue::getElementValue(Constant *C) const { in getElementValue()
819 static Constant *getIntSequenceIfElementsMatch(ArrayRef<Constant *> V) { in getIntSequenceIfElementsMatch()
823 for (Constant *C : V) in getIntSequenceIfElementsMatch()
832 static Constant *getFPSequenceIfElementsMatch(ArrayRef<Constant *> V) { in getFPSequenceIfElementsMatch()
836 for (Constant *C : V) in getFPSequenceIfElementsMatch()
845 static Constant *getSequenceIfElementsMatch(Constant *C, in getSequenceIfElementsMatch()
846 ArrayRef<Constant *> V) { in getSequenceIfElementsMatch()
872 ArrayRef<Constant *> V) in ConstantAggregate()
873 : Constant(T, VT, OperandTraits<ConstantAggregate>::op_end(this) - V.size(), in ConstantAggregate()
886 ConstantArray::ConstantArray(ArrayType *T, ArrayRef<Constant *> V) in ConstantArray()
892 Constant *ConstantArray::get(ArrayType *Ty, ArrayRef<Constant*> V) { in get()
893 if (Constant *C = getImpl(Ty, V)) in get()
898 Constant *ConstantArray::getImpl(ArrayType *Ty, ArrayRef<Constant*> V) { in getImpl()
911 Constant *C = V[0]; in getImpl()
928 ArrayRef<Constant*> V, in getTypeForElements()
939 StructType *ConstantStruct::getTypeForElements(ArrayRef<Constant*> V, in getTypeForElements()
946 ConstantStruct::ConstantStruct(StructType *T, ArrayRef<Constant *> V) in ConstantStruct()
953 Constant *ConstantStruct::get(StructType *ST, ArrayRef<Constant*> V) { in get()
981 Constant *ConstantStruct::get(StructType *T, ...) { in get()
983 SmallVector<Constant*, 8> Values; in get()
985 while (Constant *Val = va_arg(ap, llvm::Constant*)) in get()
991 ConstantVector::ConstantVector(VectorType *T, ArrayRef<Constant *> V) in ConstantVector()
998 Constant *ConstantVector::get(ArrayRef<Constant*> V) { in get()
999 if (Constant *C = getImpl(V)) in get()
1005 Constant *ConstantVector::getImpl(ArrayRef<Constant*> V) { in getImpl()
1011 Constant *C = V[0]; in getImpl()
1038 Constant *ConstantVector::getSplat(unsigned NumElts, Constant *V) { in getSplat()
1045 SmallVector<Constant*, 32> Elts(NumElts, V); in getSplat()
1114 Constant *
1115 ConstantExpr::getWithOperandReplaced(unsigned OpNo, Constant *Op) const { in getWithOperandReplaced()
1121 SmallVector<Constant*, 8> NewOps; in getWithOperandReplaced()
1128 Constant *ConstantExpr::getWithOperands(ArrayRef<Constant *> Ops, Type *Ty, in getWithOperands()
1296 Constant *Constant::getSplatValue() const { in getSplatValue()
1307 Constant *ConstantVector::getSplatValue() const { in getSplatValue()
1309 Constant *Elt = getOperand(0); in getSplatValue()
1317 const APInt &Constant::getUniqueInteger() const { in getUniqueInteger()
1321 const Constant *C = this->getAggregateElement(0U); in getUniqueInteger()
1372 : Constant(Type::getInt8PtrTy(F->getContext()), Value::BlockAddressVal, in BlockAddress()
1439 static Constant *getFoldedCast(Instruction::CastOps opc, Constant *C, Type *Ty, in getFoldedCast()
1443 if (Constant *FC = ConstantFoldCastInstruction(opc, C, Ty)) in getFoldedCast()
1457 Constant *ConstantExpr::getCast(unsigned oc, Constant *C, Type *Ty, in getCast()
1496 Constant *ConstantExpr::getZExtOrBitCast(Constant *C, Type *Ty) { in getZExtOrBitCast()
1502 Constant *ConstantExpr::getSExtOrBitCast(Constant *C, Type *Ty) { in getSExtOrBitCast()
1508 Constant *ConstantExpr::getTruncOrBitCast(Constant *C, Type *Ty) { in getTruncOrBitCast()
1514 Constant *ConstantExpr::getPointerCast(Constant *S, Type *Ty) { in getPointerCast()
1529 Constant *ConstantExpr::getPointerBitCastOrAddrSpaceCast(Constant *S, in getPointerBitCastOrAddrSpaceCast()
1540 Constant *ConstantExpr::getIntegerCast(Constant *C, Type *Ty, bool isSigned) { in getIntegerCast()
1552 Constant *ConstantExpr::getFPCast(Constant *C, Type *Ty) { in getFPCast()
1564 Constant *ConstantExpr::getTrunc(Constant *C, Type *Ty, bool OnlyIfReduced) { in getTrunc()
1578 Constant *ConstantExpr::getSExt(Constant *C, Type *Ty, bool OnlyIfReduced) { in getSExt()
1592 Constant *ConstantExpr::getZExt(Constant *C, Type *Ty, bool OnlyIfReduced) { in getZExt()
1606 Constant *ConstantExpr::getFPTrunc(Constant *C, Type *Ty, bool OnlyIfReduced) { in getFPTrunc()
1618 Constant *ConstantExpr::getFPExtend(Constant *C, Type *Ty, bool OnlyIfReduced) { in getFPExtend()
1630 Constant *ConstantExpr::getUIToFP(Constant *C, Type *Ty, bool OnlyIfReduced) { in getUIToFP()
1641 Constant *ConstantExpr::getSIToFP(Constant *C, Type *Ty, bool OnlyIfReduced) { in getSIToFP()
1652 Constant *ConstantExpr::getFPToUI(Constant *C, Type *Ty, bool OnlyIfReduced) { in getFPToUI()
1663 Constant *ConstantExpr::getFPToSI(Constant *C, Type *Ty, bool OnlyIfReduced) { in getFPToSI()
1674 Constant *ConstantExpr::getPtrToInt(Constant *C, Type *DstTy, in getPtrToInt()
1687 Constant *ConstantExpr::getIntToPtr(Constant *C, Type *DstTy, in getIntToPtr()
1700 Constant *ConstantExpr::getBitCast(Constant *C, Type *DstTy, in getBitCast()
1712 Constant *ConstantExpr::getAddrSpaceCast(Constant *C, Type *DstTy, in getAddrSpaceCast()
1733 Constant *ConstantExpr::get(unsigned Opcode, Constant *C1, Constant *C2, in get()
1800 if (Constant *FC = ConstantFoldBinaryInstruction(Opcode, C1, C2)) in get()
1806 Constant *ArgVec[] = { C1, C2 }; in get()
1813 Constant *ConstantExpr::getSizeOf(Type* Ty) { in getSizeOf()
1816 Constant *GEPIdx = ConstantInt::get(Type::getInt32Ty(Ty->getContext()), 1); in getSizeOf()
1817 Constant *GEP = getGetElementPtr( in getSizeOf()
1818 Ty, Constant::getNullValue(PointerType::getUnqual(Ty)), GEPIdx); in getSizeOf()
1823 Constant *ConstantExpr::getAlignOf(Type* Ty) { in getAlignOf()
1828 Constant *NullPtr = Constant::getNullValue(AligningTy->getPointerTo(0)); in getAlignOf()
1829 Constant *Zero = ConstantInt::get(Type::getInt64Ty(Ty->getContext()), 0); in getAlignOf()
1830 Constant *One = ConstantInt::get(Type::getInt32Ty(Ty->getContext()), 1); in getAlignOf()
1831 Constant *Indices[2] = { Zero, One }; in getAlignOf()
1832 Constant *GEP = getGetElementPtr(AligningTy, NullPtr, Indices); in getAlignOf()
1837 Constant *ConstantExpr::getOffsetOf(StructType* STy, unsigned FieldNo) { in getOffsetOf()
1842 Constant *ConstantExpr::getOffsetOf(Type* Ty, Constant *FieldNo) { in getOffsetOf()
1845 Constant *GEPIdx[] = { in getOffsetOf()
1849 Constant *GEP = getGetElementPtr( in getOffsetOf()
1850 Ty, Constant::getNullValue(PointerType::getUnqual(Ty)), GEPIdx); in getOffsetOf()
1855 Constant *ConstantExpr::getCompare(unsigned short Predicate, Constant *C1, in getCompare()
1856 Constant *C2, bool OnlyIfReduced) { in getCompare()
1877 Constant *ConstantExpr::getSelect(Constant *C, Constant *V1, Constant *V2, in getSelect()
1881 if (Constant *SC = ConstantFoldSelectInstruction(C, V1, V2)) in getSelect()
1887 Constant *ArgVec[] = { C, V1, V2 }; in getSelect()
1894 Constant *ConstantExpr::getGetElementPtr(Type *Ty, Constant *C, in getGetElementPtr()
1904 if (Constant *FC = ConstantFoldGetElementPtr(Ty, C, InBounds, Idxs)) in getGetElementPtr()
1927 std::vector<Constant*> ArgVec; in getGetElementPtr()
1935 Constant *Idx = cast<Constant>(Idxs[i]); in getGetElementPtr()
1948 Constant *ConstantExpr::getICmp(unsigned short pred, Constant *LHS, in getICmp()
1949 Constant *RHS, bool OnlyIfReduced) { in getICmp()
1954 if (Constant *FC = ConstantFoldCompareInstruction(pred, LHS, RHS)) in getICmp()
1961 Constant *ArgVec[] = { LHS, RHS }; in getICmp()
1973 Constant *ConstantExpr::getFCmp(unsigned short pred, Constant *LHS, in getFCmp()
1974 Constant *RHS, bool OnlyIfReduced) { in getFCmp()
1978 if (Constant *FC = ConstantFoldCompareInstruction(pred, LHS, RHS)) in getFCmp()
1985 Constant *ArgVec[] = { LHS, RHS }; in getFCmp()
1997 Constant *ConstantExpr::getExtractElement(Constant *Val, Constant *Idx, in getExtractElement()
2004 if (Constant *FC = ConstantFoldExtractElementInstruction(Val, Idx)) in getExtractElement()
2012 Constant *ArgVec[] = { Val, Idx }; in getExtractElement()
2019 Constant *ConstantExpr::getInsertElement(Constant *Val, Constant *Elt, in getInsertElement()
2020 Constant *Idx, Type *OnlyIfReducedTy) { in getInsertElement()
2028 if (Constant *FC = ConstantFoldInsertElementInstruction(Val, Elt, Idx)) in getInsertElement()
2035 Constant *ArgVec[] = { Val, Elt, Idx }; in getInsertElement()
2042 Constant *ConstantExpr::getShuffleVector(Constant *V1, Constant *V2, in getShuffleVector()
2043 Constant *Mask, Type *OnlyIfReducedTy) { in getShuffleVector()
2047 if (Constant *FC = ConstantFoldShuffleVectorInstruction(V1, V2, Mask)) in getShuffleVector()
2058 Constant *ArgVec[] = { V1, V2, Mask }; in getShuffleVector()
2065 Constant *ConstantExpr::getInsertValue(Constant *Agg, Constant *Val, in getInsertValue()
2076 if (Constant *FC = ConstantFoldInsertValueInstruction(Agg, Val, Idxs)) in getInsertValue()
2082 Constant *ArgVec[] = { Agg, Val }; in getInsertValue()
2089 Constant *ConstantExpr::getExtractValue(Constant *Agg, ArrayRef<unsigned> Idxs, in getExtractValue()
2100 if (Constant *FC = ConstantFoldExtractValueInstruction(Agg, Idxs)) in getExtractValue()
2106 Constant *ArgVec[] = { Agg }; in getExtractValue()
2113 Constant *ConstantExpr::getNeg(Constant *C, bool HasNUW, bool HasNSW) { in getNeg()
2120 Constant *ConstantExpr::getFNeg(Constant *C) { in getFNeg()
2126 Constant *ConstantExpr::getNot(Constant *C) { in getNot()
2129 return get(Instruction::Xor, C, Constant::getAllOnesValue(C->getType())); in getNot()
2132 Constant *ConstantExpr::getAdd(Constant *C1, Constant *C2, in getAdd()
2139 Constant *ConstantExpr::getFAdd(Constant *C1, Constant *C2) { in getFAdd()
2143 Constant *ConstantExpr::getSub(Constant *C1, Constant *C2, in getSub()
2150 Constant *ConstantExpr::getFSub(Constant *C1, Constant *C2) { in getFSub()
2154 Constant *ConstantExpr::getMul(Constant *C1, Constant *C2, in getMul()
2161 Constant *ConstantExpr::getFMul(Constant *C1, Constant *C2) { in getFMul()
2165 Constant *ConstantExpr::getUDiv(Constant *C1, Constant *C2, bool isExact) { in getUDiv()
2170 Constant *ConstantExpr::getSDiv(Constant *C1, Constant *C2, bool isExact) { in getSDiv()
2175 Constant *ConstantExpr::getFDiv(Constant *C1, Constant *C2) { in getFDiv()
2179 Constant *ConstantExpr::getURem(Constant *C1, Constant *C2) { in getURem()
2183 Constant *ConstantExpr::getSRem(Constant *C1, Constant *C2) { in getSRem()
2187 Constant *ConstantExpr::getFRem(Constant *C1, Constant *C2) { in getFRem()
2191 Constant *ConstantExpr::getAnd(Constant *C1, Constant *C2) { in getAnd()
2195 Constant *ConstantExpr::getOr(Constant *C1, Constant *C2) { in getOr()
2199 Constant *ConstantExpr::getXor(Constant *C1, Constant *C2) { in getXor()
2203 Constant *ConstantExpr::getShl(Constant *C1, Constant *C2, in getShl()
2210 Constant *ConstantExpr::getLShr(Constant *C1, Constant *C2, bool isExact) { in getLShr()
2215 Constant *ConstantExpr::getAShr(Constant *C1, Constant *C2, bool isExact) { in getAShr()
2220 Constant *ConstantExpr::getBinOpIdentity(unsigned Opcode, Type *Ty) { in getBinOpIdentity()
2229 return Constant::getNullValue(Ty); in getBinOpIdentity()
2235 return Constant::getAllOnesValue(Ty); in getBinOpIdentity()
2239 Constant *ConstantExpr::getBinOpAbsorber(unsigned Opcode, Type *Ty) { in getBinOpAbsorber()
2246 return Constant::getAllOnesValue(Ty); in getBinOpAbsorber()
2250 return Constant::getNullValue(Ty); in getBinOpAbsorber()
2264 Type *SrcElementTy, Constant *C, ArrayRef<Constant *> IdxList, Type *DestTy) in GetElementPtrConstantExpr()
2344 Constant *ConstantDataSequential::getImpl(StringRef Elements, Type *Ty) { in getImpl()
2416 Constant *ConstantDataArray::get(LLVMContext &Context, ArrayRef<uint8_t> Elts) { in get()
2421 Constant *ConstantDataArray::get(LLVMContext &Context, ArrayRef<uint16_t> Elts){ in get()
2426 Constant *ConstantDataArray::get(LLVMContext &Context, ArrayRef<uint32_t> Elts){ in get()
2431 Constant *ConstantDataArray::get(LLVMContext &Context, ArrayRef<uint64_t> Elts){ in get()
2436 Constant *ConstantDataArray::get(LLVMContext &Context, ArrayRef<float> Elts) { in get()
2441 Constant *ConstantDataArray::get(LLVMContext &Context, ArrayRef<double> Elts) { in get()
2452 Constant *ConstantDataArray::getFP(LLVMContext &Context, in getFP()
2458 Constant *ConstantDataArray::getFP(LLVMContext &Context, in getFP()
2464 Constant *ConstantDataArray::getFP(LLVMContext &Context, in getFP()
2471 Constant *ConstantDataArray::getString(LLVMContext &Context, in getString()
2488 Constant *ConstantDataVector::get(LLVMContext &Context, ArrayRef<uint8_t> Elts){ in get()
2493 Constant *ConstantDataVector::get(LLVMContext &Context, ArrayRef<uint16_t> Elts){ in get()
2498 Constant *ConstantDataVector::get(LLVMContext &Context, ArrayRef<uint32_t> Elts){ in get()
2503 Constant *ConstantDataVector::get(LLVMContext &Context, ArrayRef<uint64_t> Elts){ in get()
2508 Constant *ConstantDataVector::get(LLVMContext &Context, ArrayRef<float> Elts) { in get()
2513 Constant *ConstantDataVector::get(LLVMContext &Context, ArrayRef<double> Elts) { in get()
2524 Constant *ConstantDataVector::getFP(LLVMContext &Context, in getFP()
2530 Constant *ConstantDataVector::getFP(LLVMContext &Context, in getFP()
2536 Constant *ConstantDataVector::getFP(LLVMContext &Context, in getFP()
2543 Constant *ConstantDataVector::getSplat(unsigned NumElts, Constant *V) { in getSplat()
2641 Constant *ConstantDataSequential::getElementAsConstant(unsigned Elt) const { in getElementAsConstant()
2666 Constant *ConstantDataVector::getSplatValue() const { in getSplatValue()
2693 void Constant::handleOperandChange(Value *From, Value *To) { in handleOperandChange()
2721 assert(isa<Constant>(To) && "Cannot make Constant refer to non-constant!"); in handleOperandChangeImpl()
2722 Constant *ToC = cast<Constant>(To); in handleOperandChangeImpl()
2724 SmallVector<Constant*, 8> Values; in handleOperandChangeImpl()
2736 Constant *Val = cast<Constant>(O->get()); in handleOperandChangeImpl()
2753 if (Constant *C = getImpl(getType(), Values)) in handleOperandChangeImpl()
2762 assert(isa<Constant>(To) && "Cannot make Constant refer to non-constant!"); in handleOperandChangeImpl()
2763 Constant *ToC = cast<Constant>(To); in handleOperandChangeImpl()
2767 SmallVector<Constant*, 8> Values; in handleOperandChangeImpl()
2776 Constant *Val = cast<Constant>(O->get()); in handleOperandChangeImpl()
2798 assert(isa<Constant>(To) && "Cannot make Constant refer to non-constant!"); in handleOperandChangeImpl()
2799 Constant *ToC = cast<Constant>(To); in handleOperandChangeImpl()
2801 SmallVector<Constant*, 8> Values; in handleOperandChangeImpl()
2806 Constant *Val = getOperand(i); in handleOperandChangeImpl()
2815 if (Constant *C = getImpl(Values)) in handleOperandChangeImpl()
2824 assert(isa<Constant>(ToV) && "Cannot make Constant refer to non-constant!"); in handleOperandChangeImpl()
2825 Constant *To = cast<Constant>(ToV); in handleOperandChangeImpl()
2827 SmallVector<Constant*, 8> NewOps; in handleOperandChangeImpl()
2831 Constant *Op = getOperand(i); in handleOperandChangeImpl()
2841 if (Constant *C = getWithOperands(NewOps, getType(), true)) in handleOperandChangeImpl()