<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 - Opportunity to combine shuffles of splats with multiple uses"
href="https://bugs.llvm.org/show_bug.cgi?id=32449">32449</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>Opportunity to combine shuffles of splats with multiple uses
</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>For the following three functions:
define <2 x double> @foo2(<2 x double> %v, <2 x double> *%p) nounwind {
%res = shufflevector <2 x double> %v, <2 x double> undef, <2 x i32> <i32 1,
i32 1>
%res1 = shufflevector<2 x double> %res, <2 x double> undef, <2 x i32> <i32
1, i32 undef>
store <2 x double> %res, <2 x double>* %p
ret <2 x double> %res1
}
define <4 x double> @foo4(<4 x double> %v, <4 x double> *%p) nounwind {
%res = shufflevector <4 x double> %v, <4 x double> undef, <4 x i32> <i32 2,
i32 2, i32 2, i32 2>
%res1 = shufflevector<4 x double> %res, <4 x double> undef, <4 x i32> <i32
2, i32 0, i32 undef, i32 undef>
store <4 x double> %res, <4 x double>* %p
ret <4 x double> %res1
}
define <8 x float> @foo8(<8 x float> %v, <8 x float> *%p) nounwind {
%res = shufflevector <8 x float> %v, <8 x float> undef, <8 x i32> <i32 5,
i32 5, i32 5, i32 5, i32 5, i32 5, i32 5, i32 5>
%res1 = shufflevector<8 x float> %res, <8 x float> undef, <8 x i32> <i32 2,
i32 0, i32 undef, i32 undef, i32 5, i32 1, i32 3, i32 7>
store <8 x float> %res, <8 x float>* %p
ret <8 x float> %res1
}
llc -mcpu=skylake generates respectively:
foo2:
vpermilpd $3, %xmm0, %xmm1 # xmm1 = xmm0[1,1]
vpermilpd $1, %xmm1, %xmm0 # xmm0 = xmm1[1,0]
vmovapd %xmm1, (%rdi)
retq
foo4:
vpermpd $170, %ymm0, %ymm1 # ymm1 = ymm0[2,2,2,2]
vpermpd $226, %ymm1, %ymm0 # ymm0 = ymm1[2,0,2,3]
vmovapd %ymm1, (%rdi)
retq
foo8:
vmovshdup %ymm0, %ymm0 # ymm0 = ymm0[1,1,3,3,5,5,7,7]
vpermpd $170, %ymm0, %ymm1 # ymm1 = ymm0[2,2,2,2]
vmovaps .LCPI2_0(%rip), %ymm0 # ymm0 = <2,0,u,u,5,1,3,7>
vpermps %ymm1, %ymm0, %ymm0
vmovapd %ymm1, (%rdi)
retq
In foo2() it's easy to see that the second vpermild is redundant.
In foo4() similiarly the second vpermpd is redundant.
Not sure why in foo8 the splat-shuffle and the non-splat shuffle reversed, but
it can also be improved.</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>