[PATCH] Fix PR45948: add ssa defs from builtin partitions to the last partition.

Sebastian Pop sebpop@gmail.com
Mon Dec 13 17:23:00 GMT 2010


On Mon, Dec 13, 2010 at 10:46, Richard Guenther
<richard.guenther@gmail.com> wrote:
> I think the idea is ok, but as loop distribution already has to track
> use-def scalar dependences can't we simply add all loop-closed
> PHI nodes (args?) to the last partition?  Because it is those that
> we need to preserve (I think).  Your patch might effectively do
> that, but the extra code looks odd to me, as the loop distribution
> machinery would already need to know most of this, no?

Note that this patch does use the same code as the loop distribution
machinery: rdg_flag_vertex_and_dependent

Adding all the close phi nodes to the last partition would duplicate a
lot of the scalar computations that are already computed in other
partitions: for example,

for (i = 0, j = 0; i < n; i++, j+=2)
{
  A[i] = 0;
  B[j] = 0;
}

use (i, j);

in this code we would have a close phi node for both i and j, and it
is possible to distribute the memset zero on array A so the
computation of i should be duplicated on the last partition, but the
loop on j will still remain as B[j] cannot be generated with a memset
zero, and so if you add the close phi of j to the last partition you
would duplicate the scalar computation of j.

So we have to detect all the partitions to find out which scalar
computations were not code generated in these partitions.

Sebastian



More information about the Gcc-patches mailing list