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)' \
20 # CHECK-NEXT: "CodeRegions": [
22 # CHECK-NEXT: "InstructionInfoView": {
23 # CHECK-NEXT: "InstructionList": [
25 # CHECK-NEXT: "Instruction": 0,
26 # CHECK-NEXT: "Latency": 1,
27 # CHECK-NEXT: "NumMicroOpcodes": 1,
28 # CHECK-NEXT: "RThroughput": 0.25,
29 # CHECK-NEXT: "hasUnmodeledSideEffects": false,
30 # CHECK-NEXT: "mayLoad": false,
31 # CHECK-NEXT: "mayStore": false
35 # CHECK-NEXT: "Instructions": [
36 # CHECK-NEXT: "addl\t%eax, %eax"
38 # CHECK-NEXT: "Name": "",
39 # CHECK-NEXT: "ResourcePressureView": {
40 # CHECK-NEXT: "ResourcePressureInfo": [
42 # CHECK-NEXT: "InstructionIndex": 0,
43 # CHECK-NEXT: "ResourceIndex": 2,
44 # CHECK-NEXT: "ResourceUsage": 0.25
47 # CHECK-NEXT: "InstructionIndex": 0,
48 # CHECK-NEXT: "ResourceIndex": 3,
49 # CHECK-NEXT: "ResourceUsage": 0.25
52 # CHECK-NEXT: "InstructionIndex": 0,
53 # CHECK-NEXT: "ResourceIndex": 7,
54 # CHECK-NEXT: "ResourceUsage": 0.25
57 # CHECK-NEXT: "InstructionIndex": 0,
58 # CHECK-NEXT: "ResourceIndex": 8,
59 # CHECK-NEXT: "ResourceUsage": 0.25
62 # CHECK-NEXT: "InstructionIndex": 1,
63 # CHECK-NEXT: "ResourceIndex": 2,
64 # CHECK-NEXT: "ResourceUsage": 0.25
67 # CHECK-NEXT: "InstructionIndex": 1,
68 # CHECK-NEXT: "ResourceIndex": 3,
69 # CHECK-NEXT: "ResourceUsage": 0.25
72 # CHECK-NEXT: "InstructionIndex": 1,
73 # CHECK-NEXT: "ResourceIndex": 7,
74 # CHECK-NEXT: "ResourceUsage": 0.25
77 # CHECK-NEXT: "InstructionIndex": 1,
78 # CHECK-NEXT: "ResourceIndex": 8,
79 # CHECK-NEXT: "ResourceUsage": 0.25
85 # CHECK-NEXT: "InstructionInfoView": {
86 # CHECK-NEXT: "InstructionList": [
88 # CHECK-NEXT: "Instruction": 0,
89 # CHECK-NEXT: "Latency": 1,
90 # CHECK-NEXT: "NumMicroOpcodes": 1,
91 # CHECK-NEXT: "RThroughput": 0.25,
92 # CHECK-NEXT: "hasUnmodeledSideEffects": false,
93 # CHECK-NEXT: "mayLoad": false,
94 # CHECK-NEXT: "mayStore": false
97 # CHECK-NEXT: "Instruction": 1,
98 # CHECK-NEXT: "Latency": 1,
99 # CHECK-NEXT: "NumMicroOpcodes": 1,
100 # CHECK-NEXT: "RThroughput": 0.25,
101 # CHECK-NEXT: "hasUnmodeledSideEffects": false,
102 # CHECK-NEXT: "mayLoad": false,
103 # CHECK-NEXT: "mayStore": false
107 # CHECK-NEXT: "Instructions": [
108 # CHECK-NEXT: "addl\t%ebx, %ebx",
109 # CHECK-NEXT: "addl\t%ecx, %ecx"
111 # CHECK-NEXT: "Name": "",
112 # CHECK-NEXT: "ResourcePressureView": {
113 # CHECK-NEXT: "ResourcePressureInfo": [
115 # CHECK-NEXT: "InstructionIndex": 0,
116 # CHECK-NEXT: "ResourceIndex": 2,
117 # CHECK-NEXT: "ResourceUsage": 0.25
120 # CHECK-NEXT: "InstructionIndex": 0,
121 # CHECK-NEXT: "ResourceIndex": 3,
122 # CHECK-NEXT: "ResourceUsage": 0.25
125 # CHECK-NEXT: "InstructionIndex": 0,
126 # CHECK-NEXT: "ResourceIndex": 7,
127 # CHECK-NEXT: "ResourceUsage": 0.25
130 # CHECK-NEXT: "InstructionIndex": 0,
131 # CHECK-NEXT: "ResourceIndex": 8,
132 # CHECK-NEXT: "ResourceUsage": 0.25
135 # CHECK-NEXT: "InstructionIndex": 1,
136 # CHECK-NEXT: "ResourceIndex": 2,
137 # CHECK-NEXT: "ResourceUsage": 0.25
140 # CHECK-NEXT: "InstructionIndex": 1,
141 # CHECK-NEXT: "ResourceIndex": 3,
142 # CHECK-NEXT: "ResourceUsage": 0.25
145 # CHECK-NEXT: "InstructionIndex": 1,
146 # CHECK-NEXT: "ResourceIndex": 7,
147 # CHECK-NEXT: "ResourceUsage": 0.25
150 # CHECK-NEXT: "InstructionIndex": 1,
151 # CHECK-NEXT: "ResourceIndex": 8,
152 # CHECK-NEXT: "ResourceUsage": 0.25
155 # CHECK-NEXT: "InstructionIndex": 2,
156 # CHECK-NEXT: "ResourceIndex": 2,
157 # CHECK-NEXT: "ResourceUsage": 0.5
160 # CHECK-NEXT: "InstructionIndex": 2,
161 # CHECK-NEXT: "ResourceIndex": 3,
162 # CHECK-NEXT: "ResourceUsage": 0.5
165 # CHECK-NEXT: "InstructionIndex": 2,
166 # CHECK-NEXT: "ResourceIndex": 7,
167 # CHECK-NEXT: "ResourceUsage": 0.5
170 # CHECK-NEXT: "InstructionIndex": 2,
171 # CHECK-NEXT: "ResourceIndex": 8,
172 # CHECK-NEXT: "ResourceUsage": 0.5
178 # CHECK-NEXT: "InstructionInfoView": {
179 # CHECK-NEXT: "InstructionList": [
181 # CHECK-NEXT: "Instruction": 0,
182 # CHECK-NEXT: "Latency": 1,
183 # CHECK-NEXT: "NumMicroOpcodes": 1,
184 # CHECK-NEXT: "RThroughput": 0.25,
185 # CHECK-NEXT: "hasUnmodeledSideEffects": false,
186 # CHECK-NEXT: "mayLoad": false,
187 # CHECK-NEXT: "mayStore": false
191 # CHECK-NEXT: "Instructions": [
192 # CHECK-NEXT: "addl\t%edx, %edx"
194 # CHECK-NEXT: "Name": "",
195 # CHECK-NEXT: "ResourcePressureView": {
196 # CHECK-NEXT: "ResourcePressureInfo": [
198 # CHECK-NEXT: "InstructionIndex": 0,
199 # CHECK-NEXT: "ResourceIndex": 2,
200 # CHECK-NEXT: "ResourceUsage": 0.25
203 # CHECK-NEXT: "InstructionIndex": 0,
204 # CHECK-NEXT: "ResourceIndex": 3,
205 # CHECK-NEXT: "ResourceUsage": 0.25
208 # CHECK-NEXT: "InstructionIndex": 0,
209 # CHECK-NEXT: "ResourceIndex": 7,
210 # CHECK-NEXT: "ResourceUsage": 0.25
213 # CHECK-NEXT: "InstructionIndex": 0,
214 # CHECK-NEXT: "ResourceIndex": 8,
215 # CHECK-NEXT: "ResourceUsage": 0.25
218 # CHECK-NEXT: "InstructionIndex": 1,
219 # CHECK-NEXT: "ResourceIndex": 2,
220 # CHECK-NEXT: "ResourceUsage": 0.25
223 # CHECK-NEXT: "InstructionIndex": 1,
224 # CHECK-NEXT: "ResourceIndex": 3,
225 # CHECK-NEXT: "ResourceUsage": 0.25
228 # CHECK-NEXT: "InstructionIndex": 1,
229 # CHECK-NEXT: "ResourceIndex": 7,
230 # CHECK-NEXT: "ResourceUsage": 0.25
233 # CHECK-NEXT: "InstructionIndex": 1,
234 # CHECK-NEXT: "ResourceIndex": 8,
235 # CHECK-NEXT: "ResourceUsage": 0.25
241 # CHECK-NEXT: "SimulationParameters": {
242 # CHECK-NEXT: "-march": "x86_64",
243 # CHECK-NEXT: "-mcpu": "haswell",
244 # CHECK-NEXT: "-mtriple": "x86_64-unknown-unknown"
246 # CHECK-NEXT: "TargetInfo": {
247 # CHECK-NEXT: "CPUName": "haswell",
248 # CHECK-NEXT: "Resources": [
249 # CHECK-NEXT: "HWDivider",
250 # CHECK-NEXT: "HWFPDivider",
251 # CHECK-NEXT: "HWPort0",
252 # CHECK-NEXT: "HWPort1",
253 # CHECK-NEXT: "HWPort2",
254 # CHECK-NEXT: "HWPort3",
255 # CHECK-NEXT: "HWPort4",
256 # CHECK-NEXT: "HWPort5",
257 # CHECK-NEXT: "HWPort6",
258 # CHECK-NEXT: "HWPort7"