[llvm-bugs] [Bug 41892] New: [X86][SSE] Failure to merge 2 x float stores to <2 x float> store

via llvm-bugs llvm-bugs at lists.llvm.org
Wed May 15 14:44:42 PDT 2019


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

            Bug ID: 41892
           Summary: [X86][SSE] Failure to merge 2 x float stores to <2 x
                    float> store
           Product: libraries
           Version: trunk
          Hardware: PC
                OS: Windows NT
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: Backend: X86
          Assignee: unassignedbugs at nondot.org
          Reporter: llvm-dev at redking.me.uk
                CC: craig.topper at gmail.com, llvm-bugs at lists.llvm.org,
                    llvm-dev at redking.me.uk, spatel+llvm at rotateright.com

https://godbolt.org/z/InfZZK

#include <x86intrin.h>

void sum_pairs_128(__m128 f, float *p) {
  p[0] = f[0] + f[1];
  p[1] = f[2] + f[3];
}


clang -O3 -march=btver2

_Z13sum_pairs_128Dv4_fPf: # @_Z13sum_pairs_128Dv4_fPf
  vhaddps %xmm0, %xmm0, %xmm0
  vmovss %xmm0, (%rdi)
  vextractps $1, %xmm0, 4(%rdi)
  retq

would be better if we managed to merge to:

_Z13sum_pairs_128Dv4_fPf: # @_Z13sum_pairs_128Dv4_fPf
  vhaddps %xmm0, %xmm0, %xmm0
  vmovsd %xmm0, (%rdi)
  retq

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20190515/c8e778ee/attachment.html>


More information about the llvm-bugs mailing list