@@ -3590,23 +3590,14 @@ Instruction *InstCombinerImpl::foldSelectToCmp(SelectInst &SI) {
3590
3590
ICmpInst::isSigned (Pred) ? Intrinsic::scmp : Intrinsic::ucmp;
3591
3591
3592
3592
CallInst *Intrinsic = nullptr ;
3593
- ICmpInst::Predicate NEPred;
3594
3593
// (x < y) ? -1 : zext(x != y)
3595
3594
if (ICmpInst::isLT (Pred) && match (TV, m_AllOnes ()) &&
3596
- match (FV, m_ZExt (m_c_ICmp (NEPred, m_Specific (LHS), m_Specific (RHS)))) &&
3597
- NEPred == ICmpInst::ICMP_NE)
3595
+ match (FV, m_ZExt (m_c_SpecificICmp (ICmpInst::ICMP_NE, m_Specific (LHS), m_Specific (RHS)))))
3598
3596
Intrinsic = Builder.CreateIntrinsic (SI.getType (), IID, {LHS, RHS});
3599
3597
3600
3598
// (x > y) ? 1 : sext(x != y)
3601
3599
if (ICmpInst::isGT (Pred) && match (TV, m_One ()) &&
3602
- match (FV, m_SExt (m_c_ICmp (NEPred, m_Specific (LHS), m_Specific (RHS)))) &&
3603
- NEPred == ICmpInst::ICMP_NE)
3604
- Intrinsic = Builder.CreateIntrinsic (SI.getType (), IID, {LHS, RHS});
3605
-
3606
- // (x >= y) ? zext(x != y) : -1
3607
- if (ICmpInst::isGE (Pred) &&
3608
- match (TV, m_ZExt (m_c_ICmp (NEPred, m_Specific (LHS), m_Specific (RHS)))) &&
3609
- NEPred == ICmpInst::ICMP_NE && match (FV, m_AllOnes ()))
3600
+ match (FV, m_SExt (m_c_SpecificICmp (ICmpInst::ICMP_NE, m_Specific (LHS), m_Specific (RHS)))))
3610
3601
Intrinsic = Builder.CreateIntrinsic (SI.getType (), IID, {LHS, RHS});
3611
3602
3612
3603
if (Intrinsic)
0 commit comments