<html>
<head>
<base href="https://llvm.org/bugs/" />
</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 --- - AVX512F does a poor job passing i1s between basic blocks"
href="https://llvm.org/bugs/show_bug.cgi?id=28650">28650</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>AVX512F does a poor job passing i1s between basic blocks
</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>Linux
</td>
</tr>
<tr>
<th>Status</th>
<td>NEW
</td>
</tr>
<tr>
<th>Severity</th>
<td>normal
</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>mkuper@google.com
</td>
</tr>
<tr>
<th>CC</th>
<td>llvm-bugs@lists.llvm.org
</td>
</tr>
<tr>
<th>Classification</th>
<td>Unclassified
</td>
</tr></table>
<p>
<div>
<pre>Consider the test case from r276347:
declare i1 @bar()
define i1 @foo(i1 %i) nounwind {
entry:
br i1 %i, label %if, label %else
if:
%r = call i1 @bar()
br label %else
else:
%ret = phi i1 [%r, %if], [true, %entry]
ret i1 %ret
}
Without AVX512, we get:
foo:
movb $1, %al
testb $1, %dil
je .LBB0_2
pushq %rax
callq bar
addq $8, %rsp
.LBB0_2:
retq
While with AVX512F, we end up "serializing" the i1 through k registers:
foo:
testb $1, %dil
je .LBB0_1
pushq %rax
callq bar
andb $1, %al
kmovw %eax, %k0
addq $8, %rsp
jmp .LBB0_3
.LBB0_1:
kxnorw %k0, %k0, %k0
kshiftrw $15, %k0, %k0
.LBB0_3:
kmovw %k0, %eax
retq
The xnor + shift sequence to create a 1 is an especially nice touch. :-)</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>