Lines Matching refs:TrueVal

37   Value *TrueVal = SI->getTrueValue();  in MatchSelectPattern()  local
44 if (TrueVal == CmpLHS && FalseVal == CmpRHS) { in MatchSelectPattern()
59 if (TrueVal == CmpRHS && FalseVal == CmpLHS) { in MatchSelectPattern()
74 if ((CmpLHS == TrueVal && match(FalseVal, m_Neg(m_Specific(CmpLHS)))) || in MatchSelectPattern()
75 (CmpLHS == FalseVal && match(TrueVal, m_Neg(m_Specific(CmpLHS))))) { in MatchSelectPattern()
80 return (CmpLHS == TrueVal) ? SPF_ABS : SPF_NABS; in MatchSelectPattern()
235 Instruction *InstCombiner::FoldSelectIntoOp(SelectInst &SI, Value *TrueVal, in FoldSelectIntoOp() argument
239 if (Instruction *TVI = dyn_cast<Instruction>(TrueVal)) { in FoldSelectIntoOp()
276 !isa<Constant>(TrueVal)) { in FoldSelectIntoOp()
279 if ((SFO & 1) && TrueVal == FVI->getOperand(0)) { in FoldSelectIntoOp()
281 } else if ((SFO & 2) && TrueVal == FVI->getOperand(1)) { in FoldSelectIntoOp()
295 TrueVal, NewSel); in FoldSelectIntoOp()
391 static Value *foldSelectICmpAndOr(const SelectInst &SI, Value *TrueVal, in foldSelectICmpAndOr() argument
411 bool OrOnFalseVal = match(FalseVal, m_Or(m_Specific(TrueVal), m_Power2(C2))); in foldSelectICmpAndOr()
413 OrOnTrueVal = match(TrueVal, m_Or(m_Specific(FalseVal), m_Power2(C2))); in foldSelectICmpAndOr()
419 Value *Y = OrOnFalseVal ? TrueVal : FalseVal; in foldSelectICmpAndOr()
452 static Value *foldSelectCttzCtlz(ICmpInst *ICI, Value *TrueVal, Value *FalseVal, in foldSelectCttzCtlz() argument
463 Value *ValueOnZero = TrueVal; in foldSelectCttzCtlz()
505 Value *TrueVal = SI.getTrueValue(); in visitSelectInstWithICmp() local
540 if ((CmpLHS == TrueVal && AdjustedRHS == FalseVal) || in visitSelectInstWithICmp()
541 (CmpLHS == FalseVal && AdjustedRHS == TrueVal)) in visitSelectInstWithICmp()
555 if (match(TrueVal, m_SExt(m_Specific(CmpLHS))) && in visitSelectInstWithICmp()
557 CmpLHS = TrueVal; in visitSelectInstWithICmp()
560 sextRHS == TrueVal) { in visitSelectInstWithICmp()
569 if (match(TrueVal, m_ZExt(m_Specific(CmpLHS))) && in visitSelectInstWithICmp()
571 CmpLHS = TrueVal; in visitSelectInstWithICmp()
574 zextRHS == TrueVal) { in visitSelectInstWithICmp()
586 std::swap(FalseVal, TrueVal); in visitSelectInstWithICmp()
590 SI.setOperand(1, TrueVal); in visitSelectInstWithICmp()
609 if (TrueVal->getType() == Ty) { in visitSelectInstWithICmp()
613 C1 = dyn_cast<ConstantInt>(TrueVal); in visitSelectInstWithICmp()
617 C2 = dyn_cast<ConstantInt>(TrueVal); in visitSelectInstWithICmp()
639 TrueVal || in visitSelectInstWithICmp()
641 TrueVal) in visitSelectInstWithICmp()
643 if (SimplifyWithOpReplaced(TrueVal, CmpLHS, CmpRHS, TLI, DL, DT, AC) == in visitSelectInstWithICmp()
645 SimplifyWithOpReplaced(TrueVal, CmpRHS, CmpLHS, TLI, DL, DT, AC) == in visitSelectInstWithICmp()
649 if (SimplifyWithOpReplaced(TrueVal, CmpLHS, CmpRHS, TLI, DL, DT, AC) == in visitSelectInstWithICmp()
651 SimplifyWithOpReplaced(TrueVal, CmpRHS, CmpLHS, TLI, DL, DT, AC) == in visitSelectInstWithICmp()
653 return ReplaceInstUsesWith(SI, TrueVal); in visitSelectInstWithICmp()
655 TrueVal || in visitSelectInstWithICmp()
657 TrueVal) in visitSelectInstWithICmp()
658 return ReplaceInstUsesWith(SI, TrueVal); in visitSelectInstWithICmp()
664 if (CmpLHS == TrueVal && Pred == ICmpInst::ICMP_EQ) { in visitSelectInstWithICmp()
675 if (unsigned BitWidth = TrueVal->getType()->getScalarSizeInBits()) { in visitSelectInstWithICmp()
700 if (TrueWhenUnset && TrueVal == X && in visitSelectInstWithICmp()
705 match(TrueVal, m_Xor(m_Specific(X), m_APInt(C))) && *Y == *C) in visitSelectInstWithICmp()
709 match(TrueVal, m_Xor(m_Specific(X), m_APInt(C))) && *Y == *C) in visitSelectInstWithICmp()
712 else if (!TrueWhenUnset && TrueVal == X && in visitSelectInstWithICmp()
721 if (Value *V = foldSelectICmpAndOr(SI, TrueVal, FalseVal, Builder)) in visitSelectInstWithICmp()
724 if (Value *V = foldSelectCttzCtlz(ICI, TrueVal, FalseVal, Builder)) in visitSelectInstWithICmp()
839 static Value *foldSelectICmpAnd(const SelectInst &SI, ConstantInt *TrueVal, in foldSelectICmpAnd() argument
858 if (!TrueVal->isZero() && !FalseVal->isZero()) { in foldSelectICmpAnd()
859 if ((TrueVal->getValue() - FalseVal->getValue()).isPowerOf2()) in foldSelectICmpAnd()
861 else if ((FalseVal->getValue() - TrueVal->getValue()).isPowerOf2()) in foldSelectICmpAnd()
862 Offset = TrueVal; in foldSelectICmpAnd()
867 TrueVal = ConstantInt::get(Builder->getContext(), in foldSelectICmpAnd()
868 TrueVal->getValue() - Offset->getValue()); in foldSelectICmpAnd()
875 (!TrueVal->getValue().isPowerOf2() && in foldSelectICmpAnd()
881 ConstantInt *ValC = !TrueVal->isZero() ? TrueVal : FalseVal; in foldSelectICmpAnd()
899 bool ShouldNotVal = !TrueVal->isZero(); in foldSelectICmpAnd()
912 Value *TrueVal = SI.getTrueValue(); in visitSelectInst() local
916 SimplifySelectInst(CondVal, TrueVal, FalseVal, DL, TLI, DT, AC)) in visitSelectInst()
920 if (ConstantInt *C = dyn_cast<ConstantInt>(TrueVal)) { in visitSelectInst()
932 return BinaryOperator::CreateAnd(CondVal, TrueVal); in visitSelectInst()
936 return BinaryOperator::CreateOr(NotCond, TrueVal); in visitSelectInst()
941 if (CondVal == TrueVal) in visitSelectInst()
944 return BinaryOperator::CreateAnd(CondVal, TrueVal); in visitSelectInst()
948 if (match(TrueVal, m_Not(m_Specific(CondVal)))) in visitSelectInst()
949 return BinaryOperator::CreateAnd(TrueVal, FalseVal); in visitSelectInst()
951 return BinaryOperator::CreateOr(TrueVal, FalseVal); in visitSelectInst()
955 if (ConstantInt *TrueValC = dyn_cast<ConstantInt>(TrueVal)) in visitSelectInst()
983 if (FCI->getOperand(0) == TrueVal && FCI->getOperand(1) == FalseVal) { in visitSelectInst()
990 if (((CFPt = dyn_cast<ConstantFP>(TrueVal)) && in visitSelectInst()
1002 if (((CFPt = dyn_cast<ConstantFP>(TrueVal)) && in visitSelectInst()
1006 return ReplaceInstUsesWith(SI, TrueVal); in visitSelectInst()
1016 Value *NewCond = Builder->CreateFCmp(InvPred, TrueVal, FalseVal, in visitSelectInst()
1019 return SelectInst::Create(NewCond, FalseVal, TrueVal, in visitSelectInst()
1024 } else if (FCI->getOperand(0) == FalseVal && FCI->getOperand(1) == TrueVal){ in visitSelectInst()
1031 if (((CFPt = dyn_cast<ConstantFP>(TrueVal)) && in visitSelectInst()
1043 if (((CFPt = dyn_cast<ConstantFP>(TrueVal)) && in visitSelectInst()
1047 return ReplaceInstUsesWith(SI, TrueVal); in visitSelectInst()
1057 Value *NewCond = Builder->CreateFCmp(InvPred, FalseVal, TrueVal, in visitSelectInst()
1060 return SelectInst::Create(NewCond, FalseVal, TrueVal, in visitSelectInst()
1074 if (Instruction *TI = dyn_cast<Instruction>(TrueVal)) in visitSelectInst()
1145 if (Instruction *FoldI = FoldSelectIntoOp(SI, TrueVal, FalseVal)) in visitSelectInst()
1200 if (CanSelectOperandBeMappingIntoPredBlock(TrueVal, SI) && in visitSelectInst()
1205 if (SelectInst *TrueSI = dyn_cast<SelectInst>(TrueVal)) { in visitSelectInst()
1235 if (FalseSI->getTrueValue() == TrueVal && FalseSI->hasOneUse()) { in visitSelectInst()
1247 SI.setOperand(2, TrueVal); in visitSelectInst()