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][graphite] Merge patches from graphite branch to trunk


Hi,

I committed the attached patches to trunk.
These patches passed bootstrap and test on amd64-linux.

Sebastian Pop
--
AMD / Open Source Compiler Engineering / GNU Tools
From 2f7733471a54a0b77d6fe884b4f5516abdab9c7c Mon Sep 17 00:00:00 2001
From: spop <spop@138bc75d-0d04-0410-961f-82ee72b054a4>
Date: Wed, 10 Feb 2010 16:47:04 +0000
Subject: [PATCH 1/7] Fix PR42771.

2010-02-10  Sebastian Pop  <seb@napoca>

	PR middle-end/42771
	* graphite-clast-to-gimple.c (gloog): Call rename_sese_parameters.
	* graphite-clast-to-gimple.h (gloog): Update declaration.
	* graphite-poly.c (new_scop): Clear POLY_SCOP_P.
	* graphite-poly.h (struct poly_bb): Add missing comments.
	(struct scop): Add poly_scop_p field.
	(POLY_SCOP_P): New.
	* graphite-sese-to-poly.c (build_poly_scop): Set POLY_SCOP_P.
	* graphite.c (graphite_transform_loops): Build the polyhedral
	representation for each scop before code generation.
	* sese.c (rename_variables_in_operand): Removed.
	(rename_variables_in_expr): Return the renamed expression.
	(rename_sese_parameters): New.
	* sese.h (rename_sese_parameters): Declared.

	* gcc.dg/graphite/pr42771.c: New.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/graphite@156664 138bc75d-0d04-0410-961f-82ee72b054a4
---
 gcc/ChangeLog.graphite                  |   19 ++++++++++
 gcc/graphite-clast-to-gimple.c          |    7 +++-
 gcc/graphite-clast-to-gimple.h          |    2 +-
 gcc/graphite-poly.c                     |    2 +
 gcc/graphite-poly.h                     |    7 ++++
 gcc/graphite-sese-to-poly.c             |    1 +
 gcc/graphite.c                          |   19 +++-------
 gcc/sese.c                              |   59 ++++++++++++++-----------------
 gcc/sese.h                              |    1 +
 gcc/testsuite/gcc.dg/graphite/pr42771.c |   19 ++++++++++
 10 files changed, 89 insertions(+), 47 deletions(-)
 create mode 100644 gcc/testsuite/gcc.dg/graphite/pr42771.c

diff --git a/gcc/ChangeLog.graphite b/gcc/ChangeLog.graphite
index d563ad3..41f05b0 100644
--- a/gcc/ChangeLog.graphite
+++ b/gcc/ChangeLog.graphite
@@ -1,3 +1,22 @@
+2010-02-10  Sebastian Pop  <seb@napoca>
+
+	PR middle-end/42771
+	* graphite-clast-to-gimple.c (gloog): Call rename_sese_parameters.
+	* graphite-clast-to-gimple.h (gloog): Update declaration.
+	* graphite-poly.c (new_scop): Clear POLY_SCOP_P.
+	* graphite-poly.h (struct poly_bb): Add missing comments.
+	(struct scop): Add poly_scop_p field.
+	(POLY_SCOP_P): New.
+	* graphite-sese-to-poly.c (build_poly_scop): Set POLY_SCOP_P.
+	* graphite.c (graphite_transform_loops): Build the polyhedral
+	representation for each scop before code generation.
+	* sese.c (rename_variables_in_operand): Removed.
+	(rename_variables_in_expr): Return the renamed expression.
+	(rename_sese_parameters): New.
+	* sese.h (rename_sese_parameters): Declared.
+
+	* gcc.dg/graphite/pr42771.c: New.
+
 2010-02-07  Sebastian Pop  <sebastian.pop@amd.com>
 
 	* gcc.dg/graphite/block-0.c: Call abort for runtime test.  Always
