// llvm/test/Transforms/InstCombine/fabs.ll ``` define double @select_fcmp_nnan_ole_zero(double %x) { %0: %lezero = fcmp ole double %x, 0.000000 %negx = fsub nnan double 0.000000, %x %fabs = select i1 %lezero, double %negx, double %x ret double %fabs } => define double @select_fcmp_nnan_ole_zero(double %x) { %0: %1 = fabs nnan double %x ret double %1 } Transformation doesn't verify! ERROR: Target is more poisonous than source Example: double %x = NaN Source: i1 %lezero = #x0 (0) double %negx = poison double %fabs = NaN Target: double %1 = poison Source value: NaN Target value: poison ``` After the transformation, nnan flag should be dropped because %x can be NaN.
https://reviews.llvm.org/D101727
This has potential to cause perf regressions: https://reviews.llvm.org/rG7bd361200a7b ...but hopefully that makes the transform sound for all existing regression tests. We discussed follow-ups to improve the transform in the review.