public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* Re: [patch] Merge to trunk from Graphite branch
@ 2010-03-15 22:12 Dominique Dhumieres
  2010-03-16 13:32 ` Ira Rosen
  0 siblings, 1 reply; 42+ messages in thread
From: Dominique Dhumieres @ 2010-03-15 22:12 UTC (permalink / raw)
  To: gcc-patches; +Cc: IRAR, howarth, richard.guenther, sebpop

The missed vectorization seems related to the loop index being unknown:
if I replace 'do i = 1, n' with 'do i = 1, nl' with nl set to
some given value (say 100) the loop vectorize with -fgraphite-identity.

Dominique

^ permalink raw reply	[flat|nested] 42+ messages in thread
* Re: [patch] Merge to trunk from Graphite branch
@ 2010-03-15 20:14 Dominique Dhumieres
  0 siblings, 0 replies; 42+ messages in thread
From: Dominique Dhumieres @ 2010-03-15 20:14 UTC (permalink / raw)
  To: gcc-patches; +Cc: IRAR, howarth, richard.guenther, sebpop

> The patch from Ira would not apply: here is an updated patch,
> that anyways would execute conditionally based on running
> the graphite pass.

The patch does not fix the missed vectorization with -fgraphite-identity.

Even if this problem is not release critical it should be P1 on the graphite
agenda: there is no point to fine tune loops if it breaks the vectorization.
On x86 the potential speed-up of vectorization is 4 for floats and 2 for 
doubles.

Dominique

^ permalink raw reply	[flat|nested] 42+ messages in thread
* [patch] Merge to trunk from Graphite branch
@ 2010-03-13 18:15 Sebastian Pop
  2010-03-13 18:29 ` Toon Moene
  0 siblings, 1 reply; 42+ messages in thread
From: Sebastian Pop @ 2010-03-13 18:15 UTC (permalink / raw)
  To: GCC Patches

