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-06-06 15:25:03 +01:00
2021-06-04 23:34:43 -07:00
2021-06-05 18:05:40 +01:00
2021-05-25 20:16:21 -07:00
2021-06-07 10:04:16 +00:00
2021-05-27 12:36:34 +00:00
2021-06-02 10:36:45 +02:00
2021-05-23 14:15:23 -07:00
2021-06-06 13:45:11 +01:00
2021-04-20 14:42:46 +01:00
2021-06-04 08:24:55 -07:00
2021-06-03 20:31:01 +00:00
2021-04-28 13:22:10 -07:00
2021-05-18 16:23:43 -07:00
2021-06-03 18:34:36 +02:00
2021-05-31 17:05:13 +01:00
2021-05-27 16:48:40 -07:00
2021-06-07 05:45:05 +00:00
2021-06-07 10:55:25 +01:00
2021-06-04 11:22:06 -07:00
2021-04-21 10:19:01 -04:00
2021-06-05 21:14:43 +01:00
2021-05-13 10:17:45 -04:00
2021-06-07 12:21:38 +01:00
2021-04-16 10:08:36 -04:00
2021-06-03 21:10:51 -07:00
2021-06-07 08:08:05 -04:00