[llvm] [InlineCost] Disable cost-benefit when sample based PGO is used (PR #86626)

Wei Xiao via llvm-commits llvm-commits at lists.llvm.org
Tue Mar 26 18:14:46 PDT 2024


williamweixiao wrote:

> I think reverting the patch is probably the best. IIUC:
> 
> * @HaohaiWen's internal loads perform better with the cost-benefit analysis enabled for sample PGO.
> * @helloguo's internal loads perform worse with the cost-benefit analysis enabled for sample PGO.
> * I don't have numbers our internal loads right now although I do remember that most of the inlining opportunities are taken by the sample loader inliner `llvm/lib/Transforms/IPO/SampleProfile.cpp`.
> 
> In a case like this, I am inclined to ask those who do see benefits to manually turn on the cost-benefit analysis (i.e. `-mllvm -inline-enable-cost-benefit-analysis`). IMHO, features turned on by default should benefit broad audience.
> 
> Thoughts?

I'm just curious about why cost-benefit analysis degrades performance for sample PGO while not for instrumentation PGO. Have you analyzed the root cause of performance regression on your multiple internal workloads? Is it because sample PGO profile quality is worse than that of instrumentation profile or any other reasons? I understand that reverting is the easiest way to fix internal performance issue but it will also limit sample PGO to expose more optimization opportunities.

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


More information about the llvm-commits mailing list