This is an archive of the discontinued LLVM Phabricator instance.

[NewPM/Inliner] Customize threshold based on optlevel and sizelevel
ClosedPublic

Authored by eraman on Jun 16 2017, 5:42 PM.

Details

Summary

(Note: It will be cleaner to expose the OptimizationLevel enum to InlineCost and Inliner instead of mapping back from the enum to SizeLevel/OptLevel, but I don't know what is the right header file to move the enum into)

Event Timeline

eraman created this revision.Jun 16 2017, 5:42 PM
chandlerc added inline comments.Jun 27 2017, 4:33 PM
lib/Passes/PassBuilder.cpp
563

As discussed in person, I would just call 'getInlineParams' here and use the existing constructor of the pass object.

eraman updated this revision to Diff 104333.Jun 27 2017, 6:15 PM

Call getInlineParams in PassBuilder and pass the Params object to the existing Inliner constructor.

chandlerc accepted this revision.Jun 27 2017, 6:27 PM

Minor nitpick below. Feel free to submit.

lib/Passes/PassBuilder.cpp
872–873

Noting that this is duplicated, maybe a static helper function:

static InlineParams getInlineParamsFromOptLevel(...)

And have it do the call to getInlineParams?

This revision is now accepted and ready to land.Jun 27 2017, 6:27 PM
eraman updated this revision to Diff 104406.Jun 28 2017, 6:30 AM

Address Chandler's comments.

This revision was automatically updated to reflect the committed changes.