Lines Matching refs:BO

1487     BinaryOperator &BO, bool OpsFromSigned, std::array<Value *, 2> IntOps,  in foldFBinOpOfIntCastsFromSign()  argument
1490 Type *FPTy = BO.getType(); in foldFBinOpOfIntCastsFromSign()
1522 if (OpsFromSigned != isa<SIToFPInst>(BO.getOperand(OpNo)) && in foldFBinOpOfIntCastsFromSign()
1553 return !OpsFromSigned || BO.getOpcode() != Instruction::FMul || in foldFBinOpOfIntCastsFromSign()
1560 if (OpsFromSigned && BO.getOpcode() == Instruction::FMul && in foldFBinOpOfIntCastsFromSign()
1599 switch (BO.getOpcode()) { in foldFBinOpOfIntCastsFromSign()
1628 !willNotOverflow(IntOpc, IntOps[0], IntOps[1], BO, OutputSigned)) in foldFBinOpOfIntCastsFromSign()
1646 Instruction *InstCombinerImpl::foldFBinOpOfIntCasts(BinaryOperator &BO) { in foldFBinOpOfIntCasts() argument
1652 if (!match(BO.getOperand(0), m_SIToFP(m_Value(IntOps[0]))) && in foldFBinOpOfIntCasts()
1653 !match(BO.getOperand(0), m_UIToFP(m_Value(IntOps[0])))) in foldFBinOpOfIntCasts()
1656 if (!match(BO.getOperand(1), m_Constant(Op1FpC)) && in foldFBinOpOfIntCasts()
1657 !match(BO.getOperand(1), m_SIToFP(m_Value(IntOps[1]))) && in foldFBinOpOfIntCasts()
1658 !match(BO.getOperand(1), m_UIToFP(m_Value(IntOps[1])))) in foldFBinOpOfIntCasts()
1667 if (Instruction *R = foldFBinOpOfIntCastsFromSign(BO, /*OpsFromSigned=*/false, in foldFBinOpOfIntCasts()
1670 return foldFBinOpOfIntCastsFromSign(BO, /*OpsFromSigned=*/true, IntOps, in foldFBinOpOfIntCasts()
1677 Instruction *InstCombinerImpl::foldBinopOfSextBoolToSelect(BinaryOperator &BO) { in foldBinopOfSextBoolToSelect() argument
1681 Value *BO0 = BO.getOperand(0); in foldBinopOfSextBoolToSelect()
1682 Value *BO1 = BO.getOperand(1); in foldBinopOfSextBoolToSelect()
1690 Constant *Ones = ConstantInt::getAllOnesValue(BO.getType()); in foldBinopOfSextBoolToSelect()
1691 Constant *Zero = ConstantInt::getNullValue(BO.getType()); in foldBinopOfSextBoolToSelect()
1692 Value *TVal = Builder.CreateBinOp(BO.getOpcode(), Ones, C); in foldBinopOfSextBoolToSelect()
1693 Value *FVal = Builder.CreateBinOp(BO.getOpcode(), Zero, C); in foldBinopOfSextBoolToSelect()
1991 Instruction *InstCombinerImpl::foldBinopWithRecurrence(BinaryOperator &BO) { in foldBinopWithRecurrence() argument
1992 if (!BO.isAssociative()) in foldBinopWithRecurrence()
1996 auto Opc = BO.getOpcode(); in foldBinopWithRecurrence()
1997 auto *BO0 = dyn_cast<BinaryOperator>(BO.getOperand(0)); in foldBinopWithRecurrence()
1998 auto *BO1 = dyn_cast<BinaryOperator>(BO.getOperand(1)); in foldBinopWithRecurrence()
2005 assert(BO.isCommutative() && BO0->isCommutative() && BO1->isCommutative() && in foldBinopWithRecurrence()
2042 BO1->getFastMathFlags() & BO.getFastMathFlags(); in foldBinopWithRecurrence()
2050 Flags.mergeFlags(BO); in foldBinopWithRecurrence()
2053 NewBO->takeName(&BO); in foldBinopWithRecurrence()
2091 return replaceInstUsesWith(BO, NewBO); in foldBinopWithRecurrence()
2094 Instruction *InstCombinerImpl::foldBinopWithPhiOperands(BinaryOperator &BO) { in foldBinopWithPhiOperands() argument
2096 if (auto *NewBO = foldBinopWithRecurrence(BO)) in foldBinopWithPhiOperands()
2102 auto *Phi0 = dyn_cast<PHINode>(BO.getOperand(0)); in foldBinopWithPhiOperands()
2103 auto *Phi1 = dyn_cast<PHINode>(BO.getOperand(1)); in foldBinopWithPhiOperands()
2109 if (BO.getParent() != Phi0->getParent() || in foldBinopWithPhiOperands()
2110 BO.getParent() != Phi1->getParent()) in foldBinopWithPhiOperands()
2122 Constant *C = ConstantExpr::getBinOpIdentity(BO.getOpcode(), BO.getType(), in foldBinopWithPhiOperands()
2184 for (auto BBIter = BO.getParent()->begin(); &*BBIter != &BO; ++BBIter) in foldBinopWithPhiOperands()
2189 Constant *NewC = ConstantFoldBinaryOpOperands(BO.getOpcode(), C0, C1, DL); in foldBinopWithPhiOperands()
2196 Value *NewBO = Builder.CreateBinOp(BO.getOpcode(), in foldBinopWithPhiOperands()
2200 NotFoldedNewBO->copyIRFlags(&BO); in foldBinopWithPhiOperands()
2203 PHINode *NewPhi = PHINode::Create(BO.getType(), 2); in foldBinopWithPhiOperands()
2303 if (auto *BO = dyn_cast<BinaryOperator>(NewBO0)) in foldVectorBinop() local
2304 BO->copyIRFlags(&Inst); in foldVectorBinop()
2306 if (auto *BO = dyn_cast<BinaryOperator>(NewBO1)) in foldVectorBinop() local
2307 BO->copyIRFlags(&Inst); in foldVectorBinop()
2313 if (auto *BO = dyn_cast<BinaryOperator>(V)) in foldVectorBinop() local
2314 BO->copyIRFlags(&Inst); in foldVectorBinop()
2342 if (auto *BO = dyn_cast<BinaryOperator>(V)) in foldVectorBinop() local
2343 BO->copyIRFlags(&Inst); in foldVectorBinop()
2381 if (auto *BO = dyn_cast<BinaryOperator>(XY)) in foldVectorBinop() local
2382 BO->copyIRFlags(&Inst); in foldVectorBinop()
2501 Instruction *InstCombinerImpl::narrowMathIfNoOverflow(BinaryOperator &BO) { in narrowMathIfNoOverflow() argument
2503 Value *Op0 = BO.getOperand(0), *Op1 = BO.getOperand(1); in narrowMathIfNoOverflow()
2507 if (BO.getOpcode() == Instruction::Sub) in narrowMathIfNoOverflow()
2534 if (BO.getOpcode() == Instruction::Sub) in narrowMathIfNoOverflow()
2539 if (!willNotOverflow(BO.getOpcode(), X, Y, BO, IsSext)) in narrowMathIfNoOverflow()
2544 Value *NarrowBO = Builder.CreateBinOp(BO.getOpcode(), X, Y, "narrow"); in narrowMathIfNoOverflow()
2551 return CastInst::Create(CastOpc, NarrowBO, BO.getType()); in narrowMathIfNoOverflow()