Lines Matching refs:BO
227 APInt findInEitherOperand(BinaryOperator *BO, bool SignExtended,
281 bool CanTraceInto(bool SignExtended, bool ZeroExtended, BinaryOperator *BO,
387 BinaryOperator *BO, in CanTraceInto() argument
392 if (BO->getOpcode() != Instruction::Add && in CanTraceInto()
393 BO->getOpcode() != Instruction::Sub && in CanTraceInto()
394 BO->getOpcode() != Instruction::Or) { in CanTraceInto()
398 Value *LHS = BO->getOperand(0), *RHS = BO->getOperand(1); in CanTraceInto()
401 if (BO->getOpcode() == Instruction::Or && !NoCommonBits(LHS, RHS)) in CanTraceInto()
415 if (BO->getOpcode() == Instruction::Add && !ZeroExtended && NonNegative) { in CanTraceInto()
436 if (BO->getOpcode() == Instruction::Add || in CanTraceInto()
437 BO->getOpcode() == Instruction::Sub) { in CanTraceInto()
438 if (SignExtended && !BO->hasNoSignedWrap()) in CanTraceInto()
440 if (ZeroExtended && !BO->hasNoUnsignedWrap()) in CanTraceInto()
447 APInt ConstantOffsetExtractor::findInEitherOperand(BinaryOperator *BO, in findInEitherOperand() argument
452 APInt ConstantOffset = find(BO->getOperand(0), SignExtended, ZeroExtended, in findInEitherOperand()
460 ConstantOffset = find(BO->getOperand(1), SignExtended, ZeroExtended, in findInEitherOperand()
464 if (BO->getOpcode() == Instruction::Sub) in findInEitherOperand()
484 } else if (BinaryOperator *BO = dyn_cast<BinaryOperator>(V)) { in find() local
486 if (CanTraceInto(SignExtended, ZeroExtended, BO, NonNegative)) { in find()
487 ConstantOffset = findInEitherOperand(BO, SignExtended, ZeroExtended); in find()
561 BinaryOperator *BO = cast<BinaryOperator>(U); in distributeExtsAndCloneChain() local
563 unsigned OpNo = (BO->getOperand(0) == UserChain[ChainIndex - 1] ? 0 : 1); in distributeExtsAndCloneChain()
564 Value *TheOther = applyExts(BO->getOperand(1 - OpNo)); in distributeExtsAndCloneChain()
569 NewBO = BinaryOperator::Create(BO->getOpcode(), NextInChain, TheOther, in distributeExtsAndCloneChain()
570 BO->getName(), IP); in distributeExtsAndCloneChain()
572 NewBO = BinaryOperator::Create(BO->getOpcode(), TheOther, NextInChain, in distributeExtsAndCloneChain()
573 BO->getName(), IP); in distributeExtsAndCloneChain()
584 BinaryOperator *BO = cast<BinaryOperator>(UserChain[ChainIndex]); in removeConstOffset() local
585 unsigned OpNo = (BO->getOperand(0) == UserChain[ChainIndex - 1] ? 0 : 1); in removeConstOffset()
586 assert(BO->getOperand(OpNo) == UserChain[ChainIndex - 1]); in removeConstOffset()
588 Value *TheOther = BO->getOperand(1 - OpNo); in removeConstOffset()
593 if (CI->isZero() && !(BO->getOpcode() == Instruction::Sub && OpNo == 0)) in removeConstOffset()
597 if (BO->getOpcode() == Instruction::Or) { in removeConstOffset()
612 return BinaryOperator::CreateAdd(NextInChain, TheOther, BO->getName(), in removeConstOffset()
615 return BinaryOperator::CreateAdd(TheOther, NextInChain, BO->getName(), in removeConstOffset()
622 assert(BO->getNumUses() <= 1 && in removeConstOffset()
626 BO->setOperand(OpNo, NextInChain); in removeConstOffset()
627 BO->setHasNoSignedWrap(false); in removeConstOffset()
628 BO->setHasNoUnsignedWrap(false); in removeConstOffset()
630 BO->moveBefore(IP); in removeConstOffset()
631 return BO; in removeConstOffset()