[InstCombine] Incorrect addition of `nsz` to `llvm.minnum`: target's return value is more undefined
- Dominant language
- LLVM
- Stars
- 40.5k
- Forks
- 18.7k
- PR merge metrics
- PR metrics pending
Description
Hi, I found a miscompilation in InstCombine.
Alive2 reports that the target's return value is more undefined than the source.
```llvm
define nofpclass(nsub) float @src(float %unknown, float noundef nofpclass(pinf zero sub norm) %must.be.ninf.or.nan) {
%result = call float @llvm.minnum.f32(float %must.be.ninf.or.nan, float %unknown)
ret float %result
}
```
```llvm
define nofpclass(nsub) float @tgt(float %unknown, float noundef nofpclass(pinf zero sub norm) %must.be.ninf.or.nan) {
%result = call nsz float @llvm.minnum.f32(float %must.be.ninf.or.nan, float %unknown)
ret float %result
}
```
Alive2 report:
https://alive2.llvm.org/ce/z/ji6x4X
LLVM opt:
https://godbolt.org/z/3d3bqKqvT
This is introduced by PR #179299.
Contributor guide
Assessment
This issue has not been assessed yet.