Lines Matching refs:BO
267 APInt findInEitherOperand(BinaryOperator *BO, bool SignExtended,
319 bool CanTraceInto(bool SignExtended, bool ZeroExtended, BinaryOperator *BO,
513 BinaryOperator *BO, in CanTraceInto() argument
518 if (BO->getOpcode() != Instruction::Add && in CanTraceInto()
519 BO->getOpcode() != Instruction::Sub && in CanTraceInto()
520 BO->getOpcode() != Instruction::Or) { in CanTraceInto()
524 Value *LHS = BO->getOperand(0), *RHS = BO->getOperand(1); in CanTraceInto()
527 if (BO->getOpcode() == Instruction::Or && in CanTraceInto()
528 !cast<PossiblyDisjointInst>(BO)->isDisjoint()) in CanTraceInto()
534 if (ZeroExtended && !SignExtended && BO->getOpcode() == Instruction::Sub) in CanTraceInto()
548 if (BO->getOpcode() == Instruction::Add && !ZeroExtended && NonNegative) { in CanTraceInto()
569 if (BO->getOpcode() == Instruction::Add || in CanTraceInto()
570 BO->getOpcode() == Instruction::Sub) { in CanTraceInto()
571 if (SignExtended && !BO->hasNoSignedWrap()) in CanTraceInto()
573 if (ZeroExtended && !BO->hasNoUnsignedWrap()) in CanTraceInto()
580 APInt ConstantOffsetExtractor::findInEitherOperand(BinaryOperator *BO, in findInEitherOperand() argument
588 APInt ConstantOffset = find(BO->getOperand(0), SignExtended, ZeroExtended, in findInEitherOperand()
601 ConstantOffset = find(BO->getOperand(1), SignExtended, ZeroExtended, in findInEitherOperand()
605 if (BO->getOpcode() == Instruction::Sub) in findInEitherOperand()
630 } else if (BinaryOperator *BO = dyn_cast<BinaryOperator>(V)) { in find() local
632 if (CanTraceInto(SignExtended, ZeroExtended, BO, NonNegative)) in find()
633 ConstantOffset = findInEitherOperand(BO, SignExtended, ZeroExtended); in find()
712 BinaryOperator *BO = cast<BinaryOperator>(U); in distributeExtsAndCloneChain() local
714 unsigned OpNo = (BO->getOperand(0) == UserChain[ChainIndex - 1] ? 0 : 1); in distributeExtsAndCloneChain()
715 Value *TheOther = applyExts(BO->getOperand(1 - OpNo)); in distributeExtsAndCloneChain()
720 NewBO = BinaryOperator::Create(BO->getOpcode(), NextInChain, TheOther, in distributeExtsAndCloneChain()
721 BO->getName(), IP); in distributeExtsAndCloneChain()
723 NewBO = BinaryOperator::Create(BO->getOpcode(), TheOther, NextInChain, in distributeExtsAndCloneChain()
724 BO->getName(), IP); in distributeExtsAndCloneChain()
735 BinaryOperator *BO = cast<BinaryOperator>(UserChain[ChainIndex]); in removeConstOffset() local
736 assert((BO->use_empty() || BO->hasOneUse()) && in removeConstOffset()
741 unsigned OpNo = (BO->getOperand(0) == UserChain[ChainIndex - 1] ? 0 : 1); in removeConstOffset()
742 assert(BO->getOperand(OpNo) == UserChain[ChainIndex - 1]); in removeConstOffset()
744 Value *TheOther = BO->getOperand(1 - OpNo); in removeConstOffset()
749 if (CI->isZero() && !(BO->getOpcode() == Instruction::Sub && OpNo == 0)) in removeConstOffset()
753 BinaryOperator::BinaryOps NewOp = BO->getOpcode(); in removeConstOffset()
754 if (BO->getOpcode() == Instruction::Or) { in removeConstOffset()
777 NewBO->takeName(BO); in removeConstOffset()
1345 if (BinaryOperator *BO = dyn_cast<BinaryOperator>(FirstOffsetDef)) { in isLegalToSwapOperand() local
1346 unsigned opc = BO->getOpcode(); in isLegalToSwapOperand()
1348 (isa<ConstantInt>(BO->getOperand(0)) || in isLegalToSwapOperand()
1349 isa<ConstantInt>(BO->getOperand(1)))) in isLegalToSwapOperand()