[LLVMbugs] [Bug 13059] New: Passing 8 x float vector to a function generates unnecessary instructions on x86-64

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Fri Jun 8 09:27:55 PDT 2012


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

             Bug #: 13059
           Summary: Passing 8 x float vector to a function generates
                    unnecessary instructions on x86-64
           Product: new-bugs
           Version: trunk
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: new bugs
        AssignedTo: unassignedbugs at nondot.org
        ReportedBy: loufoque at gmail.com
                CC: llvmbugs at cs.uiuc.edu
    Classification: Unclassified


The following C code written using AVX intrinsics

#include <immintrin.h>

__m256 f(__mm256 a, __mm256 b)
{
  return _mm256_add_ps(a, b);
}

generates with Clang 3.1

f:
    pushq    %rbp
    movq    %rsp, %rbp
    vaddps    %ymm1, %ymm0, %ymm0
    popq    %rbp
    ret

expected result would have been

f:
    vaddps %ymm1, %ymm0, %ymm0
    ret

Indeed GCC generates this code. This code is also generated when using __m128
instead of __m256 (with xmm instead of ymm).

In both the __m128 and __m256 cases the LLVM IR code is pretty much the same,
with the exception that in one case we have a 8 x float and in the other a 4 x
float. I suppose the problem is therefore in the code generator for x86-64.

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