[-- Attachment #1: Type: text/plain, Size: 182 bytes --]

Hi,

I just merged the Graphite branch back to trunk.  This solved
PR43349 for which I just added the testcase, as I already have
taken care of it in the Graphite branch.

Sebastian

[-- Attachment #2: 0001-Limit-the-number-of-parameters-per-SCoP.patch --]
[-- Type: text/x-diff, Size: 3282 bytes --]

From c2e502a56a95d14a87d60f288c1aa8612fea911c Mon Sep 17 00:00:00 2001
From: spop <spop@138bc75d-0d04-0410-961f-82ee72b054a4>
Date: Sat, 13 Mar 2010 17:34:38 +0000
Subject: [PATCH 01/11] Limit the number of parameters per SCoP.

2010-03-09  Sebastian Pop  <sebastian.pop@amd.com>

	* graphite-sese-to-poly.c (build_poly_scop): Limit scops following
	the number of parameters in the scop.  Use as an upper bound
	PARAM_GRAPHITE_MAX_NB_SCOP_PARAMS.
	* params.def (PARAM_GRAPHITE_MAX_NB_SCOP_PARAMS): Declared.
	* doc/invoke.texi: Document it.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@157431 138bc75d-0d04-0410-961f-82ee72b054a4
---
 gcc/ChangeLog.graphite      |    8 ++++++++
 gcc/doc/invoke.texi         |    4 ++++
 gcc/graphite-sese-to-poly.c |    5 +++++
 gcc/params.def              |    7 +++++++
 4 files changed, 24 insertions(+), 0 deletions(-)

diff --git a/gcc/ChangeLog.graphite b/gcc/ChangeLog.graphite
index 9dcdcda..61b463b 100644
--- a/gcc/ChangeLog.graphite
+++ b/gcc/ChangeLog.graphite
@@ -1,3 +1,11 @@
+2010-03-09  Sebastian Pop  <sebastian.pop@amd.com>
+
+	* graphite-sese-to-poly.c (build_poly_scop): Limit scops following
+	the number of parameters in the scop.  Use as an upper bound
+	PARAM_GRAPHITE_MAX_NB_SCOP_PARAMS.
+	* params.def (PARAM_GRAPHITE_MAX_NB_SCOP_PARAMS): Declared.
+	* doc/invoke.texi: Document it.
+
 2010-03-05  Sebastian Pop  <sebastian.pop@amd.com>
 
 	* graphite-sese-to-poly.c (add_param_constraints): Use
diff --git a/gcc/doc/invoke.texi b/gcc/doc/invoke.texi
index 060be88..2159701 100644
--- a/gcc/doc/invoke.texi
+++ b/gcc/doc/invoke.texi
@@ -8492,6 +8492,10 @@ parameters only when their cumulative size is less or equal to
 @option{ipa-sra-ptr-growth-factor} times the size of the original
 pointer parameter.
 
+@item graphite-max-nb-scop-params
+To avoid exponential effects in the Graphite loop transforms, the
+number of parameters in a SCoP is bounded by 10.
+
 @end table
 @end table
 
diff --git a/gcc/graphite-sese-to-poly.c b/gcc/graphite-sese-to-poly.c
index 11bddf8..ae4a083 100644
--- a/gcc/graphite-sese-to-poly.c
+++ b/gcc/graphite-sese-to-poly.c
@@ -2937,6 +2937,7 @@ build_poly_scop (scop_p scop)
 {
   sese region = SCOP_REGION (scop);
   sbitmap reductions = sbitmap_alloc (last_basic_block * 2);
+  graphite_dim_t max_dim;
 
   sbitmap_zero (reductions);
   rewrite_commutative_reductions_out_of_ssa (region, reductions);
@@ -2960,6 +2961,10 @@ build_poly_scop (scop_p scop)
   build_sese_conditions (region);
   find_scop_parameters (scop);
 
+  max_dim = PARAM_VALUE (PARAM_GRAPHITE_MAX_NB_SCOP_PARAMS);
+  if (scop_nb_params (scop) > max_dim)
+    return false;
+
   build_scop_iteration_domain (scop);
   build_scop_context (scop);
 
diff --git a/gcc/params.def b/gcc/params.def
index 07bfb90..f6f549c 100644
--- a/gcc/params.def
+++ b/gcc/params.def
@@ -745,6 +745,13 @@ DEFPARAM (PARAM_LOOP_BLOCK_TILE_SIZE,
 	  "size of tiles for loop blocking",
 	  51, 0, 0)
 
+/* Maximal number of parameters that we allow in a SCoP.  */
+
+DEFPARAM (PARAM_GRAPHITE_MAX_NB_SCOP_PARAMS,
+	  "graphite-max-nb-scop-params",
+	  "maximal number of parameters in a SCoP",
+	  10, 0, 0)
+
 /* Avoid doing loop invariant motion on very large loops.  */
 
 DEFPARAM (PARAM_LOOP_INVARIANT_MAX_BBS_IN_LOOP,
-- 
1.6.3.3


[-- Attachment #3: 0002-Make-build_poly_scop-not-return-a-bool.patch --]
[-- Type: text/x-diff, Size: 3021 bytes --]

From f49215cea754cbd1f73143110bbc832c05fd597f Mon Sep 17 00:00:00 2001
From: spop <spop@138bc75d-0d04-0410-961f-82ee72b054a4>
Date: Sat, 13 Mar 2010 17:34:44 +0000
Subject: [PATCH 02/11] Make build_poly_scop not return a bool.

2010-03-09  Sebastian Pop  <sebastian.pop@amd.com>

	* graphite-sese-to-poly.c (build_poly_scop): Do not return bool.
	* graphite-sese-to-poly.h (build_poly_scop): Same.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@157432 138bc75d-0d04-0410-961f-82ee72b054a4
---
 gcc/ChangeLog.graphite      |    5 +++++
 gcc/graphite-sese-to-poly.c |   14 +++++++-------
 gcc/graphite-sese-to-poly.h |    2 +-
 3 files changed, 13 insertions(+), 8 deletions(-)

diff --git a/gcc/ChangeLog.graphite b/gcc/ChangeLog.graphite
index 61b463b..2aa6fd5 100644
--- a/gcc/ChangeLog.graphite
+++ b/gcc/ChangeLog.graphite
@@ -1,5 +1,10 @@
 2010-03-09  Sebastian Pop  <sebastian.pop@amd.com>
 
+	* graphite-sese-to-poly.c (build_poly_scop): Do not return bool.
+	* graphite-sese-to-poly.h (build_poly_scop): Same.
+
+2010-03-09  Sebastian Pop  <sebastian.pop@amd.com>
+
 	* graphite-sese-to-poly.c (build_poly_scop): Limit scops following
 	the number of parameters in the scop.  Use as an upper bound
 	PARAM_GRAPHITE_MAX_NB_SCOP_PARAMS.
diff --git a/gcc/graphite-sese-to-poly.c b/gcc/graphite-sese-to-poly.c
index ae4a083..75be56d 100644
--- a/gcc/graphite-sese-to-poly.c
+++ b/gcc/graphite-sese-to-poly.c
@@ -2932,7 +2932,7 @@ scop_ivs_can_be_represented (scop_p scop)
 
 /* Builds the polyhedral representation for a SESE region.  */
 
-bool
+void
 build_poly_scop (scop_p scop)
 {
   sese region = SCOP_REGION (scop);
@@ -2950,12 +2950,11 @@ build_poly_scop (scop_p scop)
      sense to optimize a scop containing only PBBs that do not belong
      to any loops.  */
   if (nb_pbbs_in_loops (scop) == 0)
-    return false;
+    return;
 
   scop_canonicalize_loops (scop);
-
   if (!scop_ivs_can_be_represented (scop))
-    return false;
+    return;
 
   build_sese_loop_nests (region);
   build_sese_conditions (region);
@@ -2963,7 +2962,7 @@ build_poly_scop (scop_p scop)
 
   max_dim = PARAM_VALUE (PARAM_GRAPHITE_MAX_NB_SCOP_PARAMS);
   if (scop_nb_params (scop) > max_dim)
-    return false;
+    return;
 
   build_scop_iteration_domain (scop);
   build_scop_context (scop);
@@ -2972,9 +2971,10 @@ 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;
+  /* This SCoP has been translated to the polyhedral
+     representation.  */
+  POLY_SCOP_P (scop) = true;
 }
 
 /* Always return false.  Exercise the scop_to_clast function.  */
diff --git a/gcc/graphite-sese-to-poly.h b/gcc/graphite-sese-to-poly.h
index 0737c49..3213471 100644
--- a/gcc/graphite-sese-to-poly.h
+++ b/gcc/graphite-sese-to-poly.h
@@ -28,7 +28,7 @@ struct base_alias_pair
   int *alias_set;
 };
 
-bool build_poly_scop (scop_p);
+void build_poly_scop (scop_p);
 void check_poly_representation (scop_p);
 
 #endif
-- 
1.6.3.3


[-- Attachment #4: 0003-Add-PARAM_GRAPHITE_MAX_BBS_PER_FUNCTION.patch --]
[-- Type: text/x-diff, Size: 3097 bytes --]

From 94ba21de76678316108cb184d517133a66622525 Mon Sep 17 00:00:00 2001
From: spop <spop@138bc75d-0d04-0410-961f-82ee72b054a4>
Date: Sat, 13 Mar 2010 17:34:51 +0000
Subject: [PATCH 03/11] Add PARAM_GRAPHITE_MAX_BBS_PER_FUNCTION.

2010-03-09  Sebastian Pop  <sebastian.pop@amd.com>

	* graphite.c (graphite_initialize): To bound the number of bbs per
	function, use PARAM_GRAPHITE_MAX_BBS_PER_FUNCTION.
	* params.def (PARAM_GRAPHITE_MAX_BBS_PER_FUNCTION): Declared.
	* doc/invoke.texi: Document it.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@157433 138bc75d-0d04-0410-961f-82ee72b054a4
---
 gcc/ChangeLog.graphite |    7 +++++++
 gcc/doc/invoke.texi    |    5 +++++
 gcc/graphite.c         |    2 +-
 gcc/params.def         |    7 +++++++
 4 files changed, 20 insertions(+), 1 deletions(-)

diff --git a/gcc/ChangeLog.graphite b/gcc/ChangeLog.graphite
index 2aa6fd5..3a94ee1 100644
--- a/gcc/ChangeLog.graphite
+++ b/gcc/ChangeLog.graphite
@@ -1,5 +1,12 @@
 2010-03-09  Sebastian Pop  <sebastian.pop@amd.com>
 
+	* graphite.c (graphite_initialize): To bound the number of bbs per
+	function, use PARAM_GRAPHITE_MAX_BBS_PER_FUNCTION.
+	* params.def (PARAM_GRAPHITE_MAX_BBS_PER_FUNCTION): Declared.
+	* doc/invoke.texi: Document it.
+
+2010-03-09  Sebastian Pop  <sebastian.pop@amd.com>
+
 	* graphite-sese-to-poly.c (build_poly_scop): Do not return bool.
 	* graphite-sese-to-poly.h (build_poly_scop): Same.
 
diff --git a/gcc/doc/invoke.texi b/gcc/doc/invoke.texi
index 2159701..b856ca2 100644
--- a/gcc/doc/invoke.texi
+++ b/gcc/doc/invoke.texi
@@ -8496,6 +8496,11 @@ pointer parameter.
 To avoid exponential effects in the Graphite loop transforms, the
 number of parameters in a SCoP is bounded by 10.
 
+@item graphite-max-bbs-per-function
+To avoid exponential effects in the detection of SCoPs, the functions
+with more than 100 basic blocks are not handled by the Graphite loop
+transforms.
+
 @end table
 @end table
 
diff --git a/gcc/graphite.c b/gcc/graphite.c
index ba05cc7..a244b87 100644
--- a/gcc/graphite.c
+++ b/gcc/graphite.c
@@ -202,7 +202,7 @@ graphite_initialize (void)
   if (number_of_loops () <= 1
       /* FIXME: This limit on the number of basic blocks of a function
 	 should be removed when the SCOP detection is faster.  */
-      || n_basic_blocks > 100)
+      || n_basic_blocks > PARAM_VALUE (PARAM_GRAPHITE_MAX_BBS_PER_FUNCTION))
     {
       if (dump_file && (dump_flags & TDF_DETAILS))
 	print_global_statistics (dump_file);
diff --git a/gcc/params.def b/gcc/params.def
index f6f549c..dca575d 100644
--- a/gcc/params.def
+++ b/gcc/params.def
@@ -752,6 +752,13 @@ DEFPARAM (PARAM_GRAPHITE_MAX_NB_SCOP_PARAMS,
 	  "maximal number of parameters in a SCoP",
 	  10, 0, 0)
 
+/* Maximal number of basic blocks in the functions analyzed by Graphite.  */
+
+DEFPARAM (PARAM_GRAPHITE_MAX_BBS_PER_FUNCTION,
+	  "graphite-max-bbs-per-function",
+	  "maximal number of basic blocks per function to be analyzed by Graphite",
+	  100, 0, 0)
+
 /* Avoid doing loop invariant motion on very large loops.  */
 
 DEFPARAM (PARAM_LOOP_INVARIANT_MAX_BBS_IN_LOOP,
-- 
1.6.3.3


[-- Attachment #5: 0004-Fix-PR43306-correct-evolution_function_right_is_inte.patch --]
[-- Type: text/x-diff, Size: 2772 bytes --]

From c4ccbe87dae599b81683031c8b48e9f2459f668c Mon Sep 17 00:00:00 2001
From: spop <spop@138bc75d-0d04-0410-961f-82ee72b054a4>
Date: Sat, 13 Mar 2010 17:34:59 +0000
Subject: [PATCH 04/11] Fix PR43306: correct evolution_function_right_is_integer_cst.

2010-03-09  Sebastian Pop  <sebastian.pop@amd.com>

	PR middle-end/43306
	* tree-chrec.c (evolution_function_right_is_integer_cst): CHREC_RIGHT
	should be an INTEGER_CST.  Also handle CASE_CONVERT.
	* gcc.dg/graphite/pr43306.c: New.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@157434 138bc75d-0d04-0410-961f-82ee72b054a4
---
 gcc/ChangeLog.graphite                  |    7 +++++++
 gcc/testsuite/gcc.dg/graphite/pr43306.c |    9 +++++++++
 gcc/tree-chrec.c                        |   12 +++++-------
 3 files changed, 21 insertions(+), 7 deletions(-)
 create mode 100644 gcc/testsuite/gcc.dg/graphite/pr43306.c

diff --git a/gcc/ChangeLog.graphite b/gcc/ChangeLog.graphite
index 3a94ee1..837e4bc 100644
--- a/gcc/ChangeLog.graphite
+++ b/gcc/ChangeLog.graphite
@@ -1,5 +1,12 @@
 2010-03-09  Sebastian Pop  <sebastian.pop@amd.com>
 
+	PR middle-end/43306
+	* tree-chrec.c (evolution_function_right_is_integer_cst): CHREC_RIGHT
+	should be an INTEGER_CST.  Also handle CASE_CONVERT.
+	* gcc.dg/graphite/pr43306.c: New.
+
+2010-03-09  Sebastian Pop  <sebastian.pop@amd.com>
+
 	* graphite.c (graphite_initialize): To bound the number of bbs per
 	function, use PARAM_GRAPHITE_MAX_BBS_PER_FUNCTION.
 	* params.def (PARAM_GRAPHITE_MAX_BBS_PER_FUNCTION): Declared.
diff --git a/gcc/testsuite/gcc.dg/graphite/pr43306.c b/gcc/testsuite/gcc.dg/graphite/pr43306.c
new file mode 100644
index 0000000..43195e4
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/graphite/pr43306.c
@@ -0,0 +1,9 @@
+/* { dg-options "-O1 -fstrict-overflow -fgraphite-identity" } */
+
+void foo(int x[])
+{
+  int i, j;
+  for (i = 0; i < 2; i++)
+    for (j = 0; j < 2; j++)
+      x[i] = x[i*j];
+}
diff --git a/gcc/tree-chrec.c b/gcc/tree-chrec.c
index c945f93..929bbc0 100644
--- a/gcc/tree-chrec.c
+++ b/gcc/tree-chrec.c
@@ -1529,14 +1529,12 @@ evolution_function_right_is_integer_cst (const_tree chrec)
       return true;
 
     case POLYNOMIAL_CHREC:
-      if (!evolution_function_right_is_integer_cst (CHREC_RIGHT (chrec)))
-	return false;
-
-      if (TREE_CODE (CHREC_LEFT (chrec)) == POLYNOMIAL_CHREC
-	&& !evolution_function_right_is_integer_cst (CHREC_LEFT (chrec)))
-	return false;
+      return TREE_CODE (CHREC_RIGHT (chrec)) == INTEGER_CST
+	&& (TREE_CODE (CHREC_LEFT (chrec)) != POLYNOMIAL_CHREC
+	    || evolution_function_right_is_integer_cst (CHREC_LEFT (chrec)));
 
-      return true;
+    CASE_CONVERT:
+      return evolution_function_right_is_integer_cst (TREE_OPERAND (chrec, 0));
 
     default:
       return false;
-- 
1.6.3.3


[-- Attachment #6: 0005-Document-PARAM_LOOP_BLOCK_TILE_SIZE.patch --]
[-- Type: text/x-diff, Size: 3276 bytes --]

From 89466e4339eb2a921006c0284a4da2dd7bf12c39 Mon Sep 17 00:00:00 2001
From: spop <spop@138bc75d-0d04-0410-961f-82ee72b054a4>
Date: Sat, 13 Mar 2010 17:35:08 +0000
Subject: [PATCH 05/11] Document PARAM_LOOP_BLOCK_TILE_SIZE.

2010-03-09  Sebastian Pop  <sebastian.pop@amd.com>

	* doc/invoke.texi (PARAM_LOOP_BLOCK_TILE_SIZE): Document.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@157435 138bc75d-0d04-0410-961f-82ee72b054a4
---
 gcc/ChangeLog.graphite |    4 ++++
 gcc/doc/invoke.texi    |   25 +++++++++++++++++--------
 2 files changed, 21 insertions(+), 8 deletions(-)

diff --git a/gcc/ChangeLog.graphite b/gcc/ChangeLog.graphite
index 837e4bc..3a49ccc 100644
--- a/gcc/ChangeLog.graphite
+++ b/gcc/ChangeLog.graphite
@@ -1,5 +1,9 @@
 2010-03-09  Sebastian Pop  <sebastian.pop@amd.com>
 
+	* doc/invoke.texi (PARAM_LOOP_BLOCK_TILE_SIZE): Document.
+
+2010-03-09  Sebastian Pop  <sebastian.pop@amd.com>
+
 	PR middle-end/43306
 	* tree-chrec.c (evolution_function_right_is_integer_cst): CHREC_RIGHT
 	should be an INTEGER_CST.  Also handle CASE_CONVERT.
diff --git a/gcc/doc/invoke.texi b/gcc/doc/invoke.texi
index b856ca2..8648405 100644
--- a/gcc/doc/invoke.texi
+++ b/gcc/doc/invoke.texi
@@ -6675,7 +6675,9 @@ Graphite loop transformation infrastructure.
 Perform loop strip mining transformations on loops.  Strip mining
 splits a loop into two nested loops.  The outer loop has strides
 equal to the strip size and the inner loop has strides of the
-original loop within a strip.  For example, given a loop like:
+original loop within a strip.  The strip length can be changed
+using the @option{loop-block-tile-size} parameter.  For example,
+given a loop like:
 @smallexample
 DO I = 1, N
   A(I) = A(I) + C
@@ -6683,8 +6685,8 @@ ENDDO
 @end smallexample
 loop strip mining will transform the loop as if the user had written:
 @smallexample
-DO II = 1, N, 4
-  DO I = II, min (II + 3, N)
+DO II = 1, N, 51
+  DO I = II, min (II + 50, N)
     A(I) = A(I) + C
   ENDDO
 ENDDO
@@ -6697,7 +6699,9 @@ enable the Graphite loop transformation infrastructure.
 @item -floop-block
 Perform loop blocking transformations on loops.  Blocking strip mines
 each loop in the loop nest such that the memory accesses of the
-element loops fit inside caches.  For example, given a loop like:
+element loops fit inside caches.  The strip length can be changed
+using the @option{loop-block-tile-size} parameter.  For example, given
+a loop like:
 @smallexample
 DO I = 1, N
   DO J = 1, M
@@ -6707,10 +6711,10 @@ ENDDO
 @end smallexample
 loop blocking will transform the loop as if the user had written:
 @smallexample
-DO II = 1, N, 64
-  DO JJ = 1, M, 64
-    DO I = II, min (II + 63, N)
-      DO J = JJ, min (JJ + 63, M)
+DO II = 1, N, 51
+  DO JJ = 1, M, 51
+    DO I = II, min (II + 50, N)
+      DO J = JJ, min (JJ + 50, M)
         A(J, I) = B(I) + C(J)
       ENDDO
     ENDDO
@@ -8501,6 +8505,11 @@ To avoid exponential effects in the detection of SCoPs, the functions
 with more than 100 basic blocks are not handled by the Graphite loop
 transforms.
 
+@item loop-block-tile-size
+The default factor for the loop blocking or strip mining transforms,
+enabled with @option{-floop-block} or @option{-floop-strip-mine}, is
+51.
+
 @end table
 @end table
 
-- 
1.6.3.3


[-- Attachment #7: 0006-Cleanup-remove-FIXMEs-add-new-function.patch --]
[-- Type: text/x-diff, Size: 7456 bytes --]

From 5d92ac748a1816c48ce2cc86623ab0e70a3512b5 Mon Sep 17 00:00:00 2001
From: spop <spop@138bc75d-0d04-0410-961f-82ee72b054a4>
Date: Sat, 13 Mar 2010 17:35:15 +0000
Subject: [PATCH 06/11] Cleanup: remove FIXMEs, add new function.

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

	* graphite-clast-to-gimple.c (gcc_type_for_iv_of_clast_loop): Remove
	forward declaration.
	* graphite-sese-to-poly.c (reduction_phi_p): Remove FIXME comment.
	(add_upper_bounds_from_estimated_nit): New.
	(build_loop_iteration_domains): Use it.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@157436 138bc75d-0d04-0410-961f-82ee72b054a4
---
 gcc/ChangeLog.graphite         |    8 +++
 gcc/graphite-clast-to-gimple.c |    3 -
 gcc/graphite-sese-to-poly.c    |  128 ++++++++++++++++++++++------------------
 3 files changed, 78 insertions(+), 61 deletions(-)

diff --git a/gcc/ChangeLog.graphite b/gcc/ChangeLog.graphite
index 3a49ccc..0ca526c 100644
--- a/gcc/ChangeLog.graphite
+++ b/gcc/ChangeLog.graphite
@@ -1,3 +1,11 @@
+2010-03-10  Sebastian Pop  <sebastian.pop@amd.com>
+
+	* graphite-clast-to-gimple.c (gcc_type_for_iv_of_clast_loop): Remove
+	forward declaration.
+	* graphite-sese-to-poly.c (reduction_phi_p): Remove FIXME comment.
+	(add_upper_bounds_from_estimated_nit): New.
+	(build_loop_iteration_domains): Use it.
+
 2010-03-09  Sebastian Pop  <sebastian.pop@amd.com>
 
 	* doc/invoke.texi (PARAM_LOOP_BLOCK_TILE_SIZE): Document.
diff --git a/gcc/graphite-clast-to-gimple.c b/gcc/graphite-clast-to-gimple.c
index 64ddbb8..377ca8b 100644
--- a/gcc/graphite-clast-to-gimple.c
+++ b/gcc/graphite-clast-to-gimple.c
@@ -823,9 +823,6 @@ translate_clast_user (sese region, struct clast_user_stmt *stmt, edge next_e,
   return next_e;
 }
 
-static tree gcc_type_for_iv_of_clast_loop (struct clast_for *);
-
-
 /* Creates a new if region protecting the loop to be executed, if the execution
    count is zero (lb > ub).  */
 static edge
diff --git a/gcc/graphite-sese-to-poly.c b/gcc/graphite-sese-to-poly.c
index 75be56d..28ed07c 100644
--- a/gcc/graphite-sese-to-poly.c
+++ b/gcc/graphite-sese-to-poly.c
@@ -180,7 +180,7 @@ reduction_phi_p (sese region, gimple_stmt_iterator *psi)
 
   if (simple_copy_phi_p (phi))
     {
-      /* FIXME: PRE introduces phi nodes like these, for an example,
+      /* PRE introduces phi nodes like these, for an example,
 	 see id-5.f in the fortran graphite testsuite:
 
 	 # prephitmp.85_265 = PHI <prephitmp.85_258(33), prephitmp.85_265(18)>
@@ -1038,6 +1038,74 @@ gbb_from_bb (basic_block bb)
   return (gimple_bb_p) bb->aux;
 }
 
+/* Insert in the SCOP context constraints from the estimation of the
+   number of iterations.  UB_EXPR is a linear expression describing
+   the number of iterations in a loop.  This expression is bounded by
+   the estimation NIT.  */
+
+static void
+add_upper_bounds_from_estimated_nit (scop_p scop, double_int nit,
+				     ppl_dimension_type dim,
+				     ppl_Linear_Expression_t ub_expr)
+{
+  Value val;
+  ppl_Linear_Expression_t nb_iters_le;
+  ppl_Polyhedron_t pol;
+  ppl_Coefficient_t coef;
+  ppl_Constraint_t ub;
+
+  ppl_new_Linear_Expression_with_dimension (&ub_expr, dim);
+  ppl_new_C_Polyhedron_from_space_dimension (&pol, dim, 0);
+  ppl_new_Linear_Expression_from_Linear_Expression (&nb_iters_le,
+						    ub_expr);
+
+  /* Construct the negated number of last iteration in VAL.  */
+  value_init (val);
+  mpz_set_double_int (val, nit, false);
+  value_sub_int (val, val, 1);
+  value_oppose (val, val);
+
+  /* NB_ITERS_LE holds the number of last iteration in
+     parametrical form.  Subtract estimated number of last
+     iteration and assert that result is not positive.  */
+  ppl_new_Coefficient_from_mpz_t (&coef, val);
+  ppl_Linear_Expression_add_to_inhomogeneous (nb_iters_le, coef);
+  ppl_delete_Coefficient (coef);
+  ppl_new_Constraint (&ub, nb_iters_le,
+		      PPL_CONSTRAINT_TYPE_LESS_OR_EQUAL);
+  ppl_Polyhedron_add_constraint (pol, ub);
+
+  /* Remove all but last GDIM dimensions from POL to obtain
+     only the constraints on the parameters.  */
+  {
+    graphite_dim_t gdim = scop_nb_params (scop);
+    ppl_dimension_type *dims = XNEWVEC (ppl_dimension_type, dim - gdim);
+    graphite_dim_t i;
+
+    for (i = 0; i < dim - gdim; i++)
+      dims[i] = i;
+
+    ppl_Polyhedron_remove_space_dimensions (pol, dims, dim - gdim);
+    XDELETEVEC (dims);
+  }
+
+  /* Add the constraints on the parameters to the SCoP context.  */
+  {
+    ppl_Pointset_Powerset_C_Polyhedron_t constraints_ps;
+
+    ppl_new_Pointset_Powerset_C_Polyhedron_from_C_Polyhedron
+      (&constraints_ps, pol);
+    ppl_Pointset_Powerset_C_Polyhedron_intersection_assign
+      (SCOP_CONTEXT (scop), constraints_ps);
+    ppl_delete_Pointset_Powerset_C_Polyhedron (constraints_ps);
+  }
+
+  ppl_delete_Polyhedron (pol);
+  ppl_delete_Linear_Expression (nb_iters_le);
+  ppl_delete_Constraint (ub);
+  value_clear (val);
+}
+
 /* Builds the constraint polyhedra for LOOP in SCOP.  OUTER_PH gives
    the constraints for the surrounding loops.  */
 
@@ -1113,64 +1181,8 @@ build_loop_iteration_domains (scop_p scop, struct loop *loop,
       scan_tree_for_params (SCOP_REGION (scop), nb_iters, ub_expr, one);
       value_clear (one);
 
-      /* N <= estimated_nb_iters
-
-	 FIXME: This is a workaround that should go away once we will
-	 have the PIP algorithm.  */
       if (estimated_loop_iterations (loop, true, &nit))
-	{
-	  Value val;
-	  ppl_Linear_Expression_t nb_iters_le;
-	  ppl_Polyhedron_t pol;
-	  graphite_dim_t n = scop_nb_params (scop);
-	  ppl_Coefficient_t coef;
-
-	  ppl_new_C_Polyhedron_from_space_dimension (&pol, dim, 0);
-	  ppl_new_Linear_Expression_from_Linear_Expression (&nb_iters_le,
-							    ub_expr);
-
-	  /* Construct the negated number of last iteration in VAL.  */
-	  value_init (val);
-	  mpz_set_double_int (val, nit, false);
-	  value_sub_int (val, val, 1);
-	  value_oppose (val, val);
-
-	  /* NB_ITERS_LE holds number of last iteration in parametrical form.
-	  Subtract estimated number of last iteration and assert that result
-	  is not positive.  */
-	  ppl_new_Coefficient_from_mpz_t (&coef, val);
-	  ppl_Linear_Expression_add_to_inhomogeneous (nb_iters_le, coef);
-	  ppl_delete_Coefficient (coef);
-	  ppl_new_Constraint (&ub, nb_iters_le,
-			      PPL_CONSTRAINT_TYPE_LESS_OR_EQUAL);
-	  ppl_Polyhedron_add_constraint (pol, ub);
-
-	  /* Remove all but last N dimensions from POL to obtain constraints
-	     on parameters.  */
-	    {
-	      ppl_dimension_type *dims = XNEWVEC (ppl_dimension_type, dim - n);
-	      graphite_dim_t i;
-	      for (i = 0; i < dim - n; i++)
-		dims[i] = i;
-	      ppl_Polyhedron_remove_space_dimensions (pol, dims, dim - n);
-	      XDELETEVEC (dims);
-	    }
-
-	  /* Add constraints on parameters to SCoP context.  */
-	    {
-	      ppl_Pointset_Powerset_C_Polyhedron_t constraints_ps;
-	      ppl_new_Pointset_Powerset_C_Polyhedron_from_C_Polyhedron
-	       (&constraints_ps, pol);
-	      ppl_Pointset_Powerset_C_Polyhedron_intersection_assign
-	       (SCOP_CONTEXT (scop), constraints_ps);
-	      ppl_delete_Pointset_Powerset_C_Polyhedron (constraints_ps);
-	    }
-
-	  ppl_delete_Polyhedron (pol);
-	  ppl_delete_Linear_Expression (nb_iters_le);
-	  ppl_delete_Constraint (ub);
-	  value_clear (val);
-	}
+	add_upper_bounds_from_estimated_nit (scop, nit, dim, ub_expr);
 
       /* loop_i <= expr_nb_iters */
       ppl_set_coef (ub_expr, nb, -1);
-- 
1.6.3.3


[-- Attachment #8: 0007-Fix-documentation-of-the-new-parameters.patch --]
[-- Type: text/x-diff, Size: 3704 bytes --]

From 578e34563f159ce091cda0b8f3fd8a2da30c297c Mon Sep 17 00:00:00 2001
From: spop <spop@138bc75d-0d04-0410-961f-82ee72b054a4>
Date: Sat, 13 Mar 2010 17:35:22 +0000
Subject: [PATCH 07/11] Fix documentation of the new parameters.

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

	* doc/invoke.texi: Fix documentation of graphite-max-nb-scop-params,
	graphite-max-bbs-per-function, and loop-block-tile-size.
	* params.def (PARAM_GRAPHITE_MAX_NB_SCOP_PARAMS): Replace "maximal"
	with "maximum".
	(PARAM_GRAPHITE_MAX_BBS_PER_FUNCTION): Same.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@157437 138bc75d-0d04-0410-961f-82ee72b054a4
---
 gcc/ChangeLog.graphite |    8 ++++++++
 gcc/doc/invoke.texi    |   18 +++++++++++-------
 gcc/params.def         |    4 ++--
 3 files changed, 21 insertions(+), 9 deletions(-)

diff --git a/gcc/ChangeLog.graphite b/gcc/ChangeLog.graphite
index 0ca526c..75fe38f 100644
--- a/gcc/ChangeLog.graphite
+++ b/gcc/ChangeLog.graphite
@@ -1,5 +1,13 @@
 2010-03-10  Sebastian Pop  <sebastian.pop@amd.com>
 
+	* doc/invoke.texi: Fix documentation of graphite-max-nb-scop-params,
+	graphite-max-bbs-per-function, and loop-block-tile-size.
+	* params.def (PARAM_GRAPHITE_MAX_NB_SCOP_PARAMS): Replace "maximal"
+	with "maximum".
+	(PARAM_GRAPHITE_MAX_BBS_PER_FUNCTION): Same.
+
+2010-03-10  Sebastian Pop  <sebastian.pop@amd.com>
+
 	* graphite-clast-to-gimple.c (gcc_type_for_iv_of_clast_loop): Remove
 	forward declaration.
 	* graphite-sese-to-poly.c (reduction_phi_p): Remove FIXME comment.
diff --git a/gcc/doc/invoke.texi b/gcc/doc/invoke.texi
index 8648405..23a0f4a 100644
--- a/gcc/doc/invoke.texi
+++ b/gcc/doc/invoke.texi
@@ -8498,17 +8498,21 @@ pointer parameter.
 
 @item graphite-max-nb-scop-params
 To avoid exponential effects in the Graphite loop transforms, the
-number of parameters in a SCoP is bounded by 10.
+number of parameters in a Static Control Part (SCoP) is bounded.  The
+default value is 10 parameters.  A variable whose value is unknown at
+compile time and defined outside a SCoP is a parameter of the SCoP.
 
 @item graphite-max-bbs-per-function
-To avoid exponential effects in the detection of SCoPs, the functions
-with more than 100 basic blocks are not handled by the Graphite loop
-transforms.
+To avoid exponential effects in the detection of SCoPs, the size of
+the functions analyzed by Graphite is bounded.  The default value is
+100 basic blocks.
 
 @item loop-block-tile-size
-The default factor for the loop blocking or strip mining transforms,
-enabled with @option{-floop-block} or @option{-floop-strip-mine}, is
-51.
+Loop blocking or strip mining transforms, enabled with
+@option{-floop-block} or @option{-floop-strip-mine}, strip mine each
+loop in the loop nest by a given number of iterations.  The strip
+length can be changed using the @option{loop-block-tile-size}
+parameter.  The default value is 51 iterations.
 
 @end table
 @end table
diff --git a/gcc/params.def b/gcc/params.def
index dca575d..435a788 100644
--- a/gcc/params.def
+++ b/gcc/params.def
@@ -749,14 +749,14 @@ DEFPARAM (PARAM_LOOP_BLOCK_TILE_SIZE,
 
 DEFPARAM (PARAM_GRAPHITE_MAX_NB_SCOP_PARAMS,
 	  "graphite-max-nb-scop-params",
-	  "maximal number of parameters in a SCoP",
+	  "maximum number of parameters in a SCoP",
 	  10, 0, 0)
 
 /* Maximal number of basic blocks in the functions analyzed by Graphite.  */
 
 DEFPARAM (PARAM_GRAPHITE_MAX_BBS_PER_FUNCTION,
 	  "graphite-max-bbs-per-function",
-	  "maximal number of basic blocks per function to be analyzed by Graphite",
+	  "maximum number of basic blocks per function to be analyzed by Graphite",
 	  100, 0, 0)
 
 /* Avoid doing loop invariant motion on very large loops.  */
-- 
1.6.3.3


[-- Attachment #9: 0008-Use-ssizetype-when-long_long_integer_type_node-is-NU.patch --]
[-- Type: text/x-diff, Size: 4158 bytes --]

From 119adb56544f6297218e0527ee3ebb18071fbb35 Mon Sep 17 00:00:00 2001
From: spop <spop@138bc75d-0d04-0410-961f-82ee72b054a4>
Date: Sat, 13 Mar 2010 17:35:29 +0000
Subject: [PATCH 08/11] Use ssizetype when long_long_integer_type_node is NULL.

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

	* graphite-clast-to-gimple.c (my_long_long): Defined.
	(gcc_type_for_cloog_iv): Use it instead of long_long_integer_type_node.
	* graphite-sese-to-poly.c (my_long_long): Defined.
	(scop_ivs_can_be_represented): Use it.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@157438 138bc75d-0d04-0410-961f-82ee72b054a4
---
 gcc/ChangeLog.graphite         |    7 +++++++
 gcc/graphite-clast-to-gimple.c |   15 ++++++++++-----
 gcc/graphite-sese-to-poly.c    |    6 +++++-
 3 files changed, 22 insertions(+), 6 deletions(-)

diff --git a/gcc/ChangeLog.graphite b/gcc/ChangeLog.graphite
index 75fe38f..abd9888 100644
--- a/gcc/ChangeLog.graphite
+++ b/gcc/ChangeLog.graphite
@@ -1,3 +1,10 @@
+2010-03-11  Sebastian Pop  <sebastian.pop@amd.com>
+
+	* graphite-clast-to-gimple.c (my_long_long): Defined.
+	(gcc_type_for_cloog_iv): Use it instead of long_long_integer_type_node.
+	* graphite-sese-to-poly.c (my_long_long): Defined.
+	(scop_ivs_can_be_represented): Use it.
+
 2010-03-10  Sebastian Pop  <sebastian.pop@amd.com>
 
 	* doc/invoke.texi: Fix documentation of graphite-max-nb-scop-params,
diff --git a/gcc/graphite-clast-to-gimple.c b/gcc/graphite-clast-to-gimple.c
index 377ca8b..f99a158 100644
--- a/gcc/graphite-clast-to-gimple.c
+++ b/gcc/graphite-clast-to-gimple.c
@@ -547,6 +547,9 @@ clast_get_body_of_loop (struct clast_stmt *stmt)
   gcc_unreachable ();
 }
 
+/* Java does not initialize long_long_integer_type_node.  */
+#define my_long_long (long_long_integer_type_node ? long_long_integer_type_node : ssizetype)
+
 /* Given a CLOOG_IV, return the type that CLOOG_IV should have in GCC
    land.  The selected type is big enough to include the original loop
    iteration variable, but signed to work with the subtractions CLooG
@@ -581,8 +584,8 @@ gcc_type_for_cloog_iv (const char *cloog_iv, gimple_bb_p gbb)
 	  if (type_precision <= TYPE_PRECISION (long_integer_type_node))
 	    return long_integer_type_node;
 
-	  if (type_precision <= TYPE_PRECISION (long_long_integer_type_node))
-	    return long_long_integer_type_node;
+	  if (type_precision <= TYPE_PRECISION (my_long_long))
+	    return my_long_long;
 
 	  gcc_unreachable ();
 	}
@@ -593,17 +596,19 @@ gcc_type_for_cloog_iv (const char *cloog_iv, gimple_bb_p gbb)
       if (type_precision < TYPE_PRECISION (long_integer_type_node))
 	return long_integer_type_node;
 
-      if (type_precision < TYPE_PRECISION (long_long_integer_type_node))
-	return long_long_integer_type_node;
+      if (type_precision < TYPE_PRECISION (my_long_long))
+	return my_long_long;
 
       /* There is no signed type available, that is large enough to hold the
 	 original value.  */
       gcc_unreachable ();
     }
 
-  return long_long_integer_type_node;
+  return my_long_long;
 }
 
+#undef my_long_long
+
 /* Returns the induction variable for the loop that gets translated to
    STMT.  */
 
diff --git a/gcc/graphite-sese-to-poly.c b/gcc/graphite-sese-to-poly.c
index 28ed07c..0f370a8 100644
--- a/gcc/graphite-sese-to-poly.c
+++ b/gcc/graphite-sese-to-poly.c
@@ -2910,6 +2910,9 @@ scop_canonicalize_loops (scop_p scop)
       graphite_loop_normal_form (loop);
 }
 
+/* Java does not initialize long_long_integer_type_node.  */
+#define my_long_long (long_long_integer_type_node ? long_long_integer_type_node : ssizetype)
+
 /* Can all ivs be represented by a signed integer?
    As CLooG might generate negative values in its expressions, signed loop ivs
    are required in the backend. */
@@ -2934,13 +2937,14 @@ scop_ivs_can_be_represented (scop_p scop)
       precision = TYPE_PRECISION (type);
 
       if (TYPE_UNSIGNED (type)
-	  && precision >= TYPE_PRECISION (long_long_integer_type_node))
+	  && precision >= TYPE_PRECISION (my_long_long))
 	return false;
     }
 
   return true;
 }
 
+#undef my_long_long
 
 /* Builds the polyhedral representation for a SESE region.  */
 
-- 
1.6.3.3


[-- Attachment #10: 0009-Add-testcase-from-PR43349.patch --]
[-- Type: text/x-diff, Size: 2386 bytes --]

From 197de505f546b281cae1530deaccb7f7cf83071f Mon Sep 17 00:00:00 2001
From: spop <spop@138bc75d-0d04-0410-961f-82ee72b054a4>
Date: Sat, 13 Mar 2010 17:35:37 +0000
Subject: [PATCH 09/11] Add testcase from PR43349.

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

	PR middle-end/43349
	* gfortran.dg/graphite/pr43349.f: New.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@157439 138bc75d-0d04-0410-961f-82ee72b054a4
---
 gcc/ChangeLog.graphite                       |    5 +++
 gcc/testsuite/gfortran.dg/graphite/pr43349.f |   35 ++++++++++++++++++++++++++
 2 files changed, 40 insertions(+), 0 deletions(-)
 create mode 100644 gcc/testsuite/gfortran.dg/graphite/pr43349.f

diff --git a/gcc/ChangeLog.graphite b/gcc/ChangeLog.graphite
index abd9888..331c080 100644
--- a/gcc/ChangeLog.graphite
+++ b/gcc/ChangeLog.graphite
@@ -1,5 +1,10 @@
 2010-03-11  Sebastian Pop  <sebastian.pop@amd.com>
 
+	PR middle-end/43349
+	* gfortran.dg/graphite/pr43349.f: New.
+
+2010-03-11  Sebastian Pop  <sebastian.pop@amd.com>
+
 	* graphite-clast-to-gimple.c (my_long_long): Defined.
 	(gcc_type_for_cloog_iv): Use it instead of long_long_integer_type_node.
 	* graphite-sese-to-poly.c (my_long_long): Defined.
diff --git a/gcc/testsuite/gfortran.dg/graphite/pr43349.f b/gcc/testsuite/gfortran.dg/graphite/pr43349.f
new file mode 100644
index 0000000..86e408f
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/graphite/pr43349.f
@@ -0,0 +1,35 @@
+! { dg-options "-O2 -floop-interchange" }
+
+      SUBROUTINE BUG(A,B,X,Y,Z,N)
+      IMPLICIT NONE
+      DOUBLE PRECISION A(*),B(*),X(*),Y(*),Z(*)
+      INTEGER N,J,K
+      K = 0
+      DO J = 1,N
+         K = K+1
+         X(K) = B(J+N*7)
+         Y(K) = B(J+N*8)
+         Z(K) = B(J+N*2)  + A(J+N*2)
+         K = K+1
+         X(K) = B(J+N*3)  + A(J+N*3)
+         Y(K) = B(J+N*9)  + A(J)
+         Z(K) = B(J+N*15)
+         K = K+1
+         X(K) = B(J+N*4)  + A(J+N*4)
+         Y(K) = B(J+N*15)
+         Z(K) = B(J+N*10) + A(J)
+         K = K+1
+         X(K) = B(J+N*11) + A(J+N)
+         Y(K) = B(J+N*5)  + A(J+N*5)
+         Z(K) = B(J+N*16)
+         K = K+1
+         X(K) = B(J+N*16)
+         Y(K) = B(J+N*6)  + A(J+N*6)
+         Z(K) = B(J+N*12) + A(J+N)
+         K = K+1
+         X(K) = B(J+N*13) + A(J+N*2)
+         Y(K) = B(J+N*17)
+         Z(K) = B(J+N*7)  + A(J+N*7)
+      ENDDO
+      RETURN
+      END
-- 
1.6.3.3


[-- Attachment #11: 0010-Fix-PR43354-Correctly-handle-default-definitions.patch --]
[-- Type: text/x-diff, Size: 2815 bytes --]

From 5a644317084d97fc349418e446682721319b5c06 Mon Sep 17 00:00:00 2001
From: spop <spop@138bc75d-0d04-0410-961f-82ee72b054a4>
Date: Sat, 13 Mar 2010 17:35:45 +0000
Subject: [PATCH 10/11] Fix PR43354: Correctly handle default definitions.

2010-03-13  Sebastian Pop  <sebastian.pop@amd.com>

	PR middle-end/43354
	* graphite-sese-to-poly.c (rewrite_close_phi_out_of_ssa): Do not
	call insert_out_of_ssa_copy for default definitions.
	* gfortran.dg/graphite/id-pr43354.f: New.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@157440 138bc75d-0d04-0410-961f-82ee72b054a4
---
 gcc/ChangeLog.graphite                          |    9 ++++++++-
 gcc/graphite-sese-to-poly.c                     |    3 ++-
 gcc/testsuite/gfortran.dg/graphite/id-pr43354.f |   18 ++++++++++++++++++
 3 files changed, 28 insertions(+), 2 deletions(-)
 create mode 100644 gcc/testsuite/gfortran.dg/graphite/id-pr43354.f

diff --git a/gcc/ChangeLog.graphite b/gcc/ChangeLog.graphite
index 331c080..1659de6 100644
--- a/gcc/ChangeLog.graphite
+++ b/gcc/ChangeLog.graphite
@@ -1,4 +1,11 @@
-2010-03-11  Sebastian Pop  <sebastian.pop@amd.com>
+2010-03-13  Sebastian Pop  <sebastian.pop@amd.com>
+
+	PR middle-end/43354
+	* graphite-sese-to-poly.c (rewrite_close_phi_out_of_ssa): Do not
+	call insert_out_of_ssa_copy for default definitions.
+	* gfortran.dg/graphite/id-pr43354.f: New.
+
+2010-03-13  Sebastian Pop  <sebastian.pop@amd.com>
 
 	PR middle-end/43349
 	* gfortran.dg/graphite/pr43349.f: New.
diff --git a/gcc/graphite-sese-to-poly.c b/gcc/graphite-sese-to-poly.c
index 0f370a8..b0bc348 100644
--- a/gcc/graphite-sese-to-poly.c
+++ b/gcc/graphite-sese-to-poly.c
@@ -2200,7 +2200,8 @@ rewrite_close_phi_out_of_ssa (gimple_stmt_iterator *psi)
   gimple stmt = gimple_build_assign (res, zero_dim_array);
   tree arg = gimple_phi_arg_def (phi, 0);
 
-  if (TREE_CODE (arg) == SSA_NAME)
+  if (TREE_CODE (arg) == SSA_NAME
+      && !SSA_NAME_IS_DEFAULT_DEF (arg))
     insert_out_of_ssa_copy (zero_dim_array, arg);
   else
     insert_out_of_ssa_copy_on_edge (single_pred_edge (gimple_bb (phi)),
diff --git a/gcc/testsuite/gfortran.dg/graphite/id-pr43354.f b/gcc/testsuite/gfortran.dg/graphite/id-pr43354.f
new file mode 100644
index 0000000..e614f91
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/graphite/id-pr43354.f
@@ -0,0 +1,18 @@
+      SUBROUTINE POFUN2(DIM,GRDENT,FPART,FPARTL)
+      DOUBLE PRECISION GRDENT(*)
+      DOUBLE COMPLEX FPART(*)
+      DOUBLE COMPLEX FPARTL(*)
+      INTEGER REFLCT,XRIREF
+      IF (DIM.GT.1) THEN
+         ABCS3=XRCELL(1)
+         IF (ABCS2.EQ.ABCS3) THEN
+         END IF
+      ELSE
+         DO REFLCT=1,XRIREF,1
+            FPARTL(REFLCT)=FPART(REFLCT)
+         END DO
+      END IF
+         IF (ABCS2.EQ.ABCS3) THEN
+            GRDENT(1)=GRDENT(3)
+         END IF
+      END
-- 
1.6.3.3


[-- Attachment #12: 0011-Add-ChangeLog-entries.patch --]
[-- Type: text/x-diff, Size: 3580 bytes --]

From 6c814203b659574418aab7ea0e4a6c42ff0d5b50 Mon Sep 17 00:00:00 2001
From: spop <spop@138bc75d-0d04-0410-961f-82ee72b054a4>
Date: Sat, 13 Mar 2010 17:35:52 +0000
Subject: [PATCH 11/11] Add ChangeLog entries.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@157441 138bc75d-0d04-0410-961f-82ee72b054a4
---
 gcc/ChangeLog           |   59 +++++++++++++++++++++++++++++++++++++++++++++++
 gcc/testsuite/ChangeLog |   15 ++++++++++++
 2 files changed, 74 insertions(+), 0 deletions(-)

diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index f56c1e7..4d9c1c1 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,62 @@
+2010-03-13  Sebastian Pop  <sebastian.pop@amd.com>
+
+	PR middle-end/43354
+	* graphite-sese-to-poly.c (rewrite_close_phi_out_of_ssa): Do not
+	call insert_out_of_ssa_copy for default definitions.
+
+2010-03-13  Sebastian Pop  <sebastian.pop@amd.com>
+
+	* graphite-clast-to-gimple.c (my_long_long): Defined.
+	(gcc_type_for_cloog_iv): Use it instead of long_long_integer_type_node.
+	* graphite-sese-to-poly.c (my_long_long): Defined.
+	(scop_ivs_can_be_represented): Use it.
+
+2010-03-13  Sebastian Pop  <sebastian.pop@amd.com>
+
+	* doc/invoke.texi: Fix documentation of graphite-max-nb-scop-params,
+	graphite-max-bbs-per-function, and loop-block-tile-size.
+	* params.def (PARAM_GRAPHITE_MAX_NB_SCOP_PARAMS): Replace "maximal"
+	with "maximum".
+	(PARAM_GRAPHITE_MAX_BBS_PER_FUNCTION): Same.
+
+2010-03-13  Sebastian Pop  <sebastian.pop@amd.com>
+
+	* graphite-clast-to-gimple.c (gcc_type_for_iv_of_clast_loop): Remove
+	forward declaration.
+	* graphite-sese-to-poly.c (reduction_phi_p): Remove FIXME comment.
+	(add_upper_bounds_from_estimated_nit): New.
+	(build_loop_iteration_domains): Use it.
+
+2010-03-13  Sebastian Pop  <sebastian.pop@amd.com>
+
+	* doc/invoke.texi (PARAM_LOOP_BLOCK_TILE_SIZE): Document.
+
+2010-03-13  Sebastian Pop  <sebastian.pop@amd.com>
+
+	PR middle-end/43306
+	* tree-chrec.c (evolution_function_right_is_integer_cst): CHREC_RIGHT
+	should be an INTEGER_CST.  Also handle CASE_CONVERT.
+
+2010-03-13  Sebastian Pop  <sebastian.pop@amd.com>
+
+	* graphite.c (graphite_initialize): To bound the number of bbs per
+	function, use PARAM_GRAPHITE_MAX_BBS_PER_FUNCTION.
+	* params.def (PARAM_GRAPHITE_MAX_BBS_PER_FUNCTION): Declared.
+	* doc/invoke.texi: Document it.
+
+2010-03-13  Sebastian Pop  <sebastian.pop@amd.com>
+
+	* graphite-sese-to-poly.c (build_poly_scop): Do not return bool.
+	* graphite-sese-to-poly.h (build_poly_scop): Same.
+
+2010-03-13  Sebastian Pop  <sebastian.pop@amd.com>
+
+	* graphite-sese-to-poly.c (build_poly_scop): Limit scops following
+	the number of parameters in the scop.  Use as an upper bound
+	PARAM_GRAPHITE_MAX_NB_SCOP_PARAMS.
+	* params.def (PARAM_GRAPHITE_MAX_NB_SCOP_PARAMS): Declared.
+	* doc/invoke.texi: Document it.
+
 2010-03-13  Jerry Quinn  <jlquinn@optonline.net>
 
 	* Makefile.in (TEXI_GCCINT_FILES): Remove c-tree.texi.
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index 3f5e88b..336e2e3 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,3 +1,18 @@
+2010-03-13  Sebastian Pop  <sebastian.pop@amd.com>
+
+	PR middle-end/43354
+	* gfortran.dg/graphite/id-pr43354.f: New.
+
+2010-03-13  Sebastian Pop  <sebastian.pop@amd.com>
+
+	PR middle-end/43349
+	* gfortran.dg/graphite/pr43349.f: New.
+
+2010-03-13  Sebastian Pop  <sebastian.pop@amd.com>
+
+	PR middle-end/43306
+	* gcc.dg/graphite/pr43306.c: New.
+
 2010-03-12  David S. Miller  <davem@davemloft.net>
 
 	* gcc.dg/lto/20090313_0.c: Add -mcpu=v9 to dg-lto-options on
-- 
1.6.3.3


^ permalink raw reply	[flat|nested] 42+ messages in thread
* [patch] Merge to trunk from Graphite branch
@ 2010-03-08 18:18 Sebastian Pop
  0 siblings, 0 replies; 42+ messages in thread
From: Sebastian Pop @ 2010-03-08 18:18 UTC (permalink / raw)
  To: GCC Patches

[-- Attachment #1: Type: text/plain, Size: 201 bytes --]

Hi,

I am merging to trunk the last changes from the Graphite branch
These should fix some of the last P1 bugs related to Graphite.

Sebastian Pop
--
AMD / Open Source Compiler Engineering / GNU Tools

[-- Attachment #2: 0001-Add-constraints-on-the-type-of-parameters-to-the-sco.patch --]
[-- Type: text/x-diff, Size: 1451 bytes --]

From 940163e15b52aead6cc08b8c011d94102705ec95 Mon Sep 17 00:00:00 2001
From: spop <spop@138bc75d-0d04-0410-961f-82ee72b054a4>
Date: Tue, 23 Feb 2010 13:31:26 +0000
Subject: [PATCH 01/15] Add constraints on the type of parameters to the scop context.

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

	* graphite-sese-to-poly.c (add_param_constraints): Enabled: remove
	early return.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/graphite@157002 138bc75d-0d04-0410-961f-82ee72b054a4
---
 gcc/ChangeLog.graphite      |    5 +++++
 gcc/graphite-sese-to-poly.c |    3 ---
 2 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/gcc/ChangeLog.graphite b/gcc/ChangeLog.graphite
index 1771284..a3dbd5f 100644
--- a/gcc/ChangeLog.graphite
+++ b/gcc/ChangeLog.graphite
@@ -1,3 +1,8 @@
+2010-02-23  Sebastian Pop  <sebastian.pop@amd.com>
+
+	* graphite-sese-to-poly.c (add_param_constraints): Enabled: remove
+	early return.
+
 2010-02-22  Sebastian Pop  <sebastian.pop@amd.com>
 
 	PR middle-end/43083
diff --git a/gcc/graphite-sese-to-poly.c b/gcc/graphite-sese-to-poly.c
index d4889b0..3ee431f 100644
--- a/gcc/graphite-sese-to-poly.c
+++ b/gcc/graphite-sese-to-poly.c
@@ -1501,9 +1501,6 @@ add_param_constraints (scop_p scop, ppl_Polyhedron_t context, graphite_dim_t p)
   tree type = TREE_TYPE (parameter);
   tree lb, ub;
 
-  /* Disabled until we fix CPU2006.  */
-  return;
-
   if (!INTEGRAL_TYPE_P (type))
     return;
 
-- 
1.6.3.3


[-- Attachment #3: 0002-Cleanup.patch --]
[-- Type: text/x-diff, Size: 2574 bytes --]

From ce550713b29740b1621e37d499cc55b2629bf567 Mon Sep 17 00:00:00 2001
From: spop <spop@138bc75d-0d04-0410-961f-82ee72b054a4>
Date: Tue, 23 Feb 2010 13:31:32 +0000
Subject: [PATCH 02/15] Cleanup.

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

	* graphite-clast-to-gimple.c (find_cloog_iv_in_expr): Simplify
	and clean up the logic.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/graphite@157003 138bc75d-0d04-0410-961f-82ee72b054a4
---
 gcc/ChangeLog.graphite         |    5 +++++
 gcc/graphite-clast-to-gimple.c |   30 +++++++++++++-----------------
 2 files changed, 18 insertions(+), 17 deletions(-)

diff --git a/gcc/ChangeLog.graphite b/gcc/ChangeLog.graphite
index a3dbd5f..e3e6ecd 100644
--- a/gcc/ChangeLog.graphite
+++ b/gcc/ChangeLog.graphite
@@ -1,5 +1,10 @@
 2010-02-23  Sebastian Pop  <sebastian.pop@amd.com>
 
+	* graphite-clast-to-gimple.c (find_cloog_iv_in_expr): Simplify
+	and clean up the logic.
+
+2010-02-23  Sebastian Pop  <sebastian.pop@amd.com>
+
 	* graphite-sese-to-poly.c (add_param_constraints): Enabled: remove
 	early return.
 
diff --git a/gcc/graphite-clast-to-gimple.c b/gcc/graphite-clast-to-gimple.c
index 424f5c6..3e82075 100644
--- a/gcc/graphite-clast-to-gimple.c
+++ b/gcc/graphite-clast-to-gimple.c
@@ -997,34 +997,30 @@ static const char *
 find_cloog_iv_in_expr (struct clast_expr *expr)
 {
   struct clast_term *term = (struct clast_term *) expr;
-
-  if (expr->type == expr_term
-      && !term->var)
-    return NULL;
+  struct clast_reduction *red;
+  int i;
 
   if (expr->type == expr_term)
     return term->var;
 
-  if (expr->type == expr_red)
-    {
-      int i;
-      struct clast_reduction *red = (struct clast_reduction *) expr;
+  if (expr->type != expr_red)
+    return NULL;
 
-      for (i = 0; i < red->n; i++)
-	{
-	  const char *res = find_cloog_iv_in_expr ((red)->elts[i]);
+  red = (struct clast_reduction *) expr;
+  for (i = 0; i < red->n; i++)
+    {
+      const char *res = find_cloog_iv_in_expr (red->elts[i]);
 
-	  if (res)
-	    return res;
-	}
+      if (res)
+	return res;
     }
 
   return NULL;
 }
 
-/* Build for a clast_user_stmt USER_STMT a map between the CLAST
-   induction variables and the corresponding GCC old induction
-   variables.  This information is stored on each GRAPHITE_BB.  */
+/* Build for USER_STMT a map between the CLAST induction variables and
+   the corresponding GCC old induction variables.  This information is
+   stored on each GRAPHITE_BB.  */
 
 static void
 compute_cloog_iv_types_1 (poly_bb_p pbb, struct clast_user_stmt *user_stmt)
-- 
1.6.3.3


[-- Attachment #4: 0003-Fix-PR42326-handle-default-definitions.patch --]
[-- Type: text/x-diff, Size: 2432 bytes --]

From cd3223f902edff054f9d8f394324e874353b6e5f Mon Sep 17 00:00:00 2001
From: spop <spop@138bc75d-0d04-0410-961f-82ee72b054a4>
Date: Tue, 2 Mar 2010 11:51:21 +0000
Subject: [PATCH 03/15] Fix PR42326: handle default definitions.

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

	PR middle-end/42326
	* sese.c (name_defined_in_loop_p): Return false for default
	definitions.

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

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/graphite@157162 138bc75d-0d04-0410-961f-82ee72b054a4
---
 gcc/ChangeLog.graphite                  |    8 ++++++++
 gcc/sese.c                              |    5 ++---
 gcc/testsuite/gcc.dg/graphite/pr42326.c |   20 ++++++++++++++++++++
 3 files changed, 30 insertions(+), 3 deletions(-)
 create mode 100644 gcc/testsuite/gcc.dg/graphite/pr42326.c

diff --git a/gcc/ChangeLog.graphite b/gcc/ChangeLog.graphite
index e3e6ecd..5406717 100644
--- a/gcc/ChangeLog.graphite
+++ b/gcc/ChangeLog.graphite
@@ -1,3 +1,11 @@
+2010-03-02  Sebastian Pop  <sebastian.pop@amd.com>
+
+	PR middle-end/42326
+	* sese.c (name_defined_in_loop_p): Return false for default
+	definitions.
+
+	* gcc.dg/graphite/pr42326.c: New.
+
 2010-02-23  Sebastian Pop  <sebastian.pop@amd.com>
 
 	* graphite-clast-to-gimple.c (find_cloog_iv_in_expr): Simplify
diff --git a/gcc/sese.c b/gcc/sese.c
index d7a9faa..545b1c6 100644
--- a/gcc/sese.c
+++ b/gcc/sese.c
@@ -1106,9 +1106,8 @@ get_false_edge_from_guard_bb (basic_block bb)
 static bool
 name_defined_in_loop_p (tree name, loop_p loop)
 {
-  gimple stmt = SSA_NAME_DEF_STMT (name);
-
-  return (gimple_bb (stmt)->loop_father == loop);
+  return !SSA_NAME_IS_DEFAULT_DEF (name)
+    && gimple_bb (SSA_NAME_DEF_STMT (name))->loop_father == loop;
 }
 
 /* Returns true when EXPR contains SSA_NAMEs defined in LOOP.  */
diff --git a/gcc/testsuite/gcc.dg/graphite/pr42326.c b/gcc/testsuite/gcc.dg/graphite/pr42326.c
new file mode 100644
index 0000000..de5d56e
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/graphite/pr42326.c
@@ -0,0 +1,20 @@
+/* { dg-options "-O1 -floop-parallelize-all" } */
+
+double lagrange(const double x[],
+                const double y[],
+                long n,
+                double xval)
+{
+  long i, j;
+  double yval = 0.;
+
+  for( i=0; i < n; i++ )
+    {
+      double l = 1.;
+      for( j=0; j < n; j++ )
+	if( i != j )
+	  l *= (xval-x[j])/(x[i]-x[j]);
+      yval += y[i]*l;
+    }
+  return yval;
+}
-- 
1.6.3.3


[-- Attachment #5: 0004-New-function-combine_context_id_scat.patch --]
[-- Type: text/x-diff, Size: 3829 bytes --]

From c88ab668784be9616db77719263c66eae41773b5 Mon Sep 17 00:00:00 2001
From: spop <spop@138bc75d-0d04-0410-961f-82ee72b054a4>
Date: Thu, 4 Mar 2010 12:31:18 +0000
Subject: [PATCH 04/15] New function combine_context_id_scat.

2010-03-04  Sebastian Pop  <sebastian.pop@amd.com>

	* graphite-poly.h (struct poly_scattering): Add layout documentation.
	(struct poly_bb): Same.
	(combine_context_id_scat): New.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/graphite@157219 138bc75d-0d04-0410-961f-82ee72b054a4
---
 gcc/ChangeLog.graphite |    6 +++++
 gcc/graphite-poly.h    |   53 ++++++++++++++++++++++++++++++++++++++++++++++-
 2 files changed, 57 insertions(+), 2 deletions(-)

diff --git a/gcc/ChangeLog.graphite b/gcc/ChangeLog.graphite
index 5406717..3665132 100644
--- a/gcc/ChangeLog.graphite
+++ b/gcc/ChangeLog.graphite
@@ -1,3 +1,9 @@
+2010-03-04  Sebastian Pop  <sebastian.pop@amd.com>
+
+	* graphite-poly.h (struct poly_scattering): Add layout documentation.
+	(struct poly_bb): Same.
+	(combine_context_id_scat): New.
+
 2010-03-02  Sebastian Pop  <sebastian.pop@amd.com>
 
 	PR middle-end/42326
diff --git a/gcc/graphite-poly.h b/gcc/graphite-poly.h
index 0a8204e..b586699 100644
--- a/gcc/graphite-poly.h
+++ b/gcc/graphite-poly.h
@@ -263,7 +263,9 @@ typedef struct poly_scattering *poly_scattering_p;
 
 struct poly_scattering
 {
-  /* The scattering function containing the transformations.  */
+  /* The scattering function containing the transformations: the
+     layout of this polyhedron is: T|I|G with T the transform
+     scattering, I the iteration domain, G the context parameters.  */
   ppl_Polyhedron_t scattering;
 
   /* The number of local variables.  */
@@ -283,7 +285,9 @@ struct poly_bb
   /* Pointer to the SCOP containing this PBB.  */
   scop_p scop;
 
-  /* The iteration domain of this bb.
+  /* The iteration domain of this bb.  The layout of this polyhedron
+     is I|G with I the iteration domain, G the context parameters.
+
      Example:
 
      for (i = a - 7*b + 8; i <= 3*a + 13*b + 20; i++)
@@ -1467,4 +1471,49 @@ restore_scattering (scop_p scop)
   restore_lst_schedule (scop);
 }
 
+/* For a given PBB, add to RES the scop context, the iteration domain,
+   the original scattering when ORIGINAL_P is true, otherwise add the
+   transformed scattering.  */
+
+static inline void
+combine_context_id_scat (ppl_Pointset_Powerset_C_Polyhedron_t *res,
+			 poly_bb_p pbb, bool original_p)
+{
+  ppl_Pointset_Powerset_C_Polyhedron_t context;
+  ppl_Pointset_Powerset_C_Polyhedron_t id;
+
+  ppl_new_Pointset_Powerset_C_Polyhedron_from_C_Polyhedron
+    (res, original_p ?
+     PBB_ORIGINAL_SCATTERING (pbb) : PBB_TRANSFORMED_SCATTERING (pbb));
+
+  ppl_new_Pointset_Powerset_C_Polyhedron_from_Pointset_Powerset_C_Polyhedron
+    (&context, SCOP_CONTEXT (PBB_SCOP (pbb)));
+
+  ppl_new_Pointset_Powerset_C_Polyhedron_from_Pointset_Powerset_C_Polyhedron
+    (&id, PBB_DOMAIN (pbb));
+
+  /* Extend the context and the iteration domain to the dimension of
+     the scattering: T|I|G.  */
+  {
+    ppl_dimension_type gdim, tdim, idim;
+
+    ppl_Pointset_Powerset_C_Polyhedron_space_dimension (*res, &tdim);
+    ppl_Pointset_Powerset_C_Polyhedron_space_dimension (context, &gdim);
+    ppl_Pointset_Powerset_C_Polyhedron_space_dimension (id, &idim);
+
+    if (tdim > gdim)
+      ppl_insert_dimensions_pointset (context, 0, tdim - gdim);
+
+    if (tdim > idim)
+      ppl_insert_dimensions_pointset (id, 0, tdim - idim);
+  }
+
+  /* Add the context and the iteration domain to the result.  */
+  ppl_Pointset_Powerset_C_Polyhedron_intersection_assign (*res, context);
+  ppl_Pointset_Powerset_C_Polyhedron_intersection_assign (*res, id);
+
+  ppl_delete_Pointset_Powerset_C_Polyhedron (context);
+  ppl_delete_Pointset_Powerset_C_Polyhedron (id);
+}
+
 #endif
-- 
1.6.3.3


[-- Attachment #6: 0005-Cleanup-data-dep-polyhedron-construction.patch --]
[-- Type: text/x-diff, Size: 6393 bytes --]

From 02d4a49457b6fabd698e32d4c489eb89930a1a47 Mon Sep 17 00:00:00 2001
From: spop <spop@138bc75d-0d04-0410-961f-82ee72b054a4>
Date: Thu, 4 Mar 2010 12:31:24 +0000
Subject: [PATCH 05/15] Cleanup data dep polyhedron construction.

2010-03-04  Sebastian Pop  <sebastian.pop@amd.com>

	* graphite-dependences.c (map_into_dep_poly): Removed.
	(dependence_polyhedron_1): Use combine_context_id_scat.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/graphite@157220 138bc75d-0d04-0410-961f-82ee72b054a4
---
 gcc/ChangeLog.graphite     |    5 +++
 gcc/graphite-dependences.c |   60 ++++++++-----------------------------------
 2 files changed, 16 insertions(+), 49 deletions(-)

diff --git a/gcc/ChangeLog.graphite b/gcc/ChangeLog.graphite
index 3665132..c190671 100644
--- a/gcc/ChangeLog.graphite
+++ b/gcc/ChangeLog.graphite
@@ -1,5 +1,10 @@
 2010-03-04  Sebastian Pop  <sebastian.pop@amd.com>
 
+	* graphite-dependences.c (map_into_dep_poly): Removed.
+	(dependence_polyhedron_1): Use combine_context_id_scat.
+
+2010-03-04  Sebastian Pop  <sebastian.pop@amd.com>
+
 	* graphite-poly.h (struct poly_scattering): Add layout documentation.
 	(struct poly_bb): Same.
 	(combine_context_id_scat): New.
diff --git a/gcc/graphite-dependences.c b/gcc/graphite-dependences.c
index bd83e15..f9d9daa 100644
--- a/gcc/graphite-dependences.c
+++ b/gcc/graphite-dependences.c
@@ -269,28 +269,6 @@ poly_drs_may_alias_p (poly_dr_p pdr1, poly_dr_p pdr2)
   return !empty_p;
 }
 
-/* Returns a polyhedron of dimension DIM.
-
-   Maps the dimensions [0, ..., cut - 1] of polyhedron P to OFFSET
-   and the dimensions [cut, ..., nb_dim] to DIM - GDIM.  */
-
-static ppl_Pointset_Powerset_C_Polyhedron_t
-map_into_dep_poly (graphite_dim_t dim, graphite_dim_t gdim,
-		   ppl_Pointset_Powerset_C_Polyhedron_t p,
-		   graphite_dim_t cut,
-		   graphite_dim_t offset)
-{
-  ppl_Pointset_Powerset_C_Polyhedron_t res;
-
-  ppl_new_Pointset_Powerset_C_Polyhedron_from_Pointset_Powerset_C_Polyhedron
-    (&res, p);
-  ppl_insert_dimensions_pointset (res, 0, offset);
-  ppl_insert_dimensions_pointset (res, offset + cut,
-				  dim - offset - cut - gdim);
-
-  return res;
-}
-
 /* Swap [cut0, ..., cut1] to the end of DR: "a CUT0 b CUT1 c" is
    transformed into "a CUT0 c CUT1' b"
 
@@ -486,41 +464,33 @@ dependence_polyhedron_1 (poly_dr_p pdr1, poly_dr_p pdr2,
   poly_bb_p pbb1 = PDR_PBB (pdr1);
   poly_bb_p pbb2 = PDR_PBB (pdr2);
   scop_p scop = PBB_SCOP (pbb1);
-  ppl_Pointset_Powerset_C_Polyhedron_t d1 = PBB_DOMAIN (pbb1);
-  ppl_Pointset_Powerset_C_Polyhedron_t d2 = PBB_DOMAIN (pbb2);
   graphite_dim_t tdim1 = original_scattering_p ?
     pbb_nb_scattering_orig (pbb1) : pbb_nb_scattering_transform (pbb1);
   graphite_dim_t tdim2 = original_scattering_p ?
     pbb_nb_scattering_orig (pbb2) : pbb_nb_scattering_transform (pbb2);
-  ppl_Polyhedron_t scat1 = original_scattering_p ?
-    PBB_ORIGINAL_SCATTERING (pbb1) : PBB_TRANSFORMED_SCATTERING (pbb1);
-  ppl_Polyhedron_t scat2 = original_scattering_p ?
-    PBB_ORIGINAL_SCATTERING (pbb2) : PBB_TRANSFORMED_SCATTERING (pbb2);
   graphite_dim_t ddim1 = pbb_dim_iter_domain (pbb1);
   graphite_dim_t ddim2 = pbb_dim_iter_domain (pbb2);
   graphite_dim_t sdim1 = PDR_NB_SUBSCRIPTS (pdr1) + 1;
+  graphite_dim_t sdim2 = PDR_NB_SUBSCRIPTS (pdr2) + 1;
   graphite_dim_t gdim = scop_nb_params (scop);
   graphite_dim_t dim1 = pdr_dim (pdr1);
   graphite_dim_t dim2 = pdr_dim (pdr2);
   graphite_dim_t dim = tdim1 + tdim2 + dim1 + dim2 - gdim;
   ppl_Pointset_Powerset_C_Polyhedron_t res;
-  ppl_Pointset_Powerset_C_Polyhedron_t id1, id2, isc1, isc2, idr1, idr2;
+  ppl_Pointset_Powerset_C_Polyhedron_t idr1, idr2;
   ppl_Pointset_Powerset_C_Polyhedron_t sc1, sc2, dreq;
-  ppl_Pointset_Powerset_C_Polyhedron_t context;
 
   gcc_assert (PBB_SCOP (pbb1) == PBB_SCOP (pbb2));
 
-  ppl_new_Pointset_Powerset_C_Polyhedron_from_Pointset_Powerset_C_Polyhedron
-    (&context, SCOP_CONTEXT (scop));
-  ppl_insert_dimensions_pointset (context, 0, dim - gdim);
+  combine_context_id_scat (&sc1, pbb1, original_scattering_p);
+  combine_context_id_scat (&sc2, pbb2, original_scattering_p);
 
-  ppl_new_Pointset_Powerset_C_Polyhedron_from_C_Polyhedron (&sc1, scat1);
-  ppl_new_Pointset_Powerset_C_Polyhedron_from_C_Polyhedron (&sc2, scat2);
+  ppl_insert_dimensions_pointset (sc1, tdim1 + ddim1,
+				  tdim2 + ddim2 + sdim1 + sdim2);
 
-  id1 = map_into_dep_poly (dim, gdim, d1, ddim1, tdim1);
-  id2 = map_into_dep_poly (dim, gdim, d2, ddim2, tdim1 + ddim1 + tdim2);
-  isc1 = map_into_dep_poly (dim, gdim, sc1, ddim1 + tdim1, 0);
-  isc2 = map_into_dep_poly (dim, gdim, sc2, ddim2 + tdim2, tdim1 + ddim1);
+  ppl_insert_dimensions_pointset (sc2, 0, tdim1 + ddim1);
+  ppl_insert_dimensions_pointset (sc2, tdim1 + ddim1 + tdim2 + ddim2,
+				  sdim1 + sdim2);
 
   idr1 = map_dr_into_dep_poly (dim, PDR_ACCESSES (pdr1), ddim1, ddim1 + gdim,
 			       tdim1, tdim2 + ddim2);
@@ -531,21 +501,13 @@ dependence_polyhedron_1 (poly_dr_p pdr1, poly_dr_p pdr2,
   dreq = dr_equality_constraints (dim, tdim1 + ddim1 + tdim2 + ddim2, sdim1);
 
   ppl_new_Pointset_Powerset_C_Polyhedron_from_space_dimension (&res, dim, 0);
-  ppl_Pointset_Powerset_C_Polyhedron_intersection_assign (res, context);
-  ppl_Pointset_Powerset_C_Polyhedron_intersection_assign (res, id1);
-  ppl_Pointset_Powerset_C_Polyhedron_intersection_assign (res, id2);
-  ppl_Pointset_Powerset_C_Polyhedron_intersection_assign (res, isc1);
-  ppl_Pointset_Powerset_C_Polyhedron_intersection_assign (res, isc2);
+  ppl_Pointset_Powerset_C_Polyhedron_intersection_assign (res, sc1);
+  ppl_Pointset_Powerset_C_Polyhedron_intersection_assign (res, sc2);
   ppl_Pointset_Powerset_C_Polyhedron_intersection_assign (res, idr1);
   ppl_Pointset_Powerset_C_Polyhedron_intersection_assign (res, idr2);
   ppl_Pointset_Powerset_C_Polyhedron_intersection_assign (res, dreq);
-  ppl_delete_Pointset_Powerset_C_Polyhedron (context);
-  ppl_delete_Pointset_Powerset_C_Polyhedron (id1);
-  ppl_delete_Pointset_Powerset_C_Polyhedron (id2);
   ppl_delete_Pointset_Powerset_C_Polyhedron (sc1);
   ppl_delete_Pointset_Powerset_C_Polyhedron (sc2);
-  ppl_delete_Pointset_Powerset_C_Polyhedron (isc1);
-  ppl_delete_Pointset_Powerset_C_Polyhedron (isc2);
   ppl_delete_Pointset_Powerset_C_Polyhedron (idr1);
   ppl_delete_Pointset_Powerset_C_Polyhedron (idr2);
   ppl_delete_Pointset_Powerset_C_Polyhedron (dreq);
-- 
1.6.3.3


[-- Attachment #7: 0006-Cleanup.patch --]
[-- Type: text/x-diff, Size: 2894 bytes --]

From 80f59eb05e36c6dfea5182a7b0fd80ed3f6c6d14 Mon Sep 17 00:00:00 2001
From: spop <spop@138bc75d-0d04-0410-961f-82ee72b054a4>
Date: Thu, 4 Mar 2010 12:31:31 +0000
Subject: [PATCH 06/15] Cleanup.

2010-03-04  Sebastian Pop  <sebastian.pop@amd.com>

	* graphite-ppl.c (ppl_min_for_le_polyhedron): Renamed
	ppl_min_for_le_pointset.  Use ppl_Pointset_Powerset_C_Polyhedron_minimize.
	* graphite-ppl.h (ppl_min_for_le_polyhedron): Update declaration.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/graphite@157221 138bc75d-0d04-0410-961f-82ee72b054a4
---
 gcc/ChangeLog.graphite |    6 ++++++
 gcc/graphite-ppl.c     |    8 ++++----
 gcc/graphite-ppl.h     |    4 ++--
 3 files changed, 12 insertions(+), 6 deletions(-)

diff --git a/gcc/ChangeLog.graphite b/gcc/ChangeLog.graphite
index c190671..e5d5653 100644
--- a/gcc/ChangeLog.graphite
+++ b/gcc/ChangeLog.graphite
@@ -1,5 +1,11 @@
 2010-03-04  Sebastian Pop  <sebastian.pop@amd.com>
 
+	* graphite-ppl.c (ppl_min_for_le_polyhedron): Renamed
+	ppl_min_for_le_pointset.  Use ppl_Pointset_Powerset_C_Polyhedron_minimize.
+	* graphite-ppl.h (ppl_min_for_le_polyhedron): Update declaration.
+
+2010-03-04  Sebastian Pop  <sebastian.pop@amd.com>
+
 	* graphite-dependences.c (map_into_dep_poly): Removed.
 	(dependence_polyhedron_1): Use combine_context_id_scat.
 
diff --git a/gcc/graphite-ppl.c b/gcc/graphite-ppl.c
index 0b76335..c80cf1b 100644
--- a/gcc/graphite-ppl.c
+++ b/gcc/graphite-ppl.c
@@ -673,18 +673,18 @@ ppl_max_for_le_pointset (ppl_Pointset_Powerset_C_Polyhedron_t ps,
    polyhedron POL.  */
 
 void
-ppl_min_for_le_polyhedron (ppl_Polyhedron_t pol,
-			   ppl_Linear_Expression_t le, Value res)
+ppl_min_for_le_pointset (ppl_Pointset_Powerset_C_Polyhedron_t ps,
+			 ppl_Linear_Expression_t le, Value res)
 {
   ppl_Coefficient_t num, denom;
   Value dv, nv;
-  int maximum, err;
+  int minimum, err;
 
   value_init (nv);
   value_init (dv);
   ppl_new_Coefficient (&num);
   ppl_new_Coefficient (&denom);
-  err = ppl_Polyhedron_minimize (pol, le, num, denom, &maximum);
+  err = ppl_Pointset_Powerset_C_Polyhedron_minimize (ps, le, num, denom, &minimum);
 
   if (err > 0)
     {
diff --git a/gcc/graphite-ppl.h b/gcc/graphite-ppl.h
index 488ad6f..5a3ec6a 100644
--- a/gcc/graphite-ppl.h
+++ b/gcc/graphite-ppl.h
@@ -48,8 +48,8 @@ void ppl_set_inhomogeneous_gmp (ppl_Linear_Expression_t, Value);
 void ppl_set_coef_gmp (ppl_Linear_Expression_t, ppl_dimension_type, Value);
 void ppl_max_for_le_pointset (ppl_Pointset_Powerset_C_Polyhedron_t,
                               ppl_Linear_Expression_t, Value);
-void ppl_min_for_le_polyhedron (ppl_Polyhedron_t, ppl_Linear_Expression_t,
-				Value);
+void ppl_min_for_le_pointset (ppl_Pointset_Powerset_C_Polyhedron_t,
+			      ppl_Linear_Expression_t, Value);
 ppl_Constraint_t ppl_build_relation (int, int, int, int,
 				     enum ppl_enum_Constraint_Type);
 
-- 
1.6.3.3


[-- Attachment #8: 0007-Fold-convert-SSA_NAMEs-in-the-scalar-expander.patch --]
[-- Type: text/x-diff, Size: 3701 bytes --]

From 9187b4b6f838d67c624f3f2aff60597ab6714c25 Mon Sep 17 00:00:00 2001
From: spop <spop@138bc75d-0d04-0410-961f-82ee72b054a4>
Date: Thu, 4 Mar 2010 12:31:37 +0000
Subject: [PATCH 07/15] Fold convert SSA_NAMEs in the scalar expander.

2010-03-04  Sebastian Pop  <sebastian.pop@amd.com>

	* sese.c (expand_scalar_variables_ssa_name): Add new argument for type.
	Call fold_convert on all the returned values.
	(expand_scalar_variables_expr): Pass to expand_scalar_variables_ssa_name
	the type of the resulting expression.

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

diff --git a/gcc/ChangeLog.graphite b/gcc/ChangeLog.graphite
index e5d5653..25e0c51 100644
--- a/gcc/ChangeLog.graphite
+++ b/gcc/ChangeLog.graphite
@@ -1,5 +1,12 @@
 2010-03-04  Sebastian Pop  <sebastian.pop@amd.com>
 
+	* sese.c (expand_scalar_variables_ssa_name): Add new argument for type.
+	Call fold_convert on all the returned values.
+	(expand_scalar_variables_expr): Pass to expand_scalar_variables_ssa_name
+	the type of the resulting expression.
+
+2010-03-04  Sebastian Pop  <sebastian.pop@amd.com>
+
 	* graphite-ppl.c (ppl_min_for_le_polyhedron): Renamed
 	ppl_min_for_le_pointset.  Use ppl_Pointset_Powerset_C_Polyhedron_minimize.
 	* graphite-ppl.h (ppl_min_for_le_polyhedron): Update declaration.
diff --git a/gcc/sese.c b/gcc/sese.c
index 545b1c6..975eb36 100644
--- a/gcc/sese.c
+++ b/gcc/sese.c
@@ -778,7 +778,7 @@ expand_scalar_variables_call (gimple stmt, basic_block bb, sese region,
    to translate the names of induction variables.  */
 
 static tree
-expand_scalar_variables_ssa_name (tree op0, basic_block bb,
+expand_scalar_variables_ssa_name (tree type, tree op0, basic_block bb,
 				  sese region, htab_t map,
 				  gimple_stmt_iterator *gsi)
 {
@@ -787,7 +787,7 @@ expand_scalar_variables_ssa_name (tree op0, basic_block bb,
 
   if (is_parameter (region, op0)
       || is_iv (op0))
-    return get_rename (map, op0);
+    return fold_convert (type, get_rename (map, op0));
 
   def_stmt = SSA_NAME_DEF_STMT (op0);
 
@@ -796,7 +796,7 @@ expand_scalar_variables_ssa_name (tree op0, basic_block bb,
 
   if (new_op != op0
       && gimple_bb (SSA_NAME_DEF_STMT (new_op)) == bb)
-    return new_op;
+    return fold_convert (type, new_op);
 
   if (gimple_bb (def_stmt) == bb)
     {
@@ -804,13 +804,13 @@ expand_scalar_variables_ssa_name (tree op0, basic_block bb,
 	 we do not need to create a new expression for it, we
 	 only need to ensure its operands are expanded.  */
       expand_scalar_variables_stmt (def_stmt, bb, region, map, gsi);
-      return new_op;
+      return fold_convert (type, new_op);
     }
   else
     {
       if (!gimple_bb (def_stmt)
 	  || !bb_in_sese_p (gimple_bb (def_stmt), region))
-	return new_op;
+	return fold_convert (type, new_op);
 
       switch (gimple_code (def_stmt))
 	{
@@ -871,7 +871,7 @@ expand_scalar_variables_expr (tree type, tree op0, enum tree_code code,
 	  {
 	    tree old_name = TREE_OPERAND (op0, 0);
 	    tree expr = expand_scalar_variables_ssa_name
-	      (old_name, bb, region, map, gsi);
+	      (type, old_name, bb, region, map, gsi);
 
 	    if (TREE_CODE (expr) != SSA_NAME
 		&& is_gimple_reg (old_name))
@@ -938,7 +938,7 @@ expand_scalar_variables_expr (tree type, tree op0, enum tree_code code,
     }
 
   if (code == SSA_NAME)
-    return expand_scalar_variables_ssa_name (op0, bb, region, map, gsi);
+    return expand_scalar_variables_ssa_name (type, op0, bb, region, map, gsi);
 
   if (code == ADDR_EXPR)
     {
-- 
1.6.3.3


[-- Attachment #9: 0008-Do-not-short-cut-code-generation-with-gloog_error.patch --]
[-- Type: text/x-diff, Size: 1584 bytes --]

From d14310f6f43a37395bd94bed693c098814ed5ad3 Mon Sep 17 00:00:00 2001
From: spop <spop@138bc75d-0d04-0410-961f-82ee72b054a4>
Date: Thu, 4 Mar 2010 12:31:43 +0000
Subject: [PATCH 08/15] Do not short-cut code generation with gloog_error.

2010-03-04  Tobias Grosser  <grosser@fim.uni-passau.de>

	* graphite-clast-to-gimple.c (translate_clast): Do not short-cut
	code generation with gloog_error.

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

diff --git a/gcc/ChangeLog.graphite b/gcc/ChangeLog.graphite
index 25e0c51..ff6533a 100644
--- a/gcc/ChangeLog.graphite
+++ b/gcc/ChangeLog.graphite
@@ -1,3 +1,8 @@
+2010-03-04  Tobias Grosser  <grosser@fim.uni-passau.de>
+
+	* graphite-clast-to-gimple.c (translate_clast): Do not short-cut
+	code generation with gloog_error.
+
 2010-03-04  Sebastian Pop  <sebastian.pop@amd.com>
 
 	* sese.c (expand_scalar_variables_ssa_name): Add new argument for type.
diff --git a/gcc/graphite-clast-to-gimple.c b/gcc/graphite-clast-to-gimple.c
index 3e82075..fd631a4 100644
--- a/gcc/graphite-clast-to-gimple.c
+++ b/gcc/graphite-clast-to-gimple.c
@@ -952,7 +952,7 @@ translate_clast (sese region, loop_p context_loop, struct clast_stmt *stmt,
 		 htab_t newivs_index, htab_t bb_pbb_mapping, int level,
 		 htab_t params_index)
 {
-  if (!stmt || gloog_error)
+  if (!stmt)
     return next_e;
 
   if (CLAST_STMT_IS_A (stmt, stmt_root))
-- 
1.6.3.3


[-- Attachment #10: 0009-Fix-type-problems-in-loop-ivs.patch --]
[-- Type: text/x-diff, Size: 9502 bytes --]

From ac92c9f41ecba26c95e7aca21e5bbc416981575e Mon Sep 17 00:00:00 2001
From: grosser <grosser@138bc75d-0d04-0410-961f-82ee72b054a4>
Date: Fri, 5 Mar 2010 14:30:16 +0000
Subject: [PATCH 09/15] Fix type problems in loop ivs.

Fix pr42644.
Fix pr42130 (dealII).

2010-03-03  Tobias Grosser  <grosser@fim.uni-passau.de>

	* gcc/graphite-clast-to-gimple.c (clast_to_gcc_expression): Also
	handle conversions from pointer to integers.
	(gcc_type_for_cloog_iv): Choose the smalles signed integer as an
	induction variable, to be able to work with code generated by
	CLooG.
	* gcc/graphite-sese-to-poly.c (scop_ivs_can_be_represented): New.
	(build_poly_scop): Bail out if we cannot codegen a loop.
	* gcc/testsuite/gcc.dg/graphite/id-18.c: New.
	* gcc/testsuite/gcc.dg/graphite/run-id-pr42644.c: New.
	* libgomp/testsuite/libgomp.graphite/force-parallel-1.c: Adjust.
	* libgomp/testsuite/libgomp.graphite/force-parallel-2.c: Adjust.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/graphite@157241 138bc75d-0d04-0410-961f-82ee72b054a4
---
 gcc/graphite-clast-to-gimple.c                     |   67 +++++++++++++++++--
 gcc/graphite-sese-to-poly.c                        |   36 +++++++++++
 gcc/testsuite/gcc.dg/graphite/id-18.c              |    7 ++
 gcc/testsuite/gcc.dg/graphite/run-id-pr42644.c     |   32 +++++++++
 .../testsuite/libgomp.graphite/force-parallel-1.c  |    2 +-
 .../testsuite/libgomp.graphite/force-parallel-2.c  |    2 +-
 6 files changed, 137 insertions(+), 9 deletions(-)
 create mode 100644 gcc/testsuite/gcc.dg/graphite/id-18.c
 create mode 100644 gcc/testsuite/gcc.dg/graphite/run-id-pr42644.c

diff --git a/gcc/graphite-clast-to-gimple.c b/gcc/graphite-clast-to-gimple.c
index fd631a4..64ddbb8 100644
--- a/gcc/graphite-clast-to-gimple.c
+++ b/gcc/graphite-clast-to-gimple.c
@@ -282,14 +282,24 @@ clast_to_gcc_expression (tree type, struct clast_expr *e,
 	      {
 		tree name = clast_name_to_gcc (t->var, region, newivs,
 					       newivs_index, params_index);
-		return fold_convert (type, name);
+
+		if (POINTER_TYPE_P (TREE_TYPE (name)) != POINTER_TYPE_P (type))
+		  name = fold_convert (sizetype, name);
+
+		name = fold_convert (type, name);
+		return name;
 	      }
 
 	    else if (value_mone_p (t->val))
 	      {
 		tree name = clast_name_to_gcc (t->var, region, newivs,
 					       newivs_index, params_index);
+
+		if (POINTER_TYPE_P (TREE_TYPE (name)) != POINTER_TYPE_P (type))
+		  name = fold_convert (sizetype, name);
+
 		name = fold_convert (type, name);
+
 		return fold_build1 (NEGATE_EXPR, type, name);
 	      }
 	    else
@@ -297,7 +307,12 @@ clast_to_gcc_expression (tree type, struct clast_expr *e,
 		tree name = clast_name_to_gcc (t->var, region, newivs,
 					       newivs_index, params_index);
 		tree cst = gmp_cst_to_tree (type, t->val);
+
+		if (POINTER_TYPE_P (TREE_TYPE (name)) != POINTER_TYPE_P (type))
+		  name = fold_convert (sizetype, name);
+
 		name = fold_convert (type, name);
+
 		if (!POINTER_TYPE_P (type))
 		  return fold_build2 (MULT_EXPR, type, cst, name);
 
@@ -532,9 +547,16 @@ clast_get_body_of_loop (struct clast_stmt *stmt)
   gcc_unreachable ();
 }
 
-/* Given a CLOOG_IV, returns the type that it should have in GCC land.
-   If the information is not available, i.e. in the case one of the
-   transforms created the loop, just return integer_type_node.  */
+/* Given a CLOOG_IV, return the type that CLOOG_IV should have in GCC
+   land.  The selected type is big enough to include the original loop
+   iteration variable, but signed to work with the subtractions CLooG
+   may have introduced.  If such a type is not available, we fail.
+
+   TODO: Do not always return long_long, but the smallest possible
+   type, that still holds the original type.
+
+   TODO: Get the types using CLooG instead.  This enables further
+   optimizations, but needs CLooG support.  */
 
 static tree
 gcc_type_for_cloog_iv (const char *cloog_iv, gimple_bb_p gbb)
@@ -546,9 +568,40 @@ gcc_type_for_cloog_iv (const char *cloog_iv, gimple_bb_p gbb)
   slot = htab_find_slot (GBB_CLOOG_IV_TYPES (gbb), &tmp, NO_INSERT);
 
   if (slot && *slot)
-    return ((ivtype_map_elt) *slot)->type;
+    {
+      tree type = ((ivtype_map_elt) *slot)->type;
+      int type_precision = TYPE_PRECISION (type);
+
+      /* Find the smallest signed type possible.  */
+      if (!TYPE_UNSIGNED (type))
+	{
+	  if (type_precision <= TYPE_PRECISION (integer_type_node))
+	    return integer_type_node;
+
+	  if (type_precision <= TYPE_PRECISION (long_integer_type_node))
+	    return long_integer_type_node;
+
+	  if (type_precision <= TYPE_PRECISION (long_long_integer_type_node))
+	    return long_long_integer_type_node;
+
+	  gcc_unreachable ();
+	}
+
+      if (type_precision < TYPE_PRECISION (integer_type_node))
+	return integer_type_node;
+
+      if (type_precision < TYPE_PRECISION (long_integer_type_node))
+	return long_integer_type_node;
+
+      if (type_precision < TYPE_PRECISION (long_long_integer_type_node))
+	return long_long_integer_type_node;
+
+      /* There is no signed type available, that is large enough to hold the
+	 original value.  */
+      gcc_unreachable ();
+    }
 
-  return integer_type_node;
+  return long_long_integer_type_node;
 }
 
 /* Returns the induction variable for the loop that gets translated to
@@ -1046,7 +1099,7 @@ compute_cloog_iv_types_1 (poly_bb_p pbb, struct clast_user_stmt *user_stmt)
       if (slot && !*slot)
 	{
 	  tree oldiv = pbb_to_depth_to_oldiv (pbb, index);
-	  tree type = oldiv ? TREE_TYPE (oldiv) : integer_type_node;
+	  tree type = TREE_TYPE (oldiv);
 	  *slot = new_ivtype_map_elt (tmp.cloog_iv, type);
 	}
     }
diff --git a/gcc/graphite-sese-to-poly.c b/gcc/graphite-sese-to-poly.c
index 3ee431f..279a905 100644
--- a/gcc/graphite-sese-to-poly.c
+++ b/gcc/graphite-sese-to-poly.c
@@ -2893,6 +2893,38 @@ scop_canonicalize_loops (scop_p scop)
       graphite_loop_normal_form (loop);
 }
 
+/* Can all ivs be represented by a signed integer?
+   As CLooG might generate negative values in its expressions, signed loop ivs
+   are required in the backend. */
+static bool
+scop_ivs_can_be_represented (scop_p scop)
+{
+  loop_iterator li;
+  loop_p loop;
+
+  FOR_EACH_LOOP (li, loop, 0)
+    {
+      tree type;
+      int precision;
+
+      if (!loop_in_sese_p (loop, SCOP_REGION (scop)))
+	continue;
+
+      if (!loop->single_iv)
+	continue;
+
+      type = TREE_TYPE(loop->single_iv);
+      precision = TYPE_PRECISION (type);
+
+      if (TYPE_UNSIGNED (type)
+	  && precision >= TYPE_PRECISION (long_long_integer_type_node))
+	return false;
+    }
+
+  return true;
+}
+
+
 /* Builds the polyhedral representation for a SESE region.  */
 
 bool
@@ -2915,6 +2947,10 @@ build_poly_scop (scop_p scop)
     return false;
 
   scop_canonicalize_loops (scop);
+
+  if (!scop_ivs_can_be_represented (scop))
+    return false;
+
   build_sese_loop_nests (region);
   build_sese_conditions (region);
   find_scop_parameters (scop);
diff --git a/gcc/testsuite/gcc.dg/graphite/id-18.c b/gcc/testsuite/gcc.dg/graphite/id-18.c
new file mode 100644
index 0000000..77628fa
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/graphite/id-18.c
@@ -0,0 +1,7 @@
+long do_hash (const char * lo, const char * hi)
+{
+	int val = 0;
+	for (; lo < hi; ++lo)
+		val = *lo;
+	return val;
+}
diff --git a/gcc/testsuite/gcc.dg/graphite/run-id-pr42644.c b/gcc/testsuite/gcc.dg/graphite/run-id-pr42644.c
new file mode 100644
index 0000000..2e90064
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/graphite/run-id-pr42644.c
@@ -0,0 +1,32 @@
+/* Testcase extracted from test 183.equake in SPEC CPU2000.  */
+double Ke[2], ds[2];
+
+void foo(double Ke[2], int i, double ds[],  int column)
+{
+  double tt, ts;
+  int j;
+
+  for (j = 0; j < 2; j++)
+    {
+      ++column;
+      ts = ds[i];
+      if (i == j)
+	tt = 123;
+      else
+	tt = 0;
+      Ke[column] = Ke[column] + ts + tt;
+    }
+}
+
+int
+main ()
+{
+  int i, j;
+
+  ds[0] = 1.0;
+  ds[1] = 1.0;
+
+  foo(Ke, 0, ds, -1);
+
+  return (int) Ke[0] != 124;
+}
diff --git a/libgomp/testsuite/libgomp.graphite/force-parallel-1.c b/libgomp/testsuite/libgomp.graphite/force-parallel-1.c
index 7f043d8..1ad4b41 100644
--- a/libgomp/testsuite/libgomp.graphite/force-parallel-1.c
+++ b/libgomp/testsuite/libgomp.graphite/force-parallel-1.c
@@ -23,7 +23,7 @@ int main(void)
 }
 
 /* Check that parallel code generation part make the right answer.  */
-/* { dg-final { scan-tree-dump-times "1 loops carried no dependency" 2 "graphite" } } */
+/* { dg-final { scan-tree-dump-times "1 loops carried no dependency" 1 "graphite" } } */
 /* { dg-final { cleanup-tree-dump "graphite" } } */
 /* { dg-final { scan-tree-dump-times "loopfn" 5 "optimized" } } */
 /* { dg-final { cleanup-tree-dump "parloops" } } */
diff --git a/libgomp/testsuite/libgomp.graphite/force-parallel-2.c b/libgomp/testsuite/libgomp.graphite/force-parallel-2.c
index 03d8236..1ce0feb 100644
--- a/libgomp/testsuite/libgomp.graphite/force-parallel-2.c
+++ b/libgomp/testsuite/libgomp.graphite/force-parallel-2.c
@@ -23,7 +23,7 @@ int main(void)
 }
 
 /* Check that parallel code generation part make the right answer.  */
-/* { dg-final { scan-tree-dump-times "2 loops carried no dependency" 2 "graphite" } } */
+/* { dg-final { scan-tree-dump-times "2 loops carried no dependency" 1 "graphite" } } */
 /* { dg-final { cleanup-tree-dump "graphite" } } */
 /* { dg-final { scan-tree-dump-times "loopfn" 5 "optimized" } } */
 /* { dg-final { cleanup-tree-dump "parloops" } } */
-- 
1.6.3.3


[-- Attachment #11: 0010-Add-forgotten-ChangeLog-entries.patch --]
[-- Type: text/x-diff, Size: 3147 bytes --]

From 7a2af21d7cdfd9935f1a2edc5697fd1753a5dec2 Mon Sep 17 00:00:00 2001
From: grosser <grosser@138bc75d-0d04-0410-961f-82ee72b054a4>
Date: Fri, 5 Mar 2010 14:51:16 +0000
Subject: [PATCH 10/15] Add forgotten ChangeLog entries.

Eric pointed out that my ChangeLog was incorrect. As I forgot to
commit it at all, here the corrected ChangeLogs for the last commit.

gcc/
2010-03-05  Tobias Grosser  <grosser@fim.uni-passau.de>
	    Ramakrishna Upadrasta <Ramakrishna.Upadrasta@inria.fr>

	* graphite-clast-to-gimple.c (clast_to_gcc_expression): Also
	handle conversions from pointer to integers.
	(gcc_type_for_cloog_iv): Choose the smalles signed integer as an
	induction variable, to be able to work with code generated by
	CLooG.
	* graphite-sese-to-poly.c (scop_ivs_can_be_represented): New.
	(build_poly_scop): Bail out if we cannot codegen a loop.

gcc/testsuite/
2010-03-05  Tobias Grosser  <grosser@fim.uni-passau.de>

	* gcc.dg/graphite/id-18.c: New.
	* gcc.dg/graphite/run-id-pr42644.c: New.

libgomp/
2010-03-05  Tobias Grosser  <grosser@fim.uni-passau.de>

	* testsuite/libgomp.graphite/force-parallel-1.c: Adjust.
	* testsuite/libgomp.graphite/force-parallel-2.c: Adjust.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/graphite@157242 138bc75d-0d04-0410-961f-82ee72b054a4
---
 gcc/ChangeLog.graphite           |   10 ++++++++++
 gcc/testsuite/ChangeLog.graphite |    5 +++++
 libgomp/ChangeLog.graphite       |    5 +++++
 3 files changed, 20 insertions(+), 0 deletions(-)
 create mode 100644 gcc/testsuite/ChangeLog.graphite

diff --git a/gcc/ChangeLog.graphite b/gcc/ChangeLog.graphite
index ff6533a..8790e87 100644
--- a/gcc/ChangeLog.graphite
+++ b/gcc/ChangeLog.graphite
@@ -1,3 +1,13 @@
+2010-03-05  Tobias Grosser  <grosser@fim.uni-passau.de>
+	    Ramakrishna Upadrasta <Ramakrishna.Upadrasta@inria.fr>
+
+	* graphite-clast-to-gimple.c (clast_to_gcc_expression): Also
+	handle conversions from pointer to integers.
+	(gcc_type_for_cloog_iv): Choose the smalles signed integer as an
+	induction variable, to be able to work with code generated by CLooG.
+	* graphite-sese-to-poly.c (scop_ivs_can_be_represented): New.
+	(build_poly_scop): Bail out if we cannot codegen a loop.
+
 2010-03-04  Tobias Grosser  <grosser@fim.uni-passau.de>
 
 	* graphite-clast-to-gimple.c (translate_clast): Do not short-cut
diff --git a/gcc/testsuite/ChangeLog.graphite b/gcc/testsuite/ChangeLog.graphite
new file mode 100644
index 0000000..3d70811
--- /dev/null
+++ b/gcc/testsuite/ChangeLog.graphite
@@ -0,0 +1,5 @@
+2010-03-05  Tobias Grosser  <grosser@fim.uni-passau.de>
+
+	* gcc.dg/graphite/id-18.c: New.
+	* gcc.dg/graphite/run-id-pr42644.c: New.
+
diff --git a/libgomp/ChangeLog.graphite b/libgomp/ChangeLog.graphite
index ee2cddb..74049a9 100644
--- a/libgomp/ChangeLog.graphite
+++ b/libgomp/ChangeLog.graphite
@@ -1,3 +1,8 @@
+2010-03-05  Tobias Grosser  <grosser@fim.uni-passau.de>
+
+	* testsuite/libgomp.graphite/force-parallel-1.c: Adjust.
+	* testsuite/libgomp.graphite/force-parallel-2.c: Adjust.
+
 2010-02-07  Sebastian Pop  <sebastian.pop@amd.com>
 
 	* testsuite/libgomp.graphite/force-parallel-5.c: Un-XFAILed.
-- 
1.6.3.3


[-- Attachment #12: 0011-Add-testcase-from-PR43065.patch --]
[-- Type: text/x-diff, Size: 1613 bytes --]

From aef3bb9b5cd9f69fc4052792f4618f4b185b69e0 Mon Sep 17 00:00:00 2001
From: spop <spop@138bc75d-0d04-0410-961f-82ee72b054a4>
Date: Fri, 5 Mar 2010 23:04:17 +0000
Subject: [PATCH 11/15] Add testcase from PR43065.

2010-03-04  Sebastian Pop  <sebastian.pop@amd.com>

	PR middle-end/43065
	* gcc.dg/graphite/run-id-3.c: New.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/graphite@157247 138bc75d-0d04-0410-961f-82ee72b054a4
---
 gcc/ChangeLog.graphite                   |    5 +++++
 gcc/testsuite/gcc.dg/graphite/run-id-3.c |   24 ++++++++++++++++++++++++
 2 files changed, 29 insertions(+), 0 deletions(-)
 create mode 100644 gcc/testsuite/gcc.dg/graphite/run-id-3.c

diff --git a/gcc/ChangeLog.graphite b/gcc/ChangeLog.graphite
index 8790e87..4d2853c 100644
--- a/gcc/ChangeLog.graphite
+++ b/gcc/ChangeLog.graphite
@@ -1,3 +1,8 @@
+2010-03-04  Sebastian Pop  <sebastian.pop@amd.com>
+
+	PR middle-end/43065
+	* gcc.dg/graphite/run-id-3.c: New.
+
 2010-03-05  Tobias Grosser  <grosser@fim.uni-passau.de>
 	    Ramakrishna Upadrasta <Ramakrishna.Upadrasta@inria.fr>
 
diff --git a/gcc/testsuite/gcc.dg/graphite/run-id-3.c b/gcc/testsuite/gcc.dg/graphite/run-id-3.c
new file mode 100644
index 0000000..e708ba0
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/graphite/run-id-3.c
@@ -0,0 +1,24 @@
+extern void abort (void);
+
+__attribute__ ((noinline)) int
+foo (int *zzz, unsigned int kk)
+{
+  int a, b, d;
+
+  a = b = 0;
+  for (d = 0; d < 1000; d++)
+    {
+      if (kk != 0)
+        b = *zzz;
+    }
+
+  return b;
+}
+
+int
+main (void)
+{
+  if (foo (0, 0) != 0)
+    abort();
+  return 0;
+}
-- 
1.6.3.3


[-- Attachment #13: 0012-Fix-PR43065-Insert-bounds-on-pointer-type-parameters.patch --]
[-- Type: text/x-diff, Size: 2983 bytes --]

From 926b0ec36b29d975ac956ac0da50050a490661e9 Mon Sep 17 00:00:00 2001
From: spop <spop@138bc75d-0d04-0410-961f-82ee72b054a4>
Date: Fri, 5 Mar 2010 23:48:43 +0000
Subject: [PATCH 12/15] Fix PR43065: Insert bounds on pointer type parameters.

2010-03-05  Sebastian Pop  <sebastian.pop@amd.com>
	    Reza Yazdani  <reza.yazdani@amd.com>

	PR middle-end/43065
	* graphite-sese-to-poly.c (add_param_constraints): Insert bounds
	on pointer type parameters.

	* gcc.dg/graphite/run-id-4.c: New.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/graphite@157248 138bc75d-0d04-0410-961f-82ee72b054a4
---
 gcc/ChangeLog.graphite                   |   11 ++++++++++-
 gcc/graphite-sese-to-poly.c              |   18 ++++++++++++------
 gcc/testsuite/gcc.dg/graphite/run-id-4.c |   28 ++++++++++++++++++++++++++++
 3 files changed, 50 insertions(+), 7 deletions(-)
 create mode 100644 gcc/testsuite/gcc.dg/graphite/run-id-4.c

diff --git a/gcc/ChangeLog.graphite b/gcc/ChangeLog.graphite
index 4d2853c..c3d8220 100644
--- a/gcc/ChangeLog.graphite
+++ b/gcc/ChangeLog.graphite
@@ -1,4 +1,13 @@
-2010-03-04  Sebastian Pop  <sebastian.pop@amd.com>
+2010-03-05  Sebastian Pop  <sebastian.pop@amd.com>
+	    Reza Yazdani  <reza.yazdani@amd.com>
+
+	PR middle-end/43065
+	* graphite-sese-to-poly.c (add_param_constraints): Insert bounds
+	on pointer type parameters.
+
+	* gcc.dg/graphite/run-id-4.c: New.
+
+2010-03-05  Sebastian Pop  <sebastian.pop@amd.com>
 
 	PR middle-end/43065
 	* gcc.dg/graphite/run-id-3.c: New.
diff --git a/gcc/graphite-sese-to-poly.c b/gcc/graphite-sese-to-poly.c
index 279a905..8933072 100644
--- a/gcc/graphite-sese-to-poly.c
+++ b/gcc/graphite-sese-to-poly.c
@@ -1499,13 +1499,19 @@ add_param_constraints (scop_p scop, ppl_Polyhedron_t context, graphite_dim_t p)
   ppl_Linear_Expression_t le;
   tree parameter = VEC_index (tree, SESE_PARAMS (SCOP_REGION (scop)), p);
   tree type = TREE_TYPE (parameter);
-  tree lb, ub;
+  tree lb = NULL_TREE;
+  tree ub = NULL_TREE;
 
-  if (!INTEGRAL_TYPE_P (type))
-    return;
-
-  lb = TYPE_MIN_VALUE (type);
-  ub = TYPE_MAX_VALUE (type);
+  if (INTEGRAL_TYPE_P (type))
+    {
+      lb = TYPE_MIN_VALUE (type);
+      ub = TYPE_MAX_VALUE (type);
+    }
+  else if (POINTER_TYPE_P (type))
+    {
+      lb = TYPE_MIN_VALUE (unsigned_type_node);
+      ub = TYPE_MAX_VALUE (unsigned_type_node);
+    }
 
   if (lb)
     {
diff --git a/gcc/testsuite/gcc.dg/graphite/run-id-4.c b/gcc/testsuite/gcc.dg/graphite/run-id-4.c
new file mode 100644
index 0000000..143a449
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/graphite/run-id-4.c
@@ -0,0 +1,28 @@
+/* PR rtl-optimization/24899 */
+
+extern void abort (void);
+
+__attribute__ ((noinline)) int
+foo (int x, int y, int *z)
+{
+  int a, b, c, d;
+
+  a = b = 0;
+  for (d = 0; d < y; d++)
+    {
+      if (z)
+	b = d * *z;
+      for (c = 0; c < x; c++)
+	a += b;
+    }
+
+  return a;
+}
+
+int
+main (void)
+{
+  if (foo (3, 2, 0) != 0)
+    abort ();
+  return 0;
+}
-- 
1.6.3.3


[-- Attachment #14: 0013-Use-sizetype-instead-of-unsigned_type_node.patch --]
[-- Type: text/x-diff, Size: 1591 bytes --]

From 4cd5894e9ce9ecfdc5ff689c03bee8331cee2b51 Mon Sep 17 00:00:00 2001
From: spop <spop@138bc75d-0d04-0410-961f-82ee72b054a4>
Date: Fri, 5 Mar 2010 23:54:14 +0000
Subject: [PATCH 13/15] Use sizetype instead of unsigned_type_node.

2010-03-05  Sebastian Pop  <sebastian.pop@amd.com>

	* graphite-sese-to-poly.c (add_param_constraints): Use sizetype
	instead of unsigned_type_node.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/graphite@157249 138bc75d-0d04-0410-961f-82ee72b054a4
---
 gcc/ChangeLog.graphite      |    5 +++++
 gcc/graphite-sese-to-poly.c |    4 ++--
 2 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/gcc/ChangeLog.graphite b/gcc/ChangeLog.graphite
index c3d8220..57176ad 100644
--- a/gcc/ChangeLog.graphite
+++ b/gcc/ChangeLog.graphite
@@ -1,4 +1,9 @@
 2010-03-05  Sebastian Pop  <sebastian.pop@amd.com>
+
+	* graphite-sese-to-poly.c (add_param_constraints): Use sizetype
+	instead of unsigned_type_node.
+
+2010-03-05  Sebastian Pop  <sebastian.pop@amd.com>
 	    Reza Yazdani  <reza.yazdani@amd.com>
 
 	PR middle-end/43065
diff --git a/gcc/graphite-sese-to-poly.c b/gcc/graphite-sese-to-poly.c
index 8933072..99d83d6 100644
--- a/gcc/graphite-sese-to-poly.c
+++ b/gcc/graphite-sese-to-poly.c
@@ -1509,8 +1509,8 @@ add_param_constraints (scop_p scop, ppl_Polyhedron_t context, graphite_dim_t p)
     }
   else if (POINTER_TYPE_P (type))
     {
-      lb = TYPE_MIN_VALUE (unsigned_type_node);
-      ub = TYPE_MAX_VALUE (unsigned_type_node);
+      lb = TYPE_MIN_VALUE (sizetype);
+      ub = TYPE_MAX_VALUE (sizetype);
     }
 
   if (lb)
-- 
1.6.3.3


[-- Attachment #15: 0014-Use-lower-upper-_bound_in_type.patch --]
[-- Type: text/x-diff, Size: 1997 bytes --]

From dc8bd59bfbc6e9bb7baf8537be6cd413f7ed6e05 Mon Sep 17 00:00:00 2001
From: spop <spop@138bc75d-0d04-0410-961f-82ee72b054a4>
Date: Sat, 6 Mar 2010 07:23:30 +0000
Subject: [PATCH 14/15] Use {lower,upper}_bound_in_type.

2010-03-05  Sebastian Pop  <sebastian.pop@amd.com>

	* graphite-sese-to-poly.c (add_param_constraints): Use
	lower_bound_in_type and upper_bound_in_type.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/graphite@157255 138bc75d-0d04-0410-961f-82ee72b054a4
---
 gcc/ChangeLog.graphite      |    5 +++++
 gcc/graphite-sese-to-poly.c |   19 +++++++++----------
 2 files changed, 14 insertions(+), 10 deletions(-)

diff --git a/gcc/ChangeLog.graphite b/gcc/ChangeLog.graphite
index 57176ad..9dcdcda 100644
--- a/gcc/ChangeLog.graphite
+++ b/gcc/ChangeLog.graphite
@@ -1,5 +1,10 @@
 2010-03-05  Sebastian Pop  <sebastian.pop@amd.com>
 
+	* graphite-sese-to-poly.c (add_param_constraints): Use
+	lower_bound_in_type and upper_bound_in_type.
+
+2010-03-05  Sebastian Pop  <sebastian.pop@amd.com>
+
 	* graphite-sese-to-poly.c (add_param_constraints): Use sizetype
 	instead of unsigned_type_node.
 
diff --git a/gcc/graphite-sese-to-poly.c b/gcc/graphite-sese-to-poly.c
index 99d83d6..11bddf8 100644
--- a/gcc/graphite-sese-to-poly.c
+++ b/gcc/graphite-sese-to-poly.c
@@ -1502,16 +1502,15 @@ add_param_constraints (scop_p scop, ppl_Polyhedron_t context, graphite_dim_t p)
   tree lb = NULL_TREE;
   tree ub = NULL_TREE;
 
-  if (INTEGRAL_TYPE_P (type))
-    {
-      lb = TYPE_MIN_VALUE (type);
-      ub = TYPE_MAX_VALUE (type);
-    }
-  else if (POINTER_TYPE_P (type))
-    {
-      lb = TYPE_MIN_VALUE (sizetype);
-      ub = TYPE_MAX_VALUE (sizetype);
-    }
+  if (POINTER_TYPE_P (type) || !TYPE_MIN_VALUE (type))
+    lb = lower_bound_in_type (type, type);
+  else
+    lb = TYPE_MIN_VALUE (type);
+
+  if (POINTER_TYPE_P (type) || !TYPE_MAX_VALUE (type))
+    ub = upper_bound_in_type (type, type);
+  else
+    ub = TYPE_MAX_VALUE (type);
 
   if (lb)
     {
-- 
1.6.3.3


[-- Attachment #16: 0015-Add-ChangeLog-entries.patch --]
[-- Type: text/x-diff, Size: 4501 bytes --]

From f3ec517e276e87858a62f5ef84fb42ec6b092feb Mon Sep 17 00:00:00 2001
From: Sebastian Pop <sebpop@gmail.com>
Date: Mon, 8 Mar 2010 11:38:36 -0600
Subject: [PATCH 15/15] Add ChangeLog entries.

---
 gcc/ChangeLog           |   74 +++++++++++++++++++++++++++++++++++++++++++++++
 gcc/testsuite/ChangeLog |   23 ++++++++++++++
 libgomp/ChangeLog       |    7 ++++
 3 files changed, 104 insertions(+), 0 deletions(-)

diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 67086f5..7eae746 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,77 @@
+2010-03-08  Sebastian Pop  <sebastian.pop@amd.com>
+
+	* graphite-sese-to-poly.c (add_param_constraints): Use
+	lower_bound_in_type and upper_bound_in_type.
+
+2010-03-08  Sebastian Pop  <sebastian.pop@amd.com>
+
+	* graphite-sese-to-poly.c (add_param_constraints): Use sizetype
+	instead of unsigned_type_node.
+
+2010-03-08  Sebastian Pop  <sebastian.pop@amd.com>
+	    Reza Yazdani  <reza.yazdani@amd.com>
+
+	PR middle-end/43065
+	* graphite-sese-to-poly.c (add_param_constraints): Insert bounds
+	on pointer type parameters.
+
+2010-03-08  Tobias Grosser  <grosser@fim.uni-passau.de>
+
+	PR middle-end/42644
+	PR middle-end/42130
+	* graphite-clast-to-gimple.c (clast_to_gcc_expression): Also
+	handle conversions from pointer to integers.
+	(gcc_type_for_cloog_iv): Choose the smalles signed integer as an
+	induction variable, to be able to work with code generated by
+	CLooG.
+	* graphite-sese-to-poly.c (scop_ivs_can_be_represented): New.
+	(build_poly_scop): Bail out if we cannot codegen a loop.
+
+2010-03-08  Tobias Grosser  <grosser@fim.uni-passau.de>
+
+	* graphite-clast-to-gimple.c (translate_clast): Do not short-cut
+	code generation with gloog_error.
+
+2010-03-08  Sebastian Pop  <sebastian.pop@amd.com>
+
+	* sese.c (expand_scalar_variables_ssa_name): Add new argument for type.
+	Call fold_convert on all the returned values.
+	(expand_scalar_variables_expr): Pass to expand_scalar_variables_ssa_name
+	the type of the resulting expression.
+
+2010-03-08  Sebastian Pop  <sebastian.pop@amd.com>
+
+	* graphite-ppl.c (ppl_min_for_le_polyhedron): Renamed
+	ppl_min_for_le_pointset.  Use ppl_Pointset_Powerset_C_Polyhedron_minimize.
+	* graphite-ppl.h (ppl_min_for_le_polyhedron): Update declaration.
+
+2010-03-08  Sebastian Pop  <sebastian.pop@amd.com>
+
+	* graphite-dependences.c (map_into_dep_poly): Removed.
+	(dependence_polyhedron_1): Use combine_context_id_scat.
+
+2010-03-08  Sebastian Pop  <sebastian.pop@amd.com>
+
+	* graphite-poly.h (struct poly_scattering): Add layout documentation.
+	(struct poly_bb): Same.
+	(combine_context_id_scat): New.
+
+2010-03-08  Sebastian Pop  <sebastian.pop@amd.com>
+
+	PR middle-end/42326
+	* sese.c (name_defined_in_loop_p): Return false for default
+	definitions.
+
+2010-03-08  Sebastian Pop  <sebastian.pop@amd.com>
+
+	* graphite-clast-to-gimple.c (find_cloog_iv_in_expr): Simplify
+	and clean up the logic.
+
+2010-03-08  Sebastian Pop  <sebastian.pop@amd.com>
+
+	* graphite-sese-to-poly.c (add_param_constraints): Enabled: remove
+	early return.
+
 2010-03-08  Jakub Jelinek  <jakub@redhat.com>
 
 	* var-tracking.c (remove_cselib_value_chains): Define only for
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index 197d695..b9ade14 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,3 +1,26 @@
+2010-03-05  Sebastian Pop  <sebastian.pop@amd.com>
+	    Reza Yazdani  <reza.yazdani@amd.com>
+
+	PR middle-end/43065
+	* gcc.dg/graphite/run-id-4.c: New.
+
+2010-03-08  Sebastian Pop  <sebastian.pop@amd.com>
+
+	PR middle-end/43065
+	* gcc.dg/graphite/run-id-3.c: New.
+
+2010-03-08  Tobias Grosser  <grosser@fim.uni-passau.de>
+
+	PR middle-end/42644
+	PR middle-end/42130
+	* gcc.dg/graphite/id-18.c: New.
+	* gcc.dg/graphite/run-id-pr42644.c: New.
+
+2010-03-08  Sebastian Pop  <sebastian.pop@amd.com>
+
+	PR middle-end/42326
+	* gcc.dg/graphite/pr42326.c: New.
+
 2010-03-08  Richard Guenther  <rguenther@suse.de>
 
 	PR tree-optimization/43269
diff --git a/libgomp/ChangeLog b/libgomp/ChangeLog
index dcd532f..420f354 100644
--- a/libgomp/ChangeLog
+++ b/libgomp/ChangeLog
@@ -1,3 +1,10 @@
+2010-03-08  Tobias Grosser  <grosser@fim.uni-passau.de>
+
+	PR middle-end/42644
+	PR middle-end/42130
+	* testsuite/libgomp.graphite/force-parallel-1.c: Adjust.
+	* testsuite/libgomp.graphite/force-parallel-2.c: Adjust.
+
 2010-01-29  Rainer Orth  <ro@CeBiTec.Uni-Bielefeld.DE>
 
 	* testsuite/libgomp.c++/task-1.C: Renamed err to e.
-- 
1.6.3.3


^ permalink raw reply	[flat|nested] 42+ messages in thread
* [patch] Merge to trunk from Graphite branch
@ 2010-02-23 13:44 Sebastian Pop
  0 siblings, 0 replies; 42+ messages in thread
From: Sebastian Pop @ 2010-02-23 13:44 UTC (permalink / raw)
  To: GCC Patches, gcc-graphite

[-- Attachment #1: Type: text/plain, Size: 137 bytes --]

Hi,

I committed to trunk the attached patches to fix 4 PRs.
These patches passed regstrap and the SPEC 2006 benchmark tests.

Sebastian

[-- Attachment #2: 0001-Fix-PR43026-handle-COMPONENT_REFs-in-expand-scalar-e.patch --]
[-- Type: text/x-diff, Size: 3143 bytes --]

From 986be805e7cad0595bd395db50681db55bfd497f Mon Sep 17 00:00:00 2001
From: spop <spop@138bc75d-0d04-0410-961f-82ee72b054a4>
Date: Mon, 22 Feb 2010 13:10:49 +0000
Subject: [PATCH 1/7] Fix PR43026: handle COMPONENT_REFs in expand scalar expressions.

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

	PR middle-end/43026
	* sese.c (expand_scalar_variables_expr): Handle COMPONENT_REF.

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

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/graphite@156956 138bc75d-0d04-0410-961f-82ee72b054a4
---
 gcc/ChangeLog.graphite                  |    7 ++++
 gcc/sese.c                              |    3 ++
 gcc/testsuite/g++.dg/graphite/pr43026.C |   51 +++++++++++++++++++++++++++++++
 3 files changed, 61 insertions(+), 0 deletions(-)
 create mode 100644 gcc/testsuite/g++.dg/graphite/pr43026.C

diff --git a/gcc/ChangeLog.graphite b/gcc/ChangeLog.graphite
index 4bb6dc2..cb969c5 100644
--- a/gcc/ChangeLog.graphite
+++ b/gcc/ChangeLog.graphite
@@ -1,5 +1,12 @@
 2010-02-11  Sebastian Pop  <sebastian.pop@amd.com>
 
+	PR middle-end/43026
+	* sese.c (expand_scalar_variables_expr): Handle COMPONENT_REF.
+
+	* g++.dg/graphite/pr43026.C: New.
+
+2010-02-11  Sebastian Pop  <sebastian.pop@amd.com>
+
 	PR middle-end/43012
 	* gcc.dg/graphite/pr43012.c: New.
 
diff --git a/gcc/sese.c b/gcc/sese.c
index 6fb4065..ebf9154 100644
--- a/gcc/sese.c
+++ b/gcc/sese.c
@@ -897,6 +897,9 @@ expand_scalar_variables_expr (tree type, tree op0, enum tree_code code,
 	    return build4 (ARRAY_REF, type, base, subscript, op02, op03);
 	  }
 
+	case COMPONENT_REF:
+	  return op0;
+
 	default:
 	  /* The above cases should catch everything.  */
 	  gcc_unreachable ();
diff --git a/gcc/testsuite/g++.dg/graphite/pr43026.C b/gcc/testsuite/g++.dg/graphite/pr43026.C
new file mode 100644
index 0000000..0e33f10
--- /dev/null
+++ b/gcc/testsuite/g++.dg/graphite/pr43026.C
@@ -0,0 +1,51 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fgraphite-identity -m32" } */
+
+template<typename Tp > class vector { };
+
+template <int rank, int dim> class Tensor;
+
+template <int dim> class Tensor<1,dim> {
+public:
+  Tensor (const Tensor<1,dim> &);
+private:
+  double values[(dim != 0) ? (dim) : 1];
+};
+
+template <int dim>
+#ifdef NOINLINE
+// declaring this noinline prevents the ICE
+__attribute__ ((noinline))
+#endif
+Tensor<1,dim>::Tensor (const Tensor<1,dim> &p)
+{
+  for (unsigned int i = 0; i < dim; ++i)
+    values[i] = p.values[i];
+}
+
+template <int rank, int dim>
+class Tensor {
+  Tensor<rank-1,dim> subtensor[dim];
+};
+
+template <int dim> class Base {
+public:
+  const unsigned int npoints;
+  const unsigned int dofs;
+  const Tensor<2,dim> &s2d (const unsigned int fno,
+                            const unsigned int pno) const;
+  void getf2d (vector<Tensor<2,dim> >& d2) const;
+};
+
+template <int dim>
+void Base<dim>:: getf2d
+  (vector<Tensor<2,dim> > &d2) const
+{
+  unsigned int point, sf;
+
+  for (point = 0; point < npoints; ++point)
+    for (sf = 0; sf < dofs; ++sf)
+      Tensor<2,dim> tmp = s2d (sf, point);
+}
+
+template void Base<3>::getf2d (vector<Tensor<2,3> > &) const;
-- 
1.6.3.3


[-- Attachment #3: 0002-Fix-PR43140-Add-Wno-conversion-null-to-pr41305.C.patch --]
[-- Type: text/x-diff, Size: 1725 bytes --]

From be0c4357df7018479c04999b2f69a14858c2ba44 Mon Sep 17 00:00:00 2001
From: spop <spop@138bc75d-0d04-0410-961f-82ee72b054a4>
Date: Mon, 22 Feb 2010 14:55:08 +0000
Subject: [PATCH 2/7] Fix PR43140: Add -Wno-conversion-null to pr41305.C.
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: 8bit

2010-02-22  Sebastian Pop  <sebastian.pop@amd.com>
	    Manuel López-Ibáñez  <manu@gcc.gnu.org>

	PR middle-end/43140
	* g++.dg/graphite/pr41305.C: Add -Wno-conversion-null.

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

diff --git a/gcc/ChangeLog.graphite b/gcc/ChangeLog.graphite
index cb969c5..56b4694 100644
--- a/gcc/ChangeLog.graphite
+++ b/gcc/ChangeLog.graphite
@@ -1,4 +1,10 @@
-2010-02-11  Sebastian Pop  <sebastian.pop@amd.com>
+2010-02-22  Sebastian Pop  <sebastian.pop@amd.com>
+	    Manuel López-Ibáñez  <manu@gcc.gnu.org>
+
+	PR middle-end/43140
+	* g++.dg/graphite/pr41305.C: Add -Wno-conversion-null.
+
+2010-02-22  Sebastian Pop  <sebastian.pop@amd.com>
 
 	PR middle-end/43026
 	* sese.c (expand_scalar_variables_expr): Handle COMPONENT_REF.
diff --git a/gcc/testsuite/g++.dg/graphite/pr41305.C b/gcc/testsuite/g++.dg/graphite/pr41305.C
index f558e7c..6a30b0e 100644
--- a/gcc/testsuite/g++.dg/graphite/pr41305.C
+++ b/gcc/testsuite/g++.dg/graphite/pr41305.C
@@ -1,5 +1,5 @@
 // { dg-do compile }
-// { dg-options "-O3 -floop-interchange" }
+// { dg-options "-O3 -floop-interchange -Wno-conversion-null" }
 
 void __throw_bad_alloc ();
 
-- 
1.6.3.3


[-- Attachment #4: 0003-Fix-PR43097-rename-only-SSA_NAMEs.patch --]
[-- Type: text/x-diff, Size: 3362 bytes --]

From 0b9a70f792614cfeb710b442663c04bc6f4b5521 Mon Sep 17 00:00:00 2001
From: spop <spop@138bc75d-0d04-0410-961f-82ee72b054a4>
Date: Mon, 22 Feb 2010 15:13:39 +0000
Subject: [PATCH 3/7] Fix PR43097: rename only SSA_NAMEs.

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

	PR middle-end/43140
	* sese.c (get_rename): Assert that old_name is an SSA_NAME.
	(rename_variables_in_stmt): Continue when the use is not an SSA_NAME.

	* gfortran.dg/graphite/pr43097.f: New.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/graphite@156964 138bc75d-0d04-0410-961f-82ee72b054a4
---
 gcc/ChangeLog.graphite                       |    8 ++++++++
 gcc/sese.c                                   |   12 +++++++++---
 gcc/testsuite/gfortran.dg/graphite/pr43097.f |   25 +++++++++++++++++++++++++
 3 files changed, 42 insertions(+), 3 deletions(-)
 create mode 100644 gcc/testsuite/gfortran.dg/graphite/pr43097.f

diff --git a/gcc/ChangeLog.graphite b/gcc/ChangeLog.graphite
index 56b4694..aae16e7 100644
--- a/gcc/ChangeLog.graphite
+++ b/gcc/ChangeLog.graphite
@@ -1,4 +1,12 @@
 2010-02-22  Sebastian Pop  <sebastian.pop@amd.com>
+
+	PR middle-end/43140
+	* sese.c (get_rename): Assert that old_name is an SSA_NAME.
+	(rename_variables_in_stmt): Continue when the use is not an SSA_NAME.
+
+	* gfortran.dg/graphite/pr43097.f: New.
+
+2010-02-22  Sebastian Pop  <sebastian.pop@amd.com>
 	    Manuel López-Ibáñez  <manu@gcc.gnu.org>
 
 	PR middle-end/43140
diff --git a/gcc/sese.c b/gcc/sese.c
index ebf9154..d7a9faa 100644
--- a/gcc/sese.c
+++ b/gcc/sese.c
@@ -494,6 +494,7 @@ get_rename (htab_t map, tree old_name)
   struct rename_map_elt_s tmp;
   PTR *slot;
 
+  gcc_assert (TREE_CODE (old_name) == SSA_NAME);
   tmp.old_name = old_name;
   slot = htab_find_slot (map, &tmp, NO_INSERT);
 
@@ -658,14 +659,19 @@ rename_variables_in_stmt (gimple stmt, htab_t map, gimple_stmt_iterator *insert_
   FOR_EACH_SSA_USE_OPERAND (use_p, stmt, iter, SSA_OP_ALL_USES)
     {
       tree use = USE_FROM_PTR (use_p);
-      tree expr = get_rename (map, use);
-      tree type_use = TREE_TYPE (use);
-      tree type_expr = TREE_TYPE (expr);
+      tree expr, type_use, type_expr;
       gimple_seq stmts;
 
+      if (TREE_CODE (use) != SSA_NAME)
+	continue;
+
+      expr = get_rename (map, use);
       if (use == expr)
 	continue;
 
+      type_use = TREE_TYPE (use);
+      type_expr = TREE_TYPE (expr);
+
       if (type_use != type_expr
 	  || (TREE_CODE (expr) != SSA_NAME
 	      && is_gimple_reg (use)))
diff --git a/gcc/testsuite/gfortran.dg/graphite/pr43097.f b/gcc/testsuite/gfortran.dg/graphite/pr43097.f
new file mode 100644
index 0000000..4ddeed8
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/graphite/pr43097.f
@@ -0,0 +1,25 @@
+! { dg-options "-O2 -fgraphite-identity" }
+
+      subroutine foo (ldmx,ldmy,nx,ny,v)
+      implicit real*8 (a-h, o-z)
+      dimension v(5,ldmx,ldmy,*)
+      dimension tmat(5,5)
+
+      k = 2
+      do j = 2, ny-1
+         do i = 2, nx-1
+            do ip = 1, 4
+               do m = ip+1, 5
+                  v(m,i,j,k) = v(m,i,j,k) * m
+               end do
+            end do
+            do m = 5, 1, -1
+               do l = m+1, 5
+                  v(m,i,j,k) = v(l,i,j,k)
+               end do
+               v(m,i,j,k) = m
+           end do
+         end do
+      end do
+      return
+      end
-- 
1.6.3.3


[-- Attachment #5: 0004-Fix-PR-number-in-the-changelog-entry.patch --]
[-- Type: text/x-diff, Size: 829 bytes --]

From 08cc5dfadeb3c8461ff132c36ef9297f7c8679be Mon Sep 17 00:00:00 2001
From: spop <spop@138bc75d-0d04-0410-961f-82ee72b054a4>
Date: Mon, 22 Feb 2010 15:17:38 +0000
Subject: [PATCH 4/7] Fix PR number in the changelog entry.

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

diff --git a/gcc/ChangeLog.graphite b/gcc/ChangeLog.graphite
index aae16e7..b3a820e 100644
--- a/gcc/ChangeLog.graphite
+++ b/gcc/ChangeLog.graphite
@@ -1,6 +1,6 @@
 2010-02-22  Sebastian Pop  <sebastian.pop@amd.com>
 
-	PR middle-end/43140
+	PR middle-end/43097
 	* sese.c (get_rename): Assert that old_name is an SSA_NAME.
 	(rename_variables_in_stmt): Continue when the use is not an SSA_NAME.
 
-- 
1.6.3.3


[-- Attachment #6: 0005-Fix-PR43083-Do-not-handle-regions-ending-with-multip.patch --]
[-- Type: text/x-diff, Size: 3946 bytes --]

From 9e199674aa67ed17bf84cb68512709d7b50a3c16 Mon Sep 17 00:00:00 2001
From: spop <spop@138bc75d-0d04-0410-961f-82ee72b054a4>
Date: Mon, 22 Feb 2010 17:40:23 +0000
Subject: [PATCH 5/7] Fix PR43083: Do not handle regions ending with multiple edges on the exit BB.

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

	PR middle-end/43083
	* graphite-scop-detection.c (create_single_exit_edge): Move
	the call to find_single_exit_edge to....
	(create_sese_edges): ...here.  Don't handle multiple edges
	exiting the function.
	(build_graphite_scops): Don't handle multiple edges
	exiting the function.

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

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/graphite@156970 138bc75d-0d04-0410-961f-82ee72b054a4
---
 gcc/ChangeLog.graphite                  |   12 ++++++++++++
 gcc/graphite-scop-detection.c           |   17 +++++++++++------
 gcc/testsuite/gcc.dg/graphite/pr43083.c |   14 ++++++++++++++
 3 files changed, 37 insertions(+), 6 deletions(-)
 create mode 100644 gcc/testsuite/gcc.dg/graphite/pr43083.c

diff --git a/gcc/ChangeLog.graphite b/gcc/ChangeLog.graphite
index b3a820e..f1e9005 100644
--- a/gcc/ChangeLog.graphite
+++ b/gcc/ChangeLog.graphite
@@ -1,5 +1,17 @@
 2010-02-22  Sebastian Pop  <sebastian.pop@amd.com>
 
+	PR middle-end/43083
+	* graphite-scop-detection.c (create_single_exit_edge): Move
+	the call to find_single_exit_edge to....
+	(create_sese_edges): ...here.  Don't handle multiple edges
+	exiting the function.
+	(build_graphite_scops): Don't handle multiple edges
+	exiting the function.
+
+	* gcc.dg/graphite/pr43083.c: New.
+
+2010-02-22  Sebastian Pop  <sebastian.pop@amd.com>
+
 	PR middle-end/43097
 	* sese.c (get_rename): Assert that old_name is an SSA_NAME.
 	(rename_variables_in_stmt): Continue when the use is not an SSA_NAME.
diff --git a/gcc/graphite-scop-detection.c b/gcc/graphite-scop-detection.c
index d89f0f8..5c1dbbd 100644
--- a/gcc/graphite-scop-detection.c
+++ b/gcc/graphite-scop-detection.c
@@ -935,9 +935,6 @@ create_single_exit_edge (sd_region *region)
   edge forwarder = NULL;
   basic_block exit;
 
-  if (find_single_exit_edge (region))
-    return;
-
   /* We create a forwarder bb (5) for all edges leaving this region
      (3->5, 4->5).  All other edges leading to the same bb, are moved
      to a new bb (6).  If these edges where part of another region (2->5)
@@ -1031,7 +1028,10 @@ create_sese_edges (VEC (sd_region, heap) *regions)
   mark_exit_edges (regions);
 
   for (i = 0; VEC_iterate (sd_region, regions, i, s); i++)
-    create_single_exit_edge (s);
+    /* Don't handle multiple edges exiting the function.  */
+    if (!find_single_exit_edge (s)
+	&& s->exit != EXIT_BLOCK_PTR)
+      create_single_exit_edge (s);
 
   unmark_exit_edges (regions);
 
@@ -1057,7 +1057,12 @@ build_graphite_scops (VEC (sd_region, heap) *regions,
     {
       edge entry = find_single_entry_edge (s);
       edge exit = find_single_exit_edge (s);
-      scop_p scop = new_scop (new_sese (entry, exit));
+      scop_p scop;
+
+      if (!exit)
+	continue;
+
+      scop = new_scop (new_sese (entry, exit));
       VEC_safe_push (scop_p, heap, *scops, scop);
 
       /* Are there overlapping SCoPs?  */
@@ -1323,7 +1328,7 @@ build_scops (VEC (scop_p, heap) **scops)
 
   canonicalize_loop_closed_ssa_form ();
   build_scops_1 (single_succ (ENTRY_BLOCK_PTR), ENTRY_BLOCK_PTR->loop_father,
-			      &regions, loop);
+		 &regions, loop);
   create_sese_edges (regions);
   build_graphite_scops (regions, scops);
 
diff --git a/gcc/testsuite/gcc.dg/graphite/pr43083.c b/gcc/testsuite/gcc.dg/graphite/pr43083.c
new file mode 100644
index 0000000..afb97af
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/graphite/pr43083.c
@@ -0,0 +1,14 @@
+/* { dg-options "-O3 -fgraphite-identity" } */
+
+extern void baz(void);
+
+static inline int bar(void)
+{
+  int i;
+  for (i = 0; i < 10; i++) baz();
+}
+
+int foo(void)
+{
+  if (bar() != 0) return 0;
+}
-- 
1.6.3.3


[-- Attachment #7: 0006-Add-missing-changelog-entry.patch --]
[-- Type: text/x-diff, Size: 689 bytes --]

From a886129a62af29ceb93581a2a2a17a52f5a5d195 Mon Sep 17 00:00:00 2001
From: Sebastian Pop <sebpop@gmail.com>
Date: Tue, 23 Feb 2010 06:49:39 -0600
Subject: [PATCH 6/7] Add missing changelog entry.

---
 gcc/ChangeLog.graphite |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/gcc/ChangeLog.graphite b/gcc/ChangeLog.graphite
index f1e9005..1771284 100644
--- a/gcc/ChangeLog.graphite
+++ b/gcc/ChangeLog.graphite
@@ -31,6 +31,10 @@
 
 	* g++.dg/graphite/pr43026.C: New.
 
+2010-02-13  Tobias Grosser  <grosser@fim.uni-passau.de>
+
+	* Merge from mainline (154736:156693).
+
 2010-02-11  Sebastian Pop  <sebastian.pop@amd.com>
 
 	PR middle-end/43012
-- 
1.6.3.3


[-- Attachment #8: 0007-Add-ChangeLog-entries.patch --]
[-- Type: text/x-diff, Size: 2048 bytes --]

From 347eebde254ee70a90487c0a6017243049fa83e6 Mon Sep 17 00:00:00 2001
From: Sebastian Pop <sebpop@gmail.com>
Date: Tue, 23 Feb 2010 06:57:24 -0600
Subject: [PATCH 7/7] Add ChangeLog entries.

---
 gcc/ChangeLog           |   21 +++++++++++++++++++++
 gcc/testsuite/ChangeLog |   21 +++++++++++++++++++++
 2 files changed, 42 insertions(+), 0 deletions(-)

diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 195d69c..d500d8e 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,24 @@
+2010-02-22  Sebastian Pop  <sebastian.pop@amd.com>
+
+	PR middle-end/43083
+	* graphite-scop-detection.c (create_single_exit_edge): Move
+	the call to find_single_exit_edge to....
+	(create_sese_edges): ...here.  Don't handle multiple edges
+	exiting the function.
+	(build_graphite_scops): Don't handle multiple edges
+	exiting the function.
+
+2010-02-22  Sebastian Pop  <sebastian.pop@amd.com>
+
+	PR middle-end/43097
+	* sese.c (get_rename): Assert that old_name is an SSA_NAME.
+	(rename_variables_in_stmt): Continue when the use is not an SSA_NAME.
+
+2010-02-22  Sebastian Pop  <sebastian.pop@amd.com>
+
+	PR middle-end/43026
+	* sese.c (expand_scalar_variables_expr): Handle COMPONENT_REF.
+
 2010-02-22  Manuel López-Ibáñez  <manu@gcc.gnu.org>
 
 	PR c++/43126
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index 7ca5442..d8bcce5 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,3 +1,24 @@
+2010-02-22  Sebastian Pop  <sebastian.pop@amd.com>
+
+	PR middle-end/43083
+	* gcc.dg/graphite/pr43083.c: New.
+
+2010-02-22  Sebastian Pop  <sebastian.pop@amd.com>
+
+	PR middle-end/43097
+	* gfortran.dg/graphite/pr43097.f: New.
+
+2010-02-22  Sebastian Pop  <sebastian.pop@amd.com>
+	    Manuel López-Ibáñez  <manu@gcc.gnu.org>
+
+	PR middle-end/43140
+	* g++.dg/graphite/pr41305.C: Add -Wno-conversion-null.
+
+2010-02-22  Sebastian Pop  <sebastian.pop@amd.com>
+
+	PR middle-end/43026
+	* g++.dg/graphite/pr43026.C: New.
+
 2010-02-22  Manuel López-Ibáñez  <manu@gcc.gnu.org>
 
 	PR c++/43126
-- 
1.6.3.3


^ permalink raw reply	[flat|nested] 42+ messages in thread

end of thread, other threads:[~2010-06-11 18:26 UTC | newest]

Thread overview: 42+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-03-15 22:12 [patch] Merge to trunk from Graphite branch Dominique Dhumieres
2010-03-16 13:32 ` Ira Rosen
2010-03-16 13:46   ` Sebastian Pop
2010-03-16 14:38     ` Ira Rosen
2010-03-16 15:32     ` Michael Matz
2010-06-11 18:53       ` Sebastian Pop
2010-03-16 18:26   ` Sebastian Pop
2010-03-16 18:59     ` Sebastian Pop
2010-03-16 19:36       ` Dominique Dhumieres
2010-03-16 20:43         ` Sebastian Pop
2010-03-16 23:03           ` Dominique Dhumieres
2010-03-17  0:23             ` Sebastian Pop
2010-03-17  4:07               ` Jack Howarth
2010-03-17  4:33             ` Jack Howarth
2010-03-16 19:49       ` Sebastian Pop
  -- strict thread matches above, loose matches on Subject: below --
2010-03-15 20:14 Dominique Dhumieres
2010-03-13 18:15 Sebastian Pop
2010-03-13 18:29 ` Toon Moene
2010-03-13 18:54   ` Jack Howarth
2010-03-13 19:01     ` Jack Howarth
2010-03-13 20:06       ` Sebastian Pop
2010-03-13 19:22   ` Sebastian Pop
2010-03-14  7:39     ` Ira Rosen
2010-03-14 15:49       ` Jack Howarth
2010-03-14 16:23         ` Ira Rosen
2010-03-14 17:04           ` Jack Howarth
2010-03-15 10:46             ` Richard Guenther
2010-03-15 13:14               ` Jack Howarth
2010-03-15 13:46                 ` Richard Guenther
2010-03-15 14:11                   ` Jack Howarth
2010-03-15 14:44                     ` Richard Guenther
2010-03-15 15:12                       ` Sebastian Pop
2010-03-15 15:22                       ` Jack Howarth
2010-03-15 15:35                         ` Richard Guenther
2010-03-15 16:27                         ` Tobias Burnus
2010-03-15 16:54                           ` Richard Guenther
2010-03-20 12:29                           ` Toon Moene
2010-03-15 17:12               ` Sebastian Pop
2010-03-15 17:52                 ` Jack Howarth
2010-03-15 18:29                   ` Sebastian Pop
2010-03-08 18:18 Sebastian Pop
2010-02-23 13:44 Sebastian Pop

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).