-
Notifications
You must be signed in to change notification settings - Fork 214
/
LLVM.ll
515 lines (486 loc) · 12 KB
/
LLVM.ll
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
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
; LLVM 16 https://llvm.org/docs/LangRef.html
;! Keywords ===========================================================
; Linkage Types
; https://llvm.org/docs/LangRef.html#linkage-types
private
internal
available_externally
linkonce
weak
common
appending
extern_weak
linkonce_odr
weak_odr
external
; Global Variables
; https://llvm.org/docs/LangRef.html#global-variables
global
constant
section
partition
; align
comdat
; Functions
; https://llvm.org/docs/LangRef.html#functions
define
section
comdat
declare
; Garbage Collector Strategy Names
; https://llvm.org/docs/LangRef.html#garbage-collector-strategy-names
gc
; Prefix Data
; https://llvm.org/docs/LangRef.html#prefix-data
prefix
; Aliases
; https://llvm.org/docs/LangRef.html#aliases
alias
; IFuncs
; https://llvm.org/docs/LangRef.html#ifuncs
ifunc
; Attribute Groups
; https://llvm.org/docs/LangRef.html#attribute-groups
attributes
; Module-Level Inline Assembly
; https://llvm.org/docs/LangRef.html#module-level-inline-assembly
module asm
; Data Layout
; https://llvm.org/docs/LangRef.html#data-layout
target datalayout
; Target Triple
; https://llvm.org/docs/LangRef.html#target-triple
target triple
; Use-list Order Directives
; https://llvm.org/docs/LangRef.html#use-list-order-directives
uselistorder uselistorder_bb
; Source Filename
; https://llvm.org/docs/LangRef.html#source-filename
source_filename
; Constants
; https://llvm.org/docs/LangRef.html#constants
true false
null none
global
undef
poison
; Metadata
; https://llvm.org/docs/LangRef.html#metadata
distinct
;! Type ===========================================================
; https://llvm.org/docs/LangRef.html#type-system
void
i1 i8 i16 i32 i64 i128
half
bfloat
float
double
fp128
x86_fp80
ppc_fp128
x86_mmx
ptr ; Pointer Type
vscale ; Vector Type
label ; Label Type
token ; Token Type
metadata ; Metadata Type
type ; Structure Type
opaque ; Opaque Structure Types
;! Attribute ===========================================================
; Calling Conventions
; https://llvm.org/docs/LangRef.html#calling-conventions
ccc
fastcc
coldcc
webkit_jscc
anyregcc
preserve_mostcc
preserve_allcc
cxx_fast_tlscc
swiftcc
swifttailcc
tailcc
cfguard_checkcc
; Visibility Styles
; https://llvm.org/docs/LangRef.html#visibility-styles
default
hidden
protected
; DLL Storage Classes
; https://llvm.org/docs/LangRef.html#dll-storage-classes
dllimport
dllexport
; Thread Local Storage Models
; https://llvm.org/docs/LangRef.html#thread-local-storage-models
thread_local()
localdynamic
initialexec
localexec
; Runtime Preemption Specifiers
; https://llvm.org/docs/LangRef.html#runtime-preemption-specifiers
dso_preemptable
dso_local
; Global Variables
; https://llvm.org/docs/LangRef.html#global-variables
unnamed_addr
local_unnamed_addr
no_sanitize_address
no_sanitize_hwaddress
sanitize_address_dyninit
sanitize_memtag
; Comdats
; https://llvm.org/docs/LangRef.html#comdats
any
exactmatch
largest
noduplicates
samesize
; Parameter Attributes
; https://llvm.org/docs/LangRef.html#parameter-attributes
zeroext
signext
inreg
byval
byval(<ty>)
preallocated(<ty>)
inalloca
sret
elementtype(<ty>)
align <n>
align(<n>)
noalias
nocapture
nofree
nest
returned
nonnull
dereferenceable(<n>)
dereferenceable_or_null(<n>)
swiftself
swiftasync
swifterror
immarg
noundef
nofpclass(<test mask>)
alignstack(<n>)
allocalign
allocptr
readnone
readonly
writeonly
; Prologue Data
; https://llvm.org/docs/LangRef.html#prologue-data
prologue
; Personality Function
; https://llvm.org/docs/LangRef.html#personality-function
personality
; Function Attributes
; https://llvm.org/docs/LangRef.html#function-attributes
alignstack(<n>)
alloc-family
allockind("KIND")
allocsize(<EltSizeParam>[, <NumEltsParam>])
alwaysinline
builtin
cold
convergent
disable_sanitizer_instrumentation
dontcall-error
dontcall-warn
frame-pointer
fn_ret_thunk_extern
hot
inlinehint
jumptable
memory(...)
minsize
naked
no-inline-line-tables
no-jump-tables
nobuiltin
nocallback
noduplicate
nofree
noimplicitfloat
noinline
nomerge
nonlazybind
noprofile
skipprofile
noredzone
indirect-tls-seg-refs
noreturn
norecurse
willreturn
nosync
nounwind
nosanitize_bounds
nosanitize_coverage
null_pointer_is_valid
optforfuzzing
optnone
optsize
patchable-function
probe-stack
stack-probe-size
no-stack-arg-probe
returns_twice
safestack
sanitize_address
sanitize_memory
sanitize_thread
sanitize_hwaddress
sanitize_memtag
speculative_load_hardening
speculatable
ssp
sspreq
sspstrong
strictfp
denormal-fp-math
denormal-fp-math-f32
thunk
tls-load-hoist
uwtable
nocf_check
shadowcallstack
mustprogress
warn-stack-size
vscale_range(<min>[, <max>])
nooutline
; Call Site Attributes
; https://llvm.org/docs/LangRef.html#call-site-attributes
vector-function-abi-variant
preallocated(<ty>)
; Global Attributes
; https://llvm.org/docs/LangRef.html#global-attributes
no_sanitize_address
no_sanitize_hwaddress
sanitize_memtag
sanitize_address_dyninit
; Assume Operand Bundles
; https://llvm.org/docs/LangRef.html#assume-operand-bundles
separate_storage(<val1>, <val2>)
; Atomic Memory Ordering Constraints
; https://llvm.org/docs/LangRef.html#atomic-memory-ordering-constraints
unordered
monotonic
acquire
release
acq_rel
seq_cst
; Fast-Math Flags
; https://llvm.org/docs/LangRef.html#fast-math-flags
nnan
ninf
nsz
arcp
contract
afn
reassoc
fast
; Pointer Type
addrspace()
; Constants
zeroinitializer
blockaddress(@function, %block)
dso_local_equivalent
no_cfi @func
; Inline Assembler Expressions
; https://llvm.org/docs/LangRef.html#inline-assembler-expressions
sideeffect
alignstack
inteldialect
; Instruction
nuw
nsw
exact
atomic
volatile
inbounds
inrange
syncscope("<target-scope>")
;! Instruction ===========================================================
; https://llvm.org/docs/LangRef.html#instruction-reference
; Terminator Instructions
; https://llvm.org/docs/LangRef.html#terminator-instructions
ret <type> <value>
ret void
br i1 <cond>, label <iftrue>, label <iffalse>
br label <dest>
switch <intty> <value>, label <defaultdest> [ <intty> <val>, label <dest> ... ]
indirectbr <somety>* <address>, [ label <dest1>, label <dest2>, ... ]
invoke [cconv] [ret attrs] [addrspace(<num>)] <ty>|<fnty> <fnptrval>(<function args>) [fn attrs]
[operand bundles] to label <normal label>
unwind label <exception label>
callbr [cconv] [ret attrs] [addrspace(<num>)] <ty>|<fnty> <fnptrval>(<function args>) [fn attrs]
[operand bundles] to label <fallthrough label> [indirect labels]
resume <type> <value>
catchswitch
within <parent> [ label <handler1>, label <handler2>, ... ] unwind to
caller
catchswitch within <parent> [ label <handler1>, label <handler2>, ... ] unwind label <default>
catchret
from <token> to label <normal>
cleanupret from <value> unwind label <continue>
cleanupret from <value> unwind to caller
unreachable
; Unary Operations
; https://llvm.org/docs/LangRef.html#unary-operations
fneg [fast-math flags]* <ty> <op1>
; Binary Operations
; https://llvm.org/docs/LangRef.html#binary-operations
add <ty> <op1>, <op2>
add nuw <ty> <op1>, <op2>
add nsw <ty> <op1>, <op2>
add nuw nsw <ty> <op1>, <op2>
fadd [fast-math flags]* <ty> <op1>, <op2>
sub <ty> <op1>, <op2>
sub nuw <ty> <op1>, <op2>
sub nsw <ty> <op1>, <op2>
sub nuw nsw <ty> <op1>, <op2>
fsub [fast-math flags]* <ty> <op1>, <op2>
mul <ty> <op1>, <op2>
mul nuw <ty> <op1>, <op2>
mul nsw <ty> <op1>, <op2>
mul nuw nsw <ty> <op1>, <op2>
fmul [fast-math flags]* <ty> <op1>, <op2>
udiv <ty> <op1>, <op2>
udiv exact <ty> <op1>, <op2>
sdiv <ty> <op1>, <op2>
sdiv exact <ty> <op1>, <op2>
fdiv [fast-math flags]* <ty> <op1>, <op2>
urem <ty> <op1>, <op2>
srem <ty> <op1>, <op2>
frem [fast-math flags]* <ty> <op1>, <op2>
; Bitwise Binary Operations
; https://llvm.org/docs/LangRef.html#bitwise-binary-operations
shl <ty> <op1>, <op2>
shl nuw <ty> <op1>, <op2>
shl nsw <ty> <op1>, <op2>
shl nuw nsw <ty> <op1>, <op2>
lshr <ty> <op1>, <op2>
lshr exact <ty> <op1>, <op2>
ashr <ty> <op1>, <op2>
ashr exact <ty> <op1>, <op2>
and <ty> <op1>, <op2>
or <ty> <op1>, <op2>
xor <ty> <op1>, <op2>
; Vector Operations
; https://llvm.org/docs/LangRef.html#vector-operations
extractelement <n x <ty>> <val>, <ty2> <idx>
extractelement <vscale x n x <ty>> <val>, <ty2> <idx>
insertelement <n x <ty>> <val>, <ty> <elt>, <ty2> <idx>
insertelement <vscale x n x <ty>> <val>, <ty> <elt>, <ty2> <idx>
shufflevector <n x <ty>> <v1>, <n x <ty>> <v2>, <m x i32> <mask>
shufflevector <vscale x n x <ty>> <v1>, <vscale x n x <ty>> v2, <vscale x m x i32> <mask>
; Aggregate Operations
; https://llvm.org/docs/LangRef.html#aggregate-operations
extractvalue <aggregate type> <val>, <idx>{, <idx>}*
insertvalue <aggregate type> <val>, <ty> <elt>, <idx>{, <idx>}*
; Memory Access and Addressing Operations
; https://llvm.org/docs/LangRef.html#memory-access-and-addressing-operations
alloca [inalloca] <type> [, <ty> <NumElements>] [, align <alignment>] [, addrspace(<num>)]
load [volatile] <ty>, ptr <pointer>[, align <alignment>][, !nontemporal !<nontemp_node>][, !invariant.load !<empty_node>][, !invariant.group !<empty_node>][, !nonnull !<empty_node>][, !dereferenceable !<deref_bytes_node>][, !dereferenceable_or_null !<deref_bytes_node>][, !align !<align_node>][, !noundef !<empty_node>]
load atomic [volatile] <ty>, ptr <pointer> [syncscope("<target-scope>")] <ordering>, align <alignment> [, !invariant.group !<empty_node>]
!<nontemp_node> = !{ i32 1 }
!<empty_node> = !{}
!<deref_bytes_node> = !{ i64 <dereferenceable_bytes> }
!<align_node> = !{ i64 <value_alignment> }
store [volatile] <ty> <value>, ptr <pointer>[, align <alignment>][, !nontemporal !<nontemp_node>][, !invariant.group !<empty_node>]
store atomic [volatile] <ty> <value>, ptr <pointer> [syncscope("<target-scope>")] <ordering>, align <alignment> [, !invariant.group !<empty_node>]
!<nontemp_node> = !{ i32 1 }
!<empty_node> = !{}
fence [syncscope("<target-scope>")] <ordering>
cmpxchg [weak] [volatile] ptr <pointer>, <ty> <cmp>, <ty> <new> [syncscope("<target-scope>")] <success ordering> <failure ordering>[, align <alignment>]
atomicrmw [volatile] <operation> ptr <pointer>, <ty> <value> [syncscope("<target-scope>")] <ordering>[, align <alignment>]
xchg
add
sub
and
nand
or
xor
max
min
umax
umin
fadd
fsub
fmax
fmin
uinc_wrap
udec_wrap
getelementptr <ty>, ptr <ptrval>{, [inrange] <ty> <idx>}*
getelementptr inbounds <ty>, ptr <ptrval>{, [inrange] <ty> <idx>}*
getelementptr <ty>, <N x ptr> <ptrval>, [inrange] <vector index type> <idx>; Conversion Operations
; https://llvm.org/docs/LangRef.html#conversion-operations
trunc <ty> <value>
to <ty2>
zext <ty> <value> to <ty2>
sext <ty> <value> to <ty2>
fptrunc <ty> <value> to <ty2>
fpext <ty> <value> to <ty2>
fptoui <ty> <value> to <ty2>
fptosi <ty> <value> to <ty2>
uitofp <ty> <value> to <ty2>
sitofp <ty> <value> to <ty2>
ptrtoint <ty> <value> to <ty2>
inttoptr <ty> <value> to <ty2>[, !dereferenceable !<deref_bytes_node>][, !dereferenceable_or_null !<deref_bytes_node]
bitcast <ty> <value> to <ty2>
addrspacecast <pty> <ptrval> to <pty2>
; Other Operations
; https://llvm.org/docs/LangRef.html#other-operations
icmp <cond> <ty> <op1>, <op2>
eq
ne
ugt
uge
ult
ule
sgt
sge
slt
sle
fcmp [fast-math flags]* <cond> <ty> <op1>, <op2>
oeq
ogt
oge
olt
ole
one
ord
ueq
ugt
uge
ult
ule
une
uno
phi [fast-math-flags] <ty> [ <val0>, <label0>], ...
select [fast-math flags] selty <cond>, <ty> <val1>, <ty> <val2>
freeze ty <val>
call [fast-math flags] [cconv] [ret attrs] [addrspace(<num>)]
<ty>|<fnty> <fnptrval>(<function args>) [fn attrs] [ operand bundles ]
tail
musttail
notail
va_arg <va_list*> <arglist>, <argty>
landingpad <resultty> <clause>+
landingpad <resultty>
cleanup <clause>*
catch <type> <value>
filter <array constant type> <array constant>
catchpad within <catchswitch> [<args>*]
cleanuppad within <parent> [<args>*]
;! Metadata ===========================================================
; https://llvm.org/docs/LangRef.html#metadata
;! Intrinsic ===========================================================
; Intrinsic Global Variables
; https://llvm.org/docs/LangRef.html#intrinsic-global-variables
@llvm.used
@llvm.compiler.used
@llvm.global_ctors
@llvm.global_dtors
; Intrinsic Functions
; https://llvm.org/docs/LangRef.html#intrinsic-functions