[PATCH] D77975: [CallGraphUpdater] Properly remove strongly connected components (old PM)

Johannes Doerfert via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sun Apr 12 10:09:06 PDT 2020


jdoerfert created this revision.
jdoerfert added a reviewer: hfinkel.
Herald added subscribers: bollu, hiraditya.
Herald added a project: LLVM.
jdoerfert retitled this revision from "[CallGraphUpdater] Properly remove strongly connected components (oldPM)" to "[CallGraphUpdater] Properly remove strongly connected components (old PM)".
jdoerfert added a child revision: D77854: [CallGraphUpdater] Update the ExternalCallingNode for node replacements.

The old code did eliminate references from and to functions that were
about to be deleted only just before we deleted them. This can cause
references from other functions that are supposed to be deleted to still
exist, depending on the order. If the functions form a strongly
connected component the problem manifests regardless of the order in
which we try to actually delete the functions.

This patch introduces a two step deletion. First we remove all
references and then we delete the function. Note that this only affects
the old call graph. There should not be any functional changes if no old
style call graph was given.

To test this we delete two strongly connected functions instead of one
in an existing test.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D77975

Files:
  llvm/lib/Transforms/Utils/CallGraphUpdater.cpp
  llvm/unittests/IR/LegacyPassManagerTest.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D77975.256863.patch
Type: text/x-patch
Size: 8881 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200412/78fffd8e/attachment.bin>


More information about the llvm-commits mailing list