[LLVMbugs] [Bug 2369] New: scalarrepl overly aggressive with large arrays

bugzilla-daemon at cs.uiuc.edu bugzilla-daemon at cs.uiuc.edu
Mon May 26 07:33:54 PDT 2008


http://llvm.org/bugs/show_bug.cgi?id=2369

           Summary: scalarrepl overly aggressive with large arrays
           Product: new-bugs
           Version: unspecified
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P2
         Component: new bugs
        AssignedTo: unassignedbugs at nondot.org
        ReportedBy: sharparrow1 at yahoo.com
                CC: llvmbugs at cs.uiuc.edu


Testcase:
#include <string.h>
void memtest1 (char* dst, char* src)
{
  char temp[100];
  memcpy (&temp, src, 100);
  memcpy (dst, &temp, 100); 
}

The generated assembly for X86 is about 400 instructions, which is clearly
ridiculous.  The issue is that scalarrepl is turning this into 100 loads, all
of which get spilled to the stack, then 100 stores, all of which have to be
reloaded from the stack.

On a side note, it might be worth optimizing code like this to memmove.


-- 
Configure bugmail: http://llvm.org/bugs/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.



More information about the llvm-bugs mailing list