• Home
  • Raw
  • Download

Lines Matching refs:Constant

43 void Constant::anchor() { }  in anchor()
45 bool Constant::isNegativeZeroValue() const { in isNegativeZeroValue()
66 bool Constant::isZeroValue() const { in isZeroValue()
75 bool Constant::isNullValue() const { in isNullValue()
88 bool Constant::isAllOnesValue() const { in isAllOnesValue()
99 if (Constant *Splat = CV->getSplatValue()) in isAllOnesValue()
104 if (Constant *Splat = CV->getSplatValue()) in isAllOnesValue()
111 Constant *Constant::getNullValue(Type *Ty) { in getNullValue()
146 Constant *Constant::getIntegerValue(Type *Ty, const APInt &V) { in getIntegerValue()
150 Constant *C = ConstantInt::get(Ty->getContext(), V); in getIntegerValue()
163 Constant *Constant::getAllOnesValue(Type *Ty) { in getAllOnesValue()
183 Constant *Constant::getAggregateElement(unsigned Elt) const { in getAggregateElement()
204 Constant *Constant::getAggregateElement(Constant *Elt) const { in getAggregateElement()
212 void Constant::destroyConstantImpl() { in destroyConstantImpl()
223 if (!isa<Constant>(V)) { in destroyConstantImpl()
229 assert(isa<Constant>(V) && "References remain to Constant being destroyed"); in destroyConstantImpl()
230 cast<Constant>(V)->destroyConstant(); in destroyConstantImpl()
240 static bool canTrapImpl(const Constant *C, in canTrapImpl()
275 bool Constant::canTrap() const { in canTrap()
281 bool Constant::isThreadDependent() const { in isThreadDependent()
282 SmallPtrSet<const Constant*, 64> Visited; in isThreadDependent()
283 SmallVector<const Constant*, 64> WorkList; in isThreadDependent()
288 const Constant *C = WorkList.pop_back_val(); in isThreadDependent()
296 const Constant *D = dyn_cast<Constant>(C->getOperand(I)); in isThreadDependent()
309 bool Constant::isConstantUsed() const { in isConstantUsed()
311 const Constant *UC = dyn_cast<Constant>(*UI); in isConstantUsed()
337 Constant::PossibleRelocationsTy Constant::getRelocationInfo() const { in getRelocationInfo()
368 cast<Constant>(getOperand(i))->getRelocationInfo()); in getRelocationInfo()
376 static bool removeDeadUsersOfConstant(const Constant *C) { in removeDeadUsersOfConstant()
380 const Constant *User = dyn_cast<Constant>(C->use_back()); in removeDeadUsersOfConstant()
386 const_cast<Constant*>(C)->destroyConstant(); in removeDeadUsersOfConstant()
395 void Constant::removeDeadConstantUsers() const { in removeDeadConstantUsers()
399 const Constant *User = dyn_cast<Constant>(*I); in removeDeadConstantUsers()
434 : Constant(Ty, ConstantIntVal, 0, 0), Val(V) { in ConstantInt()
452 Constant *ConstantInt::getTrue(Type *Ty) { in getTrue()
464 Constant *ConstantInt::getFalse(Type *Ty) { in getFalse()
492 Constant *ConstantInt::get(Type *Ty, uint64_t V, bool isSigned) { in get()
493 Constant *C = get(cast<IntegerType>(Ty->getScalarType()), V, isSigned); in get()
511 Constant *ConstantInt::getSigned(Type *Ty, int64_t V) { in getSigned()
515 Constant *ConstantInt::get(Type *Ty, const APInt& V) { in get()
557 Constant *ConstantFP::get(Type *Ty, double V) { in get()
564 Constant *C = get(Context, FV); in get()
574 Constant *ConstantFP::get(Type *Ty, StringRef Str) { in get()
578 Constant *C = get(Context, FV); in get()
590 APFloat apf = cast<ConstantFP>(Constant::getNullValue(Ty))->getValueAPF(); in getNegativeZero()
596 Constant *ConstantFP::getZeroValueForNegation(Type *Ty) { in getZeroValueForNegation()
599 Constant *C = getNegativeZero(ScalarTy); in getZeroValueForNegation()
605 return Constant::getNullValue(Ty); in getZeroValueForNegation()
645 : Constant(Ty, ConstantFPVal, 0, 0), Val(V) { in ConstantFP()
660 Constant *ConstantAggregateZero::getSequentialElement() const { in getSequentialElement()
661 return Constant::getNullValue(getType()->getSequentialElementType()); in getSequentialElement()
666 Constant *ConstantAggregateZero::getStructElement(unsigned Elt) const { in getStructElement()
667 return Constant::getNullValue(getType()->getStructElementType(Elt)); in getStructElement()
672 Constant *ConstantAggregateZero::getElementValue(Constant *C) const { in getElementValue()
680 Constant *ConstantAggregateZero::getElementValue(unsigned Idx) const { in getElementValue()
705 UndefValue *UndefValue::getElementValue(Constant *C) const { in getElementValue()
733 ConstantArray::ConstantArray(ArrayType *T, ArrayRef<Constant *> V) in ConstantArray()
734 : Constant(T, ConstantArrayVal, in ConstantArray()
745 Constant *ConstantArray::get(ArrayType *Ty, ArrayRef<Constant*> V) { in get()
759 Constant *C = V[0]; in get()
842 ArrayRef<Constant*> V, in getTypeForElements()
853 StructType *ConstantStruct::getTypeForElements(ArrayRef<Constant*> V, in getTypeForElements()
861 ConstantStruct::ConstantStruct(StructType *T, ArrayRef<Constant *> V) in ConstantStruct()
862 : Constant(T, ConstantStructVal, in ConstantStruct()
874 Constant *ConstantStruct::get(StructType *ST, ArrayRef<Constant*> V) { in get()
902 Constant *ConstantStruct::get(StructType *T, ...) { in get()
904 SmallVector<Constant*, 8> Values; in get()
906 while (Constant *Val = va_arg(ap, llvm::Constant*)) in get()
912 ConstantVector::ConstantVector(VectorType *T, ArrayRef<Constant *> V) in ConstantVector()
913 : Constant(T, ConstantVectorVal, in ConstantVector()
923 Constant *ConstantVector::get(ArrayRef<Constant*> V) { in get()
930 Constant *C = V[0]; in get()
1021 Constant *ConstantVector::getSplat(unsigned NumElts, Constant *V) { in getSplat()
1028 SmallVector<Constant*, 32> Elts(NumElts, V); in getSplat()
1089 Constant *
1090 ConstantExpr::getWithOperandReplaced(unsigned OpNo, Constant *Op) const { in getWithOperandReplaced()
1096 SmallVector<Constant*, 8> NewOps; in getWithOperandReplaced()
1106 Constant *ConstantExpr::
1107 getWithOperands(ArrayRef<Constant*> Ops, Type *Ty) const { in getWithOperands()
1275 Constant *Constant::getSplatValue() const { in getSplatValue()
1288 Constant *ConstantVector::getSplatValue() const { in getSplatValue()
1290 Constant *Elt = getOperand(0); in getSplatValue()
1300 const APInt &Constant::getUniqueInteger() const { in getUniqueInteger()
1304 const Constant *C = this->getAggregateElement(0U); in getUniqueInteger()
1368 : Constant(Type::getInt8PtrTy(F->getContext()), Value::BlockAddressVal, in BlockAddress()
1428 static inline Constant *getFoldedCast( in getFoldedCast()
1429 Instruction::CastOps opc, Constant *C, Type *Ty) { in getFoldedCast()
1432 if (Constant *FC = ConstantFoldCastInstruction(opc, C, Ty)) in getFoldedCast()
1443 Constant *ConstantExpr::getCast(unsigned oc, Constant *C, Type *Ty) { in getCast()
1467 Constant *ConstantExpr::getZExtOrBitCast(Constant *C, Type *Ty) { in getZExtOrBitCast()
1473 Constant *ConstantExpr::getSExtOrBitCast(Constant *C, Type *Ty) { in getSExtOrBitCast()
1479 Constant *ConstantExpr::getTruncOrBitCast(Constant *C, Type *Ty) { in getTruncOrBitCast()
1485 Constant *ConstantExpr::getPointerCast(Constant *S, Type *Ty) { in getPointerCast()
1495 Constant *ConstantExpr::getIntegerCast(Constant *C, Type *Ty, in getIntegerCast()
1508 Constant *ConstantExpr::getFPCast(Constant *C, Type *Ty) { in getFPCast()
1520 Constant *ConstantExpr::getTrunc(Constant *C, Type *Ty) { in getTrunc()
1534 Constant *ConstantExpr::getSExt(Constant *C, Type *Ty) { in getSExt()
1548 Constant *ConstantExpr::getZExt(Constant *C, Type *Ty) { in getZExt()
1562 Constant *ConstantExpr::getFPTrunc(Constant *C, Type *Ty) { in getFPTrunc()
1574 Constant *ConstantExpr::getFPExtend(Constant *C, Type *Ty) { in getFPExtend()
1586 Constant *ConstantExpr::getUIToFP(Constant *C, Type *Ty) { in getUIToFP()
1597 Constant *ConstantExpr::getSIToFP(Constant *C, Type *Ty) { in getSIToFP()
1608 Constant *ConstantExpr::getFPToUI(Constant *C, Type *Ty) { in getFPToUI()
1619 Constant *ConstantExpr::getFPToSI(Constant *C, Type *Ty) { in getFPToSI()
1630 Constant *ConstantExpr::getPtrToInt(Constant *C, Type *DstTy) { in getPtrToInt()
1642 Constant *ConstantExpr::getIntToPtr(Constant *C, Type *DstTy) { in getIntToPtr()
1654 Constant *ConstantExpr::getBitCast(Constant *C, Type *DstTy) { in getBitCast()
1665 Constant *ConstantExpr::get(unsigned Opcode, Constant *C1, Constant *C2, in get()
1732 if (Constant *FC = ConstantFoldBinaryInstruction(Opcode, C1, C2)) in get()
1735 Constant *ArgVec[] = { C1, C2 }; in get()
1742 Constant *ConstantExpr::getSizeOf(Type* Ty) { in getSizeOf()
1745 Constant *GEPIdx = ConstantInt::get(Type::getInt32Ty(Ty->getContext()), 1); in getSizeOf()
1746 Constant *GEP = getGetElementPtr( in getSizeOf()
1747 Constant::getNullValue(PointerType::getUnqual(Ty)), GEPIdx); in getSizeOf()
1752 Constant *ConstantExpr::getAlignOf(Type* Ty) { in getAlignOf()
1757 Constant *NullPtr = Constant::getNullValue(AligningTy->getPointerTo()); in getAlignOf()
1758 Constant *Zero = ConstantInt::get(Type::getInt64Ty(Ty->getContext()), 0); in getAlignOf()
1759 Constant *One = ConstantInt::get(Type::getInt32Ty(Ty->getContext()), 1); in getAlignOf()
1760 Constant *Indices[2] = { Zero, One }; in getAlignOf()
1761 Constant *GEP = getGetElementPtr(NullPtr, Indices); in getAlignOf()
1766 Constant *ConstantExpr::getOffsetOf(StructType* STy, unsigned FieldNo) { in getOffsetOf()
1771 Constant *ConstantExpr::getOffsetOf(Type* Ty, Constant *FieldNo) { in getOffsetOf()
1774 Constant *GEPIdx[] = { in getOffsetOf()
1778 Constant *GEP = getGetElementPtr( in getOffsetOf()
1779 Constant::getNullValue(PointerType::getUnqual(Ty)), GEPIdx); in getOffsetOf()
1784 Constant *ConstantExpr::getCompare(unsigned short Predicate, in getCompare()
1785 Constant *C1, Constant *C2) { in getCompare()
1806 Constant *ConstantExpr::getSelect(Constant *C, Constant *V1, Constant *V2) { in getSelect()
1809 if (Constant *SC = ConstantFoldSelectInstruction(C, V1, V2)) in getSelect()
1812 Constant *ArgVec[] = { C, V1, V2 }; in getSelect()
1819 Constant *ConstantExpr::getGetElementPtr(Constant *C, ArrayRef<Value *> Idxs, in getGetElementPtr()
1824 if (Constant *FC = ConstantFoldGetElementPtr(C, InBounds, Idxs)) in getGetElementPtr()
1836 std::vector<Constant*> ArgVec; in getGetElementPtr()
1846 ArgVec.push_back(cast<Constant>(Idxs[i])); in getGetElementPtr()
1855 Constant *
1856 ConstantExpr::getICmp(unsigned short pred, Constant *LHS, Constant *RHS) { in getICmp()
1861 if (Constant *FC = ConstantFoldCompareInstruction(pred, LHS, RHS)) in getICmp()
1865 Constant *ArgVec[] = { LHS, RHS }; in getICmp()
1877 Constant *
1878 ConstantExpr::getFCmp(unsigned short pred, Constant *LHS, Constant *RHS) { in getFCmp()
1882 if (Constant *FC = ConstantFoldCompareInstruction(pred, LHS, RHS)) in getFCmp()
1886 Constant *ArgVec[] = { LHS, RHS }; in getFCmp()
1898 Constant *ConstantExpr::getExtractElement(Constant *Val, Constant *Idx) { in getExtractElement()
1904 if (Constant *FC = ConstantFoldExtractElementInstruction(Val, Idx)) in getExtractElement()
1908 Constant *ArgVec[] = { Val, Idx }; in getExtractElement()
1916 Constant *ConstantExpr::getInsertElement(Constant *Val, Constant *Elt, in getInsertElement()
1917 Constant *Idx) { in getInsertElement()
1925 if (Constant *FC = ConstantFoldInsertElementInstruction(Val, Elt, Idx)) in getInsertElement()
1928 Constant *ArgVec[] = { Val, Elt, Idx }; in getInsertElement()
1935 Constant *ConstantExpr::getShuffleVector(Constant *V1, Constant *V2, in getShuffleVector()
1936 Constant *Mask) { in getShuffleVector()
1940 if (Constant *FC = ConstantFoldShuffleVectorInstruction(V1, V2, Mask)) in getShuffleVector()
1948 Constant *ArgVec[] = { V1, V2, Mask }; in getShuffleVector()
1955 Constant *ConstantExpr::getInsertValue(Constant *Agg, Constant *Val, in getInsertValue()
1965 if (Constant *FC = ConstantFoldInsertValueInstruction(Agg, Val, Idxs)) in getInsertValue()
1968 Constant *ArgVec[] = { Agg, Val }; in getInsertValue()
1975 Constant *ConstantExpr::getExtractValue(Constant *Agg, in getExtractValue()
1986 if (Constant *FC = ConstantFoldExtractValueInstruction(Agg, Idxs)) in getExtractValue()
1989 Constant *ArgVec[] = { Agg }; in getExtractValue()
1996 Constant *ConstantExpr::getNeg(Constant *C, bool HasNUW, bool HasNSW) { in getNeg()
2003 Constant *ConstantExpr::getFNeg(Constant *C) { in getFNeg()
2009 Constant *ConstantExpr::getNot(Constant *C) { in getNot()
2012 return get(Instruction::Xor, C, Constant::getAllOnesValue(C->getType())); in getNot()
2015 Constant *ConstantExpr::getAdd(Constant *C1, Constant *C2, in getAdd()
2022 Constant *ConstantExpr::getFAdd(Constant *C1, Constant *C2) { in getFAdd()
2026 Constant *ConstantExpr::getSub(Constant *C1, Constant *C2, in getSub()
2033 Constant *ConstantExpr::getFSub(Constant *C1, Constant *C2) { in getFSub()
2037 Constant *ConstantExpr::getMul(Constant *C1, Constant *C2, in getMul()
2044 Constant *ConstantExpr::getFMul(Constant *C1, Constant *C2) { in getFMul()
2048 Constant *ConstantExpr::getUDiv(Constant *C1, Constant *C2, bool isExact) { in getUDiv()
2053 Constant *ConstantExpr::getSDiv(Constant *C1, Constant *C2, bool isExact) { in getSDiv()
2058 Constant *ConstantExpr::getFDiv(Constant *C1, Constant *C2) { in getFDiv()
2062 Constant *ConstantExpr::getURem(Constant *C1, Constant *C2) { in getURem()
2066 Constant *ConstantExpr::getSRem(Constant *C1, Constant *C2) { in getSRem()
2070 Constant *ConstantExpr::getFRem(Constant *C1, Constant *C2) { in getFRem()
2074 Constant *ConstantExpr::getAnd(Constant *C1, Constant *C2) { in getAnd()
2078 Constant *ConstantExpr::getOr(Constant *C1, Constant *C2) { in getOr()
2082 Constant *ConstantExpr::getXor(Constant *C1, Constant *C2) { in getXor()
2086 Constant *ConstantExpr::getShl(Constant *C1, Constant *C2, in getShl()
2093 Constant *ConstantExpr::getLShr(Constant *C1, Constant *C2, bool isExact) { in getLShr()
2098 Constant *ConstantExpr::getAShr(Constant *C1, Constant *C2, bool isExact) { in getAShr()
2106 Constant *ConstantExpr::getBinOpIdentity(unsigned Opcode, Type *Ty) { in getBinOpIdentity()
2115 return Constant::getNullValue(Ty); in getBinOpIdentity()
2121 return Constant::getAllOnesValue(Ty); in getBinOpIdentity()
2129 Constant *ConstantExpr::getBinOpAbsorber(unsigned Opcode, Type *Ty) { in getBinOpAbsorber()
2136 return Constant::getAllOnesValue(Ty); in getBinOpAbsorber()
2140 return Constant::getNullValue(Ty); in getBinOpAbsorber()
2158 GetElementPtrConstantExpr(Constant *C, ArrayRef<Constant*> IdxList, in GetElementPtrConstantExpr()
2234 Constant *ConstantDataSequential::getImpl(StringRef Elements, Type *Ty) { in getImpl()
2307 Constant *ConstantDataArray::get(LLVMContext &Context, ArrayRef<uint8_t> Elts) { in get()
2312 Constant *ConstantDataArray::get(LLVMContext &Context, ArrayRef<uint16_t> Elts){ in get()
2317 Constant *ConstantDataArray::get(LLVMContext &Context, ArrayRef<uint32_t> Elts){ in get()
2322 Constant *ConstantDataArray::get(LLVMContext &Context, ArrayRef<uint64_t> Elts){ in get()
2327 Constant *ConstantDataArray::get(LLVMContext &Context, ArrayRef<float> Elts) { in get()
2332 Constant *ConstantDataArray::get(LLVMContext &Context, ArrayRef<double> Elts) { in get()
2343 Constant *ConstantDataArray::getString(LLVMContext &Context, in getString()
2360 Constant *ConstantDataVector::get(LLVMContext &Context, ArrayRef<uint8_t> Elts){ in get()
2365 Constant *ConstantDataVector::get(LLVMContext &Context, ArrayRef<uint16_t> Elts){ in get()
2370 Constant *ConstantDataVector::get(LLVMContext &Context, ArrayRef<uint32_t> Elts){ in get()
2375 Constant *ConstantDataVector::get(LLVMContext &Context, ArrayRef<uint64_t> Elts){ in get()
2380 Constant *ConstantDataVector::get(LLVMContext &Context, ArrayRef<float> Elts) { in get()
2385 Constant *ConstantDataVector::get(LLVMContext &Context, ArrayRef<double> Elts) { in get()
2391 Constant *ConstantDataVector::getSplat(unsigned NumElts, Constant *V) { in getSplat()
2490 Constant *ConstantDataSequential::getElementAsConstant(unsigned Elt) const { in getElementAsConstant()
2519 Constant *ConstantDataVector::getSplatValue() const { in getSplatValue()
2548 assert(isa<Constant>(To) && "Cannot make Constant refer to non-constant!"); in replaceUsesOfWithOnConstant()
2549 Constant *ToC = cast<Constant>(To); in replaceUsesOfWithOnConstant()
2553 SmallVector<Constant*, 8> Values; in replaceUsesOfWithOnConstant()
2565 Constant *Val = cast<Constant>(O->get()); in replaceUsesOfWithOnConstant()
2574 Constant *Replacement = 0; in replaceUsesOfWithOnConstant()
2623 assert(isa<Constant>(To) && "Cannot make Constant refer to non-constant!"); in replaceUsesOfWithOnConstant()
2624 Constant *ToC = cast<Constant>(To); in replaceUsesOfWithOnConstant()
2629 SmallVector<Constant*, 8> Values; in replaceUsesOfWithOnConstant()
2641 Constant *Val = cast<Constant>(O->get()); in replaceUsesOfWithOnConstant()
2648 Constant *Val = cast<Constant>(O->get()); in replaceUsesOfWithOnConstant()
2654 Values.push_back(cast<Constant>(O->get())); in replaceUsesOfWithOnConstant()
2660 Constant *Replacement = 0; in replaceUsesOfWithOnConstant()
2698 assert(isa<Constant>(To) && "Cannot make Constant refer to non-constant!"); in replaceUsesOfWithOnConstant()
2700 SmallVector<Constant*, 8> Values; in replaceUsesOfWithOnConstant()
2703 Constant *Val = getOperand(i); in replaceUsesOfWithOnConstant()
2704 if (Val == From) Val = cast<Constant>(To); in replaceUsesOfWithOnConstant()
2708 Constant *Replacement = get(Values); in replaceUsesOfWithOnConstant()
2720 assert(isa<Constant>(ToV) && "Cannot make Constant refer to non-constant!"); in replaceUsesOfWithOnConstant()
2721 Constant *To = cast<Constant>(ToV); in replaceUsesOfWithOnConstant()
2723 SmallVector<Constant*, 8> NewOps; in replaceUsesOfWithOnConstant()
2725 Constant *Op = getOperand(i); in replaceUsesOfWithOnConstant()
2729 Constant *Replacement = getWithOperands(NewOps); in replaceUsesOfWithOnConstant()