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: [tree-ssa] Minor code rearrangement


law@redhat.com writes:

> Long term what I want to see is the ability to call a dominator walker
> with a structure containing callbacks and state.  Then we'd share the
> walker between SSA rewriting and existing dominator optimizations.  That
> would also provide the framework to allow us to plug in other optimizations
> around a dominator walk.

Just a thought.

Assuming gcc performance is mostly limited by memory latency in walking
structures.

Then using walker functions for every sub optimization that walks
the whole tree for each transformation would be slower than having
a central walker that walks once and applies all applicable transformation.

As far as I can see currently optimize_stmt works like this.
It walks the tree once and does everything in one go.

Using multiple walks would then be slower because the eat the 
overhead of going through the tree multiple times.

If you design such a generic  walker I would design it in a way that it 
gets a list of callbacks and calls them all in order while doing a single 
walk. 

This would be a bit more complicated because there could 
be side effects between the different callbacks, but likely much faster.

It is a very similar problem to handling a parse tree in fact.

-Andi


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