On 07/24/2016 05:44 AM, tbsaunde+...@tbsaunde.org wrote:
From: Trevor Saunders <tbsaunde+...@tbsaunde.org>
gcc/ChangeLog:
2016-07-24 Trevor Saunders <tbsaunde+...@tbsaunde.org>
* bt-load.c (compute_out): Use auto_sbitmap class.
(link_btr_uses): Likewise.
* cfganal.c (mark_dfs_back_edges): Likewise.
(post_order_compute): Likewise.
(inverted_post_order_compute): Likewise.
(pre_and_rev_post_order_compute_fn): Likewise.
(single_pred_before_succ_order): Likewise.
* cfgexpand.c (pass_expand::execute): Likewise.
* cfgloop.c (verify_loop_structure): Likewise.
* cfgloopmanip.c (fix_bb_placements): Likewise.
(remove_path): Likewise.
(update_dominators_in_loop): Likewise.
* cfgrtl.c (break_superblocks): Likewise.
* ddg.c (check_sccs): Likewise.
(create_ddg_all_sccs): Likewise.
* df-core.c (df_worklist_dataflow): Likewise.
* dse.c (dse_step3): Likewise.
* except.c (eh_region_outermost): Likewise.
* function.c (thread_prologue_and_epilogue_insns): Likewise.
* gcse.c (prune_expressions): Likewise.
(prune_insertions_deletions): Likewise.
* gimple-ssa-backprop.c (backprop::~backprop): Likewise.
* graph.c (draw_cfg_nodes_no_loops): Likewise.
* ira-lives.c (remove_some_program_points_and_update_live_ranges):
Likewise.
* lcm.c (compute_earliest): Likewise.
(compute_farthest): Likewise.
* loop-unroll.c (unroll_loop_constant_iterations): Likewise.
(unroll_loop_runtime_iterations): Likewise.
(unroll_loop_stupid): Likewise.
* lower-subreg.c (decompose_multiword_subregs): Likewise.
* lra-lives.c: Likewise.
* lra.c (lra): Likewise.
* modulo-sched.c (schedule_reg_moves): Likewise.
(optimize_sc): Likewise.
(get_sched_window): Likewise.
(sms_schedule_by_order): Likewise.
(check_nodes_order): Likewise.
(order_nodes_of_sccs): Likewise.
(order_nodes_in_scc): Likewise.
* recog.c (split_all_insns): Likewise.
* regcprop.c (pass_cprop_hardreg::execute): Likewise.
* reload1.c (reload): Likewise.
* sched-rgn.c (haifa_find_rgns): Likewise.
(split_edges): Likewise.
(compute_trg_info): Likewise.
* sel-sched.c (init_seqno): Likewise.
* store-motion.c (remove_reachable_equiv_notes): Likewise.
* tree-into-ssa.c (update_ssa): Likewise.
* tree-ssa-live.c (live_worklist): Likewise.
* tree-ssa-loop-im.c (fill_always_executed_in): Likewise.
* tree-ssa-loop-ivcanon.c (try_unroll_loop_completely):
* Likewise.
(try_peel_loop): Likewise.
* tree-ssa-loop-manip.c (tree_transform_and_unroll_loop):
* Likewise.
* tree-ssa-pre.c (compute_antic): Likewise.
* tree-ssa-reassoc.c (undistribute_ops_list): Likewise.
* tree-stdarg.c (reachable_at_most_once): Likewise.
* tree-vect-slp.c (vect_attempt_slp_rearrange_stmts): Likewise.
* var-tracking.c (vt_find_locations): Likewise.
While looking at this, I noticed some more. Check the local sbitmaps in
ddg.c::find_nodes_on_paths.
I wonder if building a plugin to help find this kind of thing would
help. Essentially what we want is TYPE which we're considering
converting to an auto_TYPE. We want to see the declaration, possibly an
allocation and an explicit release. All paths have to pass through an
explicit release. The object must not escape. We can have a whitelist
of routines where the object can be passed in as a parameter.
Given that kind of infrastructure we ought to be able to look at a type
and say, yes, this seems to make sense to turn into an auto and here's
all the places that need twiddling for that change.
That infrastructure could also do things like say "X escaped via call Y"
or a path doesn't release which can further guide the process, or show
leaks.
diff --git a/gcc/modulo-sched.c b/gcc/modulo-sched.c
index 5dde66c..6e87a6f 100644
--- a/gcc/modulo-sched.c
+++ b/gcc/modulo-sched.c
So I got a bit lost tracking some of these through the call chains. I
could try again, taking notes along the way to make sure I properly
verified the children don't make a copy MUST_FOLLOW. But I'm going to
assume you did this correctly.
diff --git a/gcc/store-motion.c b/gcc/store-motion.c
index 6d7d37f..1d504e7 100644
--- a/gcc/store-motion.c
+++ b/gcc/store-motion.c
Ick. Who wrote remove_unreachable_equiv_notes?!? OK, you don't need to
answer that, I just needed to vent a little.
diff --git a/gcc/tree-ssa-pre.c b/gcc/tree-ssa-pre.c
index a5f3f71..6247a4c 100644
--- a/gcc/tree-ssa-pre.c
+++ b/gcc/tree-ssa-pre.c
@@ -2451,7 +2451,7 @@ compute_antic (void)
has_abnormal_preds seems ripe for a similar change in this function.
diff --git a/gcc/var-tracking.c b/gcc/var-tracking.c
index 5d09879..9088978 100644
--- a/gcc/var-tracking.c
+++ b/gcc/var-tracking.c
@@ -6996,7 +6996,7 @@ vt_find_locations (void)
in_worklist and in_pending seem ripe for the same transformation in this
function.
This patch is OK. There's some follow-ups if you want to tackle them.
jeff