[InstCombine] Optimize test for same-sign of values
(icmp slt (X & Y), 0) | (icmp sgt (X | Y), -1) -> (icmp sgt (X ^ Y), -1) (icmp slt (X | Y), 0) & (icmp sgt (X & Y), -1) -> (icmp slt (X ^ Y), 0) [[ https://alive2.llvm.org/ce/z/qXxEFP | alive2 example ]] [[ https://godbolt.org/z/aWf9c6j74 | godbolt ]] [[ https://godbolt.org/z/5Ydn5TehY | godbolt for inverted form ]] [[ https://alive2.llvm.org/ce/z/93AODr | alive2 for inverted form ]] [[ https://github.com/llvm/llvm-project/issues/55988 | issue #55988 ]] Differential Revision: https://reviews.llvm.org/D127903
Loading
Please sign in to comment