[PATCH] D113296: [FS-AFDO][llvm-profgen] Generate profile with FS-AFDO discriminator

Hongtao Yu via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Nov 30 15:40:09 PST 2021


hoy accepted this revision.
hoy added inline comments.


================
Comment at: llvm/tools/llvm-profgen/ProfileGenerator.h:42
+  static uint32_t getDuplicationFactor(unsigned Discriminator,
+                                       bool IsFSD = UseFSDiscriminator) {
+    return IsFSD ? 1
----------------
wlei wrote:
> hoy wrote:
> > nit: please use full name `ProfileGeneratorBase::UseFSDiscriminator` for static fields.
> > 
> > Also, can we check `Binary->useFSDiscriminator()` instead of parsing in an parameter? 
> > nit: please use full name ProfileGeneratorBase::UseFSDiscriminator for static fields.
> Fixed, thanks!
> 
> > Also, can we check Binary->useFSDiscriminator() instead of parsing in an parameter?
> There is one exception that calling getBaseDiscriminator in ProfiledBinary::getExpandedContext where we don't have the ProfileGenerator instance, so that needs to make it static.
> 
> see the below code:
> ```
>     Frame.Location.Discriminator = ProfileGeneratorBase::getBaseDiscriminator(
>         Frame.Location.Discriminator, UseFSDiscriminator);
> ```
> 
> 
I see. Thanks for pointing it out. 


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D113296



More information about the llvm-commits mailing list