[clang-tools-extra] [llvm] [clang] [PGO] Add ability to mark cold functions as optsize/minsize/optnone (PR #69030)
via cfe-commits
cfe-commits at lists.llvm.org
Mon Feb 5 13:12:31 PST 2024
WenleiHe wrote:
> I don't understand, if you're saying the profile is accurate, then those functions are actually cold, so we should be able to mark them as optsize?
Accurate is not black or white. The current heuristic requires certain level of accuracy to be effective. If you make the heuristics more aggressive (like what this patch is doing), you're raising the requirement of what can be considered accurate, and profile not meeting that new requirement could see regression with new heuristic.
Whether a function is cold or not also depends on what is the calling context and how inlining is done. All that makes function level annotation inherently inaccurate when done before inlining. Not that we shouldn't try it, but it's not as clear cut as it appears to be, and we need to be careful.
https://github.com/llvm/llvm-project/pull/69030
More information about the cfe-commits
mailing list