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 2/7] Make CLooG options compatible to newer CLooG releases and pass options to build_cloog_prog (CLOOG_ORG).


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

	* graphite-clast-to-gimple.c (set_cloog_options): Make CLooG options
	compatible to newer CLooG releases (CLOOG_ORG).
	(build_cloog_prog): Pass CloogOptions to more functions (CLOOG_ORG).
	(scop_to_clast): Pass CloogOptions to build_cloog_prog (CLOOG_ORG).
	* graphite-cloog-compat.h: Add compatibility macros for CLooG Legacy.
	(build_cloog_prog) : New.
	(cloog_program_extract_scalars): New.
	(cloog_program_scatter): New.
---
 gcc/ChangeLog.graphite         |   11 +++++++++++
 gcc/graphite-clast-to-gimple.c |   13 +++++++++----
 gcc/graphite-cloog-compat.h    |   12 ++++++++++++
 3 files changed, 32 insertions(+), 4 deletions(-)

diff --git a/gcc/ChangeLog.graphite b/gcc/ChangeLog.graphite
index 418596a..18fdc6a 100644
--- a/gcc/ChangeLog.graphite
+++ b/gcc/ChangeLog.graphite
@@ -1,5 +1,16 @@
 2010-07-27  Andreas Simbuerger  <simbuerg@fim.uni-passau.de>
 
+	* graphite-clast-to-gimple.c (set_cloog_options): Make CLooG options
+	compatible to newer CLooG releases (CLOOG_ORG).
+	(build_cloog_prog): Pass CloogOptions to more functions (CLOOG_ORG).
+	(scop_to_clast): Pass CloogOptions to build_cloog_prog (CLOOG_ORG).
+	* graphite-cloog-compat.h: Add compatibility macros for CLooG Legacy.
+	(build_cloog_prog) : New.
+	(cloog_program_extract_scalars): New.
+	(cloog_program_scatter): New.
+
+2010-07-27  Andreas Simbuerger  <simbuerg@fim.uni-passau.de>
+
 	* graphite-clast-to-gimple.c: Include graphite-cloog-compat.h
 	conditionally (CLOOG_ORG).
 	* graphite-cloog-compat.h: New.  Include graphite-cloog-compat.h.
diff --git a/gcc/graphite-clast-to-gimple.c b/gcc/graphite-clast-to-gimple.c
index c518e76..3220a6c 100644
--- a/gcc/graphite-clast-to-gimple.c
+++ b/gcc/graphite-clast-to-gimple.c
@@ -1200,7 +1200,7 @@ initialize_cloog_names (scop_p scop, CloogProgram *prog)
 /* Build cloog program for SCoP.  */
 
 static void
-build_cloog_prog (scop_p scop, CloogProgram *prog)
+build_cloog_prog (scop_p scop, CloogProgram *prog, CloogOptions *options)
 {
   int i;
   int max_nb_loops = scop_max_loop_depth (scop);
@@ -1279,10 +1279,10 @@ build_cloog_prog (scop_p scop, CloogProgram *prog)
   cloog_program_set_scaldims (prog, scaldims);
 
   /* Extract scalar dimensions to simplify the code generation problem.  */
-  cloog_program_extract_scalars (prog, scattering);
+  cloog_program_extract_scalars (prog, scattering, options);
 
   /* Apply scattering.  */
-  cloog_program_scatter (prog, scattering);
+  cloog_program_scatter (prog, scattering, options);
   free_scattering (scattering);
 
   /* Iterators corresponding to scalar dimensions have to be extracted.  */
@@ -1323,9 +1323,14 @@ set_cloog_options (void)
      GLooG.  */
   options->esp = 1;
 
+#ifdef CLOOG_ORG
+  /* Silence CLooG to avoid failing tests due to debug output to stderr.  */
+  options->quiet = 1;
+#else
   /* Enable C pretty-printing mode: normalizes the substitution
      equations for statements.  */
   options->cpp = 1;
+#endif
 
   /* Allow cloog to build strides with a stride width different to one.
      This example has stride = 4:
@@ -1380,7 +1385,7 @@ scop_to_clast (scop_p scop)
 
   /* Connect new cloog prog generation to graphite.  */
   pc.prog = cloog_program_malloc ();
-  build_cloog_prog (scop, pc.prog);
+  build_cloog_prog (scop, pc.prog, options);
   pc.prog = cloog_program_generate (pc.prog, options);
   pc.stmt = cloog_clast_create (pc.prog, options);
 
diff --git a/gcc/graphite-cloog-compat.h b/gcc/graphite-cloog-compat.h
index 44f7157..6608318 100644
--- a/gcc/graphite-cloog-compat.h
+++ b/gcc/graphite-cloog-compat.h
@@ -22,6 +22,18 @@ along with GCC; see the file COPYING3.  If not see
 #ifndef GRAPHITE_CLOOG_COMPAT_H
 #define GRAPHITE_CLOOG_COMPAT_H
 
+/* Restore compatibility to CLooG Legacy.  */
+#ifndef CLOOG_ORG
+
+/* CloogOptions compatibility.  */
+#define build_cloog_prog(SCOP, PROG, OPT) build_cloog_prog (SCOP, PROG)
+#define cloog_program_extract_scalars(PROG, SCATT, OPT)\
+  cloog_program_extract_scalars (PROG, SCATT)
+#define cloog_program_scatter(PROG, SCATT, OPT)\
+  cloog_program_scatter (PROG, SCATT)
+
+#endif
+
 /* Adapt CLooG accessors from CLooG legacy to
    newer CLooG versions.  */
 
-- 
1.7.0.4


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