[PATCH] D54388: [llvm-exegesis] InstructionBenchmarkClustering::rangeQuery(): use llvm::SmallVector<size_t, 0> for storage.

Phabricator via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Nov 19 05:31:23 PST 2018


This revision was not accepted when it landed; it landed in state "Needs Revision".
This revision was automatically updated to reflect the committed changes.
Closed by commit rL347200: [llvm-exegesis] InstructionBenchmarkClustering::rangeQuery(): use llvm… (authored by lebedevri, committed by ).

Changed prior to commit:
  https://reviews.llvm.org/D54388?vs=173546&id=174595#toc

Repository:
  rL LLVM

https://reviews.llvm.org/D54388

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


Index: llvm/trunk/tools/llvm-exegesis/lib/Clustering.h
===================================================================
--- llvm/trunk/tools/llvm-exegesis/lib/Clustering.h
+++ llvm/trunk/tools/llvm-exegesis/lib/Clustering.h
@@ -97,7 +97,7 @@
       const std::vector<InstructionBenchmark> &Points, double EpsilonSquared);
   llvm::Error validateAndSetup();
   void dbScan(size_t MinPts);
-  std::vector<size_t> rangeQuery(size_t Q) const;
+  llvm::SmallVector<size_t, 0> rangeQuery(size_t Q) const;
 
   const std::vector<InstructionBenchmark> &Points_;
   const double EpsilonSquared_;
Index: llvm/trunk/tools/llvm-exegesis/lib/Clustering.cpp
===================================================================
--- llvm/trunk/tools/llvm-exegesis/lib/Clustering.cpp
+++ llvm/trunk/tools/llvm-exegesis/lib/Clustering.cpp
@@ -9,6 +9,7 @@
 
 #include "Clustering.h"
 #include "llvm/ADT/SetVector.h"
+#include "llvm/ADT/SmallVector.h"
 #include <string>
 
 namespace llvm {
@@ -32,9 +33,9 @@
 
 // Finds the points at distance less than sqrt(EpsilonSquared) of Q (not
 // including Q).
-std::vector<size_t>
+llvm::SmallVector<size_t, 0>
 InstructionBenchmarkClustering::rangeQuery(const size_t Q) const {
-  std::vector<size_t> Neighbors;
+  llvm::SmallVector<size_t, 0> Neighbors;
   const auto &QMeasurements = Points_[Q].Measurements;
   for (size_t P = 0, NumPoints = Points_.size(); P < NumPoints; ++P) {
     if (P == Q)


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D54388.174595.patch
Type: text/x-patch
Size: 1426 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20181119/587e1bc1/attachment.bin>


More information about the llvm-commits mailing list