[PATCH] D24638: [thinlto] Basic thinlto fdo heuristic

Mehdi AMINI via llvm-commits llvm-commits at lists.llvm.org
Tue Sep 27 18:17:15 PDT 2016


mehdi_amini added inline comments.

================
Comment at: llvm/trunk/lib/Transforms/IPO/FunctionImport.cpp:291
@@ +290,3 @@
+        Edge.second.Hotness == CalleeInfo::HotnessType::Hot
+            ? Threshold * ImportHotMultiplier
+            : Threshold;
----------------
tejohnson wrote:
> mehdi_amini wrote:
> > This does not seem correct to me. The multiplier should be apply only on the initial "seed" of the call chain, not at every chain.
> The multiplier is applied to each call independently based on whether it is marked hot. E.g. if we have:
> A -> B (hot call)
> and then B has 2 calls:
> B -> C1 (hot call)
> and
> B -> C2 (cold call)
> 
> I assume you are referring to A as the "seed" of the call chain? We want to treat the two different calls from B differently, it doesn't matter that the call from A -> B is hot.
Ok I can see the logic. But I'm not convinced by the multiplier effect.
i.e. right now as you get further from the original function, the threshold would *increase* since if I follow correctly we multiply by 3 here and by 0.7 later?
I may miss something here.

i.e. with a sequence of A->B->C->D (all hot) the threshold evolves this way:

- call to B: 100
- call to C: 100*3*0.7 = 210
- call to D: 210*3*0.7 = 441

I wonder if a Bonus wouldn't be more appropriate.



Repository:
  rL LLVM

https://reviews.llvm.org/D24638





More information about the llvm-commits mailing list