• Home
  • History
  • Annotate
  • Raw
  • Download
  • only in /freebsd-13-stable/contrib/llvm-project/llvm/lib/Transforms/InstCombine/

Lines Matching refs:ConstantInt

148                                                         ConstantInt *AndCst) {
163 !isa<ConstantInt>(GEP->getOperand(1)) ||
164 !cast<ConstantInt>(GEP->getOperand(1))->isZero() ||
175 ConstantInt *Idx = dyn_cast<ConstantInt>(GEP->getOperand(i));
250 if (!isa<ConstantInt>(C)) return nullptr;
254 bool IsTrueForElt = !cast<ConstantInt>(C)->isZero();
327 Value *FirstTrueIdx = ConstantInt::get(Idx->getType(), FirstTrueElement);
335 Value *SecondTrueIdx = ConstantInt::get(Idx->getType(), SecondTrueElement);
347 Value *FirstFalseIdx = ConstantInt::get(Idx->getType(), FirstFalseElement);
355 Value *SecondFalseIdx = ConstantInt::get(Idx->getType(),SecondFalseElement);
367 Value *Offs = ConstantInt::get(Idx->getType(), -FirstTrueElement);
371 Value *End = ConstantInt::get(Idx->getType(),
381 Value *Offs = ConstantInt::get(Idx->getType(), -FirstFalseElement);
385 Value *End = ConstantInt::get(Idx->getType(),
406 V = Builder.CreateLShr(ConstantInt::get(Ty, MagicBitvector), V);
407 V = Builder.CreateAnd(ConstantInt::get(Ty, 1), V);
408 return new ICmpInst(ICmpInst::ICMP_NE, V, ConstantInt::get(Ty, 0));
437 if (ConstantInt *CI = dyn_cast<ConstantInt>(GEP->getOperand(i))) {
465 ConstantInt *CI = dyn_cast<ConstantInt>(GEP->getOperand(i));
512 Constant *OffsetVal = ConstantInt::get(IntPtrTy, NewOffs);
657 NewInsts[Base] = ConstantInt::getNullValue(IndexType);
698 if (isa<ConstantInt>(Op) && cast<ConstantInt>(Op)->isZero())
767 Constant *Index = ConstantInt::getNullValue(IndexType);
998 ConstantInt::get(I.getType(), ICmpInst::isTrueWhenEqual(Cond)));
1098 ConstantInt::get(CmpTy, !CmpInst::isTrueWhenEqual(ICI.getPredicate())));
1113 Constant *R = ConstantInt::get(X->getType(),
1123 ConstantInt::get(X->getType(), -C));
1135 ConstantInt::get(X->getType(), SMax - C));
1146 ConstantInt::get(X->getType(), SMax - (C - 1)));
1180 ConstantInt::get(A->getType(), AP2.logBase2()));
1183 return getICmp(I.ICMP_EQ, A, ConstantInt::getNullValue(A->getType()));
1196 return getICmp(I.ICMP_UGE, A, ConstantInt::get(A->getType(), Shift));
1197 return getICmp(I.ICMP_EQ, A, ConstantInt::get(A->getType(), Shift));
1199 return getICmp(I.ICMP_EQ, A, ConstantInt::get(A->getType(), Shift));
1205 auto *TorF = ConstantInt::get(I.getType(), I.getPredicate() == I.ICMP_NE);
1231 ConstantInt::get(A->getType(), AP2.getBitWidth() - AP2TrailingZeros));
1234 return getICmp(I.ICMP_EQ, A, ConstantInt::getNullValue(A->getType()));
1240 return getICmp(I.ICMP_EQ, A, ConstantInt::get(A->getType(), Shift));
1244 auto *TorF = ConstantInt::get(I.getType(), I.getPredicate() == I.ICMP_NE);
1256 ConstantInt *CI2, ConstantInt *CI1,
1389 X, ConstantInt::getNullValue(XTy));
1449 ConstantInt *CI, *CI2; // I = icmp ugt (add (add A, B), CI2), CI
1503 return replaceInstUsesWith(Cmp, ConstantInt::get(Cmp.getType(), *Imp));
1560 ConstantInt::get(V->getType(), 1));
1575 return new ICmpInst(Pred, X, ConstantInt::get(X->getType(), NewRHS));
1606 ConstantInt::getAllOnesValue(X->getType()));
1609 ConstantInt::getNullValue(X->getType()));
1617 return new ICmpInst(Pred, X, ConstantInt::get(X->getType(), C ^ *XorC));
1625 return new ICmpInst(Pred, X, ConstantInt::get(X->getType(), C ^ *XorC));
1642 ConstantInt::get(X->getType(), ~C));
1646 ConstantInt::get(X->getType(), ~C));
1706 return replaceInstUsesWith(Cmp, ConstantInt::getFalse(Cmp.getType()));
1708 return replaceInstUsesWith(Cmp, ConstantInt::getTrue(Cmp.getType()));
1711 Shift->getOperand(0), ConstantInt::get(And->getType(), NewAndCst));
1713 NewAnd, ConstantInt::get(And->getType(), NewCmpCst));
1793 Constant *ZextC1 = ConstantInt::get(WideType, C1.zext(WideScalarBits));
1794 Constant *ZextC2 = ConstantInt::get(WideType, C2->zext(WideScalarBits));
1859 !LI->isVolatile() && isa<ConstantInt>(Y)) {
1860 ConstantInt *C2 = cast<ConstantInt>(Y);
1906 ConstantInt::get(V->getType(), 1));
1926 Constant *NewC = ConstantInt::get(Or->getType(), C ^ (*MaskC));
1939 Builder.CreateICmp(Pred, P, ConstantInt::getNullValue(P->getType()));
1941 Builder.CreateICmp(Pred, Q, ConstantInt::getNullValue(Q->getType()));
2016 return new ICmpInst(Pred, Y, ConstantInt::get(ShiftType, CLog2));
2018 Constant *BitWidthMinusOne = ConstantInt::get(ShiftType, TypeBits - 1);
2039 return new ICmpInst(Pred, Y, ConstantInt::get(ShiftType, C.logBase2()));
2074 return new ICmpInst(Pred, X, ConstantInt::get(ShType, ShiftedC));
2079 return new ICmpInst(Pred, X, ConstantInt::get(ShType, ShiftedC));
2088 return new ICmpInst(Pred, X, ConstantInt::get(ShType, ShiftedC));
2104 return new ICmpInst(Pred, X, ConstantInt::get(ShType, ShiftedC));
2109 return new ICmpInst(Pred, X, ConstantInt::get(ShType, ShiftedC));
2118 return new ICmpInst(Pred, X, ConstantInt::get(ShType, ShiftedC));
2124 Constant *Mask = ConstantInt::get(
2128 Constant *LShrC = ConstantInt::get(ShType, C.lshr(*ShiftAmt));
2136 Constant *Mask = ConstantInt::get(
2178 ConstantInt::get(TruncTy, C.ashr(*ShiftAmt).trunc(TypeBits - Amt));
2225 return new ICmpInst(Pred, X, ConstantInt::get(ShrTy, ShiftedC));
2232 return new ICmpInst(Pred, X, ConstantInt::get(ShrTy, ShiftedC));
2240 return new ICmpInst(Pred, X, ConstantInt::get(ShrTy, ShiftedC));
2246 return new ICmpInst(Pred, X, ConstantInt::get(ShrTy, ShiftedC));
2265 return new ICmpInst(Pred, X, ConstantInt::get(ShrTy, C << ShAmtVal));
2271 Constant *Mask = ConstantInt::get(ShrTy, Val);
2273 return new ICmpInst(Pred, And, ConstantInt::get(ShrTy, C << ShAmtVal));
2302 Constant *MaskC = ConstantInt::get(Ty, SignMask | (*DivisorC - 1));
2309 return new ICmpInst(ICmpInst::ICMP_SGT, And, ConstantInt::getNullValue(Ty));
2314 return new ICmpInst(ICmpInst::ICMP_UGT, And, ConstantInt::get(Ty, SignMask));
2333 ConstantInt::get(Y->getType(), C2->udiv(C + 1)));
2340 ConstantInt::get(Y->getType(), C2->udiv(C)));
2472 ConstantInt::get(Div->getType(), LoBound));
2476 ConstantInt::get(Div->getType(), HiBound));
2485 ConstantInt::get(Div->getType(), LoBound));
2489 ConstantInt::get(Div->getType(), HiBound));
2499 return new ICmpInst(Pred, X, ConstantInt::get(Div->getType(), LoBound));
2508 ConstantInt::get(Div->getType(), HiBound));
2510 ConstantInt::get(Div->getType(), HiBound));
2528 ConstantInt::get(Y->getType(), 0));
2536 ConstantInt::get(Y->getType(), SubResult));
2607 return new ICmpInst(Pred, X, ConstantInt::get(Ty, NewC));
2615 return new ICmpInst(ICmpInst::ICMP_SLT, X, ConstantInt::get(Ty, Upper));
2617 return new ICmpInst(ICmpInst::ICMP_SGE, X, ConstantInt::get(Ty, Lower));
2620 return new ICmpInst(ICmpInst::ICMP_ULT, X, ConstantInt::get(Ty, Upper));
2622 return new ICmpInst(ICmpInst::ICMP_UGE, X, ConstantInt::get(Ty, Lower));
2646 Value *&RHS, ConstantInt *&Less,
2647 ConstantInt *&Equal,
2648 ConstantInt *&Greater) {
2699 ConstantInt *C) {
2708 ConstantInt *C1LessThan, *C2Equal, *C3GreaterThan;
2771 return new ICmpInst(Pred, X, ConstantInt::getNullValue(X->getType()));
2775 return new ICmpInst(Pred, X, ConstantInt::get(X->getType(), 1));
2780 ConstantInt::getAllOnesValue(X->getType()));
2788 return new ICmpInst(Pred, X, ConstantInt::getNullValue(X->getType()));
2813 ConstantInt::getNullValue(NewType));
2816 ConstantInt::getAllOnesValue(NewType));
2863 Value *NewC = ConstantInt::get(EltTy, C->trunc(EltTy->getBitWidth()));
2939 if (ConstantInt *ConstRHS = dyn_cast<ConstantInt>(Cmp.getOperand(1)))
3084 ConstantInt::get(Ty, C.byteSwap()));
3091 ConstantInt::getNullValue(Ty));
3106 ConstantInt::get(Ty, Mask2));
3163 II->getArgOperand(0), ConstantInt::get(Ty, Limit));
3172 II->getArgOperand(0), ConstantInt::get(Ty, Limit));
3186 ConstantInt::getNullValue(Ty));
3195 ConstantInt::getNullValue(Ty));
3236 ConstantInt *CI = nullptr;
3239 CI = dyn_cast<ConstantInt>(Op1);
3243 CI = dyn_cast<ConstantInt>(Op2);
3470 Value *T0 = Builder.CreateAdd(X, ConstantInt::get(XType, AddCst));
3472 Value *T1 = Builder.CreateICmp(DstPred, T0, ConstantInt::get(XType, ICmpCst));
3874 if (ConstantInt *C1 = dyn_cast<ConstantInt>(B))
3875 if (ConstantInt *C2 = dyn_cast<ConstantInt>(D)) {
3882 ConstantInt *C3 = Builder.getInt(AP1 - AP2);
3886 ConstantInt *C3 = Builder.getInt(AP2 - AP1);
3964 return replaceInstUsesWith(I, ConstantInt::getFalse(I.getType()));
3966 return replaceInstUsesWith(I, ConstantInt::getTrue(I.getType()));
4018 Constant *Mask = ConstantInt::get(
4188 ConstantInt *C1, *C2;
4246 ConstantInt *Cst1;
4341 ? new ICmpInst(ICmpInst::ICMP_ULT, CtPop, ConstantInt::get(Ty, 2))
4342 : new ICmpInst(ICmpInst::ICMP_UGT, CtPop, ConstantInt::get(Ty, 1));
4426 if (IsSignedCmp || !IsSignedExt || !isa<ConstantInt>(C))
4627 if (ConstantInt *CI = dyn_cast<ConstantInt>(BO->getOperand(1))) {
4650 ConstantInt *CI;
4668 if (ConstantInt *CI = dyn_cast<ConstantInt>(OtherVal)) {
4680 if (ConstantInt *CI = dyn_cast<ConstantInt>(OtherVal)) {
4691 if (ConstantInt *CI = dyn_cast<ConstantInt>(OtherVal)) {
4703 if (ConstantInt *CI = dyn_cast<ConstantInt>(OtherVal)) {
4745 ConstantInt *CI = cast<ConstantInt>(BO->getOperand(1));
5017 ? replaceInstUsesWith(I, ConstantInt::getFalse(I.getType()))
5018 : replaceInstUsesWith(I, ConstantInt::getTrue(I.getType()));
5040 auto *CmpC = ConstantInt::get(XTy, ValToCheck.countTrailingZeros());
5046 auto *CmpC = ConstantInt::get(XTy, ValToCheck.countTrailingZeros());
5061 return new ICmpInst(NewPred, X, ConstantInt::get(X->getType(), CmpVal));
5068 return replaceInstUsesWith(I, ConstantInt::getTrue(I.getType()));
5070 return replaceInstUsesWith(I, ConstantInt::getFalse(I.getType()));
5079 ConstantInt::get(Op1->getType(), *CmpC - 1));
5090 return replaceInstUsesWith(I, ConstantInt::getTrue(I.getType()));
5092 return replaceInstUsesWith(I, ConstantInt::getFalse(I.getType()));
5101 ConstantInt::get(Op1->getType(), *CmpC + 1));
5112 return replaceInstUsesWith(I, ConstantInt::getTrue(I.getType()));
5114 return replaceInstUsesWith(I, ConstantInt::getFalse(I.getType()));
5121 ConstantInt::get(Op1->getType(), *CmpC - 1));
5127 return replaceInstUsesWith(I, ConstantInt::getTrue(I.getType()));
5129 return replaceInstUsesWith(I, ConstantInt::getFalse(I.getType()));
5136 ConstantInt::get(Op1->getType(), *CmpC + 1));
5141 assert(!isa<ConstantInt>(Op1) && "ICMP_SGE with ConstantInt not folded!");
5143 return replaceInstUsesWith(I, ConstantInt::getTrue(I.getType()));
5145 return replaceInstUsesWith(I, ConstantInt::getFalse(I.getType()));
5150 assert(!isa<ConstantInt>(Op1) && "ICMP_SLE with ConstantInt not folded!");
5152 return replaceInstUsesWith(I, ConstantInt::getTrue(I.getType()));
5154 return replaceInstUsesWith(I, ConstantInt::getFalse(I.getType()));
5159 assert(!isa<ConstantInt>(Op1) && "ICMP_UGE with ConstantInt not folded!");
5161 return replaceInstUsesWith(I, ConstantInt::getTrue(I.getType()));
5163 return replaceInstUsesWith(I, ConstantInt::getFalse(I.getType()));
5168 assert(!isa<ConstantInt>(Op1) && "ICMP_ULE with ConstantInt not folded!");
5170 return replaceInstUsesWith(I, ConstantInt::getTrue(I.getType()));
5172 return replaceInstUsesWith(I, ConstantInt::getFalse(I.getType()));
5203 auto ConstantIsOk = [WillIncrement, IsSigned](ConstantInt *C) {
5208 if (auto *CI = dyn_cast<ConstantInt>(C)) {
5224 auto *CI = dyn_cast<ConstantInt>(Elt);
5247 Constant *OneOrNegOne = ConstantInt::get(Type, WillIncrement ? 1 : -1, true);
5675 ConstantInt::get(Op1->getType(), ~(*C)));