[PATCH] D16381: Infrastructure to allow use of PGO in inliner

David Li via llvm-commits llvm-commits at lists.llvm.org
Tue Feb 2 16:35:26 PST 2016


davidxl added inline comments.

================
Comment at: include/llvm/Transforms/IPO/InlinerPass.h:80
@@ -69,1 +79,3 @@
+  /// Are we using profile guided optimization?
+  bool PGOMode;
   /// shouldInline - Return true if the inliner should attempt to
----------------
--> hasProfileData

================
Comment at: lib/Transforms/IPO/Inliner.cpp:432
@@ +431,3 @@
+
+static bool isPGOMode(Module &M) {
+  // We check for the presence of MaxFunctionCount in the module.
----------------
hasProfileData

================
Comment at: lib/Transforms/IPO/Inliner.cpp:578
@@ +577,3 @@
+        updateEntryCount(CallSiteBlock, Callee);
+        copyBlockFrequency(CallSiteBlock, CallSuccessor->getParent());
+
----------------
add a comment here.

================
Comment at: test/Transforms/Inline/function-count-update.ll:4
@@ +3,3 @@
+; This tests that the function count of a callee gets correctly updated after it
+; has been inlined into a single callsite.
+
----------------
into two callsites in the same block.

================
Comment at: test/Transforms/Inline/function-count-update.ll:20
@@ +19,3 @@
+define i32 @caller(i32 %n) !prof !2 {
+  %i = call i32 @callee(i32 %n)
+  %j = call i32 @callee(i32 %i)
----------------
Can you make these two calls in a block that is not the entry block?


http://reviews.llvm.org/D16381





More information about the llvm-commits mailing list