This is an archive of the discontinued LLVM Phabricator instance.

[PartialInlining] Add support in partial inliner to use cost analysis in inliner
ClosedPublic

Authored by davidxl on Apr 28 2017, 4:59 PM.

Details

Summary

Added all the hooks such that getInlineCost interface can be used in partial inliner. It is important to make sure the partial inliner share the cost model as the primary one.
(partial ininlining is still not enabled)

Diff Detail

Event Timeline

davidxl created this revision.Apr 28 2017, 4:59 PM
davide added a subscriber: davide.Apr 28 2017, 5:07 PM
davide added inline comments.
lib/Transforms/IPO/PartialInlining.cpp
111

Why don't we preserve TTI? (not that it matters for performances, but)

302–306

Can you add a test that triggers this?

309–323

and these as well, maybe

davidxl updated this revision to Diff 97250.Apr 30 2017, 5:04 PM
davidxl marked an inline comment as done.

Address review feedback -- add one more test case.

eraman edited edge metadata.May 1 2017, 2:27 PM

LGTM with a few minor comments.

lib/Transforms/IPO/PartialInlining.cpp
80

I know this is how it is in InlineCost.cpp, but still: why not use function_ref everywhere?

302

This is fine, but perhaps you can filter out functions with always_inline attribute earlier and not do the analysis at all. That can be done in a separate patch. Similarly for noinline as well.

475

This should also be moved into the loop above (and the description of the statistic changed to indicate that it is the number of callsites)

This revision was automatically updated to reflect the committed changes.
davidxl marked an inline comment as done.