[PATCH] D92780: [InlineCost] Implement cost-benefit-based inliner

Kazu Hirata via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Dec 11 16:57:38 PST 2020


kazu marked 5 inline comments as done.
kazu added a comment.

PTAL.  Thanks!



================
Comment at: llvm/lib/Analysis/InlineCost.cpp:632
+      // we define a cold basic block to be one that's never executed.
+      if (BlockFrequencyInfo *BFI = GetBFI ? &(GetBFI(F)) : nullptr) {
+        auto ProfileCount = BFI->getBlockProfileCount(BB);
----------------
davidxl wrote:
> Are these guards needed? It is already checked in costBenefitAnalysis.  Perhaps move the checking in a common place and set it to boolean variable: costBenefitAnalysisEnabled and the value of the variable can be checked here.
I've created a function called isCostBenefitAnalysisEnabled.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D92780



More information about the llvm-commits mailing list