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

Arthur Eubanks via cfe-commits cfe-commits at lists.llvm.org
Tue Feb 13 11:10:33 PST 2024


aeubanks wrote:

Sorry, I thought I had waited long enough and that the previous comments were addressed. Will address your comments in a follow-up.

> This is good to go only because it's off by default. Otherwise it's not.

> Sample PGO profile has inline context, so in the profile, we may have foo as cold and bar->foo as hot, but if later inliner rejects bar->foo inlining, foo can be hot. So marking foo as cold pre-inline can still be inaccurate (and not conservative).

Is this the main objection? I didn't understand this sentence the first time reading it. The Sample PGO inliner runs before this pass so it shouldn't be affected, as mentioned before. By "later inliner" do you mean the normal CGSCC inliner? Is it possible to have a call site be hot but the callee be cold?

I don't currently have a plan to make this pass do anything by default, but I would like to resolve objections anyway. Using the `optsize` setting for this pass seems like it could be the default perhaps further in the future.

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


More information about the cfe-commits mailing list