[LLVMbugs] [Bug 3997] New: llc lowers intrinsics incorrectly with the presense of regparm attribute

bugzilla-daemon at cs.uiuc.edu bugzilla-daemon at cs.uiuc.edu
Thu Apr 16 09:39:37 PDT 2009


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

           Summary: llc lowers intrinsics incorrectly with the presense of
                    regparm attribute
           Product: tools
           Version: trunk
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P2
         Component: llc
        AssignedTo: unassignedbugs at nondot.org
        ReportedBy: haohui.mai at gmail.com
                CC: llvmbugs at cs.uiuc.edu


Created an attachment (id=2832)
 --> (http://llvm.org/bugs/attachment.cgi?id=2832)
test case

llc does not handle this case correctly:

        call void @llvm.memcpy.i32(i8* %3, i8* %4, i32 2052, i32 4)
        %dst1 = bitcast [128 x i8]* %dst to i8*         ; <i8*> [#uses=1]
        %src2 = bitcast [128 x i8]* %src to i8*         ; <i8*> [#uses=1]
        %5 = call i8* @memcpy(i8* inreg %dst1, i8* inreg %src2, i32 inreg 128)
nounwind         ; <i8*> [#uses=0]

when llvm.memcpy.i32 lowers to call to memcpy, it does not follow the
customized memcpy calling convention.

for the first llvm.memcpy.i32, the generated assemblies are:

        movl    %eax, (%edx)
        movl    %ecx, 4(%edx)
        movl    $2052, 8(%edx)
        call    memcpy

for the second call of memcpy, the codes are:

        leal    -140(%ebp), %eax
        leal    -268(%ebp), %ecx
        movl    $128, %edx
        movl    %edx, -276(%ebp)
        movl    %ecx, %edx
        movl    -276(%ebp), %ecx
        call    memcpy


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