[llvm-bugs] [Bug 43577] New: [X86] Recognize concatenated vpmovqb instructions as VPERMI2Q

via llvm-bugs llvm-bugs at lists.llvm.org
Sun Oct 6 11:55:21 PDT 2019


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: unassignedbugs at nondot.org
          Reporter: craig.topper at gmail.com
                CC: craig.topper at gmail.com, llvm-bugs at lists.llvm.org,
                    llvm-dev at redking.me.uk, spatel+llvm at rotateright.com

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.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20191006/deea3e8d/attachment.html>


More information about the llvm-bugs mailing list