<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 --- - Reduce memory consumption of LazyValueInfo"
href="https://llvm.org/bugs/show_bug.cgi?id=26921">26921</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>Reduce memory consumption of LazyValueInfo
</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>listmail@philipreames.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>Currently, LVI stores it's cache in a very memory inefficient way. We can
probably get something on the order of a 2x reduction in memory usage with some
fairly minor changes.
The LVILatticeVal consists of the following fields:
LatticeValueTy Tag;
Constant *Val;
ConstantRange Range;
Tag is a 32 bit value (default enum size), where only three bits are used.
ConstantRange is a pair of APInts, each of which are a minimum of 96 bits, but
probably actually 128 bits each when accounting for padding. Given the
bitwidth of each pair is the same, this is a particularly inefficient use of
space.
Val and Range are also used exclusively of each other (based on tag).
One idea would be to allocate the ConstantRange's into a separate uniquing set,
then replace the ConstantRange with a ConstantRange* to the uniqued element.
This would allow us to use a tagged pointer representation to reduce the entire
LVILatticeVal structure to 64 bits. Even assuming that none of our
ConstantRanges ended up being common (unlikely), that would still be a
reduction of 64 bits per entry.
We could also factor our the bitwidth storage from APInt and common the storage
for the two APInt's within a ConstantRange. This would give us a 64 bit
reduction in the size of each ConstantRange (32 bit unsigned value + 1 x
padding).
Another thing to investigate is the representation of the ValueCache as an
std::map. Using something like a DenseMap<std::pair<LVIValueHandle,
AssertingVH<BasicBlock>>, LVILatticeVal> might be a better choice.
There are probably other ways to slice this problem as well.</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>