[llvm-bugs] [Bug 27141] New: [x86, AVX] vbroadcast not used to splat constant

via llvm-bugs llvm-bugs at lists.llvm.org
Wed Mar 30 14:00:42 PDT 2016


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: unassignedbugs at nondot.org
          Reporter: spatel+llvm at rotateright.com
                CC: llvm-bugs at 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.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20160330/ecfbc161/attachment.html>


More information about the llvm-bugs mailing list