Commit 61d9c527 by Tom de Vries Committed by Tom de Vries

Add oacc_kernels_p argument to pass_parallelize_loops

2016-01-18  Tom de Vries  <tom@codesourcery.com>

	* omp-low.c (set_oacc_fn_attrib): Make extern.
	* omp-low.h (set_oacc_fn_attrib): Declare.
	* tree-parloops.c (struct reduction_info): Add reduc_addr field.
	(create_call_for_reduction_1): Handle case that reduc_addr is non-NULL.
	(create_parallel_loop, gen_parallel_loop, try_create_reduction_list):
	Add and handle function parameter oacc_kernels_p.
	(find_reduc_addr, get_omp_data_i_param): New function.
	(ref_conflicts_with_region, oacc_entry_exit_ok_1)
	(oacc_entry_exit_single_gang, oacc_entry_exit_ok): New function.
	(parallelize_loops): Add and handle function parameter oacc_kernels_p.
	Calculate dominance info.  Skip loops that are not in a kernels region
	in oacc_kernels_p mode.  Skip inner loops of parallelized loops.
	(pass_parallelize_loops::execute): Call parallelize_loops with
	oacc_kernels_p argument.
	(pass_parallelize_loops::clone, pass_parallelize_loops::set_pass_param):
	New member function.
	(pass_parallelize_loops::bool oacc_kernels_p): New member var.
	* passes.def: Add argument to pass_parallelize_loops instantation.

From-SVN: r232512
parent 12db0814
2016-01-18 Tom de Vries <tom@codesourcery.com> 2016-01-18 Tom de Vries <tom@codesourcery.com>
* omp-low.c (set_oacc_fn_attrib): Make extern.
* omp-low.h (set_oacc_fn_attrib): Declare.
* tree-parloops.c (struct reduction_info): Add reduc_addr field.
(create_call_for_reduction_1): Handle case that reduc_addr is non-NULL.
(create_parallel_loop, gen_parallel_loop, try_create_reduction_list):
Add and handle function parameter oacc_kernels_p.
(find_reduc_addr, get_omp_data_i_param): New function.
(ref_conflicts_with_region, oacc_entry_exit_ok_1)
(oacc_entry_exit_single_gang, oacc_entry_exit_ok): New function.
(parallelize_loops): Add and handle function parameter oacc_kernels_p.
Calculate dominance info. Skip loops that are not in a kernels region
in oacc_kernels_p mode. Skip inner loops of parallelized loops.
(pass_parallelize_loops::execute): Call parallelize_loops with
oacc_kernels_p argument.
(pass_parallelize_loops::clone, pass_parallelize_loops::set_pass_param):
New member function.
(pass_parallelize_loops::bool oacc_kernels_p): New member var.
* passes.def: Add argument to pass_parallelize_loops instantation.
2016-01-18 Tom de Vries <tom@codesourcery.com>
* tree-parloops.c (pass_parallelize_loops::execute): Allow * tree-parloops.c (pass_parallelize_loops::execute): Allow
pass_parallelize_loops to be run outside the loop pipeline. pass_parallelize_loops to be run outside the loop pipeline.
......
...@@ -12401,7 +12401,7 @@ replace_oacc_fn_attrib (tree fn, tree dims) ...@@ -12401,7 +12401,7 @@ replace_oacc_fn_attrib (tree fn, tree dims)
function attribute. Push any that are non-constant onto the ARGS function attribute. Push any that are non-constant onto the ARGS
list, along with an appropriate GOMP_LAUNCH_DIM tag. */ list, along with an appropriate GOMP_LAUNCH_DIM tag. */
static void void
set_oacc_fn_attrib (tree fn, tree clauses, vec<tree> *args) set_oacc_fn_attrib (tree fn, tree clauses, vec<tree> *args)
{ {
/* Must match GOMP_DIM ordering. */ /* Must match GOMP_DIM ordering. */
......
...@@ -33,6 +33,7 @@ extern tree omp_member_access_dummy_var (tree); ...@@ -33,6 +33,7 @@ extern tree omp_member_access_dummy_var (tree);
extern void replace_oacc_fn_attrib (tree, tree); extern void replace_oacc_fn_attrib (tree, tree);
extern tree build_oacc_routine_dims (tree); extern tree build_oacc_routine_dims (tree);
extern tree get_oacc_fn_attrib (tree); extern tree get_oacc_fn_attrib (tree);
extern void set_oacc_fn_attrib (tree, tree, vec<tree> *);
extern int get_oacc_ifn_dim_arg (const gimple *); extern int get_oacc_ifn_dim_arg (const gimple *);
extern int get_oacc_fn_dim_size (tree, int); extern int get_oacc_fn_dim_size (tree, int);
......
...@@ -272,7 +272,7 @@ along with GCC; see the file COPYING3. If not see ...@@ -272,7 +272,7 @@ along with GCC; see the file COPYING3. If not see
NEXT_PASS (pass_dce); NEXT_PASS (pass_dce);
POP_INSERT_PASSES () POP_INSERT_PASSES ()
NEXT_PASS (pass_iv_canon); NEXT_PASS (pass_iv_canon);
NEXT_PASS (pass_parallelize_loops); NEXT_PASS (pass_parallelize_loops, false /* oacc_kernels_p */);
NEXT_PASS (pass_expand_omp_ssa); NEXT_PASS (pass_expand_omp_ssa);
NEXT_PASS (pass_ch_vect); NEXT_PASS (pass_ch_vect);
NEXT_PASS (pass_if_conversion); NEXT_PASS (pass_if_conversion);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment