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

            Bug ID: 43577
           Summary: [X86] Recognize concatenated vpmovqb instructions as
                    VPERMI2Q
           Product: libraries
           Version: trunk
          Hardware: PC
                OS: All
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: Backend: X86
          Assignee: [email protected]
          Reporter: [email protected]
                CC: [email protected], [email protected],
                    [email protected], [email protected]

This test case from min-legal-vector-width.ll could be matched as vpermi2b on
avx512vbmi capable CPUs.

define <8 x i8> @trunc_v8i64_v8i8(<8 x i64>* %x) nounwind
"min-legal-vector-width"="256" {
; CHECK-LABEL: trunc_v8i64_v8i8:
; CHECK:       # %bb.0:
; CHECK-NEXT:    vmovdqa (%rdi), %ymm0
; CHECK-NEXT:    vmovdqa 32(%rdi), %ymm1
; CHECK-NEXT:    vpmovqb %ymm1, %xmm1
; CHECK-NEXT:    vpmovqb %ymm0, %xmm0
; CHECK-NEXT:    vpunpckldq {{.*#+}} xmm0 = xmm0[0],xmm1[0],xmm0[1],xmm1[1]
; CHECK-NEXT:    vzeroupper
; CHECK-NEXT:    retq
  %a = load <8 x i64>, <8 x i64>* %x
  %b = trunc <8 x i64> %a to <8 x i8>
  ret <8 x i8> %b
}

There may be other similar opportunities to use other VPERMV3 instructions for
other concatenated truncates like this.

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

Reply via email to