<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 --- - SDNode::hasPredecessorHelper() has algorithm bug"
href="https://llvm.org/bugs/show_bug.cgi?id=25431">25431</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>SDNode::hasPredecessorHelper() has algorithm bug
</td>
</tr>
<tr>
<th>Product</th>
<td>new-bugs
</td>
</tr>
<tr>
<th>Version</th>
<td>3.7
</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>normal
</td>
</tr>
<tr>
<th>Priority</th>
<td>P
</td>
</tr>
<tr>
<th>Component</th>
<td>new bugs
</td>
</tr>
<tr>
<th>Assignee</th>
<td>unassignedbugs@nondot.org
</td>
</tr>
<tr>
<th>Reporter</th>
<td>eric.schweitz@pgroup.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>There is an algorithm problem in this function when it is used to cache search
results and answer multiple queries.
Specifically, if we ask the algorithm if the SDNodes U_1 ... U_n are transitive
preds of the instruction S, we can get the wrong answer.
This happens in the following scenario. Suppose there is an SDNode U_j that is
a pred of S. Say U_j is the k-th argument to its succ U_i, which has m > k
total arguments; we have U_j --> U_i ~~> S. When visiting U_i, we will find
U_j, stop, and return true. At this point we have effectively pruned the search
space of all the arguments k+1 .. m to U_i. The for loop is exited before these
children are placed on the worklist. On the next query, for U_k, if U_k lies
along one of the lost subgraph paths, the algorithm will return false even
though there does exist a path U_k ~~> U_i ~~> S.
This bug is masked when using the hasPredecessor() query because the entire
search space is reconstructed rather than cached.</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>