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

Snehasish Kumar via llvm-commits llvm-commits at lists.llvm.org
Mon Mar 18 10:50:07 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:

An assert with an or condition is a little hard to reason about for me. For this to fail both LHS and RHS need to be false - context IDs is empty *and* at least one of CalleeEdges, CallerEdges is not empty. Can we rewrite this as two separate assertions to simplify? Also it seems that it is now inconsistent with the comment above? 

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


More information about the llvm-commits mailing list