Issue 114359
Summary [InstCombine] increased undefinedness when folding `(or (and (bitcast F) INTMAX), INTMIN)`
Labels new issue
Assignees
Reporter bongjunj
    ```llvm
----------------------------------------
define float @fneg_fabs_fabs_as_int_f32_and_or.2(float %val) {
#0:
  %bitcast = bitcast float %val to i32
  %and = and i32 %bitcast, 2147483647
  %or = or i32 %and, 2147483648
  %fneg.fabs = bitcast i32 %or to float
  %#1 = fmul float %fneg.fabs, %fneg.fabs
  ret float %#1
}
=>
define float @fneg_fabs_fabs_as_int_f32_and_or.2(float %val) {
#0:
  %#1 = fmul float %val, %val
  ret float %#1
}
Transformation doesn't verify!

ERROR: Value mismatch

Example:
float %val = undef

Source:
i32 %bitcast = #x00000000 (0)   [based on undef value]
i32 %and = #x00000000 (0)
i32 %or = #x80000000 (2147483648, -2147483648)
float %fneg.fabs = #x80000000 (-0.0)
float %#1 = #x00000000 (+0.0)   [based on undef value]

Target:
float %#1 = #x80000000 (-0.0)
Source value: #x00000000 (+0.0)
Target value: #x80000000 (-0.0)

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

Reply via email to