<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 --- - alloca and memcpy is very slow, opposed to inline assignment"
   href="http://llvm.org/bugs/show_bug.cgi?id=18695">18695</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>alloca and memcpy is very slow, opposed to inline assignment
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>clang
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>3.4
          </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>unassignedclangbugs@nondot.org
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>llvm+bugzilla@stefan.konink.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>Created <span class=""><a href="attachment.cgi?id=11992" name="attach_11992" title="Example source code to reproduce this bug.">attachment 11992</a> <a href="attachment.cgi?id=11992&action=edit" title="Example source code to reproduce this bug.">[details]</a></span>
Example source code to reproduce this bug.

The attached source code shows the difference in performance for alloca +
memcpy plus increment of all items in an array using a for-loop versus alloca
and a for-loop that combines the assignment of the incremented value and the
initial value.

The performance in GCC for both examples is similar and fast. Clang has very
poor performance for the first variant using memcpy.

To compile the sourcecode:

clang -DSINGLE -std=c99 -O3 expanding-inline-generic.c
(poor performance, around line 13)

clang -DINLINE -std=c99 -O3 expanding-inline-generic.c
(similar performance to GCC)</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>