Lines Matching defs:ICmp
861 auto *ICmp = dyn_cast<ICmpInst>(U->getUser());
866 if (ICmp && ICmp->isEquality() && getUnderlyingObject(*U) == Alloca) {
869 auto Res = ICmps.insert({ICmp, 0});
885 for (auto [ICmp, Operands] : Tracker.ICmps) {
892 ICmp->getType(), ICmp->getPredicate() == ICmpInst::ICMP_NE);
893 replaceInstUsesWith(*ICmp, Res);
894 eraseInstFromFunction(*ICmp);
1166 return ICmpInst::Create(Instruction::ICmp, Pred, Masked, Zero);
1195 return ICmpInst::Create(Instruction::ICmp,
4020 return CmpInst::Create(Instruction::ICmp, ICmpInst::ICMP_EQ, X,
4024 return CmpInst::Create(Instruction::ICmp, ICmpInst::ICMP_NE, X,
4033 return CmpInst::Create(Instruction::ICmp, ICmpInst::ICMP_ULT,
4041 return CmpInst::Create(Instruction::ICmp, ICmpInst::ICMP_UGT,
4054 return CmpInst::Create(Instruction::ICmp, ICmpInst::ICMP_EQ,
4062 return CmpInst::Create(Instruction::ICmp, ICmpInst::ICMP_NE,
4749 return ICmpInst::Create(Instruction::ICmp, Pred, X,
4763 return CmpInst::Create(Instruction::ICmp, Pred, And, Zero);
5414 return ICmpInst::Create(Instruction::ICmp, Pred, Y, Z);
5431 return ICmpInst::Create(Instruction::ICmp, NewPred, X, Y);
5737 if (Instruction *ICmp = foldICmpIntrinsicWithIntrinsic(I, Builder))
5738 return ICmp;
5820 Instruction *InstCombinerImpl::foldICmpWithTrunc(ICmpInst &ICmp) {
5821 ICmpInst::Predicate Pred = ICmp.getPredicate();
5822 Value *Op0 = ICmp.getOperand(0), *Op1 = ICmp.getOperand(1);
5872 foldICmpIntrinsicWithConstant(ICmp, II, C->zext(SrcBits)))
5880 Instruction *InstCombinerImpl::foldICmpWithZextOrSext(ICmpInst &ICmp) {
5881 assert(isa<CastInst>(ICmp.getOperand(0)) && "Expected cast for operand 0");
5882 auto *CastOp0 = cast<CastInst>(ICmp.getOperand(0));
5888 bool IsSignedCmp = ICmp.isSigned();
5892 if (match(ICmp.getOperand(1), m_ZExtOrSExt(m_Value(Y)))) {
5893 bool IsZext0 = isa<ZExtInst>(ICmp.getOperand(0));
5894 bool IsZext1 = isa<ZExtInst>(ICmp.getOperand(1));
5901 if (ICmp.isEquality() && X->getType()->isIntOrIntVectorTy(1) &&
5903 return new ICmpInst(ICmp.getPredicate(), Builder.CreateOr(X, Y),
5909 auto *NonNegInst0 = dyn_cast<PossiblyNonNegInst>(ICmp.getOperand(0));
5910 auto *NonNegInst1 = dyn_cast<PossiblyNonNegInst>(ICmp.getOperand(1));
5925 if (!ICmp.getOperand(0)->hasOneUse() && !ICmp.getOperand(1)->hasOneUse())
5940 if (ICmp.isEquality())
5941 return new ICmpInst(ICmp.getPredicate(), X, Y);
5946 return new ICmpInst(ICmp.getPredicate(), X, Y);
5949 return new ICmpInst(ICmp.getUnsignedPredicate(), X, Y);
5953 auto *C = dyn_cast<Constant>(ICmp.getOperand(1));
5961 if (ICmp.isEquality())
5962 return new ICmpInst(ICmp.getPredicate(), X, Res);
5967 return new ICmpInst(ICmp.getPredicate(), X, Res);
5970 return new ICmpInst(ICmp.getUnsignedPredicate(), X, Res);
5983 if (ICmp.getPredicate() == ICmpInst::ICMP_ULT)
5988 assert(ICmp.getPredicate() == ICmpInst::ICMP_UGT && "ICmp should be folded!");
5993 Instruction *InstCombinerImpl::foldICmpWithCastOp(ICmpInst &ICmp) {
5994 // If any operand of ICmp is a inttoptr roundtrip cast then remove it as
5997 Value *SimplifiedOp0 = simplifyIntToPtrRoundTripCast(ICmp.getOperand(0));
5998 Value *SimplifiedOp1 = simplifyIntToPtrRoundTripCast(ICmp.getOperand(1));
6000 return new ICmpInst(ICmp.getPredicate(),
6001 SimplifiedOp0 ? SimplifiedOp0 : ICmp.getOperand(0),
6002 SimplifiedOp1 ? SimplifiedOp1 : ICmp.getOperand(1));
6004 auto *CastOp0 = dyn_cast<CastInst>(ICmp.getOperand(0));
6007 if (!isa<Constant>(ICmp.getOperand(1)) && !isa<CastInst>(ICmp.getOperand(1)))
6026 if (auto *PtrToIntOp1 = dyn_cast<PtrToIntOperator>(ICmp.getOperand(1))) {
6030 } else if (auto *RHSC = dyn_cast<Constant>(ICmp.getOperand(1))) {
6035 return new ICmpInst(ICmp.getPredicate(), Op0Src, NewOp1);
6038 if (Instruction *R = foldICmpWithTrunc(ICmp))
6041 return foldICmpWithZextOrSext(ICmp);
6770 Instruction::ICmp, Pred1, X,
6915 llvm_unreachable("ICmp i1 X, C not simplified as expected.");
6924 llvm_unreachable("ICmp i1 X, C not simplified as expected.");
7019 return CmpInst::Create(Instruction::ICmp, NewPred, NewX, Zero);
7131 return ICmpInst::Create(Instruction::ICmp, I.getPredicate(),
7179 return ICmpInst::Create(Instruction::ICmp, OuterPred, LHS, RHS,
7326 return CmpInst::Create(Instruction::ICmp, I.getPredicate(), V, Op1);
7330 return CmpInst::Create(Instruction::ICmp, I.getPredicate(), V, Op1);