aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree-ssa-loop.c
diff options
context:
space:
mode:
authorZdenek Dvorak <ook@ucw.cz>2007-09-15 21:53:45 +0000
committerZdenek Dvorak <ook@ucw.cz>2007-09-15 21:53:45 +0000
commit1237e1abf4a1cf742f49f024805a44b99f924aaf (patch)
treeb06c39b94a477f65f57a3ea35196956c8f6f74b1 /gcc/tree-ssa-loop.c
parent375c8e538db68c0ba7e8e943a40f5bd39d92a2be (diff)
* tree-parloops.c: New file.
* tree-ssa-operands.h (free_stmt_operands): Declare. * tree-ssa-loop-manip.c (split_loop_exit_edge): Return the new basic block. * tree-pass.h (pass_parallelize_loops): Declare. * omp-low.c (expand_omp_parallel, expand_omp_for): Update SSA form for virtual operands. (build_omp_regions_1): Allow analysing just a single OMP region and its subregions. ( build_omp_regions_root, omp_expand_local): New functions. (build_omp_regions): Add argument to build_omp_regions_1 call. * builtins.def (DEF_GOMP_BUILTIN): Initialize OMP builtins when autoparallelization is run. * timevar.def (TV_TREE_PARALLELIZE_LOOPS): New. * tree-ssa-loop.c (gate_tree_parallelize_loops, tree_parallelize_loops, pass_parallelize_loops): New. * common.opt (ftree-parallelize-loops): New. * tree-flow.h (omp_expand_local, tree_duplicate_sese_tail, parallelize_loops): Declare. (add_phi_args_after_copy, split_loop_exit_edge): Declaration changed. * Makefile.in (tree-parloops.o): Added. * tree-cfg.c (add_phi_args_after_copy_edge, tree_duplicate_sese_tail): New functions. (add_phi_args_after_copy_bb): Use add_phi_args_after_copy_edge. (add_phi_args_after_copy): Call add_phi_args_after_copy_edge for one extra edge as well. (tree_duplicate_sese_region): Add argument to add_phi_args_after_copy. Use VEC_free to free doms vector. (move_block_to_fn): Update loop info. Remove phi nodes for virtual operands. Recompute operand caches in the new function. (move_sese_region_to_fn): Update loop info. * passes.c (init_optimization_passes): Add pass_parallelize_loops. * tree-ssa-operands.c (free_stmt_operands): New function. * doc/passes.texi: Document autoparallelization. * doc/invoke.texi (-ftree-parallelize-loops): New option. * gcc.dg/tree-ssa/parallelization-1.c: New test. git-svn-id: https://gcc.gnu.org/svn/gcc/trunk@128517 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/tree-ssa-loop.c')
-rw-r--r--gcc/tree-ssa-loop.c36
1 files changed, 36 insertions, 0 deletions
diff --git a/gcc/tree-ssa-loop.c b/gcc/tree-ssa-loop.c
index aed2a4dcc8a..240058a739e 100644
--- a/gcc/tree-ssa-loop.c
+++ b/gcc/tree-ssa-loop.c
@@ -468,6 +468,42 @@ struct tree_opt_pass pass_complete_unroll =
0 /* letter */
};
+/* Parallelization. */
+
+static bool
+gate_tree_parallelize_loops (void)
+{
+ return flag_tree_parallelize_loops != 1;
+}
+
+static unsigned
+tree_parallelize_loops (void)
+{
+ if (number_of_loops () <= 1)
+ return 0;
+
+ if (parallelize_loops ())
+ return TODO_cleanup_cfg | TODO_rebuild_alias;
+ return 0;
+}
+
+struct tree_opt_pass pass_parallelize_loops =
+{
+ "parloops", /* name */
+ gate_tree_parallelize_loops, /* gate */
+ tree_parallelize_loops, /* execute */
+ NULL, /* sub */
+ NULL, /* next */
+ 0, /* static_pass_number */
+ TV_TREE_PARALLELIZE_LOOPS, /* tv_id */
+ PROP_cfg | PROP_ssa, /* properties_required */
+ 0, /* properties_provided */
+ 0, /* properties_destroyed */
+ 0, /* todo_flags_start */
+ TODO_dump_func | TODO_verify_loops, /* todo_flags_finish */
+ 0 /* letter */
+};
+
/* Prefetching. */
static unsigned int