OSDN Git Service

[InstCombine] add fold for fabs(X) u< 0.0
authorSanjay Patel <spatel@rotateright.com>
Wed, 7 Nov 2018 15:11:32 +0000 (15:11 +0000)
committerSanjay Patel <spatel@rotateright.com>
Wed, 7 Nov 2018 15:11:32 +0000 (15:11 +0000)
commitb9f324c2611a50adc3e25d1ad7d3b8c9bf8a4b2e
tree65598fcc6ac2abd35757174ef63c264fdcf744e6
parent0d2cd950387e617d77adedfdcde4ca14a11ba2f4
[InstCombine] add fold for fabs(X) u< 0.0

The sibling fold for 'oge' --> 'ord' was already here,
but this half was missing.

The result of fabs() must be positive or nan, so asking
if the result is negative or nan is the same as asking
if the result is nan.

This is another step towards fixing:
https://bugs.llvm.org/show_bug.cgi?id=39475

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@346321 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Transforms/InstCombine/InstCombineCompares.cpp
test/Transforms/InstCombine/fcmp.ll