[llvm] Implements PGOBBAddrMap in Object and ObjectYAML with tests [1/5] (PR #71750)

Rahman Lavaee via llvm-commits llvm-commits at lists.llvm.org
Fri Nov 10 10:10:03 PST 2023


rlavaee wrote:

Haven't read the code yet, but this is my high-level comment:

> Alternatively, we could just place all new fields into BBAddrMap. This makes the encoding/decoding code simpler. It has the cost of changing some behavior in the original API. It also adds unnecessary fields for anyone wanting to just use the regular BBAddrMap.

We can distinguish between the ELF representation (SHT_LLVM_BB_ADDR_MAP) and the in-memory representation (`BBAddrMap` which is returned by `readBBAddrMap`). It's perfectly fine to add new fields to the ELF representation. This is why the `feature` and `version` attributes exist. This means we don't need to define a new section type and duplicate the shared encoding/decoding logic. However, it's a sensible idea to define a new `PGOBBAddrMap` class so we don't clobber the existing `BBAddrMap` with unnecessary fields. WDYT?


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


More information about the llvm-commits mailing list