[InstCombine] fold icmp of sext bool based on limited range
authorSanjay Patel <spatel@rotateright.com>
Tue, 31 May 2022 15:39:29 +0000 (11:39 -0400)
committerSanjay Patel <spatel@rotateright.com>
Tue, 31 May 2022 16:37:56 +0000 (12:37 -0400)
commit2bf6123f22c65995dec60e02944b459424532d9b
tree4f59439652ce2b26a916291e9ad8c17705d90af8
parentf3fe38448b8c41f828ed03dc704e8b918e3b773e
[InstCombine] fold icmp of sext bool based on limited range

X <=u (sext i1 Y) --> (X == 0) | Y

https://alive2.llvm.org/ce/z/W_tZzo

This is the conjugate/sibling pattern suggested with D126171
for a sign-extended bool value.
llvm/lib/Transforms/InstCombine/InstCombineCompares.cpp
llvm/test/Transforms/InstCombine/icmp-range.ll