[llvm-bugs] [Bug 31287] New: x86 backend should prefer pinsrw over movzwl + movd?

via llvm-bugs llvm-bugs at lists.llvm.org
Mon Dec 5 18:11:51 PST 2016


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

            Bug ID: 31287
           Summary: x86 backend should prefer pinsrw over movzwl + movd?
           Product: libraries
           Version: trunk
          Hardware: PC
                OS: Windows NT
            Status: NEW
          Severity: normal
          Priority: P
         Component: Backend: X86
          Assignee: unassignedbugs at nondot.org
          Reporter: efriedma at codeaurora.org
                CC: llvm-bugs at lists.llvm.org
    Classification: Unclassified

Take a testcase like the following:

define <16 x i8> @f(<2 x i8> *%p) {
  %t = load <2 x i8>, <2 x i8> *%p
  %r = shufflevector <2 x i8> %t, <2 x i8> undef, <16 x i32> <i32 0, i32 1, i32
2, i32 2, i32 2, i32 2, i32 2, i32 2, i32 2, i32 2, i32 2, i32 2, i32 2, i32 2,
i32 2, i32 2>
  ret <16 x i8> %r
}

Using "llc -mtriple=x86_64-pc-linux-gnu -mattr=+avx", we generate:

        movzwl  (%rdi), %eax
        vmovd   %eax, %xmm0
        retq

Potential alternate sequence, which I expect is a little faster (not tested):
        vpxor   %xmm0, %xmm0, %xmm0
        vpinsrw $0, (%rdi), %xmm0, %xmm0
        retq

-- 
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/20161206/7b3e0195/attachment.html>


More information about the llvm-bugs mailing list