mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2025-01-31 20:51:52 +01:00
[llvm-exegesis] Fix D80610.
Summary: Using a .data() member on a StringRef was discarding the StringRef size, breaking llvm-exegesis on machines with counter sums (e.g. Zen2). Reviewers: oontvoo Subscribers: mstojanovic, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D80982
This commit is contained in:
parent
7788e0be2b
commit
0857d5bd0f
@ -55,7 +55,7 @@ private:
|
||||
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();
|
||||
|
@ -30,8 +30,7 @@ const ExegesisTarget *ExegesisTarget::lookup(Triple TT) {
|
||||
}
|
||||
|
||||
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>(
|
||||
|
@ -69,7 +69,7 @@ public:
|
||||
|
||||
// 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 {}
|
||||
|
Loading…
x
Reference in New Issue
Block a user