[ORC] Add std::tuple support to SimplePackedSerialization.
[llvm-project.git] / llvm / test / tools / llvm-mca / JSON / X86 / views-multiple-region.s
blob0b7bb16beeb9169c31f7441d3b23614e38ebee71
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
7 # RUN: cat %t.json \
8 # RUN: | %python -c 'import json, sys; json.dump(json.loads(sys.stdin.read()), sys.stdout, sort_keys=True, indent=2)' \
9 # RUN: | FileCheck %s
11 # LLVM-MCA-BEGIN foo
12 add %eax, %eax
13 # LLVM-MCA-BEGIN bar
14 add %ebx, %ebx
15 add %ecx, %ecx
16 # LLVM-MCA-END bar
17 add %edx, %edx
18 # LLVM-MCA-END foo
20 # CHECK: {
21 # CHECK-NEXT: "CodeRegions": [
22 # CHECK-NEXT: {
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
31 # CHECK-NEXT: },
32 # CHECK-NEXT: "InstructionInfoView": {
33 # CHECK-NEXT: "InstructionList": [
34 # CHECK-NEXT: {
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
42 # CHECK-NEXT: },
43 # CHECK-NEXT: {
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
51 # CHECK-NEXT: },
52 # CHECK-NEXT: {
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
60 # CHECK-NEXT: },
61 # CHECK-NEXT: {
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
69 # CHECK-NEXT: }
70 # CHECK-NEXT: ]
71 # CHECK-NEXT: },
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"
77 # CHECK-NEXT: ],
78 # CHECK-NEXT: "Name": "foo",
79 # CHECK-NEXT: "ResourcePressureView": {
80 # CHECK-NEXT: "ResourcePressureInfo": [
81 # CHECK-NEXT: {
82 # CHECK-NEXT: "InstructionIndex": 0,
83 # CHECK-NEXT: "ResourceIndex": 8,
84 # CHECK-NEXT: "ResourceUsage": 1
85 # CHECK-NEXT: },
86 # CHECK-NEXT: {
87 # CHECK-NEXT: "InstructionIndex": 1,
88 # CHECK-NEXT: "ResourceIndex": 7,
89 # CHECK-NEXT: "ResourceUsage": 1
90 # CHECK-NEXT: },
91 # CHECK-NEXT: {
92 # CHECK-NEXT: "InstructionIndex": 2,
93 # CHECK-NEXT: "ResourceIndex": 3,
94 # CHECK-NEXT: "ResourceUsage": 1
95 # CHECK-NEXT: },
96 # CHECK-NEXT: {
97 # CHECK-NEXT: "InstructionIndex": 3,
98 # CHECK-NEXT: "ResourceIndex": 2,
99 # CHECK-NEXT: "ResourceUsage": 1
100 # CHECK-NEXT: },
101 # CHECK-NEXT: {
102 # CHECK-NEXT: "InstructionIndex": 4,
103 # CHECK-NEXT: "ResourceIndex": 2,
104 # CHECK-NEXT: "ResourceUsage": 1
105 # CHECK-NEXT: },
106 # CHECK-NEXT: {
107 # CHECK-NEXT: "InstructionIndex": 4,
108 # CHECK-NEXT: "ResourceIndex": 3,
109 # CHECK-NEXT: "ResourceUsage": 1
110 # CHECK-NEXT: },
111 # CHECK-NEXT: {
112 # CHECK-NEXT: "InstructionIndex": 4,
113 # CHECK-NEXT: "ResourceIndex": 7,
114 # CHECK-NEXT: "ResourceUsage": 1
115 # CHECK-NEXT: },
116 # CHECK-NEXT: {
117 # CHECK-NEXT: "InstructionIndex": 4,
118 # CHECK-NEXT: "ResourceIndex": 8,
119 # CHECK-NEXT: "ResourceUsage": 1
120 # CHECK-NEXT: }
121 # CHECK-NEXT: ]
122 # CHECK-NEXT: },
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
132 # CHECK-NEXT: },
133 # CHECK-NEXT: "TimelineView": {
134 # CHECK-NEXT: "TimelineInfo": [
135 # CHECK-NEXT: {
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
141 # CHECK-NEXT: },
142 # CHECK-NEXT: {
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
148 # CHECK-NEXT: },
149 # CHECK-NEXT: {
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
155 # CHECK-NEXT: },
156 # CHECK-NEXT: {
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
162 # CHECK-NEXT: }
163 # CHECK-NEXT: ]
164 # CHECK-NEXT: }
165 # CHECK-NEXT: },
166 # CHECK-NEXT: {
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
175 # CHECK-NEXT: },
176 # CHECK-NEXT: "InstructionInfoView": {
177 # CHECK-NEXT: "InstructionList": [
178 # CHECK-NEXT: {
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
186 # CHECK-NEXT: },
187 # CHECK-NEXT: {
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
195 # CHECK-NEXT: }
196 # CHECK-NEXT: ]
197 # CHECK-NEXT: },
198 # CHECK-NEXT: "Instructions": [
199 # CHECK-NEXT: "addl\t%ebx, %ebx",
200 # CHECK-NEXT: "addl\t%ecx, %ecx"
201 # CHECK-NEXT: ],
202 # CHECK-NEXT: "Name": "bar",
203 # CHECK-NEXT: "ResourcePressureView": {
204 # CHECK-NEXT: "ResourcePressureInfo": [
205 # CHECK-NEXT: {
206 # CHECK-NEXT: "InstructionIndex": 0,
207 # CHECK-NEXT: "ResourceIndex": 3,
208 # CHECK-NEXT: "ResourceUsage": 0.5
209 # CHECK-NEXT: },
210 # CHECK-NEXT: {
211 # CHECK-NEXT: "InstructionIndex": 0,
212 # CHECK-NEXT: "ResourceIndex": 8,
213 # CHECK-NEXT: "ResourceUsage": 0.5
214 # CHECK-NEXT: },
215 # CHECK-NEXT: {
216 # CHECK-NEXT: "InstructionIndex": 1,
217 # CHECK-NEXT: "ResourceIndex": 2,
218 # CHECK-NEXT: "ResourceUsage": 0.5
219 # CHECK-NEXT: },
220 # CHECK-NEXT: {
221 # CHECK-NEXT: "InstructionIndex": 1,
222 # CHECK-NEXT: "ResourceIndex": 7,
223 # CHECK-NEXT: "ResourceUsage": 0.5
224 # CHECK-NEXT: },
225 # CHECK-NEXT: {
226 # CHECK-NEXT: "InstructionIndex": 2,
227 # CHECK-NEXT: "ResourceIndex": 2,
228 # CHECK-NEXT: "ResourceUsage": 0.5
229 # CHECK-NEXT: },
230 # CHECK-NEXT: {
231 # CHECK-NEXT: "InstructionIndex": 2,
232 # CHECK-NEXT: "ResourceIndex": 3,
233 # CHECK-NEXT: "ResourceUsage": 0.5
234 # CHECK-NEXT: },
235 # CHECK-NEXT: {
236 # CHECK-NEXT: "InstructionIndex": 2,
237 # CHECK-NEXT: "ResourceIndex": 7,
238 # CHECK-NEXT: "ResourceUsage": 0.5
239 # CHECK-NEXT: },
240 # CHECK-NEXT: {
241 # CHECK-NEXT: "InstructionIndex": 2,
242 # CHECK-NEXT: "ResourceIndex": 8,
243 # CHECK-NEXT: "ResourceUsage": 0.5
244 # CHECK-NEXT: }
245 # CHECK-NEXT: ]
246 # CHECK-NEXT: },
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
256 # CHECK-NEXT: },
257 # CHECK-NEXT: "TimelineView": {
258 # CHECK-NEXT: "TimelineInfo": [
259 # CHECK-NEXT: {
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
265 # CHECK-NEXT: },
266 # CHECK-NEXT: {
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
272 # CHECK-NEXT: }
273 # CHECK-NEXT: ]
274 # CHECK-NEXT: }
275 # CHECK-NEXT: }
276 # CHECK-NEXT: ],
277 # CHECK-NEXT: "SimulationParameters": {
278 # CHECK-NEXT: "-march": "x86_64",
279 # CHECK-NEXT: "-mcpu": "haswell",
280 # CHECK-NEXT: "-mtriple": "x86_64-unknown-unknown"
281 # CHECK-NEXT: },
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"
295 # CHECK-NEXT: ]
296 # CHECK-NEXT: }
297 # CHECK-NEXT: }