[llvm] [MemProf] Track and report profiled sizes through cloning (PR #98382)

Teresa Johnson via llvm-commits llvm-commits at lists.llvm.org
Thu Jul 11 08:52:16 PDT 2024


================
@@ -2261,6 +2285,30 @@ void CallsiteContextGraph<DerivedCCG, FuncTy, CallTy>::print(
   }
 }
 
+template <typename DerivedCCG, typename FuncTy, typename CallTy>
+void CallsiteContextGraph<DerivedCCG, FuncTy, CallTy>::printTotalSizes(
+    raw_ostream &OS) const {
+  using GraphType = const CallsiteContextGraph<DerivedCCG, FuncTy, CallTy> *;
+  for (const auto Node : nodes<GraphType>(this)) {
+    if (Node->isRemoved())
+      continue;
+    if (!Node->IsAllocation)
+      continue;
+    auto ContextIds = Node->getContextIds();
----------------
teresajohnson wrote:

Added the type. Can't make it a reference since as of another recent change the node context ids are computed on the fly.

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


More information about the llvm-commits mailing list