[llvm] r277980 - [PM] Invalidate CallGraphAnalysis because it holds AssertingVH
Sean Silva via llvm-commits
llvm-commits at lists.llvm.org
Sun Aug 7 22:38:01 PDT 2016
Author: silvas
Date: Mon Aug 8 00:38:01 2016
New Revision: 277980
URL: http://llvm.org/viewvc/llvm-project?rev=277980&view=rev
Log:
[PM] Invalidate CallGraphAnalysis because it holds AssertingVH
This is essentially PR28400. The fix here is similar to that implemented
in r274656.
Modified:
llvm/trunk/lib/Transforms/IPO/FunctionAttrs.cpp
Modified: llvm/trunk/lib/Transforms/IPO/FunctionAttrs.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/IPO/FunctionAttrs.cpp?rev=277980&r1=277979&r2=277980&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/IPO/FunctionAttrs.cpp (original)
+++ llvm/trunk/lib/Transforms/IPO/FunctionAttrs.cpp Mon Aug 8 00:38:01 2016
@@ -1271,6 +1271,11 @@ ReversePostOrderFunctionAttrsPass::run(M
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;
More information about the llvm-commits
mailing list