[PATCH] D20636: PR26055: Speed up LiveDebugValues::transferDebugValue()

David Blaikie via llvm-commits llvm-commits at lists.llvm.org
Wed May 25 16:25:38 PDT 2016

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?

On Wed, May 25, 2016 at 11:42 AM, Adrian Prantl via llvm-commits <
llvm-commits at lists.llvm.org> wrote:

> aprantl created this revision.
> aprantl added reviewers: dberlin, friss.
> aprantl added subscribers: zaks.anna, llvm-commits, wolfgangp.
> aprantl set the repository for this revision to rL LLVM.
> This patch builds upon http://reviews.llvm.org/D20178 and speeds up
> LiveDebugValues::transferDebugValue() by adding an index that maps each
> DebugVariable to its open VarLoc.
> 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.
> 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.
> Benchmarks:
> bench1: The ASAN -O3 example I've been testing with.
> bench2: The bitcode from PR26055 at -O0.
> Baseline (D20178):
> bench1: user    2m43.600s
> bench2: user    1m0.948s
> This patch:
> bench1: user    1m6.725s
> bench2: user    0m21.452s
> Repository:
>   rL LLVM
> http://reviews.llvm.org/D20636
> Files:
>   lib/CodeGen/LiveDebugValues.cpp
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at lists.llvm.org
> http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20160525/524ec1d0/attachment.html>

More information about the llvm-commits mailing list