<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 - Failure to vectorize even-odd shuffle"
href="https://bugs.llvm.org/show_bug.cgi?id=43844">43844</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>Failure to vectorize even-odd shuffle
</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>Loop Optimizer
</td>
</tr>
<tr>
<th>Assignee</th>
<td>unassignedbugs@nondot.org
</td>
</tr>
<tr>
<th>Reporter</th>
<td>lebedev.ri@gmail.com
</td>
</tr>
<tr>
<th>CC</th>
<td>llvm-bugs@lists.llvm.org
</td>
</tr></table>
<p>
<div>
<pre>#include <array>
std::array<int, 16> evenodd(const std::array<const int, 16> in) {
std::array<int, 16> tmp;
for(int i = 0, j = 0; i < 16 && j < 16; i++) {
tmp[j] = in[i];
// First fill all even values, then all odd
j += 2;
if(j == 16)
j = 1;
}
return tmp;
}
results in scalar code
while it could be something like
define <16 x i32> @evenodd(<16 x i32> %in) {
%t = shufflevector <16 x i32> %in, <16 x i32> undef,
<16 x i32> <i32 0, i32 2, i32 4, i32 6, i32 8, i32 10,
i32 12, i32 14,
i32 1, i32 3, i32 5, i32 7, i32 9, i32 11,
i32 13, i32 15>
ret <16 x i32> %t
}
<a href="https://godbolt.org/z/9Mjrqa">https://godbolt.org/z/9Mjrqa</a></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>