hans added a comment.

In D83013#2137607 <https://reviews.llvm.org/D83013#2137607>, @MaskRay wrote:

> `Opts.getProfileUse() != CodeGenOptions::ProfileNone ` in
>
>   Opts.CallGraphProfile = Opts.getProfileUse() != CodeGenOptions::ProfileNone 
> &&
>                             !Opts.DisableIntegratedAS;
>
>
> is redundant. CGProfile.cpp is a no-op if no function provides 
> `getEntryFreq()`.


It's a functional no-op, but it runs the BFI analysis, which as Nikita pointed 
out above adds some compile-time cost. Not scheduling the pass unless we're 
using profile info seems like a reasonable way to avoid that cost to me.

The alternative of using LazyBlockFrequencyInfoPass and checking 
PSI->hasProfileSummary() first would also work I guess. If you think that's 
cleaner, maybe that's the better way to go.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D83013



_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to