[PATCH] D93082: Prepend "__bb" to all basic block section symbols.

Rahman Lavaee via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sun Dec 13 23:55:41 PST 2020


rahmanl added a comment.

In D93082#2450638 <https://reviews.llvm.org/D93082#2450638>, @tmsriram wrote:

> In D93082#2449369 <https://reviews.llvm.org/D93082#2449369>, @rahmanl wrote:
>
>> It may be worthwhile to think about removing the second dot from the naming, i.e., `foo.__bb.N` -> `foo.__bbN` . The reason is that this further distinguishes the symbol name from  symbols like `__cxx_global_var_init.N` plus it saves one character.
>
> The -funique-internal-linkage-names option uses ".__uniq." so I wanted to stick to that convention.   I am not sure what you mean when you say further distinguishing.

My focus is more on how this plays out with `-fbasic-block-sections=list=`. 
With `.__bb.N` we may end up having four different symbols for a function `foo`, `foo.cold`, `foo.eh`, and `foo.__bb.N`. How would a symbolizer/tool identify these as basic block sections of the same function? My guess is that it will use first inspect the last extension. If it's `.cold` or `.eh`, then the remainder is the actual function name, otherwise, if it's a number, it would have to inspect the prior extension again to make sure it's `.__bb` (hence my note about distinguishing with `__cxx_global_var_init.N`.
`.__uniq` does not have the same problem because there is only one way for the extension.

Another (rather weak) concern is that the prefix `__bb` may reflect that the section comes from a basic block of the same id. This is only the case in `-fbasic-block-sections=all`. With `=list` the section ID number may not be the same as the basic block which begins that section.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D93082/new/

https://reviews.llvm.org/D93082



More information about the llvm-commits mailing list