<html>
    <head>
      <base href="https://bugs.llvm.org/">
    </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 - KNL: inline memcpy uses two ymm loads/stores instead of one zmm load/store"
   href="https://bugs.llvm.org/show_bug.cgi?id=43240">43240</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>KNL: inline memcpy uses two ymm loads/stores instead of one zmm load/store
          </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>enhancement
          </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>dave@znu.io
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>craig.topper@gmail.com, llvm-bugs@lists.llvm.org, llvm-dev@redking.me.uk, spatel+llvm@rotateright.com
          </td>
        </tr></table>
      <p>
        <div>
        <pre>The following code generates two ymm loads/stores instead of a single zmm
load/store. This seems specific to knl because skylake-avx512 and
icelake-client both generate the correct code. And yes, this example is derived
from test/CodeGen/X86/memcpy.ll.

declare void @llvm.memcpy.p0i8.p0i8.i64(i8* nocapture, i8* nocapture, i64, i1)
nounwind

define void @test(i8* nocapture %A, i8* nocapture %B) nounwind optsize
noredzone {
entry:
  tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* %A, i8* %B, i64 64, i1 false)
  ret void
}

Expected result (as seen with skylake-avx512 and icelake-client):

        vmovups (%rsi), %zmm0
        vmovups %zmm0, (%rdi)
        retq

Actual result (as seen with knl):

        vmovups (%rsi), %ymm0
        vmovups 32(%rsi), %ymm1
        vmovups %ymm1, 32(%rdi)
        vmovups %ymm0, (%rdi)
        retq</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>