Lines Matching refs:BO
268 APInt findInEitherOperand(BinaryOperator *BO, bool SignExtended,
320 bool CanTraceInto(bool SignExtended, bool ZeroExtended, BinaryOperator *BO,
510 BinaryOperator *BO, in CanTraceInto() argument
515 if (BO->getOpcode() != Instruction::Add && in CanTraceInto()
516 BO->getOpcode() != Instruction::Sub && in CanTraceInto()
517 BO->getOpcode() != Instruction::Or) { in CanTraceInto()
521 Value *LHS = BO->getOperand(0), *RHS = BO->getOperand(1); in CanTraceInto()
526 if (BO->getOpcode() == Instruction::Or && in CanTraceInto()
527 !haveNoCommonBitsSet(LHS, RHS, SimplifyQuery(DL, DT, /*AC*/ nullptr, BO))) in CanTraceInto()
533 if (ZeroExtended && !SignExtended && BO->getOpcode() == Instruction::Sub) in CanTraceInto()
547 if (BO->getOpcode() == Instruction::Add && !ZeroExtended && NonNegative) { in CanTraceInto()
568 if (BO->getOpcode() == Instruction::Add || in CanTraceInto()
569 BO->getOpcode() == Instruction::Sub) { in CanTraceInto()
570 if (SignExtended && !BO->hasNoSignedWrap()) in CanTraceInto()
572 if (ZeroExtended && !BO->hasNoUnsignedWrap()) in CanTraceInto()
579 APInt ConstantOffsetExtractor::findInEitherOperand(BinaryOperator *BO, in findInEitherOperand() argument
587 APInt ConstantOffset = find(BO->getOperand(0), SignExtended, ZeroExtended, in findInEitherOperand()
600 ConstantOffset = find(BO->getOperand(1), SignExtended, ZeroExtended, in findInEitherOperand()
604 if (BO->getOpcode() == Instruction::Sub) in findInEitherOperand()
629 } else if (BinaryOperator *BO = dyn_cast<BinaryOperator>(V)) { in find() local
631 if (CanTraceInto(SignExtended, ZeroExtended, BO, NonNegative)) in find()
632 ConstantOffset = findInEitherOperand(BO, SignExtended, ZeroExtended); in find()
711 BinaryOperator *BO = cast<BinaryOperator>(U); in distributeExtsAndCloneChain() local
713 unsigned OpNo = (BO->getOperand(0) == UserChain[ChainIndex - 1] ? 0 : 1); in distributeExtsAndCloneChain()
714 Value *TheOther = applyExts(BO->getOperand(1 - OpNo)); in distributeExtsAndCloneChain()
719 NewBO = BinaryOperator::Create(BO->getOpcode(), NextInChain, TheOther, in distributeExtsAndCloneChain()
720 BO->getName(), IP); in distributeExtsAndCloneChain()
722 NewBO = BinaryOperator::Create(BO->getOpcode(), TheOther, NextInChain, in distributeExtsAndCloneChain()
723 BO->getName(), IP); in distributeExtsAndCloneChain()
734 BinaryOperator *BO = cast<BinaryOperator>(UserChain[ChainIndex]); in removeConstOffset() local
735 assert((BO->use_empty() || BO->hasOneUse()) && in removeConstOffset()
740 unsigned OpNo = (BO->getOperand(0) == UserChain[ChainIndex - 1] ? 0 : 1); in removeConstOffset()
741 assert(BO->getOperand(OpNo) == UserChain[ChainIndex - 1]); in removeConstOffset()
743 Value *TheOther = BO->getOperand(1 - OpNo); in removeConstOffset()
748 if (CI->isZero() && !(BO->getOpcode() == Instruction::Sub && OpNo == 0)) in removeConstOffset()
752 BinaryOperator::BinaryOps NewOp = BO->getOpcode(); in removeConstOffset()
753 if (BO->getOpcode() == Instruction::Or) { in removeConstOffset()
776 NewBO->takeName(BO); in removeConstOffset()
1295 if (BinaryOperator *BO = dyn_cast<BinaryOperator>(FirstOffsetDef)) { in isLegalToSwapOperand() local
1296 unsigned opc = BO->getOpcode(); in isLegalToSwapOperand()
1298 (isa<ConstantInt>(BO->getOperand(0)) || in isLegalToSwapOperand()
1299 isa<ConstantInt>(BO->getOperand(1)))) in isLegalToSwapOperand()