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]

[PATCH 61/65] Adapt to new CloogScattering abstraction, introduced in official CLooG versions (CLOOG_ORG).


From: spop <spop@138bc75d-0d04-0410-961f-82ee72b054a4>

2010-07-27  Andreas Simbuerger  <simbuerg@fim.uni-passau.de>

	* graphite-clast-to-gimple.c (free_scattering): Change
	CloogDomainList/CloogDomain to CloogScatteringList/CloogScattering
	(CLOOG_ORG).
	(build_cloog_prog): Same.
	* graphite-cloog-compat.h (cloog_domain): Removed.
	(cloog_scattering): New.
	(cloog_set_domain): Removed.
	(cloog_set_scattering): New.
	(cloog_next_domain): Removed.
	(cloog_next_scattering): New.
	(cloog_set_next_domain): Removed.
	(cloog_set_next_scattering): New.
	(CloogScatteringList): New.
	(CloogScattering): New.
	(cloog_scattering_free): New.
	(new_Cloog_Scattering_from_ppl_Polyhedron): New.
	* graphite-cloog-util.c (new_Cloog_Scattering_from_ppl_Polyhedron):
	New.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/graphite@162608 138bc75d-0d04-0410-961f-82ee72b054a4
---
 gcc/ChangeLog                  |   21 +++++++++++++++++++++
 gcc/ChangeLog.graphite         |   21 +++++++++++++++++++++
 gcc/graphite-clast-to-gimple.c |   25 +++++++++++++------------
 gcc/graphite-cloog-compat.h    |   30 ++++++++++++++++++++----------
 gcc/graphite-cloog-util.c      |   21 +++++++++++++++++++++
 gcc/graphite-cloog-util.h      |    2 ++
 6 files changed, 98 insertions(+), 22 deletions(-)

diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 2391126..dfa57af 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,5 +1,26 @@
 2010-08-02  Andreas Simbuerger  <simbuerg@fim.uni-passau.de>
 
+	* graphite-clast-to-gimple.c (free_scattering): Change
+	CloogDomainList/CloogDomain to CloogScatteringList/CloogScattering
+	(CLOOG_ORG).
+	(build_cloog_prog): Same.
+	* graphite-cloog-compat.h (cloog_domain): Removed.
+	(cloog_scattering): New.
+	(cloog_set_domain): Removed.
+	(cloog_set_scattering): New.
+	(cloog_next_domain): Removed.
+	(cloog_next_scattering): New.
+	(cloog_set_next_domain): Removed.
+	(cloog_set_next_scattering): New.
+	(CloogScatteringList): New.
+	(CloogScattering): New.
+	(cloog_scattering_free): New.
+	(new_Cloog_Scattering_from_ppl_Polyhedron): New.
+	* graphite-cloog-util.c (new_Cloog_Scattering_from_ppl_Polyhedron):
+	New.
+
+2010-08-02  Andreas Simbuerger  <simbuerg@fim.uni-passau.de>
+
 	* graphite-clast-to-gimple.c (build_cloog_prog): Extend with
 	CloogState.
 	(set_cloog_options): Same.
diff --git a/gcc/ChangeLog.graphite b/gcc/ChangeLog.graphite
index b5e53b5..4916f91 100644
--- a/gcc/ChangeLog.graphite
+++ b/gcc/ChangeLog.graphite
@@ -1,5 +1,26 @@
 2010-07-27  Andreas Simbuerger  <simbuerg@fim.uni-passau.de>
 
