diff options
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; |