Lines Matching defs:ConstantInt
41 cl::desc("Use ConstantInt's native fixed-length vector splat support."));
47 cl::desc("Use ConstantInt's native scalable vector splat support."));
92 if (const ConstantInt *CI = dyn_cast<ConstantInt>(this))
109 if (const ConstantInt *CI = dyn_cast<ConstantInt>(this))
126 if (const ConstantInt *CI = dyn_cast<ConstantInt>(this))
143 if (const ConstantInt *CI = dyn_cast<ConstantInt>(this))
171 if (const ConstantInt *CI = dyn_cast<ConstantInt>(this))
188 if (const ConstantInt *CI = dyn_cast<ConstantInt>(this))
361 if (isa<ConstantInt>(this) || isa<ConstantFP>(this))
376 return ConstantInt::get(Ty, 0);
407 Constant *C = ConstantInt::get(Ty->getContext(), V);
422 return ConstantInt::get(Ty->getContext(),
447 if (const auto *CI = dyn_cast<ConstantInt>(this))
451 ? ConstantInt::get(getContext(), CI->getValue())
480 if (ConstantInt *CI = dyn_cast<ConstantInt>(Elt)) {
532 delete static_cast<ConstantInt *>(C);
856 // ConstantInt
859 ConstantInt::ConstantInt(Type *Ty, const APInt &V)
866 ConstantInt *ConstantInt::getTrue(LLVMContext &Context) {
869 pImpl->TheTrueVal = ConstantInt::get(Type::getInt1Ty(Context), 1);
873 ConstantInt *ConstantInt::getFalse(LLVMContext &Context) {
876 pImpl->TheFalseVal = ConstantInt::get(Type::getInt1Ty(Context), 0);
880 ConstantInt *ConstantInt::getBool(LLVMContext &Context, bool V) {
884 Constant *ConstantInt::getTrue(Type *Ty) {
886 ConstantInt *TrueC = ConstantInt::getTrue(Ty->getContext());
892 Constant *ConstantInt::getFalse(Type *Ty) {
894 ConstantInt *FalseC = ConstantInt::getFalse(Ty->getContext());
900 Constant *ConstantInt::getBool(Type *Ty, bool V) {
904 // Get a ConstantInt from an APInt.
905 ConstantInt *ConstantInt::get(LLVMContext &Context, const APInt &V) {
908 std::unique_ptr<ConstantInt> &Slot =
915 Slot.reset(new ConstantInt(ITy, V));
921 // Get a ConstantInt vector with each lane set to the same APInt.
922 ConstantInt *ConstantInt::get(LLVMContext &Context, ElementCount EC,
925 std::unique_ptr<ConstantInt> &Slot =
930 Slot.reset(new ConstantInt(VTy, V));
941 Constant *ConstantInt::get(Type *Ty, uint64_t V, bool isSigned) {
951 ConstantInt *ConstantInt::get(IntegerType *Ty, uint64_t V, bool isSigned) {
958 Constant *ConstantInt::get(Type *Ty, const APInt& V) {
959 ConstantInt *C = get(Ty->getContext(), V);
961 "ConstantInt type doesn't match the type implied by its value!");
970 ConstantInt *ConstantInt::get(IntegerType* Ty, StringRef Str, uint8_t radix) {
975 void ConstantInt::destroyConstantImpl() {
976 llvm_unreachable("You can't ConstantInt->destroyConstantImpl()!");
1145 return getStructElement(cast<ConstantInt>(C)->getZExtValue());
1180 return getStructElement(cast<ConstantInt>(C)->getZExtValue());
1215 return getStructElement(cast<ConstantInt>(C)->getZExtValue());
1242 if (auto *CI = dyn_cast<ConstantInt>(C))
1268 if (ConstantInt *CI = dyn_cast<ConstantInt>(C)) {
1342 // Check to see if all of the elements are ConstantFP or ConstantInt and if
1439 bool isSplatInt = UseConstantIntForFixedLengthSplat && isa<ConstantInt>(C);
1459 return ConstantInt::get(C->getContext(), T->getElementCount(),
1460 cast<ConstantInt>(C)->getValue());
1462 // Check to see if all of the elements are ConstantFP or ConstantInt and if
1476 if (UseConstantIntForFixedLengthSplat && isa<ConstantInt>(V))
1477 return ConstantInt::get(V->getContext(), EC,
1478 cast<ConstantInt>(V)->getValue());
1486 if ((isa<ConstantFP>(V) || isa<ConstantInt>(V)) &&
1496 if (UseConstantIntForScalableSplat && isa<ConstantInt>(V))
1497 return ConstantInt::get(V->getContext(), EC,
1498 cast<ConstantInt>(V)->getValue());
1515 V = ConstantExpr::getInsertElement(PoisonV, V, ConstantInt::get(IdxTy, 0));
1597 bool ConstantInt::isValueValidForType(Type *Ty, uint64_t Val) {
1604 bool ConstantInt::isValueValidForType(Type *Ty, int64_t Val) {
1712 if (auto *CI = dyn_cast<ConstantInt>(this))
1713 return ConstantInt::get(getContext(), CI->getValue());
1733 ConstantInt *Index = dyn_cast<ConstantInt>(IElt->getOperand(2));
1772 if (const ConstantInt *CI = dyn_cast<ConstantInt>(this))
1776 return cast<ConstantInt>(this->getSplatValue())->getValue();
1781 assert(C && isa<ConstantInt>(C) && "Not a vector of numbers!");
1782 return cast<ConstantInt>(C)->getValue();
1786 if (auto *CI = dyn_cast<ConstantInt>(this))
1793 if (auto *CI = dyn_cast_or_null<ConstantInt>(
1812 auto *CI = dyn_cast<ConstantInt>(Elem);
2072 ConstantPtrAuth *ConstantPtrAuth::get(Constant *Ptr, ConstantInt *Key,
2073 ConstantInt *Disc, Constant *AddrDisc) {
2084 ConstantPtrAuth::ConstantPtrAuth(Constant *Ptr, ConstantInt *Key,
2085 ConstantInt *Disc, Constant *AddrDisc)
2132 const auto *IntVal = dyn_cast<ConstantInt>(CastV->getOperand(0));
2483 Constant *GEPIdx = ConstantInt::get(Type::getInt32Ty(Ty->getContext()), 1);
2497 Constant *Zero = ConstantInt::get(Type::getInt64Ty(Ty->getContext()), 0);
2498 Constant *One = ConstantInt::get(Type::getInt32Ty(Ty->getContext()), 1);
2629 return getSub(ConstantInt::get(C->getType(), 0), C, /*HasNUW=*/false, HasNSW);
2667 return ConstantInt::get(Ty, IVal->logBase2());
2686 Elts.push_back(ConstantInt::get(Ty->getScalarType(), IVal->logBase2()));
2704 return ConstantInt::get(Ty, 1);
2729 return ConstantInt::get(Ty, 1);
3071 if (ConstantInt *CI = dyn_cast<ConstantInt>(V)) {
3205 return ConstantInt::get(getElementType(), getElementAsInteger(Elt));