[graphite] Last patches: Cloog rebuilds loop structure

Tobias Grosser grosser@fim.uni-passau.de
Thu Jun 5 05:42:00 GMT 2008


Hi graphities,

here the last changes to make Cloog rebuild the loop structures.

Look at http://tobias.osaft.eu/gcc to see the newest test cases,
with the rebuilt loop structures.

1. Cloog domain:
================

To make cloog compile the CloogProgram, the matrices in the CloogDomain
have to be complete. It is not possible to keep empty columns.

For example:

for (i=0; i<8; i++)
  for (j=0; j<5; j++)
    A
  for (k=0; k<3; k++)
    B

The domains right know are:

A:
 i   j   k   1
 1   0   0   0   >= 0
-1   0   0   8   >= 0
 0   1   0   0   >= 0
 0  -1   0   5   >= 0

The third column is never used!

B:
 i   j   k   1
 1   0   0   0   >= 0
-1   0   0   8   >= 0
 0   0   1   0   >= 0
 0   0  -1   3   >= 0

The second column is never used!

To make cloog work we have to produce matrices with the loop depth as column
index:

A:
 a   b   1
 1   0   0   >= 0
-1   0   8   >= 0
 0   1   0   >= 0
 0  -1   5   >= 0

B:
 a   b   1
 1   0   0   >= 0
-1   0   8   >= 0
 0   1   0   >= 0
 0  -1   3   >= 0

a = loop depth 1
b = loop depth 2.

I am not sure, why that was changed in the latest commits. Is there a reason,
why we need these larger matrices? If yes, I will create another patch, that generates
the cloog matrices on the fly and keeps the large matrices untouched.

But to check the cloog code generation, just apply this patch and enjoy the first
cloog regenerated loop nests.

Bugs: scop-0.c does not produce useful output after the commit "Use instantiate_scev 
      instead of instantiate_parameters". If you revert this one, also scop-0.c, will
      produce correct output. Give me some time to look into that one.

Patch: graphite-domain_to_short_cloog_format-2008-06-05.patch

2. setup_cloog_loop:
====================

This function contained a bug. If there have been more than one loop at the outermost
loop level, sometimes we forgot to setup the cloog loop for some of these.
This happened, as the chain loop->next is only complete, if we start at the first loop
of this chain and all loops of this chain are part of the SCoP. This is not always true.

Patch: graphite-setup_cloog_loop-2008-06-05.patch

-------------------------

==> So what is next?

1. We have to add the conditional statement restrictions to the CloogDomains of every bb
to be able to represent conditional control flow in the cloog output. At the moment
these restrictions are missing. Adrien - Let's work together! ;-)

2. All this code has to be tested, as these patches are only tested with small test cases.
To make graphite a stable gcc extension, I will throw some really large programs on this
code.

3. If the new cloog program generation is well tested, I would like to remove the old
cloog program generation.

See you
Tobi
-------------- next part --------------
A non-text attachment was scrubbed...
Name: graphite-domain_to_short_cloog_format-2008-06-05.patch
Type: text/x-patch
Size: 5847 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20080605/d806e9f0/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: graphite-setup_cloog_loop-2008-06-05.patch
Type: text/x-patch
Size: 5787 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20080605/d806e9f0/attachment-0001.bin>


More information about the Gcc-patches mailing list