Lines Matching refs:ConstantInt
84 if (isa<ConstantInt>(V) || isa<ConstantFP>(V)) in FoldBitCast()
90 if (ConstantInt *CI = dyn_cast<ConstantInt>(V)) { in FoldBitCast()
116 return ConstantInt::get(FP->getContext(), in FoldBitCast()
143 if (ConstantInt *CI = dyn_cast<ConstantInt>(C)) { in ExtractConstantBytes()
148 return ConstantInt::get(CI->getContext(), V); in ExtractConstantBytes()
159 ConstantInt *Amt = dyn_cast<ConstantInt>(CE->getOperand(1)); in ExtractConstantBytes()
241 Constant *C = ConstantExpr::getExtractElement(V, ConstantInt::get(Ty, i)); in ConstantFoldCastInstruction()
278 return ConstantInt::get(FPC->getContext(), IntVal); in ConstantFoldCastInstruction()
283 if (ConstantInt *CI = dyn_cast<ConstantInt>(V)) { in ConstantFoldCastInstruction()
293 if (ConstantInt *CI = dyn_cast<ConstantInt>(V)) { in ConstantFoldCastInstruction()
295 return ConstantInt::get(V->getContext(), in ConstantFoldCastInstruction()
300 if (ConstantInt *CI = dyn_cast<ConstantInt>(V)) { in ConstantFoldCastInstruction()
302 return ConstantInt::get(V->getContext(), in ConstantFoldCastInstruction()
311 if (ConstantInt *CI = dyn_cast<ConstantInt>(V)) { in ConstantFoldCastInstruction()
312 return ConstantInt::get(V->getContext(), in ConstantFoldCastInstruction()
349 ConstantInt::get(Ty, i)); in ConstantFoldSelectInstruction()
351 ConstantInt::get(Ty, i)); in ConstantFoldSelectInstruction()
360 if (!isa<ConstantInt>(Cond)) break; in ConstantFoldSelectInstruction()
397 if (isa<ConstantInt>(C) || isa<GlobalVariable>(C) || isa<ConstantFP>(C) || in ConstantFoldSelectInstruction()
426 auto *CIdx = dyn_cast<ConstantInt>(Idx); in ConstantFoldExtractElementInstruction()
454 if (const auto *IEIdx = dyn_cast<ConstantInt>(CE->getOperand(2))) { in ConstantFoldExtractElementInstruction()
488 ConstantInt *CIdx = dyn_cast<ConstantInt>(Idx); in ConstantFoldInsertElementInstruction()
512 Constant *C = ConstantExpr::getExtractElement(Val, ConstantInt::get(Ty, i)); in ConstantFoldInsertElementInstruction()
537 ConstantExpr::getExtractElement(V1, ConstantInt::get(Ty, 0)); in ConstantFoldShuffleVectorInstruction()
567 ConstantInt::get(Ty, Elt - SrcNumElts)); in ConstantFoldShuffleVectorInstruction()
570 InElt = ConstantExpr::getExtractElement(V1, ConstantInt::get(Ty, Elt)); in ConstantFoldShuffleVectorInstruction()
640 assert(!isa<ConstantInt>(C) && "Unexpected Integer UnaryOp"); in ConstantFoldUnaryInstruction()
661 Constant *ExtractIdx = ConstantInt::get(Ty, i); in ConstantFoldUnaryInstruction()
800 if (ConstantInt *CI2 = dyn_cast<ConstantInt>(C2)) { in ConstantFoldBinaryInstruction()
882 } else if (isa<ConstantInt>(C1)) { in ConstantFoldBinaryInstruction()
890 if (ConstantInt *CI1 = dyn_cast<ConstantInt>(C1)) { in ConstantFoldBinaryInstruction()
891 if (ConstantInt *CI2 = dyn_cast<ConstantInt>(C2)) { in ConstantFoldBinaryInstruction()
898 return ConstantInt::get(CI1->getContext(), C1V + C2V); in ConstantFoldBinaryInstruction()
900 return ConstantInt::get(CI1->getContext(), C1V - C2V); in ConstantFoldBinaryInstruction()
902 return ConstantInt::get(CI1->getContext(), C1V * C2V); in ConstantFoldBinaryInstruction()
905 return ConstantInt::get(CI1->getContext(), C1V.udiv(C2V)); in ConstantFoldBinaryInstruction()
910 return ConstantInt::get(CI1->getContext(), C1V.sdiv(C2V)); in ConstantFoldBinaryInstruction()
913 return ConstantInt::get(CI1->getContext(), C1V.urem(C2V)); in ConstantFoldBinaryInstruction()
918 return ConstantInt::get(CI1->getContext(), C1V.srem(C2V)); in ConstantFoldBinaryInstruction()
920 return ConstantInt::get(CI1->getContext(), C1V & C2V); in ConstantFoldBinaryInstruction()
922 return ConstantInt::get(CI1->getContext(), C1V | C2V); in ConstantFoldBinaryInstruction()
924 return ConstantInt::get(CI1->getContext(), C1V ^ C2V); in ConstantFoldBinaryInstruction()
927 return ConstantInt::get(CI1->getContext(), C1V.shl(C2V)); in ConstantFoldBinaryInstruction()
931 return ConstantInt::get(CI1->getContext(), C1V.lshr(C2V)); in ConstantFoldBinaryInstruction()
935 return ConstantInt::get(CI1->getContext(), C1V.ashr(C2V)); in ConstantFoldBinaryInstruction()
999 Constant *ExtractIdx = ConstantInt::get(Ty, i); in ConstantFoldBinaryInstruction()
1059 return ConstantInt::getFalse(C1->getContext()); in ConstantFoldBinaryInstruction()
1240 return ConstantInt::get(ResultTy, CmpInst::isTrueWhenEqual(Predicate)); in ConstantFoldCompareInstruction()
1244 return ConstantInt::get(ResultTy, CmpInst::isUnordered(Predicate)); in ConstantFoldCompareInstruction()
1262 if (isa<ConstantInt>(C2)) in ConstantFoldCompareInstruction()
1272 if (isa<ConstantInt>(C1) && isa<ConstantInt>(C2)) { in ConstantFoldCompareInstruction()
1273 const APInt &V1 = cast<ConstantInt>(C1)->getValue(); in ConstantFoldCompareInstruction()
1274 const APInt &V2 = cast<ConstantInt>(C2)->getValue(); in ConstantFoldCompareInstruction()
1275 return ConstantInt::get(ResultTy, ICmpInst::compare(V1, V2, Predicate)); in ConstantFoldCompareInstruction()
1279 return ConstantInt::get(ResultTy, FCmpInst::compare(C1V, C2V, Predicate)); in ConstantFoldCompareInstruction()
1302 ConstantExpr::getExtractElement(C1, ConstantInt::get(Ty, I)); in ConstantFoldCompareInstruction()
1304 ConstantExpr::getExtractElement(C2, ConstantInt::get(Ty, I)); in ConstantFoldCompareInstruction()
1316 return ConstantInt::getFalse(ResultTy); in ConstantFoldCompareInstruction()
1318 return ConstantInt::getTrue(ResultTy); in ConstantFoldCompareInstruction()
1406 return ConstantInt::get(ResultTy, Result); in ConstantFoldCompareInstruction()
1431 if (auto *CI = dyn_cast<ConstantInt>(Idxs[0])) { in isInBoundsIndices()
1436 CI = dyn_cast_or_null<ConstantInt>(CV->getSplatValue()); in isInBoundsIndices()
1449 const ConstantInt *CI) { in isIndexInRangeOfArrayType()
1494 ConstantInt *CI = dyn_cast<ConstantInt>(Idx0); in foldGEPOfGEP()
1587 !isa<ConstantInt>(Idxs[0]) && !isa<ConstantDataVector>(Idxs[0]); in ConstantFoldGetElementPtr()
1590 if (!isa<ConstantInt>(Idxs[i]) && !isa<ConstantDataVector>(Idxs[i])) { in ConstantFoldGetElementPtr()
1595 if (!isa<ConstantInt>(Idxs[i - 1]) && !isa<ConstantDataVector>(Idxs[i - 1])) in ConstantFoldGetElementPtr()
1614 if (ConstantInt *CI = dyn_cast<ConstantInt>(Idxs[i])) { in ConstantFoldGetElementPtr()
1627 auto *CI = cast<ConstantInt>(CV->getElementAsConstant(I)); in ConstantFoldGetElementPtr()
1675 ConstantInt::get(CurrIdx->getType()->getScalarType(), NumElements); in ConstantFoldGetElementPtr()