diff options
author | Andrew Pinski <apinski@marvell.com> | 2023-04-27 12:21:54 -0700 |
---|---|---|
committer | Andrew Pinski <apinski@marvell.com> | 2023-05-08 00:36:19 -0700 |
commit | 6d6c17e45f62cfe0b7de502af299348fca548b01 (patch) | |
tree | a87a92b2dfa86e83ebb3d874e5200e0b3967b334 /libgfortran/io/async.c | |
parent | 01f3e3768fffa73dc63c261426ebaaf4b9add74b (diff) | |
download | gcc-6d6c17e45f62cfe0b7de502af299348fca548b01.zip gcc-6d6c17e45f62cfe0b7de502af299348fca548b01.tar.gz gcc-6d6c17e45f62cfe0b7de502af299348fca548b01.tar.bz2 |
PHIOPT: factor out unary operations instead of just conversions
After using factor_out_conditional_conversion with diamond bb,
we should be able do use it also for all normal unary gimple and not
just conversions. This allows to optimize PR 59424 for an example.
This is also a start to optimize PR 64700 and a few others.
OK? Bootstrapped and tested on x86_64-linux-gnu with no regressions.
An example of this is:
```
static inline unsigned long long g(int t)
{
unsigned t1 = t;
return t1;
}
static int abs1(int a)
{
if (a < 0)
a = -a;
return a;
}
unsigned long long f(int c, int d, int e)
{
unsigned long long t;
if (d > e)
t = g(abs1(d));
else
t = g(abs1(e));
return t;
}
```
Which should be optimized to:
_9 = MAX_EXPR <d_5(D), e_6(D)>;
_4 = ABS_EXPR <_9>;
t_3 = (long long unsigned intD.16) _4;
gcc/ChangeLog:
* tree-ssa-phiopt.cc (factor_out_conditional_conversion): Rename to ...
(factor_out_conditional_operation): This and add support for all unary
operations.
(pass_phiopt::execute): Update call to factor_out_conditional_conversion
to call factor_out_conditional_operation instead.
PR tree-optimization/109424
PR tree-optimization/59424
gcc/testsuite/ChangeLog:
* gcc.dg/tree-ssa/abs-2.c: Update tree scan for
details change in wording.
* gcc.dg/tree-ssa/minmax-17.c: Likewise.
* gcc.dg/tree-ssa/pr103771.c: Likewise.
* gcc.dg/tree-ssa/minmax-18.c: New test.
* gcc.dg/tree-ssa/minmax-19.c: New test.
Diffstat (limited to 'libgfortran/io/async.c')
0 files changed, 0 insertions, 0 deletions