This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] IPA REF: alias refactoring
- From: Jan Hubicka <hubicka at ucw dot cz>
- To: Martin Liška <mliska at suse dot cz>
- Cc: GCC Patches <gcc-patches at gcc dot gnu dot org>
- Date: Sat, 28 Jun 2014 08:49:54 +0200
- Subject: Re: [PATCH] IPA REF: alias refactoring
- Authentication-results: sourceware.org; auth=none
- References: <53AD41FB dot 3040409 at suse dot cz>
> Hi,
> this patch enhances alias manipulation for symtab_node. Honza suggested following changes.
>
> Patch is pre approved, will be committed if no comments and regressions.
> Bootstrapped on x86_64-pc-linux-gnu, regression tests have been running.
>
> Thanks,
> Martin
>
> gcc/ChangeLog:
>
> * cgraph.h (iterate_direct_aliases): New function.
> (FOR_EACH_ALIAS): New macro iterates all direct aliases for a node.
> * cgraph.c (cgraph_for_node_thunks_and_aliases): Usage of
> FOR_EACH_ALIAS added.
> (cgraph_for_node_and_aliases): Likewise.
> * cgraphunit.c (assemble_thunks_and_aliases): Likewise.
> * ipa-inline.c (reset_edge_caches): Likewise.
> (update_caller_keys): Likewise.
> * trans-mem.c (ipa_tm_execute): Likewise.
> *varpool.c (varpool_analyze_node): Likewise.
> (varpool_for_node_and_aliases): Likewise.
> * ipa-ref.h (first_referring_alias): New function.
> (last_referring_alias): Likewise.
I missed it last time around, I think first_alias/last_alias are better names.
first_alias is unused. If you added it I guess FOR_EACH_ALIAS should use it.
We probably also can bring has_aliases_p inline and implement it using
first_referring_alias.
> + /* If deleted item is IPA_REF_ALIAS, we have to move last
> + item of IPA_REF_LIST type to the deleted position. After that
> + we replace last node with deletion slot. */
> + struct ipa_ref *last_alias = list->last_referring_alias ();
You can avoid walking to last alias when the removed item is not IPA_REF_ALIAS.
> +
> + /* IPA_REF_ALIAS is always put at the beginning of the list. */
inserted?
OK with these changes (or if you already comitted, just do them incrementally)
Honza