From: Johannes Doerfert Date: Thu, 16 Apr 2020 03:21:17 +0000 (-0500) Subject: [Attributor] Replace call graph call sites after function replacement X-Git-Tag: llvmorg-12-init~8866 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=8c4057e3a35dfab77c0fafc307980124f2b07b5e;p=platform%2Fupstream%2Fllvm.git [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. --- 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(); }