Lines Matching defs:CondVal
878 auto *CondVal = SI.getCondition();
887 if (!match(CondVal, m_ICmp(Predicate, m_Value(X), m_Zero())) ||
904 auto *ZeroC = cast<Constant>(cast<Instruction>(CondVal)->getOperand(1));
2023 Value *CondVal = SI.getCondition();
2073 Value *NewSel = Builder.CreateSelect(CondVal, NewTrueOp, NewFalseOp,
2098 Value *CondVal = SI.getCondition();
2103 if (!match(CondVal, m_ExtractValue<1>(m_WithOverflowInst(II))) ||
2257 Value *CondVal = SI.getCondition();
2259 auto *CondValTy = dyn_cast<FixedVectorType>(CondVal->getType());
2260 if (!CondValTy || !match(CondVal, m_Constant(CondC)))
2719 Value *CondVal = SI.getCondition();
2728 if (!(match(CondVal, m_ICmp(Pred, m_Value(RemRes), m_APInt(C))) &&
2792 /// Given that \p CondVal is known to be \p CondIsTrue, try to simplify \p SI.
2794 Value *CondVal,
2800 assert(CondVal->getType() == InnerCondVal->getType() &&
2802 if (auto Implied = isImpliedCondition(CondVal, InnerCondVal, DL, CondIsTrue))
2825 Value *CondVal = SI.getCondition();
2836 if (!match(CondVal, m_FCmp(Pred, m_Specific(X), m_AnyZeroFP())))
2914 if (!match(CondVal,
2920 if (Swap == TrueIfSigned && !CondVal->hasOneUse() && !TrueVal->hasOneUse())
3154 Value *CondVal = SI.getCondition();
3162 if (!SelType->isIntOrIntVectorTy(1) || isa<Constant>(CondVal) ||
3163 TrueVal->getType() != CondVal->getType())
3174 if (impliesPoisonOrCond(FalseVal, CondVal, /*Expected=*/false)) {
3176 return BinaryOperator::CreateOr(CondVal, FalseVal);
3179 if (match(CondVal, m_OneUse(m_Select(m_Value(A), m_One(), m_Value(B)))) &&
3187 if (match(CondVal, m_LogicalAnd(m_Value(A), m_Value(B))) &&
3189 (CondVal->hasOneUse() || FalseVal->hasOneUse())) {
3190 bool CondLogicAnd = isa<SelectInst>(CondVal);
3216 if (impliesPoisonOrCond(TrueVal, CondVal, /*Expected=*/true)) {
3218 return BinaryOperator::CreateAnd(CondVal, TrueVal);
3221 if (match(CondVal, m_OneUse(m_Select(m_Value(A), m_Value(B), m_Zero()))) &&
3229 if (match(CondVal, m_LogicalOr(m_Value(A), m_Value(B))) &&
3231 (CondVal->hasOneUse() || TrueVal->hasOneUse())) {
3232 bool CondLogicOr = isa<SelectInst>(CondVal);
3261 Value *NotCond = Builder.CreateNot(CondVal, "not." + CondVal->getName());
3266 Value *NotCond = Builder.CreateNot(CondVal, "not." + CondVal->getName());
3273 (CondVal->hasOneUse() || TrueVal->hasOneUse()) &&
3280 (CondVal->hasOneUse() || FalseVal->hasOneUse()) &&
3285 if (match(CondVal, m_Select(m_Value(A), m_One(), m_Value(B))) &&
3289 if (match(CondVal, m_Select(m_Value(A), m_Value(B), m_Zero())) &&
3299 if (match(CondVal,
3305 if (match(CondVal, m_OneUse(m_c_And(m_Value(C), m_Specific(FalseVal))))) {
3312 if (match(CondVal, m_OneUse(m_c_Or(m_Specific(TrueVal), m_Value(C))))) {
3319 if (match(CondVal,
3329 if (isCheckForZeroAndMulWithOverflow(CondVal, Op1, IsAnd, Y)) {
3336 if (auto *V = foldBooleanAndOr(CondVal, Op1, SI, IsAnd,
3344 if (match(CondVal, m_LogicalOr(m_Value(A), m_Value(B))) &&
3352 std::optional<bool> Res = isImpliedCondition(CondVal, B, DL);
3361 std::optional<bool> Res = isImpliedCondition(CondVal, B, DL, false);
3365 if (match(CondVal, m_LogicalAnd(m_Value(A), m_Value(B))) &&
3380 match(CondVal, m_c_LogicalAnd(m_Specific(C), m_Value(A)))) {
3381 auto *SelCond = dyn_cast<SelectInst>(CondVal);
3395 if (match(CondVal, m_c_LogicalAnd(m_Not(m_Value(C)), m_Value(A))) &&
3397 auto *SelCond = dyn_cast<SelectInst>(CondVal);
3751 Value *CondVal = SI.getCondition();
3756 if (Value *V = simplifySelectInst(CondVal, TrueVal, FalseVal,
3769 Type *CondType = CondVal->getType();
3770 if (!isa<Constant>(CondVal) && SelType->isIntOrIntVectorTy() &&
3772 if (Value *S = simplifyWithOpReplaced(TrueVal, CondVal,
3777 if (Value *S = simplifyWithOpReplaced(FalseVal, CondVal,
3782 if (replaceInInstruction(TrueVal, CondVal,
3784 replaceInInstruction(FalseVal, CondVal,
3802 CondVal->getType()->isVectorTy() == SelType->isVectorTy()) {
3805 return new ZExtInst(CondVal, SelType);
3809 return new SExtInst(CondVal, SelType);
3813 Value *NotCond = Builder.CreateNot(CondVal, "not." + CondVal->getName());
3819 Value *NotCond = Builder.CreateNot(CondVal, "not." + CondVal->getName());
3826 if (auto *FCmp = dyn_cast<FCmpInst>(CondVal)) {
3885 auto *FCmp = dyn_cast<FCmpInst>(CondVal);
3914 if (CmpInst *CI = dyn_cast<CmpInst>(CondVal))
3918 if (ICmpInst *ICI = dyn_cast<ICmpInst>(CondVal))
3953 if (isa<VectorType>(CondVal->getType()) && !isa<VectorType>(Idx->getType()))
3961 Builder.CreateSelect(CondVal, NewT, NewF, SI.getName() + ".idx", &SI);
3999 Value *CmpLHS = cast<CmpInst>(CondVal)->getOperand(0);
4000 Value *CmpRHS = cast<CmpInst>(CondVal)->getOperand(1);
4030 if (TrueSI->getCondition()->getType() == CondVal->getType()) {
4034 *TrueSI, CondVal, /*CondIsTrue=*/true, DL))
4042 Value *And = Builder.CreateLogicalAnd(CondVal, TrueSI->getCondition());
4050 if (FalseSI->getCondition()->getType() == CondVal->getType()) {
4054 *FalseSI, CondVal, /*CondIsTrue=*/false, DL))
4059 Value *Or = Builder.CreateLogicalOr(CondVal, FalseSI->getCondition());
4076 if (TrueBOSI->getCondition() == CondVal) {
4083 if (TrueBOSI->getCondition() == CondVal) {
4095 if (FalseBOSI->getCondition() == CondVal) {
4102 if (FalseBOSI->getCondition() == CondVal) {
4111 if (match(CondVal, m_Not(m_Value(NotCond))) &&
4127 if (!CondVal->getType()->isVectorTy() && !AC.assumptions().empty()) {
4129 computeKnownBits(CondVal, Known, 0, &SI);
4167 (match(TrueVal, m_MaskedLoad(m_Value(), m_Value(), m_Specific(CondVal),
4169 match(TrueVal, m_MaskedGather(m_Value(), m_Value(), m_Specific(CondVal),
4183 (CondVal->getType() == Mask->getType())) {
4189 if (Value *V = simplifyAndInst(CondVal, Mask, SQ.getWithInstruction(&SI)))
4234 if (CondVal->hasOneUse() && SelType->isIntOrIntVectorTy()) {
4245 if (match(CondVal, m_And(m_Value(LHS), m_Value(RHS)))) {
4250 } else if (match(CondVal, m_Or(m_Value(LHS), m_Value(RHS)))) {
4258 if (match(CondVal, m_LogicalAnd(m_Value(LHS), m_Value(RHS)))) {
4261 } else if (match(CondVal, m_LogicalOr(m_Value(LHS), m_Value(RHS)))) {
4268 if (CondVal->getType() == SI.getType() && isKnownInversion(FalseVal, TrueVal))
4269 return BinaryOperator::CreateXor(CondVal, FalseVal);
4276 CondContext CC(CondVal);
4277 findValuesAffectedByCondition(CondVal, /*IsAssume=*/false, [&](Value *V) {
4306 if (match(CondVal, m_NUWTrunc(m_Value(Trunc)))) {
4312 if (match(CondVal, m_NSWTrunc(m_Value(Trunc)))) {