[llvm] 8c4057e - [Attributor] Replace call graph call sites after function replacement

Johannes Doerfert via llvm-commits llvm-commits at lists.llvm.org
Wed Apr 15 20:25:23 PDT 2020


Author: Johannes Doerfert
Date: 2020-04-15T22:24:09-05:00
New Revision: 8c4057e3a35dfab77c0fafc307980124f2b07b5e

URL: https://github.com/llvm/llvm-project/commit/8c4057e3a35dfab77c0fafc307980124f2b07b5e
DIFF: https://github.com/llvm/llvm-project/commit/8c4057e3a35dfab77c0fafc307980124f2b07b5e.diff

LOG: [Attributor] Replace call graph call sites after function replacement

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.

Added: 
    

Modified: 
    llvm/lib/Transforms/IPO/Attributor.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/lib/Transforms/IPO/Attributor.cpp b/llvm/lib/Transforms/IPO/Attributor.cpp
index 15e18d2f036f..2c67edac7406 100644
--- a/llvm/lib/Transforms/IPO/Attributor.cpp
+++ b/llvm/lib/Transforms/IPO/Attributor.cpp
@@ -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();
     }


        


More information about the llvm-commits mailing list