[PATCH] D48779: [llvm-exegesis] Delegate the decision of cycle counter name to the target
Clement Courbet via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Sat Jun 30 02:58:27 PDT 2018
courbet accepted this revision.
courbet added a comment.
This revision is now accepted and ready to land.
Just two minor comments.
================
Comment at: tools/llvm-exegesis/lib/Latency.cpp:98
+const char *LatencyBenchmarkRunner::getCounterName() const {
+ // FIXME: Do not require SchedModel for latency.
+ if (!State.getSubtargetInfo().getSchedModel().hasExtraProcessorInfo())
----------------
I think you can remove this fixme now.
================
Comment at: tools/llvm-exegesis/lib/Latency.cpp:117
int64_t MinLatency = std::numeric_limits<int64_t>::max();
- const char *CounterName = State.getSubtargetInfo()
- .getSchedModel()
- .getExtraProcessorInfo()
- .PfmCounters.CycleCounter;
- if (!CounterName)
- llvm::report_fatal_error("sched model does not define a cycle counter");
+ const char *CounterName = getCounterName();
const pfm::PerfEvent CyclesPerfEvent(CounterName);
----------------
You need to keep the test for nullity, just in case the implementation returns nullptr.
Repository:
rL LLVM
https://reviews.llvm.org/D48779
More information about the llvm-commits
mailing list