diff options
author | Sebastian Pop <sebastian.pop@amd.com> | 2008-01-16 02:44:04 +0000 |
---|---|---|
committer | Sebastian Pop <spop@gcc.gnu.org> | 2008-01-16 02:44:04 +0000 |
commit | 1d4af1e827fad674218523d2e91c6aed1f5729c4 (patch) | |
tree | fcbdd6bf910f9bbcdd7e090cf671cb1963ae6c39 /gcc | |
parent | 8c87e2452fbb98d147135995ca3a05ab851e2789 (diff) | |
download | gcc-1d4af1e827fad674218523d2e91c6aed1f5729c4.zip gcc-1d4af1e827fad674218523d2e91c6aed1f5729c4.tar.gz gcc-1d4af1e827fad674218523d2e91c6aed1f5729c4.tar.bz2 |
tree-parloops.c (loop_has_blocks_with_irreducible_flag): New.
2008-01-12 Sebastian Pop <sebastian.pop@amd.com>
* tree-parloops.c (loop_has_blocks_with_irreducible_flag): New.
(parallelize_loops): Don't parallelize irreducible components.
From-SVN: r131561
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/tree-parloops.c | 21 |
2 files changed, 26 insertions, 0 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 676637f..b8c9e96 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +2008-01-12 Sebastian Pop <sebastian.pop@amd.com> + + * tree-parloops.c (loop_has_blocks_with_irreducible_flag): New. + (parallelize_loops): Don't parallelize irreducible components. + 2008-01-14 Manuel Lopez-Ibanez <manu@gcc.gnu.org> PR c++/24924 diff --git a/gcc/tree-parloops.c b/gcc/tree-parloops.c index a6484b5..3b3176c 100644 --- a/gcc/tree-parloops.c +++ b/gcc/tree-parloops.c @@ -431,6 +431,26 @@ loop_parallel_p (struct loop *loop, htab_t reduction_list, struct tree_niter_des return ret; } +/* Return true when LOOP contains basic blocks marked with the + BB_IRREDUCIBLE_LOOP flag. */ + +static inline bool +loop_has_blocks_with_irreducible_flag (struct loop *loop) +{ + unsigned i; + basic_block *bbs = get_loop_body_in_dom_order (loop); + bool res = true; + + for (i = 0; i < loop->num_nodes; i++) + if (bbs[i]->flags & BB_IRREDUCIBLE_LOOP) + goto end; + + res = false; + end: + free (bbs); + return res; +} + /* Assigns the address of OBJ in TYPE to an ssa name, and returns this name. The assignment statement is placed before LOOP. DECL_ADDRESS maps decls to their addresses that can be reused. The address of OBJ is known to @@ -1741,6 +1761,7 @@ parallelize_loops (void) || expected_loop_iterations (loop) <= n_threads /* And of course, the loop must be parallelizable. */ || !can_duplicate_loop_p (loop) + || loop_has_blocks_with_irreducible_flag (loop) || !loop_parallel_p (loop, reduction_list, &niter_desc)) continue; |