This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [patch][graphite] Rewrite of "out of graphite"


On Wed, Dec 3, 2008 at 1:33 PM, Sebastian Pop <sebpop@gmail.com> wrote:
> There are still 3 bugs left for building polyhedron benchmarks:
> id-{2,3,4}.f90.  I'm working on id-4.f90, Tobias and Dwarak are going
> to work on id-3.f90 that is a fail in the scop detection: sd_region.
>

Here is the fix for id-4.f90.  Committed to graphite branch, waiting for review
to commit to trunk.

Sebastian Pop
--
AMD - GNU Tools
2008-12-03  Sebastian Pop  <sebastian.pop@amd.com>

	Fix testsuite/gfortran.dg/graphite/id-4.f90.
	* graphite.c (scan_tree_for_params): Do not compute the multiplicand
	when not needed.

Index: graphite.c
===================================================================
--- graphite.c	(revision 142403)
+++ graphite.c	(working copy)
@@ -2324,26 +2324,28 @@ scan_tree_for_params (scop_p s, tree e, 
     case MULT_EXPR:
       if (chrec_contains_symbols (TREE_OPERAND (e, 0)))
 	{
-	  Value val;
-
-	  gcc_assert (host_integerp (TREE_OPERAND (e, 1), 0));
-
-	  value_init (val);
-	  value_set_si (val, int_cst_value (TREE_OPERAND (e, 1)));
-	  value_multiply (k, k, val);
-	  value_clear (val);
+	  if (c)
+	    {
+	      Value val;
+	      gcc_assert (host_integerp (TREE_OPERAND (e, 1), 0));
+	      value_init (val);
+	      value_set_si (val, int_cst_value (TREE_OPERAND (e, 1)));
+	      value_multiply (k, k, val);
+	      value_clear (val);
+	    }
 	  scan_tree_for_params (s, TREE_OPERAND (e, 0), c, r, k, subtract);
 	}
       else
 	{
-	  Value val;
-
-	  gcc_assert (host_integerp (TREE_OPERAND (e, 0), 0));
-
-	  value_init (val);
-	  value_set_si (val, int_cst_value (TREE_OPERAND (e, 0)));
-	  value_multiply (k, k, val);
-	  value_clear (val);
+	  if (c)
+	    {
+	      Value val;
+	      gcc_assert (host_integerp (TREE_OPERAND (e, 0), 0));
+	      value_init (val);
+	      value_set_si (val, int_cst_value (TREE_OPERAND (e, 0)));
+	      value_multiply (k, k, val);
+	      value_clear (val);
+	    }
 	  scan_tree_for_params (s, TREE_OPERAND (e, 1), c, r, k, subtract);
 	}
       break;

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