Re: [PATCH 11/11] Make opt_pass and gcc::pipeline be GC-managed

2013-08-27 Thread Richard Biener
On Sat, Aug 3, 2013 at 2:21 AM, Richard Henderson wrote: > On 08/02/2013 11:53 AM, David Malcolm wrote: >> FWIW I had a go at avoiding templates by attempting to tell gengtype to >> write out functions for all GTY((user)) types, regardless of whether it >> thinks they're referenced, with this: >>

Re: v3 of patch (was Re: [PATCH 11/11] Make opt_pass and gcc::pipeline be GC-managed)

2013-08-19 Thread David Malcolm
On Mon, 2013-08-19 at 10:52 -0700, Richard Henderson wrote: > On 08/16/2013 08:33 AM, David Malcolm wrote: > > I also tweaked the traversal hooks for opt_pass to emulate "chain_next", > > since this is where the really deep callchains could otherwise occur. > > > > See the patch for details (given

Re: v3 of patch (was Re: [PATCH 11/11] Make opt_pass and gcc::pipeline be GC-managed)

2013-08-19 Thread Richard Henderson
On 08/16/2013 08:33 AM, David Malcolm wrote: > I also tweaked the traversal hooks for opt_pass to emulate "chain_next", > since this is where the really deep callchains could otherwise occur. > > See the patch for details (given the subtleties I opted to put big > comments in the relevant routines

v3 of patch (was Re: [PATCH 11/11] Make opt_pass and gcc::pipeline be GC-managed)

2013-08-16 Thread David Malcolm
On Mon, 2013-08-05 at 06:59 -1000, Richard Henderson wrote: > On 08/05/2013 05:18 AM, David Malcolm wrote: > > So I *think* the most efficient traversal is to do this first (with a > > suitable comment): > > > > for (int i = passes_by_id_size ; i > 0; ) > >::gt_ggc_mx (passes_by_id[--i]); > >

Re: Updated patch (was Re: [PATCH 11/11] Make opt_pass and gcc::pipeline be GC-managed)

2013-08-05 Thread David Malcolm
On Mon, 2013-08-05 at 06:59 -1000, Richard Henderson wrote: > On 08/05/2013 05:18 AM, David Malcolm wrote: > > So I *think* the most efficient traversal is to do this first (with a > > suitable comment): > > > > for (int i = passes_by_id_size ; i > 0; ) > >::gt_ggc_mx (passes_by_id[--i]); > >

Re: Updated patch (was Re: [PATCH 11/11] Make opt_pass and gcc::pipeline be GC-managed)

2013-08-05 Thread Richard Henderson
On 08/05/2013 05:18 AM, David Malcolm wrote: > So I *think* the most efficient traversal is to do this first (with a > suitable comment): > > for (int i = passes_by_id_size ; i > 0; ) >::gt_ggc_mx (passes_by_id[--i]); > > That ought to visit all of the passes without triggering recursion > (

Re: Updated patch (was Re: [PATCH 11/11] Make opt_pass and gcc::pipeline be GC-managed)

2013-08-05 Thread David Malcolm
On Sat, 2013-08-03 at 08:39 -1000, Richard Henderson wrote: > On 08/02/2013 02:48 PM, David Malcolm wrote: > > +pass_manager::gt_ggc_mx () > > +{ > > + ::gt_ggc_mx (all_passes); > > + ::gt_ggc_mx (all_small_ipa_passes); > > + ::gt_ggc_mx (all_lowering_passes); > > + ::gt_ggc_mx (all_regular_ipa

Re: Updated patch (was Re: [PATCH 11/11] Make opt_pass and gcc::pipeline be GC-managed)

2013-08-03 Thread Richard Henderson
On 08/02/2013 02:48 PM, David Malcolm wrote: > +pass_manager::gt_ggc_mx () > +{ > + ::gt_ggc_mx (all_passes); > + ::gt_ggc_mx (all_small_ipa_passes); > + ::gt_ggc_mx (all_lowering_passes); > + ::gt_ggc_mx (all_regular_ipa_passes); > + ::gt_ggc_mx (all_lto_gen_passes); > + ::gt_ggc_mx (all_lat

Updated patch (was Re: [PATCH 11/11] Make opt_pass and gcc::pipeline be GC-managed)

2013-08-02 Thread David Malcolm
On Fri, 2013-08-02 at 10:01 -1000, Richard Henderson wrote: > On 08/02/2013 09:08 AM, David Malcolm wrote: > > For opt_pass and pass_manager, something different is going on. > > I'd wondered about that. > > > For some reason gengtype doesn't generate the triad of gt_ggc_mx_FOO, > > gt_pch_nx_FOO

Re: [PATCH 11/11] Make opt_pass and gcc::pipeline be GC-managed

2013-08-02 Thread Richard Henderson
On 08/02/2013 11:53 AM, David Malcolm wrote: > FWIW I had a go at avoiding templates by attempting to tell gengtype to > write out functions for all GTY((user)) types, regardless of whether it > thinks they're referenced, with this: > @@ -3697,7 +3697,8 @@ write_types (outf_p output_header, type_p

Re: [PATCH 11/11] Make opt_pass and gcc::pipeline be GC-managed

2013-08-02 Thread David Malcolm
On Fri, 2013-08-02 at 10:01 -1000, Richard Henderson wrote: > On 08/02/2013 09:08 AM, David Malcolm wrote: > > For opt_pass and pass_manager, something different is going on. > > I'd wondered about that. > > > For some reason gengtype doesn't generate the triad of gt_ggc_mx_FOO, > > gt_pch_nx_FOO

Re: [PATCH 11/11] Make opt_pass and gcc::pipeline be GC-managed

2013-08-02 Thread Richard Henderson
On 08/02/2013 09:08 AM, David Malcolm wrote: > For opt_pass and pass_manager, something different is going on. I'd wondered about that. > For some reason gengtype doesn't generate the triad of gt_ggc_mx_FOO, > gt_pch_nx_FOO, gt_pch_p_NFOO functions in gtype-desc.c, for types > FOO=opt_pass and pa

Re: [PATCH 11/11] Make opt_pass and gcc::pipeline be GC-managed

2013-08-02 Thread David Malcolm
On Thu, 2013-08-01 at 11:45 -1000, Richard Henderson wrote: > On 07/26/2013 05:04 AM, David Malcolm wrote: > > (opt_pass::gt_ggc_mx): New. > > (opt_pass::gt_pch_nx): New. > > (opt_pass::gt_pch_nx_with_op): New. > > (gt_ggc_mx (opt_pass *)): New. > > (gt_pch_nx (opt_pass *)): New

Re: [PATCH 11/11] Make opt_pass and gcc::pipeline be GC-managed

2013-08-01 Thread Richard Henderson
On 07/26/2013 05:04 AM, David Malcolm wrote: > (opt_pass::gt_ggc_mx): New. > (opt_pass::gt_pch_nx): New. > (opt_pass::gt_pch_nx_with_op): New. > (gt_ggc_mx (opt_pass *)): New. > (gt_pch_nx (opt_pass *)): New. > (gt_pch_nx_opt_pass): New. > (pipeline::operat

Re: [PATCH 11/11] Make opt_pass and gcc::pipeline be GC-managed

2013-07-27 Thread Bernhard Reutner-Fischer
On 26 July 2013 17:04:41 David Malcolm wrote: diff --git a/gcc/passes.c b/gcc/passes.c index ce5cdeb..dd1b0ba 100644 --- a/gcc/passes.c +++ b/gcc/passes.c + +void gt_pch_nx_pipeline (void *this_obj, void *p, +gt_pointer_operator op, void *cookie) +{ + pipeline *pass

[PATCH 11/11] Make opt_pass and gcc::pipeline be GC-managed

2013-07-26 Thread David Malcolm
This patch makes gcc::pipeline and opt_pass instances be allocated within the GC-heap, and adds traversal hooks for GC/PCH, so that passes can own refs to other GC-allocated objects. gcc/ Make opt_pass and gcc::pipeline be GC-managed, so that pass instances can own GC refs.