Patterns were added to substitute comparison and logic operations with min and logic operations.
Pattern.1
i = a < c
j = b < c
res = i or j
changes to:
m = min(a, b)
res = m < c
Pattern.2
i = a >= c
j = b >= c
res = i and j // negation of the result from Pattern.1
changes to:
m = min(a, b)
tmp = m < c
res = tmp xor 1
Pattern.2 is similar to Pattern.1 except there is no sgeu instruction and result has to be inverted with xor 1.
This patch can resolve this issue: https://github.com/llvm/llvm-project/issues/56518
The DAG for this before isel looks like
There is no AND, the XOR with 1 was already created.