[Attributor] Replace call graph call sites after function replacement
authorJohannes Doerfert <johannes@jdoerfert.de>
Thu, 16 Apr 2020 03:21:17 +0000 (22:21 -0500)
committerJohannes Doerfert <johannes@jdoerfert.de>
Thu, 16 Apr 2020 03:24:09 +0000 (22:24 -0500)
The CallGraphUpdater allows to directly alter call site information and
we should do so. This might appease the windows buildbot that crashes
during the SCC traversal.

llvm/lib/Transforms/IPO/Attributor.cpp

index 15e18d2..2c67eda 100644 (file)
@@ -1569,9 +1569,8 @@ ChangeStatus Attributor::rewriteFunctionSignatures(
     for (auto &CallSitePair : CallSitePairs) {
       CallBase &OldCB = *CallSitePair.first;
       CallBase &NewCB = *CallSitePair.second;
-      // We do not modify the call graph here but simply reanalyze the old
-      // function. This should be revisited once the old PM is gone.
       ModifiedFns.insert(OldCB.getFunction());
+      CGUpdater.replaceCallSite(OldCB, NewCB);
       OldCB.replaceAllUsesWith(&NewCB);
       OldCB.eraseFromParent();
     }