[patch] Fix PR43464: update loop closed SSA form once copy prop is done

Sebastian Pop sebpop@gmail.com
Thu Apr 1 19:18:00 GMT 2010


On Wed, Mar 31, 2010 at 06:28, Michael Matz <matz@suse.de> wrote:
> At least graphite-sese-to-poly.c, lambda-code.c and possibly
> tree-ssa-pre.c would need something similar.

For lambda-code.c, I do not see something wrong with that code:
it won't handle all the cases, and it fails safely when it does not
handle loop close phi nodes with more than an argument.

In can_convert_to_perfect_nest we have:

    if (gimple_phi_num_args (gsi_stmt (si)) != 1)
      goto fail;

Then the other use of this "one arg phi node" assumption is in

/* Return true if STMT is an exit PHI for LOOP */

static bool
exit_phi_for_loop_p (struct loop *loop, gimple stmt)
{
  if (gimple_code (stmt) != GIMPLE_PHI
      || gimple_phi_num_args (stmt) != 1
      || gimple_bb (stmt) != single_exit (loop)->dest)
    return false;

  return true;
}

That is called from can_put_in_inner_loop and from
can_put_after_inner_loop.

These are both called from cannot_convert_bb_to_perfect_nest
that would fail safely: not handling the loop when it is considered
too difficult, i.e. loops with loop close phis with more than one
argument won't be transformed.

Sebastian



More information about the Gcc-patches mailing list