+	* graphite-clast-to-gimple.c (free_scattering): Change
+	CloogDomainList/CloogDomain to CloogScatteringList/CloogScattering
+	(CLOOG_ORG).
+	(build_cloog_prog): Same.
+	* graphite-cloog-compat.h (cloog_domain): Removed.
+	(cloog_scattering): New.
+	(cloog_set_domain): Removed.
+	(cloog_set_scattering): New.
+	(cloog_next_domain): Removed.
+	(cloog_next_scattering): New.
+	(cloog_set_next_domain): Removed.
+	(cloog_set_next_scattering): New.
+	(CloogScatteringList): New.
+	(CloogScattering): New.
+	(cloog_scattering_free): New.
+	(new_Cloog_Scattering_from_ppl_Polyhedron): New.
+	* graphite-cloog-util.c (new_Cloog_Scattering_from_ppl_Polyhedron):
+	New.
+
+2010-07-27  Andreas Simbuerger  <simbuerg@fim.uni-passau.de>
+
 	* graphite-clast-to-gimple.c (build_cloog_prog): Extend with
 	CloogState.
 	(set_cloog_options): Same.
diff --git a/gcc/graphite-clast-to-gimple.c b/gcc/graphite-clast-to-gimple.c
index 11867cf..138c0df 100644
--- a/gcc/graphite-clast-to-gimple.c
+++ b/gcc/graphite-clast-to-gimple.c
@@ -1127,14 +1127,14 @@ translate_clast (sese region, loop_p context_loop, struct clast_stmt *stmt,
 /* Free the SCATTERING domain list.  */
 
 static void
-free_scattering (CloogDomainList *scattering)
+free_scattering (CloogScatteringList *scattering)
 {
   while (scattering)
     {
-      CloogDomain *dom = cloog_domain (scattering);
-      CloogDomainList *next = cloog_next_domain (scattering);
+      CloogScattering *dom = cloog_scattering (scattering);
+      CloogScatteringList *next = cloog_next_scattering (scattering);
 
-      cloog_domain_free (dom);
+      cloog_scattering_free (dom);
       free (scattering);
       scattering = next;
     }
@@ -1212,7 +1212,7 @@ build_cloog_prog (scop_p scop, CloogProgram *prog,
   poly_bb_p pbb;
   CloogLoop *loop_list = NULL;
   CloogBlockList *block_list = NULL;
-  CloogDomainList *scattering = NULL;
+  CloogScatteringList *scattering = NULL;
   int nbs = 2 * max_nb_loops + 1;
   int *scaldims;
 
@@ -1264,17 +1264,18 @@ build_cloog_prog (scop_p scop, CloogProgram *prog,
       /* Build scattering list.  */
       {
         /* XXX: Replace with cloog_domain_list_alloc(), when available.  */
-        CloogDomainList *new_scattering
-	  = (CloogDomainList *) xmalloc (sizeof (CloogDomainList));
+        CloogScatteringList *new_scattering
+	  = (CloogScatteringList *) xmalloc (sizeof (CloogScatteringList));
         ppl_Polyhedron_t scat;
-	CloogDomain *dom;
+	CloogScattering *dom;
 
 	scat = PBB_TRANSFORMED_SCATTERING (pbb);
-	dom = new_Cloog_Domain_from_ppl_Polyhedron (scat, scop_nb_params (scop),
-                                                    state);
+        dom = new_Cloog_Scattering_from_ppl_Polyhedron
+          (scat, scop_nb_params (scop), pbb_nb_scattering_transform (pbb),
+           state);
 
-        cloog_set_next_domain (new_scattering, scattering);
-        cloog_set_domain (new_scattering, dom);
+        cloog_set_next_scattering (new_scattering, scattering);
+        cloog_set_scattering (new_scattering, dom);
         scattering = new_scattering;
       }
     }
diff --git a/gcc/graphite-cloog-compat.h b/gcc/graphite-cloog-compat.h
index f27ee5a..56b6bb3 100644
--- a/gcc/graphite-cloog-compat.h
+++ b/gcc/graphite-cloog-compat.h
@@ -58,6 +58,16 @@ typedef const char *clast_name_p;
   new_Cloog_Domain_from_ppl_Polyhedron (POLY)
 #define cloog_domain_from_cloog_matrix(STATE, MAT, NB)\
   cloog_domain_matrix2domain (MAT)
+
+/* CloogScatteringList compatibility.  */
+#define CloogScatteringList CloogDomainList
+#define CloogScattering CloogDomain
+#define cloog_set_next_scattering cloog_set_next_domain
+#define cloog_set_scattering cloog_set_domain
+#define cloog_scattering cloog_domain
+#define cloog_next_scattering cloog_next_domain
+#define cloog_scattering_free cloog_domain_free
+
 #endif
 
 /* Adapt CLooG accessors from CLooG legacy to
@@ -71,28 +81,28 @@ cloog_statement_usr (CloogStatement *cs)
   return cs->usr;
 }
 
-static inline CloogDomain *
-cloog_domain (CloogDomainList *dl)
+static inline CloogScattering *
+cloog_scattering (CloogScatteringList *sl)
 {
-  return dl->domain;
+  return sl->scatt;
 }
 
 static inline void
-cloog_set_domain (CloogDomainList *dl, CloogDomain *domain)
+cloog_set_scattering (CloogScatteringList *sl, CloogScattering *scatt)
 {
-  dl->domain = domain;
+  sl->scatt = scatt;
 }
 
-static inline CloogDomainList *
-cloog_next_domain (CloogDomainList *dl)
+static inline CloogScatteringList *
+cloog_next_scattering (CloogScatteringList *sl)
 {
-  return dl->next;
+  return sl->next;
 }
 
 static inline void
-cloog_set_next_domain (CloogDomainList *dl, CloogDomainList *next)
+cloog_set_next_scattering (CloogScatteringList *sl, CloogScatteringList *next)
 {
-  dl->next = next;
+  sl->next = next;
 }
 
 static inline int
diff --git a/gcc/graphite-cloog-util.c b/gcc/graphite-cloog-util.c
index 500443f..1770458 100644
--- a/gcc/graphite-cloog-util.c
+++ b/gcc/graphite-cloog-util.c
@@ -238,6 +238,27 @@ new_Cloog_Domain_from_ppl_Polyhedron (ppl_const_Polyhedron_t ph, int nb_params,
   return res;
 }
 
+/* Create a CloogScattering from polyhedron PH.  */
+
+CloogScattering *
+new_Cloog_Scattering_from_ppl_Polyhedron (ppl_const_Polyhedron_t ph,
+                                          int nb_params ATTRIBUTE_UNUSED,
+                                          int nb_scatt ATTRIBUTE_UNUSED,
+                                          CloogState *state ATTRIBUTE_UNUSED)
+{
+#ifdef CLOOG_ORG
+  CloogMatrix *mat = new_Cloog_Matrix_from_ppl_Polyhedron (ph);
+  CloogScattering *res = cloog_scattering_from_cloog_matrix (state, mat,
+                                                             nb_scatt,
+                                                             nb_params);
+
+  cloog_matrix_free (mat);
+  return res;
+#else
+  return new_Cloog_Domain_from_ppl_Polyhedron (ph, nb_params, state);
+#endif
+}
+
 /* Creates a CloogDomain from a pointset powerset PS.  */
 
 CloogDomain *
diff --git a/gcc/graphite-cloog-util.h b/gcc/graphite-cloog-util.h
index eaa48f3..d7758ce 100644
--- a/gcc/graphite-cloog-util.h
+++ b/gcc/graphite-cloog-util.h
@@ -27,6 +27,8 @@ along with GCC; see the file COPYING3.  If not see
 CloogMatrix *new_Cloog_Matrix_from_ppl_Polyhedron (ppl_const_Polyhedron_t);
 CloogDomain *new_Cloog_Domain_from_ppl_Polyhedron (ppl_const_Polyhedron_t,
 						   int, CloogState *);
+CloogScattering *new_Cloog_Scattering_from_ppl_Polyhedron
+  (ppl_const_Polyhedron_t, int, int, CloogState *);
 CloogDomain * new_Cloog_Domain_from_ppl_Pointset_Powerset
   (ppl_Pointset_Powerset_C_Polyhedron_t, int, CloogState *);
 void new_C_Polyhedron_from_Cloog_Matrix (ppl_Polyhedron_t *, CloogMatrix *);
-- 
1.7.0.4


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