Lines Matching refs:CmpInst

107     LoadInst *LI, GetElementPtrInst *GEP, GlobalVariable *GV, CmpInst &ICI,  in foldCmpLoadFromIndexedGlobal()
907 if (IndicesTheSame && CmpInst::makeCmpResultType(BaseType) == I.getType()) in foldGEPICmp()
1081 !CmpInst::isTrueWhenEqual(ICI.getPredicate())); in foldAllocaCmp()
1141 auto getICmp = [&I](CmpInst::Predicate Pred, Value *LHS, Value *RHS) { in foldICmpShrConstConst()
1143 Pred = CmpInst::getInversePredicate(Pred); in foldICmpShrConstConst()
1200 auto getICmp = [&I](CmpInst::Predicate Pred, Value *LHS, Value *RHS) { in foldICmpShlConstConst()
1202 Pred = CmpInst::getInversePredicate(Pred); in foldICmpShlConstConst()
1377 CmpInst::Predicate Pred = Cmp.getPredicate(); in foldICmpWithZero()
1428 CmpInst::Predicate Pred = Cmp.getPredicate(); in foldICmpWithConstant()
1487 CmpInst::Predicate Pred = Cmp.getPredicate(); in foldICmpWithDominatingICmp()
1504 CmpInst::getInversePredicate(DomPred), *DomC); in foldICmpWithDominatingICmp()
1877 auto NewPred = TrueIfNeg ? CmpInst::ICMP_EQ : CmpInst::ICMP_NE; in foldICmpAndConstant()
1903 Pred == CmpInst::ICMP_EQ ? CmpInst::ICMP_UGT : CmpInst::ICMP_ULE; in foldICmpAndConstant()
1930 Pred = (Pred == CmpInst::ICMP_EQ) ? CmpInst::ICMP_ULE : CmpInst::ICMP_UGT; in foldICmpOrConstant()
1967 auto BOpc = Pred == CmpInst::ICMP_EQ ? Instruction::And : Instruction::Or; in foldICmpOrConstant()
1980 auto BOpc = Pred == CmpInst::ICMP_EQ ? Instruction::And : Instruction::Or; in foldICmpOrConstant()
2266 CmpInst::Predicate Pred = Cmp.getPredicate(); in foldICmpShrConstant()
2281 return new ICmpInst(TrueIfSigned ? CmpInst::ICMP_EQ : CmpInst::ICMP_NE, in foldICmpShrConstant()
2289 (Pred == CmpInst::ICMP_UGT || Pred == CmpInst::ICMP_ULT)) { in foldICmpShrConstant()
2290 bool IsUGT = Pred == CmpInst::ICMP_UGT; in foldICmpShrConstant()
2298 auto NewPred = IsUGT ? CmpInst::ICMP_ULT : CmpInst::ICMP_UGE; in foldICmpShrConstant()
2321 if (IsExact || Pred == CmpInst::ICMP_SLT || Pred == CmpInst::ICMP_ULT) { in foldICmpShrConstant()
2329 if (Pred == CmpInst::ICMP_SGT) { in foldICmpShrConstant()
2336 if (Pred == CmpInst::ICMP_UGT) { in foldICmpShrConstant()
2351 if (Pred == CmpInst::ICMP_UGT) { in foldICmpShrConstant()
2352 return new ICmpInst(CmpInst::ICMP_SLT, X, in foldICmpShrConstant()
2355 if (Pred == CmpInst::ICMP_ULT) { in foldICmpShrConstant()
2356 return new ICmpInst(CmpInst::ICMP_SGT, X, in foldICmpShrConstant()
2361 if (Pred == CmpInst::ICMP_ULT || (Pred == CmpInst::ICMP_UGT && IsExact)) { in foldICmpShrConstant()
2368 if (Pred == CmpInst::ICMP_UGT) { in foldICmpShrConstant()
2395 if (Pred == CmpInst::ICMP_EQ) in foldICmpShrConstant()
2396 return new ICmpInst(CmpInst::ICMP_ULT, X, in foldICmpShrConstant()
2399 return new ICmpInst(CmpInst::ICMP_UGT, X, in foldICmpShrConstant()
2777 const CmpInst::Predicate Pred = Cmp.getPredicate(); in foldICmpAddConstant()
2819 if (Pred == CmpInst::ICMP_UGT && C == *C2 + SMax) in foldICmpAddConstant()
2823 if (Pred == CmpInst::ICMP_ULT && C == *C2 + SMin) in foldICmpAddConstant()
2827 if (Pred == CmpInst::ICMP_SGT && C == *C2 - 1) in foldICmpAddConstant()
2831 if (Pred == CmpInst::ICMP_SLT && C == *C2) in foldICmpAddConstant()
3470 return CmpInst::Create(Instruction::ICmp, ICmpInst::ICMP_EQ, X, in foldICmpIntrinsicWithConstant()
3474 return CmpInst::Create(Instruction::ICmp, ICmpInst::ICMP_NE, X, in foldICmpIntrinsicWithConstant()
3483 return CmpInst::Create(Instruction::ICmp, ICmpInst::ICMP_ULT, in foldICmpIntrinsicWithConstant()
3491 return CmpInst::Create(Instruction::ICmp, ICmpInst::ICMP_UGT, in foldICmpIntrinsicWithConstant()
3504 return CmpInst::Create(Instruction::ICmp, ICmpInst::ICMP_EQ, in foldICmpIntrinsicWithConstant()
3512 return CmpInst::Create(Instruction::ICmp, ICmpInst::ICMP_NE, in foldICmpIntrinsicWithConstant()
4049 CmpInst::Predicate Pred; in foldICmpXNegX()
4082 const CmpInst::Predicate Pred = I.getPredicate(); in foldICmpBinOp()
4124 CmpInst::Predicate NewPred = in foldICmpBinOp()
4133 CmpInst::Predicate NewPred = in foldICmpBinOp()
4144 (CmpInst::isUnsigned(Pred) && BO0->hasNoUnsignedWrap()) || in foldICmpBinOp()
4145 (CmpInst::isSigned(Pred) && BO0->hasNoSignedWrap()); in foldICmpBinOp()
4149 (CmpInst::isUnsigned(Pred) && BO1->hasNoUnsignedWrap()) || in foldICmpBinOp()
4150 (CmpInst::isSigned(Pred) && BO1->hasNoSignedWrap()); in foldICmpBinOp()
4203 if (A && NoOp0WrapProblem && Pred == CmpInst::ICMP_SLT && in foldICmpBinOp()
4205 return new ICmpInst(CmpInst::ICMP_SLE, A, Op1); in foldICmpBinOp()
4208 if (A && NoOp0WrapProblem && Pred == CmpInst::ICMP_SGE && in foldICmpBinOp()
4210 return new ICmpInst(CmpInst::ICMP_SGT, A, Op1); in foldICmpBinOp()
4213 if (A && NoOp0WrapProblem && Pred == CmpInst::ICMP_SLE && match(B, m_One())) in foldICmpBinOp()
4214 return new ICmpInst(CmpInst::ICMP_SLT, A, Op1); in foldICmpBinOp()
4217 if (A && NoOp0WrapProblem && Pred == CmpInst::ICMP_SGT && match(B, m_One())) in foldICmpBinOp()
4218 return new ICmpInst(CmpInst::ICMP_SGE, A, Op1); in foldICmpBinOp()
4221 if (C && NoOp1WrapProblem && Pred == CmpInst::ICMP_SGT && in foldICmpBinOp()
4223 return new ICmpInst(CmpInst::ICMP_SGE, Op0, C); in foldICmpBinOp()
4226 if (C && NoOp1WrapProblem && Pred == CmpInst::ICMP_SLE && in foldICmpBinOp()
4228 return new ICmpInst(CmpInst::ICMP_SLT, Op0, C); in foldICmpBinOp()
4231 if (C && NoOp1WrapProblem && Pred == CmpInst::ICMP_SGE && match(D, m_One())) in foldICmpBinOp()
4232 return new ICmpInst(CmpInst::ICMP_SGT, Op0, C); in foldICmpBinOp()
4235 if (C && NoOp1WrapProblem && Pred == CmpInst::ICMP_SLT && match(D, m_One())) in foldICmpBinOp()
4236 return new ICmpInst(CmpInst::ICMP_SLE, Op0, C); in foldICmpBinOp()
4248 if (A && NoOp0WrapProblem && Pred == CmpInst::ICMP_ULE && match(B, m_One())) in foldICmpBinOp()
4249 return new ICmpInst(CmpInst::ICMP_ULT, A, Op1); in foldICmpBinOp()
4252 if (A && NoOp0WrapProblem && Pred == CmpInst::ICMP_UGT && match(B, m_One())) in foldICmpBinOp()
4253 return new ICmpInst(CmpInst::ICMP_UGE, A, Op1); in foldICmpBinOp()
4256 if (C && NoOp1WrapProblem && Pred == CmpInst::ICMP_UGE && match(D, m_One())) in foldICmpBinOp()
4257 return new ICmpInst(CmpInst::ICMP_UGT, Op0, C); in foldICmpBinOp()
4260 if (C && NoOp1WrapProblem && Pred == CmpInst::ICMP_ULT && match(D, m_One())) in foldICmpBinOp()
4261 return new ICmpInst(CmpInst::ICMP_ULE, Op0, C); in foldICmpBinOp()
4336 return new ICmpInst(CmpInst::getFlippedStrictnessPredicate(Pred), B, A); in foldICmpBinOp()
4340 return new ICmpInst(CmpInst::getFlippedStrictnessPredicate(Pred), C, D); in foldICmpBinOp()
4523 if (Pred == CmpInst::ICMP_EQ || Pred == CmpInst::ICMP_SGE) in foldICmpWithMinMax()
4528 if (Pred == CmpInst::ICMP_NE || Pred == CmpInst::ICMP_SLT) in foldICmpWithMinMax()
4540 if (Pred == CmpInst::ICMP_EQ || Pred == CmpInst::ICMP_SLE) in foldICmpWithMinMax()
4545 if (Pred == CmpInst::ICMP_NE || Pred == CmpInst::ICMP_SGT) in foldICmpWithMinMax()
4557 if (Pred == CmpInst::ICMP_EQ || Pred == CmpInst::ICMP_UGE) in foldICmpWithMinMax()
4562 if (Pred == CmpInst::ICMP_NE || Pred == CmpInst::ICMP_ULT) in foldICmpWithMinMax()
4574 if (Pred == CmpInst::ICMP_EQ || Pred == CmpInst::ICMP_ULE) in foldICmpWithMinMax()
4579 if (Pred == CmpInst::ICMP_NE || Pred == CmpInst::ICMP_UGT) in foldICmpWithMinMax()
4596 const CmpInst::Predicate Pred = I.getPredicate(); in foldICmpEquality()
4929 return new ICmpInst(CmpInst::ICMP_SGT, X, Constant::getAllOnesValue(SrcTy)); in foldICmpWithZextOrSext()
4934 return new ICmpInst(CmpInst::ICMP_SLT, X, Constant::getNullValue(SrcTy)); in foldICmpWithZextOrSext()
5614 I, ConstantInt::getBool(I.getType(), Pred == CmpInst::ICMP_NE)); in foldICmpUsingKnownBits()
5642 Pred == CmpInst::ICMP_EQ ? CmpInst::ICMP_UGE : CmpInst::ICMP_ULT; in foldICmpUsingKnownBits()
5747 llvm::Optional<std::pair<CmpInst::Predicate, Constant *>>
5748 InstCombiner::getFlippedStrictnessPredicateAndConstant(CmpInst::Predicate Pred, in getFlippedStrictnessPredicateAndConstant()
5756 CmpInst::Predicate UnsignedPred = ICmpInst::getUnsignedPredicate(Pred); in getFlippedStrictnessPredicateAndConstant()
5804 CmpInst::Predicate NewPred = CmpInst::getFlippedStrictnessPredicate(Pred); in getFlippedStrictnessPredicateAndConstant()
5838 CmpInst *InstCombinerImpl::canonicalizeICmpPredicate(CmpInst &I) { in canonicalizeICmpPredicate()
5840 CmpInst::Predicate Pred = I.getPredicate(); in canonicalizeICmpPredicate()
5850 I.setPredicate(CmpInst::getInversePredicate(Pred)); in canonicalizeICmpPredicate()
5870 case CmpInst::ICMP_EQ: // A == 0 -> !A in canonicalizeICmpBool()
5871 case CmpInst::ICMP_ULE: // A <=u 0 -> !A in canonicalizeICmpBool()
5872 case CmpInst::ICMP_SGE: // A >=s 0 -> !A in canonicalizeICmpBool()
5879 case CmpInst::ICMP_NE: // A != 1 -> !A in canonicalizeICmpBool()
5880 case CmpInst::ICMP_ULT: // A <u 1 -> !A in canonicalizeICmpBool()
5881 case CmpInst::ICMP_SGT: // A >s -1 -> !A in canonicalizeICmpBool()
5979 return CmpInst::Create(Instruction::ICmp, NewPred, NewX, Zero); in foldICmpWithHighBitMask()
5982 static Instruction *foldVectorCmp(CmpInst &Cmp, in foldVectorCmp()
5984 const CmpInst::Predicate Pred = Cmp.getPredicate(); in foldVectorCmp()
6028 CmpInst::Predicate Pred = I.getPredicate(); in foldICmpOfUAddOv()
6149 return CmpInst::Create(Instruction::ICmp, I.getPredicate(), V, Op1); in visitICmpInst()
6153 return CmpInst::Create(Instruction::ICmp, I.getPredicate(), V, Op1); in visitICmpInst()
6730 CmpInst::Predicate Pred = I.getPredicate(); in foldFCmpFNegCommonOp()
6759 const CmpInst::Predicate Pred = I.getPredicate(); in visitFCmpInst()
6793 if (Pred == CmpInst::FCMP_ORD || Pred == CmpInst::FCMP_UNO) { in visitFCmpInst()