The change itself is hopefully straightforward: if we know that both operands of an unsigned integer vector comparison are non-negative, then it's safe to directly use a signed-compare-greater-than instruction (the only integer vector compare predicate provided by SSE/AVX).
This should solve PR33276:
https://bugs.llvm.org/show_bug.cgi?id=33276
Some questions and potential follow-ups are raised here:
- Are we better off using pcmpgt + min/max/psubus instructions instead of inverting a pcmp?
- Since we're computing known bits, should we try harder to eliminate other compares like (known negative < known positive)?
- I can't tell what the intent of the AVX512 tests was supposed to be; (X u< 0) is always false. Those tests were added with rL276648.