[clang] [llvm] [InstrPGO] Instrument sampling profile based cold function (PR #109837)
    Lei Wang via llvm-commits 
    llvm-commits at lists.llvm.org
       
    Tue Oct  1 15:19:24 PDT 2024
    
    
  
wlei-llvm wrote:
> For your use case, can you use [ProfileSymbolList](https://github.com/llvm/llvm-project/blob/32ffc9fdc2cd422c88c926b862adb3de726e3888/llvm/include/llvm/ProfileData/SampleProf.h#L1509-L1512) to identify very cold functions (executed but unsampled) or are you indeed looking for functions that are never executed?
We are indeed focusing on functions that are never executed. The ProfileSymbolList is already used to identify functions with a “0” entry count, which is the target of the instrumentation in this work. We then aim to further distinguish the dead functions from them.
> 
> Will this be used to guide developers with diagnostics or more aggressive compiler driven optimizations?
We haven’t considered to use them for any compiler optimization. The primary goal is to improve the developer experience, just to take the general benefits from removing dead code: improving readability, good codebase maintainability, reducing build time, etc. Another potential use might be to verify the sampling PGO profile coverage/quality, say to check if we missed any functions that are actually hot. 
https://github.com/llvm/llvm-project/pull/109837
    
    
More information about the llvm-commits
mailing list