+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
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
|| 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;