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