Skip to content

Commit 106756a

Browse files
Dmitry BushevAnastasiyaChernikova
authored andcommitted
Remove performance counters initial support
1 parent 2cc23cf commit 106756a

File tree

9 files changed

+8
-183
lines changed

9 files changed

+8
-183
lines changed

llvm/lib/Target/RISCV/CMakeLists.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ tablegen(LLVM RISCVGenRegisterBank.inc -gen-register-bank)
1515
tablegen(LLVM RISCVGenRegisterInfo.inc -gen-register-info)
1616
tablegen(LLVM RISCVGenSearchableTables.inc -gen-searchable-tables)
1717
tablegen(LLVM RISCVGenSubtargetInfo.inc -gen-subtarget)
18-
tablegen(LLVM RISCVGenExegesis.inc -gen-exegesis)
1918

2019
set(LLVM_TARGET_DEFINITIONS RISCVGISel.td)
2120
tablegen(LLVM RISCVGenGlobalISel.inc -gen-global-isel)

llvm/lib/Target/RISCV/RISCV.td

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -84,9 +84,3 @@ def RISCV : Target {
8484
let AssemblyWriters = [RISCVAsmWriter];
8585
let AllowRegisterRenaming = 1;
8686
}
87-
88-
//===----------------------------------------------------------------------===//
89-
// Pfm Counters
90-
//===----------------------------------------------------------------------===//
91-
92-
include "RISCVPfmCounters.td"

llvm/lib/Target/RISCV/RISCVInstrInfo.td

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -526,7 +526,7 @@ class BranchCC_rri<bits<3> funct3, string opcodestr>
526526
let isTerminator = 1;
527527
}
528528

