https://bugs.llvm.org/show_bug.cgi?id=34370
Bug ID: 34370
Summary: [X86][AVX512] suboptimal shuffle sequence instead of
one vpermps instruction
Product: libraries
Version: trunk
Hardware: All
OS: All
Status: NEW
Severity: enhancement
Priority: P
Component: Backend: X86
Assignee: unassignedb...@nondot.org
Reporter: ayman.m...@intel.com
CC: llvm-bugs@lists.llvm.org
For the following IR:
define <8 x float> @test(<8 x float>* %vp, <8 x float> %vec2) {
%vec = load <8 x float>, <8 x float>* %vp
%shuf = shufflevector <8 x float> %vec, <8 x float> undef, <8 x i32> <i32 7,
i32 6, i32 3, i32 0, i32 7, i32 6, i32 3, i32 0>
%res = select <8 x i1> <i1 1, i1 1, i1 1, i1 0, i1 1, i1 1, i1 0, i1 0>, <8
x float> %shuf, <8 x float> %vec2
ret <8 x float> %res
}
>> llc -mcpu=skx <file-name> -o out.s
LLVM emits (showing 3.00 throughput on IACA tool):
vpermilps $59, (%rdi), %ymm1 # ymm1 = mem[3,2,3,0,7,6,7,4]
vpermpd $102, %ymm1, %ymm1 # ymm1 = ymm1[2,1,2,1]
movb $55, %al
kmovd %eax, %k1
vmovaps %ymm1, %ymm0 {%k1}
retq
While it can be replaced with (showing 2.86 throughput on IACA tool):
vmovaps .LCPI3327_0(%rip), %ymm1 # ymm1 = [7,6,3,0,7,6,3,0]
movb $55, %al
kmovd %eax, %k1
vpermps (%rdi), %ymm1, %ymm0 {%k1}
retq
** Throughput results from IACA tool => lower is better.
--
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs