[LLVMbugs] [Bug 10048] llc 2.9 doesn't care of packed attribute to generate code for x86 target

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Tue May 31 05:25:20 PDT 2011


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

seb <babslachem at gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|RESOLVED                    |REOPENED
         Resolution|INVALID                     |

--- Comment #7 from seb <babslachem at gmail.com> 2011-05-31 07:25:19 CDT ---
Hi,

Your explanation make sense, now I've modified code as follows:

%struct.sType = type < { < 4 x float >, < 4 x float >, < 4 x float > } >
%struct.sType.alt = type < { [12 x float] } >
@A = common global < 4 x float > zeroinitializer
@B = common global < 4 x float > zeroinitializer
@C = common global < 4 x float > zeroinitializer
define void @bar(%struct.sType* byval %s) {
L.entry:
    %0 = bitcast %struct.sType* %s to < 4 x float >*
    %1 = load < 4 x float >* %0, align 1
    store < 4 x float > %1, < 4 x float >* @A, align 1
    %2 = bitcast %struct.sType* %s to < 4 x float >*
    %3 = load < 4 x float >* %2, align 1
    store < 4 x float > %3, < 4 x float >* @B, align 1
    %4 = bitcast %struct.sType* %s to < 4 x float >*
    %5 = load < 4 x float >* %4, align 1
    store < 4 x float > %5, < 4 x float >* @C, align 1
    ret void
}

define void @foo1(%struct.sType.alt* byval %x) {
L.entry:
    %0 = bitcast %struct.sType.alt* %x to %struct.sType*
    call void  @bar (%struct.sType* byval %0)
    ret void
}

generated code for foo1 is:

foo1:                                   # @foo1
.Leh_func_begin1:
# BB#0:                                 # %L.entry
    subl    $60, %esp
.Ltmp1:
    movaps  96(%esp), %xmm0
    movaps  %xmm0, 32(%esp)
    movaps  64(%esp), %xmm0
    movaps  80(%esp), %xmm1
    movaps  %xmm1, 16(%esp)
    movaps  %xmm0, (%esp)
    calll   bar
    addl    $60, %esp
    ret


I would have expected that copy from struct.sTYpe.alt to struct.sType uses
movups for loads instead of movaps, since struct.sType.alt is not supposed to
be aligned on a 16 byte boundary. Why movaps are generated for loading ?

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