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: [email protected]
          Reporter: [email protected]
                CC: [email protected]
    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.
_______________________________________________
LLVMbugs mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/llvmbugs

Reply via email to