[LLVMbugs] [Bug 23073] New: [AVX] bloated vector permute mask generation

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Mon Mar 30 10:15:01 PDT 2015


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

            Bug ID: 23073
           Summary: [AVX] bloated vector permute mask generation
           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

$ cat badperm.ll 
define <8 x float> @shuffle_v8f32_70000000(<8 x float> %a, <8 x float> %b) {
  %shuffle = shufflevector <8 x float> %a, <8 x float> %b, <8 x i32> <i32 7,
i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0>
  ret <8 x float> %shuffle
}


$ ./llc -mattr=avx2 badperm.ll -o -
...
        movl    $7, %eax
    vmovd    %eax, %xmm1
    vpxor    %ymm2, %ymm2, %ymm2
    vpblendd    $1, %ymm1, %ymm2, %ymm1 ## ymm1 = ymm1[0],ymm2[1,2,3,4,5,6,7]
    vpermps    %ymm0, %ymm1, %ymm0
    retq


As noticed by Andrea in http://reviews.llvm.org/D8341, this could've been a
vmovaps + vpermd (or vpermps depending on int/fp domain).

Or since we know that all of the high elements of the mask are zeros, the
permute mask could be shortened to a single 32-bit constant '7' load (vmovd
instead of vmovaps)?

-- 
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/20150330/d7ab6cc9/attachment.html>


More information about the llvm-bugs mailing list