Re: Simplifying Gimple Generation

2012-11-24 Thread Diego Novillo
Thanks for all the responses. I have created a wiki page to track this proposal: http://gcc.gnu.org/wiki/cxx-conversion/gimple-generation It is also indexed from the main improvements wiki: http://gcc.gnu.org/wiki/ImprovementProjects Thanks. Diego.

Re: Simplifying Gimple Generation

2012-11-20 Thread Andrew MacLeod
On 11/14/2012 08:13 PM, Lawrence Crowl wrote: Diego and I seek your comments on the following (loose) proposal. We propose a simplified form using new build helper classes ssa_seq and ssa_stmt that would allow the above code to be written as follows. ssa_seq q; ssa_stmt t = q.stmt (NE_EXPR, s

Re: Simplifying Gimple Generation

2012-11-16 Thread Xinliang David Li
On Fri, Nov 16, 2012 at 5:13 AM, Diego Novillo wrote: > On Thu, Nov 15, 2012 at 2:31 AM, Xinliang David Li wrote: > >>> ssa_stmt t = q.stmt (NE_EXPR, shadow, 0); >>> ssa_stmt a = q.stmt (BIT_AND_EXPR, base_addr, 7); >>> ssa_stmt b = q.stmt (shadow_type, a); >>> ssa_stmt c = q.stmt (PLUS_EXPR, b,

Re: Simplifying Gimple Generation

2012-11-16 Thread Andrew Pinski
On Fri, Nov 16, 2012 at 6:30 AM, Michael Matz wrote: > Hi, > > On Fri, 16 Nov 2012, Diego Novillo wrote: > >> > I think consistency should trump brevity here, so also add a tree code for >> > the converter, i.e. >> > ssa_stmt b = q.stmt (NOP_EXPR, shadow_type, a); >> >> Ah, yes. This one was am

Re: Simplifying Gimple Generation

2012-11-16 Thread Michael Matz
Hi, On Fri, 16 Nov 2012, Diego Novillo wrote: > > I think consistency should trump brevity here, so also add a tree code for > > the converter, i.e. > > ssa_stmt b = q.stmt (NOP_EXPR, shadow_type, a); > > Ah, yes. This one was amusing. When we were drafting the proposal, > Lawrence kept wond

Re: Simplifying Gimple Generation

2012-11-16 Thread Diego Novillo
On Thu, Nov 15, 2012 at 9:48 AM, Michael Matz wrote: > Hi Lawrence, > > On Wed, 14 Nov 2012, Lawrence Crowl wrote: > >> Diego and I seek your comments on the following (loose) proposal. > > In principle I agree with the goal, I'm not sure I like the specific way > yet, and even if I do I have some

Re: Simplifying Gimple Generation

2012-11-16 Thread Diego Novillo
On Thu, Nov 15, 2012 at 1:06 AM, Basile Starynkevitch wrote: > On Wed, Nov 14, 2012 at 05:13:12PM -0800, Lawrence Crowl wrote: >> Diego and I seek your comments on the following (loose) proposal. >> >> >> Generating gimple and tree expressions require lots of detail, >> which is hard to remember a

Re: Simplifying Gimple Generation

2012-11-16 Thread Diego Novillo
On Thu, Nov 15, 2012 at 2:31 AM, Xinliang David Li wrote: >> ssa_stmt t = q.stmt (NE_EXPR, shadow, 0); >> ssa_stmt a = q.stmt (BIT_AND_EXPR, base_addr, 7); >> ssa_stmt b = q.stmt (shadow_type, a); >> ssa_stmt c = q.stmt (PLUS_EXPR, b, offset); >> ssa_stmt d = q.stmt (GE_EXPR, c, shadow); >> ssa_s

Re: Simplifying Gimple Generation

2012-11-16 Thread Michael Matz
Hi, On Thu, 15 Nov 2012, Lawrence Crowl wrote: > They allow us to use the same name for the same actions in two > different contexts. In particular, distinguishing between statement > construction in SSA and non-SSA. I don't see the difference, and I don't see where you need context data to di

Re: Simplifying Gimple Generation

2012-11-15 Thread Lawrence Crowl
On 11/15/12, Michael Matz wrote: > On Wed, 14 Nov 2012, Lawrence Crowl wrote: > > Diego and I seek your comments on the following (loose) proposal. > > In principle I agree with the goal, I'm not sure I like the > specific way yet, and even if I do I have some suggestions: > > > We will add a set

Re: Simplifying Gimple Generation

2012-11-15 Thread Lawrence Crowl
On 11/14/12, Basile Starynkevitch wrote: > On Wed, Nov 14, 2012 at 05:13:12PM -0800, Lawrence Crowl wrote: >> Diego and I seek your comments on the following (loose) proposal. >> >> >> Generating gimple and tree expressions require lots of detail, >> which is hard to remember and easy to get wrong

Re: Simplifying Gimple Generation

2012-11-15 Thread Xinliang David Li
On Thu, Nov 15, 2012 at 9:01 AM, Michael Matz wrote: > Hi, > > On Thu, 15 Nov 2012, Gabriel Dos Reis wrote: > >> On Thu, Nov 15, 2012 at 8:48 AM, Michael Matz wrote: >> [...] >> > The method name should imply the action, e.g. 'add_stmt' or append_stmt >> > or the like. >> >> strongly agreed. >> [

Re: Simplifying Gimple Generation

2012-11-15 Thread Michael Matz
Hi, On Thu, 15 Nov 2012, Gabriel Dos Reis wrote: > On Thu, Nov 15, 2012 at 8:48 AM, Michael Matz wrote: > [...] > > The method name should imply the action, e.g. 'add_stmt' or append_stmt > > or the like. > > strongly agreed. > [...] > > > All in all I think we can severely improve on building

Re: Simplifying Gimple Generation

2012-11-15 Thread Gabriel Dos Reis
On Thu, Nov 15, 2012 at 8:48 AM, Michael Matz wrote: [...] > The method name should imply the action, e.g. 'add_stmt' or append_stmt > or the like. strongly agreed. [...] > All in all I think we can severely improve on building gimple statements > without introduction of any helper class. Basic

Re: Simplifying Gimple Generation

2012-11-15 Thread Michael Matz
Hi Lawrence, On Wed, 14 Nov 2012, Lawrence Crowl wrote: > Diego and I seek your comments on the following (loose) proposal. In principle I agree with the goal, I'm not sure I like the specific way yet, and even if I do I have some suggestions: > We will add a set of helper classes to be used a

Re: Simplifying Gimple Generation

2012-11-14 Thread Xinliang David Li
On Wed, Nov 14, 2012 at 5:13 PM, Lawrence Crowl wrote: > Diego and I seek your comments on the following (loose) proposal. > > > Generating gimple and tree expressions require lots of detail, > which is hard to remember and easy to get wrong. There is some > amount of boilerplate code that can, i

Re: Simplifying Gimple Generation

2012-11-14 Thread Basile Starynkevitch
On Wed, Nov 14, 2012 at 05:13:12PM -0800, Lawrence Crowl wrote: > Diego and I seek your comments on the following (loose) proposal. > > > Generating gimple and tree expressions require lots of detail, > which is hard to remember and easy to get wrong. There is some > amount of boilerplate code t

Simplifying Gimple Generation

2012-11-14 Thread Lawrence Crowl
Diego and I seek your comments on the following (loose) proposal. Generating gimple and tree expressions require lots of detail, which is hard to remember and easy to get wrong. There is some amount of boilerplate code that can, in most cases, be reduced and managed automatically. We will add a