[PATCH] D149597: [FS-AFDO] Do not load non-FS profile in MIR loader.

Wenlei He via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed May 10 15:18:48 PDT 2023


wenlei accepted this revision.
wenlei added a comment.
This revision is now accepted and ready to land.

In D149597#4333318 <https://reviews.llvm.org/D149597#4333318>, @hoy wrote:

> In D149597#4333284 <https://reviews.llvm.org/D149597#4333284>, @wenlei wrote:
>
>>> However for lines that do have a zero FSdiscriminator, line+FSdiscriminator can accidentally match the base counter while all other lines still load nothing.
>>
>> Can this also happen when input profile is actually a FS profile? which is also not good? Or is that less of a problem when input profile is FS because we will also load other samples whose FSDiscriminator is non-zero?
>
> I think it's not a problem for FS profiles. Given a FS profile, a zero discriminator is a valid FS discriminator which means the counter is not aggregated and there will be no more than one line loading that counter on MIR. For a non-FS profile, we cannot tell if a zero is a valid FS discriminator unless the file-level flag is checked.

ok, that makes sense since profile reader actually masks discriminator based on the current FSDiscriminator mask.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D149597



More information about the llvm-commits mailing list