As Volkan noted in the commit thread for rL287585, min/max canonicalization exposes the fact that we're missing combines for min/max patterns. This patch won't solve the example that was attached to that thread, so something else still needs fixing.
The line between InstCombine and InstSimplify gets blurry here because sometimes the icmp instruction that we want to fold to already exists, but sometimes it's the swapped form of what we want.
Also note that there's yet another definition of min/max via the matcher patterns (I didn't find these until recently). I'm still hoping to canonicalize the non-standard patterns detected by matchSelectPattern(), so I went ahead and used m_SMin here even though I think that means those non-standard patterns will fall through for now.
Once this looks ok, I can follow up with the corresponding smax/umin/umax.