Lines Matching defs:ICmp

884       auto *ICmp = dyn_cast<ICmpInst>(U->getUser());
889 if (ICmp && ICmp->isEquality() && getUnderlyingObject(*U) == Alloca) {
892 ICmps[ICmp] |= 1u << U->getOperandNo();
907 for (auto [ICmp, Operands] : Tracker.ICmps) {
914 ICmp->getType(), ICmp->getPredicate() == ICmpInst::ICMP_NE);
915 replaceInstUsesWith(*ICmp, Res);
916 eraseInstFromFunction(*ICmp);
1188 return ICmpInst::Create(Instruction::ICmp, Pred, Masked, Zero);
1217 return ICmpInst::Create(Instruction::ICmp,
4191 return CmpInst::Create(Instruction::ICmp, ICmpInst::ICMP_EQ, X,
4195 return CmpInst::Create(Instruction::ICmp, ICmpInst::ICMP_NE, X,
4204 return CmpInst::Create(Instruction::ICmp, ICmpInst::ICMP_ULT,
4212 return CmpInst::Create(Instruction::ICmp, ICmpInst::ICMP_UGT,
4225 return CmpInst::Create(Instruction::ICmp, ICmpInst::ICMP_EQ,
4233 return CmpInst::Create(Instruction::ICmp, ICmpInst::ICMP_NE,
4925 return ICmpInst::Create(Instruction::ICmp, Pred, X,
4939 return CmpInst::Create(Instruction::ICmp, Pred, And, Zero);
5624 return ICmpInst::Create(Instruction::ICmp, Pred, Y, Z);
5641 return ICmpInst::Create(Instruction::ICmp, NewPred, X, Y);
5947 if (Instruction *ICmp = foldICmpIntrinsicWithIntrinsic(I, Builder))
5948 return ICmp;
6027 Instruction *InstCombinerImpl::foldICmpWithTrunc(ICmpInst &ICmp) {
6028 ICmpInst::Predicate Pred = ICmp.getPredicate();
6029 Value *Op0 = ICmp.getOperand(0), *Op1 = ICmp.getOperand(1);
6062 foldICmpIntrinsicWithConstant(ICmp, II, C->zext(SrcBits)))
6070 Instruction *InstCombinerImpl::foldICmpWithZextOrSext(ICmpInst &ICmp) {
6071 assert(isa<CastInst>(ICmp.getOperand(0)) && "Expected cast for operand 0");
6072 auto *CastOp0 = cast<CastInst>(ICmp.getOperand(0));
6078 bool IsSignedCmp = ICmp.isSigned();
6082 if (match(ICmp.getOperand(1), m_ZExtOrSExt(m_Value(Y)))) {
6083 bool IsZext0 = isa<ZExtInst>(ICmp.getOperand(0));
6084 bool IsZext1 = isa<ZExtInst>(ICmp.getOperand(1));
6091 if (ICmp.isEquality() && X->getType()->isIntOrIntVectorTy(1) &&
6093 return new ICmpInst(ICmp.getPredicate(), Builder.CreateOr(X, Y),
6099 auto *NonNegInst0 = dyn_cast<PossiblyNonNegInst>(ICmp.getOperand(0));
6100 auto *NonNegInst1 = dyn_cast<PossiblyNonNegInst>(ICmp.getOperand(1));
6115 if (!ICmp.getOperand(0)->hasOneUse() && !ICmp.getOperand(1)->hasOneUse())
6130 if (ICmp.isEquality())
6131 return new ICmpInst(ICmp.getPredicate(), X, Y);
6136 return new ICmpInst(ICmp.getPredicate(), X, Y);
6139 return new ICmpInst(ICmp.getUnsignedPredicate(), X, Y);
6143 auto *C = dyn_cast<Constant>(ICmp.getOperand(1));
6151 if (ICmp.isEquality())
6152 return new ICmpInst(ICmp.getPredicate(), X, Res);
6157 return new ICmpInst(ICmp.getPredicate(), X, Res);
6160 return new ICmpInst(ICmp.getUnsignedPredicate(), X, Res);
6173 if (ICmp.getPredicate() == ICmpInst::ICMP_ULT)
6178 assert(ICmp.getPredicate() == ICmpInst::ICMP_UGT && "ICmp should be folded!");
6183 Instruction *InstCombinerImpl::foldICmpWithCastOp(ICmpInst &ICmp) {
6184 // If any operand of ICmp is a inttoptr roundtrip cast then remove it as
6187 Value *SimplifiedOp0 = simplifyIntToPtrRoundTripCast(ICmp.getOperand(0));
6188 Value *SimplifiedOp1 = simplifyIntToPtrRoundTripCast(ICmp.getOperand(1));
6190 return new ICmpInst(ICmp.getPredicate(),
6191 SimplifiedOp0 ? SimplifiedOp0 : ICmp.getOperand(0),
6192 SimplifiedOp1 ? SimplifiedOp1 : ICmp.getOperand(1));
6194 auto *CastOp0 = dyn_cast<CastInst>(ICmp.getOperand(0));
6197 if (!isa<Constant>(ICmp.getOperand(1)) && !isa<CastInst>(ICmp.getOperand(1)))
6216 if (auto *PtrToIntOp1 = dyn_cast<PtrToIntOperator>(ICmp.getOperand(1))) {
6220 } else if (auto *RHSC = dyn_cast<Constant>(ICmp.getOperand(1))) {
6225 return new ICmpInst(ICmp.getPredicate(), Op0Src, NewOp1);
6232 if (auto *IntToPtrOp1 = dyn_cast<IntToPtrInst>(ICmp.getOperand(1))) {
6236 } else if (auto *RHSC = dyn_cast<Constant>(ICmp.getOperand(1))) {
6241 return new ICmpInst(ICmp.getPredicate(), Op0Src, NewOp1);
6244 if (Instruction *R = foldICmpWithTrunc(ICmp))
6247 return foldICmpWithZextOrSext(ICmp);
6930 Instruction::ICmp, Pred1, X,
7001 llvm_unreachable("ICmp i1 X, C not simplified as expected.");
7010 llvm_unreachable("ICmp i1 X, C not simplified as expected.");
7105 return CmpInst::Create(Instruction::ICmp, NewPred, NewX, Zero);
7217 return ICmpInst::Create(Instruction::ICmp, I.getPredicate(),
7265 return ICmpInst::Create(Instruction::ICmp, OuterPred, LHS, RHS,
7412 return CmpInst::Create(Instruction::ICmp, I.getPredicate(), V, Op1);
7416 return CmpInst::Create(Instruction::ICmp, I.getPredicate(), V, Op1);