summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorrguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4>2012-06-22 12:29:33 +0000
committerrguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4>2012-06-22 12:29:33 +0000
commit479a6d791640a3d9a94e4c126df1a52a57703f11 (patch)
treec3219bcca178f5d132ff02ba16435f89fac9c6c1
parent45565b9d475c5868c3a5378b8e853ae2de741d93 (diff)
downloadgcc-479a6d791640a3d9a94e4c126df1a52a57703f11.tar.gz
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. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@188885 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r--gcc/ChangeLog14
-rw-r--r--gcc/graphite-sese-to-poly.c1
-rw-r--r--gcc/graphite.c5
-rw-r--r--gcc/tree-flow.h3
-rw-r--r--gcc/tree-parloops.c2
-rw-r--r--libgomp/ChangeLog8
-rw-r--r--libgomp/testsuite/libgomp.graphite/force-parallel-1.c2
-rw-r--r--libgomp/testsuite/libgomp.graphite/force-parallel-2.c2
8 files changed, 34 insertions, 3 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 550518cb3b6..4bbbbd7e742 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -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
diff --git a/gcc/graphite-sese-to-poly.c b/gcc/graphite-sese-to-poly.c
index 555100fc5c4..31e52181dc5 100644
--- a/gcc/graphite-sese-to-poly.c
+++ b/gcc/graphite-sese-to-poly.c
@@ -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--;
}
diff --git a/gcc/graphite.c b/gcc/graphite.c
index b013447443f..91358c1f409 100644
--- a/gcc/graphite.c
+++ b/gcc/graphite.c
@@ -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;
diff --git a/gcc/tree-flow.h b/gcc/tree-flow.h
index cefc9c0f934..40935f2d8e0 100644
--- a/gcc/tree-flow.h
+++ b/gcc/tree-flow.h
@@ -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 *);
diff --git a/gcc/tree-parloops.c b/gcc/tree-parloops.c
index e95bf4cd8b8..86036b42639 100644
--- a/gcc/tree-parloops.c
+++ b/gcc/tree-parloops.c
@@ -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))
diff --git a/libgomp/ChangeLog b/libgomp/ChangeLog
index df2bfb50450..9ec6159135f 100644
--- a/libgomp/ChangeLog
+++ b/libgomp/ChangeLog
@@ -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
diff --git a/libgomp/testsuite/libgomp.graphite/force-parallel-1.c b/libgomp/testsuite/libgomp.graphite/force-parallel-1.c
index d168b438823..8c40e34dfc0 100644
--- a/libgomp/testsuite/libgomp.graphite/force-parallel-1.c
+++ b/libgomp/testsuite/libgomp.graphite/force-parallel-1.c
@@ -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" } } */
diff --git a/libgomp/testsuite/libgomp.graphite/force-parallel-2.c b/libgomp/testsuite/libgomp.graphite/force-parallel-2.c
index 03d823653a7..1ce0feb2506 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" } } */