[Bug tree-optimization/32390] tree-ssa-math-opts.c performs too many IL scans

2009-02-06 Thread rguenth at gcc dot gnu dot org


--- Comment #8 from rguenth at gcc dot gnu dot org  2009-02-06 22:51 ---
Sure.  There's this other problem of testsuite regressions you'll get.  I've
been
there, it takes a _lot_ of time to do even minimal pass re-ordering / removing
:(

The best strathegy was always to fix deficiencies in passes to not need
followup
ones or iterating.


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=32390



[Bug tree-optimization/32390] tree-ssa-math-opts.c performs too many IL scans

2009-02-06 Thread steven at gcc dot gnu dot org


--- Comment #7 from steven at gcc dot gnu dot org  2009-02-06 22:43 ---
Then they should be grouped. And kept grouped.

Here's one case where there has to be a trade-off between micro-optimizations
for specific cases, and compile time for everyone.  Please, for once, let us
seriously consider this trade-off.


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=32390



[Bug tree-optimization/32390] tree-ssa-math-opts.c performs too many IL scans

2009-02-06 Thread rguenth at gcc dot gnu dot org


--- Comment #6 from rguenth at gcc dot gnu dot org  2009-02-06 22:29 ---
Only they all run at different times during the pass pipeline ;)


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=32390



[Bug tree-optimization/32390] tree-ssa-math-opts.c performs too many IL scans

2009-02-06 Thread steven at gcc dot gnu dot org


--- Comment #5 from steven at gcc dot gnu dot org  2009-02-06 21:41 ---
We have a new candidate: bswap optimization.

Diego's idea to do "a single scan that calls back to all these transformations
on every statement" really still sounds like The Right Thing to do.


-- 

steven at gcc dot gnu dot org changed:

   What|Removed |Added

 Status|UNCONFIRMED |NEW
 Ever Confirmed|0   |1
   Keywords||compile-time-hog
   Last reconfirmed|-00-00 00:00:00 |2009-02-06 21:41:34
   date||


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=32390



[Bug tree-optimization/32390] tree-ssa-math-opts.c performs too many IL scans

2007-06-18 Thread paolo dot bonzini at lu dot unisi dot ch


--- Comment #4 from paolo dot bonzini at lu dot unisi dot ch  2007-06-19 
05:09 ---
Subject: Re:  tree-ssa-math-opts.c performs too
 many IL scans


> We have reciprocal pass (in fact CSE recip pass) that CSEs 1.0/z from x/z, 
> y/z,
> .../z. This is done by scanning function for RDIV_EXPR, where denominator (z)
> is the same. If 1.0/func() -> rfunc() conversion is done before recip pass, we
> loose the ability to scan for RDIV_EXPRs and the ability to CSE the division.

You could still use a pointer_set or pointer_map to save where the 
RDIV_EXPRs are and avoid scanning the IL twice.

Paolo


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=32390



[Bug tree-optimization/32390] tree-ssa-math-opts.c performs too many IL scans

2007-06-18 Thread ubizjak at gmail dot com


--- Comment #3 from ubizjak at gmail dot com  2007-06-18 17:40 ---
(In reply to comment #2)

> We need a better explanation than this.  Uros agreed to summarize the
> IRC discussion to close this issue.  It'd be useful if we keep that same
> discussion on the source code itself.

The need for separate IL passes could be explained by:

We have reciprocal pass (in fact CSE recip pass) that CSEs 1.0/z from x/z, y/z,
.../z. This is done by scanning function for RDIV_EXPR, where denominator (z)
is the same. If 1.0/func() -> rfunc() conversion is done before recip pass, we
loose the ability to scan for RDIV_EXPRs and the ability to CSE the division.

By putting 1.0/func()->rfunc() after recip pass, we simply run another scan for
RDIV_EXPRs with function as their argument. Note that we already CSE'd
1.0/func(), so the conversion into rfunc() is trivial. This is the reason why
function recip pass needs to run after recip (aka CSE recip) pass.

Next convesion is sqrt(a/b) -> rsqrt(b/a) conversion that runs after rfunc
recip pass as a separate pass (so, in the function granulartiy). If this pass
is run together or before rfunc pass, then rsqrt pass would convert expressions
like 1.0/sqrt(a/b) into 1.0/rsqrt(b/a). There is no point for rfunc pass (that
would follow) to convert this to sqrt(b/a).


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=32390



[Bug tree-optimization/32390] tree-ssa-math-opts.c performs too many IL scans

2007-06-18 Thread dnovillo at google dot com


--- Comment #2 from dnovillo at google dot com  2007-06-18 14:00 ---
Subject: Re:  tree-ssa-math-opts.c performs too
 many IL scans

On 6/18/07 9:56 AM, rguenth at gcc dot gnu dot org wrote:
> --- Comment #1 from rguenth at gcc dot gnu dot org  2007-06-18 13:56 
> ---
> All three transformations are done at different stages of the optimization
> pipeline due to various reasons.

We need a better explanation than this.  Uros agreed to summarize the
IRC discussion to close this issue.  It'd be useful if we keep that same
discussion on the source code itself.


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=32390



[Bug tree-optimization/32390] tree-ssa-math-opts.c performs too many IL scans

2007-06-18 Thread rguenth at gcc dot gnu dot org


--- Comment #1 from rguenth at gcc dot gnu dot org  2007-06-18 13:56 ---
All three transformations are done at different stages of the optimization
pipeline due to various reasons.


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=32390