diff options
author | Nick Lewycky <nicholas@mxc.ca> | 2010-05-12 21:48:15 +0000 |
---|---|---|
committer | Nick Lewycky <nicholas@mxc.ca> | 2010-05-12 21:48:15 +0000 |
commit | 9a1581b9102511282ee823ab9a29819bc060e6a5 (patch) | |
tree | 0885d4ca5d9e5568f0b25ebd0b0d087bf9dfb9ea /lib | |
parent | bd4fa2efd373c46dc14b87744b908f16f539c836 (diff) | |
download | llvm-9a1581b9102511282ee823ab9a29819bc060e6a5.tar.gz llvm-9a1581b9102511282ee823ab9a29819bc060e6a5.tar.bz2 llvm-9a1581b9102511282ee823ab9a29819bc060e6a5.tar.xz |
Clear CachedFunctionInfo upon Pass::releaseMemory. Because ValueMap will abort
on RAUW of functions, this is a correctness issue instead of a mere memory
usage problem.
No testcase until the new MergeFunctions can land.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@103653 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib')
-rw-r--r-- | lib/Analysis/InlineCost.cpp | 7 | ||||
-rw-r--r-- | lib/Transforms/IPO/InlineSimple.cpp | 3 |
2 files changed, 9 insertions, 1 deletions
diff --git a/lib/Analysis/InlineCost.cpp b/lib/Analysis/InlineCost.cpp index 6271371597..10c2d79bef 100644 --- a/lib/Analysis/InlineCost.cpp +++ b/lib/Analysis/InlineCost.cpp @@ -455,6 +455,11 @@ InlineCostAnalyzer::growCachedCostInfo(Function *Caller, Function *Callee) { else CallerMetrics.NumInsts = 0; - // We are not updating the argumentweights. We have already determined that + // We are not updating the argument weights. We have already determined that // Caller is a fairly large function, so we accept the loss of precision. } + +/// clear - empty the cache of inline costs +void InlineCostAnalyzer::clear() { + CachedFunctionInfo.clear(); +} diff --git a/lib/Transforms/IPO/InlineSimple.cpp b/lib/Transforms/IPO/InlineSimple.cpp index 46cf4b25e4..74b4a1c10e 100644 --- a/lib/Transforms/IPO/InlineSimple.cpp +++ b/lib/Transforms/IPO/InlineSimple.cpp @@ -49,6 +49,9 @@ namespace { CA.growCachedCostInfo(Caller, Callee); } virtual bool doInitialization(CallGraph &CG); + void releaseMemory() { + CA.clear(); + } }; } |