Issue |
117436
|
Summary |
[InstSimplify] Missed optimization: `X != Y` implies `X | Y != 0`
|
Labels |
missed-optimization,
llvm:transforms
|
Assignees |
dtcxzyw
|
Reporter |
dtcxzyw
|
Proof: https://alive2.llvm.org/ce/z/cJ75Ya
```
define i1 @src(i8 %x, i8 %y) {
entry:
%cond = icmp ne i8 %x, %y
br i1 %cond, label %if.then, label %if.else
if.then:
%or = or i8 %x, %y
%cmp = icmp eq i8 %or, 0
ret i1 %cmp
if.else:
ret i1 false
}
define i1 @tgt(i8 %x, i8 %y) {
entry:
%cond = icmp ne i8 %x, %y
br i1 %cond, label %if.then, label %if.else
if.then:
ret i1 false
if.else:
ret i1 false
}
```
See also https://github.com/dtcxzyw/llvm-tools/issues/32 and https://discourse.llvm.org/t/tuning-up-constraint-elimination/83213/5?u=dtcxzyw.
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs