Lines Matching refs:BO
268 APInt findInEitherOperand(BinaryOperator *BO, bool SignExtended,
320 bool CanTraceInto(bool SignExtended, bool ZeroExtended, BinaryOperator *BO,
486 BinaryOperator *BO, in CanTraceInto() argument
491 if (BO->getOpcode() != Instruction::Add && in CanTraceInto()
492 BO->getOpcode() != Instruction::Sub && in CanTraceInto()
493 BO->getOpcode() != Instruction::Or) { in CanTraceInto()
497 Value *LHS = BO->getOperand(0), *RHS = BO->getOperand(1); in CanTraceInto()
502 if (BO->getOpcode() == Instruction::Or && in CanTraceInto()
503 !haveNoCommonBitsSet(LHS, RHS, DL, nullptr, BO, DT)) in CanTraceInto()
517 if (BO->getOpcode() == Instruction::Add && !ZeroExtended && NonNegative) { in CanTraceInto()
538 if (BO->getOpcode() == Instruction::Add || in CanTraceInto()
539 BO->getOpcode() == Instruction::Sub) { in CanTraceInto()
540 if (SignExtended && !BO->hasNoSignedWrap()) in CanTraceInto()
542 if (ZeroExtended && !BO->hasNoUnsignedWrap()) in CanTraceInto()
549 APInt ConstantOffsetExtractor::findInEitherOperand(BinaryOperator *BO, in findInEitherOperand() argument
554 APInt ConstantOffset = find(BO->getOperand(0), SignExtended, ZeroExtended, in findInEitherOperand()
562 ConstantOffset = find(BO->getOperand(1), SignExtended, ZeroExtended, in findInEitherOperand()
566 if (BO->getOpcode() == Instruction::Sub) in findInEitherOperand()
586 } else if (BinaryOperator *BO = dyn_cast<BinaryOperator>(V)) { in find() local
588 if (CanTraceInto(SignExtended, ZeroExtended, BO, NonNegative)) in find()
589 ConstantOffset = findInEitherOperand(BO, SignExtended, ZeroExtended); in find()
667 BinaryOperator *BO = cast<BinaryOperator>(U); in distributeExtsAndCloneChain() local
669 unsigned OpNo = (BO->getOperand(0) == UserChain[ChainIndex - 1] ? 0 : 1); in distributeExtsAndCloneChain()
670 Value *TheOther = applyExts(BO->getOperand(1 - OpNo)); in distributeExtsAndCloneChain()
675 NewBO = BinaryOperator::Create(BO->getOpcode(), NextInChain, TheOther, in distributeExtsAndCloneChain()
676 BO->getName(), IP); in distributeExtsAndCloneChain()
678 NewBO = BinaryOperator::Create(BO->getOpcode(), TheOther, NextInChain, in distributeExtsAndCloneChain()
679 BO->getName(), IP); in distributeExtsAndCloneChain()
690 BinaryOperator *BO = cast<BinaryOperator>(UserChain[ChainIndex]); in removeConstOffset() local
691 assert(BO->getNumUses() <= 1 && in removeConstOffset()
696 unsigned OpNo = (BO->getOperand(0) == UserChain[ChainIndex - 1] ? 0 : 1); in removeConstOffset()
697 assert(BO->getOperand(OpNo) == UserChain[ChainIndex - 1]); in removeConstOffset()
699 Value *TheOther = BO->getOperand(1 - OpNo); in removeConstOffset()
704 if (CI->isZero() && !(BO->getOpcode() == Instruction::Sub && OpNo == 0)) in removeConstOffset()
708 BinaryOperator::BinaryOps NewOp = BO->getOpcode(); in removeConstOffset()
709 if (BO->getOpcode() == Instruction::Or) { in removeConstOffset()
732 NewBO->takeName(BO); in removeConstOffset()
1271 if (BinaryOperator *BO = dyn_cast<BinaryOperator>(FirstOffsetDef)) { in isLegalToSwapOperand() local
1272 unsigned opc = BO->getOpcode(); in isLegalToSwapOperand()
1274 (isa<ConstantInt>(BO->getOperand(0)) || in isLegalToSwapOperand()
1275 isa<ConstantInt>(BO->getOperand(1)))) in isLegalToSwapOperand()