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: improving auto increment expressions detection across basic blocks.


Hi Andrew,

I've been looking at doing this possibly in the store sinking pass and
have the following query as below.


On Mon, Apr 7, 2008 at 9:11 PM, Andrew Pinski <pinskia@gmail.com> wrote:
> On Mon, Apr 7, 2008 at 3:31 AM, Ramana Radhakrishnan <ramana.r@gmail.com> wrote:
> >  The basic case is as explained below.
> >
> >  for (i = 0; i < 100; i ++)
> >  {
> >   if (....)
> >  {
> >   a[i] = something;
> >  }
> >  else
> >   a[i] = something else..
> >
> >  }
>
> If it is this case, I think the store to a[i] should really sinked
> below the if statement instead of doing anything fancy with
> autoincrement.

Reg. the store sinking that you point out I've been looking at
tree-ssa-sink.c see if I can do something there .In sink_local it
appears as though the whole thing works by using dominator information
. The sinking process works by going block by block and attempting to
sink to a location which is dominated by this node.

Correct me if I am wrong but if you looked at the basic blocks in
which the stores are already contained, they would not be considered
for store sinking because they don't dominate anything really in the
CFG.  So one wouldn't be able to do this in the current infrastructure
that we have in GCC. Is there any other place that one could look at ?

Cheers
Ramana


>
> Thanks,
> Andrew Pinski
>



-- 
Ramana Radhakrishnan


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