<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 --- - LLVM fails to inline/clone recursive function, leading to 3x slowdown compared to gcc"
   href="http://llvm.org/bugs/show_bug.cgi?id=20154">20154</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>LLVM fails to inline/clone recursive function, leading to 3x slowdown compared to gcc
          </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>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>Interprocedural Optimizations
          </td>
        </tr>

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

        <tr>
          <th>Reporter</th>
          <td>rdivacky@freebsd.org
          </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=12716" name="attach_12716" title="test case">attachment 12716</a> <a href="attachment.cgi?id=12716&action=edit" title="test case">[details]</a></span>
test case

The attached (big test case) when compiled with trunk clang doesnt have
cpu_search() function inlined (or cloned?) into its callers even when marked
always_inline.

This is because the function is (indirectly) recursive. When compiling the same
file with gcc49, the cpu_search function is inlined.

This file is implementation of scheduler from FreeBSD and as reported
(<a href="https://kib.kiev.ua/kib/pgsql_perf.pdf">https://kib.kiev.ua/kib/pgsql_perf.pdf</a>) inlining it results in massive
improvement in performance (25% -> 8%).</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>