<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 - Load/store combine fails to merge complex address math"
href="https://bugs.llvm.org/show_bug.cgi?id=42986">42986</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>Load/store combine fails to merge complex address math
</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>Common Code Generator Code
</td>
</tr>
<tr>
<th>Assignee</th>
<td>unassignedbugs@nondot.org
</td>
</tr>
<tr>
<th>Reporter</th>
<td>llvm-dev@redking.me.uk
</td>
</tr>
<tr>
<th>CC</th>
<td>craig.topper@gmail.com, llvm-bugs@lists.llvm.org, spatel+llvm@rotateright.com
</td>
</tr></table>
<p>
<div>
<pre>Current Codegen: <a href="https://godbolt.org/z/LnSMCV">https://godbolt.org/z/LnSMCV</a>
void cpy(const float *src, float *dst,
unsigned src_offset, unsigned dst_offset, unsigned dst_stride) {
float x0 = src[src_offset + 0];
float x1 = src[src_offset + 1];
dst[dst_offset + dst_stride + 0] = x0;
dst[dst_offset + dst_stride + 1] = x1;
}
We fail to recognise the sequential load/stores, and merge to a single i64/f64
load/store pair.
clang -g0 -O3 -march=btver2
cpy:
movl %edx, %eax
incl %edx
movl (%rdi,%rax,4), %eax
movl (%rdi,%rdx,4), %edx
leal (%r8,%rcx), %edi
movl %eax, (%rsi,%rdi,4)
leal 1(%r8,%rcx), %eax
movl %edx, (%rsi,%rax,4)
retq
Th -Oz case is even worse:
clang -g0 -Oz -march=btver2
cpy:
movl %edx, %eax
movl (%rdi,%rax,4), %eax
pushq $1
popq %r9
addl %r9d, %edx
addl %r8d, %ecx
movl (%rdi,%rdx,4), %edx
movl %eax, (%rsi,%rcx,4)
addl %r9d, %ecx
movl %edx, (%rsi,%rcx,4)
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>