[LLVMbugs] [Bug 18695] New: alloca and memcpy is very slow, opposed to inline assignment

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Sun Feb 2 05:19:32 PST 2014


            Bug ID: 18695
           Summary: alloca and memcpy is very slow, opposed to inline
           Product: clang
           Version: 3.4
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: -New Bugs
          Assignee: unassignedclangbugs at nondot.org
          Reporter: llvm+bugzilla at stefan.konink.de
                CC: llvmbugs at cs.uiuc.edu
    Classification: Unclassified

Created attachment 11992
  --> http://llvm.org/bugs/attachment.cgi?id=11992&action=edit
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)

You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20140202/81fbb9be/attachment.html>

More information about the llvm-bugs mailing list