This is the mail archive of the gcc@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: [tree-ssa] New regressions as of 2003-11-04


> On Tue, 2003-11-04 at 16:17, law@redhat.com wrote:
> > In message <1067979853.7039.50.camel@p4>, Andrew MacLeod writes:
> 
> >  >
> >  >Aren't we doing any threading during cleanup_tree_cfg()?
> > You can't thread those jumps because the the target has a PHI node.  If
> > you threaded them you'd generate something like
> > 
> > # block 2
> > if (set != -1)
> >   {
> >     goto lab;
> >   }
> > else
> >   {
> >     goto lab;
> >   }
> > 
> > 
> > lab:
> >   set_1 = PHI (-1 (2), 0 (2))
> > 
> > Which causes all kinds of headaches :(
> > 
> Hrm. Thats bad.
> 
> 
> So that means threading ought to guarantee that there in no more than
> one jump between the else block and the PHI node tho
> 
>  In that case perhaps remove_useless_stmts_and_vars_cond() needs to know
> that this can happen... it had to be modified (has to be?? :-) to look

Please lets try to move out of running
remove_useless_stmts_and_vars_cond.  In the case we want to preserve CFG
during RTL expansion, we can not do it.

> for a single stmt in the target of the COND_EXPR arm now, if that block
> contains nothing but a GOTO and a single stmt in the *next* block, then
> it has the same situation.

I think it makes sense add flag to thread_jumps to know whether it is in
SSA or not SSA form.  In SSA form we can disable redirections where we
don't know how to update SSA graph and we can run it once after
expanding out of SSA afterwards.

On the other hand, I was thinking that in longer run, we can probably do
out-of-SSA as part of RTL expansion.  In highlevel point of view, this
is easy.  You can teach expand_expr to deal with SSA_NAME tree node and
we can insert RTL copy statements on the edges during expansion process
and call commit_edge_insertions afterwards.  That way we save number of
temporaries produced.

The motivation is that current sheme of sharing temporaries for
syntactic tables and attempts to re-use same variables as much as
possible on out-of-ssa pass (that I believe has only advantage of saving
memory needed by VAR_DECL/IDENTIFIER nodes) results in unnecesary RTL
registers reuse that in turn badly confuse any local optimizer we do
have turning temporaries global.

I made simple experiment by inserting webizer pass before NULL pointer
conversion pass and on the SPEC, I can measure 1.1% performance
improvement at no compilation time cost. (I am not sure, but I think
it is near the difference in between mainline and tree-SSA branch)
It can be nice to get this for free as a effect of out-of-SSA pass as we
discussed with Jeff in the great past.

Temporary RTL registers are much more light weight that tree variables
and thus this appear to work well even for memory issues.

Honza
> 
> Unfortunately, I would think thats the right place in this Brave New
> World we have.
> 
> Wonder how many more of these we'll stumble upon.
> 
> Andrew
> 
>   
> 


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