This is an archive of the discontinued LLVM Phabricator instance.

[ThinLTO] Split NotEligibleToImport into legality and inlinability flags
ClosedPublic

Authored by tejohnson on Oct 16 2018, 4:06 PM.

Details

Summary

The NotEligibleToImport flag on the GlobalValueSummary was set if it
isn't legal to import (e.g. because it references unpromotable locals)
and when it can't be inlined (in which case importing is pointless).

I split out the inlinable piece into a separate flag on the
FunctionSummary (doesn't make sense for aliases or global variables),
because in the future we may want to import for reasons other than
inlining.

Diff Detail

Event Timeline

tejohnson created this revision.Oct 16 2018, 4:06 PM
davidxl added inline comments.Nov 5 2018, 10:42 AM
lib/Analysis/ModuleSummaryAnalysis.cpp
362

How much overhead does it incur if isVarArg check is removed? Having a check here prevent cross module inlining from happening even when inliner is enhanced in the future (which will incur effort to diagnose the problem).

tejohnson added inline comments.Nov 5 2018, 10:45 AM
lib/Analysis/ModuleSummaryAnalysis.cpp
362

In fact, I am planning a follow-on change to modify this, because the inliner has since been changed and some varargs are now inlineable. But I wanted to do that in a follow-on patch, to keep this one just about the refactoring of the flag, without any end-behavior change.

davidxl added inline comments.Nov 5 2018, 10:48 AM
lib/Analysis/ModuleSummaryAnalysis.cpp
362

then perhaps just change the attribute name to be 'NoInline' ?

tejohnson marked an inline comment as done.Nov 6 2018, 11:35 AM
tejohnson updated this revision to Diff 172809.Nov 6 2018, 11:36 AM

s/NotInlinable/NoInline/ as suggested in review

davidxl accepted this revision.Nov 6 2018, 11:38 AM

lgtm

This revision is now accepted and ready to land.Nov 6 2018, 11:38 AM
This revision was automatically updated to reflect the committed changes.