[PATCH] D16381: Adjust inlining thresholds based on callsite hotness

Z. Zheng via llvm-commits llvm-commits at lists.llvm.org
Thu Jan 21 13:18:19 PST 2016


zzheng added a comment.

A few suggestions to make code more easy to read. This patch of course needs a PGO expert to review.


================
Comment at: include/llvm/Transforms/IPO/InlinerPass.h:93
@@ -75,1 +92,3 @@
+  BlockCloningFunctor BCF;
+  FunctionCloningFunctor FCF;
 };
----------------
Where's these two being used?

================
Comment at: lib/Analysis/InlineCost.cpp:623
@@ +622,3 @@
+      BFA->getBlockFrequencyInfo(CallBB->getParent());
+  Optional<uint64_t> CallerEntryCount = Caller->getEntryCount();
+  if (HasPGOCounts) {
----------------
Unused variable: CallerEntryCount

================
Comment at: lib/Analysis/InlineCost.cpp:628
@@ +627,3 @@
+    if (Caller->getEntryCount()) {
+      uint64_t CallerEntryCount = Caller->getEntryCount().getValue();
+      uint64_t CallSiteCount =
----------------
Caller->getEntryCount() called twice, this looks simpler:


```
Optional<uint64_t> CallerEntryCount = Caller->getEntryCount();
if (CallerEntryCount.hasValue()) {
  uint64_t CallSiteCount =
          CallerEntryCount.getValue() * CallSiteFreq / CallerEntryFreq;
}
```

================
Comment at: lib/Analysis/InlineCost.cpp:1601
@@ +1600,3 @@
+  // We need to create a BlockFrequencyInfo object for F and store it.
+  //
+  // First create a dominator tree
----------------
Empty comment line, I think it can be removed.


http://reviews.llvm.org/D16381





More information about the llvm-commits mailing list