OSDN Git Service

2006-03-09 Andrew Pinski <pinskia@physics.uc.edu>
authorpinskia <pinskia@138bc75d-0d04-0410-961f-82ee72b054a4>
Fri, 10 Mar 2006 01:22:54 +0000 (01:22 +0000)
committerpinskia <pinskia@138bc75d-0d04-0410-961f-82ee72b054a4>
Fri, 10 Mar 2006 01:22:54 +0000 (01:22 +0000)
        * tree-ssa-phiopt.c (tree_ssa_phiopt): Add cfgchanged variable.
        Set it when one of the replacement functions returned true.
        Return TODO_cleanup_cfg if cfgchanged is true.
        (pass_phiopt) <todo_flags_finish>: Remove TODO_cleanup_cfg.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@111920 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/ChangeLog
gcc/tree-ssa-phiopt.c

index d545ac4..eeb0feb 100644 (file)
@@ -1,3 +1,10 @@
+2006-03-09  Andrew Pinski  <pinskia@physics.uc.edu>
+
+       * tree-ssa-phiopt.c (tree_ssa_phiopt): Add cfgchanged variable.
+       Set it when one of the replacement functions returned true.
+       Return TODO_cleanup_cfg if cfgchanged is true.
+       (pass_phiopt) <todo_flags_finish>: Remove TODO_cleanup_cfg.
+
 2006-03-09  Adam Nemet  <anemet@caviumnetworks.com>
 
        * combine.c (simplify_shift_const_1): Use gen_lowpart_or_truncate
 2006-03-09  Adam Nemet  <anemet@caviumnetworks.com>
 
        * combine.c (simplify_shift_const_1): Use gen_lowpart_or_truncate
index ff96065..a005991 100644 (file)
@@ -139,6 +139,7 @@ tree_ssa_phiopt (void)
   basic_block bb;
   basic_block *bb_order;
   unsigned n, i;
   basic_block bb;
   basic_block *bb_order;
   unsigned n, i;
+  bool cfgchanged = false;
 
   /* Search every basic block for COND_EXPR we may be able to optimize.
 
 
   /* Search every basic block for COND_EXPR we may be able to optimize.
 
@@ -227,17 +228,19 @@ tree_ssa_phiopt (void)
 
       /* Do the replacement of conditional if it can be done.  */
       if (conditional_replacement (bb, bb1, e1, e2, phi, arg0, arg1))
 
       /* Do the replacement of conditional if it can be done.  */
       if (conditional_replacement (bb, bb1, e1, e2, phi, arg0, arg1))
-       ;
+       cfgchanged = true;
       else if (value_replacement (bb, bb1, e1, e2, phi, arg0, arg1))
       else if (value_replacement (bb, bb1, e1, e2, phi, arg0, arg1))
-       ;
+       cfgchanged = true;
       else if (abs_replacement (bb, bb1, e1, e2, phi, arg0, arg1))
       else if (abs_replacement (bb, bb1, e1, e2, phi, arg0, arg1))
-       ;
-      else
-       minmax_replacement (bb, bb1, e1, e2, phi, arg0, arg1);
+       cfgchanged = true;
+      else if (minmax_replacement (bb, bb1, e1, e2, phi, arg0, arg1))
+       cfgchanged = true;
     }
 
   free (bb_order);
     }
 
   free (bb_order);
-  return 0;
+  
+  /* If the CFG has changed, we should cleanup the CFG. */
+  return cfgchanged ? TODO_cleanup_cfg : 0;
 }
 
 /* Returns the list of basic blocks in the function in an order that guarantees
 }
 
 /* Returns the list of basic blocks in the function in an order that guarantees
@@ -1010,8 +1013,7 @@ struct tree_opt_pass pass_phiopt =
   0,                                   /* properties_provided */
   0,                                   /* properties_destroyed */
   0,                                   /* todo_flags_start */
   0,                                   /* properties_provided */
   0,                                   /* properties_destroyed */
   0,                                   /* todo_flags_start */
-  TODO_cleanup_cfg
-    | TODO_dump_func
+  TODO_dump_func
     | TODO_ggc_collect
     | TODO_verify_ssa
     | TODO_verify_flow
     | TODO_ggc_collect
     | TODO_verify_ssa
     | TODO_verify_flow