<html>
    <head>
      <base href="http://llvm.org/bugs/" />
    </head>
    <body><table border="1" cellspacing="0" cellpadding="8">
        <tr>
          <th>Bug ID</th>
          <td><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW --- - EVT instances refer indirectly to a specific LLVMContext"
   href="http://llvm.org/bugs/show_bug.cgi?id=20124">20124</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>EVT instances refer indirectly to a specific LLVMContext
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>libraries
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>trunk
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>PC
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>All
          </td>
        </tr>

        <tr>
          <th>Status</th>
          <td>NEW
          </td>
        </tr>

        <tr>
          <th>Severity</th>
          <td>normal
          </td>
        </tr>

        <tr>
          <th>Priority</th>
          <td>P
          </td>
        </tr>

        <tr>
          <th>Component</th>
          <td>Common Code Generator Code
          </td>
        </tr>

        <tr>
          <th>Assignee</th>
          <td>unassignedbugs@nondot.org
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>Mathias.Froehlich@web.de
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>llvmbugs@cs.uiuc.edu
          </td>
        </tr>

        <tr>
          <th>Classification</th>
          <td>Unclassified
          </td>
        </tr></table>
      <p>
        <div>
        <pre>This report is based on a request at llvmdev at
<a href="http://lists.cs.uiuc.edu/pipermail/llvmdev/2014-June/074145.html">http://lists.cs.uiuc.edu/pipermail/llvmdev/2014-June/074145.html</a>

This is about an observation that the EVT's cached and returned from
SDNode::getValueTypeList(EVT VT)
are keyed by the llvm::Type pointer which in turn refer to a LLVMContext.
But that, if you use several LLVMContext instances over the lifetime of
a program, this EVT map seems to accumulate new entries for each new
LLVMContext
that is used.
The memory is correctly freed on destruction of managed singletons, but until
then it is kept around. This matches in effect the behavior of a memory leak,
even if being finally freed at the end and by that not being a memory leak in
it's strong sense.

I cannot talk about llvm's internal structure, but given the comments in the
above mentioned mailing list thread this reference chain seems to be unwanted
for
other reasons also.

Thanks in advance

Mathias</pre>
        </div>
      </p>
      <hr>
      <span>You are receiving this mail because:</span>
      
      <ul>
          <li>You are on the CC list for the bug.</li>
      </ul>
    </body>
</html>