diff --git a/gcc/graphite-clast-to-gimple.c b/gcc/graphite-clast-to-gimple.c
index cc48859..424f5c6 100644
--- a/gcc/graphite-clast-to-gimple.c
+++ b/gcc/graphite-clast-to-gimple.c
@@ -1428,7 +1428,7 @@ create_params_index (htab_t index_table, CloogProgram *prog) {
 */
 
 bool
-gloog (scop_p scop, htab_t bb_pbb_mapping)
+gloog (scop_p scop, VEC (scop_p, heap) *scops, htab_t bb_pbb_mapping)
 {
   VEC (tree, heap) *newivs = VEC_alloc (tree, heap, 10);
   loop_p context_loop;
@@ -1436,6 +1436,7 @@ gloog (scop_p scop, htab_t bb_pbb_mapping)
   ifsese if_region = NULL;
   htab_t rename_map, newivs_index, params_index;
   cloog_prog_clast pc;
+  int i;
 
   timevar_push (TV_GRAPHITE_CODE_GEN);
   gloog_error = false;
@@ -1481,6 +1482,10 @@ gloog (scop_p scop, htab_t bb_pbb_mapping)
 			    if_region->true_region->exit);
   scev_reset_htab ();
   rename_nb_iterations (rename_map);
+
+  for (i = 0; VEC_iterate (scop_p, scops, i, scop); i++)
+    rename_sese_parameters (rename_map, SCOP_REGION (scop));
+
   recompute_all_dominators ();
   graphite_verify ();
 
diff --git a/gcc/graphite-clast-to-gimple.h b/gcc/graphite-clast-to-gimple.h
index 85fb5e1..ae1f35c 100644
--- a/gcc/graphite-clast-to-gimple.h
+++ b/gcc/graphite-clast-to-gimple.h
@@ -36,7 +36,7 @@ typedef struct bb_pbb_def
   poly_bb_p pbb;
 }bb_pbb_def;
 
-extern bool gloog (scop_p, htab_t);
+extern bool gloog (scop_p, VEC (scop_p, heap) *, htab_t);
 extern cloog_prog_clast scop_to_clast (scop_p);
 extern void debug_clast_stmt (struct clast_stmt *);
 extern void print_clast_stmt (FILE *, struct clast_stmt *);
diff --git a/gcc/graphite-poly.c b/gcc/graphite-poly.c
index 6ed6a84..3e29b4b 100644
--- a/gcc/graphite-poly.c
+++ b/gcc/graphite-poly.c
@@ -464,6 +464,8 @@ new_scop (void *region)
   SCOP_ORIGINAL_SCHEDULE (scop) = NULL;
   SCOP_TRANSFORMED_SCHEDULE (scop) = NULL;
   SCOP_SAVED_SCHEDULE (scop) = NULL;
+  POLY_SCOP_P (scop) = false;
+
   return scop;
 }
 
diff --git a/gcc/graphite-poly.h b/gcc/graphite-poly.h
index a2969c7..0a8204e 100644
--- a/gcc/graphite-poly.h
+++ b/gcc/graphite-poly.h
@@ -277,8 +277,10 @@ struct poly_scattering
 
 struct poly_bb
 {
+  /* Pointer to a basic block or a statement in the compiler.  */
   void *black_box;
 
+  /* Pointer to the SCOP containing this PBB.  */
   scop_p scop;
 
   /* The iteration domain of this bb.
@@ -1303,6 +1305,10 @@ struct scop
   /* A hashtable of the data dependence relations for the original
      scattering.  */
   htab_t original_pddrs;
+
+  /* True when the scop has been converted to its polyhedral
+     representation.  */
+  bool poly_scop_p;
 };
 
 #define SCOP_BBS(S) (S->bbs)
@@ -1312,6 +1318,7 @@ struct scop
 #define SCOP_ORIGINAL_SCHEDULE(S) (S->original_schedule)
 #define SCOP_TRANSFORMED_SCHEDULE(S) (S->transformed_schedule)
 #define SCOP_SAVED_SCHEDULE(S) (S->saved_schedule)
+#define POLY_SCOP_P(S) (S->poly_scop_p)
 
 extern scop_p new_scop (void *);
 extern void free_scop (scop_p);
diff --git a/gcc/graphite-sese-to-poly.c b/gcc/graphite-sese-to-poly.c
index 3be2d86..614232b 100644
--- a/gcc/graphite-sese-to-poly.c
+++ b/gcc/graphite-sese-to-poly.c
@@ -2898,6 +2898,7 @@ build_poly_scop (scop_p scop)
   scop_to_lst (scop);
   build_scop_scattering (scop);
   build_scop_drs (scop);
+  POLY_SCOP_P (scop) = true;
 
   return true;
 }
diff --git a/gcc/graphite.c b/gcc/graphite.c
index 7037a3f..ba05cc7 100644
--- a/gcc/graphite.c
+++ b/gcc/graphite.c
@@ -268,20 +268,13 @@ graphite_transform_loops (void)
   bb_pbb_mapping = htab_create (10, bb_pbb_map_hash, eq_bb_pbb_map, free);
 
   for (i = 0; VEC_iterate (scop_p, scops, i, scop); i++)
