https://bugs.llvm.org/show_bug.cgi?id=34357
Bug ID: 34357
Summary: [X86][AVX512] Use of different granularity broadcast
prevents combining the mask inside the 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
vector broadcasts of type <2 x float> or <2 x i32> don't select the
vbroadcastf32x2 and vbroadcasti32x2 instructions. Instead they select
vbroadcastsd and vpbroadcastq (respectively).
This prevents the mask (if exists) to be combined inside the broadcast
instruction (because of the different granularity between the mask and selected
instruction), which results in an extra blend or mov instruction.
Reproducer:
define <8 x float> @test_masked_z_2xfloat_to_8xfloat_mask1(<8 x float> %vec) {
%shuf = shufflevector <8 x float> %vec, <8 x float> undef, <8 x i32> <i32 0,
i32 1, i32 0, i32 1, i32 0, i32 1, i32 0, i32 1>
%res = select <8 x i1> <i1 0, i1 1, i1 1, i1 1, i1 1, i1 1, i1 1, i1 0>, <8
x float> %shuf, <8 x float> zeroinitializer
ret <8 x float> %res
}
>> llc -mcpu=skx <file-name> -o out.s
LLVM emits:
vbroadcastsd %xmm0, %ymm0
movb $126, %al
kmovd %eax, %k1
vmovaps %ymm0, %ymm0 {%k1} {z}
retq
While it can be replaced with:
movb $126, %al
kmovd %eax, %k1
vbroadcastf32x2 %xmm0, %ymm0 {%k1} {z}
--
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