Help w/ CFG/loop optimization problem?

Daniel Berlin dberlin@dberlin.org
Tue Sep 10 16:40:00 GMT 2002



On Tue, 10 Sep 2002, Roger Sayle wrote:

> 
> Hi Dale,
> > Thanks, I'll look at that.  I think it would be more general to have
> > this done in the optimization phases if possible, though; users can
> > write recognizable doloop-able loops in other ways than the usual C
> > idioms.  Of course, some would argue they should be penalized for
> > this. :)
> 
> Hopefully this problem is only short term.
> 
> The core issue is that GCC's loop optimization pass is currently based
> upon notes placed in the RTL stream by the front-ends.  Hence, the loop
> optimizations are only applied to lexical loops in the source code.
> Jan,  Dan and the other folks working on the CFG-branch are working on
> replacing loop.c with a CFG-based loop optimizer, that does its own loop
> discovery (probably based upon DJ-trees), so should be able to optimize
> loops other than the usual C idioms, and perhaps even irreducible loops.
> However this isn't scheduled before 3.5 at the earliest.
Just a note.
My work on the CFG-branch involves variable tracking in the presence of 
optimizations, and outputting dwarf2 location lists to represent this.

The loop stuff is done by Jan and others. When it comes to loop opts, I 
just occasionally contribute code to Jan or others off-list to use as a starting point (like code to 
find nesting depths using DJ graphs, or code to compute SESE regions using 
cycle equivalence finding in O(E) time).




More information about the Gcc-patches mailing list