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

            Bug ID: 27141
           Summary: [x86, AVX] vbroadcast not used to splat constant
           Product: libraries
           Version: trunk
          Hardware: PC
                OS: All
            Status: NEW
          Severity: normal
          Priority: P
         Component: Backend: X86
          Assignee: unassignedb...@nondot.org
          Reporter: spatel+l...@rotateright.com
                CC: llvm-bugs@lists.llvm.org
    Classification: Unclassified

This was noticed in the output of http://reviews.llvm.org/D18566 (bug 27100):

define void @hoo(<4 x i32>* %x, i8 %c) {
  %ins = insertelement <4 x i32> undef, i32 42, i32 0
  %splat = shufflevector <4 x i32> %ins, <4 x i32> undef, <4 x i32>
zeroinitializer
  store <4 x i32> %splat, <4 x i32>* %x
  ret void
}

$ ./llc -o - memset.ll -mattr=avx
...
    vmovaps    LCPI0_0(%rip), %xmm0    ## xmm0 = [42,42,42,42]
    vmovaps    %xmm0, (%rdi)


$ ./llc -o - memset.ll -mattr=avx2
...
    vbroadcastss    LCPI0_0(%rip), %xmm0
    vmovaps    %xmm0, (%rdi)

vbroadcastss from memory is available with AVX, so these should produce
identical asm.

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

Reply via email to