This is the mail archive of the gcc-patches@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: Fw: [lno] compute symbolic values for loop counts


Hello,

> In some cases funciton number_of_iterations_in_loop ()
> returns an interval, such as in the following example:
> 
>         # n_1 = PHI <20(5), 15(1)>;
>         ...
>         # i_3 = PHI <0(6), i_12(9)>;
>       <L7>:
>         a[i_3] = 0;
>         i_12 = i_3 + 1;
>         if (i_12 < n_1) goto <L7>
> 
> 
> The returned tree is:
> 
> <(<unnamed type>)([15, 20] - 1 + 0)> + 1
> 
> We are using this tree in order to generate a temporary
> variable from it, that cannot be done in this case.
> What we are looking for is the value n_1 (or (n_1 - 1) + 1),
> or, in general, the value as it was calculated before
> conversion into interval.

I believe the right thing number_of_iterations_in_loop should do
is to return n_1; if some pass is interested in getting the intervals,
it may use instantiate_parameters to get them in.

Zdenek


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