Description
Alive2: https://alive2.llvm.org/ce/z/ZNNbj_
define i1 @src(i32 %x, i32 %y) {
entry:
%cond = icmp sgt i32 %x, %y
br i1 %cond, label %if.then, label %if.else
if.then:
%cmp = icmp samesign ugt i32 %x, %y
ret i1 %cmp
if.else:
ret i1 false
}
define i1 @tgt(i32 %x, i32 %y) {
entry:
%cond = icmp sgt i32 %x, %y
br i1 %cond, label %if.then, label %if.else
if.then:
ret i1 true
if.else:
ret i1 false
}
We already perform similar optimizations in #115893.