Totally forget deallocated SDNodes in SDDbgInfo.
authorFrederic Riss <friss@apple.com>
Tue, 11 Nov 2014 21:21:08 +0000 (21:21 +0000)
committerFrederic Riss <friss@apple.com>
Tue, 11 Nov 2014 21:21:08 +0000 (21:21 +0000)
commit6eb7964b7d3b734c73ecfb1cac457c02769a80ff
treea70bcb1a3917562e5c522b762a7f324df414af03
parent63dea2c95275ffcb3ff916946c6961f65aec7dae
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.

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