<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 --- - MachineSink Performance Issue"
   href="http://llvm.org/bugs/show_bug.cgi?id=17245">17245</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>MachineSink Performance Issue
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>new-bugs
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>unspecified
          </td>
        </tr>

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

        <tr>
          <th>OS</th>
          <td>Linux
          </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>new bugs
          </td>
        </tr>

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

        <tr>
          <th>Reporter</th>
          <td>willdtz@gmail.com
          </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>Created <span class=""><a href="attachment.cgi?id=11197" name="attach_11197" title="Proposed patch to address performance issue">attachment 11197</a> <a href="attachment.cgi?id=11197&action=edit" title="Proposed patch to address performance issue">[details]</a></span>
Proposed patch to address performance issue

I'm encountering bad performance behavior of the MachineSink pass,
as shown in the attached 'before.log' (MachineSink taking ~25 minutes to
execute!).

Investigation led me to create the attached patch which both avoids the n^2
behavior presently exhibited by the pass but also tries to more faithfully
implement the heuristic described in the comments of the code itself.

With this patch applied, MachineSink's execution time reduces from 1494.1
seconds down to 1.8 seconds.  I've attached the patch as well as 'after.log'
demonstrating the much improved timings.

Unfortunately the original IR is both large and something I'd rather not post,
although I've managed to reduce it into the attached 'reduced.bc' example that
has before/after timings of 10.5s/0.2s (I used bugpoint filtering on the
runtime before being greater than 10s and after being less than 1 second).</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>