This pattern showed up when I was investigating a different minnum optimization. I can add the maxnum sibling as a follow-up if this looks ok.
We should be able to perform some other combines when the constants are equal or greater-than too, but that would go in instcombine if I'm seeing it correctly.
Looks like bracket doesn't line up with switch.