1 # NOTE: Assertions have been autogenerated by utils/update_mca_test_checks.py
2 # RUN: llvm-mca -mtriple=x86_64-unknown-unknown -mcpu=haswell --json -instruction-tables < %s | FileCheck %s
3 # RUN: llvm-mca -mtriple=x86_64-unknown-unknown -mcpu=haswell --json -instruction-tables -o %t.json < %s
5 # RUN: | %python -c 'import json, sys; json.dump(json.loads(sys.stdin.read()), sys.stdout, sort_keys=True, indent=2)' \
18 # CHECK-NEXT: "CodeRegions": [
20 # CHECK-NEXT: "InstructionInfoView": {
21 # CHECK-NEXT: "InstructionList": [
23 # CHECK-NEXT: "Instruction": 0,
24 # CHECK-NEXT: "Latency": 1,
25 # CHECK-NEXT: "NumMicroOpcodes": 1,
26 # CHECK-NEXT: "RThroughput": 0.25,
27 # CHECK-NEXT: "hasUnmodeledSideEffects": false,
28 # CHECK-NEXT: "mayLoad": false,
29 # CHECK-NEXT: "mayStore": false
32 # CHECK-NEXT: "Instruction": 1,
33 # CHECK-NEXT: "Latency": 1,
34 # CHECK-NEXT: "NumMicroOpcodes": 1,
35 # CHECK-NEXT: "RThroughput": 0.25,
36 # CHECK-NEXT: "hasUnmodeledSideEffects": false,
37 # CHECK-NEXT: "mayLoad": false,
38 # CHECK-NEXT: "mayStore": false
41 # CHECK-NEXT: "Instruction": 2,
42 # CHECK-NEXT: "Latency": 1,
43 # CHECK-NEXT: "NumMicroOpcodes": 1,
44 # CHECK-NEXT: "RThroughput": 0.25,
45 # CHECK-NEXT: "hasUnmodeledSideEffects": false,
46 # CHECK-NEXT: "mayLoad": false,
47 # CHECK-NEXT: "mayStore": false
50 # CHECK-NEXT: "Instruction": 3,
51 # CHECK-NEXT: "Latency": 1,
52 # CHECK-NEXT: "NumMicroOpcodes": 1,
53 # CHECK-NEXT: "RThroughput": 0.25,
54 # CHECK-NEXT: "hasUnmodeledSideEffects": false,
55 # CHECK-NEXT: "mayLoad": false,
56 # CHECK-NEXT: "mayStore": false
60 # CHECK-NEXT: "Instructions": [
61 # CHECK-NEXT: "addl\t%eax, %eax",
62 # CHECK-NEXT: "addl\t%ebx, %ebx",
63 # CHECK-NEXT: "addl\t%ecx, %ecx",
64 # CHECK-NEXT: "addl\t%edx, %edx"
66 # CHECK-NEXT: "Name": "foo",
67 # CHECK-NEXT: "ResourcePressureView": {
68 # CHECK-NEXT: "ResourcePressureInfo": [
70 # CHECK-NEXT: "InstructionIndex": 0,
71 # CHECK-NEXT: "ResourceIndex": 2,
72 # CHECK-NEXT: "ResourceUsage": 0.25
75 # CHECK-NEXT: "InstructionIndex": 0,
76 # CHECK-NEXT: "ResourceIndex": 3,
77 # CHECK-NEXT: "ResourceUsage": 0.25
80 # CHECK-NEXT: "InstructionIndex": 0,
81 # CHECK-NEXT: "ResourceIndex": 7,
82 # CHECK-NEXT: "ResourceUsage": 0.25
85 # CHECK-NEXT: "InstructionIndex": 0,
86 # CHECK-NEXT: "ResourceIndex": 8,
87 # CHECK-NEXT: "ResourceUsage": 0.25
90 # CHECK-NEXT: "InstructionIndex": 1,
91 # CHECK-NEXT: "ResourceIndex": 2,
92 # CHECK-NEXT: "ResourceUsage": 0.25
95 # CHECK-NEXT: "InstructionIndex": 1,
96 # CHECK-NEXT: "ResourceIndex": 3,
97 # CHECK-NEXT: "ResourceUsage": 0.25
100 # CHECK-NEXT: "InstructionIndex": 1,
101 # CHECK-NEXT: "ResourceIndex": 7,
102 # CHECK-NEXT: "ResourceUsage": 0.25
105 # CHECK-NEXT: "InstructionIndex": 1,
106 # CHECK-NEXT: "ResourceIndex": 8,
107 # CHECK-NEXT: "ResourceUsage": 0.25
110 # CHECK-NEXT: "InstructionIndex": 2,
111 # CHECK-NEXT: "ResourceIndex": 2,
112 # CHECK-NEXT: "ResourceUsage": 0.25
115 # CHECK-NEXT: "InstructionIndex": 2,
116 # CHECK-NEXT: "ResourceIndex": 3,
117 # CHECK-NEXT: "ResourceUsage": 0.25
120 # CHECK-NEXT: "InstructionIndex": 2,
121 # CHECK-NEXT: "ResourceIndex": 7,
122 # CHECK-NEXT: "ResourceUsage": 0.25
125 # CHECK-NEXT: "InstructionIndex": 2,
126 # CHECK-NEXT: "ResourceIndex": 8,
127 # CHECK-NEXT: "ResourceUsage": 0.25
130 # CHECK-NEXT: "InstructionIndex": 3,
131 # CHECK-NEXT: "ResourceIndex": 2,
132 # CHECK-NEXT: "ResourceUsage": 0.25
135 # CHECK-NEXT: "InstructionIndex": 3,
136 # CHECK-NEXT: "ResourceIndex": 3,
137 # CHECK-NEXT: "ResourceUsage": 0.25
140 # CHECK-NEXT: "InstructionIndex": 3,
141 # CHECK-NEXT: "ResourceIndex": 7,
142 # CHECK-NEXT: "ResourceUsage": 0.25
145 # CHECK-NEXT: "InstructionIndex": 3,
146 # CHECK-NEXT: "ResourceIndex": 8,
147 # CHECK-NEXT: "ResourceUsage": 0.25
150 # CHECK-NEXT: "InstructionIndex": 4,
151 # CHECK-NEXT: "ResourceIndex": 2,
152 # CHECK-NEXT: "ResourceUsage": 1
155 # CHECK-NEXT: "InstructionIndex": 4,
156 # CHECK-NEXT: "ResourceIndex": 3,
157 # CHECK-NEXT: "ResourceUsage": 1
160 # CHECK-NEXT: "InstructionIndex": 4,
161 # CHECK-NEXT: "ResourceIndex": 7,
162 # CHECK-NEXT: "ResourceUsage": 1
165 # CHECK-NEXT: "InstructionIndex": 4,
166 # CHECK-NEXT: "ResourceIndex": 8,
167 # CHECK-NEXT: "ResourceUsage": 1
173 # CHECK-NEXT: "InstructionInfoView": {
174 # CHECK-NEXT: "InstructionList": [
176 # CHECK-NEXT: "Instruction": 0,
177 # CHECK-NEXT: "Latency": 1,
178 # CHECK-NEXT: "NumMicroOpcodes": 1,
179 # CHECK-NEXT: "RThroughput": 0.25,
180 # CHECK-NEXT: "hasUnmodeledSideEffects": false,
181 # CHECK-NEXT: "mayLoad": false,
182 # CHECK-NEXT: "mayStore": false
185 # CHECK-NEXT: "Instruction": 1,
186 # CHECK-NEXT: "Latency": 1,
187 # CHECK-NEXT: "NumMicroOpcodes": 1,
188 # CHECK-NEXT: "RThroughput": 0.25,
189 # CHECK-NEXT: "hasUnmodeledSideEffects": false,
190 # CHECK-NEXT: "mayLoad": false,
191 # CHECK-NEXT: "mayStore": false
195 # CHECK-NEXT: "Instructions": [
196 # CHECK-NEXT: "addl\t%ebx, %ebx",
197 # CHECK-NEXT: "addl\t%ecx, %ecx"
199 # CHECK-NEXT: "Name": "bar",
200 # CHECK-NEXT: "ResourcePressureView": {
201 # CHECK-NEXT: "ResourcePressureInfo": [
203 # CHECK-NEXT: "InstructionIndex": 0,
204 # CHECK-NEXT: "ResourceIndex": 2,
205 # CHECK-NEXT: "ResourceUsage": 0.25
208 # CHECK-NEXT: "InstructionIndex": 0,
209 # CHECK-NEXT: "ResourceIndex": 3,
210 # CHECK-NEXT: "ResourceUsage": 0.25
213 # CHECK-NEXT: "InstructionIndex": 0,
214 # CHECK-NEXT: "ResourceIndex": 7,
215 # CHECK-NEXT: "ResourceUsage": 0.25
218 # CHECK-NEXT: "InstructionIndex": 0,
219 # CHECK-NEXT: "ResourceIndex": 8,
220 # CHECK-NEXT: "ResourceUsage": 0.25
223 # CHECK-NEXT: "InstructionIndex": 1,
224 # CHECK-NEXT: "ResourceIndex": 2,
225 # CHECK-NEXT: "ResourceUsage": 0.25
228 # CHECK-NEXT: "InstructionIndex": 1,
229 # CHECK-NEXT: "ResourceIndex": 3,
230 # CHECK-NEXT: "ResourceUsage": 0.25
233 # CHECK-NEXT: "InstructionIndex": 1,
234 # CHECK-NEXT: "ResourceIndex": 7,
235 # CHECK-NEXT: "ResourceUsage": 0.25
238 # CHECK-NEXT: "InstructionIndex": 1,
239 # CHECK-NEXT: "ResourceIndex": 8,
240 # CHECK-NEXT: "ResourceUsage": 0.25
243 # CHECK-NEXT: "InstructionIndex": 2,
244 # CHECK-NEXT: "ResourceIndex": 2,
245 # CHECK-NEXT: "ResourceUsage": 0.5
248 # CHECK-NEXT: "InstructionIndex": 2,
249 # CHECK-NEXT: "ResourceIndex": 3,
250 # CHECK-NEXT: "ResourceUsage": 0.5
253 # CHECK-NEXT: "InstructionIndex": 2,
254 # CHECK-NEXT: "ResourceIndex": 7,
255 # CHECK-NEXT: "ResourceUsage": 0.5
258 # CHECK-NEXT: "InstructionIndex": 2,
259 # CHECK-NEXT: "ResourceIndex": 8,
260 # CHECK-NEXT: "ResourceUsage": 0.5
266 # CHECK-NEXT: "SimulationParameters": {
267 # CHECK-NEXT: "-march": "x86_64",
268 # CHECK-NEXT: "-mcpu": "haswell",
269 # CHECK-NEXT: "-mtriple": "x86_64-unknown-unknown"
271 # CHECK-NEXT: "TargetInfo": {
272 # CHECK-NEXT: "CPUName": "haswell",
273 # CHECK-NEXT: "Resources": [
274 # CHECK-NEXT: "HWDivider",
275 # CHECK-NEXT: "HWFPDivider",
276 # CHECK-NEXT: "HWPort0",
277 # CHECK-NEXT: "HWPort1",
278 # CHECK-NEXT: "HWPort2",
279 # CHECK-NEXT: "HWPort3",
280 # CHECK-NEXT: "HWPort4",
281 # CHECK-NEXT: "HWPort5",
282 # CHECK-NEXT: "HWPort6",
283 # CHECK-NEXT: "HWPort7"