Skip to content

Commit 43f4e2b

Browse files
[Docs][llvm-exegesis] Use double dash long options
Currently the llvm-exegesis docs use a mix of double dash and single dash options with seemingly no pattern. This patch makes everything double dash options as it has been suggested that we should be advertising double dash long options exclusively in the documentation. Reviewed By: MaskRay Differential Revision: https://reviews.llvm.org/D157641
1 parent f7f5d34 commit 43f4e2b

File tree

1 file changed

+33
-33
lines changed

1 file changed

+33
-33
lines changed

llvm/docs/CommandGuide/llvm-exegesis.rst

Lines changed: 33 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -89,18 +89,18 @@ instruction, run:
8989

9090
.. code-block:: bash
9191
92-
$ llvm-exegesis -mode=latency -opcode-name=ADD64rr
92+
$ llvm-exegesis --mode=latency --opcode-name=ADD64rr
9393
9494
Measuring the uop decomposition or inverse throughput of an instruction works similarly:
9595

9696
.. code-block:: bash
9797
98-
$ llvm-exegesis -mode=uops -opcode-name=ADD64rr
99-
$ llvm-exegesis -mode=inverse_throughput -opcode-name=ADD64rr
98+
$ llvm-exegesis --mode=uops --opcode-name=ADD64rr
99+
$ llvm-exegesis --mode=inverse_throughput --opcode-name=ADD64rr
100100
101101
102102
The output is a YAML document (the default is to write to stdout, but you can
103-
redirect the output to a file using `-benchmarks-file`):
103+
redirect the output to a file using `--benchmarks-file`):
104104

105105
.. code-block:: none
106106
@@ -125,7 +125,7 @@ To measure the latency of all instructions for the host architecture, run:
125125

126126
.. code-block:: bash
127127
128-
$ llvm-exegesis -mode=latency -opcode-index=-1
128+
$ llvm-exegesis --mode=latency --opcode-index=-1
129129
130130
131131
EXAMPLE 2: benchmarking a custom code snippet
@@ -136,7 +136,7 @@ To measure the latency/uops of a custom piece of code, you can specify the
136136

