<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 --- - [X86][AVX] suboptimal splat loads"
href="https://llvm.org/bugs/show_bug.cgi?id=23022">23022</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>[X86][AVX] suboptimal splat loads
</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>All
</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>spatel+llvm@rotateright.com
</td>
</tr>
<tr>
<th>CC</th>
<td>llvmbugs@cs.uiuc.edu
</td>
</tr>
<tr>
<th>Classification</th>
<td>Unclassified
</td>
</tr></table>
<p>
<div>
<pre>$ cat splat_loads.ll
define <2 x double> @splat_load_2f64(<2 x double>* %ptr) {
%x = load <2 x double>, <2 x double>* %ptr
%x1 = shufflevector <2 x double> %x, <2 x double> undef, <2 x i32> <i32 0,
i32 0>
ret <2 x double> %x1
}
define <4 x double> @splat_load_4f64(<4 x double>* %ptr) {
%x = load <4 x double>, <4 x double>* %ptr
%x1 = shufflevector <4 x double> %x, <4 x double> undef, <4 x i32> <i32 0,
i32 0, i32 0, i32 0>
ret <4 x double> %x1
}
define <4 x float> @splat_load_4f32(<4 x float>* %ptr) {
%x = load <4 x float>, <4 x float>* %ptr
%x1 = shufflevector <4 x float> %x, <4 x float> undef, <4 x i32> <i32 0, i32
0, i32 0, i32 0>
ret <4 x float> %x1
}
define <8 x float> @splat_load_8f32(<8 x float>* %ptr) {
%x = load <8 x float>, <8 x float>* %ptr
%x1 = shufflevector <8 x float> %x, <8 x float> undef, <8 x i32> <i32 0, i32
0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0>
ret <8 x float> %x1
}
-------------------------------------------------------------------------------
Testing with llc built from r233098:
$ ./llc -o - -mattr=avx splat_loads.ll
_splat_load_2f64: ## @splat_load_2f64
vmovddup (%rdi), %xmm0 ## xmm0 = mem[0,0]
retq
...
_splat_load_4f64: ## @splat_load_4f64
vmovapd (%rdi), %ymm0
vmovddup %xmm0, %xmm0 ## xmm0 = xmm0[0,0]
vinsertf128 $1, %xmm0, %ymm0, %ymm0
retq
...
_splat_load_4f32: ## @splat_load_4f32
vpermilps $0, (%rdi), %xmm0 ## xmm0 = mem[0,0,0,0]
retq
...
_splat_load_8f32: ## @splat_load_8f32
vmovaps (%rdi), %ymm0
vpermilps $0, %xmm0, %xmm0 ## xmm0 = xmm0[0,0,0,0]
vinsertf128 $1, %xmm0, %ymm0, %ymm0
retq
-------------------------------------------------------------------------------
I don't remember whether the vmovddup in the 1st test is somehow better than a
vbroadcast, but I think all of these could be single vbroadcast load
instructions.</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>