[llvm] [MemProf] Avoid duplicate edges between nodes (PR #113337)

Snehasish Kumar via llvm-commits llvm-commits at lists.llvm.org
Fri Oct 25 08:01:48 PDT 2024


================
@@ -1352,6 +1352,12 @@ static void checkNode(const ContextNode<DerivedCCG, FuncTy, CallTy> *Node,
     }
     assert(NodeContextIds == CalleeEdgeContextIds);
   }
+  // Make sure we don't end up with duplicate edges between the same caller and
+  // callee.
+  DenseSet<ContextNode<DerivedCCG, FuncTy, CallTy> *> NodeSet;
----------------
snehasish wrote:

Since we only use the NodeSet to check in the assert, I think this will needlessly run in an optmized build. Should we wrap this in an `#ifndef NDEBUG`?

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


More information about the llvm-commits mailing list