This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] Make inlining consistent in LTO and non-LTO mode (PR target/71991).
- From: Martin Liška <mliska at suse dot cz>
- To: Jan Hubicka <hubicka at ucw dot cz>
- Cc: gcc-patches at gcc dot gnu dot org
- Date: Mon, 31 Jul 2017 13:41:50 +0200
- Subject: Re: [PATCH] Make inlining consistent in LTO and non-LTO mode (PR target/71991).
- Authentication-results: sourceware.org; auth=none
- References: <41799444-fc9f-526e-e792-0bcb5f5d1440@suse.cz> <20170628142403.GA50911@kam.mff.cuni.cz> <47e34310-0938-3300-1d58-9e56186944f3@suse.cz> <20170628151846.GB76272@kam.mff.cuni.cz> <11a31789-d027-2313-baee-4ea1f460920b@suse.cz>
Honza?
Thanks,
Martin
On 06/30/2017 03:50 PM, Martin Liška wrote:
> On 06/28/2017 05:18 PM, Jan Hubicka wrote:
>>> On 06/28/2017 04:24 PM, Jan Hubicka wrote:
>>>>> - /* If callee has no option attributes, then it is ok to inline. */
>>>>> - if (!callee_tree)
>>>>> + /* If callee has no option attributes (or default),
>>>>> + then it is ok to inline. */
>>>>> + if (!callee_tree || callee_tree == target_option_default_node)
>>>>
>>>> I am not sure this actually makes sense, because target_option_default_node is not very
>>>> meaningful for LTO (it contains whatever was passed to LTO driver).
>>>
>>> I see!
>>>
>>> Perhaps one can check
>>>> for explicit optimization/machine attribute and whether caller and callee come from
>
> I'm not sure what you mean by 'for explicit optimization/machine attribute' ?
>
> I'm attaching a new patch, is it closer?
>
> Martin
>
>>>> same compilation unit, though this is quite hackish and will do unexpected things with COMDATs.
>>>
>>> That's quite cumbersome. Any other idea than marking the PR as won't fix?
>>
>> Yep, it is not prettiest. The problem is that the concept that callee can change semantics
>> when no explicit attribute is present is sloppy. I am not sure how many programs rely on it
>> (it is kind of surprising to see functions not being inlined into your target attribute annotated
>> function I guess).
>> Note that we check for original file in inliner already - this can be done by comparing lto_file_data
>> of corresponding cgraph nodes.
>>
>> Honza
>>
>