In the attached test case attempt to import function foo causes promotion of function bar, which prevents inlining it on codegen phase.
Details
Diff Detail
Event Timeline
Thanks! Couple suggestions.
lib/Analysis/ModuleSummaryAnalysis.cpp | ||
---|---|---|
309 | Move it up here and just OR into this bool. | |
test/ThinLTO/X86/noinline.ll | ||
11 | 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. |
LGTM with one minor comment nit.
Thanks!
lib/Analysis/ModuleSummaryAnalysis.cpp | ||
---|---|---|
310 | s/inline functions/import functions/ |
Move it up here and just OR into this bool.