[PATCH] D28331: Improve PGO support for the new inliner

Piotr Padlewski via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Jan 20 03:41:27 PST 2017

Prazek added inline comments.

Comment at: lib/Analysis/InlineCost.cpp:48-56
 static cl::opt<int> HintThreshold(
     "inlinehint-threshold", cl::Hidden, cl::init(325),
     cl::desc("Threshold for inlining functions with inline hint"));
+static cl::opt<int>
+    ColdCallSiteThreshold("inline-cold-callsite-threshold", cl::Hidden,
+                          cl::init(45),
davide wrote:
> Is it possible to introduce another `cl::opt` here to disable this mode while in PGO? It would be extremely useful for testing the benefit of this feature compared to what's already there in PGO.
Probably passing normal inlining threshold would be the same as disabling this mode.

Comment at: lib/Analysis/InlineCost.cpp:660-661
         Threshold = MaxIfValid(Threshold, Params.HotCallSiteThreshold);
       } else if (PSI->isFunctionEntryHot(&Callee)) {
+        DEBUG(dbgs() << "Hot callee.\n");
         // If callsite hotness can not be determined, we may still know
Are there any plans in the nearest future to only rely on caller hotness/coldness and not on callee hotness?

Comment at: lib/Transforms/Utils/InlineFunction.cpp:1409
+  for (auto &OrigBB : *Callee) {
+    BasicBlock *ClonedBB = cast_or_null<BasicBlock>(VMap[&OrigBB]);
+    if (!ClonedBB)
auto *ClonedBB

Comment at: lib/Transforms/Utils/InlineFunction.cpp:1416
+  }
+  BasicBlock *EntryClone =
+      cast<BasicBlock>(VMap.lookup(&Callee->getEntryBlock()));


More information about the llvm-commits mailing list