This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [autovect] [patch] Make store motion use alias oracle



gcc-patches-owner@gcc.gnu.org wrote on 14/03/2007 16:26:57:

> Revital1 Eres <ERES@il.ibm.com> writes:
>
> > +/* 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)
>
> Can you give this function a different name?  It does not seem to test
> for whether the statement may have side effects: e.g., statements do
> not have side effects merely because they are at the end of a basic
> block.  The function seems to test for some other property and I think
> it would be clearer if it had some other name.
>

In that case maybe it will be more appropriate to cancel
the function and insert all those constrains to the caller
if_convertible_gimple_modify_stmt_p ()

Revital

Index: tree-if-conv.c
===================================================================
--- tree-if-conv.c      (revision 122880)
+++ tree-if-conv.c      (working copy)
@@ -346,17 +346,28 @@
 if_convertible_gimple_modify_stmt_p (struct loop *loop, basic_block bb,
                                     tree m_expr)
 {
+  tree lhs, rhs;
+
   if (dump_file && (dump_flags & TDF_DETAILS))
     {
       fprintf (dump_file, "-------------------------\n");
       print_generic_stmt (dump_file, m_expr, TDF_SLIM);
     }

-  /* Be conservative and do not handle immovable expressions.  */
-  if (movement_possibility (m_expr) == MOVE_IMPOSSIBLE)
+ if (TREE_CODE (stmt) != GIMPLE_MODIFY_STMT)
+    return false;
+
+  lhs = GIMPLE_STMT_OPERAND (stmt, 0);
+  rhs = GIMPLE_STMT_OPERAND (stmt, 1);
+
+  /* Some of these constrains might be too conservative.  */
+  if (stmt_ends_bb_p (stmt) || stmt_ann (stmt)->has_volatile_ops
+      || (TREE_CODE (lhs) == SSA_NAME
+          && SSA_NAME_OCCURS_IN_ABNORMAL_PHI (lhs))
+      || TREE_SIDE_EFFECTS (rhs))
     {
       if (dump_file && (dump_flags & TDF_DETAILS))
-       fprintf (dump_file, "stmt is movable. Don't take risk\n");
+        fprintf (dump_file, "stmt not suitable for ifcvt\n");
       return false;
     }


> Thanks.
>
> Ian


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]