-    {
-      bool transform_done = false;
-
-      if (!build_poly_scop (scop))
-	continue;
+    build_poly_scop (scop);
 
-      if (apply_poly_transforms (scop))
-	transform_done = gloog (scop, bb_pbb_mapping);
-      else
-	check_poly_representation (scop);
-
-      if (transform_done)
-	need_cfg_cleanup_p = true;
-    }
+  for (i = 0; VEC_iterate (scop_p, scops, i, scop); i++)
+    if (POLY_SCOP_P (scop)
+	&& apply_poly_transforms (scop)
+	&& gloog (scop, scops, bb_pbb_mapping))
+      need_cfg_cleanup_p = true;
 
   htab_delete (bb_pbb_mapping);
   free_scops (scops);
diff --git a/gcc/sese.c b/gcc/sese.c
index f959bdb..6fb4065 100644
--- a/gcc/sese.c
+++ b/gcc/sese.c
@@ -526,49 +526,31 @@ set_rename (htab_t map, tree old_name, tree expr)
   *slot = new_rename_map_elt (old_name, expr);
 }
 
-static void rename_variables_in_expr (htab_t, tree);
-
-/* Renames the operand OP of expression T following the tuples
-   (OLD_NAME, EXPR) in RENAME_MAP.  */
-
-static void
-rename_variables_in_operand (htab_t rename_map, tree t, int op)
-{
-  tree operand = TREE_OPERAND (t, op);
-
-  if (TREE_CODE (operand) == SSA_NAME)
-    {
-      tree new_name = get_rename (rename_map, operand);
-
-      if (new_name != operand)
-	TREE_OPERAND (t, op) = new_name;
-    }
-  else
-    rename_variables_in_expr (rename_map, operand);
-}
-
 /* Renames the expression T following the tuples (OLD_NAME, EXPR) in
-   RENAME_MAP.  */
+   the rename map M.  Returns the expression T after renaming.  */
 
-static void
-rename_variables_in_expr (htab_t rename_map, tree t)
+static tree
+rename_variables_in_expr (htab_t m, tree t)
 {
   if (!t)
-    return;
+    return t;
+
+ if (TREE_CODE (t) == SSA_NAME)
+   return get_rename (m, t);
 
   switch (TREE_CODE_LENGTH (TREE_CODE (t)))
     {
     case 3:
-      rename_variables_in_operand (rename_map, t, 2);
+      TREE_OPERAND (t, 2) = rename_variables_in_expr (m, TREE_OPERAND (t, 2));
 
     case 2:
-      rename_variables_in_operand (rename_map, t, 1);
+      TREE_OPERAND (t, 1) = rename_variables_in_expr (m, TREE_OPERAND (t, 1));
 
     case 1:
-      rename_variables_in_operand (rename_map, t, 0);
+      TREE_OPERAND (t, 0) = rename_variables_in_expr (m, TREE_OPERAND (t, 0));
 
     default:
-      return;
+      return t;
     }
 }
 
@@ -582,9 +564,22 @@ rename_nb_iterations (htab_t rename_map)
   struct loop *loop;
 
   FOR_EACH_LOOP (li, loop, 0)
-    {
-      rename_variables_in_expr (rename_map, loop->nb_iterations);
-    }
+    loop->nb_iterations = rename_variables_in_expr (rename_map,
+						    loop->nb_iterations);
+}
+
+/* Renames all the parameters of SESE following the tuples (OLD_NAME,
+   EXPR) in RENAME_MAP.  */
+
+void
+rename_sese_parameters (htab_t rename_map, sese region)
+{
+  int i;
+  tree p;
+
+  for (i = 0; VEC_iterate (tree, SESE_PARAMS (region), i, p); i++)
+    VEC_replace (tree, SESE_PARAMS (region), i,
+		 rename_variables_in_expr (rename_map, p));
 }
 
 /* Adjusts the phi nodes in the block BB for variables defined in
diff --git a/gcc/sese.h b/gcc/sese.h
index 20dd1b0..980ade9 100644
--- a/gcc/sese.h
+++ b/gcc/sese.h
@@ -264,6 +264,7 @@ extern hashval_t rename_map_elt_info (const void *);
 extern int eq_rename_map_elts (const void *, const void *);
 extern void set_rename (htab_t, tree, tree);
 extern void rename_nb_iterations (htab_t);
+extern void rename_sese_parameters (htab_t, sese);
 
 /* Constructs a new SCEV_INFO_STR structure for VAR and INSTANTIATED_BELOW.  */
 
