This is an archive of the discontinued LLVM Phabricator instance.

[ThinLTO] Don't try to import noinline functions
ClosedPublic

Authored by evgeny777 on Dec 21 2017, 5:57 AM.

Details

Summary

In the attached test case attempt to import function foo causes promotion of function bar, which prevents inlining it on codegen phase.

Diff Detail

Repository
rL LLVM

Event Timeline

evgeny777 created this revision.Dec 21 2017, 5:57 AM

Thanks! Couple suggestions.

lib/Analysis/ModuleSummaryAnalysis.cpp
309 ↗(On Diff #127870)

Move it up here and just OR into this bool.

test/ThinLTO/X86/noinline.ll
11 ↗(On Diff #127870)

It would be better to check for the non-import of foo directly. E.g. pass -save-temps to llvm-lto2, then ensure a define of foo does not exist in the llvm-dis of the resulting %t1.bc.imports file.

This would enable you to simplify the test - no need to have bar at all. Also the test will still work as expected in a possible future where we might decide to import bar as a local copy to avoid the promotion.

evgeny777 updated this revision to Diff 127990.Dec 22 2017, 1:12 AM

Addressed review comments

tejohnson accepted this revision.Dec 22 2017, 6:41 AM

LGTM with one minor comment nit.
Thanks!

lib/Analysis/ModuleSummaryAnalysis.cpp
310 ↗(On Diff #127990)

s/inline functions/import functions/

This revision is now accepted and ready to land.Dec 22 2017, 6:41 AM
This revision was automatically updated to reflect the committed changes.