Commit d95167ee by Tom de Vries Committed by Tom de Vries

Don't allow latch with phi in try_transform_to_exit_first_loop_alt

2016-01-11  Tom de Vries  <tom@codesourcery.com>

	PR tree-optimization/69109
	* tree-parloops.c (try_transform_to_exit_first_loop_alt): Don't allow
	latch with phi.

	* gcc.dg/autopar/pr69109-2.c: New test.
	* gcc.dg/autopar/pr69109.c: New test.

From-SVN: r232212
parent 4f6403a8
2016-01-11 Tom de Vries <tom@codesourcery.com> 2016-01-11 Tom de Vries <tom@codesourcery.com>
PR tree-optimization/69109
* tree-parloops.c (try_transform_to_exit_first_loop_alt): Don't allow
latch with phi.
2016-01-11 Tom de Vries <tom@codesourcery.com>
PR tree-optimization/69108 PR tree-optimization/69108
* tree-parloops.c (gather_scalar_reductions): Handle case that outer phi * tree-parloops.c (gather_scalar_reductions): Handle case that outer phi
res is not used in a phi. res is not used in a phi.
......
2016-01-11 Tom de Vries <tom@codesourcery.com> 2016-01-11 Tom de Vries <tom@codesourcery.com>
PR tree-optimization/69109
* gcc.dg/autopar/pr69109-2.c: New test.
* gcc.dg/autopar/pr69109.c: New test.
2016-01-11 Tom de Vries <tom@codesourcery.com>
PR tree-optimization/69108 PR tree-optimization/69108
* gcc.dg/autopar/pr69108.c: New test. * gcc.dg/autopar/pr69108.c: New test.
......
/* { dg-do compile } */
/* { dg-options "-O2 -ftree-parallelize-loops=2 -funswitch-loops" } */
#include "../../gcc.c-torture/compile/pr32399.c"
/* { dg-do compile } */
/* { dg-options "-O2 -ftree-parallelize-loops=2 -funswitch-loops" } */
#include "../vect/unswitch-loops-pr26969.c"
...@@ -1769,6 +1769,10 @@ try_transform_to_exit_first_loop_alt (struct loop *loop, ...@@ -1769,6 +1769,10 @@ try_transform_to_exit_first_loop_alt (struct loop *loop,
if (!gimple_seq_nondebug_singleton_p (bb_seq (loop->latch))) if (!gimple_seq_nondebug_singleton_p (bb_seq (loop->latch)))
return false; return false;
/* Check whether the latch contains no phis. */
if (phi_nodes (loop->latch) != NULL)
return false;
/* Check whether the latch contains the loop iv increment. */ /* Check whether the latch contains the loop iv increment. */
edge back = single_succ_edge (loop->latch); edge back = single_succ_edge (loop->latch);
edge exit = single_dom_exit (loop); edge exit = single_dom_exit (loop);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment