[InstCombine] icmp(X | OrC, C) --> icmp(X, 0)
We can eliminate the or operation based on the predicate and the relation between OrC and C. sge: X | OrC s>= C --> X s>= 0 iff OrC s>= C s>= 0 sgt: X | OrC s> C --> X s>= 0 iff OrC s> C s>= 0 sle: X | OrC s<= C --> X s< 0 iff OrC s> C s>= 0 slt: X | OrC s< C --> X s< 0 iff OrC s>= C s>= 0 Alive2 links: sge: https://alive2.llvm.org/ce/z/W-6FHE sgt: https://alive2.llvm.org/ce/z/TKK2yJ sle: https://alive2.llvm.org/ce/z/vURQGM slt: https://alive2.llvm.org/ce/z/JAsVfw Related issue: https://github.com/llvm/llvm-project/issues/61538 Signed-off-by:Jun Zhang <jun@junz.org> Differential Revision: https://reviews.llvm.org/D147597
Loading
Please sign in to comment