[patch] Make scev instantiation call compute_overall_effect_of_inner_loop

Sebastian Pop sebpop@gmail.com
Tue Jun 8 21:54:00 GMT 2010


On Tue, Jun 8, 2010 at 14:11, Sebastian Pop <sebpop@gmail.com> wrote:
> Hi,
>
> I remarked that in add_conditions_to_domain, we are adding the exit
> condition of a loop to the basic blocks following the loop.
> Why do we need to do this?
>
> The example I am looking at is a bit more complicated than this,
> but here is an abstraction that shows the problem:
>
> loop
>  bb0:
>    i_0 = phi (0, i_1)
>    i_1 = i_0 + 1
>    if (i_0 < 1000)
>      goto bb1
>    else
>      goto bb2
>
>  bb1:
>     goto bb0
> end_loop
>
> bb2:
>  S;
>
> We want to add the condition "i_0 >= 1000" to the domain of bb2, and
> this fails in my case as the scev analysis is not able to compute the
> overall effect of the inner loop on i_0.  In the end I wrote a patch
> that makes scev return the right answer, and not surprisingly, in the
> simple example above, we insert a useless constraint: 1000 >= 1000.

So here is that other patch that makes the instantiation of the SCEVs
call compute_overall_effect_of_inner_loop when the instantiation
should happen in an outer loop than where the SSA_NAME was defined.

Regstrap in progress on amd64-linux.  Ok for trunk?

Thanks,
Sebastian
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-Call-compute_overall_effect_of_inner_loop-from-insta.patch
Type: text/x-diff
Size: 1620 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20100608/f4ab769c/attachment.bin>


More information about the Gcc-patches mailing list