instcombine: Migrate math library call simplifications
authorMeador Inge <meadori@codesourcery.com>
Tue, 13 Nov 2012 04:16:17 +0000 (04:16 +0000)
committerMeador Inge <meadori@codesourcery.com>
Tue, 13 Nov 2012 04:16:17 +0000 (04:16 +0000)
commit2920a71663b96f2c33b1fee09ca5ca9f5dc1cf12
treede057ca88e82ce75a40dc65a04b4d4db0db0a2ec
parent4712b804dfe02bc7bbf948f9a5e352b3f14cc89a
instcombine: Migrate math library call simplifications

This patch migrates the math library call simplifications from the
simplify-libcalls pass into the instcombine library call simplifier.

I have typically migrated just one simplifier at a time, but the math
simplifiers are interdependent because:

   1. CosOpt, PowOpt, and Exp2Opt all depend on UnaryDoubleFPOpt.
   2. CosOpt, PowOpt, Exp2Opt, and UnaryDoubleFPOpt all depend on
      the option -enable-double-float-shrink.

These two factors made migrating each of these simplifiers individually
more of a pain than it would be worth.  So, I migrated them all together.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@167815 91177308-0d34-0410-b5e6-96231b3b80d8
18 files changed:
include/llvm/Transforms/Utils/SimplifyLibCalls.h
lib/Transforms/InstCombine/InstructionCombining.cpp
lib/Transforms/Scalar/SimplifyLibCalls.cpp
lib/Transforms/Utils/SimplifyLibCalls.cpp
test/Transforms/InstCombine/cos-1.ll [new file with mode: 0644]
test/Transforms/InstCombine/cos-2.ll [new file with mode: 0644]
test/Transforms/InstCombine/double-float-shrink-1.ll [new file with mode: 0644]
test/Transforms/InstCombine/double-float-shrink-2.ll [new file with mode: 0644]
test/Transforms/InstCombine/exp2-1.ll [new file with mode: 0644]
test/Transforms/InstCombine/exp2-2.ll [new file with mode: 0644]
test/Transforms/InstCombine/pow-1.ll [new file with mode: 0644]
test/Transforms/InstCombine/pow-2.ll [new file with mode: 0644]
test/Transforms/SimplifyLibCalls/cos.ll [deleted file]
test/Transforms/SimplifyLibCalls/double-float-shrink.ll [deleted file]
test/Transforms/SimplifyLibCalls/exp2.ll [deleted file]
test/Transforms/SimplifyLibCalls/floor.ll [deleted file]
test/Transforms/SimplifyLibCalls/pow-to-sqrt.ll [deleted file]
test/Transforms/SimplifyLibCalls/pow2.ll [deleted file]