[LLVMbugs] [Bug 22377] New: New vector shuffle legality: fails to reuse shuffle result, and turns unpcklps into shufps x2.

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Wed Jan 28 15:54:15 PST 2015


http://llvm.org/bugs/show_bug.cgi?id=22377

            Bug ID: 22377
           Summary: New vector shuffle legality: fails to reuse shuffle
                    result, and turns unpcklps into shufps x2.
           Product: libraries
           Version: trunk
          Hardware: PC
                OS: All
            Status: NEW
          Severity: normal
          Priority: P
         Component: Backend: X86
          Assignee: unassignedbugs at nondot.org
          Reporter: ahmed.bougacha at gmail.com
                CC: llvmbugs at cs.uiuc.edu
    Classification: Unclassified

Created attachment 13753
  --> http://llvm.org/bugs/attachment.cgi?id=13753&action=edit
IR testcase

For the attached reduced IR, we used to generate:

    vpermilps    $221, %xmm0, %xmm1 ## xmm1 = xmm0[1,3,1,3]
    vpermilps    $136, %xmm0, %xmm0 ## xmm0 = xmm0[0,2,0,2]
    vaddps    %xmm0, %xmm1, %xmm1
    vunpcklps    %xmm1, %xmm0, %xmm0 ## xmm0 = xmm0[0],xmm1[0],xmm0[1],xmm1[1]

With the new all-shuffles-are-legal lowering, we now generate:

    vpermilps    $221, %xmm0, %xmm1 ## xmm1 = xmm0[1,3,1,3]
    vpermilps    $136, %xmm0, %xmm2 ## xmm2 = xmm0[0,2,0,2]
    vaddps    %xmm2, %xmm1, %xmm1
    vshufps    $72, %xmm1, %xmm0, %xmm0 ## xmm0 = xmm0[0,2],xmm1[0,1]
    vshufps    $216, %xmm0, %xmm0, %xmm0 ## xmm0 = xmm0[0,2,1,3]

That is, we no longer reuse the intermediate shuffle result, and fall back to
shufps.

-- 
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/20150128/d284df81/attachment.html>


More information about the llvm-bugs mailing list