tree-ssa-propagate.h (substitute_and_fold): Adjust prototype.
authorRichard Biener <rguenther@suse.de>
Tue, 18 Oct 2016 07:49:32 +0000 (07:49 +0000)
committerRichard Biener <rguenth@gcc.gnu.org>
Tue, 18 Oct 2016 07:49:32 +0000 (07:49 +0000)
2016-10-18  Richard Biener  <rguenther@suse.de>

* tree-ssa-propagate.h (substitute_and_fold): Adjust prototype.
* tree-ssa-propagate.c (ssa_prop_fini): Remove final BB_VISITED
clearing.
(substitute_and_fold_dom_walker): Adjust constructor.
(substitute_and_fold_dom_walker::before_dom_children): Remove
do_dce flag and handling (always true).
(substitute_and_fold): Likewise.
* tree-vrp.c (vrp_finalize): Adjust.
(execute_early_vrp): Remove final BB_VISITED clearing.
* tree-ssa-ccp.c (ccp_finalize): Adjust.
* tree-ssa-copy.c (fini_copy_prop): Likewise.
* ira.c (ira): Call clear_bb_flags.

From-SVN: r241296

gcc/ChangeLog
gcc/ira.c
gcc/tree-ssa-ccp.c
gcc/tree-ssa-copy.c
gcc/tree-ssa-propagate.c
gcc/tree-ssa-propagate.h
gcc/tree-vrp.c

index 2c10faf83e4a9de72ab2aaf8706a851a6c169551..77fef0623550ec8cacd07224b3f4d23ebcdaf0cd 100644 (file)
@@ -1,3 +1,18 @@
+2016-10-18  Richard Biener  <rguenther@suse.de>
+
+       * tree-ssa-propagate.h (substitute_and_fold): Adjust prototype.
+       * tree-ssa-propagate.c (ssa_prop_fini): Remove final BB_VISITED
+       clearing.
+       (substitute_and_fold_dom_walker): Adjust constructor.
+       (substitute_and_fold_dom_walker::before_dom_children): Remove
+       do_dce flag and handling (always true).
+       (substitute_and_fold): Likewise.
+       * tree-vrp.c (vrp_finalize): Adjust.
+       (execute_early_vrp): Remove final BB_VISITED clearing.
+       * tree-ssa-ccp.c (ccp_finalize): Adjust.
+       * tree-ssa-copy.c (fini_copy_prop): Likewise.
+       * ira.c (ira): Call clear_bb_flags.
+
 2016-10-18  Richard Biener  <rguenther@suse.de>
 
        * genmatch.c (dt_operand::gen_gimple_expr): Use get_name to
index 94cfe2a04a11181a4492f0909bff6e3386477ed2..cd640fce589faf018ec26cca45cf2c23633d46ae 100644 (file)
--- a/gcc/ira.c
+++ b/gcc/ira.c
@@ -5065,6 +5065,8 @@ ira (FILE *f)
   bool saved_flag_caller_saves = flag_caller_saves;
   enum ira_region saved_flag_ira_region = flag_ira_region;
 
+  clear_bb_flags ();
+
   /* Perform target specific PIC register initialization.  */
   targetm.init_pic_reg ();
 
index 61754d8d7588c747229d145ee2fabc4e2cf1083a..167598f6eec4df60d656019dfb1c2851907b873a 100644 (file)
@@ -953,8 +953,7 @@ ccp_finalize (bool nonzero_p)
     }
 
   /* Perform substitutions based on the known constant values.  */
-  something_changed = substitute_and_fold (get_constant_value,
-                                          ccp_fold_stmt, true);
+  something_changed = substitute_and_fold (get_constant_value, ccp_fold_stmt);
 
   free (const_val);
   const_val = NULL;
index fcf4fa9464afc44f693a9b6cf9c9942c61f0cade..abc620535713eaa77a4944383a72124d1db556fb 100644 (file)
@@ -550,7 +550,7 @@ fini_copy_prop (void)
        }
     }
 
-  bool changed = substitute_and_fold (get_value, NULL, true);
+  bool changed = substitute_and_fold (get_value, NULL);
   if (changed)
     {
       free_numbers_of_iterations_estimates (cfun);
index 0f940cc56b58b2435adcfe282fdb72d36db309f4..fbe7e13f84ef6756f063495111260496c3b87d2b 100644 (file)
@@ -479,9 +479,6 @@ ssa_prop_fini (void)
   free (cfg_order_to_bb);
   BITMAP_FREE (ssa_edge_worklist);
   uid_to_stmt.release ();
-  basic_block bb;
-  FOR_BB_BETWEEN (bb, ENTRY_BLOCK_PTR_FOR_FN (cfun), NULL, next_bb)
-    bb->flags &= ~BB_VISITED;
 }
 
 
