<div dir="ltr">Given this is a time/space tradeoff, it might be worth having the space numbers as well just to demonstrate that it's a good tradeoff?</div><div class="gmail_extra"><br><div class="gmail_quote">On Wed, May 25, 2016 at 11:42 AM, Adrian Prantl via llvm-commits <span dir="ltr"><<a href="mailto:llvm-commits@lists.llvm.org" target="_blank">llvm-commits@lists.llvm.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">aprantl created this revision.<br>
aprantl added reviewers: dberlin, friss.<br>
aprantl added subscribers: zaks.anna, llvm-commits, wolfgangp.<br>
aprantl set the repository for this revision to rL LLVM.<br>
<br>
This patch builds upon <a href="http://reviews.llvm.org/D20178" rel="noreferrer" target="_blank">http://reviews.llvm.org/D20178</a> and speeds up LiveDebugValues::transferDebugValue() by adding an index that maps each DebugVariable to its open VarLoc.<br>
<br>
The transferDebugValue() function needs to close all open ranges for a given DebugVariable. Iterating over the set bits of OpenRanges is prohibitively slow in practice. I experimented with using the sorted map of VarLocs in the UniqueVector to iterate only over the range of VarLocs with a given DebugVariable, but the binary search turned out to be even more expensive than just iterating over the set bits in OpenRanges.<br>
Instead, this patch exploits the fact that there can only be one open location for each DebugVariable and redundantly stores this location in a DenseMap.<br>
<br>
Benchmarks:<br>
bench1: The ASAN -O3 example I've been testing with.<br>
bench2: The bitcode from PR26055 at -O0.<br>
<br>
Baseline (D20178):<br>
bench1: user    2m43.600s<br>
bench2: user    1m0.948s<br>
<br>
This patch:<br>
bench1: user    1m6.725s<br>
bench2: user    0m21.452s<br>
<br>
<br>
Repository:<br>
  rL LLVM<br>
<br>
<a href="http://reviews.llvm.org/D20636" rel="noreferrer" target="_blank">http://reviews.llvm.org/D20636</a><br>
<br>
Files:<br>
  lib/CodeGen/LiveDebugValues.cpp<br>
<br>
<br>_______________________________________________<br>
llvm-commits mailing list<br>
<a href="mailto:llvm-commits@lists.llvm.org">llvm-commits@lists.llvm.org</a><br>
<a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits" rel="noreferrer" target="_blank">http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits</a><br>
<br></blockquote></div><br></div>