diff --git a/gcc/testsuite/gcc.dg/graphite/pr42771.c b/gcc/testsuite/gcc.dg/graphite/pr42771.c
new file mode 100644
index 0000000..505fda7
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/graphite/pr42771.c
@@ -0,0 +1,19 @@
+/* { dg-options "-O3 -fgraphite-identity" } */
+
+extern int *A;
+extern int B[][4];
+extern void bar(void);
+
+void foo(int im, int jm, int cond)
+{
+  int i, j;
+  if (cond) {
+    for (i = 0; i < 256; i++)
+      A[i] = 0;
+    bar();
+  }
+  for (i = 0; i < im; i++)
+    for (j = 1; j < jm; j++)
+      if (jm != 8 || j != jm >> 1)
+        B[j][0] ^= B[j-1][0];
+}
-- 
1.6.3.3

From 67eec5e8ef2cd7f9e86c5859b9e42fe91aee599c Mon Sep 17 00:00:00 2001
From: spop <spop@138bc75d-0d04-0410-961f-82ee72b054a4>
Date: Wed, 10 Feb 2010 20:23:41 +0000
Subject: [PATCH 2/7] Fix PR42914 and PR42530.

2010-02-10  Sebastian Pop  <seb@napoca>

	PR middle-end/42914
	PR middle-end/42530
	* graphite-sese-to-poly.c (remove_phi): New.
	(translate_scalar_reduction_to_array): Call remove_phi.

	* gcc.dg/graphite/pr42530.c: New.
	* gcc.dg/graphite/pr42914.c: New.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/graphite@156668 138bc75d-0d04-0410-961f-82ee72b054a4
---
 gcc/ChangeLog.graphite                  |   10 +++++++
 gcc/graphite-sese-to-poly.c             |   43 ++++++++++++++++++++++++++----
 gcc/testsuite/gcc.dg/graphite/pr42530.c |   18 +++++++++++++
 gcc/testsuite/gcc.dg/graphite/pr42914.c |   21 +++++++++++++++
 4 files changed, 86 insertions(+), 6 deletions(-)
 create mode 100644 gcc/testsuite/gcc.dg/graphite/pr42530.c
 create mode 100644 gcc/testsuite/gcc.dg/graphite/pr42914.c

diff --git a/gcc/ChangeLog.graphite b/gcc/ChangeLog.graphite
index 41f05b0..d7eb169 100644
--- a/gcc/ChangeLog.graphite
+++ b/gcc/ChangeLog.graphite
@@ -1,5 +1,15 @@
 2010-02-10  Sebastian Pop  <seb@napoca>
 
+	PR middle-end/42914
+	PR middle-end/42530
+	* graphite-sese-to-poly.c (remove_phi): New.
+	(translate_scalar_reduction_to_array): Call remove_phi.
+
+	* gcc.dg/graphite/pr42530.c: New.
+	* gcc.dg/graphite/pr42914.c: New.
+
+2010-02-10  Sebastian Pop  <seb@napoca>
+
 	PR middle-end/42771
 	* graphite-clast-to-gimple.c (gloog): Call rename_sese_parameters.
 	* graphite-clast-to-gimple.h (gloog): Update declaration.
diff --git a/gcc/graphite-sese-to-poly.c b/gcc/graphite-sese-to-poly.c
index 614232b..d4889b0 100644
--- a/gcc/graphite-sese-to-poly.c
+++ b/gcc/graphite-sese-to-poly.c
@@ -2719,6 +2719,41 @@ insert_copyin (tree red, gimple loop_phi)
   gsi_insert_seq_on_edge (edge_initial_value_for_loop_phi (loop_phi), stmts);
 }
 