529-
let hasSideEffects = 0, mayLoad = 1, mayStore = 0, UseNamedOperandTable = 1 in {
529+
let hasSideEffects = 0, mayLoad = 1, mayStore = 0 in {
530530
class Load_ri<bits<3> funct3, string opcodestr, DAGOperand rty = GPR>
531531
: RVInstI<funct3, OPC_LOAD, (outs rty:$rd), (ins GPRMem:$rs1, simm12:$imm12),
532532
opcodestr, "$rd, ${imm12}(${rs1})">;
@@ -541,7 +541,7 @@ class HLoad_r<bits<7> funct7, bits<5> funct5, string opcodestr>
541541
// Operands for stores are in the order srcreg, base, offset rather than
542542
// reflecting the order these fields are specified in the instruction
543543
// encoding.
544-
let hasSideEffects = 0, mayLoad = 0, mayStore = 1, UseNamedOperandTable = 1 in {
544+
let hasSideEffects = 0, mayLoad = 0, mayStore = 1 in {
545545
class Store_rri<bits<3> funct3, string opcodestr, DAGOperand rty = GPR>
546546
: RVInstS<funct3, OPC_STORE, (outs),
547547
(ins rty:$rs2, GPRMem:$rs1, simm12:$imm12),

llvm/lib/Target/RISCV/RISCVPfmCounters.td

Lines changed: 0 additions & 18 deletions
This file was deleted.

llvm/tools/llvm-exegesis/lib/RISCV/CMakeLists.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ add_llvm_library(LLVMExegesisRISCV
1515
DISABLE_LLVM_LINK_LLVM_DYLIB
1616
STATIC
1717
Target.cpp
18-
RISCVCounters.cpp
1918

2019
DEPENDS
2120
intrinsics_gen

llvm/tools/llvm-exegesis/lib/RISCV/RISCVCounters.cpp

Lines changed: 0 additions & 98 deletions
This file was deleted.

llvm/tools/llvm-exegesis/lib/RISCV/RISCVCounters.h

Lines changed: 0 additions & 31 deletions
This file was deleted.

llvm/tools/llvm-exegesis/lib/RISCV/Target.cpp

Lines changed: 6 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,6 @@
88

99
#include "../Target.h"
1010

11-
#include "RISCVCounters.h"
12-
1311
#include "MCTargetDesc/RISCVBaseInfo.h"
1412
#include "MCTargetDesc/RISCVMCTargetDesc.h"
1513
#include "MCTargetDesc/RISCVMatInt.h"
@@ -31,17 +29,10 @@ namespace exegesis {
3129

3230
namespace {
3331

34-
#include "RISCVGenExegesis.inc"
35-
3632
class ExegesisRISCVTarget : public ExegesisTarget {
3733
public:
3834
ExegesisRISCVTarget();
3935

40-
Expected<std::unique_ptr<pfm::CounterGroup>>
41-
createCounter(StringRef CounterName, const LLVMState &State,
42-
ArrayRef<const char *> ValidationCounters,
43-
const pid_t ProcessID) const override;
44-
4536
bool checkOpcodeSupported(int Opcode,
4637
const MCSubtargetInfo &SI) const override;
4738

@@ -81,19 +72,8 @@ class ExegesisRISCVTarget : public ExegesisTarget {
8172
};
8273

8374
ExegesisRISCVTarget::ExegesisRISCVTarget()
84-
: ExegesisTarget(RISCVCpuPfmCounters, RISCV_MC::isOpcodeAvailable) {}
85-
86-
Expected<std::unique_ptr<pfm::CounterGroup>> ExegesisRISCVTarget::createCounter(
87-
StringRef CounterName, const LLVMState &State,
88-
ArrayRef<const char *> ValidationCounters, const pid_t ProcessID) const {
89-
if (CounterName == RISCVPfmCounterNames[0]) {
90-
// TODO add support for Linux perf counters
91-
return createRISCVCpuCyclesCounter(pfm::PerfEvent(CounterName));
92-
}
93-
return make_error<Failure>(Twine("Unsupported performance counter '")
94-
.concat(CounterName)
95-
.concat("'"));
96-
}
75+
: ExegesisTarget(ArrayRef<CpuAndPfmCounters>{},
76+
RISCV_MC::isOpcodeAvailable) {}
9777

9878
bool ExegesisRISCVTarget::checkOpcodeSupported(
9979
int Opcode, const MCSubtargetInfo &SI) const {
@@ -135,11 +115,12 @@ static std::vector<MCInst> loadIntReg(const MCSubtargetInfo &STI, unsigned Reg,
135115
for (const RISCVMatInt::Inst &Inst : InstSeq) {
136116
switch (Inst.getOpndKind()) {
137117
case RISCVMatInt::Imm:
138-
MatIntInstrs.push_back(
139-
MCInstBuilder(RISCV::LUI).addReg(DestReg).addImm(Inst.getImm()));
118+
MatIntInstrs.push_back(MCInstBuilder(Inst.getOpcode())
119+
.addReg(DestReg)
120+
.addImm(Inst.getImm()));
140121
break;
141122
case RISCVMatInt::RegX0:
142-
MatIntInstrs.push_back(MCInstBuilder(RISCV::ADD_UW)
123+
MatIntInstrs.push_back(MCInstBuilder(Inst.getOpcode())
143124
.addReg(DestReg)
144125
.addReg(SrcReg)
145126
.addReg(RISCV::X0));

utils/bazel/llvm-project-overlay/llvm/BUILD.bazel

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2248,7 +2248,6 @@ llvm_target_lib_list = [lib for lib in [
22482248
("-gen-register-info", "lib/Target/RISCV/RISCVGenRegisterInfo.inc"),
22492249
("-gen-subtarget", "lib/Target/RISCV/RISCVGenSubtargetInfo.inc"),
22502250
("-gen-searchable-tables", "lib/Target/RISCV/RISCVGenSearchableTables.inc"),
2251-
("-gen-exegesis", "lib/Target/RISCV/RISCVGenExegesis.inc"),
22522251
],
22532252
"tbl_deps": [
22542253
":riscv_isel_target_gen",

0 commit comments

Comments
 (0)