This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [tree-ssa] Minor code rearrangement
- From: Andi Kleen <ak at muc dot de>
- To: law at redhat dot com
- Cc: gcc-patches at gcc dot gnu dot org
- Date: Thu, 02 Oct 2003 20:20:00 +0200
- Subject: Re: [tree-ssa] Minor code rearrangement
- References: <200310011844.h91Ii5sf005228@speedy.slc.redhat.com>
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