This is the mail archive of the
mailing list for the GCC project.
Re: [4.5] Find more autoinc addressing for induction variables
- From: Kenneth Zadeck <Kenneth dot Zadeck at NaturalBridge dot com>
- To: gcc-patches at gcc dot gnu dot org,"Bonzini, Paolo" <bonzini at gnu dot org>, "Bosscher, Steven" <stevenb dot gcc at gmail dot com>,Bernd Schmidt <bernds_cb1 at t-online dot de>
- Cc: zadeck at naturalbridge dot com
- Date: Thu, 14 May 2009 10:01:30 -0400
- Subject: Re: [4.5] Find more autoinc addressing for induction variables
- Reply-to: Kenneth dot Zadeck at NaturalBridge dot com
> > There'll be another patch to go with this one that makes
> > tree-ssa-loop-ivopts.c generate more opportunities for this one to trigger.
> That's nice, I recall seeing quite a few reports on this. Maybe we want
> this only at -O2 though, DU/UD chains are relatively expensive to build
> (see PR39157).
There is a way to have your cake and eat it too!!!!
There is an interface to df that allows you to cut out a region of
code (say the inner loop) and build the chains you want only over the
variables defined or used in that region. There is a call in df
(df_set_blocks) which allows you to pass a bitmap of the basic blocks
you are interested in. You put that call after you ask for the
df problems but before you call df_analyze. You can then reset the
bitmap and call df_analyze again for the next loop.
this interface was used by zdenek in the rtl loop code and so you can
easily steal the code from there. While you are in the loop code you should
check out the code that zdenek uses to build the tree of loops in the
program and traverse only the inner ones.