Issue 128457
Summary [InstCombine] wrong folding of `select (fcmp ...) (frem ...) C`
Labels new issue
Assignees
Reporter bongjunj
    https://alive2.llvm.org/ce/z/Ee6vRd

```llvm

----------------------------------------
define float @select_fcmp_frem(float %x) {
#0:
  %fcmp = fcmp oeq float %x, 3.000000
  %frem = frem float %x, 2.000000
  %sel = select i1 %fcmp, float %frem, float 1.000000
  ret float %sel
}
=>
define float @select_fcmp_frem(float %x) {
#0:
  ret float 1.000000
}
Transformation doesn't verify!

ERROR: Value mismatch

Example:
float %x = #x40400000 (3)

Source:
i1 %fcmp = #x1 (1)
float %frem = #xbf800000 (-1)
float %sel = #xbf800000 (-1)

Target:
Source value: #xbf800000 (-1)
Target value: #x3f800000 (1)

Summary:
  0 correct transformations
  1 incorrect transformations
  0 failed-to-prove transformations
  0 Alive2 errors
```
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to