1 # NOTE: Assertions have been autogenerated by utils/update_mca_test_checks.py
2 # Verify that we create proper JSON for the MCA views TimelineView, ResourcePressureview,
3 # InstructionInfoView and SummaryView.
5 # RUN: llvm-mca -mtriple=x86_64-unknown-unknown -mcpu=haswell --json --timeline-max-iterations=1 --timeline --all-stats --all-views < %s | FileCheck %s
6 # RUN: llvm-mca -mtriple=x86_64-unknown-unknown -mcpu=haswell --json --timeline-max-iterations=1 --timeline --all-stats --all-views -o %t.json < %s
8 # RUN: | %python -c 'import json, sys; json.dump(json.loads(sys.stdin.read()), sys.stdout, sort_keys=True, indent=2)' \
21 # CHECK-NEXT: "CodeRegions": [
23 # CHECK-NEXT: "DispatchStatistics": {
24 # CHECK-NEXT: "GROUP": 0,
25 # CHECK-NEXT: "LQ": 0,
26 # CHECK-NEXT: "RAT": 0,
27 # CHECK-NEXT: "RCU": 0,
28 # CHECK-NEXT: "SCHEDQ": 0,
29 # CHECK-NEXT: "SQ": 0,
30 # CHECK-NEXT: "USH": 0
32 # CHECK-NEXT: "InstructionInfoView": {
33 # CHECK-NEXT: "InstructionList": [
35 # CHECK-NEXT: "Instruction": 0,
36 # CHECK-NEXT: "Latency": 1,
37 # CHECK-NEXT: "NumMicroOpcodes": 1,
38 # CHECK-NEXT: "RThroughput": 0.25,
39 # CHECK-NEXT: "hasUnmodeledSideEffects": false,
40 # CHECK-NEXT: "mayLoad": false,
41 # CHECK-NEXT: "mayStore": false
44 # CHECK-NEXT: "Instruction": 1,
45 # CHECK-NEXT: "Latency": 1,
46 # CHECK-NEXT: "NumMicroOpcodes": 1,
47 # CHECK-NEXT: "RThroughput": 0.25,
48 # CHECK-NEXT: "hasUnmodeledSideEffects": false,
49 # CHECK-NEXT: "mayLoad": false,
50 # CHECK-NEXT: "mayStore": false
53 # CHECK-NEXT: "Instruction": 2,
54 # CHECK-NEXT: "Latency": 1,
55 # CHECK-NEXT: "NumMicroOpcodes": 1,
56 # CHECK-NEXT: "RThroughput": 0.25,
57 # CHECK-NEXT: "hasUnmodeledSideEffects": false,
58 # CHECK-NEXT: "mayLoad": false,
59 # CHECK-NEXT: "mayStore": false
62 # CHECK-NEXT: "Instruction": 3,
63 # CHECK-NEXT: "Latency": 1,
64 # CHECK-NEXT: "NumMicroOpcodes": 1,
65 # CHECK-NEXT: "RThroughput": 0.25,
66 # CHECK-NEXT: "hasUnmodeledSideEffects": false,
67 # CHECK-NEXT: "mayLoad": false,
68 # CHECK-NEXT: "mayStore": false
72 # CHECK-NEXT: "Instructions": [
73 # CHECK-NEXT: "addl\t%eax, %eax",
74 # CHECK-NEXT: "addl\t%ebx, %ebx",
75 # CHECK-NEXT: "addl\t%ecx, %ecx",
76 # CHECK-NEXT: "addl\t%edx, %edx"
78 # CHECK-NEXT: "Name": "foo",
79 # CHECK-NEXT: "ResourcePressureView": {
80 # CHECK-NEXT: "ResourcePressureInfo": [
82 # CHECK-NEXT: "InstructionIndex": 0,
83 # CHECK-NEXT: "ResourceIndex": 8,
84 # CHECK-NEXT: "ResourceUsage": 1
87 # CHECK-NEXT: "InstructionIndex": 1,
88 # CHECK-NEXT: "ResourceIndex": 7,
89 # CHECK-NEXT: "ResourceUsage": 1
92 # CHECK-NEXT: "InstructionIndex": 2,
93 # CHECK-NEXT: "ResourceIndex": 3,
94 # CHECK-NEXT: "ResourceUsage": 1
97 # CHECK-NEXT: "InstructionIndex": 3,
98 # CHECK-NEXT: "ResourceIndex": 2,
99 # CHECK-NEXT: "ResourceUsage": 1
102 # CHECK-NEXT: "InstructionIndex": 4,
103 # CHECK-NEXT: "ResourceIndex": 2,
104 # CHECK-NEXT: "ResourceUsage": 1
107 # CHECK-NEXT: "InstructionIndex": 4,
108 # CHECK-NEXT: "ResourceIndex": 3,
109 # CHECK-NEXT: "ResourceUsage": 1
112 # CHECK-NEXT: "InstructionIndex": 4,
113 # CHECK-NEXT: "ResourceIndex": 7,
114 # CHECK-NEXT: "ResourceUsage": 1
117 # CHECK-NEXT: "InstructionIndex": 4,
118 # CHECK-NEXT: "ResourceIndex": 8,
119 # CHECK-NEXT: "ResourceUsage": 1
123 # CHECK-NEXT: "SummaryView": {
124 # CHECK-NEXT: "BlockRThroughput": 1,
125 # CHECK-NEXT: "DispatchWidth": 4,
126 # CHECK-NEXT: "IPC": 3.883495145631068,
127 # CHECK-NEXT: "Instructions": 400,
128 # CHECK-NEXT: "Iterations": 100,
129 # CHECK-NEXT: "TotalCycles": 103,
130 # CHECK-NEXT: "TotaluOps": 400,
131 # CHECK-NEXT: "uOpsPerCycle": 3.883495145631068
133 # CHECK-NEXT: "TimelineView": {
134 # CHECK-NEXT: "TimelineInfo": [
136 # CHECK-NEXT: "CycleDispatched": 0,
137 # CHECK-NEXT: "CycleExecuted": 2,
138 # CHECK-NEXT: "CycleIssued": 1,
139 # CHECK-NEXT: "CycleReady": 0,
140 # CHECK-NEXT: "CycleRetired": 3
143 # CHECK-NEXT: "CycleDispatched": 0,
144 # CHECK-NEXT: "CycleExecuted": 2,
145 # CHECK-NEXT: "CycleIssued": 1,
146 # CHECK-NEXT: "CycleReady": 0,
147 # CHECK-NEXT: "CycleRetired": 3
150 # CHECK-NEXT: "CycleDispatched": 0,
151 # CHECK-NEXT: "CycleExecuted": 2,
152 # CHECK-NEXT: "CycleIssued": 1,
153 # CHECK-NEXT: "CycleReady": 0,
154 # CHECK-NEXT: "CycleRetired": 3
157 # CHECK-NEXT: "CycleDispatched": 0,
158 # CHECK-NEXT: "CycleExecuted": 2,
159 # CHECK-NEXT: "CycleIssued": 1,
160 # CHECK-NEXT: "CycleReady": 0,
161 # CHECK-NEXT: "CycleRetired": 3
167 # CHECK-NEXT: "DispatchStatistics": {
168 # CHECK-NEXT: "GROUP": 0,
169 # CHECK-NEXT: "LQ": 0,
170 # CHECK-NEXT: "RAT": 0,
171 # CHECK-NEXT: "RCU": 0,
172 # CHECK-NEXT: "SCHEDQ": 41,
173 # CHECK-NEXT: "SQ": 0,
174 # CHECK-NEXT: "USH": 0
176 # CHECK-NEXT: "InstructionInfoView": {
177 # CHECK-NEXT: "InstructionList": [
179 # CHECK-NEXT: "Instruction": 0,
180 # CHECK-NEXT: "Latency": 1,
181 # CHECK-NEXT: "NumMicroOpcodes": 1,
182 # CHECK-NEXT: "RThroughput": 0.25,
183 # CHECK-NEXT: "hasUnmodeledSideEffects": false,
184 # CHECK-NEXT: "mayLoad": false,
185 # CHECK-NEXT: "mayStore": false
188 # CHECK-NEXT: "Instruction": 1,
189 # CHECK-NEXT: "Latency": 1,
190 # CHECK-NEXT: "NumMicroOpcodes": 1,
191 # CHECK-NEXT: "RThroughput": 0.25,
192 # CHECK-NEXT: "hasUnmodeledSideEffects": false,
193 # CHECK-NEXT: "mayLoad": false,
194 # CHECK-NEXT: "mayStore": false
198 # CHECK-NEXT: "Instructions": [
199 # CHECK-NEXT: "addl\t%ebx, %ebx",
200 # CHECK-NEXT: "addl\t%ecx, %ecx"
202 # CHECK-NEXT: "Name": "bar",
203 # CHECK-NEXT: "ResourcePressureView": {
204 # CHECK-NEXT: "ResourcePressureInfo": [
206 # CHECK-NEXT: "InstructionIndex": 0,
207 # CHECK-NEXT: "ResourceIndex": 3,
208 # CHECK-NEXT: "ResourceUsage": 0.5
211 # CHECK-NEXT: "InstructionIndex": 0,
212 # CHECK-NEXT: "ResourceIndex": 8,
213 # CHECK-NEXT: "ResourceUsage": 0.5
216 # CHECK-NEXT: "InstructionIndex": 1,
217 # CHECK-NEXT: "ResourceIndex": 2,
218 # CHECK-NEXT: "ResourceUsage": 0.5
221 # CHECK-NEXT: "InstructionIndex": 1,
222 # CHECK-NEXT: "ResourceIndex": 7,
223 # CHECK-NEXT: "ResourceUsage": 0.5
226 # CHECK-NEXT: "InstructionIndex": 2,
227 # CHECK-NEXT: "ResourceIndex": 2,
228 # CHECK-NEXT: "ResourceUsage": 0.5
231 # CHECK-NEXT: "InstructionIndex": 2,
232 # CHECK-NEXT: "ResourceIndex": 3,
233 # CHECK-NEXT: "ResourceUsage": 0.5
236 # CHECK-NEXT: "InstructionIndex": 2,
237 # CHECK-NEXT: "ResourceIndex": 7,
238 # CHECK-NEXT: "ResourceUsage": 0.5
241 # CHECK-NEXT: "InstructionIndex": 2,
242 # CHECK-NEXT: "ResourceIndex": 8,
243 # CHECK-NEXT: "ResourceUsage": 0.5
247 # CHECK-NEXT: "SummaryView": {
248 # CHECK-NEXT: "BlockRThroughput": 0.5,
249 # CHECK-NEXT: "DispatchWidth": 4,
250 # CHECK-NEXT: "IPC": 1.941747572815534,
251 # CHECK-NEXT: "Instructions": 200,
252 # CHECK-NEXT: "Iterations": 100,
253 # CHECK-NEXT: "TotalCycles": 103,
254 # CHECK-NEXT: "TotaluOps": 200,
255 # CHECK-NEXT: "uOpsPerCycle": 1.941747572815534
257 # CHECK-NEXT: "TimelineView": {
258 # CHECK-NEXT: "TimelineInfo": [
260 # CHECK-NEXT: "CycleDispatched": 0,
261 # CHECK-NEXT: "CycleExecuted": 2,
262 # CHECK-NEXT: "CycleIssued": 1,
263 # CHECK-NEXT: "CycleReady": 0,
264 # CHECK-NEXT: "CycleRetired": 3
267 # CHECK-NEXT: "CycleDispatched": 0,
268 # CHECK-NEXT: "CycleExecuted": 2,
269 # CHECK-NEXT: "CycleIssued": 1,
270 # CHECK-NEXT: "CycleReady": 0,
271 # CHECK-NEXT: "CycleRetired": 3
277 # CHECK-NEXT: "SimulationParameters": {
278 # CHECK-NEXT: "-march": "x86_64",
279 # CHECK-NEXT: "-mcpu": "haswell",
280 # CHECK-NEXT: "-mtriple": "x86_64-unknown-unknown"
282 # CHECK-NEXT: "TargetInfo": {
283 # CHECK-NEXT: "CPUName": "haswell",
284 # CHECK-NEXT: "Resources": [
285 # CHECK-NEXT: "HWDivider",
286 # CHECK-NEXT: "HWFPDivider",
287 # CHECK-NEXT: "HWPort0",
288 # CHECK-NEXT: "HWPort1",
289 # CHECK-NEXT: "HWPort2",
290 # CHECK-NEXT: "HWPort3",
291 # CHECK-NEXT: "HWPort4",
292 # CHECK-NEXT: "HWPort5",
293 # CHECK-NEXT: "HWPort6",
294 # CHECK-NEXT: "HWPort7"