From 8c4057e3a35dfab77c0fafc307980124f2b07b5e Mon Sep 17 00:00:00 2001 From: Johannes Doerfert Date: Wed, 15 Apr 2020 22:21:17 -0500 Subject: [PATCH] [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. --- llvm/lib/Transforms/IPO/Attributor.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/llvm/lib/Transforms/IPO/Attributor.cpp b/llvm/lib/Transforms/IPO/Attributor.cpp index 15e18d2..2c67eda 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(); } -- 2.7.4