<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 - Regression: Chain of branches/selects no longer simplified to chain of 'or'"
href="https://bugs.llvm.org/show_bug.cgi?id=51577">51577</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>Regression: Chain of branches/selects no longer simplified to chain of 'or'
</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>Keywords</th>
<td>code-quality, quality-of-implementation, regression
</td>
</tr>
<tr>
<th>Severity</th>
<td>normal
</td>
</tr>
<tr>
<th>Priority</th>
<td>P
</td>
</tr>
<tr>
<th>Component</th>
<td>Transformation Utilities
</td>
</tr>
<tr>
<th>Assignee</th>
<td>unassignedbugs@nondot.org
</td>
</tr>
<tr>
<th>Reporter</th>
<td>nok.raven@gmail.com
</td>
</tr>
<tr>
<th>CC</th>
<td>llvm-bugs@lists.llvm.org
</td>
</tr></table>
<p>
<div>
<pre>Something changed in the middle-end and a soup of icmp's, select's, and phi's
is now produced by the optimizer for these:
bool foo(bool& a, bool& b, bool& c, bool& d)
{
bool r = false;
if (a) r = true;
if (b) r = true;
if (c) r = true;
if (d) r = true;
return r;
}
bool bar(bool& a, bool& b, bool& c, bool& d)
{
if (a) return true;
if (b) return true;
if (c) return true;
if (d) return true;
return false;
}
bool qaz(bool& a, bool& b, bool& c, bool& d)
{
if (a) return true;
if (b) return true;
if (c) return true;
return d;
}
bool zaq(bool& a, bool& b, bool& c, bool& d)
{
bool r = false;
/**/ if (a) r = true;
else if (b) r = true;
else if (c) r = true;
else if (d) r = true;
return r;
}
All functions are equivalent and should produce:
mov al, byte ptr [rcx]
or al, byte ptr [rdx]
or al, byte ptr [rsi]
or al, byte ptr [rdi]
ret
<a href="https://godbolt.org/z/re5KGeKPK">https://godbolt.org/z/re5KGeKPK</a></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>