invalidate the information about irreducible regions. */
static bool
-fix_loop_placement (class loop *loop, bool *irred_invalidated)
+fix_loop_placement (class loop *loop, bool *irred_invalidated,
+ bitmap loop_closed_ssa_invalidated)
{
unsigned i;
edge e;
if (e->flags & EDGE_IRREDUCIBLE_LOOP)
*irred_invalidated = true;
rescan_loop_exit (e, false, false);
+ /* Any LC SSA PHIs on e->dest might now be on the wrong edge
+ if their defs were in a former outer loop. */
+ if (loop_closed_ssa_invalidated)
+ bitmap_set_bit (loop_closed_ssa_invalidated, e->src->index);
}
ret = true;
if (from->loop_father->header == from)
{
/* Subloop header, maybe move the loop upward. */
- if (!fix_loop_placement (from->loop_father, irred_invalidated))
+ if (!fix_loop_placement (from->loop_father, irred_invalidated,
+ loop_closed_ssa_invalidated))
continue;
target_loop = loop_outer (from->loop_father);
if (loop_closed_ssa_invalidated)
while (loop_outer (loop))
{
outer = loop_outer (loop);
- if (!fix_loop_placement (loop, irred_invalidated))
+ if (!fix_loop_placement (loop, irred_invalidated,
+ loop_closed_ssa_invalidated))
break;
/* Changing the placement of a loop in the loop tree may alter the