summaryrefslogtreecommitdiffstats
path: root/contrib/llvm/include
diff options
context:
space:
mode:
authordim <dim@FreeBSD.org>2014-11-19 07:24:43 +0000
committerdim <dim@FreeBSD.org>2014-11-19 07:24:43 +0000
commita243faf2d255266df3c81f7917af4c5df03a7ccc (patch)
tree63cd9df3b439af266b26dc0ee9f0438693f265e0 /contrib/llvm/include
parentdf514ceb8dddd315e9012ed06b1dd2dae77764af (diff)
downloadFreeBSD-src-a243faf2d255266df3c81f7917af4c5df03a7ccc.zip
FreeBSD-src-a243faf2d255266df3c81f7917af4c5df03a7ccc.tar.gz
MFC r274442:
Pull in r221709 from upstream llvm trunk (by Frédéric Riss): Totally forget deallocated SDNodes in SDDbgInfo. What would happen before that commit is that the SDDbgValues associated with a deallocated SDNode would be marked Invalidated, but SDDbgInfo would keep a map entry keyed by the SDNode pointer pointing to this list of invalidated SDDbgNodes. As the memory gets reused, the list might get wrongly associated with another new SDNode. As the SDDbgValues are cloned when they are transfered, this can lead to an exponential number of SDDbgValues being produced during DAGCombine like in http://llvm.org/bugs/show_bug.cgi?id=20893 Note that the previous behavior wasn't really buggy as the invalidation made sure that the SDDbgValues won't be used. This commit can be considered a memory optimization and as such is really hard to validate in a unit-test. This should fix abnormally large memory usage and resulting OOM crashes when compiling certain ports with debug information. Reported by: Dmitry Marakasov <amdmi3@amdmi3.ru> Upstream PRs: http://llvm.org/PR19031 http://llvm.org/PR20893 MFC r274483: The fix imported into llvm in r274442 contains some C++11 constructs, which gcc in base cannot handle. Replace these with C++98 equivalents. While here, add the patch for the adapted fix. Reported by: bz, kib Pointy hat to: dim
Diffstat (limited to 'contrib/llvm/include')
-rw-r--r--contrib/llvm/include/llvm/CodeGen/SelectionDAG.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/contrib/llvm/include/llvm/CodeGen/SelectionDAG.h b/contrib/llvm/include/llvm/CodeGen/SelectionDAG.h
index 82becca..9e1115b 100644
--- a/contrib/llvm/include/llvm/CodeGen/SelectionDAG.h
+++ b/contrib/llvm/include/llvm/CodeGen/SelectionDAG.h
@@ -127,6 +127,10 @@ public:
DbgValMap[Node].push_back(V);
}
+ /// \brief Invalidate all DbgValues attached to the node and remove
+ /// it from the Node-to-DbgValues map.
+ void erase(const SDNode *Node);
+
void clear() {
DbgValMap.clear();
DbgValues.clear();
OpenPOWER on IntegriCloud