[multiple changes]
authorRichard Guenther <rguenther@suse.de>
Fri, 22 Jun 2012 12:29:33 +0000 (12:29 +0000)
committerRichard Biener <rguenth@gcc.gnu.org>
Fri, 22 Jun 2012 12:29:33 +0000 (12:29 +0000)
2012-06-22  Richard Guenther  <rguenther@suse.de>

Merge from graphite branch
2011-08-10  Sebastian Pop <sebpop@gmail.com>

* graphite-sese-to-poly.c (build_scop_drs): Fix memory leak.

2012-01-13  Tobias Grosser  <tobias@grosser.es>

* tree-flow.h (parallelized_function_p): Declare.
* tree-parloops.c (parallelized_function_p): Export.
* graphite.c (graphite_transform_loops): Do not run graphite on
already parallel functions.

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

From-SVN: r188885

gcc/ChangeLog
gcc/graphite-sese-to-poly.c
gcc/graphite.c
gcc/tree-flow.h
gcc/tree-parloops.c
libgomp/ChangeLog
libgomp/testsuite/libgomp.graphite/force-parallel-1.c
libgomp/testsuite/libgomp.graphite/force-parallel-2.c

index 550518cb3b63d3be6e49abc4b801bdca02faa908..4bbbbd7e742baf1a84022b15221f895afffaad0d 100644 (file)
@@ -1,3 +1,17 @@
+2012-06-22  Richard Guenther  <rguenther@suse.de>
+
+       Merge from graphite branch
+       2011-08-10  Sebastian Pop <sebpop@gmail.com>
+    
+       * graphite-sese-to-poly.c (build_scop_drs): Fix memory leak.
+
+       2012-01-13  Tobias Grosser  <tobias@grosser.es>
+
+       * tree-flow.h (parallelized_function_p): Declare.
+       * tree-parloops.c (parallelized_function_p): Export.
+       * graphite.c (graphite_transform_loops): Do not run graphite on
+       already parallel functions.
+
 2012-06-22  Alan Modra  <amodra@gmail.com>
 
        * config/rs6000/rs6000.c (rs6000_pre_atomic_barrier): Pass in and
index 555100fc5c46cde80bc43898c8e932e3092015b0..31e52181dc5648b5d0767cfcb7c69969dab2ac0b 100644 (file)
@@ -1991,6 +1991,7 @@ build_scop_drs (scop_p scop)
     if (VEC_empty (data_reference_p, GBB_DATA_REFS (PBB_BLACK_BOX (pbb))))
       {
        free_gimple_bb (PBB_BLACK_BOX (pbb));
+       free_poly_bb (pbb);
        VEC_ordered_remove (poly_bb_p, SCOP_BBS (scop), i);
        i--;
       }
index b013447443f009154512419000c64f5fe98b8355..91358c1f409e79a50beb5524f24d059b0c058bb7 100644 (file)
@@ -253,6 +253,11 @@ graphite_transform_loops (void)
   VEC (scop_p, heap) *scops = NULL;
   htab_t bb_pbb_mapping;
 
+  /* If a function is parallel it was most probably already run through graphite
+     once. No need to run again.  */
+  if (parallelized_function_p (cfun->decl))
+    return;
+
   if (!graphite_initialize ())
     return;
 
index cefc9c0f93401c34beb0a8f2cd0a996058b799cf..40935f2d8e0a578d2504e969cb7234e89a2b03b0 100644 (file)
@@ -858,6 +858,9 @@ void warn_function_noreturn (tree);
 /* In tree-ssa-ter.c  */
 bool stmt_is_replaceable_p (gimple);
 
+/* In tree-parloops.c  */
+bool parallelized_function_p (tree);
+
 #include "tree-flow-inline.h"
 
 void swap_tree_operands (gimple, tree *, tree *);
index e95bf4cd8b8812b790b1a30d732b045a3cf01eed..86036b426391ddd82ee4f889120ef49a94e4195f 100644 (file)
@@ -1394,7 +1394,7 @@ static GTY(()) bitmap parallelized_functions;
 
 /* Returns true if FN was created by create_loop_fn.  */
 
-static bool
+bool
 parallelized_function_p (tree fn)
 {
   if (!parallelized_functions || !DECL_ARTIFICIAL (fn))
index df2bfb504509a7ee7d5ef437a0eb4bee1f724388..9ec6159135fa22c87db162ab28f57a5054494bee 100644 (file)
@@ -1,3 +1,11 @@
+2012-06-22  Richard Guenther  <rguenther@suse.de>
+
+       Merge from graphite branch
+       2012-01-13  Tobias Grosser  <tobias@grosser.es>
+
+       * testsuite/libgomp.graphite/force-parallel-1.c: Adjust.
+       * testsuite/libgomp.graphite/force-parallel-2.c: Likewise.
+
 2012-06-07  Jakub Jelinek  <jakub@redhat.com>
 
        PR middle-end/53580
index d168b438823ccf54ed65e6589639b1c00002ea22..8c40e34dfc0b519a033d775dac1351c4341ebd0c 100644 (file)
@@ -24,7 +24,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" } } */
index 03d823653a7475b59ef480a1e0789926b3855062..1ce0feb250606a24c928cc0a66abbc6dc12786bc 100644 (file)
@@ -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" } } */