OSDN Git Service

SimplifyLibCalls: Remove incorrect optimization of fabs
authorMatt Arsenault <Matthew.Arsenault@amd.com>
Sat, 7 Jan 2017 19:55:12 +0000 (19:55 +0000)
committerMatt Arsenault <Matthew.Arsenault@amd.com>
Sat, 7 Jan 2017 19:55:12 +0000 (19:55 +0000)
commit071eccb2551364f0354a01263f109155280766cd
tree29906cc3c8c7f8044ed1ca3dbd0694ac1b0c64bc
parent91a00349ed32c75a4137f37c9ec592ecf887a0de
SimplifyLibCalls: Remove incorrect optimization of fabs

fabs(x * x) is not generally safe to assume x is positive if x is a NaN.
This is also less general than it could be, so this will be replaced
with a transformation on the intrinsic.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@291359 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Transforms/Utils/SimplifyLibCalls.cpp
test/Transforms/InstCombine/fabs.ll
test/Transforms/InstCombine/fast-math.ll