[LLVMbugs] [Bug 22359] New: [X86][AVX] extract_subvector shuffle disaster

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Tue Jan 27 13:21:10 PST 2015


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

            Bug ID: 22359
           Summary: [X86][AVX] extract_subvector shuffle disaster
           Product: libraries
           Version: trunk
          Hardware: PC
                OS: All
            Status: NEW
          Severity: normal
          Priority: P
         Component: Backend: X86
          Assignee: unassignedbugs at nondot.org
          Reporter: spatel+llvm at rotateright.com
                CC: llvmbugs at cs.uiuc.edu
    Classification: Unclassified

This is a testcase I was considering using in a patch for bug 21711, but
something is causing the AVX1/AVX2 codegen to go wrong. This doesn't happen
with SSE. 

We're trying to store half of a 256-bit vector here:

define void @f7(<8 x float> %v, <2 x float>* %ptr) {
  %idx2 = getelementptr inbounds <2 x float>* %ptr, i64 1

  %shuffle0 = shufflevector <8 x float> %v, <8 x float> undef, <2 x i32> <i32
0, i32 1>
  %shuffle1 = shufflevector <8 x float> %v, <8 x float> undef, <2 x i32> <i32
2, i32 3>

  store <2 x float> %shuffle0, <2 x float>* %ptr, align 8
  store <2 x float> %shuffle1, <2 x float>* %idx2, align 8
  ret void
}

$ ./llc extract.ll -mattr=sse -o -
...
    movups    %xmm0, (%rdi)
    retq

$ ./llc extract.ll -mattr=avx -o - 
...
    vpermilps    $231, %xmm0, %xmm1 ## xmm1 = xmm0[3,1,2,3]
    vpermilpd    $1, %xmm0, %xmm2 ## xmm2 = xmm0[1,0]
    vmovshdup    %xmm0, %xmm3    ## xmm3 = xmm0[1,1,3,3]
    vinsertps    $16, %xmm3, %xmm0, %xmm0 ## xmm0 = xmm0[0],xmm3[0],xmm0[2,3]
    vinsertps    $32, %xmm2, %xmm0, %xmm0 ## xmm0 = xmm0[0,1],xmm2[0],xmm0[3]
    vinsertps    $48, %xmm1, %xmm0, %xmm0 ## xmm0 = xmm0[0,1,2],xmm1[0]
    vmovups    %xmm0, (%rdi)
    vzeroupper
    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/20150127/3002b38f/attachment.html>


More information about the llvm-bugs mailing list