[PATCH] D115676: [NFC][LazyCallGraph] Remove check in removeDeadFunction() if graph is empty

Arthur Eubanks via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Dec 13 14:00:46 PST 2021


aeubanks created this revision.
aeubanks added a reviewer: asbirlea.
Herald added a subscriber: hiraditya.
aeubanks requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

If we're in removeDeadFunction(), we should have already constructed the call graph.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D115676

Files:
  llvm/lib/Analysis/LazyCallGraph.cpp


Index: llvm/lib/Analysis/LazyCallGraph.cpp
===================================================================
--- llvm/lib/Analysis/LazyCallGraph.cpp
+++ llvm/lib/Analysis/LazyCallGraph.cpp
@@ -1522,13 +1522,6 @@
   // Remove this from the entry edges if present.
   EntryEdges.removeEdgeInternal(N);
 
-  if (SCCMap.empty()) {
-    // No SCCs have been formed, so removing this is fine and there is nothing
-    // else necessary at this point but clearing out the node.
-    N.clear();
-    return;
-  }
-
   // Cannot remove a function which has yet to be visited in the DFS walk, so
   // if we have a node at all then we must have an SCC and RefSCC.
   auto CI = SCCMap.find(&N);


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D115676.394051.patch
Type: text/x-patch
Size: 686 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20211213/48d51264/attachment.bin>


More information about the llvm-commits mailing list