[PATCH] D54418: [llvm-exegesis] InstructionBenchmarkClustering::dbScan(): replace SetVector with custom BitVectorVector

Roman Lebedev via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Nov 12 03:02:10 PST 2018


lebedev.ri created this revision.
lebedev.ri added reviewers: courbet, MaskRay, RKSimon, gchatelet, john.brawn.
Herald added a subscriber: tschuett.

As it was suggested in https://reviews.llvm.org/D54381, `Set` is not the optimal data structure, given the data knowledge.
We know that the values are in range `[0, Points_.size())`.
Thus, we really only need a single bit to track whether we have the value or not.
Naturally, `BitVector` fits the bill.
We can't just use `BitVector` as a `Set` in `SetVector`, thus i have copied `SetVector`
into llvm-exegesis directory, pruned everything that isn't needed, and replaced `Set` with `BitVector` terminology.

Old: (https://reviews.llvm.org/D54415)

   Performance counter stats for './bin/llvm-exegesis -mode=analysis -analysis-epsilon=100000 -benchmarks-file=/tmp/benchmarks.yaml -analysis-inconsistencies-output-file=/tmp/clusters.html' (16 runs):
  
         6564.110422      task-clock (msec)         #    1.000 CPUs utilized            ( +-  0.19% )
  ...
              6.5657 +- 0.0129 seconds time elapsed  ( +-  0.20% )

New:

   Performance counter stats for './bin/llvm-exegesis -mode=analysis -analysis-epsilon=100000 -benchmarks-file=/tmp/benchmarks.yaml -analysis-inconsistencies-output-file=/tmp/clusters.html' (16 runs):
  
         5553.640326      task-clock (msec)         #    1.000 CPUs utilized            ( +-  0.27% )
  ...
              5.5545 +- 0.0148 seconds time elapsed  ( +-  0.27% )

So another -15%.


Repository:
  rL LLVM

https://reviews.llvm.org/D54418

Files:
  tools/llvm-exegesis/lib/BitVectorVector.h
  tools/llvm-exegesis/lib/Clustering.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D54418.173639.patch
Type: text/x-patch
Size: 4828 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20181112/c8f2f6c4/attachment.bin>


More information about the llvm-commits mailing list