This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] Fix PR30028, fold sin, cos to sincos on the tree-level
- From: Richard Guenther <rguenther at suse dot de>
- To: Paolo Bonzini <paolo dot bonzini at lu dot unisi dot ch>
- Cc: GCC Patches <gcc-patches at gcc dot gnu dot org>, Daniel Berlin <dberlin at dberlin dot org>
- Date: Mon, 11 Dec 2006 10:39:13 +0100 (CET)
- Subject: Re: [PATCH] Fix PR30028, fold sin, cos to sincos on the tree-level
- References: <Pine.LNX.4.64.0612071925330.3105@zhemvz.fhfr.qr> <457D10CC.3050803@lu.unisi.ch>
On Mon, 11 Dec 2006, Paolo Bonzini wrote:
>
> > * tree-ssa-math-opts.c (execute_cse_reciprocals_1): Gate
> > with !optimize_size && flag_unsafe_math_optimizations.
> > (gate_cse_reciprocals): Only gate with optimize.
> > (execute_cse_sincos_1): New routine to CSE sin and cos to sincos.
> > (execute_cse_reciprocals): Call it.
>
> If you don't want to walk the whole tree once more, please rename this
> function.
>
> > + /* Simply insert cexpi at the argument definition site. */
>
> No way :-(
>
> Something like this caused an enormous regression on povray (it's in bugzilla,
> I don't remember the number though). That's the reason why
> tree-ssa-math-opts.c had to be rewritten to do the dominator magic it does.
I hoped it didn't matter for sin/cos transformation. I looked at all
the dominator magic and the infrastructure didn't look like I could simply
re-use it.
I'll try to re-work it after vacation and if the canonicalization patch
goes in. Of course I still have the plan to teach VN/PRE to do this
transformation by value-numbering sin (x) as IMAGPART_EXPR <cexpi (x)>
and cos (x) as REALPART_EXPR <cexpi (x)> and teaching insertion and
expression re-constructing to deal with value-numbers without a leader.
Dunno what's the best way here, though.
Richard.
--
Richard Guenther <rguenther@suse.de>
Novell / SUSE Labs