This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] Fix PR30028, fold sin, cos to sincos on the tree-level


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]