+/* Removes the PHI node and resets all the debug stmts that are using
+   the PHI_RESULT.  */
+
+static void
+remove_phi (gimple phi)
+{
+  imm_use_iterator imm_iter;
+  tree def;
+  use_operand_p use_p;
+  gimple_stmt_iterator gsi;
+  VEC (gimple, heap) *update = VEC_alloc (gimple, heap, 3);
+  unsigned int i;
+  gimple stmt;
+
+  def = PHI_RESULT (phi);
+  FOR_EACH_IMM_USE_FAST (use_p, imm_iter, def)
+    {
+      stmt = USE_STMT (use_p);
+
+      if (is_gimple_debug (stmt))
+	{
+	  gimple_debug_bind_reset_value (stmt);
+	  VEC_safe_push (gimple, heap, update, stmt);
+	}
+    }
+
+  for (i = 0; VEC_iterate (gimple, update, i, stmt); i++)
+    update_stmt (stmt);
+
+  VEC_free (gimple, heap, update);
+
+  gsi = gsi_for_phi_node (phi);
+  remove_phi_node (&gsi, false);
+}
+
 /* Rewrite out of SSA the reduction described by the loop phi nodes
    IN, and the close phi nodes OUT.  IN and OUT are structured by loop
    levels like this:
@@ -2737,7 +2772,6 @@ translate_scalar_reduction_to_array (VEC (gimple, heap) *in,
   unsigned int i;
   gimple loop_phi;
   tree red;
-  gimple_stmt_iterator gsi;
 
   for (i = 0; VEC_iterate (gimple, in, i, loop_phi); i++)
     {
@@ -2764,11 +2798,8 @@ translate_scalar_reduction_to_array (VEC (gimple, heap) *in,
 	  insert_copyin (red, loop_phi);
 	}
 
-      gsi = gsi_for_phi_node (loop_phi);
-      remove_phi_node (&gsi, false);
-
-      gsi = gsi_for_phi_node (close_phi);
-      remove_phi_node (&gsi, false);
+      remove_phi (loop_phi);
+      remove_phi (close_phi);
     }
 }
 
diff --git a/gcc/testsuite/gcc.dg/graphite/pr42530.c b/gcc/testsuite/gcc.dg/graphite/pr42530.c
new file mode 100644
index 0000000..c0fa299
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/graphite/pr42530.c
@@ -0,0 +1,18 @@
+/* { dg-options "-O2 -g -ffast-math -floop-parallelize-all" } */
+
+int array[2][2];
+
+void foo(int *a)
+{
+  int i, j;
+  int sum, tmp = 0;
+
+  for (i=0; i<2; i++)
+    for (j=0; j<2; j++)
+      sum += array[i][j];
+
+  if (sum > 0) {
+    tmp = sum;
+    *a = tmp;
+  }
+}
diff --git a/gcc/testsuite/gcc.dg/graphite/pr42914.c b/gcc/testsuite/gcc.dg/graphite/pr42914.c
new file mode 100644
index 0000000..606ee08
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/graphite/pr42914.c
@@ -0,0 +1,21 @@
+/* { dg-options "-O2 -g -ffast-math -fgraphite-identity" } */
+
+int find_sad_16x16(int *mode)
+{
+  int current, best;
+  int M1[16][16],M0[4][4][4][4],M3[4],M4[4][4];
+  int i,j,k;
+  int ii,jj;
+
+  for (jj=0;jj<4;jj++)
+    for (ii=0;ii<4;ii++)
+      for (j=0;j<4;j++)
+	for (j=0;j<4;j++)
+	  current += abs(M0[i][ii][j][jj]);
+
+  if(current < best)
+    {
+      best = current;
+      *mode = k;
+    }
+}
-- 
1.6.3.3

From 0f60c4841baf8e00d33afea51c4c837e5a1844d5 Mon Sep 17 00:00:00 2001
From: spop <spop@138bc75d-0d04-0410-961f-82ee72b054a4>
Date: Thu, 11 Feb 2010 05:57:30 +0000
Subject: [PATCH 3/7] Fix PR42930.

2010-02-10  Sebastian Pop  <seb@napoca>

	PR middle-end/42930
	* graphite-scop-detection.c (graphite_can_represent_scev): Call
	graphite_can_represent_init for MULT_EXPR.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/graphite@156682 138bc75d-0d04-0410-961f-82ee72b054a4
---
 gcc/ChangeLog.graphite        |    6 ++++++
 gcc/graphite-scop-detection.c |    1 +
 2 files changed, 7 insertions(+), 0 deletions(-)

diff --git a/gcc/ChangeLog.graphite b/gcc/ChangeLog.graphite
index d7eb169..2ad0c52 100644
--- a/gcc/ChangeLog.graphite
+++ b/gcc/ChangeLog.graphite
@@ -1,5 +1,11 @@
 2010-02-10  Sebastian Pop  <seb@napoca>
 
+	PR middle-end/42930
+	* graphite-scop-detection.c (graphite_can_represent_scev): Call
+	graphite_can_represent_init for MULT_EXPR.
+
+2010-02-10  Sebastian Pop  <seb@napoca>
+
 	PR middle-end/42914
 	PR middle-end/42530
 	* graphite-sese-to-poly.c (remove_phi): New.
diff --git a/gcc/graphite-scop-detection.c b/gcc/graphite-scop-detection.c
index ddd1121..d89f0f8 100644
--- a/gcc/graphite-scop-detection.c
+++ b/gcc/graphite-scop-detection.c
@@ -225,6 +225,7 @@ graphite_can_represent_scev (tree scev, int outermost_loop)
 	&& !CONVERT_EXPR_CODE_P (TREE_CODE (TREE_OPERAND (scev, 1)))
 	&& !(chrec_contains_symbols (TREE_OPERAND (scev, 0))
 	     && chrec_contains_symbols (TREE_OPERAND (scev, 1)))
