Take: ``` unsigned fumin(unsigned x, unsigned y) { if (x == -1u) return y; return x < y ? x : y; } signed fsmin(signed x, signed y) { if (x == __INT_MAX__) return y; return x < y ? x : y; } unsigned fumax(unsigned x, unsigned y) { if (x == 0) return y; return x > y ? x : y; } signed fsmax(signed x, signed y) { if (x == -__INT_MAX__-1) return y; return x > y ? x : y; } ``` The comparison against the min/max value should be removed and these just become min/max of x and y. This is the generic version of what was mentioned in https://github.com/llvm/llvm-project/issues/202576 . Mentioning umin/umax and smin/smax.
mine