[llvm] [Exegesis][RISCV] Add RISCV support for llvm-exegesis (PR #89047)

via llvm-commits llvm-commits at lists.llvm.org
Tue Dec 3 07:53:49 PST 2024


================
@@ -50,15 +50,27 @@
 namespace llvm {
 namespace exegesis {
 
+struct OpcodeNameParser
+    : public cl::parser<std::vector<std::pair<StringRef, StringRef>>> {
+  OpcodeNameParser(cl::Option &O)
+      : cl::parser<std::vector<std::pair<StringRef, StringRef>>>(O) {}
+  bool parse(cl::Option &O, StringRef ArgName, const StringRef ArgValue,
+             std::vector<std::pair<StringRef, StringRef>> &Val);
+};
+
 static cl::opt<int> OpcodeIndex(
     "opcode-index",
     cl::desc("opcode to measure, by index, or -1 to measure all opcodes"),
     cl::cat(BenchmarkOptions), cl::init(0));
 
-static cl::opt<std::string>
+static cl::opt<std::vector<std::pair<StringRef, StringRef>>, false,
+               OpcodeNameParser>
     OpcodeNames("opcode-name",
-                cl::desc("comma-separated list of opcodes to measure, by name"),
-                cl::cat(BenchmarkOptions), cl::init(""));
+                cl::desc("comma-separated list of opcodes to measure, "
+                         "each item is either opcode name ('OP') "
+                         "or opcode range ('OP1..OP2', ends are inclusive)"),
----------------
AnastasiyaChernikova wrote:

Deleted this option in this pr

https://github.com/llvm/llvm-project/pull/89047


More information about the llvm-commits mailing list