diff --git a/llvm/docs/CommandGuide/llvm-exegesis.rst b/llvm/docs/CommandGuide/llvm-exegesis.rst index 0a5b0990d2ee0..31be33cc861f6 100644 --- a/llvm/docs/CommandGuide/llvm-exegesis.rst +++ b/llvm/docs/CommandGuide/llvm-exegesis.rst @@ -175,7 +175,8 @@ OPTIONS .. option:: -opcode-index= - Specify the opcode to measure, by index. See example 1 for details. + Specify the opcode to measure, by index. Specifying `-1` will result + in measuring every existing opcode. See example 1 for details. Either `opcode-index`, `opcode-name` or `snippets-file` must be set. .. option:: -opcode-name=,,... diff --git a/llvm/tools/llvm-exegesis/llvm-exegesis.cpp b/llvm/tools/llvm-exegesis/llvm-exegesis.cpp index c086abbb80df0..3adc9f0ca19ee 100644 --- a/llvm/tools/llvm-exegesis/llvm-exegesis.cpp +++ b/llvm/tools/llvm-exegesis/llvm-exegesis.cpp @@ -47,9 +47,10 @@ static cl::OptionCategory Options("llvm-exegesis options"); static cl::OptionCategory BenchmarkOptions("llvm-exegesis benchmark options"); static cl::OptionCategory AnalysisOptions("llvm-exegesis analysis options"); -static cl::opt OpcodeIndex("opcode-index", - cl::desc("opcode to measure, by index"), - cl::cat(BenchmarkOptions), cl::init(0)); +static cl::opt 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 OpcodeNames("opcode-name",