Optimize away fabs() calls when input is squared (known positive).
authorSanjay Patel <spatel@rotateright.com>
Tue, 14 Oct 2014 20:43:11 +0000 (20:43 +0000)
committerSanjay Patel <spatel@rotateright.com>
Tue, 14 Oct 2014 20:43:11 +0000 (20:43 +0000)
commit3f349b2ba807629665dfb164a1409cc79ac64afb
tree421d3568bb04f7f5d81acc0ed88d61892241c9f0
parent40017084f71d7e93ed57ed395f375b249d690952
Optimize away fabs() calls when input is squared (known positive).

Eliminate library calls and intrinsic calls to fabs when the input
is a squared value.

Note that no unsafe-math / fast-math assumptions are needed for
this optimization.

Differential Revision: http://reviews.llvm.org/D5777

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@219717 91177308-0d34-0410-b5e6-96231b3b80d8
include/llvm/Transforms/Utils/SimplifyLibCalls.h
lib/Transforms/Utils/SimplifyLibCalls.cpp
test/Transforms/InstCombine/fabs.ll [new file with mode: 0644]