+	&& graphite_can_represent_init (scev)
 	&& graphite_can_represent_scev (TREE_OPERAND (scev, 0), outermost_loop)
 	&& graphite_can_represent_scev (TREE_OPERAND (scev, 1), outermost_loop);
 
-- 
1.6.3.3

From e2157522a9dc2fe4172e6ece2ddbb842629fa103 Mon Sep 17 00:00:00 2001
From: spop <spop@138bc75d-0d04-0410-961f-82ee72b054a4>
Date: Thu, 11 Feb 2010 05:58:27 +0000
Subject: [PATCH 4/7] Fix email address in ChangeLog.graphite.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/graphite@156683 138bc75d-0d04-0410-961f-82ee72b054a4
---
 gcc/ChangeLog.graphite |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/gcc/ChangeLog.graphite b/gcc/ChangeLog.graphite
index 2ad0c52..93e14fb 100644
--- a/gcc/ChangeLog.graphite
+++ b/gcc/ChangeLog.graphite
@@ -1,10 +1,10 @@
-2010-02-10  Sebastian Pop  <seb@napoca>
+2010-02-10  Sebastian Pop  <sebastian.pop@amd.com>
 
 	PR middle-end/42930
 	* graphite-scop-detection.c (graphite_can_represent_scev): Call
 	graphite_can_represent_init for MULT_EXPR.
 
-2010-02-10  Sebastian Pop  <seb@napoca>
+2010-02-10  Sebastian Pop  <sebastian.pop@amd.com>
 
 	PR middle-end/42914
 	PR middle-end/42530
@@ -14,7 +14,7 @@
 	* gcc.dg/graphite/pr42530.c: New.
 	* gcc.dg/graphite/pr42914.c: New.
 
-2010-02-10  Sebastian Pop  <seb@napoca>
+2010-02-10  Sebastian Pop  <sebastian.pop@amd.com>
 
 	PR middle-end/42771
 	* graphite-clast-to-gimple.c (gloog): Call rename_sese_parameters.
-- 
1.6.3.3

From 2400f649ae824dbc22519da3c8ef5c0f59fed522 Mon Sep 17 00:00:00 2001
From: spop <spop@138bc75d-0d04-0410-961f-82ee72b054a4>
Date: Thu, 11 Feb 2010 06:07:27 +0000
Subject: [PATCH 5/7] Add testcase for PR42930.

2010-02-10  Sebastian Pop  <sebastian.pop@amd.com>

	* g++.dg/graphite/pr42930.C: New.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/graphite@156684 138bc75d-0d04-0410-961f-82ee72b054a4
---
 gcc/ChangeLog.graphite                  |    8 ++++
 gcc/testsuite/g++.dg/graphite/pr42930.C |   55 +++++++++++++++++++++++++++++++
 2 files changed, 63 insertions(+), 0 deletions(-)
 create mode 100644 gcc/testsuite/g++.dg/graphite/pr42930.C

diff --git a/gcc/ChangeLog.graphite b/gcc/ChangeLog.graphite
index 93e14fb..b047c2b 100644
--- a/gcc/ChangeLog.graphite
+++ b/gcc/ChangeLog.graphite
@@ -1,5 +1,13 @@
 2010-02-10  Sebastian Pop  <sebastian.pop@amd.com>
 
+       * graphite.c (graphite_transform_loops): Re-enable dbg_cnt.
+
+2010-02-10  Sebastian Pop  <sebastian.pop@amd.com>
+
+	* g++.dg/graphite/pr42930.C: New.
+
+2010-02-10  Sebastian Pop  <sebastian.pop@amd.com>
+
 	PR middle-end/42930
 	* graphite-scop-detection.c (graphite_can_represent_scev): Call
 	graphite_can_represent_init for MULT_EXPR.
