Daniil Seredkin
7736c1936a
[InstCombine] Missed optimization for pow(x, y) * pow(x, z) with fast-math
If FP reassociation (fast-math) is allowed, then LLVM is free to do the
following transformation pow(x, y) * pow(x, z) -> pow(x, y + z).
This patch adds this transformation and tests for it.
See more https://bugs.llvm.org/show_bug.cgi?id=47205
It handles two cases
1. When operands of fmul are different instructions
%4 = call reassoc float @llvm.pow.f32(float %0, float %1)
%5 = call reassoc float @llvm.pow.f32(float %0, float %2)
%6 = fmul reassoc float %5, %4
-->
%3 = fadd reassoc float %1, %2
%4 = call reassoc float @llvm.pow.f32(float %0, float %3)
2. When operands of fmul are the same instruction
%4 = call reassoc float @llvm.pow.f32(float %0, float %1)
%5 = fmul reassoc float %4, %4
-->
%3 = fadd reassoc float %1, %1
%4 = call reassoc float @llvm.pow.f32(float %0, float %3)
Differential Revision: https://reviews.llvm.org/D102574
2021-06-07 08:08:05 -04:00
..
2021-05-24 19:43:40 +02:00
2021-05-24 19:43:40 +02:00
2020-12-21 15:22:27 +00:00
2021-04-02 12:32:05 +09:00
2021-05-31 09:12:18 -07:00
2021-05-29 08:57:27 +02:00
2021-05-31 09:12:18 -07:00
2021-02-19 12:35:40 +01:00
2020-12-18 00:37:22 +03:00
2020-11-19 11:22:23 -08:00
2020-12-18 17:06:17 -08:00
2021-05-24 19:43:40 +02:00
2021-05-24 19:43:40 +02:00
2021-04-28 23:44:20 +01:00
2021-03-26 20:07:41 +00:00
2021-06-02 15:57:12 -07:00
2021-05-25 20:47:17 +02:00
2021-01-22 21:47:35 +01:00
2021-05-31 09:12:18 -07:00
2021-05-31 10:22:37 +01:00
2021-05-20 14:40:51 -04:00
2021-05-06 01:39:18 +02:00
2021-05-24 19:43:40 +02:00
2021-05-24 19:43:40 +02:00
2020-12-17 01:03:49 +03:00
2021-05-28 17:09:45 +02:00
2021-03-24 17:58:16 +00:00
2021-05-24 19:43:40 +02:00
2021-05-24 19:43:40 +02:00
2021-04-02 13:16:35 -04:00
2021-03-30 15:06:32 +01:00
2020-12-18 17:06:17 -08:00
2021-05-24 19:43:40 +02:00
2020-12-28 19:58:12 -08:00
2021-04-29 00:17:37 +02:00
2021-05-24 19:43:40 +02:00
2021-06-07 08:08:05 -04:00
2020-11-20 17:58:26 -05:00
2021-06-04 11:42:53 -04:00
2021-01-10 18:03:51 +09:00
2021-05-28 16:58:38 -07:00
2021-05-07 19:52:29 +01:00
2021-05-24 19:43:40 +02:00
2021-05-24 19:43:40 +02:00
2020-12-17 16:17:32 +00:00
2021-05-24 19:43:40 +02:00
2021-05-12 15:29:29 -07:00
2021-06-07 10:55:25 +01:00
2021-06-01 13:07:36 +01:00
2021-04-19 18:38:39 +03:00
2021-05-12 19:22:01 +01:00
2021-04-27 05:46:43 -04:00
2021-06-04 13:35:00 -07:00
2021-05-31 16:27:38 -04:00
2021-03-19 12:28:22 +07:00
2021-03-06 21:52:46 +03:00
2021-05-24 19:43:40 +02:00
2021-05-24 19:43:40 +02:00
2021-05-06 09:29:52 +09:00
2021-06-02 15:56:23 +01:00
2021-06-05 10:52:02 +02:00
2021-06-07 01:26:47 +09:00
2021-03-25 18:10:36 -07:00
2021-06-07 12:13:21 +01:00
2020-12-18 17:59:12 +00:00
2021-01-21 21:08:54 -08:00
2021-05-14 15:35:21 -07:00
2020-11-14 13:12:38 +03:00
2021-06-07 12:13:20 +01:00
2021-05-25 17:02:13 -07:00
2021-05-21 03:40:59 +02:00
2020-11-20 17:58:26 -05:00
2021-05-24 19:43:40 +02:00
2020-11-20 17:58:26 -05:00
2020-11-19 11:22:23 -08:00
2021-04-30 19:02:02 +07:00
2021-05-24 19:43:40 +02:00
2021-05-21 03:40:59 +02:00
2021-05-31 09:12:18 -07:00
2021-06-04 13:27:56 -07:00
2021-06-07 10:59:30 +01:00
2021-05-20 13:12:45 +03:00
2021-05-21 11:06:20 +01:00
2020-11-08 11:14:05 +00:00
2021-04-13 01:29:41 +00:00
2021-05-27 09:14:14 +07:00
2021-05-30 00:52:48 -07:00
2021-06-02 10:32:52 -07:00
2021-02-11 08:59:52 +00:00
2021-05-24 19:43:40 +02:00
2021-05-07 21:51:47 -07:00
2021-04-19 11:03:19 -07:00
2021-06-02 10:58:22 +01:00
2021-05-26 11:43:11 -07:00
2021-06-03 10:26:59 -07:00
2020-12-29 17:09:31 +09:00
2021-05-24 19:43:40 +02:00
2021-05-24 19:43:40 +02:00
2021-03-30 23:20:38 +05:30
2021-05-24 19:43:40 +02:00
2021-05-31 09:12:18 -07:00
2021-04-19 14:04:58 -07:00
2021-05-24 19:43:40 +02:00
2021-06-01 10:40:57 +01:00
2021-03-29 13:03:52 +02:00