Lines Matching refs:ICmp
860 auto *ICmp = dyn_cast<ICmpInst>(U->getUser()); in foldAllocaCmp() local
865 if (ICmp && ICmp->isEquality() && getUnderlyingObject(*U) == Alloca) { in foldAllocaCmp()
868 auto Res = ICmps.insert({ICmp, 0}); in foldAllocaCmp()
884 for (auto [ICmp, Operands] : Tracker.ICmps) { in foldAllocaCmp()
891 ICmp->getType(), ICmp->getPredicate() == ICmpInst::ICMP_NE); in foldAllocaCmp()
892 replaceInstUsesWith(*ICmp, Res); in foldAllocaCmp()
893 eraseInstFromFunction(*ICmp); in foldAllocaCmp()
1165 return ICmpInst::Create(Instruction::ICmp, Pred, Masked, Zero); in foldIRemByPowerOfTwoToBitTest()
1194 return ICmpInst::Create(Instruction::ICmp, in foldSignBitTest()
3857 return CmpInst::Create(Instruction::ICmp, ICmpInst::ICMP_EQ, X, in foldICmpIntrinsicWithConstant()
3861 return CmpInst::Create(Instruction::ICmp, ICmpInst::ICMP_NE, X, in foldICmpIntrinsicWithConstant()
3870 return CmpInst::Create(Instruction::ICmp, ICmpInst::ICMP_ULT, in foldICmpIntrinsicWithConstant()
3878 return CmpInst::Create(Instruction::ICmp, ICmpInst::ICMP_UGT, in foldICmpIntrinsicWithConstant()
3891 return CmpInst::Create(Instruction::ICmp, ICmpInst::ICMP_EQ, in foldICmpIntrinsicWithConstant()
3899 return CmpInst::Create(Instruction::ICmp, ICmpInst::ICMP_NE, in foldICmpIntrinsicWithConstant()
4455 return ICmpInst::Create(Instruction::ICmp, Pred, X, in foldICmpXNegX()
4469 return CmpInst::Create(Instruction::ICmp, Pred, And, Zero); in foldICmpXNegX()
5086 return ICmpInst::Create(Instruction::ICmp, Pred, Y, Z); in foldICmpWithMinMax()
5103 return ICmpInst::Create(Instruction::ICmp, NewPred, X, Y); in foldICmpWithMinMax()
5408 if (Instruction *ICmp = foldICmpIntrinsicWithIntrinsic(I, Builder)) in foldICmpEquality() local
5409 return ICmp; in foldICmpEquality()
5491 Instruction *InstCombinerImpl::foldICmpWithTrunc(ICmpInst &ICmp) { in foldICmpWithTrunc() argument
5492 ICmpInst::Predicate Pred = ICmp.getPredicate(); in foldICmpWithTrunc()
5493 Value *Op0 = ICmp.getOperand(0), *Op1 = ICmp.getOperand(1); in foldICmpWithTrunc()
5543 foldICmpIntrinsicWithConstant(ICmp, II, C->zext(SrcBits))) in foldICmpWithTrunc()
5551 Instruction *InstCombinerImpl::foldICmpWithZextOrSext(ICmpInst &ICmp) { in foldICmpWithZextOrSext() argument
5552 assert(isa<CastInst>(ICmp.getOperand(0)) && "Expected cast for operand 0"); in foldICmpWithZextOrSext()
5553 auto *CastOp0 = cast<CastInst>(ICmp.getOperand(0)); in foldICmpWithZextOrSext()
5559 bool IsSignedCmp = ICmp.isSigned(); in foldICmpWithZextOrSext()
5563 if (match(ICmp.getOperand(1), m_ZExtOrSExt(m_Value(Y)))) { in foldICmpWithZextOrSext()
5564 bool IsZext0 = isa<ZExtInst>(ICmp.getOperand(0)); in foldICmpWithZextOrSext()
5565 bool IsZext1 = isa<ZExtInst>(ICmp.getOperand(1)); in foldICmpWithZextOrSext()
5572 if (ICmp.isEquality() && X->getType()->isIntOrIntVectorTy(1) && in foldICmpWithZextOrSext()
5574 return new ICmpInst(ICmp.getPredicate(), Builder.CreateOr(X, Y), in foldICmpWithZextOrSext()
5580 auto *NonNegInst0 = dyn_cast<PossiblyNonNegInst>(ICmp.getOperand(0)); in foldICmpWithZextOrSext()
5581 auto *NonNegInst1 = dyn_cast<PossiblyNonNegInst>(ICmp.getOperand(1)); in foldICmpWithZextOrSext()
5596 if (!ICmp.getOperand(0)->hasOneUse() && !ICmp.getOperand(1)->hasOneUse()) in foldICmpWithZextOrSext()
5611 if (ICmp.isEquality()) in foldICmpWithZextOrSext()
5612 return new ICmpInst(ICmp.getPredicate(), X, Y); in foldICmpWithZextOrSext()
5617 return new ICmpInst(ICmp.getPredicate(), X, Y); in foldICmpWithZextOrSext()
5620 return new ICmpInst(ICmp.getUnsignedPredicate(), X, Y); in foldICmpWithZextOrSext()
5624 auto *C = dyn_cast<Constant>(ICmp.getOperand(1)); in foldICmpWithZextOrSext()
5632 if (ICmp.isEquality()) in foldICmpWithZextOrSext()
5633 return new ICmpInst(ICmp.getPredicate(), X, Res); in foldICmpWithZextOrSext()
5638 return new ICmpInst(ICmp.getPredicate(), X, Res); in foldICmpWithZextOrSext()
5641 return new ICmpInst(ICmp.getUnsignedPredicate(), X, Res); in foldICmpWithZextOrSext()
5654 if (ICmp.getPredicate() == ICmpInst::ICMP_ULT) in foldICmpWithZextOrSext()
5659 assert(ICmp.getPredicate() == ICmpInst::ICMP_UGT && "ICmp should be folded!"); in foldICmpWithZextOrSext()
5664 Instruction *InstCombinerImpl::foldICmpWithCastOp(ICmpInst &ICmp) { in foldICmpWithCastOp() argument
5668 Value *SimplifiedOp0 = simplifyIntToPtrRoundTripCast(ICmp.getOperand(0)); in foldICmpWithCastOp()
5669 Value *SimplifiedOp1 = simplifyIntToPtrRoundTripCast(ICmp.getOperand(1)); in foldICmpWithCastOp()
5671 return new ICmpInst(ICmp.getPredicate(), in foldICmpWithCastOp()
5672 SimplifiedOp0 ? SimplifiedOp0 : ICmp.getOperand(0), in foldICmpWithCastOp()
5673 SimplifiedOp1 ? SimplifiedOp1 : ICmp.getOperand(1)); in foldICmpWithCastOp()
5675 auto *CastOp0 = dyn_cast<CastInst>(ICmp.getOperand(0)); in foldICmpWithCastOp()
5678 if (!isa<Constant>(ICmp.getOperand(1)) && !isa<CastInst>(ICmp.getOperand(1))) in foldICmpWithCastOp()
5697 if (auto *PtrToIntOp1 = dyn_cast<PtrToIntOperator>(ICmp.getOperand(1))) { in foldICmpWithCastOp()
5701 } else if (auto *RHSC = dyn_cast<Constant>(ICmp.getOperand(1))) { in foldICmpWithCastOp()
5706 return new ICmpInst(ICmp.getPredicate(), Op0Src, NewOp1); in foldICmpWithCastOp()
5709 if (Instruction *R = foldICmpWithTrunc(ICmp)) in foldICmpWithCastOp()
5712 return foldICmpWithZextOrSext(ICmp); in foldICmpWithCastOp()
6441 Instruction::ICmp, Pred1, X, in foldICmpUsingBoolRange()
6690 return CmpInst::Create(Instruction::ICmp, NewPred, NewX, Zero); in foldICmpWithHighBitMask()
6802 return ICmpInst::Create(Instruction::ICmp, I.getPredicate(), in foldICmpInvariantGroup()
6850 return ICmpInst::Create(Instruction::ICmp, OuterPred, LHS, RHS, in foldReductionIdiom()
6963 return CmpInst::Create(Instruction::ICmp, I.getPredicate(), V, Op1); in visitICmpInst()
6967 return CmpInst::Create(Instruction::ICmp, I.getPredicate(), V, Op1); in visitICmpInst()