[PATCH] D73817: Add PassManagerImpl.h to hide implementation details
Reid Kleckner via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Mon Feb 3 14:38:33 PST 2020
rnk added a comment.
@aprantl, thanks, I fixed it in a follow-up module.map change: rGf8c4d70d1138 <https://reviews.llvm.org/rGf8c4d70d11388ddbf3ccc63ca4ea35d09a987d41>.
In D73817#1855806 <https://reviews.llvm.org/D73817#1855806>, @dblaikie wrote:
> Any idea why is this class being instantiated/spending a lot of time on that instantiation if it's the subject of an explicit instantiation decl/def?
As for why it's instantiated, most TUs instantiate AnalysisManager::getResult. I see 83 files with call sites in lib/Transforms. So, it is actually commonly required functionality. I haven't nailed down if it gets instantiated accidentally just from including PassManager.h. I think the answer is no, but either way this is an improvement.
As for why it's expensive, there are two DenseMaps in AnalysisManager, and this function inserts into both maps. In -ftime-trace, those instantiations happen to be attributed to getResultImpl. It's possible that some of those DenseMapPair & std::pair instantiations happen later anyway after this change, but you can see the memory usage reduction is real.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D73817/new/
https://reviews.llvm.org/D73817
More information about the llvm-commits
mailing list