| Issue |
175949
|
| Summary |
`fcmp` on bitcasted constant and inf isn't simplified which triggers unreachable
|
| Labels |
new issue
|
| Assignees |
|
| Reporter |
karolzwolak
|
https://godbolt.org/z/MEeGGj7eT
```llvm
define i1 @crashes() {
%cmp = fcmp ogt bfloat bitcast (half 0xH7C00 to bfloat), 0xR7F80 ; rhs is +inf
ret i1 %cmp
}
```
when run
```sh
opt -passes=instsimplify,instcombine
```
Should be canonicalized to just return `i1 0`, but the bitcasted constant seems to confuse LLVM, which then triggers unreachable here
https://github.com/llvm/llvm-project/blob/7d5fe7e1949321060395e1f4667cae83d6c012d1/llvm/lib/Transforms/InstCombine/InstCombineCompares.cpp#L8833-L8839
Similar examples with `uge` and `-inf` are also affected: https://godbolt.org/z/xPKoEb7Mv.
The relevant code was introduced in #80986.
_______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs