This is the mail archive of the mailing list for the GCC project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] Make inlining consistent in LTO and non-LTO mode (PR target/71991).

> 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
> > 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.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]