[llvm] [MemProf] Track and report profiled sizes through cloning (PR #98382)
Snehasish Kumar via llvm-commits
llvm-commits at lists.llvm.org
Thu Jul 11 09:30:52 PDT 2024
================
@@ -935,6 +948,7 @@ ModuleSummaryIndex llvm::buildModuleSummaryIndex(
CantBePromoted.insert(GV->getGUID());
// Create the appropriate summary type.
if (Function *F = dyn_cast<Function>(GV)) {
+ std::vector<AllocInfo> EmptyAllocInfo;
----------------
snehasish wrote:
Thanks, it makes sense to me now. The copy-constructor for AllocInfo is deleted due to the new unique_ptr member. I think an empty std::vector can also be used to indicate non-availability of the sizes? It only adds an additional 16b per AllocInfo (sizeof std::vector is 24b I think) and would avoid some of the complexity and overhead of indirection. Given some of the other discussion about making this unconditional, what do you think about dropping the unique_ptr and making it a plain std::vector?
https://github.com/llvm/llvm-project/pull/98382
More information about the llvm-commits
mailing list