This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH 2/6] use auto_sbitmap in various places
On Mon, Jul 25, 2016 at 11:18:07AM -0600, Jeff Law wrote:
> On 07/24/2016 05:44 AM, tbsaunde+gcc@tbsaunde.org wrote:
> > From: Trevor Saunders <tbsaunde+gcc@tbsaunde.org>
> >
> > gcc/ChangeLog:
> >
> > 2016-07-24 Trevor Saunders <tbsaunde+gcc@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.
yeah, there was a couple places like that which I left for the time
being mostly because they swapped bitmaps and I wanted to add a way of
doing that first.
> 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.
yeah, that would definitely be nice, and I've considered doing it
before, but been afraid it would be a bit of work. I suppose though if
it took work it would be because I learned some things so maybe its
worth doing for bitmap and all the uses of malloc / free.
> > 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.
yeah, I believe so.
> > 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.
heh, it is silly, but I can understand how people mess this stuff up.
> > 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.
unfortunately its a file static, so that needs work first.
> > 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.
yeah, I'll probably get to it at some point, though I also want to work
on helpers for bitmap and all our uses of arrays.
Trev
>
> jeff
>