[PATCH] Propagate nonfreeing_call_p using ipa-pure-const (take 2)

Jan Hubicka hubicka@ucw.cz
Fri Nov 14 17:51:00 GMT 2014


> On Thu, Nov 13, 2014 at 12:52:21PM +0100, Jakub Jelinek wrote:
> > On Thu, Nov 13, 2014 at 09:39:42AM +0100, Jakub Jelinek wrote:
> > > What about the:
> > > > > I wonder if the nonfreeing_call_p function shouldn't be moved elsewhere
> > > > > though (suggestion where), so that gimple.c doesn't need the cgraph
> > > > > includes.
> > > question though (maybe it is more on Richard)?
> > 
> > Tried richi's suggested cgraph.[ch], but that meant all users of
> > nonfreeing_call_p had to start including all of ipa-ref.h, lto-streamer.h
> > and cgraph.h, so it is probably better to keep it in gimple.[ch].
> 
> Here is a new version, which also handles IFN_ABNORMAL_DISPATCHER as
> nonfreeing, it doesn't really call anything, just connect abnormal edges.
> Bootstrapped/regtested on x86_64-linux and i686-linux, ok for trunk?
> 
> 2014-11-14  Jakub Jelinek  <jakub@redhat.com>
> 
> 	* ipa-pure-const.c (struct funct_state_d): Add can_free field.
> 	(varying_state): Add true for can_free.
> 	(check_call): For builtin or internal !nonfreeing_call_p set
> 	local->can_free.
> 	(check_stmt): For asm volatile and asm with "memory" set
> 	local->can_free.
> 	(analyze_function): Clear local->can_free initially, continue
> 	calling check_stmt until all flags are computed, dump can_free
> 	flag.
> 	(pure_const_write_summary): Write can_free flag.
> 	(pure_const_read_summary): Read it back.
> 	(propagate_pure_const): Propagate also can_free flag, set
> 	w->nonfreeing_fn if it is false after propagation.
> 	* cgraph.h (cgraph_node): Add nonfreeing_fn member.
> 	* gimple.c: Include ipa-ref.h, lto-streamer.h and cgraph.h.
> 	(nonfreeing_call_p): Return cgraph nonfreeing_fn flag if set.
> 	Also return true for IFN_ABNORMAL_DISPATCHER.
> 	* cgraph.c (cgraph_node::dump): Dump nonfreeing_fn flag.
> 	* lto-cgraph.c (lto_output_node): Write nonfreeing_fn flag.
> 	(input_overwrite_node): Read it back.

OK,
thanks
Honza



More information about the Gcc-patches mailing list