[PATCH] D20178: Fix PR26055 - LiveDebugValues is very slow
Adrian Prantl via llvm-commits
llvm-commits at lists.llvm.org
Sun May 15 09:24:45 PDT 2016
aprantl updated this revision to Diff 57297.
aprantl added a comment.
This version replaces the data structures with SparseBitVectors and adds a couple of further optimizations.
Apart from making the algorithm much easier to read, this now brings the ASAN example I've been primarily testing on down to just 8 seconds(!) in a NoAsserts build (while producing an identical object file :-).
Some of the optimizations I added on top are:
- VarLoc now explicitly stores the register location for faster comparisons.
- transferDebugValue no longer checks the inlinedAt field. This makes a huge difference because looking up the inline scope of a MachineInstr is quite slow. This means that we can't propagate more than one inlined copies of the same variable. IMHO this is an acceptable trade-off. Note that this only affects accuracy, not correctness.
- I experimented with many different data structures (std::list, SmallDenseMap, SmallBitVector) for VarLocList, but settled on a SparseBitVector, because it makes the InLocs |= OpenRanges operation very natural. Iterating over the set bits in a SparseBitVector can be expensive, but it doesn't seem to make much of a difference in practice.
I think this is as far as I want to go with optimizations for PR26055.
Once we add support for more differnet kinds of debug (value) locations, it might make sense to revisit this.
http://reviews.llvm.org/D20178
Files:
lib/CodeGen/LiveDebugValues.cpp
test/DebugInfo/COFF/register-variables.ll
test/DebugInfo/MIR/X86/live-debug-values-3preds.mir
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D20178.57297.patch
Type: text/x-patch
Size: 21861 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20160515/08e4b8c6/attachment.bin>
More information about the llvm-commits
mailing list