• Home
  • Raw
  • Download

Lines Matching refs:TrueVal

210 Instruction *InstCombiner::FoldSelectIntoOp(SelectInst &SI, Value *TrueVal,  in FoldSelectIntoOp()  argument
214 if (Instruction *TVI = dyn_cast<Instruction>(TrueVal)) { in FoldSelectIntoOp()
251 !isa<Constant>(TrueVal)) { in FoldSelectIntoOp()
254 if ((SFO & 1) && TrueVal == FVI->getOperand(0)) { in FoldSelectIntoOp()
256 } else if ((SFO & 2) && TrueVal == FVI->getOperand(1)) { in FoldSelectIntoOp()
270 TrueVal, NewSel); in FoldSelectIntoOp()
361 Value *TrueVal = SI.getTrueValue(); in visitSelectInstWithICmp() local
396 if ((CmpLHS == TrueVal && AdjustedRHS == FalseVal) || in visitSelectInstWithICmp()
397 (CmpLHS == FalseVal && AdjustedRHS == TrueVal)) in visitSelectInstWithICmp()
411 if (match(TrueVal, m_SExt(m_Specific(CmpLHS))) && in visitSelectInstWithICmp()
413 CmpLHS = TrueVal; in visitSelectInstWithICmp()
416 sextRHS == TrueVal) { in visitSelectInstWithICmp()
425 if (match(TrueVal, m_ZExt(m_Specific(CmpLHS))) && in visitSelectInstWithICmp()
427 CmpLHS = TrueVal; in visitSelectInstWithICmp()
430 zextRHS == TrueVal) { in visitSelectInstWithICmp()
442 std::swap(FalseVal, TrueVal); in visitSelectInstWithICmp()
446 SI.setOperand(1, TrueVal); in visitSelectInstWithICmp()
465 if (TrueVal->getType() == Ty) { in visitSelectInstWithICmp()
469 C1 = dyn_cast<ConstantInt>(TrueVal); in visitSelectInstWithICmp()
473 C2 = dyn_cast<ConstantInt>(TrueVal); in visitSelectInstWithICmp()
494 if (SimplifyWithOpReplaced(FalseVal, CmpLHS, CmpRHS, TD, TLI) == TrueVal || in visitSelectInstWithICmp()
495 SimplifyWithOpReplaced(FalseVal, CmpRHS, CmpLHS, TD, TLI) == TrueVal) in visitSelectInstWithICmp()
497 if (SimplifyWithOpReplaced(TrueVal, CmpLHS, CmpRHS, TD, TLI) == FalseVal || in visitSelectInstWithICmp()
498 SimplifyWithOpReplaced(TrueVal, CmpRHS, CmpLHS, TD, TLI) == FalseVal) in visitSelectInstWithICmp()
501 if (SimplifyWithOpReplaced(TrueVal, CmpLHS, CmpRHS, TD, TLI) == FalseVal || in visitSelectInstWithICmp()
502 SimplifyWithOpReplaced(TrueVal, CmpRHS, CmpLHS, TD, TLI) == FalseVal) in visitSelectInstWithICmp()
503 return ReplaceInstUsesWith(SI, TrueVal); in visitSelectInstWithICmp()
504 if (SimplifyWithOpReplaced(FalseVal, CmpLHS, CmpRHS, TD, TLI) == TrueVal || in visitSelectInstWithICmp()
505 SimplifyWithOpReplaced(FalseVal, CmpRHS, CmpLHS, TD, TLI) == TrueVal) in visitSelectInstWithICmp()
506 return ReplaceInstUsesWith(SI, TrueVal); in visitSelectInstWithICmp()
512 if (CmpLHS == TrueVal && Pred == ICmpInst::ICMP_EQ) { in visitSelectInstWithICmp()
595 static Value *foldSelectICmpAnd(const SelectInst &SI, ConstantInt *TrueVal, in foldSelectICmpAnd() argument
615 if (!TrueVal->isZero() && !FalseVal->isZero()) { in foldSelectICmpAnd()
616 if ((TrueVal->getValue() - FalseVal->getValue()).isPowerOf2()) in foldSelectICmpAnd()
618 else if ((FalseVal->getValue() - TrueVal->getValue()).isPowerOf2()) in foldSelectICmpAnd()
619 Offset = TrueVal; in foldSelectICmpAnd()
624 TrueVal = ConstantInt::get(Builder->getContext(), in foldSelectICmpAnd()
625 TrueVal->getValue() - Offset->getValue()); in foldSelectICmpAnd()
632 (!TrueVal->getValue().isPowerOf2() && in foldSelectICmpAnd()
638 ConstantInt *ValC = !TrueVal->isZero() ? TrueVal : FalseVal; in foldSelectICmpAnd()
650 bool ShouldNotVal = !TrueVal->isZero(); in foldSelectICmpAnd()
663 Value *TrueVal = SI.getTrueValue(); in visitSelectInst() local
666 if (Value *V = SimplifySelectInst(CondVal, TrueVal, FalseVal, TD)) in visitSelectInst()
670 if (ConstantInt *C = dyn_cast<ConstantInt>(TrueVal)) { in visitSelectInst()
681 return BinaryOperator::CreateAnd(CondVal, TrueVal); in visitSelectInst()
685 return BinaryOperator::CreateOr(NotCond, TrueVal); in visitSelectInst()
690 if (CondVal == TrueVal) in visitSelectInst()
693 return BinaryOperator::CreateAnd(CondVal, TrueVal); in visitSelectInst()
697 if (match(TrueVal, m_Not(m_Specific(CondVal)))) in visitSelectInst()
698 return BinaryOperator::CreateAnd(TrueVal, FalseVal); in visitSelectInst()
700 return BinaryOperator::CreateOr(TrueVal, FalseVal); in visitSelectInst()
704 if (ConstantInt *TrueValC = dyn_cast<ConstantInt>(TrueVal)) in visitSelectInst()
732 if (FCI->getOperand(0) == TrueVal && FCI->getOperand(1) == FalseVal) { in visitSelectInst()
739 if (((CFPt = dyn_cast<ConstantFP>(TrueVal)) && in visitSelectInst()
751 if (((CFPt = dyn_cast<ConstantFP>(TrueVal)) && in visitSelectInst()
755 return ReplaceInstUsesWith(SI, TrueVal); in visitSelectInst()
759 } else if (FCI->getOperand(0) == FalseVal && FCI->getOperand(1) == TrueVal){ in visitSelectInst()
766 if (((CFPt = dyn_cast<ConstantFP>(TrueVal)) && in visitSelectInst()
778 if (((CFPt = dyn_cast<ConstantFP>(TrueVal)) && in visitSelectInst()
782 return ReplaceInstUsesWith(SI, TrueVal); in visitSelectInst()
794 if (Instruction *TI = dyn_cast<Instruction>(TrueVal)) in visitSelectInst()
854 if (Instruction *FoldI = FoldSelectIntoOp(SI, TrueVal, FalseVal)) in visitSelectInst()
881 if (CanSelectOperandBeMappingIntoPredBlock(TrueVal, SI) && in visitSelectInst()
886 if (SelectInst *TrueSI = dyn_cast<SelectInst>(TrueVal)) { in visitSelectInst()
906 SI.setOperand(2, TrueVal); in visitSelectInst()
934 Value *V = Builder->CreateShuffleVector(TrueVal, FalseVal, MaskVal); in visitSelectInst()