[llvm] [MemProf] Reduce cloning overhead by sharing nodes when possible (PR #99832)

Teresa Johnson via llvm-commits llvm-commits at lists.llvm.org
Tue Jul 23 12:03:12 PDT 2024


================
@@ -1757,6 +1815,7 @@ IndexCallsiteContextGraph::IndexCallsiteContextGraph(
           if (AN.MIBs.empty())
             continue;
           CallsWithMetadata.push_back({&AN});
+          CallToFunc[{&AN}] = FS;
----------------
teresajohnson wrote:

The braces are needed here and for line 1852 to convert from either AllocInfo* or CallsiteInfo* to IndexCall. CallToFunc is a map from CallTy, which is a template parameter and for the index is of type IndexCall (which can hold either alloc or callsite summary pointers). Without the braces there is a compiler error.

https://github.com/llvm/llvm-project/pull/99832


More information about the llvm-commits mailing list