Lines Matching refs:BO
153 APInt findInEitherOperand(BinaryOperator *BO, bool SignExtended,
207 bool CanTraceInto(bool SignExtended, bool ZeroExtended, BinaryOperator *BO,
315 BinaryOperator *BO, in CanTraceInto() argument
320 if (BO->getOpcode() != Instruction::Add && in CanTraceInto()
321 BO->getOpcode() != Instruction::Sub && in CanTraceInto()
322 BO->getOpcode() != Instruction::Or) { in CanTraceInto()
326 Value *LHS = BO->getOperand(0), *RHS = BO->getOperand(1); in CanTraceInto()
329 if (BO->getOpcode() == Instruction::Or && !NoCommonBits(LHS, RHS)) in CanTraceInto()
343 if (BO->getOpcode() == Instruction::Add && !ZeroExtended && NonNegative) { in CanTraceInto()
364 if (BO->getOpcode() == Instruction::Add || in CanTraceInto()
365 BO->getOpcode() == Instruction::Sub) { in CanTraceInto()
366 if (SignExtended && !BO->hasNoSignedWrap()) in CanTraceInto()
368 if (ZeroExtended && !BO->hasNoUnsignedWrap()) in CanTraceInto()
375 APInt ConstantOffsetExtractor::findInEitherOperand(BinaryOperator *BO, in findInEitherOperand() argument
380 APInt ConstantOffset = find(BO->getOperand(0), SignExtended, ZeroExtended, in findInEitherOperand()
388 ConstantOffset = find(BO->getOperand(1), SignExtended, ZeroExtended, in findInEitherOperand()
392 if (BO->getOpcode() == Instruction::Sub) in findInEitherOperand()
412 } else if (BinaryOperator *BO = dyn_cast<BinaryOperator>(V)) { in find() local
414 if (CanTraceInto(SignExtended, ZeroExtended, BO, NonNegative)) { in find()
415 ConstantOffset = findInEitherOperand(BO, SignExtended, ZeroExtended); in find()
489 BinaryOperator *BO = cast<BinaryOperator>(U); in distributeExtsAndCloneChain() local
491 unsigned OpNo = (BO->getOperand(0) == UserChain[ChainIndex - 1] ? 0 : 1); in distributeExtsAndCloneChain()
492 Value *TheOther = applyExts(BO->getOperand(1 - OpNo)); in distributeExtsAndCloneChain()
497 NewBO = BinaryOperator::Create(BO->getOpcode(), NextInChain, TheOther, in distributeExtsAndCloneChain()
498 BO->getName(), IP); in distributeExtsAndCloneChain()
500 NewBO = BinaryOperator::Create(BO->getOpcode(), TheOther, NextInChain, in distributeExtsAndCloneChain()
501 BO->getName(), IP); in distributeExtsAndCloneChain()
512 BinaryOperator *BO = cast<BinaryOperator>(UserChain[ChainIndex]); in removeConstOffset() local
513 unsigned OpNo = (BO->getOperand(0) == UserChain[ChainIndex - 1] ? 0 : 1); in removeConstOffset()
514 assert(BO->getOperand(OpNo) == UserChain[ChainIndex - 1]); in removeConstOffset()
516 Value *TheOther = BO->getOperand(1 - OpNo); in removeConstOffset()
521 if (CI->isZero() && !(BO->getOpcode() == Instruction::Sub && OpNo == 0)) in removeConstOffset()
525 if (BO->getOpcode() == Instruction::Or) { in removeConstOffset()
539 return BinaryOperator::CreateAdd(BO->getOperand(0), BO->getOperand(1), in removeConstOffset()
540 BO->getName(), IP); in removeConstOffset()
545 assert(BO->getNumUses() <= 1 && in removeConstOffset()
549 BO->setOperand(OpNo, NextInChain); in removeConstOffset()
550 BO->setHasNoSignedWrap(false); in removeConstOffset()
551 BO->setHasNoUnsignedWrap(false); in removeConstOffset()
553 BO->moveBefore(IP); in removeConstOffset()
554 return BO; in removeConstOffset()