[PATCH] D24976: [thinlto] Don't decay threshold for hot callsites

Mehdi AMINI via llvm-commits llvm-commits at lists.llvm.org
Wed Sep 28 11:35:12 PDT 2016


mehdi_amini added inline comments.

================
Comment at: lib/Transforms/IPO/FunctionImport.cpp:350
@@ -341,3 +349,3 @@
     // Insert the newly imported function to the worklist.
-    Worklist.push_back(std::make_pair(ResolvedCalleeSummary, Threshold));
+    Worklist.emplace_back(ResolvedCalleeSummary, Threshold, IsHotCallsite);
   }
----------------
Prazek wrote:
> mehdi_amini wrote:
> > As mentioned in D24638, you could achieve the same result by adjusting the Threshold when pushing on the stack instead of passing more context to the next iteration and delaying the adjustment.
> > 
> > 
> just to make sure - you want to apply the threshold: lines
>   if (IsHotCallsite)
>       Threshold = Threshold * ImportHotInstrFactor;
>   else
>       Threshold = Threshold * ImportInstrFactor;
> 
> here, and don't do any threshold changes in the while loop? (So worklist will only contain FunctionSummary - because threshold and my bool won't be needed)
> 
> If so, then it seems like a good idea!
Right: doing all the threshold management at the same place.


https://reviews.llvm.org/D24976





More information about the llvm-commits mailing list