[llvm] [SHT_LLVM_BB_ADDR_MAP] Add a new PGOAnalysisMap feature to emit dynamic instruction count (PR #119303)

Lei Wang via llvm-commits llvm-commits at lists.llvm.org
Tue Dec 10 10:36:09 PST 2024


wlei-llvm wrote:

> We already have llvm-cm in https://github.com/google/gematria that is able to do this and also apply more fancy cost modelling techniques. If there's interest in that tooling, we can also work on upstreaming (https://discourse.llvm.org/t/rfc-llvm-cm-cost-model-evaluation-for-object-files-machine-code/71502).

Hi @boomanaiden154 , This is very cool, thank you for the pointer, I will take a deep look later. 

> Can you explicate on this argument a bit more? I don't see how this would save binary size when the assembly is already there. It's pretty trivial to parse the basic block frequency and multiply it by the number of instructions in the block in an external tool. 

Sorry the description wasn't clear. I meant to skip all the BB entries, BB frequency/probability things by using this https://github.com/llvm/llvm-project/pull/114447, so that we only have the dyn-inst-count emitted, this can save ~95% of the section `SHT_LLVM_BB_ADDR_MAP `.   Updated the PR description. 


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


More information about the llvm-commits mailing list