This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH, stage1] Construct ipa_reduced_postorder always for overwritable (PR ipa/89009).
- From: Martin Liška <mliska at suse dot cz>
- To: Martin Jambor <mjambor at suse dot cz>, Jan Hubicka <hubicka at ucw dot cz>
- Cc: gcc-patches at gcc dot gnu dot org
- Date: Wed, 6 Mar 2019 11:05:33 +0100
- Subject: Re: [PATCH, stage1] Construct ipa_reduced_postorder always for overwritable (PR ipa/89009).
- References: <376f68fe-91e9-20dc-894d-eac4e085b7dc@suse.cz> <20190211085231.vyj4z4afev5mv2n5@kam.mff.cuni.cz> <ri6zhr2phys.fsf@suse.cz> <20190211134913.gpyri2hpsws4hmjb@kam.mff.cuni.cz> <a09bc622-d40f-33e9-f080-2d089055d325@suse.cz> <20190214101935.ss7xmiidftict626@kam.mff.cuni.cz> <b6c7fda5-bcee-f0b1-b796-4b58ee6f972e@suse.cz> <ri6mumrsyf8.fsf@suse.cz> <ae2e4292-a058-29bf-ee79-676828735034@suse.cz>
@Honza: PING^1
On 2/20/19 10:10 AM, Martin Liška wrote:
> On 2/19/19 2:25 PM, Martin Jambor wrote:
>> 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 <mliska@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.
>
> Yes, I like it.
>
> There's a new version of the patch I've just tested.
>
> Martin
>
>>
>> Otherwise, it the IPA-CP bits obviously look good,
>>
>> Martin
>>
>