Add BranchProbabilityInfo::releaseMemory to clear the Weights field.
authorPete Cooper <peter_cooper@apple.com>
Thu, 28 May 2015 19:43:06 +0000 (19:43 +0000)
committerPete Cooper <peter_cooper@apple.com>
Thu, 28 May 2015 19:43:06 +0000 (19:43 +0000)
commit40d9379cd55a081cc4179a86751e4f387ea52929
tree93209f291fd4c08d271c7e541984c9718a24b871
parent24441414a3557ad2416520fbb27330cc9b48fc1d
Add BranchProbabilityInfo::releaseMemory to clear the Weights field.

BranchProbabilityInfo was leaking 3MB of memory when running 'opt -O2 verify-uselistorder.lto.bc'.  This was due to the Weights member not being cleared once the pass is no longer needed.

This adds the releaseMemory override to clear that field.  The other fields are cleared at the end of runOnFunction so can stay there.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238462 91177308-0d34-0410-b5e6-96231b3b80d8
include/llvm/Analysis/BranchProbabilityInfo.h
lib/Analysis/BranchProbabilityInfo.cpp