This is the required plumbing to add PGO to the new PM (which allows to test the changes to make the inliner profile-aware).
As long as several of us are interested in this, I decided to share it early (in the hope to save to somebody some boring typing).
I'll upload the clang bits soon, but I have some comments.
- The default threshold for the inliner run used to be a tunable. I just hardcoded the value of the cl::opt. If people think it's valuable to thread this from the frontend down to the optimizer, happy to (but I wouldn't keep the cl::opt around). My take is that this option shouldn't be exposed.
- There seems to be a comment about the hint threshold of the inliner. I blatantly cargo culted that from the old PM, but maybe should be removed ? (or we should get around to do the required performance testing to tune it)
Thanks!
Pass and store an optional rather than a pointer? Removes lifetime concerns and ownersihp questions, and this seems a not-scary data type to copy.