(icmp ule (or X, Y), X)
If there are any unique bits between `X` and `Y` --> false
(icmp ugt (or X, Y), X)
If there are any unique bits between `X` and `Y` --> true
Proofs: https://alive2.llvm.org/ce/z/igZM4Q
This patch adds new functionality to InstCombine/InstSimplify,
although it should be noted, this logic did exist elsewhere in
LLVM pipeline.
The rationale is InstCombine can produce (icmp (or X, Y), X)
relatively late in the pipeline (after the other passes that would
normally simplify this well have run), leading to missed
optimizations: https://github.com/llvm/llvm-project/issues/64610
equivalent