xref: /llvm-project/llvm/test/tools/llvm-exegesis/X86/analysis-cluster-stabilization.test (revision 1bc8daba4fa3e27c115969c4c996dd1f7d52a3e4)
1# RUN: llvm-exegesis -mode=analysis -benchmarks-file=%s -analysis-clusters-output-file=- -analysis-clustering-epsilon=0.1 -analysis-inconsistency-epsilon=0.1 -analysis-numpoints=1 | FileCheck -check-prefixes=CHECK-CLUSTERS %s
2# RUN: llvm-exegesis -mode=analysis -benchmarks-file=%s -analysis-inconsistencies-output-file=- -analysis-clustering-epsilon=0.5 -analysis-inconsistency-epsilon=0.5 -analysis-numpoints=1 | FileCheck -check-prefixes=CHECK-INCONSISTENCIES-STABLE %s
3# RUN: llvm-exegesis -mode=analysis -benchmarks-file=%s -analysis-inconsistencies-output-file=- -analysis-clustering-epsilon=0.5 -analysis-inconsistency-epsilon=0.5 -analysis-display-unstable-clusters -analysis-numpoints=1 | FileCheck -check-prefixes=CHECK-INCONSISTENCIES-UNSTABLE %s
4
5# We have one ADD32rr measurement, and two measurements for SQRTSSr.
6# The ADD32rr measurement and one of the SQRTSSr measurements are identical,
7# and thus will be be in the same cluster. But the second SQRTSSr measurement
8# is different from the first SQRTSSr measurement, and thus it will be in it's
9# own cluster. We do reclusterization, and thus since there is more than one
10# measurement from SQRTSSr, and they are not in the same cluster, we move
11# all two SQRTSSr measurements into their own cluster, and mark it as unstable.
12# By default, we do not show such unstable clusters.
13# If told to show, we *only* show such unstable clusters.
14
15# CHECK-CLUSTERS: {{^}}cluster_id,opcode_name,config,sched_class,latency{{$}}
16# CHECK-CLUSTERS-NEXT: {{^}}0,
17# CHECK-CLUSTERS-SAME: ,90.00{{$}}
18# CHECK-CLUSTERS: {{^}}3,
19# CHECK-CLUSTERS-SAME: ,90.11{{$}}
20# CHECK-CLUSTERS-NEXT: {{^}}3,
21# CHECK-CLUSTERS-SAME: ,100.00{{$}}
22
23# CHECK-INCONSISTENCIES-STABLE: ADD32rr
24# CHECK-INCONSISTENCIES-STABLE-NOT: ADD32rr
25# CHECK-INCONSISTENCIES-STABLE-NOT: SQRTSSr
26
27# CHECK-INCONSISTENCIES-UNSTABLE: SQRTSSr
28# CHECK-INCONSISTENCIES-UNSTABLE: SQRTSSr
29# CHECK-INCONSISTENCIES-UNSTABLE-NOT: SQRTSSr
30# CHECK-INCONSISTENCIES-UNSTABLE-NOT: ADD32rr
31
32---
33mode:            latency
34key:
35  instructions:
36    - 'ADD32rr EDX EDX EAX'
37  config:          ''
38  register_initial_values:
39    - 'EDX=0x0'
40    - 'EAX=0x0'
41cpu_name:        bdver2
42llvm_triple:     x86_64-unknown-linux-gnu
43num_repetitions: 10000
44measurements:
45  - { key: latency, value: 90.0000, per_snippet_value: 90.0000 }
46error:           ''
47info:            Repeating a single implicitly serial instruction
48assembled_snippet: BA00000000B80000000001C201C201C201C201C201C201C201C201C201C201C201C201C201C201C201C2C3
49---
50mode:            latency
51key:
52  instructions:
53    - 'SQRTSSr XMM11 XMM11'
54  config:          ''
55  register_initial_values:
56    - 'XMM11=0x0'
57cpu_name:        bdver2
58llvm_triple:     x86_64-unknown-linux-gnu
59num_repetitions: 10000
60measurements:
61  - { key: latency, value: 90.1111, per_snippet_value: 90.1111 }
62error:           ''
63info:            Repeating a single explicitly serial instruction
64assembled_snippet: 4883EC10C7042400000000C744240400000000C744240800000000C744240C00000000C57A6F1C244883C410F3450F51DBF3450F51DBF3450F51DBF3450F51DBF3450F51DBF3450F51DBF3450F51DBF3450F51DBF3450F51DBF3450F51DBF3450F51DBF3450F51DBF3450F51DBF3450F51DBF3450F51DBF3450F51DBC3
65...
66---
67mode:            latency
68key:
69  instructions:
70    - 'SQRTSSr XMM11 XMM11'
71  config:          ''
72  register_initial_values:
73    - 'XMM11=0x0'
74cpu_name:        bdver2
75llvm_triple:     x86_64-unknown-linux-gnu
76num_repetitions: 10000
77measurements:
78  - { key: latency, value: 100, per_snippet_value: 100 }
79error:           ''
80info:            Repeating a single explicitly serial instruction
81assembled_snippet: 4883EC10C7042400000000C744240400000000C744240800000000C744240C00000000C57A6F1C244883C410F3450F51DBF3450F51DBF3450F51DBF3450F51DBF3450F51DBF3450F51DBF3450F51DBF3450F51DBF3450F51DBF3450F51DBF3450F51DBF3450F51DBF3450F51DBF3450F51DBF3450F51DBF3450F51DBC3
82...
83