Weiming Zhao
cc87069c31
[SimplifyLibCalls] Optimization for pow(x, n) where n is some constant
...
Summary:
In order to avoid calling pow function we generate repeated fmul when n is a
positive or negative whole number.
For each exponent we pre-compute Addition Chains in order to minimize the no.
of fmuls.
Refer: http://wwwhomes.uni-bielefeld.de/achim/addition_chain.html
We pre-compute addition chains for exponents upto 32 (which results in a max of
7 fmuls).
For eg:
4 = 2+2
5 = 2+3
6 = 3+3 and so on
Hence,
pow(x, 4.0) ==> y = fmul x, x
x = fmul y, y
ret x
For negative exponents, we simply compute the reciprocal of the final result.
Note: This transformation is only enabled under fast-math.
Patch by Mandeep Singh Grang <mgrang@codeaurora.org>
Reviewers: weimingz, majnemer, escha, davide, scanon, joerg
Subscribers: probinson, escha, llvm-commits
Differential Revision: http://reviews.llvm.org/D13994
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@254776 91177308-0d34-0410-b5e6-96231b3b80d8
2015-12-04 22:00:47 +00:00
..
2015-02-27 21:17:42 +00:00
2015-04-16 23:24:18 +00:00
2015-02-27 21:17:42 +00:00
2015-06-17 20:52:32 +00:00
2015-04-16 23:24:18 +00:00
2015-06-17 20:52:32 +00:00
2015-02-27 21:17:42 +00:00
2015-02-27 21:17:42 +00:00
2015-02-27 21:17:42 +00:00
2015-02-27 21:17:42 +00:00
2015-02-27 21:17:42 +00:00
2015-02-27 21:17:42 +00:00
2015-02-27 21:17:42 +00:00
2015-02-27 21:17:42 +00:00
2015-02-27 21:17:42 +00:00
2015-04-16 23:24:18 +00:00
2015-04-16 23:24:18 +00:00
2015-02-27 21:17:42 +00:00
2015-03-24 21:50:35 +00:00
2015-02-27 21:17:42 +00:00
2015-09-11 03:22:04 +00:00
2015-09-11 03:22:04 +00:00
2015-11-19 05:56:52 +00:00
2015-02-27 19:29:02 +00:00
2015-02-27 19:29:02 +00:00
2015-02-27 21:17:42 +00:00
2015-02-27 21:17:42 +00:00
2015-02-27 21:17:42 +00:00
2015-04-16 23:24:18 +00:00
2015-02-27 19:29:02 +00:00
2015-02-27 21:17:42 +00:00
2015-04-16 23:24:18 +00:00
2015-02-27 21:17:42 +00:00
2015-04-16 23:24:18 +00:00
2015-02-27 21:17:42 +00:00
2015-02-27 21:17:42 +00:00
2015-04-16 23:24:18 +00:00
2015-04-16 23:24:18 +00:00
2015-06-17 20:52:32 +00:00
2015-03-13 18:20:45 +00:00
2015-02-27 21:17:42 +00:00
2015-04-16 23:24:18 +00:00
2015-02-27 21:17:42 +00:00
2015-02-27 19:29:02 +00:00
2015-02-27 21:17:42 +00:00
2015-02-27 21:17:42 +00:00
2014-11-24 23:03:17 +00:00
2015-04-16 23:24:18 +00:00
2013-11-15 01:34:59 +00:00
2015-04-16 23:24:18 +00:00
2015-02-27 21:17:42 +00:00
2015-02-27 19:29:02 +00:00
2015-11-19 05:56:52 +00:00
2015-02-27 21:17:42 +00:00
2015-02-27 21:17:42 +00:00
2015-02-27 21:17:42 +00:00
2015-02-27 21:17:42 +00:00
2015-03-13 18:20:45 +00:00
2015-03-13 18:20:45 +00:00
2015-04-16 23:24:18 +00:00
2015-02-27 19:29:02 +00:00
2015-02-27 21:17:42 +00:00
2015-02-27 19:29:02 +00:00
2015-02-27 21:17:42 +00:00
2015-02-27 21:17:42 +00:00
2015-02-27 19:29:02 +00:00
2015-02-27 21:17:42 +00:00
2015-04-16 23:24:18 +00:00
2014-05-24 12:50:23 +00:00
2015-02-27 21:17:42 +00:00
2015-02-27 21:17:42 +00:00
2015-02-27 21:17:42 +00:00
2015-03-13 18:20:45 +00:00
2015-03-13 18:20:45 +00:00
2015-02-27 19:29:02 +00:00
2015-02-27 21:17:42 +00:00
2015-02-27 21:17:42 +00:00
2015-03-13 18:20:45 +00:00
2014-06-12 14:06:00 +00:00
2015-07-14 22:39:23 +00:00
2015-02-27 21:17:42 +00:00
2014-06-02 21:23:54 +00:00
2014-06-17 00:42:07 +00:00
2014-12-01 09:27:46 +00:00
2015-06-17 20:52:32 +00:00
2015-11-19 05:56:52 +00:00
2015-09-11 03:22:04 +00:00
2015-02-27 19:29:02 +00:00
2015-11-19 05:56:52 +00:00
2015-02-27 21:17:42 +00:00
2015-07-14 00:11:08 +00:00
2015-02-27 21:17:42 +00:00
2015-05-11 06:37:03 +00:00
2015-10-23 20:37:08 +00:00
2015-11-19 05:56:52 +00:00
2015-10-08 17:09:31 +00:00
2015-08-16 07:09:17 +00:00
2014-11-27 11:22:49 +00:00
2015-01-06 08:41:31 +00:00
2015-09-08 18:36:56 +00:00
2014-10-13 22:37:51 +00:00
2014-09-07 19:21:07 +00:00
2015-02-27 21:17:42 +00:00
2015-10-07 16:01:18 +00:00
2015-02-27 21:17:42 +00:00
2015-02-27 21:17:42 +00:00
2015-09-11 03:22:04 +00:00
2014-12-15 19:07:53 +00:00
2015-11-19 21:32:25 +00:00
2015-11-12 12:39:41 +00:00
2015-02-27 21:17:42 +00:00
2015-08-12 08:08:56 +00:00
2015-03-10 22:52:37 +00:00
2015-08-10 19:56:39 +00:00
2015-10-06 20:20:45 +00:00
2015-09-24 10:24:58 +00:00
2015-04-16 23:24:18 +00:00
2015-09-14 18:10:43 +00:00
2014-04-30 17:22:00 +00:00
2015-03-11 18:03:05 +00:00
2015-11-19 05:56:52 +00:00
2015-06-17 20:52:32 +00:00
2014-12-15 19:07:53 +00:00
2015-02-27 21:17:42 +00:00
2014-02-20 23:00:15 +00:00
2015-11-25 00:42:19 +00:00
2015-09-15 17:51:59 +00:00
2015-08-10 19:01:27 +00:00
2015-11-22 00:16:24 +00:00
2014-03-24 04:36:06 +00:00
2015-10-07 00:20:07 +00:00
2015-09-16 20:41:29 +00:00
2015-03-13 18:20:45 +00:00
2015-03-13 18:20:45 +00:00
2015-09-11 03:22:04 +00:00
2015-03-13 18:20:45 +00:00
2015-03-10 05:13:47 +00:00
2014-10-01 20:36:33 +00:00
2014-03-06 05:32:52 +00:00
2015-02-27 21:17:42 +00:00
2015-06-17 20:52:32 +00:00
2015-10-14 22:42:12 +00:00
2015-11-05 22:03:56 +00:00
2015-11-05 22:03:56 +00:00
2015-03-08 21:53:59 +00:00
2015-04-30 22:05:30 +00:00
2015-09-25 23:21:38 +00:00
2015-02-27 19:29:02 +00:00
2014-06-26 08:57:33 +00:00
2015-02-27 21:17:42 +00:00
2015-10-23 20:37:08 +00:00
2015-03-10 22:43:20 +00:00
2014-10-23 21:52:45 +00:00
2015-02-27 19:29:02 +00:00
2015-04-16 23:24:18 +00:00
2014-02-04 20:27:23 +00:00
2015-03-04 18:43:29 +00:00
2015-10-08 16:56:55 +00:00
2015-08-16 20:18:19 +00:00
2015-03-09 03:20:25 +00:00
2014-01-20 07:44:53 +00:00
2015-11-02 18:00:00 +00:00
2014-12-03 21:46:33 +00:00
2015-02-27 21:17:42 +00:00
2015-09-23 18:40:57 +00:00
2014-11-04 05:17:58 +00:00
2015-02-27 21:17:42 +00:00
2015-02-27 21:17:42 +00:00
2015-05-29 00:04:30 +00:00
2013-11-28 21:38:05 +00:00
2015-02-27 21:17:42 +00:00
2015-04-16 23:24:18 +00:00
2015-03-13 18:20:45 +00:00
2015-02-27 19:29:02 +00:00
2015-09-10 22:35:41 +00:00
2015-02-27 21:17:42 +00:00
2015-02-27 21:17:42 +00:00
2015-03-13 18:20:45 +00:00
2015-10-26 10:25:05 +00:00
2015-04-21 23:02:15 +00:00
2014-11-18 09:31:41 +00:00
2015-09-26 03:26:47 +00:00
2015-09-19 00:48:31 +00:00
2015-12-02 16:15:07 +00:00
2015-03-11 15:12:32 +00:00
2015-11-30 22:39:36 +00:00
2015-07-21 08:52:23 +00:00
2015-02-27 21:17:42 +00:00
2015-06-17 20:52:32 +00:00
2015-03-13 18:20:45 +00:00
2015-11-17 20:13:04 +00:00
2015-11-05 22:03:56 +00:00
2015-03-13 18:20:45 +00:00
2015-07-10 06:55:49 +00:00
2015-05-28 18:39:17 +00:00
2015-05-28 18:39:17 +00:00
2015-12-02 16:15:07 +00:00
2015-11-02 17:53:51 +00:00
2015-11-02 17:53:51 +00:00
2015-11-02 17:53:51 +00:00
2015-10-23 20:37:08 +00:00
2015-03-13 18:20:45 +00:00
2015-02-27 21:17:42 +00:00
2015-02-27 21:17:42 +00:00
2015-11-02 17:53:51 +00:00
2015-11-30 19:38:35 +00:00
2015-11-30 19:36:35 +00:00
2015-02-27 21:17:42 +00:00
2015-12-03 22:45:19 +00:00
2015-04-30 04:56:04 +00:00
2014-10-21 23:00:20 +00:00
2015-02-27 21:17:42 +00:00
2015-03-21 22:04:26 +00:00
2015-08-28 18:30:18 +00:00
2015-11-19 05:56:52 +00:00
2015-11-19 05:56:52 +00:00
2015-11-19 05:56:52 +00:00
2015-11-19 05:56:52 +00:00
2015-11-19 05:56:52 +00:00
2015-11-19 05:56:52 +00:00
2015-11-19 05:56:52 +00:00
2015-11-19 05:56:52 +00:00
2015-11-19 05:56:52 +00:00
2015-02-27 21:17:42 +00:00
2015-05-20 18:41:25 +00:00
2015-08-11 09:12:57 +00:00
2015-01-06 23:00:33 +00:00
2015-04-18 04:41:30 +00:00
2015-02-27 21:17:42 +00:00
2014-12-19 17:12:35 +00:00
2015-09-30 10:56:37 +00:00
2014-11-12 18:25:47 +00:00
2015-02-27 21:17:42 +00:00
2015-08-27 03:16:29 +00:00
2014-11-27 10:57:24 +00:00
2015-09-08 17:58:22 +00:00
2015-02-27 21:17:42 +00:00
2015-06-17 20:52:32 +00:00
2015-09-11 03:22:04 +00:00
2015-03-27 22:04:28 +00:00
2015-11-19 05:56:52 +00:00
2015-02-27 21:17:42 +00:00
2014-01-19 16:48:41 +00:00
2014-12-09 10:46:38 +00:00
2015-12-02 16:15:07 +00:00
2015-04-16 23:24:18 +00:00
2015-03-04 18:43:29 +00:00
2015-04-10 21:07:09 +00:00
2014-05-08 19:50:24 +00:00
2015-11-02 17:53:51 +00:00
2015-11-02 17:53:51 +00:00
2015-11-02 17:53:51 +00:00
2015-02-27 21:17:42 +00:00
2013-12-06 21:48:36 +00:00
2015-09-27 20:34:31 +00:00
2015-11-02 18:00:00 +00:00
2015-12-04 22:00:47 +00:00
2015-11-03 20:32:23 +00:00
2015-11-03 20:32:23 +00:00
2015-11-26 09:51:17 +00:00
2015-11-18 23:21:32 +00:00
2015-02-27 21:17:42 +00:00
2015-02-27 21:17:42 +00:00
2015-04-16 23:24:18 +00:00
2015-04-16 23:24:18 +00:00
2015-02-27 21:17:42 +00:00
2014-11-21 23:36:44 +00:00
2013-12-02 18:43:59 +00:00
2014-04-14 21:50:37 +00:00
2014-07-04 22:05:26 +00:00
2014-11-21 23:36:44 +00:00
2014-11-21 23:36:44 +00:00
2015-03-04 18:43:29 +00:00
2014-12-12 23:59:29 +00:00
2015-06-05 18:04:42 +00:00
2015-06-25 20:14:47 +00:00
2015-08-11 21:33:55 +00:00
2015-08-28 19:09:31 +00:00
2015-03-13 18:20:45 +00:00
2015-04-16 23:24:18 +00:00
2015-04-16 23:24:18 +00:00
2015-03-13 18:20:45 +00:00
2014-06-19 01:19:19 +00:00
2014-12-03 10:39:15 +00:00
2014-06-02 22:01:04 +00:00
2014-03-07 04:36:21 +00:00
2014-01-20 07:44:53 +00:00
2015-02-27 21:17:42 +00:00
2015-02-13 16:33:34 +00:00
2015-03-27 22:04:28 +00:00
2015-03-27 22:04:28 +00:00
2013-11-04 20:36:06 +00:00
2015-02-27 21:17:42 +00:00
2015-03-03 22:40:36 +00:00
2015-06-25 12:18:43 +00:00
2014-06-02 22:01:04 +00:00
2015-11-22 00:16:24 +00:00
2015-02-27 21:17:42 +00:00
2014-02-11 21:09:03 +00:00
2015-02-27 21:17:42 +00:00
2014-12-02 05:29:47 +00:00
2015-02-27 21:17:42 +00:00
2015-11-19 05:56:52 +00:00
2015-11-26 09:51:17 +00:00
2015-02-16 21:47:54 +00:00
2015-11-19 05:56:52 +00:00
2015-10-31 20:59:32 +00:00
2015-04-16 23:24:18 +00:00
2015-04-16 23:24:18 +00:00
2015-11-19 05:56:52 +00:00
2015-02-27 19:29:02 +00:00
2015-05-12 23:52:24 +00:00
2015-03-04 18:43:29 +00:00
2015-11-19 05:56:52 +00:00
2015-02-27 19:29:02 +00:00
2015-03-13 18:20:45 +00:00
2015-02-27 19:29:02 +00:00
2015-02-27 19:29:02 +00:00
2015-02-27 19:29:02 +00:00
2015-02-27 19:29:02 +00:00
2015-03-21 21:09:33 +00:00
2015-02-27 19:29:02 +00:00
2015-03-13 18:20:45 +00:00
2015-02-27 19:29:02 +00:00
2015-11-19 05:56:52 +00:00
2015-02-27 19:29:02 +00:00
2015-02-27 19:29:02 +00:00
2015-03-13 18:20:45 +00:00
2015-02-27 19:29:02 +00:00
2015-02-27 19:29:02 +00:00
2015-02-27 19:29:02 +00:00
2015-02-27 19:29:02 +00:00
2015-02-27 19:29:02 +00:00
2015-02-27 19:29:02 +00:00
2015-02-27 19:29:02 +00:00
2015-02-27 19:29:02 +00:00
2015-02-27 21:17:42 +00:00
2015-02-27 19:29:02 +00:00
2015-11-19 05:56:52 +00:00
2015-02-27 19:29:02 +00:00
2015-03-13 18:20:45 +00:00
2015-02-27 19:29:02 +00:00
2015-03-13 18:20:45 +00:00
2015-02-27 19:29:02 +00:00
2015-03-13 18:20:45 +00:00
2015-02-27 19:29:02 +00:00
2015-02-27 19:29:02 +00:00
2015-03-13 18:20:45 +00:00
2015-02-27 19:29:02 +00:00
2015-11-19 05:56:52 +00:00
2014-08-19 23:36:30 +00:00
2015-06-23 02:49:24 +00:00
2015-03-10 06:51:39 +00:00
2015-11-04 23:36:56 +00:00
2015-11-26 09:51:17 +00:00
2015-11-07 00:52:53 +00:00
2015-11-19 22:11:52 +00:00
2015-03-04 18:43:29 +00:00
2014-11-24 23:15:18 +00:00
2015-05-11 05:33:27 +00:00
2015-04-16 23:24:18 +00:00
2015-10-06 10:34:53 +00:00
2015-02-27 21:17:42 +00:00
2015-02-27 19:29:02 +00:00
2014-01-19 20:05:13 +00:00
2015-11-24 17:51:20 +00:00
2015-02-27 19:29:02 +00:00
2015-11-15 08:19:35 +00:00
2015-08-14 22:46:49 +00:00
2015-02-27 21:17:42 +00:00
2015-02-27 21:17:42 +00:00
2015-02-27 19:29:02 +00:00
2015-09-12 13:39:53 +00:00
2015-04-25 20:55:25 +00:00
2015-07-27 18:52:15 +00:00
2015-07-27 18:52:15 +00:00
2015-09-30 16:44:39 +00:00
2015-10-17 11:40:05 +00:00
2015-09-29 08:19:11 +00:00
2015-03-24 22:39:29 +00:00
2015-10-11 14:38:34 +00:00
2014-09-16 08:50:10 +00:00
2015-11-22 00:16:24 +00:00
2014-06-02 22:01:04 +00:00
2015-02-27 21:17:42 +00:00
2014-01-19 20:05:13 +00:00