[PATCH] D123152: [WPD] Add statistics

Teresa Johnson via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Apr 5 15:04:30 PDT 2022


tejohnson added a comment.

In D123152#3430851 <https://reviews.llvm.org/D123152#3430851>, @luna wrote:

> LGTM.
>
> Only one question regarding whether the counter is intended for DevirtModule or DevirtIndex (or both)

Both, see inline reply below.



================
Comment at: llvm/lib/Transforms/IPO/WholeProgramDevirt.cpp:1155
                              TheFn->stripPointerCasts()->getName(), OREGetter);
+      NumSingleImpl++;
       auto &CB = VCallSite.CB;
----------------
luna wrote:
> If I'm reading correctly, `NumSingleImpl` is incremented in `DevirtModule::applySingleImplDevirt`, but not for `DevirtIndex::trySingleImplDevirt`.
> 
> I'm wondering if this is intended for the purpose of this cl. If yes, maybe describe something like 
> 
> The counter is incremented in regular LTO (or ThinLTO, etc)
Note that applySingleImplDevirt is called both for regular and thin LTO - for ThinLTO it is called during the backends, from importResolution(). This counter is keeping track of the number of actual single impl devirtualizations (i.e. callsites where that optimization is applied).

During the whole program portion (both regular and thin LTO) we keep track of the number of target functions that had devirtualizations in the NumDevirtTargets statistic.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D123152/new/

https://reviews.llvm.org/D123152



More information about the llvm-commits mailing list