[InstCombine] change canonicalization to fabs() to use FMF on fsub
authorSanjay Patel <spatel@rotateright.com>
Mon, 10 Jun 2019 14:46:36 +0000 (14:46 +0000)
committerSanjay Patel <spatel@rotateright.com>
Mon, 10 Jun 2019 14:46:36 +0000 (14:46 +0000)
commit8b6d9f60ed712529d0f4f605387fe8045c96c1b1
treefafce2c37c53380165e9e6cfdcd34123459c7396
parentb87669f166ce0bb810b2a6655fdaa79bc3b4f010
[InstCombine] change canonicalization to fabs() to use FMF on fsub

Similar to rL362909:
This isn't the ideal fix (use FMF on the select), but it's still an
improvement until we have better FMF propagation to selects and other
FP math operators.

I don't think there's much risk of regression from this change by
not including the FMF on the fcmp any more. The nsz/nnan FMF
should be the same on the fcmp and the fsub because they have the
same operand.

llvm-svn: 362943
llvm/lib/Transforms/InstCombine/InstCombineSelect.cpp
llvm/test/Transforms/InstCombine/fabs.ll