Hal Finkel 64fa501b10 Apply the InstCombine fptrunc sqrt optimization to llvm.sqrt
InstCombine, in visitFPTrunc, applies the following optimization to sqrt calls:

  (fptrunc (sqrt (fpext x))) -> (sqrtf x)

but does not apply the same optimization to llvm.sqrt. This is a problem
because, to enable vectorization, Clang generates llvm.sqrt instead of sqrt in
fast-math mode, and because this optimization is being applied to sqrt and not
applied to llvm.sqrt, sometimes the fast-math code is slower.

This change makes InstCombine apply this optimization to llvm.sqrt as well.

This fixes the specific problem in PR17758, although the same underlying issue
(optimizations applied to libcalls are not applied to intrinsics) exists for
other optimizations in SimplifyLibCalls.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@194935 91177308-0d34-0410-b5e6-96231b3b80d8
2013-11-16 21:29:08 +00:00
..
2013-08-28 23:04:41 +00:00
2013-07-09 07:50:59 +00:00
2013-08-28 23:04:41 +00:00
2013-11-15 01:34:59 +00:00
2013-07-09 22:01:22 +00:00
2013-08-12 12:43:26 +00:00
2013-02-16 23:41:36 +00:00
2012-11-14 20:18:34 +00:00
2013-08-28 23:04:41 +00:00
2013-08-21 19:53:10 +00:00
2013-08-28 23:04:41 +00:00
2013-08-28 23:04:41 +00:00
2013-03-28 19:34:14 +00:00

This directory contains test cases for the instcombine transformation.  The
dated tests are actual bug tests, whereas the named tests are used to test
for features that the this pass should be capable of performing.