Issue 151303
Summary [InstCombine] Incorrect fabs + nsz fold
Labels miscompilation, llvm:instcombine
Assignees
Reporter nikic
    https://alive2.llvm.org/ce/z/FmBrma
```llvm
define float @src(float %a) {
  %i32 = bitcast float %a to i32
  %cmp = icmp slt i32 %i32, 0
  call void @llvm.assume(i1 %cmp)

  %b = fneg nsz float %a
 %c = call float @llvm.fabs(float %b)
  ret float %c
}
```
The fabs is optimized away here, even though `fneg nsz` can flip the sign bit of zero.
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to