https://bugs.llvm.org/show_bug.cgi?id=45748

            Bug ID: 45748
           Summary: Bad optimization of reverse-initialization of 128-bit
                    vector with 64-bit vectors
           Product: libraries
           Version: trunk
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: Backend: X86
          Assignee: unassignedb...@nondot.org
          Reporter: gabrav...@gmail.com
                CC: craig.top...@gmail.com, llvm-bugs@lists.llvm.org,
                    llvm-...@redking.me.uk, spatel+l...@rotateright.com

typedef int32_t v2si __attribute__((vector_size(8)));
typedef int64_t v2di __attribute__((vector_size(16)));

v2di setr_epi64(v2si q0, v2si q1)
{
    return v2di{(int64_t)q0, (int64_t)q1};
}

GCC -O3 produces :

setr_epi64(int __vector(2), int __vector(2)):
  punpcklqdq xmm0, xmm1
  ret

LLVM produces :

setr_epi64(int __vector(2), int __vector(2)): # @setr_epi64(int __vector(2),
int __vector(2))
  movq rax, xmm0
  movq rcx, xmm1
  movq xmm1, rcx
  movq xmm0, rax
  punpcklqdq xmm0, xmm1 # xmm0 = xmm0[0],xmm1[0]
  ret

The code here cannot be further minimized, from what I've been able to see with
my tests.

See also https://godbolt.org/z/ZC-SWs

-- 
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to