<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 --- - Register allocator unnecessarily spilling in vector code"
href="https://llvm.org/bugs/show_bug.cgi?id=28131">28131</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>Register allocator unnecessarily spilling in vector code
</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>Linux
</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>Register Allocator
</td>
</tr>
<tr>
<th>Assignee</th>
<td>unassignedbugs@nondot.org
</td>
</tr>
<tr>
<th>Reporter</th>
<td>mkuper@google.com
</td>
</tr>
<tr>
<th>CC</th>
<td>llvm-bugs@lists.llvm.org
</td>
</tr>
<tr>
<th>Classification</th>
<td>Unclassified
</td>
</tr></table>
<p>
<div>
<pre>Created <span class=""><a href="attachment.cgi?id=16543" name="attach_16543" title="Reproducer">attachment 16543</a> <a href="attachment.cgi?id=16543&action=edit" title="Reproducer">[details]</a></span>
Reproducer
For the attached IR, we get:
.LBB0_1: # %vector.body
# =>This Inner Loop Header: Depth=1
vmovdqa c+976(%rax), %xmm0
vmovdqa c+960(%rax), %xmm1
vmovdqa c+1008(%rax), %xmm2
vmovdqa c+992(%rax), %xmm3
vpaddb b+992(%rax), %xmm3, %xmm3
vpaddb b+1008(%rax), %xmm2, %xmm2
vpaddb b+960(%rax), %xmm1, %xmm1
vpaddb b+976(%rax), %xmm0, %xmm0
vmovdqa %xmm0, a+976(%rax)
vmovdqa %xmm1, a+960(%rax)
vmovdqa %xmm2, a+1008(%rax)
vmovdqa %xmm3, a+992(%rax)
vmovdqa w+4048(,%rax,4), %xmm8
vmovdqa w+4032(,%rax,4), %xmm9
vmovdqa w+4080(,%rax,4), %xmm10
vmovdqa w+4064(,%rax,4), %xmm11
vmovdqa w+3984(,%rax,4), %xmm12
vmovdqa w+3968(,%rax,4), %xmm13
vmovdqa w+4016(,%rax,4), %xmm14
vmovdqa w+4000(,%rax,4), %xmm15
vmovdqa w+3920(,%rax,4), %xmm0
vmovdqa w+3904(,%rax,4), %xmm1
vmovdqa w+3952(,%rax,4), %xmm2
vmovdqa w+3936(,%rax,4), %xmm3
vmovdqa w+3856(,%rax,4), %xmm4
vmovdqa w+3840(,%rax,4), %xmm5
vmovdqa w+3888(,%rax,4), %xmm6
vmovdqa w+3872(,%rax,4), %xmm7
vpaddd v+3872(,%rax,4), %xmm7, %xmm7
vmovdqa %xmm7, -24(%rsp) # 16-byte Spill
vpaddd v+3888(,%rax,4), %xmm6, %xmm6
vpaddd v+3840(,%rax,4), %xmm5, %xmm5
vpaddd v+3856(,%rax,4), %xmm4, %xmm4
vpaddd v+3936(,%rax,4), %xmm3, %xmm3
vpaddd v+3952(,%rax,4), %xmm2, %xmm2
vpaddd v+3904(,%rax,4), %xmm1, %xmm1
vpaddd v+3920(,%rax,4), %xmm0, %xmm0
vpaddd v+4000(,%rax,4), %xmm15, %xmm15
vpaddd v+4016(,%rax,4), %xmm14, %xmm14
vpaddd v+3968(,%rax,4), %xmm13, %xmm13
vpaddd v+3984(,%rax,4), %xmm12, %xmm12
vpaddd v+4064(,%rax,4), %xmm11, %xmm11
vpaddd v+4080(,%rax,4), %xmm10, %xmm10
vpaddd v+4032(,%rax,4), %xmm9, %xmm9
vpaddd v+4048(,%rax,4), %xmm8, %xmm7
vmovdqa %xmm7, u+4048(,%rax,4)
vmovdqa %xmm9, u+4032(,%rax,4)
vmovdqa %xmm10, u+4080(,%rax,4)
vmovdqa %xmm11, u+4064(,%rax,4)
vmovdqa %xmm12, u+3984(,%rax,4)
vmovdqa %xmm13, u+3968(,%rax,4)
vmovdqa %xmm14, u+4016(,%rax,4)
vmovdqa %xmm15, u+4000(,%rax,4)
vmovdqa %xmm0, u+3920(,%rax,4)
vmovdqa %xmm1, u+3904(,%rax,4)
vmovdqa %xmm2, u+3952(,%rax,4)
vmovdqa %xmm3, u+3936(,%rax,4)
vmovdqa %xmm4, u+3856(,%rax,4)
vmovdqa %xmm5, u+3840(,%rax,4)
vmovdqa %xmm6, u+3888(,%rax,4)
vmovaps -24(%rsp), %xmm0 # 16-byte Reload
vmovaps %xmm0, u+3872(,%rax,4)
addq $64, %rax
jne .LBB0_1
There's absolutely no reason to spill xmm7 - the last vpadd could clobber xmm8
just like the rest of the adds do (and that's regardless of the fact we could
get around it by scheduling.)</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>