Hi,

On Tue, Feb 19 2019, Martin Liška wrote:
> On 2/14/19 11:19 AM, Jan Hubicka wrote:
>>

...

>> Next stage1 we should also teach the callback to ignore edges of calls
>> that are not being optimized.
>
> I'm sending patch for that.

...

> gcc/ChangeLog:
>
> 2019-02-19  Martin Liska  <mli...@suse.cz>
>
>       * ipa-cp.c (ignore_edge_p): New function.
>       (build_toporder_info): Use it.
>       * ipa-inline.c (ignore_edge_p): New function/
>       (inline_small_functions): Use it.
>       * ipa-pure-const.c (ignore_edge_for_nothrow):
>       Verify opt_for_fn for caller and callee.
>       (ignore_edge_for_pure_const): Likewise.
>       * ipa-reference.c (ignore_edge_p): Extend to check
>       for opt_for_fn.
>       * ipa-utils.c (searchc): Refactor.
>       * ipa-utils.h: Fix coding style.
> ---
>  gcc/ipa-cp.c         | 18 +++++++++++++++++-
>  gcc/ipa-inline.c     | 12 +++++++++++-
>  gcc/ipa-pure-const.c | 17 ++++++++++++-----
>  gcc/ipa-reference.c  | 13 ++++++++++---
>  gcc/ipa-utils.c      |  3 +--
>  gcc/ipa-utils.h      |  2 --
>  6 files changed, 51 insertions(+), 14 deletions(-)
>
> diff --git a/gcc/ipa-cp.c b/gcc/ipa-cp.c
> index 442d5c63eff..004b3a34b1c 100644
> --- a/gcc/ipa-cp.c
> +++ b/gcc/ipa-cp.c
> @@ -806,6 +806,21 @@ public:
>    {}
>  };
>  
> +/* Skip edges from and to nodes without ipa_cp enabled.
> +   Ignore not available symbols.  */
> +
> +static bool
> +ignore_edge_p (cgraph_edge *e)
> +{
> +  enum availability avail;
> +  e->callee->function_or_virtual_thunk_symbol (&avail, e->caller);

Can't the return value of this call be directly fed...

> +
> +  return (avail <= AVAIL_INTERPOSABLE
> +       || !opt_for_fn (e->caller->decl, flag_ipa_cp)
> +       || !opt_for_fn (e->callee->function_symbol ()->decl,

...here instead of calling function_symbol... which does not look
through thunks which IMHO you want, even if only for consistency.

Otherwise, it the IPA-CP bits obviously look good,

Martin

Reply via email to