<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 - DependenceAnalysis ignores base pointers and only looks at array indeces"
href="https://bugs.llvm.org/show_bug.cgi?id=33567">33567</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>DependenceAnalysis ignores base pointers and only looks at array indeces
</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>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>Global Analyses
</td>
</tr>
<tr>
<th>Assignee</th>
<td>unassignedbugs@nondot.org
</td>
</tr>
<tr>
<th>Reporter</th>
<td>stanislav.manilov@gmail.com
</td>
</tr>
<tr>
<th>CC</th>
<td>llvm-bugs@lists.llvm.org
</td>
</tr></table>
<p>
<div>
<pre>Consider the following two examples:
void example_A(int *A, unsigned n) {
for (unsigned i = 0; i < n; ++i) {
A[i] = A[i + 1];
}
}
void example_B(int *A, unsigned n) {
int *B = A + 1;
for (unsigned i = 0; i < n; ++i) {
A[i] = B[i];
}
}
I expect DependenceAnalysis to give me the same result from both examples,
ideally "anti [1|<]" if I understand the notation correctly. Explicitly, I
expect an anti dependence of distance 1, since on iteration i+1 the loop reads
the memory location written on iteration i.
Quoting Philip (<a href="mailto:philip.pfaffe@gmail.com">philip.pfaffe@gmail.com</a>):
In the first example, I get an "anti [*|<]" result. DA doesn't look through
zext expressions, so it needs to overapproximate.
In the second example I get a "consistent anti [0|<]" result, which is wrong.
The cause of this bug is that DA falsely ignores the base pointer, and only
looks at the indices.
End of quote.
I have verified this and get the same results on LLVM 3.9.1 and LLVM trunk
(f066646d).</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>