Lines Matching defs:CondVal
859 auto *CondVal = SI.getCondition();
868 if (!match(CondVal, m_ICmp(Predicate, m_Value(X), m_Zero())) ||
885 auto *ZeroC = cast<Constant>(cast<Instruction>(CondVal)->getOperand(1));
2025 Value *CondVal = SI.getCondition();
2075 Value *NewSel = Builder.CreateSelect(CondVal, NewTrueOp, NewFalseOp,
2100 Value *CondVal = SI.getCondition();
2105 if (!match(CondVal, m_ExtractValue<1>(m_WithOverflowInst(II))) ||
2259 Value *CondVal = SI.getCondition();
2261 auto *CondValTy = dyn_cast<FixedVectorType>(CondVal->getType());
2262 if (!CondValTy || !match(CondVal, m_Constant(CondC)))
2721 Value *CondVal = SI.getCondition();
2730 if (!(match(CondVal, m_ICmp(Pred, m_Value(RemRes), m_APInt(C))) &&
2794 /// Given that \p CondVal is known to be \p CondIsTrue, try to simplify \p SI.
2796 Value *CondVal,
2802 assert(CondVal->getType() == InnerCondVal->getType() &&
2804 if (auto Implied = isImpliedCondition(CondVal, InnerCondVal, DL, CondIsTrue))
2827 Value *CondVal = SI.getCondition();
2838 if (!match(CondVal, m_FCmp(Pred, m_Specific(X), m_AnyZeroFP())))
2916 if (!match(CondVal,
2922 if (Swap == TrueIfSigned && !CondVal->hasOneUse() && !TrueVal->hasOneUse())
3123 Value *CondVal = SI.getCondition();
3131 if (!SelType->isIntOrIntVectorTy(1) || isa<Constant>(CondVal) ||
3132 TrueVal->getType() != CondVal->getType())
3143 if (impliesPoison(FalseVal, CondVal)) {
3145 return BinaryOperator::CreateOr(CondVal, FalseVal);
3148 if (match(CondVal, m_OneUse(m_Select(m_Value(A), m_One(), m_Value(B)))) &&
3155 if (auto *LHS = dyn_cast<FCmpInst>(CondVal))
3162 if (match(CondVal, m_LogicalAnd(m_Value(A), m_Value(B))) &&
3164 (CondVal->hasOneUse() || FalseVal->hasOneUse())) {
3165 bool CondLogicAnd = isa<SelectInst>(CondVal);
3191 if (impliesPoison(TrueVal, CondVal)) {
3193 return BinaryOperator::CreateAnd(CondVal, TrueVal);
3196 if (match(CondVal, m_OneUse(m_Select(m_Value(A), m_Value(B), m_Zero()))) &&
3203 if (auto *LHS = dyn_cast<FCmpInst>(CondVal))
3210 if (match(CondVal, m_LogicalOr(m_Value(A), m_Value(B))) &&
3212 (CondVal->hasOneUse() || TrueVal->hasOneUse())) {
3213 bool CondLogicOr = isa<SelectInst>(CondVal);
3242 Value *NotCond = Builder.CreateNot(CondVal, "not." + CondVal->getName());
3247 Value *NotCond = Builder.CreateNot(CondVal, "not." + CondVal->getName());
3254 (CondVal->hasOneUse() || TrueVal->hasOneUse()) &&
3261 (CondVal->hasOneUse() || FalseVal->hasOneUse()) &&
3266 if (match(CondVal, m_Select(m_Value(A), m_One(), m_Value(B))) &&
3270 if (match(CondVal, m_Select(m_Value(A), m_Value(B), m_Zero())) &&
3280 if (match(CondVal,
3286 if (match(CondVal, m_OneUse(m_c_And(m_Value(C), m_Specific(FalseVal))))) {
3293 if (match(CondVal, m_OneUse(m_c_Or(m_Specific(TrueVal), m_Value(C))))) {
3300 if (match(CondVal,
3310 if (isCheckForZeroAndMulWithOverflow(CondVal, Op1, IsAnd, Y)) {
3317 if (auto *ICmp0 = dyn_cast<ICmpInst>(CondVal))
3327 if (match(CondVal, m_LogicalOr(m_Value(A), m_Value(B))) &&
3335 std::optional<bool> Res = isImpliedCondition(CondVal, B, DL);
3344 std::optional<bool> Res = isImpliedCondition(CondVal, B, DL, false);
3348 if (match(CondVal, m_LogicalAnd(m_Value(A), m_Value(B))) &&
3363 match(CondVal, m_c_LogicalAnd(m_Specific(C), m_Value(A)))) {
3364 auto *SelCond = dyn_cast<SelectInst>(CondVal);
3378 if (match(CondVal, m_c_LogicalAnd(m_Not(m_Value(C)), m_Value(A))) &&
3380 auto *SelCond = dyn_cast<SelectInst>(CondVal);
3585 Value *CondVal = SI.getCondition();
3590 if (Value *V = simplifySelectInst(CondVal, TrueVal, FalseVal,
3603 Type *CondType = CondVal->getType();
3604 if (!isa<Constant>(CondVal) && SelType->isIntOrIntVectorTy() &&
3606 if (Value *S = simplifyWithOpReplaced(TrueVal, CondVal,
3611 if (Value *S = simplifyWithOpReplaced(FalseVal, CondVal,
3630 CondVal->getType()->isVectorTy() == SelType->isVectorTy()) {
3633 return new ZExtInst(CondVal, SelType);
3637 return new SExtInst(CondVal, SelType);
3641 Value *NotCond = Builder.CreateNot(CondVal, "not." + CondVal->getName());
3647 Value *NotCond = Builder.CreateNot(CondVal, "not." + CondVal->getName());
3654 if (auto *FCmp = dyn_cast<FCmpInst>(CondVal)) {
3733 if (ICmpInst *ICI = dyn_cast<ICmpInst>(CondVal))
3768 if (isa<VectorType>(CondVal->getType()) && !isa<VectorType>(Idx->getType()))
3776 Builder.CreateSelect(CondVal, NewT, NewF, SI.getName() + ".idx", &SI);
3814 Value *CmpLHS = cast<CmpInst>(CondVal)->getOperand(0);
3815 Value *CmpRHS = cast<CmpInst>(CondVal)->getOperand(1);
3852 if (TrueSI->getCondition()->getType() == CondVal->getType()) {
3856 *TrueSI, CondVal, /*CondIsTrue=*/true, DL))
3864 Value *And = Builder.CreateLogicalAnd(CondVal, TrueSI->getCondition());
3872 if (FalseSI->getCondition()->getType() == CondVal->getType()) {
3876 *FalseSI, CondVal, /*CondIsTrue=*/false, DL))
3881 Value *Or = Builder.CreateLogicalOr(CondVal, FalseSI->getCondition());
3898 if (TrueBOSI->getCondition() == CondVal) {
3905 if (TrueBOSI->getCondition() == CondVal) {
3917 if (FalseBOSI->getCondition() == CondVal) {
3924 if (FalseBOSI->getCondition() == CondVal) {
3933 if (match(CondVal, m_Not(m_Value(NotCond))) &&
3949 if (!CondVal->getType()->isVectorTy() && !AC.assumptions().empty()) {
3951 computeKnownBits(CondVal, Known, 0, &SI);
3986 (match(TrueVal, m_MaskedLoad(m_Value(), m_Value(), m_Specific(CondVal),
3988 match(TrueVal, m_MaskedGather(m_Value(), m_Value(), m_Specific(CondVal),
4002 (CondVal->getType() == Mask->getType())) {
4008 if (Value *V = simplifyAndInst(CondVal, Mask, SQ.getWithInstruction(&SI)))
4047 if (CondVal->hasOneUse() && SelType->isIntOrIntVectorTy()) {
4058 if (match(CondVal, m_And(m_Value(LHS), m_Value(RHS)))) {
4063 } else if (match(CondVal, m_Or(m_Value(LHS), m_Value(RHS)))) {
4071 if (match(CondVal, m_LogicalAnd(m_Value(LHS), m_Value(RHS)))) {
4074 } else if (match(CondVal, m_LogicalOr(m_Value(LHS), m_Value(RHS)))) {
4081 if (CondVal->getType() == SI.getType() && isKnownInversion(FalseVal, TrueVal))
4082 return BinaryOperator::CreateXor(CondVal, FalseVal);
4089 CondContext CC(CondVal);
4090 findValuesAffectedByCondition(CondVal, /*IsAssume=*/false, [&](Value *V) {