[PATCH] D74713: [ConstantFold] fold most FP ops with undef operand to undef rather than NaN

Roman Lebedev via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Feb 17 12:02:37 PST 2020


lebedev.ri requested changes to this revision.
lebedev.ri added inline comments.
This revision now requires changes to proceed.


================
Comment at: llvm/test/Analysis/ConstantFolding/vector-undef-elts.ll:46-52
 define <3 x float> @fadd() {
 ; CHECK-LABEL: @fadd(
-; CHECK-NEXT:    ret <3 x float> <float undef, float 0x7FF8000000000000, float undef>
+; CHECK-NEXT:    ret <3 x float> undef
 ;
   %c = fadd <3 x float> <float undef, float 42.0, float undef>, undef
   ret <3 x float> %c
 }
----------------
```
----------------------------------------
define <3 x float> @fadd() {
%0:
  %c = fadd <3 x float> { undef, 42.000000, undef }, undef
  ret <3 x float> %c
}
=>
define <3 x float> @fadd() {
%0:
  ret <3 x float> undef
}
Transformation doesn't verify!
ERROR: Value mismatch

Example:

Source:
<3 x float> %c = < undef, #x42280000 (42)       [based on undef value], NaN     [based on undef value] >

Target:
Source value: < NaN     [based on undef value], #x42280000 (42), NaN >
Target value: < #x00000000 (+0.0), #x00000020 (0.000000000000?), NaN >

Summary:
  0 correct transformations
  1 incorrect transformations
  0 errors

```


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D74713/new/

https://reviews.llvm.org/D74713





More information about the llvm-commits mailing list