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

            Bug ID: 43240
           Summary: KNL: inline memcpy uses two ymm loads/stores instead
                    of one zmm load/store
           Product: libraries
           Version: trunk
          Hardware: PC
                OS: All
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: Backend: X86
          Assignee: unassignedb...@nondot.org
          Reporter: d...@znu.io
                CC: craig.top...@gmail.com, llvm-bugs@lists.llvm.org,
                    llvm-...@redking.me.uk, spatel+l...@rotateright.com

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

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

Reply via email to