This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[graphite] initialize scattering names
- From: "Sebastian Pop" <sebpop at gmail dot com>
- To: "GCC Patches" <gcc-patches at gcc dot gnu dot org>, "Tobias Grosser" <grosser at fim dot uni-passau dot de>
- Date: Tue, 29 Jan 2008 19:55:06 -0600
- Subject: [graphite] initialize scattering names
Cloog needs despite of parameters and iterators, scattering variables which
are used to force a schedule on the way we iterate over the different code
blocks and dimensions. These need to be initialized.
To scatter an schedule with n loops, we need 2*n+1 scattering dimensions.
n dimensions for the order in the loop iteration dimension and n+1 for
the textual order of the different levels.
2008-01-29 Tobias Grosser <grosser@fim.uni-passau.de>
* graphite.c (initialize_cloog_names): Initialize names of scattering
variables.
--- gcc/graphite.c
+++ gcc/graphite.c
@@ -858,7 +858,9 @@ initialize_cloog_names (scop_p scop)
unsigned i, nb_params = VEC_length (tree, SCOP_PARAMS (scop));
char **params = XNEWVEC (char *, nb_params);
unsigned nb_iterators = scop_nb_loops(scop);
+ unsigned nb_scattering= scop_nb_loops(scop) * 2 + 1;
char **iterators = XNEWVEC (char *, nb_iterators);
+ char **scattering = XNEWVEC (char *, nb_scattering);
tree p;
for (i = 0; VEC_iterate (tree, SCOP_PARAMS (scop), i, p); i++)
@@ -888,6 +890,16 @@ initialize_cloog_names (scop_p scop)
SCOP_PROG (scop)->names->nb_iterators = nb_iterators;
SCOP_PROG (scop)->names->iterators = iterators;
+
+ for (i = 0; i < nb_scattering; i++)
+
+ {
+ scattering[i] = XNEWVEC (char, 18 + 12);
+ sprintf (scattering[i], "s_%d", i);
+ }
+
+ SCOP_PROG (scop)->names->nb_scattering = nb_scattering;
+ SCOP_PROG (scop)->names->scattering = scattering;
}
/* Record the parameters used in the SCOP. A variable is a parameter