[autovect] [patch] Make store motion use alias oracle
Dorit Nuzman
DORIT@il.ibm.com
Wed Mar 14 11:25:00 GMT 2007
Revital1 Eres/Haifa/IBM wrote on 14/03/2007 11:26:27:
> Dorit Nuzman/Haifa/IBM wrote on 14/03/2007 11:24:12:
>
> > Zdenek Dvorak <rakdver@atrey.karlin.mff.cuni.cz> wrote on
> 14/03/2007 11:18:58:
> >
> > > Hello,
> > >
> > > > Attached is the patch that fix the problem exposed in
tree-if-conv.c as
> > > > was discussed previously. It was bootstrap and tested on ppc
together
> > > > with the lim patch.
> > > >
> > > > OK for autovect?
> > >
> > > assuming that you do the required testing, this is OK for mainline as
> > > well.
> >
> > in that case, just put it in mainline, and lets synch up the branch
with
> > mainline right after that.
>
> If I understand correctly Zdenek's approval for mainline refers only to
> the ifcvt fix. Is the lim patch is OK for autovect too?
>
yes (assuming it will make it's way to mainline one day in one form or
another)
thanks,
dorit
> Thanks,
> Revital
> >
> > thanks,
> > dorit
> >
> > >
> > > Zdenek
> > >
> > > > Thanks,
> > > > Revital
> > > >
> > > > (See attached file: ifcvt_fix_patch_14_3.txt)
> > > >
> > > > 2007-03-14 Revital Eres <eres@il.ibm.com>
> > > >
> > > > * tree-if-conv.c (may_have_side_effect_p): New
> > > > function to check if stmt is if-convertible.
> > > > (if_convertible_gimple_modify_stmt_p): Call it.
> > >
> > > > Index: tree-if-conv.c
> > > > ===================================================================
> > > > --- tree-if-conv.c (revision 122880)
> > > > +++ tree-if-conv.c (working copy)
> > > > @@ -334,9 +334,38 @@
> > > > return true;
> > > > }
> > > >
> > > > +/* Return true if STMT may have certain side effects
> > > > + and thus ifcvt can not be applied. Otherwise return false. */
> > > > +static bool
> > > > +may_have_side_effect_p (tree stmt)
> > > > +{
> > > > + tree lhs, rhs;
> > > > +
> > > > + if (TREE_CODE (stmt) != GIMPLE_MODIFY_STMT)
> > > > + return true;
> > > > +
> > > > + if (stmt_ends_bb_p (stmt))
> > > > + return true;
> > > > +
> > > > + if (stmt_ann (stmt)->has_volatile_ops)
> > > > + return true;
> > > > +
> > > > + lhs = GIMPLE_STMT_OPERAND (stmt, 0);
> > > > + if (TREE_CODE (lhs) == SSA_NAME
> > > > + && SSA_NAME_OCCURS_IN_ABNORMAL_PHI (lhs))
> > > > + return true;
> > > > +
> > > > + rhs = GIMPLE_STMT_OPERAND (stmt, 1);
> > > > +
> > > > + if (TREE_SIDE_EFFECTS (rhs))
> > > > + return true;
> > > > +
> > > > + return false;
> > > > +}
> > > > +
> > > > /* Return true, if M_EXPR is if-convertible.
> > > > GIMPLE_MODIFY_STMT is not if-convertible if,
> > > > - - It is not movable.
> > > > + - It may have certain side effects.
> > > > - It could trap.
> > > > - LHS is not var decl.
> > > > GIMPLE_MODIFY_STMT is part of block BB, which is inside loop
LOOP.
> > > > @@ -352,11 +381,12 @@
> > > > print_generic_stmt (dump_file, m_expr, TDF_SLIM);
> > > > }
> > > >
> > > > - /* Be conservative and do not handle immovable expressions. */
> > > > - if (movement_possibility (m_expr) == MOVE_IMPOSSIBLE)
> > > > + /* Be conservative and do not handle expressions with
> > > > + certain side effects. */
> > > > + if (may_have_side_effect_p (m_expr))
> > > > {
> > > > if (dump_file && (dump_flags & TDF_DETAILS))
> > > > - fprintf (dump_file, "stmt is movable. Don't take risk\n");
> > > > + fprintf (dump_file, "stmt with side effects. Don't take
risk\n");
> > > > return false;
> > > > }
> > > >
> > >
More information about the Gcc-patches
mailing list