<html>
<head>
<base href="http://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 --- - consecutive stores not merged optimally"
href="http://llvm.org/bugs/show_bug.cgi?id=21771">21771</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>consecutive stores not merged optimally
</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>Marking this as an x86 bug, but it probably applies to any target that has
reasonably fast unaligned memops (and therefore could be fixed at a higher
level):
$ cat bad_store_merge.ll
define <4 x double> @bad_store_merge(double* %ptr) {
%a = load double* %ptr, align 8
%vecinit = insertelement <4 x double> undef, double %a, i32 0
%arrayidx1 = getelementptr inbounds double* %ptr, i64 1
%b = load double* %arrayidx1, align 8
%vecinit2 = insertelement <4 x double> %vecinit, double %b, i32 1
%arrayidx3 = getelementptr inbounds double* %ptr, i64 2
%c = load double* %arrayidx3, align 8
%vecinit4 = insertelement <4 x double> %vecinit2, double %c, i32 2
%arrayidx5 = getelementptr inbounds double* %ptr, i64 3
%d = load double* %arrayidx5, align 8
%vecinit6 = insertelement <4 x double> %vecinit4, double %d, i32 3
ret <4 x double> %vecinit6
}
bin$ ./llc -mcpu=core2 bad_store_merge.ll -o -
...
movsd 16(%rdi), %xmm1
movhpd 24(%rdi), %xmm1
movups (%rdi), %xmm0
retq
We should have combined the 'movsd' and 'movhpd' into one store, so the ideal
codegen for this target (not AVX, so no 256-bit memops) would be:
movups (%rdi), %xmm0
movups 16(%rdi), %xmm1
retq
This is a follow-on from <a class="bz_bug_link
bz_status_RESOLVED bz_closed"
title="RESOLVED FIXED - [X86][AVX] suboptimal expansion of 256 bit vector loads."
href="show_bug.cgi?id=21710">bug 21710</a>. I think it's a problem in
SelectionDAG::isConsecutiveLoad().</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>