[PATCH] Fix PR44676: fix invariant phi node removal.
Richard Guenther
rguenther@suse.de
Tue Dec 7 12:30:00 GMT 2010
On Mon, 6 Dec 2010, Sebastian Pop wrote:
> On Mon, Dec 6, 2010 at 14:18, Sebastian Pop <sebpop@gmail.com> wrote:
> > Hi,
> >
> > This backports the change from trunk that fixed PR44676. Â I am
> > regstrapping this fix on amd64-linux. Â Ok for the 4.5 branch?
> >
>
> This patch passed bootstrap and test on amd64-linux.
Ok.
Thanks,
Richard.
> > Thanks,
> > Sebastian
> >
> > Backport from trunk
> > http://gcc.gnu.org/viewcvs?view=revision&revision=163105
> >
> > 2010-05-07  Sebastian Pop  <sebastian.pop@amd.com>
> >
> > Â Â Â Â Backport from mainline:
> >     2010-05-07  Sebastian Pop  <sebastian.pop@amd.com>
> >
> > Â Â Â Â PR tree-optimization/44676
> > Â Â Â Â * graphite-sese-to-poly.c (loop_entry_phi_arg): Renamed
> > Â Â Â Â phi_arg_in_outermost_loop.
> > Â Â Â Â (remove_simple_copy_phi): Call phi_arg_in_outermost_loop.
> > Â Â Â Â (remove_invariant_phi): Same.
> > ---
> >  gcc/ChangeLog        |  11 +++++++++++
> > Â gcc/graphite-sese-to-poly.c | Â 20 +++++++++++---------
> > Â 2 files changed, 22 insertions(+), 9 deletions(-)
> >
> > diff --git a/gcc/ChangeLog b/gcc/ChangeLog
> > index 4d52ec8..5d5fd6b 100644
> > --- a/gcc/ChangeLog
> > +++ b/gcc/ChangeLog
> > @@ -1,3 +1,14 @@
> > +2010-12-06  Sebastian Pop  <sebastian.pop@amd.com>
> > +
> > + Â Â Â Backport from mainline:
> > +    2010-05-07  Sebastian Pop  <sebastian.pop@amd.com>
> > +
> > + Â Â Â PR tree-optimization/44676
> > + Â Â Â * graphite-sese-to-poly.c (loop_entry_phi_arg): Renamed
> > + Â Â Â phi_arg_in_outermost_loop.
> > + Â Â Â (remove_simple_copy_phi): Call phi_arg_in_outermost_loop.
> > + Â Â Â (remove_invariant_phi): Same.
> > +
> >  2010-12-06  Rainer Orth  <ro@CeBiTec.Uni-Bielefeld.DE>
> >
> > Â Â Â Â Backport from mainline:
> > diff --git a/gcc/graphite-sese-to-poly.c b/gcc/graphite-sese-to-poly.c
> > index b8f332a..fc28480 100644
> > --- a/gcc/graphite-sese-to-poly.c
> > +++ b/gcc/graphite-sese-to-poly.c
> > @@ -73,21 +73,23 @@ var_used_in_not_loop_header_phi_node (tree var)
> > Â return result;
> > Â }
> >
> > -/* Returns the index of the phi argument corresponding to the initial
> > - Â value in the loop. Â */
> > +/* Returns the index of the PHI argument defined in the outermost
> > + Â loop. Â */
> >
> > Â static size_t
> > -loop_entry_phi_arg (gimple phi)
> > +phi_arg_in_outermost_loop (gimple phi)
> > Â {
> > Â loop_p loop = gimple_bb (phi)->loop_father;
> > - Â size_t i;
> > + Â size_t i, res = 0;
> >
> > Â for (i = 0; i < gimple_phi_num_args (phi); i++)
> > Â Â if (!flow_bb_inside_loop_p (loop, gimple_phi_arg_edge (phi, i)->src))
> > - Â Â Â return i;
> > + Â Â Â {
> > + Â Â Â loop = gimple_phi_arg_edge (phi, i)->src->loop_father;
> > + Â Â Â res = i;
> > + Â Â Â }
> >
> > - Â gcc_unreachable ();
> > - Â return 0;
> > + Â return res;
> > Â }
> >
> > Â /* Removes a simple copy phi node "RES = phi (INIT, RES)" at position
> > @@ -98,7 +100,7 @@ remove_simple_copy_phi (gimple_stmt_iterator *psi)
> > Â {
> > Â gimple phi = gsi_stmt (*psi);
> > Â tree res = gimple_phi_result (phi);
> > - Â size_t entry = loop_entry_phi_arg (phi);
> > + Â size_t entry = phi_arg_in_outermost_loop (phi);
> > Â tree init = gimple_phi_arg_def (phi, entry);
> > Â gimple stmt = gimple_build_assign (res, init);
> > Â edge e = gimple_phi_arg_edge (phi, entry);
> > @@ -118,7 +120,7 @@ remove_invariant_phi (sese region, gimple_stmt_iterator *psi)
> > Â loop_p loop = loop_containing_stmt (phi);
> > Â tree res = gimple_phi_result (phi);
> > Â tree scev = scalar_evolution_in_region (region, loop, res);
> > - Â size_t entry = loop_entry_phi_arg (phi);
> > + Â size_t entry = phi_arg_in_outermost_loop (phi);
> > Â edge e = gimple_phi_arg_edge (phi, entry);
> > Â tree var;
> > Â gimple stmt;
> > --
> > 1.7.1
> >
> >
>
>
--
Richard Guenther <rguenther@suse.de>
Novell / SUSE Labs
SUSE LINUX Products GmbH - Nuernberg - AG Nuernberg - HRB 16746 - GF: Markus Rex
More information about the Gcc-patches
mailing list