[patch] Cleanup code generation in lambda-code

Daniel Berlin dberlin@dberlin.org
Tue Jun 5 23:59:00 GMT 2007


On 6/5/07, Sebastian Pop <sebpop@gmail.com> wrote:
> Hi,
>
> Here is a patch with the testcase that lead us to consider cleaning
> up this part of lamdba:
>
> int medium_loop_interchange(int A[HEIGHT][WIDTH])
> {
>  int i,j;
>  for(j = 0; j < WIDTH; j++)
>    for(i = 0; i < HEIGHT; i++)
>       A[i][j] = A[i][j] + A[i][j];
>  return A[1][1];
> }
>
> we tried to interchange this kernel and then vectorize it,
> but the vectorization was not able and still is not able to deal
> with the code produced by lambda.  The code contained
> constructs like that:
>
> lbvtmp.38D.2061_47 = 0;
> lbvtmp.38D.2061_48 = lnivtmp.34D.2057_41;
> lbvtmp.38D.2061_49 = lbvtmp.38D.2061_47 + lbvtmp.38D.2061_48;
>
> that were generated quite often.  With the proposed patch we no
> longer generate such sequences, because we just construct a
> linear expression that gets gimplified correctly with a call to
> force_gimple_operands.  At least the code that is generated with
> this patch is not as difficult to pattern match as it was before.
>
> The next steps are to make sure that the generated code from
> lambda is vectorizable, and then also implement some more
> transforms like loop skewing, etc.
>
> The patch passed bootstrap on i686-linux with all languages and
> BOOT_CFLAGS="-g -O2 -fcheck-data-deps -ftree-loop-linear"
> The testsuite is still running, but I verified before that a
> make -k check RUNTESTFLAGS=tree-ssa.exp had no regressions.
> Ok for trunk?
>
Works for me, but you may want to use fold_build2 instead of build2



More information about the Gcc-patches mailing list