<html>
<head>
<base href="https://bugs.llvm.org/">
</head>
<body><table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Bug ID</th>
<td><a class="bz_bug_link
bz_status_NEW "
title="NEW - [AVX-512] Missed opportunity to perform k-operations before copying to GPR"
href="https://bugs.llvm.org/show_bug.cgi?id=32546">32546</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>[AVX-512] Missed opportunity to perform k-operations before copying to GPR
</td>
</tr>
<tr>
<th>Product</th>
<td>libraries
</td>
</tr>
<tr>
<th>Version</th>
<td>trunk
</td>
</tr>
<tr>
<th>Hardware</th>
<td>PC
</td>
</tr>
<tr>
<th>OS</th>
<td>Windows NT
</td>
</tr>
<tr>
<th>Status</th>
<td>NEW
</td>
</tr>
<tr>
<th>Severity</th>
<td>enhancement
</td>
</tr>
<tr>
<th>Priority</th>
<td>P
</td>
</tr>
<tr>
<th>Component</th>
<td>Backend: X86
</td>
</tr>
<tr>
<th>Assignee</th>
<td>unassignedbugs@nondot.org
</td>
</tr>
<tr>
<th>Reporter</th>
<td>zvi.rackover@intel.com
</td>
</tr>
<tr>
<th>CC</th>
<td>llvm-bugs@lists.llvm.org
</td>
</tr></table>
<p>
<div>
<pre>define <4 x i64> @foo(<8 x float> %a, <8 x float> %b, <8 x float> %c, <8 x
float> %d) {
entry:
%0 = tail call i8 @llvm.x86.avx512.mask.cmp.ps.256(<8 x float> %a, <8 x
float> %b, i32 1, i8 -1)
%1 = tail call i8 @llvm.x86.avx512.mask.cmp.ps.256(<8 x float> %c, <8 x
float> %d, i32 1, i8 -1)
%and17 = and i8 %1, %0
%and = zext i8 %and17 to i32
%2 = insertelement <8 x i32> undef, i32 %and, i32 0
%vecinit7.i = shufflevector <8 x i32> %2, <8 x i32> undef, <8 x i32>
zeroinitializer
%3 = bitcast <8 x i32> %vecinit7.i to <4 x i64>
ret <4 x i64> %3
}
declare i8 @llvm.x86.avx512.mask.cmp.ps.256(<8 x float>, <8 x float>, i32, i8)
llc -mcpu=skx gives:
vcmpltps %ymm1, %ymm0, %k0
kmovb %k0, %eax
vcmpltps %ymm3, %ymm2, %k0
kmovb %k0, %ecx
andb %al, %cl
movzbl %cl, %eax
vpbroadcastd %eax, %ymm0
retq
A better sequence would be:
vcmpps $1, %ymm1, %ymm0, %k0
vcmpps $1, %ymm3, %ymm2, %k1
kandw %k0, %k1, %k1
kmovw %k1, %edx
vpbroadcastd %edx, %ymm0
ret</pre>
</div>
</p>
<hr>
<span>You are receiving this mail because:</span>
<ul>
<li>You are on the CC list for the bug.</li>
</ul>
</body>
</html>