summaryrefslogtreecommitdiffstats
path: root/usr.bin/clang/llvm-bcanalyzer/llvm-bcanalyzer.1
blob: f8f27b8caf59d90fbe3de10ce527dc0b8d5145bc (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
.\" $FreeBSD$
.\" Man page generated from reStructuredText.
.
.TH "LLVM-BCANALYZER" "1" "2017-12-24" "6" "LLVM"
.SH NAME
llvm-bcanalyzer \- LLVM bitcode analyzer
.
.nr rst2man-indent-level 0
.
.de1 rstReportMargin
\\$1 \\n[an-margin]
level \\n[rst2man-indent-level]
level margin: \\n[rst2man-indent\\n[rst2man-indent-level]]
-
\\n[rst2man-indent0]
\\n[rst2man-indent1]
\\n[rst2man-indent2]
..
.de1 INDENT
.\" .rstReportMargin pre:
. RS \\$1
. nr rst2man-indent\\n[rst2man-indent-level] \\n[an-margin]
. nr rst2man-indent-level +1
.\" .rstReportMargin post:
..
.de UNINDENT
. RE
.\" indent \\n[an-margin]
.\" old: \\n[rst2man-indent\\n[rst2man-indent-level]]
.nr rst2man-indent-level -1
.\" new: \\n[rst2man-indent\\n[rst2man-indent-level]]
.in \\n[rst2man-indent\\n[rst2man-indent-level]]u
..
.SH SYNOPSIS
.sp
\fBllvm\-bcanalyzer\fP [\fIoptions\fP] [\fIfilename\fP]
.SH DESCRIPTION
.sp
The \fBllvm\-bcanalyzer\fP command is a small utility for analyzing bitcode
files.  The tool reads a bitcode file (such as generated with the
\fBllvm\-as\fP tool) and produces a statistical report on the contents of
the bitcode file.  The tool can also dump a low level but human readable
version of the bitcode file.  This tool is probably not of much interest or
utility except for those working directly with the bitcode file format.  Most
LLVM users can just ignore this tool.
.sp
If \fIfilename\fP is omitted or is \fB\-\fP, then \fBllvm\-bcanalyzer\fP reads its
input from standard input.  This is useful for combining the tool into a
pipeline.  Output is written to the standard output.
.SH OPTIONS
.INDENT 0.0
.TP
.B \-nodetails
Causes \fBllvm\-bcanalyzer\fP to abbreviate its output by writing out only
a module level summary.  The details for individual functions are not
displayed.
.UNINDENT
.INDENT 0.0
.TP
.B \-dump
Causes \fBllvm\-bcanalyzer\fP to dump the bitcode in a human readable
format.  This format is significantly different from LLVM assembly and
provides details about the encoding of the bitcode file.
.UNINDENT
.INDENT 0.0
.TP
.B \-verify
Causes \fBllvm\-bcanalyzer\fP to verify the module produced by reading the
bitcode.  This ensures that the statistics generated are based on a consistent
module.
.UNINDENT
.INDENT 0.0
.TP
.B \-help
Print a summary of command line options.
.UNINDENT
.SH EXIT STATUS
.sp
If \fBllvm\-bcanalyzer\fP succeeds, it will exit with 0.  Otherwise, if an
error occurs, it will exit with a non\-zero value, usually 1.
.SH SUMMARY OUTPUT DEFINITIONS
.sp
The following items are always printed by llvm\-bcanalyzer.  They comprize the
summary output.
.sp
\fBBitcode Analysis Of Module\fP
.INDENT 0.0
.INDENT 3.5
This just provides the name of the module for which bitcode analysis is being
generated.
.UNINDENT
.UNINDENT
.sp
\fBBitcode Version Number\fP
.INDENT 0.0
.INDENT 3.5
The bitcode version (not LLVM version) of the file read by the analyzer.
.UNINDENT
.UNINDENT
.sp
\fBFile Size\fP
.INDENT 0.0
.INDENT 3.5
The size, in bytes, of the entire bitcode file.
.UNINDENT
.UNINDENT
.sp
\fBModule Bytes\fP
.INDENT 0.0
.INDENT 3.5
The size, in bytes, of the module block.  Percentage is relative to File Size.
.UNINDENT
.UNINDENT
.sp
\fBFunction Bytes\fP
.INDENT 0.0
.INDENT 3.5
The size, in bytes, of all the function blocks.  Percentage is relative to File
Size.
.UNINDENT
.UNINDENT
.sp
\fBGlobal Types Bytes\fP
.INDENT 0.0
.INDENT 3.5
The size, in bytes, of the Global Types Pool.  Percentage is relative to File
Size.  This is the size of the definitions of all types in the bitcode file.
.UNINDENT
.UNINDENT
.sp
\fBConstant Pool Bytes\fP
.INDENT 0.0
.INDENT 3.5
The size, in bytes, of the Constant Pool Blocks Percentage is relative to File
Size.
.UNINDENT
.UNINDENT
.sp
\fBModule Globals Bytes\fP
.INDENT 0.0
.INDENT 3.5
Ths size, in bytes, of the Global Variable Definitions and their initializers.
Percentage is relative to File Size.
.UNINDENT
.UNINDENT
.sp
\fBInstruction List Bytes\fP
.INDENT 0.0
.INDENT 3.5
The size, in bytes, of all the instruction lists in all the functions.
Percentage is relative to File Size.  Note that this value is also included in
the Function Bytes.
.UNINDENT
.UNINDENT
.sp
\fBCompaction Table Bytes\fP
.INDENT 0.0
.INDENT 3.5
The size, in bytes, of all the compaction tables in all the functions.
Percentage is relative to File Size.  Note that this value is also included in
the Function Bytes.
.UNINDENT
.UNINDENT
.sp
\fBSymbol Table Bytes\fP
.INDENT 0.0
.INDENT 3.5
The size, in bytes, of all the symbol tables in all the functions.  Percentage is
relative to File Size.  Note that this value is also included in the Function
Bytes.
.UNINDENT
.UNINDENT
.sp
\fBDependent Libraries Bytes\fP
.INDENT 0.0
.INDENT 3.5
The size, in bytes, of the list of dependent libraries in the module.  Percentage
is relative to File Size.  Note that this value is also included in the Module
Global Bytes.
.UNINDENT
.UNINDENT
.sp
\fBNumber Of Bitcode Blocks\fP
.INDENT 0.0
.INDENT 3.5
The total number of blocks of any kind in the bitcode file.
.UNINDENT
.UNINDENT
.sp
\fBNumber Of Functions\fP
.INDENT 0.0
.INDENT 3.5
The total number of function definitions in the bitcode file.
.UNINDENT
.UNINDENT
.sp
\fBNumber Of Types\fP
.INDENT 0.0
.INDENT 3.5
The total number of types defined in the Global Types Pool.
.UNINDENT
.UNINDENT
.sp
\fBNumber Of Constants\fP
.INDENT 0.0
.INDENT 3.5
The total number of constants (of any type) defined in the Constant Pool.
.UNINDENT
.UNINDENT
.sp
\fBNumber Of Basic Blocks\fP
.INDENT 0.0
.INDENT 3.5
The total number of basic blocks defined in all functions in the bitcode file.
.UNINDENT
.UNINDENT
.sp
\fBNumber Of Instructions\fP
.INDENT 0.0
.INDENT 3.5
The total number of instructions defined in all functions in the bitcode file.
.UNINDENT
.UNINDENT
.sp
\fBNumber Of Long Instructions\fP
.INDENT 0.0
.INDENT 3.5
The total number of long instructions defined in all functions in the bitcode
file.  Long instructions are those taking greater than 4 bytes.  Typically long
instructions are GetElementPtr with several indices, PHI nodes, and calls to
functions with large numbers of arguments.
.UNINDENT
.UNINDENT
.sp
\fBNumber Of Operands\fP
.INDENT 0.0
.INDENT 3.5
The total number of operands used in all instructions in the bitcode file.
.UNINDENT
.UNINDENT
.sp
\fBNumber Of Compaction Tables\fP
.INDENT 0.0
.INDENT 3.5
The total number of compaction tables in all functions in the bitcode file.
.UNINDENT
.UNINDENT
.sp
\fBNumber Of Symbol Tables\fP
.INDENT 0.0
.INDENT 3.5
The total number of symbol tables in all functions in the bitcode file.
.UNINDENT
.UNINDENT
.sp
\fBNumber Of Dependent Libs\fP
.INDENT 0.0
.INDENT 3.5
The total number of dependent libraries found in the bitcode file.
.UNINDENT
.UNINDENT
.sp
\fBTotal Instruction Size\fP
.INDENT 0.0
.INDENT 3.5
The total size of the instructions in all functions in the bitcode file.
.UNINDENT
.UNINDENT
.sp
\fBAverage Instruction Size\fP
.INDENT 0.0
.INDENT 3.5
The average number of bytes per instruction across all functions in the bitcode
file.  This value is computed by dividing Total Instruction Size by Number Of
Instructions.
.UNINDENT
.UNINDENT
.sp
\fBMaximum Type Slot Number\fP
.INDENT 0.0
.INDENT 3.5
The maximum value used for a type\(aqs slot number.  Larger slot number values take
more bytes to encode.
.UNINDENT
.UNINDENT
.sp
\fBMaximum Value Slot Number\fP
.INDENT 0.0
.INDENT 3.5
The maximum value used for a value\(aqs slot number.  Larger slot number values take
more bytes to encode.
.UNINDENT
.UNINDENT
.sp
\fBBytes Per Value\fP
.INDENT 0.0
.INDENT 3.5
The average size of a Value definition (of any type).  This is computed by
dividing File Size by the total number of values of any type.
.UNINDENT
.UNINDENT
.sp
\fBBytes Per Global\fP
.INDENT 0.0
.INDENT 3.5
The average size of a global definition (constants and global variables).
.UNINDENT
.UNINDENT
.sp
\fBBytes Per Function\fP
.INDENT 0.0
.INDENT 3.5
The average number of bytes per function definition.  This is computed by
dividing Function Bytes by Number Of Functions.
.UNINDENT
.UNINDENT
.sp
\fB# of VBR 32\-bit Integers\fP
.INDENT 0.0
.INDENT 3.5
The total number of 32\-bit integers encoded using the Variable Bit Rate
encoding scheme.
.UNINDENT
.UNINDENT
.sp
\fB# of VBR 64\-bit Integers\fP
.INDENT 0.0
.INDENT 3.5
The total number of 64\-bit integers encoded using the Variable Bit Rate encoding
scheme.
.UNINDENT
.UNINDENT
.sp
\fB# of VBR Compressed Bytes\fP
.INDENT 0.0
.INDENT 3.5
The total number of bytes consumed by the 32\-bit and 64\-bit integers that use
the Variable Bit Rate encoding scheme.
.UNINDENT
.UNINDENT
.sp
\fB# of VBR Expanded Bytes\fP
.INDENT 0.0
.INDENT 3.5
The total number of bytes that would have been consumed by the 32\-bit and 64\-bit
integers had they not been compressed with the Variable Bit Rage encoding
scheme.
.UNINDENT
.UNINDENT
.sp
\fBBytes Saved With VBR\fP
.INDENT 0.0
.INDENT 3.5
The total number of bytes saved by using the Variable Bit Rate encoding scheme.
The percentage is relative to # of VBR Expanded Bytes.
.UNINDENT
.UNINDENT
.SH DETAILED OUTPUT DEFINITIONS
.sp
The following definitions occur only if the \-nodetails option was not given.
The detailed output provides additional information on a per\-function basis.
.sp
\fBType\fP
.INDENT 0.0
.INDENT 3.5
The type signature of the function.
.UNINDENT
.UNINDENT
.sp
\fBByte Size\fP
.INDENT 0.0
.INDENT 3.5
The total number of bytes in the function\(aqs block.
.UNINDENT
.UNINDENT
.sp
\fBBasic Blocks\fP
.INDENT 0.0
.INDENT 3.5
The number of basic blocks defined by the function.
.UNINDENT
.UNINDENT
.sp
\fBInstructions\fP
.INDENT 0.0
.INDENT 3.5
The number of instructions defined by the function.
.UNINDENT
.UNINDENT
.sp
\fBLong Instructions\fP
.INDENT 0.0
.INDENT 3.5
The number of instructions using the long instruction format in the function.
.UNINDENT
.UNINDENT
.sp
\fBOperands\fP
.INDENT 0.0
.INDENT 3.5
The number of operands used by all instructions in the function.
.UNINDENT
.UNINDENT
.sp
\fBInstruction Size\fP
.INDENT 0.0
.INDENT 3.5
The number of bytes consumed by instructions in the function.
.UNINDENT
.UNINDENT
.sp
\fBAverage Instruction Size\fP
.INDENT 0.0
.INDENT 3.5
The average number of bytes consumed by the instructions in the function.
This value is computed by dividing Instruction Size by Instructions.
.UNINDENT
.UNINDENT
.sp
\fBBytes Per Instruction\fP
.INDENT 0.0
.INDENT 3.5
The average number of bytes used by the function per instruction.  This value
is computed by dividing Byte Size by Instructions.  Note that this is not the
same as Average Instruction Size.  It computes a number relative to the total
function size not just the size of the instruction list.
.UNINDENT
.UNINDENT
.sp
\fBNumber of VBR 32\-bit Integers\fP
.INDENT 0.0
.INDENT 3.5
The total number of 32\-bit integers found in this function (for any use).
.UNINDENT
.UNINDENT
.sp
\fBNumber of VBR 64\-bit Integers\fP
.INDENT 0.0
.INDENT 3.5
The total number of 64\-bit integers found in this function (for any use).
.UNINDENT
.UNINDENT
.sp
\fBNumber of VBR Compressed Bytes\fP
.INDENT 0.0
.INDENT 3.5
The total number of bytes in this function consumed by the 32\-bit and 64\-bit
integers that use the Variable Bit Rate encoding scheme.
.UNINDENT
.UNINDENT
.sp
\fBNumber of VBR Expanded Bytes\fP
.INDENT 0.0
.INDENT 3.5
The total number of bytes in this function that would have been consumed by
the 32\-bit and 64\-bit integers had they not been compressed with the Variable
Bit Rate encoding scheme.
.UNINDENT
.UNINDENT
.sp
\fBBytes Saved With VBR\fP
.INDENT 0.0
.INDENT 3.5
The total number of bytes saved in this function by using the Variable Bit
Rate encoding scheme.  The percentage is relative to # of VBR Expanded Bytes.
.UNINDENT
.UNINDENT
.SH SEE ALSO
.sp
/CommandGuide/llvm\-dis, /BitCodeFormat
.SH AUTHOR
Maintained by The LLVM Team (http://llvm.org/).
.SH COPYRIGHT
2003-2017, LLVM Project
.\" Generated by docutils manpage writer.
.
OpenPOWER on IntegriCloud