CSE conversions within sincos
authorAlexandre Oliva <oliva@adacore.com>
Thu, 29 Oct 2020 09:30:50 +0000 (06:30 -0300)
committerAlexandre Oliva <oliva@gnu.org>
Thu, 29 Oct 2020 09:30:50 +0000 (06:30 -0300)
commit53dede0f04bd95c316bb2493db43bc9d1b06c967
tree3512917874a8747ce964ab95b64f398cf0abceb0
parent68990ed13dc36cb98f94afa84e9dadc39e955e8c
CSE conversions within sincos

On platforms in which Aux_[Real_Type] involves non-NOP conversions
(e.g., between single- and double-precision, or between short float
and float), the conversions before the calls are CSEd too late for
sincos to combine calls.

This patch enables the sincos pass to CSE type casts used as arguments
to eligible calls before looking for other calls using the same
operand.

for  gcc/ChangeLog

* tree-ssa-math-opts.c (sincos_stats): Add conv_removed.
(execute_cse_conv_1): New.
(execute_cse_sincos_1): Call it.  Fix return within
FOR_EACH_IMM_USE_STMT.
(pass_cse_sincos::execute): Report conv_inserted.

for  gcc/testsuite/ChangeLog

* gnat.dg/sin_cos.ads: New.
* gnat.dg/sin_cos.adb: New.
* gcc.dg/sin_cos.c: New.
gcc/testsuite/gcc.dg/sin_cos.c [new file with mode: 0644]
gcc/testsuite/gnat.dg/sin_cos.adb [new file with mode: 0644]
gcc/testsuite/gnat.dg/sin_cos.ads [new file with mode: 0644]
gcc/tree-ssa-math-opts.c