diff --git a/llvm/lib/Transforms/IPO/ArgumentPromotion.cpp b/llvm/lib/Transforms/IPO/ArgumentPromotion.cpp index fe5cd7671213cf..5f24d53da0b31f 100644 --- a/llvm/lib/Transforms/IPO/ArgumentPromotion.cpp +++ b/llvm/lib/Transforms/IPO/ArgumentPromotion.cpp @@ -1052,6 +1052,7 @@ PreservedAnalyses ArgumentPromotionPass::run(LazyCallGraph::SCC &C, // swaps out the particular function mapped to a particular node in the // graph. C.getOuterRefSCC().replaceNodeFunction(N, *NewF); + FAM.clear(OldF, OldF.getName()); OldF.eraseFromParent(); }