<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 - Codegen difference for anyof idioms"
href="https://bugs.llvm.org/show_bug.cgi?id=46448">46448</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>Codegen difference for anyof idioms
</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>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>listmail@philipreames.com
</td>
</tr>
<tr>
<th>CC</th>
<td>craig.topper@gmail.com, llvm-bugs@lists.llvm.org, llvm-dev@redking.me.uk, spatel+llvm@rotateright.com
</td>
</tr></table>
<p>
<div>
<pre>The following examples return true if at least one of the two 64 bit values are
zero. This was derived from an example performing null checks on pointers, but
the pointer bits don't appear to be relevant.
At the moment, we generate different code for these two examples, and do not
canonicalize one to the other at IR. I don't know which of the two outputs is
better, but we clearly should be generating one output for both examples.
;; EITHER is zero
define i1 @test_v1(<2 x i64>* %p) {
%int.vec = load <2 x i64>, <2 x i64>* %p
%cmp = icmp eq <2 x i64> %int.vec, zeroinitializer
%cmp.cast = bitcast <2 x i1> %cmp to i2
%cmp2 = icmp ne i2 %cmp.cast, 0
ret i1 %cmp2
}
;; EITHER is zero
define i1 @test_v2(<2 x i64>* %p) {
%int.vec = load <2 x i64>, <2 x i64>* %p
%reduce = call i64 @llvm.experimental.vector.reduce.and.v2i64(<2 x i64>
%int.vec)
%cmp = icmp ne i64 %reduce, 0
ret i1 %cmp
}
llc -O3 < input.ll -mcpu=skylake
test_v1: # @test_v1
vpxor %xmm0, %xmm0, %xmm0
vpcmpeqq (%rdi), %xmm0, %xmm0
vmovmskpd %xmm0, %eax
testb %al, %al
setne %al
retq
test_v2: # @test_v2
vpbroadcastq 8(%rdi), %xmm0
vpand (%rdi), %xmm0, %xmm0
vmovq %xmm0, %rax
testq %rax, %rax
setne %al
retq</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>