summaryrefslogtreecommitdiffstats
path: root/llvm/tools/llvm-exegesis/lib/Analysis.cpp
diff options
context:
space:
mode:
authorClement Courbet <courbet@google.com>2018-06-04 11:43:40 +0000
committerClement Courbet <courbet@google.com>2018-06-04 11:43:40 +0000
commit2cb97b95a2c209cf6a78108161392cfc2388062d (patch)
treec75f4de17e7a2147d03509d1b29854a99f2196bd /llvm/tools/llvm-exegesis/lib/Analysis.cpp
parent77d1811e96e02164d40485e98369bdea44189855 (diff)
downloadbcm5719-llvm-2cb97b95a2c209cf6a78108161392cfc2388062d.tar.gz
bcm5719-llvm-2cb97b95a2c209cf6a78108161392cfc2388062d.zip
[llvm-exegesis][NFC] Use an enum instead of a string for benchmark mode.
Summary: YAML encoding is backwards-compatible. Reviewers: gchatelet Subscribers: tschuett, llvm-commits Differential Revision: https://reviews.llvm.org/D47705 llvm-svn: 333886
Diffstat (limited to 'llvm/tools/llvm-exegesis/lib/Analysis.cpp')
-rw-r--r--llvm/tools/llvm-exegesis/lib/Analysis.cpp11
1 files changed, 6 insertions, 5 deletions
diff --git a/llvm/tools/llvm-exegesis/lib/Analysis.cpp b/llvm/tools/llvm-exegesis/lib/Analysis.cpp
index 0eb9cf20378..bf132724eaa 100644
--- a/llvm/tools/llvm-exegesis/lib/Analysis.cpp
+++ b/llvm/tools/llvm-exegesis/lib/Analysis.cpp
@@ -319,8 +319,9 @@ bool Analysis::SchedClassCluster::measurementsMatch(
std::vector<BenchmarkMeasure> SchedClassPoint(NumMeasurements);
// Latency case.
assert(!Clustering.getPoints().empty());
- const std::string &Mode = Clustering.getPoints()[0].Key.Mode;
- if (Mode == "latency") { // FIXME: use an enum.
+ const InstructionBenchmarkKey::ModeE Mode =
+ Clustering.getPoints()[0].Key.Mode;
+ if (Mode == InstructionBenchmarkKey::Latency) {
if (NumMeasurements != 1) {
llvm::errs()
<< "invalid number of measurements in latency mode: expected 1, got "
@@ -336,7 +337,7 @@ bool Analysis::SchedClassCluster::measurementsMatch(
std::max<double>(SchedClassPoint[0].Value, WLE->Cycles);
}
ClusterCenterPoint[0].Value = Representative[0].avg();
- } else if (Mode == "uops") {
+ } else if (Mode == InstructionBenchmarkKey::Uops) {
for (int I = 0, E = Representative.size(); I < E; ++I) {
// Find the pressure on ProcResIdx `Key`.
uint16_t ProcResIdx = 0;
@@ -358,8 +359,8 @@ bool Analysis::SchedClassCluster::measurementsMatch(
ClusterCenterPoint[I].Value = Representative[I].avg();
}
} else {
- llvm::errs() << "unimplemented measurement matching for mode ''" << Mode
- << "''\n";
+ llvm::errs() << "unimplemented measurement matching for mode " << Mode
+ << "\n";
return false;
}
return Clustering.isNeighbour(ClusterCenterPoint, SchedClassPoint);
OpenPOWER on IntegriCloud