On Fri, 15 Mar 2019, Jakub Jelinek wrote:

> On Fri, Mar 15, 2019 at 09:46:33AM +0100, Richard Biener wrote:
> > On Fri, 15 Mar 2019, Jakub Jelinek wrote:
> > 
> > > On Fri, Mar 15, 2019 at 09:22:26AM +0100, Richard Biener wrote:
> > > > That said, I think we can go with my patch for GCC 9 and defer a more
> > > > complete and elaborate solution to GCC 10 (where I'd still prefer
> > > > sth simple).
> > > > 
> > > > What do you think?
> > > 
> > > Ok.  gimple_purge_dead_abnormal_call_edges after all isn't that expensive,
> > > it just walks over all successor edges of a bb.
> > > Right now gimple_purge_all_dead_abnormal_call_edges is only called by
> > > sccvn on specific bbs that do need ab cleanup, tree-inline.c calls
> > > gimple_purge_dead_abnormal_call_edges only if it is inlining a call at the
> > > end of a bb and tree-cfg.c calls it for const/pure calls.
> > > 
> > > In that last case, I wonder if we actually shouldn't do following, because
> > > it makes no sense to call it for each constant/pure call in a bb when all 
> > > we
> > > care about is whether it is the last stmt that is a pure/const call.
> > 
> > Sure.  Though I think with us now having gimple_call_set_ctrl_altering
> > execute_fixup_cfg can be stripped down considerably - possibly simply
> > leaving most parts to CFG cleanup.  The noreturn fixup is still
> > required if a call becomes known to not return (CFG cleanup only
> > looks at the last stmt), but gimple_purge_dead_abnormal_call_edges can
> > be completely elided IMHO (just schedule CFG cleanup).
> 
> The CFG cleanup never calls gimple_purge_dead_abnormal_call_edges though.

Indeed.  I guess it could do that where it calls 
gimple_purge_dead_eh_edges (cleanup_control_flow_bb).

> Do we ever update gimple_call_ctrl_altering_p flag if something changes?

Yes, CFG cleanup does this and if fixup_cfg needs to live it could do
that as well (it calls fixup_noreturn_call which updates it for example).

Richard.

>       Jakub
> 

-- 
Richard Biener <rguent...@suse.de>
SUSE LINUX GmbH, GF: Felix Imendoerffer, Jane Smithard, Graham Norton, HRB 
21284 (AG Nuernberg)

Reply via email to