Re: [PATCH][RFC] Add dynamic edge/bb flag allocation

2018-05-23 Thread Michael Matz
Hi, On Wed, 23 May 2018, Richard Biener wrote: > > alloc_flags (>cfg->bb_flag_pool); > > alloc_flags (>cfg->edge_flag_pool); > > You'll end up with sth like > >alloc_flags flag (BB_FLAG_POOL_FOR_FN (cfun)); > > then, mixing C++ RAII and macros! (eh) First: I don't see the

Re: [PATCH][RFC] Add dynamic edge/bb flag allocation

2018-05-23 Thread Richard Biener
On Wed, 23 May 2018, Michael Matz wrote: > Hi, > > On Wed, 23 May 2018, Eric Botcazou wrote: > > > > Maybe you should convert the thing to a template when the need arises > > > instead of before? You have now added 54 lines of code for wrapping an > > > int! > > > > Yeah, it took me 5 minutes

Re: [PATCH][RFC] Add dynamic edge/bb flag allocation

2018-05-23 Thread Michael Matz
Hi, On Wed, 23 May 2018, Eric Botcazou wrote: > > Maybe you should convert the thing to a template when the need arises > > instead of before? You have now added 54 lines of code for wrapping an > > int! > > Yeah, it took me 5 minutes to understand what all this fluff is about! So, what I

Re: [PATCH][RFC] Add dynamic edge/bb flag allocation

2018-05-23 Thread Eric Botcazou
> Maybe you should convert the thing to a template when the need arises > instead of before? You have now added 54 lines of code for wrapping an > int! Yeah, it took me 5 minutes to understand what all this fluff is about! -- Eric Botcazou

Re: [PATCH][RFC] Add dynamic edge/bb flag allocation

2018-05-23 Thread Michael Matz
Hi, On Wed, 23 May 2018, Richard Biener wrote: > > I messed up the conversion to a template. The bitnum should be > > subtracted from HOST_BITS_PER_WIDE_INT and yes, 1 in unsigned hwi > > should be shifted. Maybe you should convert the thing to a template when the need arises instead of

Re: [PATCH][RFC] Add dynamic edge/bb flag allocation

2018-05-23 Thread Richard Biener
On Tue, 22 May 2018, Richard Biener wrote: > On May 22, 2018 6:53:57 PM GMT+02:00, Joseph Myers > wrote: > >On Tue, 22 May 2018, Richard Biener wrote: > > > >> + if (*sptr & (1 << (CHAR_BIT * sizeof (T) - 1))) > >> + gcc_unreachable (); > >> + m_flag = 1 <<

Re: [PATCH][RFC] Add dynamic edge/bb flag allocation

2018-05-22 Thread Richard Biener
On May 22, 2018 6:53:57 PM GMT+02:00, Joseph Myers wrote: >On Tue, 22 May 2018, Richard Biener wrote: > >> + if (*sptr & (1 << (CHAR_BIT * sizeof (T) - 1))) >> +gcc_unreachable (); >> + m_flag = 1 << ((CHAR_BIT * sizeof (T)) - clz_hwi (*sptr)); > >I don't

Re: [PATCH][RFC] Add dynamic edge/bb flag allocation

2018-05-22 Thread Joseph Myers
On Tue, 22 May 2018, Richard Biener wrote: > + if (*sptr & (1 << (CHAR_BIT * sizeof (T) - 1))) > + gcc_unreachable (); > + m_flag = 1 << ((CHAR_BIT * sizeof (T)) - clz_hwi (*sptr)); I don't see how the use of clz_hwi works with a type T that may be narrower than HOST_WIDE_INT.

Re: [PATCH][RFC] Add dynamic edge/bb flag allocation

2018-05-22 Thread Richard Biener
On Tue, 22 May 2018, David Malcolm wrote: > On Tue, 2018-05-22 at 10:43 +0200, Richard Biener wrote: > > On Mon, 21 May 2018, Jeff Law wrote: > > > > > On 05/18/2018 07:15 AM, David Malcolm wrote: > > > > On Fri, 2018-05-18 at 13:11 +0200, Richard Biener wrote: > > > > > The following adds a

Re: [PATCH][RFC] Add dynamic edge/bb flag allocation

2018-05-22 Thread David Malcolm
On Tue, 2018-05-22 at 10:43 +0200, Richard Biener wrote: > On Mon, 21 May 2018, Jeff Law wrote: > > > On 05/18/2018 07:15 AM, David Malcolm wrote: > > > On Fri, 2018-05-18 at 13:11 +0200, Richard Biener wrote: > > > > The following adds a simple alloc/free_flag machinery > > > > allocating > > >

Re: [PATCH][RFC] Add dynamic edge/bb flag allocation

2018-05-22 Thread Richard Biener
On Mon, 21 May 2018, Jeff Law wrote: > On 05/18/2018 07:15 AM, David Malcolm wrote: > > On Fri, 2018-05-18 at 13:11 +0200, Richard Biener wrote: > >> The following adds a simple alloc/free_flag machinery allocating > >> bits from an int typed pool and applies that to bb->flags and edge- > >>>

Re: [PATCH][RFC] Add dynamic edge/bb flag allocation

2018-05-21 Thread Jeff Law
On 05/18/2018 07:15 AM, David Malcolm wrote: > On Fri, 2018-05-18 at 13:11 +0200, Richard Biener wrote: >> The following adds a simple alloc/free_flag machinery allocating >> bits from an int typed pool and applies that to bb->flags and edge- >>> flags. >> This should allow infrastructure pieces

Re: [PATCH][RFC] Add dynamic edge/bb flag allocation

2018-05-18 Thread David Malcolm
On Fri, 2018-05-18 at 13:11 +0200, Richard Biener wrote: > The following adds a simple alloc/free_flag machinery allocating > bits from an int typed pool and applies that to bb->flags and edge- > >flags. > This should allow infrastructure pieces to use egde/bb flags > temporarily > without