[LLVMbugs] [Bug 2371] New: codegen should inline small memmoves

bugzilla-daemon at cs.uiuc.edu bugzilla-daemon at cs.uiuc.edu
Mon May 26 08:04:49 PDT 2008


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

           Summary: codegen should inline small memmoves
           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:
target triple = "i686-pc-linux-gnu"
        %struct.anon = type { i32, i32, i32 }

define void @a(%struct.anon* %a, %struct.anon* %b) nounwind  {
entry:
        %tmp2 = bitcast %struct.anon* %a to i8*         ; <i8*> [#uses=1]
        %tmp3 = bitcast %struct.anon* %b to i8*         ; <i8*> [#uses=1]
        tail call void @llvm.memmove.i32( i8* %tmp2, i8* %tmp3, i32 12, i32 4 )
        ret void
}

Generated assembly:
a:
        subl    $12, %esp
        movl    20(%esp), %ecx
        movl    %ecx, 4(%esp)
        movl    16(%esp), %ecx
        movl    %ecx, (%esp)
        movl    $12, 8(%esp)
        call    memmove
        addl    $12, %esp
        ret

For a memmove this short, it should just load the values from the first
pointer, then store them into the other pointer.


-- 
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