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] Lazy updating of stmt operands


Hello,

> > >  >> > tree-dfa.c:compute_immediate_uses()
> > >  >> 
> > >  >> Which needs to pass through every single statement in the program. Not
> > >  >> really terribly efficient.
> > >  >> 
> > >  >*shrug*, it's used by SSA-CCP.  Since def-use edges are only needed by
> > >  >some passes, I don't think it would be worth our while trying to
> > >  >maintain them in get_stmt_operands.
> 
> > here is the patch.  It increases time for compiling preprocessed gcc
> > sources from 3m43.734s to 3m47.967s.  It does not use interface of
> > immediate uses, since that is not well suited for updating; instead it
> > just keeps lists of uses for each ssa name.  The old interface and ccp
> > that uses it are not changed by the patch, so in fact the cost would
> > be a bit smaller.
> 
> Why isn't it well suited for updating?

suppose a statement is changed.  To update the immediate uses of this
statement, you would need to go to the defining statement for each
variable, find yourself in a (possibly very long) list of uses and
make the update.  This would be a disaster for the performance.

> The information is in the
> defining stmt's annotation, so given any SSA variable, you can get to
> the immediate uses by looking at the annotation for SSA_NAME_DEF_STMT.
> It needs a marginal extention to deal with the fact that there can be
> multiple defs/vdefs on one stmt, but we need to do that to handle
> virtual defs anyway.  I would prefer to keep this information right with
> the stmt rather than in a table on the side.

Immediate use is not a property of the statement, but the property of
the ssa name; so it should be in the SSA_NAME, as my patch does,
not in the statement annotations.

Zdenek


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