[clang] [llvm] [PGO] Add ability to mark cold functions as optsize/minsize/optnone (PR #69030)

David Li via cfe-commits cfe-commits at lists.llvm.org
Tue Jan 30 11:49:35 PST 2024


david-xl wrote:

> How does this relate to the existing `shouldOptimizeForSize(Function&, ...)` and `shouldOptimizeForSize(MachineFunction&, ...)` APIs which appear to provide similar functionality at a first glance. If they are the same, then we should have a plan in place to cleanup and only have one system afterwards, if there are important differences, then I wouldn't mind some comments explaining them.

This patch allows more user control on the cold function action types.

Another difference is that the existing API can be invoked in postInline passes which can see more cold functions after inlining. To replace those APIs, the new pass will need to run again post-inlining.

https://github.com/llvm/llvm-project/pull/69030


More information about the cfe-commits mailing list