@@ -972,10 +969,9 @@ class substitute_and_fold_dom_walker : public dom_walker
 public:
     substitute_and_fold_dom_walker (cdi_direction direction,
                                    ssa_prop_get_value_fn get_value_fn_,
-                                   ssa_prop_fold_stmt_fn fold_fn_,
-                                   bool do_dce_)
+                                   ssa_prop_fold_stmt_fn fold_fn_)
        : dom_walker (direction), get_value_fn (get_value_fn_),
-      fold_fn (fold_fn_), do_dce (do_dce_), something_changed (false)
+      fold_fn (fold_fn_), something_changed (false)
     {
       stmts_to_remove.create (0);
       stmts_to_fixup.create (0);
@@ -993,7 +989,6 @@ public:
 
     ssa_prop_get_value_fn get_value_fn;
     ssa_prop_fold_stmt_fn fold_fn;
-    bool do_dce;
     bool something_changed;
     vec<gimple *> stmts_to_remove;
     vec<gimple *> stmts_to_fixup;
@@ -1012,8 +1007,7 @@ substitute_and_fold_dom_walker::before_dom_children (basic_block bb)
       tree res = gimple_phi_result (phi);
       if (virtual_operand_p (res))
        continue;
-      if (do_dce
-         && res && TREE_CODE (res) == SSA_NAME)
+      if (res && TREE_CODE (res) == SSA_NAME)
        {
          tree sprime = get_value_fn (res);
          if (sprime
@@ -1039,8 +1033,7 @@ substitute_and_fold_dom_walker::before_dom_children (basic_block bb)
       /* No point propagating into a stmt we have a value for we
          can propagate into all uses.  Mark it for removal instead.  */
       tree lhs = gimple_get_lhs (stmt);
-      if (do_dce
-         && lhs && TREE_CODE (lhs) == SSA_NAME)
+      if (lhs && TREE_CODE (lhs) == SSA_NAME)
        {
          tree sprime = get_value_fn (lhs);
          if (sprime
@@ -1180,8 +1173,7 @@ substitute_and_fold_dom_walker::before_dom_children (basic_block bb)
 
 bool
 substitute_and_fold (ssa_prop_get_value_fn get_value_fn,
-                    ssa_prop_fold_stmt_fn fold_fn,
-                    bool do_dce)
+                    ssa_prop_fold_stmt_fn fold_fn)
 {
   gcc_assert (get_value_fn);
 
@@ -1192,7 +1184,7 @@ substitute_and_fold (ssa_prop_get_value_fn get_value_fn,
 
   calculate_dominance_info (CDI_DOMINATORS);
   substitute_and_fold_dom_walker walker(CDI_DOMINATORS,
-                                       get_value_fn, fold_fn, do_dce);
+                                       get_value_fn, fold_fn);
   walker.walk (ENTRY_BLOCK_PTR_FOR_FN (cfun));
 
   /* We cannot remove stmts during the BB walk, especially not release
index 1a969765f09283bdde73a00296084706c6dcb791..2729bc7dff9982185a7b5b4ce1b4e20ae4c52cdb 100644 (file)
@@ -75,8 +75,7 @@ extern bool update_gimple_call (gimple_stmt_iterator *, tree, int, ...);
 extern bool update_call_from_tree (gimple_stmt_iterator *, tree);
 extern void ssa_propagate (ssa_prop_visit_stmt_fn, ssa_prop_visit_phi_fn);
 extern bool stmt_makes_single_store (gimple *);
-extern bool substitute_and_fold (ssa_prop_get_value_fn, ssa_prop_fold_stmt_fn,
-                                bool);
+extern bool substitute_and_fold (ssa_prop_get_value_fn, ssa_prop_fold_stmt_fn);
 extern bool may_propagate_copy (tree, tree);
 extern bool may_propagate_copy_into_stmt (gimple *, tree);
 extern bool may_propagate_copy_into_asm (tree);
index eb3eebd44d5c38f7e6760df6fe5c70b5e4a1119d..31f4f25cced9cafd48c9f0f173d03c2b2000c220 100644 (file)
@@ -10622,8 +10622,7 @@ vrp_finalize (bool warn_array_bounds_p)
                          vr_value[i]->max);
       }
 
-  substitute_and_fold (op_with_constant_singleton_value_range,
-                      vrp_fold_stmt, true);
+  substitute_and_fold (op_with_constant_singleton_value_range, vrp_fold_stmt);
 
   if (warn_array_bounds && warn_array_bounds_p)
     check_all_array_refs ();
@@ -10954,8 +10953,6 @@ execute_early_vrp ()
   vrp_free_lattice ();
   scev_finalize ();
   loop_optimizer_finalize ();
-  FOR_EACH_BB_FN (bb, cfun)
-    bb->flags &= ~BB_VISITED;
   return 0;
 }