<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 - [X86] broadcast i32x2 from memory not lowered to the memory form of vbroadcasti32x2"
href="https://bugs.llvm.org/show_bug.cgi?id=34394">34394</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>[X86] broadcast i32x2 from memory not lowered to the memory form of vbroadcasti32x2
</td>
</tr>
<tr>
<th>Product</th>
<td>libraries
</td>
</tr>
<tr>
<th>Version</th>
<td>trunk
</td>
</tr>
<tr>
<th>Hardware</th>
<td>All
</td>
</tr>
<tr>
<th>OS</th>
<td>All
</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>ayman.musa@intel.com
</td>
</tr>
<tr>
<th>CC</th>
<td>llvm-bugs@lists.llvm.org
</td>
</tr></table>
<p>
<div>
<pre>Broadcasting <2 x i32> from memory gets lowered to bad sequence instead of
simply using the vbroadcasti32x2 instruction.
define <4 x i32> @test_2xi32_to_4xi32_mem(<2 x i32>* %vp) {
%vec = load <2 x i32>, <2 x i32>* %vp
%res = shufflevector <2 x i32> %vec, <2 x i32> undef, <4 x i32> <i32 0, i32
1, i32 0, i32 1>
ret <4 x i32> %res
}
LLVM emits:
vpmovzxdq (%rdi), %xmm0 # xmm0 = mem[0],zero,mem[1],zero
vpshufd $136, %xmm0, %xmm0 # xmm0 = xmm0[0,2,0,2]
retq
Instead of:
vbroadcasti32x2 (%rdi), %xmm0
retq
==============================================================================
define <8 x i32> @test_2xi32_to_8xi32_mem(<2 x i32>* %vp) {
%vec = load <2 x i32>, <2 x i32>* %vp
%res = shufflevector <2 x i32> %vec, <2 x i32> undef, <8 x i32> <i32 0, i32
1, i32 0, i32 1, i32 0, i32 1, i32 0, i32 1>
ret <8 x i32> %res
}
LLVM emits:
vpmovzxdq (%rdi), %xmm0 # xmm0 = mem[0],zero,mem[1],zero
vpshufd $232, %xmm0, %xmm0 # xmm0 = xmm0[0,2,2,3]
vpbroadcastq %xmm0, %ymm0
retq
Instead of:
vbroadcasti32x2 (%rdi), %ymm0
retq
==============================================================================
define <16 x i32> @test_2xi32_to_16xi32_mem(<2 x i32>* %vp) {
%vec = load <2 x i32>, <2 x i32>* %vp
%res = shufflevector <2 x i32> %vec, <2 x i32> undef, <16 x i32> <i32 0, i32
1, i32 0, i32 1, i32 0, i32 1, i32 0, i32 1, i32 0, i32 1, i32 0, i32 1, i32 0,
i32 1, i32 0, i32 1>
ret <16 x i32> %res
}
LLVM emits the following:
vpmovzxdq (%rdi), %xmm0 # xmm0 = mem[0],zero,mem[1],zero
vmovdqa32 .LCPI45_0(%rip), %zmm1 # zmm1 = [0,2,0,2,0,2,0,2,0,2,0,2,0,2,0,2]
vpermd %zmm0, %zmm1, %zmm0
retq
Instead of:
vbroadcasti32x2 (%rdi), %zmm0
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>