[PATCH] Recognize clones for all contexts in SCCs in IPA-CP
Jan Hubicka
hubicka@ucw.cz
Wed Nov 21 12:59:00 GMT 2012
> Hi,
>
> in IPA-CP, a few functions look at callees of cgraph edges to see if
> they still lead to the original node (those still need to be examined
> or re-examined) or to a clone (those are considered already decided
> and should be left alone). The problem is that currently, when
> looking at an SCC, these functions decide not to "close" the SCC by
> switching the last edge from a specialized clone to a specialized
> clone because it already leads to a clone, albeit one for all
> contexts.
>
> In the testcase ipcp-agg-7.c that is part of this patch, this leads to
> two copies of foo, one of them not specialized for known aggregate
> values, even though there should have been just one.
>
> The patch fixes this by introducing another flag is_all_contexts_clone
> and testing it in the necessary functions. In order to avoid
> confusion, I renamed already existing flag clone_for_all_contexts to
> do_clone_for_all_contexts.
>
> Additionally, I discovered that decide_whether_version_node contains a
> bogus "|| !plats->aggs" in a test, which is harmless but just should
> not be there, so I removed it.
>
> Bootstrapped and tested on x86_64-linux. OK for trunk?
>
> Martin
>
>
> 2012-11-20 Martin Jambor <mjambor@suse.cz>
>
> * ipa-prop.h (struct ipa_node_params): Rename clone_for_all_contexts to
> do_clone_for_all_contexts. Update all uses. New flag
> is_all_contexts_clone.
>
> * ipa-cp.c (cgraph_edge_brings_value_p): Also consider the case when cs
> leads to the clone for all contexts.
> (perhaps_add_new_callers): Likewise.
> (decide_whether_version_node): Remove bogus !plats->aggs test. Set
> is_all_contexts_clone when cloning for all contexts.
>
> * testsuite/gcc.dg/ipa/ipcp-agg-7.c: New test.
> * testsuite/gcc.dg/ipa/ipcp-agg-8.c: Likewise.
OK,
thanks!
Honza
More information about the Gcc-patches
mailing list