<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 --- - [AArch64] Sutraction interferes with umin generation" href="https://urldefense.proofpoint.com/v2/url?u=https-3A__llvm.org_bugs_show-5Fbug.cgi-3Fid-3D23857&d=AwMBaQ&c=8hUWFZcy2Z-Za5rBPlktOQ&r=pF93YEPyB-J_PERP4DUZOJDzFVX5ZQ57vQk33wu0vio&m=S3T8j5bzukYGG2QAgeAOYlye3VJfJIsx7r0S8WJ8SSA&s=_6w9A468DJ_t6J749xJUmht3SNuqvxFnmKlWh9cxs6I&e=">23857</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>[AArch64] Sutraction interferes with umin generation
</td>
</tr>
<tr>
<th>Product</th>
<td>tools
</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>opt
</td>
</tr>
<tr>
<th>Assignee</th>
<td>unassignedbugs@nondot.org
</td>
</tr>
<tr>
<th>Reporter</th>
<td>silviu.baranga@arm.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=14478" name="attach_14478" title="IR reproducer">attachment 14478</a> <a href="attachment.cgi?id=14478&action=edit" title="IR reproducer">[details]</a></span>
IR reproducer
The following code will not generate umin/umax instructions because of the
subtract used to compute a.
void test(unsigned char *in0,
unsigned char *in1,
unsigned char *out,
unsigned n) {
unsigned i;
unsigned char a, b;
for (i = 0; i < n; i++)
{
a = 255 - in0[i]; // Replacing with a = in0[i] allows us to generate umin
b = in1[i];
out[i] = (unsigned char) (a < b ? a : b);
}
}
Reproduce with:
clang -cc1 -triple aarch64--linux-gnueabi test.c -S -o out.s -mllvm
-force-vector-width=16 -O3 -vectorize-loops
I've also attached a.ll which contains two similar functions obtained from this
code. This shows that removing the xor (sub) operation allows us to generate
umin:
opt -O3 aa.ll -o aa1.ll -S -force-vector-width=16
bin/llc -O3 aa1.ll -o aa1.s
Found on trunk (4a867c7a05bd0560cc16b3c16286e1c76073334e), Mon Jun 15 09:19:41
2015.</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>