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

Jun Bum Lim via llvm-commits llvm-commits at lists.llvm.org
Fri Jan 22 07:43:33 PST 2016


junbuml added inline comments.

================
Comment at: lib/Analysis/InlineCost.cpp:1607
@@ +1606,3 @@
+  LoopInfo LI;
+  LI.analyze(DT);
+  // Then compute BranchProbabilityInfo
----------------
You can call  LoopInfo LI(DT) instead of LoopInfo LI;   LI.analyze(DT);

================
Comment at: lib/Analysis/InlineCost.cpp:1610
@@ +1609,3 @@
+  BranchProbabilityInfo BPI;
+  BPI.calculate(*F, LI);
+  // Finally compute BlockFrequencyInfo
----------------
BranchProbabilityInfo BPI(*F, LI); will call calculate(F, LI);

================
Comment at: lib/Analysis/InlineCost.cpp:1613
@@ +1612,3 @@
+  BlockFrequencyInfo *BFI = new BlockFrequencyInfo;
+  BFI->calculate(*F, BPI, LI);
+  BFM[F] = BFI;
----------------
You can also call BlockFrequencyInfo(*F, BPI, LI), which call calculate(*F, BPI, LI); inside.

================
Comment at: lib/Analysis/InlineCost.cpp:1467
@@ +1466,3 @@
+
+bool llvm::IsColdCallSite(CallSite CS, BlockFrequencyAnalysis *BFA) {
+  Function *Caller = CS.getCaller();
----------------
I cannot see any use of this function. Are you planing to hook this function in heuristic in this patch ? 


http://reviews.llvm.org/D16381





More information about the llvm-commits mailing list