diff options
Diffstat (limited to 'llvm')
| -rw-r--r-- | llvm/tools/llvm-exegesis/lib/Analysis.cpp | 25 | ||||
| -rw-r--r-- | llvm/unittests/tools/llvm-exegesis/BenchmarkResultTest.cpp | 2 |
2 files changed, 10 insertions, 17 deletions
diff --git a/llvm/tools/llvm-exegesis/lib/Analysis.cpp b/llvm/tools/llvm-exegesis/lib/Analysis.cpp index 48700218577..c8b2cb8c009 100644 --- a/llvm/tools/llvm-exegesis/lib/Analysis.cpp +++ b/llvm/tools/llvm-exegesis/lib/Analysis.cpp @@ -17,20 +17,13 @@ void renderInstructionRow(const InstructionBenchmark &Point, OS << "\n"; } -void analyzeCluster(const std::vector<InstructionBenchmark> &Points, - const llvm::MCSubtargetInfo &STI, - const InstructionBenchmarkClustering::Cluster &Cluster, - llvm::raw_ostream &OS) { +void printCluster(const std::vector<InstructionBenchmark> &Points, + const llvm::MCSubtargetInfo &STI, + const size_t ClusterId, + const InstructionBenchmarkClustering::Cluster &Cluster, + llvm::raw_ostream &OS) { // TODO: - // std::sort(Cluster.PointIndices.begin(), Cluster.PointIndices.end(), - // [](int PointIdA, int PointIdB) { return GetSchedClass(Points[PointIdA]) < // GetSchedClass(Points[PointIdB]); }); - OS << "Cluster:\n"; - // Get max length of the name for alignement. - size_t NameLen = 0; - for (const auto &PointId : Cluster.PointIndices) { - NameLen = std::max(NameLen, Points[PointId].AsmTmpl.Name.size()); - } // Print all points. for (const auto &PointId : Cluster.PointIndices) { @@ -43,10 +36,10 @@ void analyzeCluster(const std::vector<InstructionBenchmark> &Points, llvm::Error printAnalysisClusters(const InstructionBenchmarkClustering &Clustering, const llvm::MCSubtargetInfo &STI, llvm::raw_ostream &OS) { - - for (const auto &Cluster : Clustering.getValidClusters()) { - analyzeCluster(Clustering.getPoints(), STI, Cluster, OS); - OS << "\n\n\n"; + OS << "cluster_id,key,"; + for (size_t I = 0, E = Clustering.getValidClusters().size(); I < E; ++I) { + printCluster(Clustering.getPoints(), STI, I, Clustering.getValidClusters()[I], OS); + OS << "\n\n"; } return llvm::Error::success(); diff --git a/llvm/unittests/tools/llvm-exegesis/BenchmarkResultTest.cpp b/llvm/unittests/tools/llvm-exegesis/BenchmarkResultTest.cpp index 82c9481a238..52bc0e94357 100644 --- a/llvm/unittests/tools/llvm-exegesis/BenchmarkResultTest.cpp +++ b/llvm/unittests/tools/llvm-exegesis/BenchmarkResultTest.cpp @@ -57,7 +57,7 @@ TEST(BenchmarkResultTest, WriteToAndReadFromDisk) { { // Vector version. const auto FromDiskVector = InstructionBenchmark::readYamlsOrDie(Filename); - ASSERT_EQ(FromDiskVector.size(), 1); + ASSERT_EQ(FromDiskVector.size(), size_t{1}); const auto FromDisk = FromDiskVector[0]; EXPECT_EQ(FromDisk.AsmTmpl.Name, ToDisk.AsmTmpl.Name); EXPECT_EQ(FromDisk.CpuName, ToDisk.CpuName); |

