This is an archive of the discontinued LLVM Phabricator instance.

[exegesis] `ParallelSnippetGenerator`: always use `RegRandomizationStrategy`
Changes PlannedPublic

Authored by lebedev.ri on Jan 20 2023, 2:48 PM.

Details

Summary

Even for instructions without tied operands, as long as
there are at least two untied use reg operands,
we may find something interesting by passing the same register.

In particular, we already know that CMP64rr & friends are dep-breaking,
and some of them are even 0-cycle zero-idioms.

$ /builddirs/llvm-project/build-Clang15/bin/llvm-exegesis -mode=inverse_throughput -opcode-name=CMP64rr -max-configs-per-opcode=1048576 --benchmarks-file=- --repetition-mode=loop --loop-body-size=1024 --num-repetitions=10240000
---
mode:            inverse_throughput
key:
  instructions:
    - 'CMP64rr RAX RSI'
  config:          ''
  register_initial_values:
    - 'RAX=0x0'
    - 'RSI=0x0'
cpu_name:        znver3
llvm_triple:     x86_64-unknown-linux-gnu
num_repetitions: 10240000
measurements:
  - { key: inverse_throughput, value: 0.250251, per_snippet_value: 0.250251 }
error:           ''
info:            instruction is parallel, repeating a random one. For uses, one unique register for each position
assembled_snippet: 48B8000000000000000048BE000000000000000049B802000000000000004839F04839F04983C0FF75F4C3
...
---
mode:            inverse_throughput
key:
  instructions:
    - 'CMP64rr RSI RSI'
  config:          ''
  register_initial_values:
    - 'RSI=0x0'
cpu_name:        znver3
llvm_triple:     x86_64-unknown-linux-gnu
num_repetitions: 10240000
measurements:
  - { key: inverse_throughput, value: 0.166852, per_snippet_value: 0.166852 }
error:           ''
info:            instruction is parallel, repeating a random one. For uses, reusing the same register for all positions
assembled_snippet: 48BE000000000000000049B802000000000000004839F64839F64983C0FF75F4C3
...

Diff Detail

Event Timeline

lebedev.ri created this revision.Jan 20 2023, 2:48 PM
Herald added a project: Restricted Project. · View Herald TranscriptJan 20 2023, 2:48 PM
lebedev.ri requested review of this revision.Jan 20 2023, 2:48 PM
lebedev.ri edited the summary of this revision. (Show Details)Jan 20 2023, 2:52 PM
lebedev.ri planned changes to this revision.Jan 20 2023, 6:09 PM

(will only proceed after D140271.)

lebedev.ri edited the summary of this revision. (Show Details)Jan 21 2023, 6:09 AM