Add statistics to count overall devirtualized targets as well as the
various types of devirtualizations applied at callsites.
Details
- Reviewers
mingmingl - Commits
- rGced9a795fd84: [WPD] Add statistics
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
LGTM.
Only one question regarding whether the counter is intended for DevirtModule or DevirtIndex (or both)
llvm/lib/Transforms/IPO/WholeProgramDevirt.cpp | ||
---|---|---|
1155 | 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) |
Both, see inline reply below.
llvm/lib/Transforms/IPO/WholeProgramDevirt.cpp | ||
---|---|---|
1155 | 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. |
llvm/lib/Transforms/IPO/WholeProgramDevirt.cpp | ||
---|---|---|
1155 |
Ah I see your point. Basically DevirtIndex::run is called within runWholeProgramDevirtOnIndex in the thin-link step, and DevirtModule::run is called for thinLTO backend compile (after thin-link step). Thanks for pointing it out! |
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)