<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 - [SLPVectorizer] Failure to use vectorize integer minimum loop"
href="https://bugs.llvm.org/show_bug.cgi?id=42755">42755</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>[SLPVectorizer] Failure to use vectorize integer minimum loop
</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>Scalar Optimizations
</td>
</tr>
<tr>
<th>Assignee</th>
<td>unassignedbugs@nondot.org
</td>
</tr>
<tr>
<th>Reporter</th>
<td>llvm-dev@redking.me.uk
</td>
</tr>
<tr>
<th>CC</th>
<td>llvm-bugs@lists.llvm.org
</td>
</tr></table>
<p>
<div>
<pre>Current codegen: <a href="https://gcc.godbolt.org/z/smAJKe">https://gcc.godbolt.org/z/smAJKe</a>
#include <x86intrin.h>
auto minmaxi(__v4si x, __v4si min) {
for (int i = 0; i != 4; ++i)
if (x[i] < min[i])
min[i] = x[i];
return min;
}
_Z7minmaxiDv4_iS_:
vmovd %xmm0, %eax
vmovd %xmm1, %ecx
cmpl %ecx, %eax
jl .LBB0_1
vpextrd $1, %xmm0, %eax
vpextrd $1, %xmm1, %ecx
cmpl %ecx, %eax
jl .LBB0_3
.LBB0_4:
vpextrd $2, %xmm0, %eax
vpextrd $2, %xmm1, %ecx
cmpl %ecx, %eax
jl .LBB0_5
.LBB0_6:
vpextrd $3, %xmm0, %eax
vpextrd $3, %xmm1, %ecx
cmpl %ecx, %eax
jl .LBB0_7
.LBB0_8:
vmovdqa %xmm1, %xmm0
retq
.LBB0_1:
vpblendw $3, %xmm0, %xmm1, %xmm1 # xmm1 =
xmm0[0,1],xmm1[2,3,4,5,6,7]
vpextrd $1, %xmm0, %eax
vpextrd $1, %xmm1, %ecx
cmpl %ecx, %eax
jge .LBB0_4
.LBB0_3:
vpblendw $12, %xmm0, %xmm1, %xmm1 # xmm1 =
xmm1[0,1],xmm0[2,3],xmm1[4,5,6,7]
vpextrd $2, %xmm0, %eax
vpextrd $2, %xmm1, %ecx
cmpl %ecx, %eax
jge .LBB0_6
.LBB0_5:
vpblendw $48, %xmm0, %xmm1, %xmm1 # xmm1 =
xmm1[0,1,2,3],xmm0[4,5],xmm1[6,7]
vpextrd $3, %xmm0, %eax
vpextrd $3, %xmm1, %ecx
cmpl %ecx, %eax
jge .LBB0_8
.LBB0_7:
vpblendw $192, %xmm0, %xmm1, %xmm1 # xmm1 =
xmm1[0,1,2,3,4,5],xmm0[6,7]
vmovdqa %xmm1, %xmm0
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>