[llvm] [MemProf] Remove empty edges once after cloning (PR #85320)

Snehasish Kumar via llvm-commits llvm-commits at lists.llvm.org
Tue Mar 26 17:07:30 PDT 2024


================
@@ -306,7 +306,7 @@ class CallsiteContextGraph {
     // True if this node was effectively removed from the graph, in which case
     // its context id set, caller edges, and callee edges should all be empty.
     bool isRemoved() const {
-      assert(ContextIds.empty() ==
+      assert(!ContextIds.empty() ||
----------------
snehasish wrote:

Is the following equivalent to what you want? 

```
if (ContextIds.empty()) {
  assert(CalleeEdges.empty() && CallerEdges.empty() && "Context ids empty but at least one of callee and caller edges were not!");
}
```

This shouldn't  cause non-assert builds to complain since we don't have any assert specific temporaries.

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


More information about the llvm-commits mailing list