Re: [patch] Perform anonymous constant propagation during inlining

2015-05-12 Thread Richard Biener
On Mon, May 11, 2015 at 4:05 PM, Eric Botcazou wrote: >> >Would you be OK with a slight variation of your earlier idea, i.e. >> >calling fold_stmt with a specific valueizer from fold_marked_statements >> >instead of the implicit no_follow_ssa_edges in the inliner? Something >> >like: >> > >> >tre

Re: [patch] Perform anonymous constant propagation during inlining

2015-05-11 Thread Eric Botcazou
> >Would you be OK with a slight variation of your earlier idea, i.e. > >calling fold_stmt with a specific valueizer from fold_marked_statements > >instead of the implicit no_follow_ssa_edges in the inliner? Something > >like: > > > >tree > >follow_anonymous_single_use_edges (tree val) > >{ > > >

Re: [patch] Perform anonymous constant propagation during inlining

2015-05-04 Thread Richard Biener
On May 4, 2015 11:38:42 PM GMT+02:00, Eric Botcazou wrote: >> 2015-05-01 Eric Botcazou >> >> * expr.c (expand_expr_real_1) : Try to substitute >constants >> on the RHS of expressions. >> * gimple-expr.h (is_gimple_constant): Reorder. > >Bummer. This breaks C++ debugging: > >+F

Re: [patch] Perform anonymous constant propagation during inlining

2015-05-04 Thread Eric Botcazou
> 2015-05-01 Eric Botcazou > > * expr.c (expand_expr_real_1) : Try to substitute constants > on the RHS of expressions. > * gimple-expr.h (is_gimple_constant): Reorder. Bummer. This breaks C++ debugging: +FAIL: gdb.cp/class2.exp: print alpha at marker return 0 +FAIL: gdb.cp

Re: [patch] Perform anonymous constant propagation during inlining

2015-05-04 Thread Eric Botcazou
> Hum, the fact that your earlier version created wrong code > (get_gimple_for_ssa_name > already returned false here) points at some issues with > EXPAND_INITIALIZER as well, no...? Theoritically yes but, in practice, EXPAND_INITIALIZER is used in varasm.c and for debugging stuff only, so I don'

Re: [patch] Perform anonymous constant propagation during inlining

2015-05-04 Thread Richard Biener
On Fri, May 1, 2015 at 8:09 PM, Eric Botcazou wrote: >> OK, how aggressive then? We could as well do the substitution for all >> copies: >> >> /* For EXPAND_INITIALIZER try harder to get something simpler. >>Otherwise, substitute copies on the RHS, this can propagate >>const

Re: [patch] Perform anonymous constant propagation during inlining

2015-05-01 Thread Eric Botcazou
> OK, how aggressive then? We could as well do the substitution for all > copies: > > /* For EXPAND_INITIALIZER try harder to get something simpler. >Otherwise, substitute copies on the RHS, this can propagate >constants at -O0 and thus simplify arithmetic operations. */ >

Re: [patch] Perform anonymous constant propagation during inlining

2015-05-01 Thread Eric Botcazou
> Yeah, I think that's a way better place for the hack. OK, how aggressive then? We could as well do the substitution for all copies: /* For EXPAND_INITIALIZER try harder to get something simpler. Otherwise, substitute copies on the RHS, this can propagate constants at -O

Re: [patch] Perform anonymous constant propagation during inlining

2015-05-01 Thread Richard Biener
On May 1, 2015 12:27:17 PM GMT+02:00, Eric Botcazou wrote: >> Hmm, special-casing this in the inliner looks odd to me. ISTR the >inliner >> already propagates constant parameters to immediate uses, so I guess >> you run into the casting case you handle specially. > >Right on both counts, the ori

Re: [patch] Perform anonymous constant propagation during inlining

2015-05-01 Thread Eric Botcazou
> Hmm, special-casing this in the inliner looks odd to me. ISTR the inliner > already propagates constant parameters to immediate uses, so I guess > you run into the casting case you handle specially. Right on both counts, the original GIMPLE looks like: right.3 = (system__storage_elements__in

Re: [patch] Perform anonymous constant propagation during inlining

2015-04-29 Thread Jan Hubicka
> On Wed, Apr 29, 2015 at 3:23 PM, Jan Hubicka wrote: > >> Historically the pragma Inline_Always of GNAT had been implemented in the > >> FE > >> because the RTL inliner and then the Tree inliner weren't invoked at -O0 or > >> powerful enough to inline some constructs. But this approach had > >

Re: [patch] Perform anonymous constant propagation during inlining

2015-04-29 Thread Richard Biener
On Wed, Apr 29, 2015 at 3:23 PM, Jan Hubicka wrote: >> Historically the pragma Inline_Always of GNAT had been implemented in the FE >> because the RTL inliner and then the Tree inliner weren't invoked at -O0 or >> powerful enough to inline some constructs. But this approach had drawbacks, >> espe

Re: [patch] Perform anonymous constant propagation during inlining

2015-04-29 Thread Jan Hubicka
> Historically the pragma Inline_Always of GNAT had been implemented in the FE > because the RTL inliner and then the Tree inliner weren't invoked at -O0 or > powerful enough to inline some constructs. But this approach had drawbacks, > especially wrt debug info. These restrictions were gradua

Re: [patch] Perform anonymous constant propagation during inlining

2015-04-29 Thread Richard Biener
On Wed, Apr 29, 2015 at 11:50 AM, Eric Botcazou wrote: > Historically the pragma Inline_Always of GNAT had been implemented in the FE > because the RTL inliner and then the Tree inliner weren't invoked at -O0 or > powerful enough to inline some constructs. But this approach had drawbacks, > espec

[patch] Perform anonymous constant propagation during inlining

2015-04-29 Thread Eric Botcazou
Historically the pragma Inline_Always of GNAT had been implemented in the FE because the RTL inliner and then the Tree inliner weren't invoked at -O0 or powerful enough to inline some constructs. But this approach had drawbacks, especially wrt debug info. These restrictions were gradually lift