diff options
Diffstat (limited to 'llvm/lib')
| -rw-r--r-- | llvm/lib/Transforms/IPO/FunctionAttrs.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/llvm/lib/Transforms/IPO/FunctionAttrs.cpp b/llvm/lib/Transforms/IPO/FunctionAttrs.cpp index a68e8d8ef5d..e4b86e9ca7d 100644 --- a/llvm/lib/Transforms/IPO/FunctionAttrs.cpp +++ b/llvm/lib/Transforms/IPO/FunctionAttrs.cpp @@ -1271,6 +1271,11 @@ ReversePostOrderFunctionAttrsPass::run(Module &M, AnalysisManager<Module> &AM) { auto &CG = AM.getResult<CallGraphAnalysis>(M); bool Changed = deduceFunctionAttributeInRPO(M, CG); + + // CallGraphAnalysis holds AssertingVH and must be invalidated eagerly so + // that other passes don't delete stuff from under it. + AM.invalidate<CallGraphAnalysis>(M); + if (!Changed) return PreservedAnalyses::all(); PreservedAnalyses PA; |