137137
.. code-block:: bash
138138
139-
$ echo "vzeroupper" | llvm-exegesis -mode=uops -snippets-file=-
139+
$ echo "vzeroupper" | llvm-exegesis --mode=uops --snippets-file=-
140140
141141
Real-life code snippets typically depend on registers or memory.
142142
:program:`llvm-exegesis` checks the liveliness of registers (i.e. any register
@@ -189,10 +189,10 @@ following command:
189189

190190
.. code-block:: bash
191191
192-
$ llvm-exegesis -mode=analysis \
193-
-benchmarks-file=/tmp/benchmarks.yaml \
194-
-analysis-clusters-output-file=/tmp/clusters.csv \
195-
-analysis-inconsistencies-output-file=/tmp/inconsistencies.html
192+
$ llvm-exegesis --mode=analysis \
193+
--benchmarks-file=/tmp/benchmarks.yaml \
194+
--analysis-clusters-output-file=/tmp/clusters.csv \
195+
--analysis-inconsistencies-output-file=/tmp/inconsistencies.html
196196
197197
This will group the instructions into clusters with the same performance
198198
characteristics. The clusters will be written out to `/tmp/clusters.csv` in the
@@ -230,28 +230,28 @@ be shown. This does not invalidate any of the analysis results though.
230230
OPTIONS
231231
-------
232232

233-
.. option:: -help
233+
.. option:: --help
234234

235235
Print a summary of command line options.
236236

237-
.. option:: -opcode-index=<LLVM opcode index>
237+
.. option:: --opcode-index=<LLVM opcode index>
238238

239239
Specify the opcode to measure, by index. Specifying `-1` will result
240240
in measuring every existing opcode. See example 1 for details.
241241
Either `opcode-index`, `opcode-name` or `snippets-file` must be set.
242242

243-
.. option:: -opcode-name=<opcode name 1>,<opcode name 2>,...
243+
.. option:: --opcode-name=<opcode name 1>,<opcode name 2>,...
244244

245245
Specify the opcode to measure, by name. Several opcodes can be specified as
246246
a comma-separated list. See example 1 for details.
247247
Either `opcode-index`, `opcode-name` or `snippets-file` must be set.
248248

249-
.. option:: -snippets-file=<filename>
249+
.. option:: --snippets-file=<filename>
250250

251251
Specify the custom code snippet to measure. See example 2 for details.
252252
Either `opcode-index`, `opcode-name` or `snippets-file` must be set.
253253

254-
.. option:: -mode=[latency|uops|inverse_throughput|analysis]
254+
.. option:: --mode=[latency|uops|inverse_throughput|analysis]
255255

256256
Specify the run mode. Note that some modes have additional requirements and options.
257257

@@ -274,7 +274,7 @@ OPTIONS
274274
* ``assemble-measured-code``: Same as ``prepare-and-assemble-snippet``. but also creates the full sequence that can be dumped to a file using ``--dump-object-to-disk``.
275275
* ``measure``: Same as ``assemble-measured-code``, but also runs the measurement.
276276

277-
.. option:: -x86-lbr-sample-period=<nBranches/sample>
277+
.. option:: --x86-lbr-sample-period=<nBranches/sample>
278278

279279
Specify the LBR sampling period - how many branches before we take a sample.
280280
When a positive value is specified for this option and when the mode is `latency`,
@@ -283,7 +283,7 @@ OPTIONS
283283
could occur if the sampling is too frequent. A prime number should be used to
284284
avoid consistently skipping certain blocks.
285285

286-
.. option:: -x86-disable-upper-sse-registers
286+
.. option:: --x86-disable-upper-sse-registers
287287

288288
Using the upper xmm registers (xmm8-xmm15) forces a longer instruction encoding
289289
which may put greater pressure on the frontend fetch and decode stages,
@@ -292,7 +292,7 @@ OPTIONS
292292
enabled can help determine the effects of the frontend and can be used to
293293
improve latency and throughput estimates.
294294

295-
.. option:: -repetition-mode=[duplicate|loop|min]
295+
.. option:: --repetition-mode=[duplicate|loop|min]
296296

297297
Specify the repetition mode. `duplicate` will create a large, straight line
298298
basic block with `num-repetitions` instructions (repeating the snippet
@@ -307,21 +307,21 @@ OPTIONS
307307
instead use the `min` mode, which will run each other mode,
308308
and produce the minimal measured result.
309309

310-
.. option:: -num-repetitions=<Number of repetitions>
310+
.. option:: --num-repetitions=<Number of repetitions>
311311

312312
Specify the target number of executed instructions. Note that the actual
313313
repetition count of the snippet will be `num-repetitions`/`snippet size`.
314314
Higher values lead to more accurate measurements but lengthen the benchmark.
315315

316-
.. option:: -loop-body-size=<Preferred loop body size>
316+
.. option:: --loop-body-size=<Preferred loop body size>
317317

318318
Only effective for `-repetition-mode=[loop|min]`.
319319
Instead of looping over the snippet directly, first duplicate it so that the
320320
loop body contains at least this many instructions. This potentially results
321321
in loop body being cached in the CPU Op Cache / Loop Cache, which allows to
322322
which may have higher throughput than the CPU decoders.
323323

324-
.. option:: -max-configs-per-opcode=<value>
324+
.. option:: --max-configs-per-opcode=<value>
325325

326326
Specify the maximum configurations that can be generated for each opcode.
327327
By default this is `1`, meaning that we assume that a single measurement is
@@ -333,67 +333,67 @@ OPTIONS
333333
lead to different performance characteristics.
334334

335335

336-
.. option:: -benchmarks-file=</path/to/file>
336+
.. option:: --benchmarks-file=</path/to/file>
337337

338338
File to read (`analysis` mode) or write (`latency`/`uops`/`inverse_throughput`
339339
modes) benchmark results. "-" uses stdin/stdout.
340340

341-
.. option:: -analysis-clusters-output-file=</path/to/file>
341+
.. option:: --analysis-clusters-output-file=</path/to/file>
342342

343343
If provided, write the analysis clusters as CSV to this file. "-" prints to
344344
stdout. By default, this analysis is not run.
345345

346-
.. option:: -analysis-inconsistencies-output-file=</path/to/file>
346+
.. option:: --analysis-inconsistencies-output-file=</path/to/file>
347347

348348
If non-empty, write inconsistencies found during analysis to this file. `-`
349349
prints to stdout. By default, this analysis is not run.
350350

351-
.. option:: -analysis-filter=[all|reg-only|mem-only]
351+
.. option:: --analysis-filter=[all|reg-only|mem-only]
352352

353353
By default, all benchmark results are analysed, but sometimes it may be useful
354354
to only look at those that to not involve memory, or vice versa. This option
355355
allows to either keep all benchmarks, or filter out (ignore) either all the
356356
ones that do involve memory (involve instructions that may read or write to
357357
memory), or the opposite, to only keep such benchmarks.
358358

359-
.. option:: -analysis-clustering=[dbscan,naive]
359+
.. option:: --analysis-clustering=[dbscan,naive]
360360

361361
Specify the clustering algorithm to use. By default DBSCAN will be used.
362362
Naive clustering algorithm is better for doing further work on the
363363
`-analysis-inconsistencies-output-file=` output, it will create one cluster
364364
per opcode, and check that the cluster is stable (all points are neighbours).
365365

366-
.. option:: -analysis-numpoints=<dbscan numPoints parameter>
366+
.. option:: --analysis-numpoints=<dbscan numPoints parameter>
367367

368368
Specify the numPoints parameters to be used for DBSCAN clustering
369369
(`analysis` mode, DBSCAN only).
370370

371-
.. option:: -analysis-clustering-epsilon=<dbscan epsilon parameter>
371+
.. option:: --analysis-clustering-epsilon=<dbscan epsilon parameter>
372372

373373
Specify the epsilon parameter used for clustering of benchmark points
374374
(`analysis` mode).
375375

376-
.. option:: -analysis-inconsistency-epsilon=<epsilon>
376+
.. option:: --analysis-inconsistency-epsilon=<epsilon>
377377

378378
Specify the epsilon parameter used for detection of when the cluster
379379
is different from the LLVM schedule profile values (`analysis` mode).
380380

381-
.. option:: -analysis-display-unstable-clusters
381+
.. option:: --analysis-display-unstable-clusters
382382

383383
If there is more than one benchmark for an opcode, said benchmarks may end up
384384
not being clustered into the same cluster if the measured performance
385385
characteristics are different. by default all such opcodes are filtered out.
386386
This flag will instead show only such unstable opcodes.
387387

388-
.. option:: -ignore-invalid-sched-class=false
388+
.. option:: --ignore-invalid-sched-class=false
389389

390390
If set, ignore instructions that do not have a sched class (class idx = 0).
391391

392-
.. option:: -mtriple=<triple name>
392+
.. option:: --mtriple=<triple name>
393393

394394
Target triple. See `-version` for available targets.
395395

396-
.. option:: -mcpu=<cpu name>
396+
.. option:: --mcpu=<cpu name>
397397

398398
If set, measure the cpu characteristics using the counters for this CPU. This
399399
is useful when creating new sched models (the host CPU is unknown to LLVM).

0 commit comments

Comments
 (0)