Page MenuHomePhabricator

ThinLTO : Import always_inline functions irrespective of the threshold
ClosedPublic

Authored by Bharathi on Fri, Nov 8, 9:37 AM.

Details

Summary

A user can force a function to be inlined by specifying the always_inline attribute. Currently, thinlto implementation is not aware of always_inline functions and does not guarantee import of such functions, which in turn can prevent inlining of such functions.

Diff Detail

Event Timeline

Bharathi created this revision.Fri, Nov 8, 9:37 AM

I just started to look at this (added a minor comment below) - but could you please re-upload this with full context so that it is easier to review?

llvm/include/llvm/IR/ModuleSummaryIndex.h
550

document

hiraditya added inline comments.Fri, Nov 8, 9:56 AM
llvm/test/ThinLTO/X86/Inputs/funcimport_alwaysinline.ll
11

the definition of \#1 and \#0 seems to be missing?

tejohnson added inline comments.Fri, Nov 8, 10:39 AM
llvm/test/ThinLTO/X86/Inputs/funcimport_alwaysinline.ll
11

Probably can just remove the attribute numbers here since they aren't needed.

Bharathi updated this revision to Diff 228498.Fri, Nov 8, 11:05 AM

Uploaded with full context and addressed review comments received so far.

Thanks for working on this! One suggestion for test cleanup below.

llvm/test/ThinLTO/X86/funcimport_alwaysinline.ll
30

I don't think you need all these calls to @bar (or any, or the def of @bar). I believe this was from another test that was testing the import-instr-limit. Since you have 0 you don't need anything here.

Bharathi updated this revision to Diff 228501.Fri, Nov 8, 11:42 AM
Bharathi marked 4 inline comments as done.

Clean up test case.

tejohnson accepted this revision.Fri, Nov 8, 11:53 AM

LGTM thanks!

This revision is now accepted and ready to land.Fri, Nov 8, 11:53 AM
This revision was automatically updated to reflect the committed changes.