aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree-parloops.c
diff options
context:
space:
mode:
authorTom de Vries <tom@codesourcery.com>2014-11-13 10:51:58 +0000
committerTom de Vries <vries@gcc.gnu.org>2014-11-13 10:51:58 +0000
commit187518942c654f1d144a76a262ba8a7b904f7b9d (patch)
tree3873e81fede18285707d2a798b557f5b571b0ea0 /gcc/tree-parloops.c
parentd82f1e13053446d0b0fd8e8e3b26f5d7e579bfd7 (diff)
downloadgcc-187518942c654f1d144a76a262ba8a7b904f7b9d.zip
gcc-187518942c654f1d144a76a262ba8a7b904f7b9d.tar.gz
gcc-187518942c654f1d144a76a262ba8a7b904f7b9d.tar.bz2
Run pass_expand_omp_ssa after pass_paralellize_loops
2014-11-13 Tom de Vries <tom@codesourcery.com> * omp-low.c (pass_data_expand_omp): Set properties_provided to PROP_gimple_eomp. (pass_expand_omp::gate): Remove function. Move gate expression to ... (pass_expand_omp::execute): ... here, as new variable gate. Add early exit if gate is false. (pass_data pass_data_expand_omp_ssa): New pass_data. (class pass_expand_omp_ssa): New pass. (make_pass_expand_omp_ssa): New function. * passes.def (pass_parallelize_loops): Use PUSH_INSERT_PASSES_WITHIN instead of NEXT_PASS. (pass_expand_omp_ssa): Add after pass_parallelize_loops. * tree-parloops.c (gen_parallel_loop): Remove call to omp_expand_local. (pass_parallelize_loops::execute): Don't do cleanups TODO_cleanup_cfg and TODO_rebuild_alias yet. Add TODO_update_ssa. Set cfun->omp_expand_needed. * tree-pass.h: Add define PROP_gimple_eomp. (make_pass_expand_omp_ssa): Declare. From-SVN: r217474
Diffstat (limited to 'gcc/tree-parloops.c')
-rw-r--r--gcc/tree-parloops.c18
1 files changed, 7 insertions, 11 deletions
diff --git a/gcc/tree-parloops.c b/gcc/tree-parloops.c
index 09b3f16..e5dca78 100644
--- a/gcc/tree-parloops.c
+++ b/gcc/tree-parloops.c
@@ -1753,7 +1753,6 @@ gen_parallel_loop (struct loop *loop,
tree many_iterations_cond, type, nit;
tree arg_struct, new_arg_struct;
gimple_seq stmts;
- basic_block parallel_head;
edge entry, exit;
struct clsn_data clsn_data;
unsigned prob;
@@ -1891,8 +1890,8 @@ gen_parallel_loop (struct loop *loop,
cond_stmt = last_stmt (loop->header);
if (cond_stmt)
loc = gimple_location (cond_stmt);
- parallel_head = create_parallel_loop (loop, create_loop_fn (loc), arg_struct,
- new_arg_struct, n_threads, loc);
+ create_parallel_loop (loop, create_loop_fn (loc), arg_struct,
+ new_arg_struct, n_threads, loc);
if (reduction_list->elements () > 0)
create_call_for_reduction (loop, reduction_list, &clsn_data);
@@ -1906,13 +1905,6 @@ gen_parallel_loop (struct loop *loop,
removed statements. */
FOR_EACH_LOOP (loop, 0)
free_numbers_of_iterations_estimates_loop (loop);
-
- /* Expand the parallel constructs. We do it directly here instead of running
- a separate expand_omp pass, since it is more efficient, and less likely to
- cause troubles with further analyses not being able to deal with the
- OMP trees. */
-
- omp_expand_local (parallel_head);
}
/* Returns true when LOOP contains vector phi nodes. */
@@ -2284,7 +2276,11 @@ pass_parallelize_loops::execute (function *fun)
return 0;
if (parallelize_loops ())
- return TODO_cleanup_cfg | TODO_rebuild_alias;
+ {
+ fun->curr_properties &= ~(PROP_gimple_eomp);
+ return TODO_update_ssa;
+ }
+
return 0;
}