diff --git a/gcc/testsuite/g++.dg/graphite/pr42930.C b/gcc/testsuite/g++.dg/graphite/pr42930.C
new file mode 100644
index 0000000..c1150ce
--- /dev/null
+++ b/gcc/testsuite/g++.dg/graphite/pr42930.C
@@ -0,0 +1,55 @@
+/* { dg-options "-O1 -floop-block" } */
+
+typedef unsigned char byte;
+typedef unsigned int uint;
+typedef unsigned char uint8;
+namespace Common {
+class NonCopyable {
+};
+template<class In, class Out>
+Out copy(In first, In last, Out dst) {
+ while (first != last)
+  *dst++ = *first++;
+}
+template<class T>
+class Array {
+ uint _size;
+ T *_storage;
+public:
+ Array<T>& operator=(const Array<T> &array) {
+  copy(array._storage, array._storage + _size, _storage);
+ }
+};
+}
+namespace Graphics {
+struct PixelFormat {
+ inline PixelFormat() {
+ }
+ inline PixelFormat(byte BytesPerPixel,
+      byte RBits, byte GBits, byte BBits, byte ABits,
+      byte RShift, byte GShift, byte BShift, byte AShift) {
+ }
+};
+};
+namespace Cine {
+static const Graphics::PixelFormat kLowPalFormat(2, 3, 3, 3, 0, 8, 4, 0, 0);
+class Palette {
+public:
+ struct Color {
+  uint8 r, g, b;
+ };
+ Palette(const Graphics::PixelFormat format = Graphics::PixelFormat(), const uint numColors = 0);
+ bool empty() const;
+ bool isValid() const;
+ Common::Array<Color> _colors;
+};
+class FWRenderer : public Common::NonCopyable {
+ Cine::Palette _activePal;
+ void drawCommand();
+};
+void FWRenderer::drawCommand() {
+ if (!_activePal.isValid() || _activePal.empty()) {
+  _activePal = Cine::Palette(kLowPalFormat, 16);
+ }
+}
+}
-- 
1.6.3.3

From 2366746ce65480e722a8485d42cca40b14e1a5af Mon Sep 17 00:00:00 2001
From: spop <spop@138bc75d-0d04-0410-961f-82ee72b054a4>
Date: Thu, 11 Feb 2010 19:19:37 +0000
Subject: [PATCH 6/7] Add testcase for PR43012.

2010-02-11  Sebastian Pop  <sebastian.pop@amd.com>

	PR middle-end/43012
	* gcc.dg/graphite/pr43012.c: New.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/graphite@156708 138bc75d-0d04-0410-961f-82ee72b054a4
---
 gcc/ChangeLog.graphite                  |    8 +++-
 gcc/testsuite/gcc.dg/graphite/pr43012.c |   74 +++++++++++++++++++++++++++++++
 2 files changed, 80 insertions(+), 2 deletions(-)
 create mode 100644 gcc/testsuite/gcc.dg/graphite/pr43012.c

diff --git a/gcc/ChangeLog.graphite b/gcc/ChangeLog.graphite
index b047c2b..4bb6dc2 100644
--- a/gcc/ChangeLog.graphite
+++ b/gcc/ChangeLog.graphite
@@ -1,7 +1,11 @@
-2010-02-10  Sebastian Pop  <sebastian.pop@amd.com>
+2010-02-11  Sebastian Pop  <sebastian.pop@amd.com>
+
+	PR middle-end/43012
+	* gcc.dg/graphite/pr43012.c: New.
 
-       * graphite.c (graphite_transform_loops): Re-enable dbg_cnt.
+2010-02-10  Sebastian Pop  <sebastian.pop@amd.com>
 
+	* graphite.c (graphite_transform_loops): Re-enable dbg_cnt.
 2010-02-10  Sebastian Pop  <sebastian.pop@amd.com>
 
 	* g++.dg/graphite/pr42930.C: New.
