diff options
| author | Clement Courbet <courbet@google.com> | 2018-10-25 07:44:01 +0000 |
|---|---|---|
| committer | Clement Courbet <courbet@google.com> | 2018-10-25 07:44:01 +0000 |
| commit | 41c8af3924ca539faa3ea871f09ab37ba7f3b7d1 (patch) | |
| tree | 068a77624d5c7aa8fd8c0be3ec4457ae58537236 /llvm/tools/llvm-exegesis/lib/LlvmState.cpp | |
| parent | 128fcffb062789a77d65ce2966ffa0ef718e3d47 (diff) | |
| download | bcm5719-llvm-41c8af3924ca539faa3ea871f09ab37ba7f3b7d1.tar.gz bcm5719-llvm-41c8af3924ca539faa3ea871f09ab37ba7f3b7d1.zip | |
[MCSched] Bind PFM Counters to the CPUs instead of the SchedModel.
Summary:
The pfm counters are now in the ExegesisTarget rather than the
MCSchedModel (PR39165).
This also compresses the pfm counter tables (PR37068).
Reviewers: RKSimon, gchatelet
Subscribers: mgrang, llvm-commits
Differential Revision: https://reviews.llvm.org/D52932
llvm-svn: 345243
Diffstat (limited to 'llvm/tools/llvm-exegesis/lib/LlvmState.cpp')
| -rw-r--r-- | llvm/tools/llvm-exegesis/lib/LlvmState.cpp | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/llvm/tools/llvm-exegesis/lib/LlvmState.cpp b/llvm/tools/llvm-exegesis/lib/LlvmState.cpp index 58e9db315d5..b5580c83cf5 100644 --- a/llvm/tools/llvm-exegesis/lib/LlvmState.cpp +++ b/llvm/tools/llvm-exegesis/lib/LlvmState.cpp @@ -36,14 +36,17 @@ LLVMState::LLVMState(const std::string &Triple, const std::string &CpuName) { llvm::errs() << "no exegesis target for " << Triple << ", using default\n"; TheExegesisTarget = &ExegesisTarget::getDefault(); } + PfmCounters = &TheExegesisTarget->getPfmCounters(CpuName); + RATC.reset(new RegisterAliasingTrackerCache( getRegInfo(), getFunctionReservedRegs(getTargetMachine()))); IC.reset(new InstructionsCache(getInstrInfo(), getRATC())); } -LLVMState::LLVMState() +LLVMState::LLVMState(const std::string &CpuName) : LLVMState(llvm::sys::getProcessTriple(), - llvm::sys::getHostCPUName().str()) {} + CpuName.empty() ? llvm::sys::getHostCPUName().str() : CpuName) { +} std::unique_ptr<llvm::LLVMTargetMachine> LLVMState::createTargetMachine() const { |

