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))
373 return ConstantInt::get(Ty, 0);
404 Constant *C = ConstantInt::get(Ty->getContext(), V);
419 return ConstantInt::get(Ty->getContext(),
463 if (ConstantInt *CI = dyn_cast<ConstantInt>(Elt)) {
515 delete static_cast<ConstantInt *>(C);
840 // ConstantInt
843 ConstantInt::ConstantInt(Type *Ty, const APInt &V)
850 ConstantInt *ConstantInt::getTrue(LLVMContext &Context) {
853 pImpl->TheTrueVal = ConstantInt::get(Type::getInt1Ty(Context), 1);
857 ConstantInt *ConstantInt::getFalse(LLVMContext &Context) {
860 pImpl->TheFalseVal = ConstantInt::get(Type::getInt1Ty(Context), 0);
864 ConstantInt *ConstantInt::getBool(LLVMContext &Context, bool V) {
868 Constant *ConstantInt::getTrue(Type *Ty) {
870 ConstantInt *TrueC = ConstantInt::getTrue(Ty->getContext());
876 Constant *ConstantInt::getFalse(Type *Ty) {
878 ConstantInt *FalseC = ConstantInt::getFalse(Ty->getContext());
884 Constant *ConstantInt::getBool(Type *Ty, bool V) {
888 // Get a ConstantInt from an APInt.
889 ConstantInt *ConstantInt::get(LLVMContext &Context, const APInt &V) {
892 std::unique_ptr<ConstantInt> &Slot =
899 Slot.reset(new ConstantInt(ITy, V));
905 // Get a ConstantInt vector with each lane set to the same APInt.
906 ConstantInt *ConstantInt::get(LLVMContext &Context, ElementCount EC,
909 std::unique_ptr<ConstantInt> &Slot =
914 Slot.reset(new ConstantInt(VTy, V));
925 Constant *ConstantInt::get(Type *Ty, uint64_t V, bool isSigned) {
935 ConstantInt *ConstantInt::get(IntegerType *Ty, uint64_t V, bool isSigned) {
939 Constant *ConstantInt::get(Type *Ty, const APInt& V) {
940 ConstantInt *C = get(Ty->getContext(), V);
942 "ConstantInt type doesn't match the type implied by its value!");
951 ConstantInt *ConstantInt::get(IntegerType* Ty, StringRef Str, uint8_t radix) {
956 void ConstantInt::destroyConstantImpl() {
957 llvm_unreachable("You can't ConstantInt->destroyConstantImpl()!");
1126 return getStructElement(cast<ConstantInt>(C)->getZExtValue());
1161 return getStructElement(cast<ConstantInt>(C)->getZExtValue());
1196 return getStructElement(cast<ConstantInt>(C)->getZExtValue());
1223 if (auto *CI = dyn_cast<ConstantInt>(C))
1249 if (ConstantInt *CI = dyn_cast<ConstantInt>(C)) {
1322 // Check to see if all of the elements are ConstantFP or ConstantInt and if
1417 bool isSplatInt = UseConstantIntForFixedLengthSplat && isa<ConstantInt>(C);
1437 return ConstantInt::get(C->getContext(), T->getElementCount(),
1438 cast<ConstantInt>(C)->getValue());
1440 // Check to see if all of the elements are ConstantFP or ConstantInt and if
1454 if (UseConstantIntForFixedLengthSplat && isa<ConstantInt>(V))
1455 return ConstantInt::get(V->getContext(), EC,
1456 cast<ConstantInt>(V)->getValue());
1464 if ((isa<ConstantFP>(V) || isa<ConstantInt>(V)) &&
1474 if (UseConstantIntForScalableSplat && isa<ConstantInt>(V))
1475 return ConstantInt::get(V->getContext(), EC,
1476 cast<ConstantInt>(V)->getValue());
1493 V = ConstantExpr::getInsertElement(PoisonV, V, ConstantInt::get(IdxTy, 0));
1575 bool ConstantInt::isValueValidForType(Type *Ty, uint64_t Val) {
1582 bool ConstantInt::isValueValidForType(Type *Ty, int64_t Val) {
1707 ConstantInt *Index = dyn_cast<ConstantInt>(IElt->getOperand(2));
1746 if (const ConstantInt *CI = dyn_cast<ConstantInt>(this))
1750 return cast<ConstantInt>(this->getSplatValue())->getValue();
1755 assert(C && isa<ConstantInt>(C) && "Not a vector of numbers!");
1756 return cast<ConstantInt>(C)->getValue();
1760 if (auto *CI = dyn_cast<ConstantInt>(this))
1767 if (auto *CI = dyn_cast_or_null<ConstantInt>(
1786 auto *CI = dyn_cast<ConstantInt>(Elem);
2046 ConstantPtrAuth *ConstantPtrAuth::get(Constant *Ptr, ConstantInt *Key,
2047 ConstantInt *Disc, Constant *AddrDisc) {
2058 ConstantPtrAuth::ConstantPtrAuth(Constant *Ptr, ConstantInt *Key,
2059 ConstantInt *Disc, Constant *AddrDisc)
2445 Constant *GEPIdx = ConstantInt::get(Type::getInt32Ty(Ty->getContext()), 1);
2458 Constant *Zero = ConstantInt::get(Type::getInt64Ty(Ty->getContext()), 0);
2459 Constant *One = ConstantInt::get(Type::getInt32Ty(Ty->getContext()), 1);
2590 return getSub(ConstantInt::get(C->getType(), 0), C, /*HasNUW=*/false, HasNSW);
2628 return ConstantInt::get(Ty, IVal->logBase2());
2647 Elts.push_back(ConstantInt::get(Ty->getScalarType(), IVal->logBase2()));
2665 return ConstantInt::get(Ty, 1);
2690 return ConstantInt::get(Ty, 1);
3018 if (ConstantInt *CI = dyn_cast<ConstantInt>(V)) {
3152 return ConstantInt::get(getElementType(), getElementAsInteger(Elt));