+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.
+
2008-05-20 Jan Sjodin <jan.sjodin@amd.com>
Sebastian Pop <sebastian.pop@amd.com>
+2008-05-20 Jan Sjodin <jan.sjodin@amd.com>
+ Sebastian Pop <sebastian.pop@amd.com>
+
+ PR tree-optimization/36181
+ * gcc.dg/tree-ssa/pr36181.c: New.
+
2008-05-20 Uros Bizjak <ubizjak@gmail.com>
PR testsuite/36057
--- /dev/null
+/* { dg-do compile } */
+/* { dg-options "-O3 -ftree-parallelize-loops=2" } */
+
+int foo ()
+{
+ int i, sum = 0, data[1024];
+
+ for(i = 0; i<1024; i++)
+ sum += data[i];
+
+ return sum;
+}
+
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. */
/* 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;