<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 - [SLP] Missed icmp/fcmp allof/anyof reductions"
href="https://bugs.llvm.org/show_bug.cgi?id=41312">41312</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>[SLP] Missed icmp/fcmp allof/anyof reductions
</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>a.bataev@hotmail.com, dtemirbulatov@gmail.com, llvm-bugs@lists.llvm.org, spatel+llvm@rotateright.com
</td>
</tr></table>
<p>
<div>
<pre>We should be able to combine these to allof/anyof vector reductions, instead we
end up with nested branch trees and scalar selects.
<a href="https://gcc.godbolt.org/z/FImIuY">https://gcc.godbolt.org/z/FImIuY</a>
#include <x86intrin.h>
float test_merge_allof_v4sf(__v4sf t) {
if((t[0] < 0.0 && t[1] < 0.0 && t[2] < 0.0 && t[3] < 0.0) ||
(t[0] > 1.0 && t[1] > 1.0 && t[2] > 1.0 && t[3] > 1.0))
return 0;
return t[0] + t[1];
}
float test_merge_anyof_v4sf(__v4sf t) {
if((t[0] < 0.0 || t[1] < 0.0 || t[2] < 0.0 || t[3] < 0.0) ||
(t[0] > 1.0 || t[1] > 1.0 || t[2] > 1.0 || t[3] > 1.0))
return 0;
return t[0] + t[1];
}
float test_separate_allof_v4sf(__v4sf t) {
if((t[0] < 0.0 && t[1] < 0.0 && t[2] < 0.0 && t[3] < 0.0))
return 0;
if((t[0] > 1.0 && t[1] > 1.0 && t[2] > 1.0 && t[3] > 1.0))
return 0;
return t[0] + t[1];
}
float test_separate_anyof_v4sf(__v4sf t) {
if((t[0] < 0.0 || t[1] < 0.0 || t[2] < 0.0 || t[3] < 0.0))
return 0;
if((t[0] > 1.0 || t[1] > 1.0 || t[2] > 1.0 || t[3] > 1.0))
return 0;
return t[0] + t[1];
}
int test_separate_allof_v4si(__v4si t) {
if((t[0] < 1 && t[1] < 1 && t[2] < 1 && t[3] < 1))
return 0;
if((t[0] > 255 && t[1] > 255 && t[2] > 255 && t[3] > 255))
return 0;
return t[0] + t[1];
}
int test_separate_anyof_v4si(__v4si t) {
if((t[0] < 1 || t[1] < 1 || t[2] < 1 || t[3] < 1))
return 0;
if((t[0] > 255 || t[1] > 255 || t[2] > 255 || t[3] > 255))
return 0;
return t[0] + t[1];
}</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>