[InstCombine] canonicalize cmp+select as umin/umax
(V == 0) ? 1 : V --> umax(V, 1) (V == UMAX) ? UMAX-1 : V --> umin(V, UMAX-1) https://alive2.llvm.org/ce/z/pfDBAf This is one pair of the variants discussed in issue #60374. Enhancements for the other end of the constant range and signed variants are potential follow-ups, but that may require more work because we canonicalize at least one min/max like that to icmp+zext.
Loading
Please sign in to comment