Lines Matching refs:BO

269   APInt findInEitherOperand(BinaryOperator *BO, bool SignExtended,
321 bool CanTraceInto(bool SignExtended, bool ZeroExtended, BinaryOperator *BO,
504 BinaryOperator *BO, in CanTraceInto() argument
509 if (BO->getOpcode() != Instruction::Add && in CanTraceInto()
510 BO->getOpcode() != Instruction::Sub && in CanTraceInto()
511 BO->getOpcode() != Instruction::Or) { in CanTraceInto()
515 Value *LHS = BO->getOperand(0), *RHS = BO->getOperand(1); in CanTraceInto()
520 if (BO->getOpcode() == Instruction::Or && in CanTraceInto()
521 !haveNoCommonBitsSet(LHS, RHS, DL, nullptr, BO, DT)) in CanTraceInto()
535 if (BO->getOpcode() == Instruction::Add && !ZeroExtended && NonNegative) { in CanTraceInto()
556 if (BO->getOpcode() == Instruction::Add || in CanTraceInto()
557 BO->getOpcode() == Instruction::Sub) { in CanTraceInto()
558 if (SignExtended && !BO->hasNoSignedWrap()) in CanTraceInto()
560 if (ZeroExtended && !BO->hasNoUnsignedWrap()) in CanTraceInto()
567 APInt ConstantOffsetExtractor::findInEitherOperand(BinaryOperator *BO, in findInEitherOperand() argument
575 APInt ConstantOffset = find(BO->getOperand(0), SignExtended, ZeroExtended, in findInEitherOperand()
588 ConstantOffset = find(BO->getOperand(1), SignExtended, ZeroExtended, in findInEitherOperand()
592 if (BO->getOpcode() == Instruction::Sub) in findInEitherOperand()
617 } else if (BinaryOperator *BO = dyn_cast<BinaryOperator>(V)) { in find() local
619 if (CanTraceInto(SignExtended, ZeroExtended, BO, NonNegative)) in find()
620 ConstantOffset = findInEitherOperand(BO, SignExtended, ZeroExtended); in find()
698 BinaryOperator *BO = cast<BinaryOperator>(U); in distributeExtsAndCloneChain() local
700 unsigned OpNo = (BO->getOperand(0) == UserChain[ChainIndex - 1] ? 0 : 1); in distributeExtsAndCloneChain()
701 Value *TheOther = applyExts(BO->getOperand(1 - OpNo)); in distributeExtsAndCloneChain()
706 NewBO = BinaryOperator::Create(BO->getOpcode(), NextInChain, TheOther, in distributeExtsAndCloneChain()
707 BO->getName(), IP); in distributeExtsAndCloneChain()
709 NewBO = BinaryOperator::Create(BO->getOpcode(), TheOther, NextInChain, in distributeExtsAndCloneChain()
710 BO->getName(), IP); in distributeExtsAndCloneChain()
721 BinaryOperator *BO = cast<BinaryOperator>(UserChain[ChainIndex]); in removeConstOffset() local
722 assert((BO->use_empty() || BO->hasOneUse()) && in removeConstOffset()
727 unsigned OpNo = (BO->getOperand(0) == UserChain[ChainIndex - 1] ? 0 : 1); in removeConstOffset()
728 assert(BO->getOperand(OpNo) == UserChain[ChainIndex - 1]); in removeConstOffset()
730 Value *TheOther = BO->getOperand(1 - OpNo); in removeConstOffset()
735 if (CI->isZero() && !(BO->getOpcode() == Instruction::Sub && OpNo == 0)) in removeConstOffset()
739 BinaryOperator::BinaryOps NewOp = BO->getOpcode(); in removeConstOffset()
740 if (BO->getOpcode() == Instruction::Or) { in removeConstOffset()
763 NewBO->takeName(BO); in removeConstOffset()
1328 if (BinaryOperator *BO = dyn_cast<BinaryOperator>(FirstOffsetDef)) { in isLegalToSwapOperand() local
1329 unsigned opc = BO->getOpcode(); in isLegalToSwapOperand()
1331 (isa<ConstantInt>(BO->getOperand(0)) || in isLegalToSwapOperand()
1332 isa<ConstantInt>(BO->getOperand(1)))) in isLegalToSwapOperand()