aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom de Vries <tom@codesourcery.com>2015-09-03 11:00:46 +0000
committerTom de Vries <vries@gcc.gnu.org>2015-09-03 11:00:46 +0000
commitf7f186847d9a170f1f1926e77cc4f00c7ca0b92b (patch)
tree483c896cc6a21e4a2df91c56176b36022aafd87a
parent2699123aabf1969ec4318550d5c7623a2783c5f5 (diff)
downloadgcc-f7f186847d9a170f1f1926e77cc4f00c7ca0b92b.zip
gcc-f7f186847d9a170f1f1926e77cc4f00c7ca0b92b.tar.gz
gcc-f7f186847d9a170f1f1926e77cc4f00c7ca0b92b.tar.bz2
Add param parloops-chunk-size
2015-09-03 Tom de Vries <tom@codesourcery.com> * doc/invoke.texi (parloops-chunk-size): Add item. * params.def (PARAM_PARLOOPS_CHUNK_SIZE): Add DEFPARAM. * tree-parloops.c: Include params.h. (create_parallel_loop): Set chunk-size of schedule of omp-for loop, if param parloops-chunk-size is used. From-SVN: r227434
-rw-r--r--gcc/ChangeLog8
-rw-r--r--gcc/doc/invoke.texi4
-rw-r--r--gcc/params.def5
-rw-r--r--gcc/tree-parloops.c5
4 files changed, 22 insertions, 0 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 57234e7..1d0f7a3 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,11 @@
+2015-09-03 Tom de Vries <tom@codesourcery.com>
+
+ * doc/invoke.texi (parloops-chunk-size): Add item.
+ * params.def (PARAM_PARLOOPS_CHUNK_SIZE): Add DEFPARAM.
+ * tree-parloops.c: Include params.h.
+ (create_parallel_loop): Set chunk-size of schedule of omp-for loop, if
+ param parloops-chunk-size is used.
+
2015-09-03 Naveen H.S <Naveen.Hurugalawadi@caviumnetworks.com>
PR middle-end/67351
diff --git a/gcc/doc/invoke.texi b/gcc/doc/invoke.texi
index e7bbcec..d7dc64e 100644
--- a/gcc/doc/invoke.texi
+++ b/gcc/doc/invoke.texi
@@ -11001,6 +11001,10 @@ path. The default is 10.
Maximum number of new jump thread paths to create for a finite state
automaton. The default is 50.
+@item parloops-chunk-size
+Chunk size of omp schedule for loops parallelized by parloops. The default
+is 0.
+
@end table
@end table
diff --git a/gcc/params.def b/gcc/params.def
index c8b3a90..11238cb 100644
--- a/gcc/params.def
+++ b/gcc/params.def
@@ -1135,6 +1135,11 @@ DEFPARAM (PARAM_MAX_FSM_THREAD_PATHS,
"max-fsm-thread-paths",
"Maximum number of new jump thread paths to create for a finite state automaton",
50, 1, 999999)
+
+DEFPARAM (PARAM_PARLOOPS_CHUNK_SIZE,
+ "parloops-chunk-size",
+ "Chunk size of omp schedule for loops parallelized by parloops",
+ 0, 0, 0)
/*
Local variables:
diff --git a/gcc/tree-parloops.c b/gcc/tree-parloops.c
index d017479..c164121 100644
--- a/gcc/tree-parloops.c
+++ b/gcc/tree-parloops.c
@@ -57,6 +57,7 @@ along with GCC; see the file COPYING3. If not see
#include "tree-nested.h"
#include "cgraph.h"
#include "tree-ssa.h"
+#include "params.h"
/* This pass tries to distribute iterations of loops into several threads.
The implementation is straightforward -- for each loop we test whether its
@@ -2092,6 +2093,10 @@ create_parallel_loop (struct loop *loop, tree loop_fn, tree data,
type = TREE_TYPE (cvar);
t = build_omp_clause (loc, OMP_CLAUSE_SCHEDULE);
OMP_CLAUSE_SCHEDULE_KIND (t) = OMP_CLAUSE_SCHEDULE_STATIC;
+ int chunk_size = PARAM_VALUE (PARAM_PARLOOPS_CHUNK_SIZE);
+ if (chunk_size != 0)
+ OMP_CLAUSE_SCHEDULE_CHUNK_EXPR (t)
+ = build_int_cst (integer_type_node, chunk_size);
for_stmt = gimple_build_omp_for (NULL, GF_OMP_FOR_KIND_FOR, t, 1, NULL);
gimple_set_location (for_stmt, loc);