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]

[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


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