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

Rahman Lavaee via llvm-commits llvm-commits at lists.llvm.org
Fri Jan 3 15:00:58 PST 2025


rlavaee wrote:

It seems that this feature uses the `SHT_LLVM_BB_ADDR_MAP` infrastructure for function address mapping for a per-function metadata with no need for basic block address mapping.  While it might be tempting to reuse the infrastructure for this purpose (probably because of interaction with pgo-analysis-map), I think it may overload the parsing and emitting code in the long run.

The alternative is to define a new [extension](https://llvm.org/docs/Extensions.html) and implement the parsing/emitting logic separately. Since your structure is basically a map from function addresses to counts, it shouldn't be too hard to implement, though I agree you would need to add code in different places (ObjectYaml, Object, Codegen). @jh7370 may have an opinion here.

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


More information about the llvm-commits mailing list