diff options
author | spop <spop@138bc75d-0d04-0410-961f-82ee72b054a4> | 2008-05-20 19:17:12 +0000 |
---|---|---|
committer | spop <spop@138bc75d-0d04-0410-961f-82ee72b054a4> | 2008-05-20 19:17:12 +0000 |
commit | c968a07c40114726a8bde1eca6cdc43e4696009d (patch) | |
tree | cf4a0fe3e80a3306003282e6187090dd233f10c8 /gcc/tree-parloops.c | |
parent | b79b3386e82cd23eb4b0dd4951b7d813c0f33b94 (diff) | |
download | gcc-c968a07c40114726a8bde1eca6cdc43e4696009d.tar.gz |
2008-05-20 Sebastian Pop <sebastian.pop@amd.com>
Jan Sjodin <jan.sjodin@amd.com>
PR tree-optimization/36181
* tree-parloops.c (loop_has_vector_phi_nodes): New.
(parallelize_loops): Don't parallelize when the loop has vector
phi nodes.
* gcc.dg/tree-ssa/pr36181.c: New.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@135673 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/tree-parloops.c')
-rw-r--r-- | gcc/tree-parloops.c | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/gcc/tree-parloops.c b/gcc/tree-parloops.c index de4f3065a52..109e3058921 100644 --- a/gcc/tree-parloops.c +++ b/gcc/tree-parloops.c @@ -1797,6 +1797,27 @@ gen_parallel_loop (struct loop *loop, htab_t reduction_list, omp_expand_local (parallel_head); } +/* Returns true when LOOP contains vector phi nodes. */ + +static bool +loop_has_vector_phi_nodes (struct loop *loop) +{ + unsigned i; + basic_block *bbs = get_loop_body_in_dom_order (loop); + bool res = true; + tree phi; + + for (i = 0; i < loop->num_nodes; i++) + for (phi = phi_nodes (bbs[i]); phi; phi = PHI_CHAIN (phi)) + if (TREE_CODE (TREE_TYPE (PHI_RESULT (phi))) == VECTOR_TYPE) + goto end; + + res = false; + end: + free (bbs); + return res; +} + /* Detect parallel loops and generate parallel code using libgomp primitives. Returns true if some loop was parallelized, false otherwise. */ @@ -1828,6 +1849,8 @@ parallelize_loops (void) /* And of course, the loop must be parallelizable. */ || !can_duplicate_loop_p (loop) || loop_has_blocks_with_irreducible_flag (loop) + /* FIXME: the check for vector phi nodes could be removed. */ + || loop_has_vector_phi_nodes (loop) || !loop_parallel_p (loop, reduction_list, &niter_desc)) continue; |