[llvm] [LTO][Pipelines] Add 0 hot-caller threshold for SamplePGO + FullLTO (PR #135152)
Tianle Liu via llvm-commits
llvm-commits at lists.llvm.org
Sun Apr 13 22:25:32 PDT 2025
tianleliu wrote:
Hi Mingming, very appreciate for your detailed answer!
As you are mentioning button-up call graph based inline, I have a question(not closely about this patch) about inlining in SampleProfileLoaderPass.
In the button-up call graph based inline, each inlined function firstly runs a pipeline of optimization before it inlined. For example, in buildModuleSimplificationPipeline, callee function would first runs pre-inline passes, which contains a series of optimizations, then is inlined. And even after inlining, the caller function does buildFunctionSimplificationPipeline, which also contains a series of optimizations, before it is inlined by other functions.
But inline in SampleProfileLoaderPass, inlining (SampleProfileLoader::inlineHotFunctions) is top-down order without doing any optimization for callee functions. Considering many optimizations are top-down scanning in BB/function for finding chance, So I have a concern that some hot short function's optimization chance might be broken after it is inlined in a bigger context.
If my above point is right, I have an immature thought that we can just only mark/record the inlinings context in SampleProfileLoaderPass but defer the implementation of inline in general inline pipelines/passes. So that all functions would do full optimizations before they are inlined.
Do you have idea about my thought?
https://github.com/llvm/llvm-project/pull/135152
More information about the llvm-commits
mailing list