Open
Description
Alive2: https://alive2.llvm.org/ce/z/RN4Sch
----------------------------------------
define i1 @src(i8 %x) {
#0:
%cmp = icmp eq i8 %x, 0
%trunc = trunc nuw i8 %x to i1
%or = or i1 %cmp, %trunc
ret i1 %or
}
=>
define i1 @tgt(i8 %x) {
#0:
ret i1 1
}
Transformation seems to be correct!
It is a variant of #132678. cc @scottmcm
See also dtcxzyw/llvm-opt-benchmark#2234 (comment).
I don't know how to generalize this :(