improving auto increment expressions detection across basic blocks.

Ramana Radhakrishnan ramana.r@gmail.com
Mon Apr 7 16:58:00 GMT 2008


Hi Andrew,





On Mon, Apr 7, 2008 at 4:41 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.

In this case I agree that sinking the store would take care of the
auto increment because you'd then have the store and the increment in
the same block and hence things should theoretically work. Ofcourse
the a[i] in both edges of the if need not exist and the else could
instead be an update to a b[i] in which case there might be a need for
something fancy with auto-increments.

Cheers
Ramana


>
>  Thanks,
>  Andrew Pinski
>



-- 
Ramana Radhakrishnan



More information about the Gcc mailing list