Lines Matching defs:IC

57                                             InstCombinerImpl &IC) {
103 IC.getSimplifyQuery().getWithInstruction(&Sel)))
110 return IC.replaceOperand(Sel, IsEq ? 1 : 2, Y);
690 static Value *foldSelectICmpLshrAshr(const ICmpInst *IC, Value *TrueVal,
693 ICmpInst::Predicate Pred = IC->getPredicate();
694 Value *CmpLHS = IC->getOperand(0);
695 Value *CmpRHS = IC->getOperand(1);
719 return Builder.CreateAShr(X, Y, IC->getName(), IsExact);
745 static Value *foldSelectICmpAndBinOp(const ICmpInst *IC, Value *TrueVal,
751 TrueVal->getType()->isVectorTy() != IC->getType()->isVectorTy())
754 Value *CmpLHS = IC->getOperand(0);
755 Value *CmpRHS = IC->getOperand(1);
759 CmpInst::Predicate Pred = IC->getPredicate();
760 if (IC->isEquality()) {
811 (IC->hasOneUse() + BinOp->hasOneUse()))
877 static Instruction *foldSelectZeroOrMul(SelectInst &SI, InstCombinerImpl &IC) {
913 auto *FrY = IC.InsertNewInstBefore(new FreezeInst(Y, Y->getName() + ".fr"),
915 IC.replaceOperand(*FalseValI, FalseValI->getOperand(0) == Y ? 0 : 1, FrY);
916 return IC.replaceInstUsesWith(SI, FalseValI);
1186 InstCombinerImpl &IC) {
1230 IC.addToWorklist(II);
1242 IC.addToWorklist(II);
1249 InstCombinerImpl &IC) {
1268 IC.Builder.CreateBinaryIntrinsic(Intrinsic::abs, LHS, IntMinIsPoisonC);
1271 return IC.Builder.CreateNeg(Abs); // Always without NSW flag!
1277 return IC.Builder.CreateBinaryIntrinsic(IntrinsicID, LHS, RHS);
1476 InstCombiner &IC) {
1605 ICmpInst::Predicate::ICMP_SGE, C2, ThresholdLowIncl, IC.getDataLayout());
1610 ICmpInst::Predicate::ICMP_SLE, C2, ThresholdHighExcl, IC.getDataLayout());
1654 InstCombinerImpl &IC) {
1711 InstCombiner::BuilderTy::InsertPointGuard Guard(IC.Builder);
1712 IC.Builder.SetInsertPoint(&Sel);
1715 Value *NewCmp = IC.Builder.CreateICmp(Pred, X, FlippedStrictness->second,
1717 IC.replaceOperand(Sel, 0, NewCmp);
1838 InstCombinerImpl &IC) {
2296 InstCombinerImpl &IC) {
2309 return IC.replaceOperand(
2310 Sel, 0, IC.Builder.CreateVectorSplat(Ty->getElementCount(), Cond));
2717 static Instruction *foldSelectWithSRem(SelectInst &SI, InstCombinerImpl &IC,
2750 IC.isKnownToBeAPowerOfTwo(Remainder, /*OrZero=*/true) &&
2824 InstCombinerImpl &IC) {
2843 Value *Fabs = IC.Builder.CreateUnaryIntrinsic(Intrinsic::fabs, X, &SI);
2844 return IC.replaceInstUsesWith(SI, Fabs);
2847 Value *Fabs = IC.Builder.CreateUnaryIntrinsic(Intrinsic::fabs, X, &SI);
2848 return IC.replaceInstUsesWith(SI, Fabs);
2890 Value *Fabs = IC.Builder.CreateUnaryIntrinsic(Intrinsic::fabs, X, &SI);
2891 return IC.replaceInstUsesWith(SI, Fabs);
2894 Value *Fabs = IC.Builder.CreateUnaryIntrinsic(Intrinsic::fabs, X, &SI);
2925 Value *Fabs = IC.Builder.CreateUnaryIntrinsic(Intrinsic::fabs, X, &SI);
2927 return IC.replaceInstUsesWith(SI, Fabs);
3508 InstCombinerImpl &IC) {
3546 IC.addToWorklist(cast<Instruction>(Ctlz));
3644 static bool matchFMulByZeroIfResultEqZero(InstCombinerImpl &IC, Value *Cmp0,
3655 return IC.fmulByZeroIsZero(MulRHS, FMF, &CtxI);