[PATCH] D80982: [llvm-exegesis] Fix D80610.
Clement Courbet via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Tue Jun 2 01:04:57 PDT 2020
courbet created this revision.
courbet added a reviewer: oontvoo.
Herald added a subscriber: mstojanovic.
Herald added a project: LLVM.
kadircet accepted this revision.
kadircet added a comment.
This revision is now accepted and ready to land.
LGTM
Using a .data() member on a StringRef was discarding the StringRef
size, breaking llvm-exegesis on machines with counter sums (e.g.
Zen2).
Repository:
rG LLVM Github Monorepo
https://reviews.llvm.org/D80982
Files:
llvm/tools/llvm-exegesis/lib/BenchmarkRunner.cpp
llvm/tools/llvm-exegesis/lib/Target.cpp
llvm/tools/llvm-exegesis/lib/Target.h
Index: llvm/tools/llvm-exegesis/lib/Target.h
===================================================================
--- llvm/tools/llvm-exegesis/lib/Target.h
+++ llvm/tools/llvm-exegesis/lib/Target.h
@@ -69,7 +69,7 @@
// Targets can use this to create target-specific perf counters.
virtual Expected<std::unique_ptr<pfm::Counter>>
- createCounter(const char *CounterName, const LLVMState &State) const;
+ createCounter(StringRef CounterName, const LLVMState &State) const;
// Targets can use this to add target-specific passes in assembleToStream();
virtual void addTargetSpecificPasses(PassManagerBase &PM) const {}
Index: llvm/tools/llvm-exegesis/lib/Target.cpp
===================================================================
--- llvm/tools/llvm-exegesis/lib/Target.cpp
+++ llvm/tools/llvm-exegesis/lib/Target.cpp
@@ -30,8 +30,7 @@
}
Expected<std::unique_ptr<pfm::Counter>>
-ExegesisTarget::createCounter(const char *CounterName,
- const LLVMState &) const {
+ExegesisTarget::createCounter(StringRef CounterName, const LLVMState &) const {
pfm::PerfEvent Event(CounterName);
if (!Event.valid())
return llvm::make_error<Failure>(
Index: llvm/tools/llvm-exegesis/lib/BenchmarkRunner.cpp
===================================================================
--- llvm/tools/llvm-exegesis/lib/BenchmarkRunner.cpp
+++ llvm/tools/llvm-exegesis/lib/BenchmarkRunner.cpp
@@ -55,7 +55,7 @@
for (auto &CounterName : CounterNames) {
CounterName = CounterName.trim();
auto CounterOrError =
- State.getExegesisTarget().createCounter(CounterName.data(), State);
+ State.getExegesisTarget().createCounter(CounterName, State);
if (!CounterOrError)
return CounterOrError.takeError();
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D80982.267805.patch
Type: text/x-patch
Size: 1783 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200602/d2d19461/attachment.bin>
More information about the llvm-commits
mailing list