diff --git a/gcc/testsuite/gcc.dg/graphite/pr43012.c b/gcc/testsuite/gcc.dg/graphite/pr43012.c
new file mode 100644
index 0000000..6d0f3b0
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/graphite/pr43012.c
@@ -0,0 +1,74 @@
+/* This testcase is from PR43012.
+   You will need CLooG-PPL 0.15.8 or later to have this testcase fixed.  */
+
+/* { dg-do run } */
+/* { dg-options "-O2 -floop-strip-mine" } */
+
+extern void abort (void);
+
+#ifdef DBG
+extern int printf (const char *, ...);
+#endif
+
+#define LAST_TOKEN 534
+#define FLOAT_FUNCT_TOKEN 64
+#define VECTOR_FUNCT_TOKEN 77
+#define COLOUR_KEY_TOKEN 89
+
+int Table[LAST_TOKEN];
+
+void
+pre_init_tokenizer ()
+{
+  int i;
+
+  for (i = 0; i < LAST_TOKEN; i++)
+    {
+      Table[i] = i;
+      if (i < FLOAT_FUNCT_TOKEN)
+	Table[i] = FLOAT_FUNCT_TOKEN;
+      else
+	{
+	  if (i < VECTOR_FUNCT_TOKEN)
+	    Table[i] = VECTOR_FUNCT_TOKEN;
+	  else
+	    {
+	      if (i < COLOUR_KEY_TOKEN)
+		Table[i] = COLOUR_KEY_TOKEN;
+	    }
+	}
+    }
+}
+
+void
+check ()
+{
+  int i;
+
+  for (i = 0; i < FLOAT_FUNCT_TOKEN; i++)
+    if (Table[i] != FLOAT_FUNCT_TOKEN)
+      abort ();
+  for (i = FLOAT_FUNCT_TOKEN; i < VECTOR_FUNCT_TOKEN; i++)
+    if (Table[i] != VECTOR_FUNCT_TOKEN)
+      abort ();
+  for (i = VECTOR_FUNCT_TOKEN; i < COLOUR_KEY_TOKEN; i++)
+    if (Table[i] != COLOUR_KEY_TOKEN)
+      abort ();
+  for (i = COLOUR_KEY_TOKEN; i < LAST_TOKEN; i++)
+    if (Table[i] != i)
+      abort ();
+}
+
+int
+main ()
+{
+  int i;
+
+  pre_init_tokenizer ();
+#ifdef DBG
+  for (i = 0; i < LAST_TOKEN; i++)
+    printf ("%3d: %d\n", i, Table[i]);
+#endif
+  check ();
+  return 0;
+}
-- 
1.6.3.3

From c626c841163d8dc8a5c74c703d34fee9460a2d69 Mon Sep 17 00:00:00 2001
From: Sebastian Pop <sebpop@gmail.com>
Date: Thu, 11 Feb 2010 13:37:12 -0600
Subject: [PATCH 7/7] Add ChangeLog entries.

---
 gcc/ChangeLog           |   30 ++++++++++++++++++++++++++++++
 gcc/testsuite/ChangeLog |   22 ++++++++++++++++++++++
 2 files changed, 52 insertions(+), 0 deletions(-)

diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index e95703f..049ca3f 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,33 @@
+2010-02-11  Sebastian Pop  <sebastian.pop@amd.com>
+
+	PR middle-end/42930
+	* graphite-scop-detection.c (graphite_can_represent_scev): Call
+	graphite_can_represent_init for MULT_EXPR.
+
+2010-02-11  Sebastian Pop  <sebastian.pop@amd.com>
+
+	PR middle-end/42914
+	PR middle-end/42530
+	* graphite-sese-to-poly.c (remove_phi): New.
+	(translate_scalar_reduction_to_array): Call remove_phi.
+
+2010-02-11  Sebastian Pop  <sebastian.pop@amd.com>
+
+	PR middle-end/42771
+	* graphite-clast-to-gimple.c (gloog): Call rename_sese_parameters.
+	* graphite-clast-to-gimple.h (gloog): Update declaration.
+	* graphite-poly.c (new_scop): Clear POLY_SCOP_P.
+	* graphite-poly.h (struct poly_bb): Add missing comments.
+	(struct scop): Add poly_scop_p field.
+	(POLY_SCOP_P): New.
+	* graphite-sese-to-poly.c (build_poly_scop): Set POLY_SCOP_P.
+	* graphite.c (graphite_transform_loops): Build the polyhedral
+	representation for each scop before code generation.
+	* sese.c (rename_variables_in_operand): Removed.
+	(rename_variables_in_expr): Return the renamed expression.
+	(rename_sese_parameters): New.
+	* sese.h (rename_sese_parameters): Declared.
+
 2010-02-11  Richard Guenther  <rguenther@suse.de>
 
 	PR tree-optimization/42998
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index 718b97d..9aaa67e 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,3 +1,25 @@
+2010-02-11  Sebastian Pop  <sebastian.pop@amd.com>
+
+	PR middle-end/43012
+	* gcc.dg/graphite/pr43012.c: New.
+
+2010-02-11  Sebastian Pop  <sebastian.pop@amd.com>
+
+	PR middle-end/42930
+	* g++.dg/graphite/pr42930.C: New.
+
+2010-02-11  Sebastian Pop  <sebastian.pop@amd.com>
+
+	PR middle-end/42914
+	PR middle-end/42530
+	* gcc.dg/graphite/pr42530.c: New.
+	* gcc.dg/graphite/pr42914.c: New.
+
+2010-02-11  Sebastian Pop  <sebastian.pop@amd.com>
+
+	PR middle-end/42771
+	* gcc.dg/graphite/pr42771.c: New.
+
 2010-02-11  Richard Guenther  <rguenther@suse.de>
 
 	PR tree-optimization/42998
-- 
1.6.3.3


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