Lines Matching refs:CondVal

843   auto *CondVal = SI.getCondition();  in foldSelectZeroOrMul()  local
852 if (!match(CondVal, m_ICmp(Predicate, m_Value(X), m_Zero())) || in foldSelectZeroOrMul()
869 auto *ZeroC = cast<Constant>(cast<Instruction>(CondVal)->getOperand(1)); in foldSelectZeroOrMul()
1881 Value *CondVal = SI.getCondition(); in foldAddSubSelect() local
1931 Value *NewSel = Builder.CreateSelect(CondVal, NewTrueOp, NewFalseOp, in foldAddSubSelect()
1956 Value *CondVal = SI.getCondition(); in foldOverflowingAddSubSelect() local
1961 if (!match(CondVal, m_ExtractValue<1>(m_WithOverflowInst(II))) || in foldOverflowingAddSubSelect()
2115 Value *CondVal = SI.getCondition(); in canonicalizeSelectToShuffle() local
2117 auto *CondValTy = dyn_cast<FixedVectorType>(CondVal->getType()); in canonicalizeSelectToShuffle()
2118 if (!CondValTy || !match(CondVal, m_Constant(CondC))) in canonicalizeSelectToShuffle()
2580 Value *CondVal = SI.getCondition(); in foldSelectWithSRem() local
2589 if (!(match(CondVal, m_ICmp(Pred, m_Value(RemRes), m_APInt(C))) && in foldSelectWithSRem()
2656 Value *CondVal = SI.getCondition(); in foldAndOrOfSelectUsingImpliedCond() local
2663 std::optional<bool> Res = isImpliedCondition(Op, CondVal, DL, IsAnd); in foldAndOrOfSelectUsingImpliedCond()
2699 Value *CondVal = SI.getCondition(); in foldSelectWithFCmpToFabs() local
2710 if (!match(CondVal, m_FCmp(Pred, m_Specific(X), m_AnyZeroFP()))) in foldSelectWithFCmpToFabs()
2938 Value *CondVal = SI.getCondition(); in foldSelectOfBools() local
2946 if (!SelType->isIntOrIntVectorTy(1) || isa<Constant>(CondVal) || in foldSelectOfBools()
2947 TrueVal->getType() != CondVal->getType()) in foldSelectOfBools()
2958 if (impliesPoison(FalseVal, CondVal)) { in foldSelectOfBools()
2960 return BinaryOperator::CreateOr(CondVal, FalseVal); in foldSelectOfBools()
2963 if (auto *LHS = dyn_cast<FCmpInst>(CondVal)) in foldSelectOfBools()
2970 if (match(CondVal, m_LogicalAnd(m_Value(A), m_Value(B))) && in foldSelectOfBools()
2972 (CondVal->hasOneUse() || FalseVal->hasOneUse())) { in foldSelectOfBools()
2973 bool CondLogicAnd = isa<SelectInst>(CondVal); in foldSelectOfBools()
2999 if (impliesPoison(TrueVal, CondVal)) { in foldSelectOfBools()
3001 return BinaryOperator::CreateAnd(CondVal, TrueVal); in foldSelectOfBools()
3004 if (auto *LHS = dyn_cast<FCmpInst>(CondVal)) in foldSelectOfBools()
3011 if (match(CondVal, m_LogicalOr(m_Value(A), m_Value(B))) && in foldSelectOfBools()
3013 (CondVal->hasOneUse() || TrueVal->hasOneUse())) { in foldSelectOfBools()
3014 bool CondLogicOr = isa<SelectInst>(CondVal); in foldSelectOfBools()
3043 Value *NotCond = Builder.CreateNot(CondVal, "not." + CondVal->getName()); in foldSelectOfBools()
3048 Value *NotCond = Builder.CreateNot(CondVal, "not." + CondVal->getName()); in foldSelectOfBools()
3055 (CondVal->hasOneUse() || TrueVal->hasOneUse()) && in foldSelectOfBools()
3062 (CondVal->hasOneUse() || FalseVal->hasOneUse()) && in foldSelectOfBools()
3067 if (match(CondVal, m_Select(m_Value(A), m_One(), m_Value(B))) && in foldSelectOfBools()
3071 if (match(CondVal, m_Select(m_Value(A), m_Value(B), m_Zero())) && in foldSelectOfBools()
3081 if (match(CondVal, in foldSelectOfBools()
3087 if (match(CondVal, m_OneUse(m_c_And(m_Value(C), m_Specific(FalseVal))))) { in foldSelectOfBools()
3094 if (match(CondVal, m_OneUse(m_c_Or(m_Specific(TrueVal), m_Value(C))))) { in foldSelectOfBools()
3101 if (match(CondVal, in foldSelectOfBools()
3111 if (isCheckForZeroAndMulWithOverflow(CondVal, Op1, IsAnd, Y)) { in foldSelectOfBools()
3119 if (auto *I = foldAndOrOfSelectUsingImpliedCond(CondVal, *Op1SI, in foldSelectOfBools()
3123 if (auto *ICmp0 = dyn_cast<ICmpInst>(CondVal)) in foldSelectOfBools()
3133 if (match(CondVal, m_LogicalOr(m_Value(A), m_Value(B))) && in foldSelectOfBools()
3141 std::optional<bool> Res = isImpliedCondition(CondVal, B, DL); in foldSelectOfBools()
3150 std::optional<bool> Res = isImpliedCondition(CondVal, B, DL, false); in foldSelectOfBools()
3154 if (match(CondVal, m_LogicalAnd(m_Value(A), m_Value(B))) && in foldSelectOfBools()
3169 match(CondVal, m_c_LogicalAnd(m_Specific(C), m_Value(A)))) { in foldSelectOfBools()
3170 auto *SelCond = dyn_cast<SelectInst>(CondVal); in foldSelectOfBools()
3184 if (match(CondVal, m_c_LogicalAnd(m_Not(m_Value(C)), m_Value(A))) && in foldSelectOfBools()
3186 auto *SelCond = dyn_cast<SelectInst>(CondVal); in foldSelectOfBools()
3364 Value *CondVal = SI.getCondition(); in visitSelectInst() local
3369 if (Value *V = simplifySelectInst(CondVal, TrueVal, FalseVal, in visitSelectInst()
3382 Type *CondType = CondVal->getType(); in visitSelectInst()
3383 if (!isa<Constant>(CondVal) && SelType->isIntOrIntVectorTy() && in visitSelectInst()
3385 if (Value *S = simplifyWithOpReplaced(TrueVal, CondVal, in visitSelectInst()
3390 if (Value *S = simplifyWithOpReplaced(FalseVal, CondVal, in visitSelectInst()
3409 CondVal->getType()->isVectorTy() == SelType->isVectorTy()) { in visitSelectInst()
3412 return new ZExtInst(CondVal, SelType); in visitSelectInst()
3416 return new SExtInst(CondVal, SelType); in visitSelectInst()
3420 Value *NotCond = Builder.CreateNot(CondVal, "not." + CondVal->getName()); in visitSelectInst()
3426 Value *NotCond = Builder.CreateNot(CondVal, "not." + CondVal->getName()); in visitSelectInst()
3433 if (auto *FCmp = dyn_cast<FCmpInst>(CondVal)) { in visitSelectInst()
3512 if (ICmpInst *ICI = dyn_cast<ICmpInst>(CondVal)) in visitSelectInst()
3547 if (isa<VectorType>(CondVal->getType()) && !isa<VectorType>(Idx->getType())) in visitSelectInst()
3555 Builder.CreateSelect(CondVal, NewT, NewF, SI.getName() + ".idx", &SI); in visitSelectInst()
3594 Value *CmpLHS = cast<CmpInst>(CondVal)->getOperand(0); in visitSelectInst()
3595 Value *CmpRHS = cast<CmpInst>(CondVal)->getOperand(1); in visitSelectInst()
3632 if (TrueSI->getCondition()->getType() == CondVal->getType()) { in visitSelectInst()
3634 if (TrueSI->getCondition() == CondVal) { in visitSelectInst()
3644 Value *And = Builder.CreateLogicalAnd(CondVal, TrueSI->getCondition()); in visitSelectInst()
3652 if (FalseSI->getCondition()->getType() == CondVal->getType()) { in visitSelectInst()
3654 if (FalseSI->getCondition() == CondVal) { in visitSelectInst()
3661 Value *Or = Builder.CreateLogicalOr(CondVal, FalseSI->getCondition()); in visitSelectInst()
3678 if (TrueBOSI->getCondition() == CondVal) { in visitSelectInst()
3685 if (TrueBOSI->getCondition() == CondVal) { in visitSelectInst()
3697 if (FalseBOSI->getCondition() == CondVal) { in visitSelectInst()
3704 if (FalseBOSI->getCondition() == CondVal) { in visitSelectInst()
3713 if (match(CondVal, m_Not(m_Value(NotCond))) && in visitSelectInst()
3729 if (!CondVal->getType()->isVectorTy() && !AC.assumptions().empty()) { in visitSelectInst()
3731 computeKnownBits(CondVal, Known, 0, &SI); in visitSelectInst()
3766 (match(TrueVal, m_MaskedLoad(m_Value(), m_Value(), m_Specific(CondVal), in visitSelectInst()
3768 match(TrueVal, m_MaskedGather(m_Value(), m_Value(), m_Specific(CondVal), in visitSelectInst()
3782 (CondVal->getType() == Mask->getType())) { in visitSelectInst()
3788 if (Value *V = simplifyAndInst(CondVal, Mask, SQ.getWithInstruction(&SI))) in visitSelectInst()
3824 if (CondVal->hasOneUse() && SelType->isIntOrIntVectorTy()) { in visitSelectInst()
3835 if (match(CondVal, m_And(m_Value(LHS), m_Value(RHS)))) { in visitSelectInst()
3840 } else if (match(CondVal, m_Or(m_Value(LHS), m_Value(RHS)))) { in visitSelectInst()
3848 if (match(CondVal, m_LogicalAnd(m_Value(LHS), m_Value(RHS)))) { in visitSelectInst()
3851 } else if (match(CondVal, m_LogicalOr(m_Value(LHS), m_Value(RHS)))) { in visitSelectInst()