[LLVMbugs] [Bug 690] NEW: llvm-gcc should set aggressive alignment info when lowering memset/memcpy/memmove

bugzilla-daemon at cs.uiuc.edu bugzilla-daemon at cs.uiuc.edu
Thu Jan 12 16:36:21 PST 2006


http://llvm.cs.uiuc.edu/bugs/show_bug.cgi?id=690

           Summary: llvm-gcc should set aggressive alignment info when
                    lowering memset/memcpy/memmove
           Product: tools
           Version: 1.0
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: enhancement
          Priority: P2
         Component: llvm-gcc
        AssignedTo: unassignedbugs at nondot.org
        ReportedBy: sabre at nondot.org


llvm-gcc currently compiles this:

#include <stdlib.h>
void test(int *X, int *Y) {  memset(X, 123, 4);}

to this:

void %test(int* %X, int* %Y) {
        %tmp.1 = cast int* %X to sbyte*         ; <sbyte*> [#uses=1]
        tail call void %llvm.memset( sbyte* %tmp.1, ubyte 123, uint 4, uint 0 )
        ret void
}

Note that there is no alignment info, which doesn't let the code generator lower this to a single 4-byte 
store.  Since the arg is an int*, we know the alignment has to be 4.

The new front-end does this right, this is just a tracking bug.

-Chris



------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.




More information about the llvm-bugs mailing list