@@ -1120,16 +1120,16 @@ static void simplifyRecipe(VPRecipeBase &R, VPTypeAnalysis &TypeInfo) {
11201120 CmpInst::getInversePredicate (WideCmp->getPredicate ()));
11211121 for (VPUser *U : to_vector (WideCmp->users ())) {
11221122 auto *R = cast<VPSingleDefRecipe>(U);
1123- // not (icmp eq) -> icmp ne
1124- if (match (R, m_Not (m_Specific (WideCmp))))
1125- R->replaceAllUsesWith (WideCmp);
1126- // select (icmp eq), x, y -> select (icmp ne), y, x
1127- else if (match (R, m_Select (m_Specific (WideCmp), m_VPValue (X),
1128- m_VPValue (Y)))) {
1123+ if (match (R, m_Select (m_Specific (WideCmp), m_VPValue (X),
1124+ m_VPValue (Y)))) {
1125+ // select (icmp pred), x, y -> select (icmp inv_pred), y, x
11291126 R->setOperand (1 , Y);
11301127 R->setOperand (2 , X);
1131- } else
1132- llvm_unreachable (" Unexpected user" );
1128+ } else {
1129+ // not (icmp pred) -> icmp inv_pred
1130+ assert (match (R, m_Not (m_Specific (WideCmp))) && " Unexpected user" );
1131+ R->replaceAllUsesWith (WideCmp);
1132+ }
11331133 }
11341134 // If WideCmp doesn't have a debug location, use the one from the
11351135 // negation, to preserve the location.
0 commit comments