]> gcc.gnu.org Git - gcc.git/commit
Move cabs expansion from powcabs to complex lowering [PR115710]
authorAndrew Pinski <quic_apinski@quicinc.com>
Sun, 30 Jun 2024 19:57:14 +0000 (12:57 -0700)
committerAndrew Pinski <quic_apinski@quicinc.com>
Tue, 2 Jul 2024 21:26:51 +0000 (14:26 -0700)
commitd8fe4f05ef448e6a136398d38c0f2170d3c6bb0d
tree07d388c5dfbd1733bd9233230b8e1079c0fd603e
parent578ccc717937178b50db0e35554da3f77f19e304
Move cabs expansion from powcabs to complex lowering [PR115710]

Expanding cabs in powcab might be too late as forwprop might
recombine the load from a memory with the complex expr. Moving
instead to complex lowering allows us to use directly the real/imag
component from the loads instead. This allows for vectorization too.

Bootstrapped and tested on x86_64-linux-gnu with no regressions.

PR tree-optimization/115710

gcc/ChangeLog:

* tree-complex.cc (init_dont_simulate_again): Handle CABS.
(gimple_expand_builtin_cabs): New function, moved mostly
from tree-ssa-math-opts.cc.
(expand_complex_operations_1): Call gimple_expand_builtin_cabs.
* tree-ssa-math-opts.cc (gimple_expand_builtin_cabs): Remove.
(build_and_insert_binop): Remove.
(pass_data_expand_powcabs): Update comment.
(pass_expand_powcabs::execute): Don't handle CABS.

gcc/testsuite/ChangeLog:

* gcc.dg/tree-ssa/cabs-1.c: New test.
* gcc.dg/tree-ssa/cabs-2.c: New test.
* gfortran.dg/vect/pr115710.f90: New test.

Signed-off-by: Andrew Pinski <quic_apinski@quicinc.com>
gcc/testsuite/gcc.dg/tree-ssa/cabs-1.c [new file with mode: 0644]
gcc/testsuite/gcc.dg/tree-ssa/cabs-2.c [new file with mode: 0644]
gcc/testsuite/gfortran.dg/vect/pr115710.f90 [new file with mode: 0644]
gcc/tree-complex.cc
gcc/tree-ssa-math-opts.cc
This page took 0.079517 seconds and 6 git commands to generate.