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

Easwaran Raman via llvm-commits llvm-commits at lists.llvm.org
Wed Feb 3 16:21:28 PST 2016


eraman marked 4 inline comments as done.
eraman added a comment.

In http://reviews.llvm.org/D16381#342401, @davidxl wrote:

> Please also add a test case that covers proper profile update with always inline as intended for the refactoring.


Done. I have added the alwaysinline attribute to the callee in the first test case and have run it with -always-inline alone.


================
Comment at: include/llvm/Analysis/InlineCost.h:152
@@ -132,1 +151,3 @@
+/// \brief Return estimated count of the block \p BB.
+Optional<uint64_t> getBlockCount(BasicBlock *BB, BlockFrequencyAnalysis *BFA);
 }
----------------
davidxl wrote:
> I suggest making this a member method of BFA. Also provide a wrapper method -- this will be the primary API used by other clients for callsite hotness:
> 
> Optional<uint64_t> getCallsiteCount(CallSite CS);
I agree that this needs to be moved somewhere else, but I am not convinced BFA is that place. In the other profile refactoring patch, I have created a ProfileCommon.h. Perhaps that is a good place for profile related urility methods like this?

================
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)
----------------
davidxl wrote:
> Can you make these two calls in a block that is not the entry block?
That does not matter for the purposes of this test case. 


http://reviews.llvm.org/D16381





More information about the llvm-commits mailing list