[PATCH] [PR20893] Change SelectionDAG's DbgValueMap to have set semantics (NFC)

Frédéric Riss friss at apple.com
Tue Nov 11 13:24:36 PST 2014


> On Nov 11, 2014, at 10:16 AM, Adrian Prantl <aprantl at apple.com> wrote:
> 
> Fred found an even better fix for this.
> 
> http://reviews.llvm.org/D5451
> 

Just for the heads-up for the people involved in this thread, I committed a fix for this in r221709.

In the testcase, DAGCombine would combine long chains of ‘add’s with constants. In doing so, it combines 2 nodes, clones the SDDbgValues from the old node in the new one and deletes the old node. The SDDbgValues for the old node are marked invalid, but the SDDbgInfo object would keep an entry  in his DbgValueMap keyed on the pointer of the deleted node. Then the memory of the removed node might be reused by a new SDNode generated by the combiner and this node will magically have a list of DbgValues attached to it upon creation. In the test the new nodes get combined with the ones where the list was just duplicated, thus you get an exponential number of SDDbgValues created and stored. This resulted in 24Gb of unused SDDbgValues. The fix is just to delete the SDNode entry from the map when the SDNode is deallocated.

Fred





More information about the llvm-commits mailing list