[PATCH] D107173: [CSSPGO] Introduce MD5-based context-sensitive profile

Hongtao Yu via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Jul 30 13:06:02 PDT 2021


hoy added a comment.

In D107173#2917382 <https://reviews.llvm.org/D107173#2917382>, @wmi wrote:

> Thanks for the work to reduce the CS profile size! It is something we really need.
>
> I am also trying it in a slightly different way. 
> For "[main:3.1 @ _Z5funcBi]:120:19" in your example, I split the context string into multiple tuples of {string, line, discriminator}: 
> {main, 3, 1} {_Z5funcBi, 0, 0}, and for each name in the tuple, we will only save the index to the name table. So we will not have new entry in the name table for different contexts.
>
> In this way, we won't have any increase in the name table section compared with non-CS profile even when we uses string based name. We do need to have a new section called CSNameTable to store the tuples. When we read the section, we will recontruct the context string from the tuple and the rest of the profile handling will have no change.
>
> In this way, on top of it we can also apply md5 to the nametable using existing md5 mechanism, to further compress the name table section.
>
> I havn't finished the implemention, but I am close to it. It will be good to discuss how we converge the effort here.

@wmi  good to know you are also working on improving the efficiency. Thanks!
The string split design sounds interesting. I'm curious to know more about it, like how context strings are split in the profile, and how they are constructed and represented in the compiler.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D107173



More information about the llvm-commits mailing list