This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] Teach IPA-CP to make calls direct based on contents of aggregates
- From: Jan Hubicka <hubicka at ucw dot cz>
- To: GCC Patches <gcc-patches at gcc dot gnu dot org>, Jan Hubicka <hubicka at ucw dot cz>
- Date: Sun, 24 Mar 2013 12:09:34 +0100
- Subject: Re: [PATCH] Teach IPA-CP to make calls direct based on contents of aggregates
- References: <20130324001514 dot GE16552 at virgil dot suse>
>
> The reason why ipa_get_indirect_edge_target is split into two is that
> unlike in the inlining case, this one has to understand the
> description of known aggregate values in clones which are different
> from aggregate jump functions (they are quite simpler). Otherwise the
> patch is hopefully quite straightforward.
Hmm, perhaps we can commonize it a bit more?
>
> Bootstrapped and tested on x86_64-linux, OK for trunk?
I would also suggest adding code translating calls to known constant (NULL or integer_cst) into
__builtin_trap / __bulitin_unreachable (based on Richi's preferences). It should help code quality
(since relatively few calls are like that on Mozilla) and also it will make us to notice where
we propagate complette garbage - I still do not know of those obviously bogus calls come from
impossible type conversions (so we read past vtable) or because of some bug.
>
> 2013-03-19 Martin Jambor <mjambor@suse.cz>
>
> * ipa-cp.c (ipa_get_indirect_edge_target): Renamed to
> ipa_get_indirect_edge_target_1, added parameter agg_reps and ability to
> process it.
> (ipa_get_indirect_edge_target): New function.
> (devirtualization_time_bonus): New parameter known_aggs, pass it to
> ipa_get_indirect_edge_target. Update all callers.
> (ipcp_discover_new_direct_edges): New parameter aggvals. Pass it to
> ipa_get_indirect_edge_target_1 instead of calling
> ipa_get_indirect_edge_target.
> (create_specialized_node): Pass aggvlas to
> ipcp_discover_new_direct_edges.
>
> testsuite/
> * gcc.dg/ipa/ipcp-agg-9.c: New test.
>
OK,
thanks
Honza