OSDN Git Service

[InstSimplify] enhance fcmp fold with never-nan operand
authorSanjay Patel <spatel@rotateright.com>
Sun, 9 Jun 2019 13:48:59 +0000 (13:48 +0000)
committerSanjay Patel <spatel@rotateright.com>
Sun, 9 Jun 2019 13:48:59 +0000 (13:48 +0000)
commit8a87b868f52b00658b89aa42b7b3ed07b90501ef
tree7c1c2f55e3a078d450ec5747c79df389e3287b89
parent4cca04faf272d995bd39ef7314fb462c7ce72fa9
[InstSimplify] enhance fcmp fold with never-nan operand

This is another step towards correcting our usage of fast-math-flags when applied on an fcmp.
In this case, we are checking for 'nnan' on the fcmp itself rather than the operand of
the fcmp. But I'm leaving that clause in until we're more confident that we can stop
relying on fcmp's FMF.

By using the more general "isKnownNeverNaN()", we gain a simplification shown on the
tests with 'uitofp' regardless of the FMF on the fcmp (uitofp never produces a NaN).
On the tests with 'fabs', we are now relying on the FMF for the call fabs instruction
in addition to the FMF on the fcmp.

This is a continuation of D62979 / rL362879.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@362903 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Analysis/InstructionSimplify.cpp
test/Transforms/InstSimplify/floating-point-compare.ll