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

via llvm-commits llvm-commits at lists.llvm.org
Mon Feb 5 12:59:01 PST 2024


WenleiHe wrote:

> > FWIW we've tried this with sampling PGO in the past. While on paper this seems like an obvious thing to do, in reality aggressively tuning down opt level for cold functions can lead to regression since profile isn't always accurate.
> > That said, as long as this change only provides options for users to make decision and not changing the default behavior, it's probably fine.
> 
> IIUC, this won't affect sample profile unless you mark the sample profile as "accurate" (e.g. `-profile-sample-accurate`). But I should double check.

This patch should not affect the behavior of "accurate". Many people use the "accurate" mode by default now (with profiled symbol list populated when generating sample pgo profile). So we don't want surprise perf churn. 


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


More information about the llvm-commits mailing list