<html>
    <head>
      <base href="https://llvm.org/bugs/" />
    </head>
    <body><table border="1" cellspacing="0" cellpadding="8">
        <tr>
          <th>Bug ID</th>
          <td><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW --- - [x86, AVX] vbroadcast not used to splat constant"
   href="https://llvm.org/bugs/show_bug.cgi?id=27141">27141</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>[x86, AVX] vbroadcast not used to splat constant
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>libraries
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>trunk
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>PC
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>All
          </td>
        </tr>

        <tr>
          <th>Status</th>
          <td>NEW
          </td>
        </tr>

        <tr>
          <th>Severity</th>
          <td>normal
          </td>
        </tr>

        <tr>
          <th>Priority</th>
          <td>P
          </td>
        </tr>

        <tr>
          <th>Component</th>
          <td>Backend: X86
          </td>
        </tr>

        <tr>
          <th>Assignee</th>
          <td>unassignedbugs@nondot.org
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>spatel+llvm@rotateright.com
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>llvm-bugs@lists.llvm.org
          </td>
        </tr>

        <tr>
          <th>Classification</th>
          <td>Unclassified
          </td>
        </tr></table>
      <p>
        <div>
        <pre>This was noticed in the output of <a href="http://reviews.llvm.org/D18566">http://reviews.llvm.org/D18566</a> (<a class="bz_bug_link 
          bz_status_NEW "
   title="NEW --- - Optimize memset for AVX2"
   href="show_bug.cgi?id=27100">bug 27100</a>):

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.</pre>
        </div>
      </p>
      <hr>
      <span>You are receiving this mail because:</span>
      
      <ul>
          <li>You are on the CC list for the bug.</li>
      </ul>
    </body>
</html>