<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 - Failure to convert 'sub' reduction to negated 'add' reduction"
href="https://bugs.llvm.org/show_bug.cgi?id=49858">49858</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>Failure to convert 'sub' reduction to negated 'add' reduction
</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>Scalar Optimizations
</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>llvm-bugs@lists.llvm.org, spatel+llvm@rotateright.com
</td>
</tr></table>
<p>
<div>
<pre>Split off from [<a class="bz_bug_link
bz_status_REOPENED "
title="REOPENED - [X86][SSE] Missed vXi8 sum reduction optimization"
href="show_bug.cgi?id=42674#c20">Bug#42674 Comment#20</a>]
<a href="https://godbolt.org/z/vfd8oGvaT">https://godbolt.org/z/vfd8oGvaT</a>
We fail to match subtraction reductions as addition reductions followed by a
negation.
int sub32(const int *data)
{
int result = 0;
for(unsigned n=0; n<16; ++n) result -= data[n];
return result;
}
int sub32(const int *data, int start_value)
{
int result = start_value;
for(unsigned n=0; n<16; ++n) result -= data[n];
return result;
}</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>