<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 --- - code for hot loop in libjpeg is terribad, with lots of reg-to-reg copies"
href="http://llvm.org/bugs/show_bug.cgi?id=19134">19134</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>code for hot loop in libjpeg is terribad, with lots of reg-to-reg copies
</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>grosbach@apple.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>Created <span class=""><a href="attachment.cgi?id=12228" name="attach_12228" title="-O0 IR for ycc_rgb_convert()">attachment 12228</a> <a href="attachment.cgi?id=12228&action=edit" title="-O0 IR for ycc_rgb_convert()">[details]</a></span>
-O0 IR for ycc_rgb_convert()
libjpeg (jpeg-6b) code.
Function ycc_rgb_convert() in jdcolor.c (unoptimized bitcode attached) gets
compiled with the hot inner loop as:
LBB3_5: ## %for.body
## Parent Loop BB3_3 Depth=1
## => This Inner Loop Header: Depth=2
movzbl (%r13), %esi
movq %r14, %r12
movq %r10, %r14
movzbl (%rdi), %r10d
movq %r8, %rdx
movl (%rcx,%r10,4), %r8d
addl %esi, %r8d
movq %rcx, %r11
movslq %r8d, %rcx
movq %rdx, %r8
movb (%r15,%rcx), %cl
movzbl (%rbx), %edx
movb %cl, (%rax)
movq (%r8,%r10,8), %rcx
movq %r14, %r10
movq %r12, %r14
addq (%r14,%rdx,8), %rcx
shrq $16, %rcx
addl %esi, %ecx
movslq %ecx, %rcx
movb (%r15,%rcx), %cl
movb %cl, 1(%rax)
addl (%r10,%rdx,4), %esi
movslq %esi, %rcx
movb (%r15,%rcx), %cl
movb %cl, 2(%rax)
movq %r11, %rcx
incq %r13
incq %rbx
incq %rdi
addq $3, %rax
decl %r9d
jne LBB3_5
Note the sequences like:
movq %r14, %r10
movq %r12, %r14
We're copying around the loop counter and base addresses for no obviously good
reason. Both GCC 4.8.2 and ICC13 do much better here.</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>