Lines Matching refs:ConstantInt
177 ConstantInt *AndCst) { in foldCmpLoadFromIndexedGlobal()
192 !isa<ConstantInt>(GEP->getOperand(1)) || in foldCmpLoadFromIndexedGlobal()
193 !cast<ConstantInt>(GEP->getOperand(1))->isZero() || in foldCmpLoadFromIndexedGlobal()
204 ConstantInt *Idx = dyn_cast<ConstantInt>(GEP->getOperand(i)); in foldCmpLoadFromIndexedGlobal()
279 if (!isa<ConstantInt>(C)) return nullptr; in foldCmpLoadFromIndexedGlobal()
283 bool IsTrueForElt = !cast<ConstantInt>(C)->isZero(); in foldCmpLoadFromIndexedGlobal()
356 Value *FirstTrueIdx = ConstantInt::get(Idx->getType(), FirstTrueElement); in foldCmpLoadFromIndexedGlobal()
364 Value *SecondTrueIdx = ConstantInt::get(Idx->getType(), SecondTrueElement); in foldCmpLoadFromIndexedGlobal()
376 Value *FirstFalseIdx = ConstantInt::get(Idx->getType(), FirstFalseElement); in foldCmpLoadFromIndexedGlobal()
384 Value *SecondFalseIdx = ConstantInt::get(Idx->getType(),SecondFalseElement); in foldCmpLoadFromIndexedGlobal()
396 Value *Offs = ConstantInt::get(Idx->getType(), -FirstTrueElement); in foldCmpLoadFromIndexedGlobal()
400 Value *End = ConstantInt::get(Idx->getType(), in foldCmpLoadFromIndexedGlobal()
410 Value *Offs = ConstantInt::get(Idx->getType(), -FirstFalseElement); in foldCmpLoadFromIndexedGlobal()
414 Value *End = ConstantInt::get(Idx->getType(), in foldCmpLoadFromIndexedGlobal()
435 V = Builder.CreateLShr(ConstantInt::get(Ty, MagicBitvector), V); in foldCmpLoadFromIndexedGlobal()
436 V = Builder.CreateAnd(ConstantInt::get(Ty, 1), V); in foldCmpLoadFromIndexedGlobal()
437 return new ICmpInst(ICmpInst::ICMP_NE, V, ConstantInt::get(Ty, 0)); in foldCmpLoadFromIndexedGlobal()
466 if (ConstantInt *CI = dyn_cast<ConstantInt>(GEP->getOperand(i))) { in evaluateGEPOffsetExpression()
494 ConstantInt *CI = dyn_cast<ConstantInt>(GEP->getOperand(i)); in evaluateGEPOffsetExpression()
541 Constant *OffsetVal = ConstantInt::get(IntPtrTy, NewOffs); in evaluateGEPOffsetExpression()
686 NewInsts[Base] = ConstantInt::getNullValue(IndexType); in rewriteGEPAsOffset()
724 if (isa<ConstantInt>(Op) && cast<ConstantInt>(Op)->isZero()) in rewriteGEPAsOffset()
793 Constant *Index = ConstantInt::getNullValue(IndexType); in getAsConstantIndexedAddress()
978 ConstantInt::get(I.getType(), ICmpInst::isTrueWhenEqual(Cond))); in foldGEPICmp()
1078 ConstantInt::get(CmpTy, !CmpInst::isTrueWhenEqual(ICI.getPredicate()))); in foldAllocaCmp()
1093 Constant *R = ConstantInt::get(X->getType(), in foldICmpAddOpConst()
1103 ConstantInt::get(X->getType(), -C)); in foldICmpAddOpConst()
1115 ConstantInt::get(X->getType(), SMax - C)); in foldICmpAddOpConst()
1126 ConstantInt::get(X->getType(), SMax - (C - 1))); in foldICmpAddOpConst()
1160 ConstantInt::get(A->getType(), AP2.logBase2())); in foldICmpShrConstConst()
1163 return getICmp(I.ICMP_EQ, A, ConstantInt::getNullValue(A->getType())); in foldICmpShrConstConst()
1176 return getICmp(I.ICMP_UGE, A, ConstantInt::get(A->getType(), Shift)); in foldICmpShrConstConst()
1177 return getICmp(I.ICMP_EQ, A, ConstantInt::get(A->getType(), Shift)); in foldICmpShrConstConst()
1179 return getICmp(I.ICMP_EQ, A, ConstantInt::get(A->getType(), Shift)); in foldICmpShrConstConst()
1185 auto *TorF = ConstantInt::get(I.getType(), I.getPredicate() == I.ICMP_NE); in foldICmpShrConstConst()
1211 ConstantInt::get(A->getType(), AP2.getBitWidth() - AP2TrailingZeros)); in foldICmpShlConstConst()
1214 return getICmp(I.ICMP_EQ, A, ConstantInt::getNullValue(A->getType())); in foldICmpShlConstConst()
1220 return getICmp(I.ICMP_EQ, A, ConstantInt::get(A->getType(), Shift)); in foldICmpShlConstConst()
1224 auto *TorF = ConstantInt::get(I.getType(), I.getPredicate() == I.ICMP_NE); in foldICmpShlConstConst()
1236 ConstantInt *CI2, ConstantInt *CI1, in processUGT_ADDCST_ADD()
1356 ConstantInt *CI, *CI2; // I = icmp ugt (add (add A, B), CI2), CI in foldICmpWithConstant()
1389 return replaceInstUsesWith(Cmp, ConstantInt::get(Cmp.getType(), *Imp)); in foldICmpWithDominatingICmp()
1446 ConstantInt::get(V->getType(), 1)); in foldICmpTruncConstant()
1461 return new ICmpInst(Pred, X, ConstantInt::get(X->getType(), NewRHS)); in foldICmpTruncConstant()
1495 ConstantInt::getAllOnesValue(X->getType())); in foldICmpXorConstant()
1498 ConstantInt::getNullValue(X->getType())); in foldICmpXorConstant()
1506 return new ICmpInst(Pred, X, ConstantInt::get(X->getType(), C ^ *XorC)); in foldICmpXorConstant()
1514 return new ICmpInst(Pred, X, ConstantInt::get(X->getType(), C ^ *XorC)); in foldICmpXorConstant()
1531 ConstantInt::get(X->getType(), ~C)); in foldICmpXorConstant()
1535 ConstantInt::get(X->getType(), ~C)); in foldICmpXorConstant()
1590 return replaceInstUsesWith(Cmp, ConstantInt::getFalse(Cmp.getType())); in foldICmpAndShift()
1592 return replaceInstUsesWith(Cmp, ConstantInt::getTrue(Cmp.getType())); in foldICmpAndShift()
1594 Cmp.setOperand(1, ConstantInt::get(And->getType(), NewCst)); in foldICmpAndShift()
1596 And->setOperand(1, ConstantInt::get(And->getType(), NewAndCst)); in foldICmpAndShift()
1658 Constant *ZextC1 = ConstantInt::get(WideType, C1.zext(WideScalarBits)); in foldICmpAndConstConst()
1659 Constant *ZextC2 = ConstantInt::get(WideType, C2->zext(WideScalarBits)); in foldICmpAndConstConst()
1725 !LI->isVolatile() && isa<ConstantInt>(Y)) { in foldICmpAndConstant()
1726 ConstantInt *C2 = cast<ConstantInt>(Y); in foldICmpAndConstant()
1772 ConstantInt::get(V->getType(), 1)); in foldICmpOrConstant()
1792 Builder.CreateICmp(Pred, P, ConstantInt::getNullValue(P->getType())); in foldICmpOrConstant()
1794 Builder.CreateICmp(Pred, Q, ConstantInt::getNullValue(Q->getType())); in foldICmpOrConstant()
1869 return new ICmpInst(Pred, Y, ConstantInt::get(ShiftType, CLog2)); in foldICmpShlOne()
1871 Constant *BitWidthMinusOne = ConstantInt::get(ShiftType, TypeBits - 1); in foldICmpShlOne()
1892 return new ICmpInst(Pred, Y, ConstantInt::get(ShiftType, C.logBase2())); in foldICmpShlOne()
1927 return new ICmpInst(Pred, X, ConstantInt::get(ShType, ShiftedC)); in foldICmpShlConstant()
1932 return new ICmpInst(Pred, X, ConstantInt::get(ShType, ShiftedC)); in foldICmpShlConstant()
1941 return new ICmpInst(Pred, X, ConstantInt::get(ShType, ShiftedC)); in foldICmpShlConstant()
1957 return new ICmpInst(Pred, X, ConstantInt::get(ShType, ShiftedC)); in foldICmpShlConstant()
1962 return new ICmpInst(Pred, X, ConstantInt::get(ShType, ShiftedC)); in foldICmpShlConstant()
1971 return new ICmpInst(Pred, X, ConstantInt::get(ShType, ShiftedC)); in foldICmpShlConstant()
1977 Constant *Mask = ConstantInt::get( in foldICmpShlConstant()
1981 Constant *LShrC = ConstantInt::get(ShType, C.lshr(*ShiftAmt)); in foldICmpShlConstant()
1989 Constant *Mask = ConstantInt::get( in foldICmpShlConstant()
2010 ConstantInt::get(TruncTy, C.ashr(*ShiftAmt).trunc(TypeBits - Amt)); in foldICmpShlConstant()
2057 return new ICmpInst(Pred, X, ConstantInt::get(ShrTy, ShiftedC)); in foldICmpShrConstant()
2064 return new ICmpInst(Pred, X, ConstantInt::get(ShrTy, ShiftedC)); in foldICmpShrConstant()
2072 return new ICmpInst(Pred, X, ConstantInt::get(ShrTy, ShiftedC)); in foldICmpShrConstant()
2078 return new ICmpInst(Pred, X, ConstantInt::get(ShrTy, ShiftedC)); in foldICmpShrConstant()
2097 return new ICmpInst(Pred, X, ConstantInt::get(ShrTy, C << ShAmtVal)); in foldICmpShrConstant()
2103 Constant *Mask = ConstantInt::get(ShrTy, Val); in foldICmpShrConstant()
2105 return new ICmpInst(Pred, And, ConstantInt::get(ShrTy, C << ShAmtVal)); in foldICmpShrConstant()
2127 ConstantInt::get(Y->getType(), C2->udiv(C + 1))); in foldICmpUDivConstant()
2134 ConstantInt::get(Y->getType(), C2->udiv(C))); in foldICmpUDivConstant()
2266 ConstantInt::get(Div->getType(), LoBound)); in foldICmpDivConstant()
2270 ConstantInt::get(Div->getType(), HiBound)); in foldICmpDivConstant()
2279 ConstantInt::get(Div->getType(), LoBound)); in foldICmpDivConstant()
2283 ConstantInt::get(Div->getType(), HiBound)); in foldICmpDivConstant()
2293 return new ICmpInst(Pred, X, ConstantInt::get(Div->getType(), LoBound)); in foldICmpDivConstant()
2302 ConstantInt::get(Div->getType(), HiBound)); in foldICmpDivConstant()
2304 ConstantInt::get(Div->getType(), HiBound)); in foldICmpDivConstant()
2390 return new ICmpInst(Pred, X, ConstantInt::get(Ty, NewC)); in foldICmpAddConstant()
2398 return new ICmpInst(ICmpInst::ICMP_SLT, X, ConstantInt::get(Ty, Upper)); in foldICmpAddConstant()
2400 return new ICmpInst(ICmpInst::ICMP_SGE, X, ConstantInt::get(Ty, Lower)); in foldICmpAddConstant()
2403 return new ICmpInst(ICmpInst::ICMP_ULT, X, ConstantInt::get(Ty, Upper)); in foldICmpAddConstant()
2405 return new ICmpInst(ICmpInst::ICMP_UGE, X, ConstantInt::get(Ty, Lower)); in foldICmpAddConstant()
2426 Value *&RHS, ConstantInt *&Less, in matchThreeWayIntCompare()
2427 ConstantInt *&Equal, in matchThreeWayIntCompare()
2428 ConstantInt *&Greater) { in matchThreeWayIntCompare()
2450 ConstantInt *C) { in foldICmpSelectConstant()
2459 ConstantInt *C1LessThan, *C2Equal, *C3GreaterThan; in foldICmpSelectConstant()
2516 if (auto *Elem = dyn_cast_or_null<ConstantInt>(Mask->getSplatValue())) { in foldICmpBitCastConstant()
2527 Value *NewC = ConstantInt::get(EltTy, C.trunc(EltTy->getBitWidth())); in foldICmpBitCastConstant()
2599 if (ConstantInt *ConstRHS = dyn_cast<ConstantInt>(Cmp.getOperand(1))) in foldICmpInstWithConstant()
2773 Cmp.setOperand(1, ConstantInt::get(Ty, C.byteSwap())); in foldICmpIntrinsicWithConstant()
2782 Cmp.setOperand(1, ConstantInt::getNullValue(Ty)); in foldICmpIntrinsicWithConstant()
2798 Cmp.setOperand(1, ConstantInt::get(Ty, Mask2)); in foldICmpIntrinsicWithConstant()
2856 ConstantInt *CI = nullptr; in foldICmpInstWithConstantNotInt()
2859 CI = dyn_cast<ConstantInt>(Op1); in foldICmpInstWithConstantNotInt()
2863 CI = dyn_cast<ConstantInt>(Op2); in foldICmpInstWithConstantNotInt()
3089 Value *T0 = Builder.CreateAdd(X, ConstantInt::get(XType, AddCst)); in foldICmpWithTruncSignExtendedVal()
3091 Value *T1 = Builder.CreateICmp(DstPred, T0, ConstantInt::get(XType, ICmpCst)); in foldICmpWithTruncSignExtendedVal()
3254 if (ConstantInt *C1 = dyn_cast<ConstantInt>(B)) in foldICmpBinOp()
3255 if (ConstantInt *C2 = dyn_cast<ConstantInt>(D)) { in foldICmpBinOp()
3262 ConstantInt *C3 = Builder.getInt(AP1 - AP2); in foldICmpBinOp()
3266 ConstantInt *C3 = Builder.getInt(AP2 - AP1); in foldICmpBinOp()
3338 return replaceInstUsesWith(I, ConstantInt::getFalse(I.getType())); in foldICmpBinOp()
3340 return replaceInstUsesWith(I, ConstantInt::getTrue(I.getType())); in foldICmpBinOp()
3392 Constant *Mask = ConstantInt::get( in foldICmpBinOp()
3556 ConstantInt *C1, *C2; in foldICmpEquality()
3616 ConstantInt *Cst1; in foldICmpEquality()
3797 if (isSignedCmp || !isSignedExt || !isa<ConstantInt>(C)) in foldICmpWithCastAndCast()
3980 if (ConstantInt *CI = dyn_cast<ConstantInt>(BO->getOperand(1))) { in processUMulZExtIdiom()
4014 ConstantInt *CI; in processUMulZExtIdiom()
4032 if (ConstantInt *CI = dyn_cast<ConstantInt>(OtherVal)) { in processUMulZExtIdiom()
4044 if (ConstantInt *CI = dyn_cast<ConstantInt>(OtherVal)) { in processUMulZExtIdiom()
4055 if (ConstantInt *CI = dyn_cast<ConstantInt>(OtherVal)) { in processUMulZExtIdiom()
4067 if (ConstantInt *CI = dyn_cast<ConstantInt>(OtherVal)) { in processUMulZExtIdiom()
4109 ConstantInt *CI = cast<ConstantInt>(BO->getOperand(1)); in processUMulZExtIdiom()
4383 ? replaceInstUsesWith(I, ConstantInt::getFalse(I.getType())) in foldICmpUsingKnownBits()
4384 : replaceInstUsesWith(I, ConstantInt::getTrue(I.getType())); in foldICmpUsingKnownBits()
4406 auto *CmpC = ConstantInt::get(XTy, ValToCheck.countTrailingZeros()); in foldICmpUsingKnownBits()
4412 auto *CmpC = ConstantInt::get(XTy, ValToCheck.countTrailingZeros()); in foldICmpUsingKnownBits()
4427 return new ICmpInst(NewPred, X, ConstantInt::get(X->getType(), CmpVal)); in foldICmpUsingKnownBits()
4434 return replaceInstUsesWith(I, ConstantInt::getTrue(I.getType())); in foldICmpUsingKnownBits()
4436 return replaceInstUsesWith(I, ConstantInt::getFalse(I.getType())); in foldICmpUsingKnownBits()
4445 ConstantInt::get(Op1->getType(), *CmpC - 1)); in foldICmpUsingKnownBits()
4456 return replaceInstUsesWith(I, ConstantInt::getTrue(I.getType())); in foldICmpUsingKnownBits()
4458 return replaceInstUsesWith(I, ConstantInt::getFalse(I.getType())); in foldICmpUsingKnownBits()
4467 ConstantInt::get(Op1->getType(), *CmpC + 1)); in foldICmpUsingKnownBits()
4478 return replaceInstUsesWith(I, ConstantInt::getTrue(I.getType())); in foldICmpUsingKnownBits()
4480 return replaceInstUsesWith(I, ConstantInt::getFalse(I.getType())); in foldICmpUsingKnownBits()
4487 ConstantInt::get(Op1->getType(), *CmpC - 1)); in foldICmpUsingKnownBits()
4493 return replaceInstUsesWith(I, ConstantInt::getTrue(I.getType())); in foldICmpUsingKnownBits()
4495 return replaceInstUsesWith(I, ConstantInt::getFalse(I.getType())); in foldICmpUsingKnownBits()
4502 ConstantInt::get(Op1->getType(), *CmpC + 1)); in foldICmpUsingKnownBits()
4507 assert(!isa<ConstantInt>(Op1) && "ICMP_SGE with ConstantInt not folded!"); in foldICmpUsingKnownBits()
4509 return replaceInstUsesWith(I, ConstantInt::getTrue(I.getType())); in foldICmpUsingKnownBits()
4511 return replaceInstUsesWith(I, ConstantInt::getFalse(I.getType())); in foldICmpUsingKnownBits()
4516 assert(!isa<ConstantInt>(Op1) && "ICMP_SLE with ConstantInt not folded!"); in foldICmpUsingKnownBits()
4518 return replaceInstUsesWith(I, ConstantInt::getTrue(I.getType())); in foldICmpUsingKnownBits()
4520 return replaceInstUsesWith(I, ConstantInt::getFalse(I.getType())); in foldICmpUsingKnownBits()
4525 assert(!isa<ConstantInt>(Op1) && "ICMP_UGE with ConstantInt not folded!"); in foldICmpUsingKnownBits()
4527 return replaceInstUsesWith(I, ConstantInt::getTrue(I.getType())); in foldICmpUsingKnownBits()
4529 return replaceInstUsesWith(I, ConstantInt::getFalse(I.getType())); in foldICmpUsingKnownBits()
4534 assert(!isa<ConstantInt>(Op1) && "ICMP_ULE with ConstantInt not folded!"); in foldICmpUsingKnownBits()
4536 return replaceInstUsesWith(I, ConstantInt::getTrue(I.getType())); in foldICmpUsingKnownBits()
4538 return replaceInstUsesWith(I, ConstantInt::getFalse(I.getType())); in foldICmpUsingKnownBits()
4576 auto *CI = dyn_cast<ConstantInt>(Op1C); in canonicalizeCmpWithConstant()
4595 auto *CI = dyn_cast<ConstantInt>(Elt); in canonicalizeCmpWithConstant()
4606 Constant *OneOrNegOne = ConstantInt::get(Op1Type, IsLE ? 1 : -1, true); in canonicalizeCmpWithConstant()
4894 return new ICmpInst(Pred, X, ConstantInt::getNullValue(X->getType())); in visitICmpInst()
4898 return new ICmpInst(Pred, X, ConstantInt::get(X->getType(), 1)); in visitICmpInst()
4902 return new ICmpInst(Pred, X, ConstantInt::getAllOnesValue(X->getType())); in visitICmpInst()
4910 return new ICmpInst(Pred, X, ConstantInt::getNullValue(X->getType())); in visitICmpInst()
4978 ConstantInt::get(Op1->getType(), ~(*C))); in visitICmpInst()