<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 --- - MemorySSA non linearity"
href="https://llvm.org/bugs/show_bug.cgi?id=28658">28658</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>MemorySSA non linearity
</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>Scalar Optimizations
</td>
</tr>
<tr>
<th>Assignee</th>
<td>unassignedbugs@nondot.org
</td>
</tr>
<tr>
<th>Reporter</th>
<td>sebpop@gmail.com
</td>
</tr>
<tr>
<th>CC</th>
<td>david.majnemer@gmail.com, dberlin@dberlin.org, george.burgess.iv@gmail.com, llvm-bugs@lists.llvm.org
</td>
</tr>
<tr>
<th>Classification</th>
<td>Unclassified
</td>
</tr></table>
<p>
<div>
<pre>While investigating the cause of a huge number of queries to the MemSSA in the
test-suite, I found that the compilation of
MultiSource/Applications/JM/ldecod/macroblock.c
has an unusually high number of lookups:
436 memoryssa - Number of Memory SSA version cache hits
30401 memoryssa - Number of MemorySSA version cache inserts
128166 memoryssa - Number of Memory SSA version cache
lookups
>From that file I extracted something that exposes the non linearity in the
number of lookups.
$ cat fun.c
#define loop do { \
for (j=0;j<m;j++) \
A[i+j] += B[i+j] * C[i][H[i+j]]; \
} while (0)
void fun(int *A, int **C, int *H, int n, int m) {
int i, j;
for (i=0;i<n;i++) {
int *B = A[i] ? C[i] : C[i+1];
loop; loop; loop; loop; loop; loop; loop; loop; loop; loop;
loop; loop; loop; loop; loop; loop; loop; loop; loop; loop;
}
}
$ clang -O3 -mllvm -stats fun.c
10284 memoryssa - Number of MemorySSA version cache inserts
20569 memoryssa - Number of Memory SSA version cache lookups
Number of Memory SSA version cache lookups:
80 loops - 20569
40 loops - 5489
20 loops - 1549
10 loops - 479
1 loop - 29
Adding another statement in the loop:
#define loop do { \
for (j=0;j<m;j++) \
A[i+j] += B[i+j] * C[i][H[i+j]]; \
A[i-j] += B[i-j] * C[i+j][H[i-j]]; \
} while (0)
Number of Memory SSA version cache lookups:
80 loops - 160824
40 loops - 42024
20 loops - 11424
10 loops - 3324
1 loop - 138</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>