llvmlite 0.41.1__cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl → 0.42.0__cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of llvmlite might be problematic. Click here for more details.
- llvmlite/_version.py +2 -2
- llvmlite/binding/__init__.py +1 -0
- llvmlite/binding/executionengine.py +11 -3
- llvmlite/binding/ffi.py +2 -0
- llvmlite/binding/libllvmlite.so +0 -0
- llvmlite/binding/passmanagers.py +9 -0
- llvmlite/binding/typeref.py +198 -0
- llvmlite/binding/value.py +36 -42
- llvmlite/ir/instructions.py +2 -2
- llvmlite/ir/values.py +1 -1
- llvmlite/tests/test_binding.py +152 -1
- llvmlite/tests/test_ir.py +5 -1
- llvmlite-0.42.0.dist-info/LICENSE.thirdparty +225 -0
- {llvmlite-0.41.1.dist-info → llvmlite-0.42.0.dist-info}/METADATA +6 -5
- {llvmlite-0.41.1.dist-info → llvmlite-0.42.0.dist-info}/RECORD +18 -16
- {llvmlite-0.41.1.dist-info → llvmlite-0.42.0.dist-info}/WHEEL +1 -1
- {llvmlite-0.41.1.dist-info → llvmlite-0.42.0.dist-info}/LICENSE +0 -0
- {llvmlite-0.41.1.dist-info → llvmlite-0.42.0.dist-info}/top_level.txt +0 -0
llvmlite/_version.py
CHANGED
|
@@ -4,8 +4,8 @@
|
|
|
4
4
|
# unpacked source archive. Distribution tarballs contain a pre-generated copy
|
|
5
5
|
# of this file.
|
|
6
6
|
|
|
7
|
-
version_version = '0.
|
|
8
|
-
version_full = '
|
|
7
|
+
version_version = '0.42.0'
|
|
8
|
+
version_full = 'b2a26aafd266b8972ad26dfa98dc41642f84913e'
|
|
9
9
|
def get_versions(default={}, verbose=False):
|
|
10
10
|
return {'version': version_version, 'full': version_full}
|
|
11
11
|
|
llvmlite/binding/__init__.py
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import platform
|
|
1
2
|
from ctypes import (POINTER, c_char_p, c_bool, c_void_p,
|
|
2
3
|
c_int, c_uint64, c_size_t, CFUNCTYPE, string_at, cast,
|
|
3
4
|
py_object, Structure)
|
|
@@ -9,14 +10,21 @@ from llvmlite.binding import ffi, targets, object_file
|
|
|
9
10
|
ffi.lib.LLVMPY_LinkInMCJIT
|
|
10
11
|
|
|
11
12
|
|
|
12
|
-
def create_mcjit_compiler(module, target_machine):
|
|
13
|
+
def create_mcjit_compiler(module, target_machine, use_lmm=None):
|
|
13
14
|
"""
|
|
14
15
|
Create a MCJIT ExecutionEngine from the given *module* and
|
|
15
16
|
*target_machine*.
|
|
17
|
+
|
|
18
|
+
*lmm* controls whether the llvmlite memory manager is used. If not supplied,
|
|
19
|
+
the default choice for the platform will be used (``True`` on 64-bit ARM
|
|
20
|
+
systems, ``False`` otherwise).
|
|
16
21
|
"""
|
|
22
|
+
if use_lmm is None:
|
|
23
|
+
use_lmm = platform.machine() in ('arm64', 'aarch64')
|
|
24
|
+
|
|
17
25
|
with ffi.OutputString() as outerr:
|
|
18
26
|
engine = ffi.lib.LLVMPY_CreateMCJITCompiler(
|
|
19
|
-
module, target_machine, outerr)
|
|
27
|
+
module, target_machine, use_lmm, outerr)
|
|
20
28
|
if not engine:
|
|
21
29
|
raise RuntimeError(str(outerr))
|
|
22
30
|
|
|
@@ -71,7 +79,6 @@ class ExecutionEngine(ffi.ObjectRef):
|
|
|
71
79
|
return ffi.lib.LLVMPY_GetGlobalValueAddress(self, name.encode("ascii"))
|
|
72
80
|
|
|
73
81
|
def add_global_mapping(self, gv, addr):
|
|
74
|
-
# XXX unused?
|
|
75
82
|
ffi.lib.LLVMPY_AddGlobalMapping(self, gv, addr)
|
|
76
83
|
|
|
77
84
|
def add_module(self, module):
|
|
@@ -239,6 +246,7 @@ class _ObjectCacheRef(ffi.ObjectRef):
|
|
|
239
246
|
ffi.lib.LLVMPY_CreateMCJITCompiler.argtypes = [
|
|
240
247
|
ffi.LLVMModuleRef,
|
|
241
248
|
ffi.LLVMTargetMachineRef,
|
|
249
|
+
c_bool,
|
|
242
250
|
POINTER(c_char_p),
|
|
243
251
|
]
|
|
244
252
|
ffi.lib.LLVMPY_CreateMCJITCompiler.restype = ffi.LLVMExecutionEngineRef
|
llvmlite/binding/ffi.py
CHANGED
|
@@ -25,6 +25,7 @@ LLVMTargetRef = _make_opaque_ref("LLVMTarget")
|
|
|
25
25
|
LLVMTargetMachineRef = _make_opaque_ref("LLVMTargetMachine")
|
|
26
26
|
LLVMMemoryBufferRef = _make_opaque_ref("LLVMMemoryBuffer")
|
|
27
27
|
LLVMAttributeListIterator = _make_opaque_ref("LLVMAttributeListIterator")
|
|
28
|
+
LLVMElementIterator = _make_opaque_ref("LLVMElementIterator")
|
|
28
29
|
LLVMAttributeSetIterator = _make_opaque_ref("LLVMAttributeSetIterator")
|
|
29
30
|
LLVMGlobalsIterator = _make_opaque_ref("LLVMGlobalsIterator")
|
|
30
31
|
LLVMFunctionsIterator = _make_opaque_ref("LLVMFunctionsIterator")
|
|
@@ -32,6 +33,7 @@ LLVMBlocksIterator = _make_opaque_ref("LLVMBlocksIterator")
|
|
|
32
33
|
LLVMArgumentsIterator = _make_opaque_ref("LLVMArgumentsIterator")
|
|
33
34
|
LLVMInstructionsIterator = _make_opaque_ref("LLVMInstructionsIterator")
|
|
34
35
|
LLVMOperandsIterator = _make_opaque_ref("LLVMOperandsIterator")
|
|
36
|
+
LLVMIncomingBlocksIterator = _make_opaque_ref("LLVMIncomingBlocksIterator")
|
|
35
37
|
LLVMTypesIterator = _make_opaque_ref("LLVMTypesIterator")
|
|
36
38
|
LLVMObjectCacheRef = _make_opaque_ref("LLVMObjectCache")
|
|
37
39
|
LLVMObjectFileRef = _make_opaque_ref("LLVMObjectFile")
|
llvmlite/binding/libllvmlite.so
CHANGED
|
Binary file
|
llvmlite/binding/passmanagers.py
CHANGED
|
@@ -638,6 +638,14 @@ class PassManager(ffi.ObjectRef):
|
|
|
638
638
|
def add_target_library_info(self, triple):
|
|
639
639
|
ffi.lib.LLVMPY_AddTargetLibraryInfoPass(self, _encode_string(triple))
|
|
640
640
|
|
|
641
|
+
def add_instruction_namer_pass(self):
|
|
642
|
+
"""
|
|
643
|
+
See https://llvm.org/docs/Passes.html#instnamer-assign-names-to-anonymous-instructions.
|
|
644
|
+
|
|
645
|
+
LLVM 14: `llvm::createInstructionNamerPass`
|
|
646
|
+
""" # noqa E501
|
|
647
|
+
ffi.lib.LLVMPY_AddInstructionNamerPass(self)
|
|
648
|
+
|
|
641
649
|
# Non-standard LLVM passes
|
|
642
650
|
|
|
643
651
|
def add_refprune_pass(self, subpasses_flags=RefPruneSubpasses.ALL,
|
|
@@ -916,6 +924,7 @@ ffi.lib.LLVMPY_AddTypeBasedAliasAnalysisPass.argtypes = [ffi.LLVMPassManagerRef]
|
|
|
916
924
|
ffi.lib.LLVMPY_AddBasicAliasAnalysisPass.argtypes = [ffi.LLVMPassManagerRef]
|
|
917
925
|
ffi.lib.LLVMPY_AddTargetLibraryInfoPass.argtypes = [ffi.LLVMPassManagerRef,
|
|
918
926
|
c_char_p]
|
|
927
|
+
ffi.lib.LLVMPY_AddInstructionNamerPass.argtypes = [ffi.LLVMPassManagerRef]
|
|
919
928
|
|
|
920
929
|
ffi.lib.LLVMPY_AddRefPrunePass.argtypes = [ffi.LLVMPassManagerRef, c_int,
|
|
921
930
|
c_size_t]
|
|
@@ -0,0 +1,198 @@
|
|
|
1
|
+
from ctypes import c_int, c_bool, c_void_p, c_uint64
|
|
2
|
+
import enum
|
|
3
|
+
|
|
4
|
+
from llvmlite.binding import ffi
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
class TypeKind(enum.IntEnum):
|
|
8
|
+
# The LLVMTypeKind enum from llvm-c/Core.h
|
|
9
|
+
|
|
10
|
+
void = 0
|
|
11
|
+
half = 1
|
|
12
|
+
float = 2
|
|
13
|
+
double = 3
|
|
14
|
+
x86_fp80 = 4
|
|
15
|
+
fp128 = 5
|
|
16
|
+
ppc_fp128 = 6
|
|
17
|
+
label = 7
|
|
18
|
+
integer = 8
|
|
19
|
+
function = 9
|
|
20
|
+
struct = 10
|
|
21
|
+
array = 11
|
|
22
|
+
pointer = 12
|
|
23
|
+
vector = 13
|
|
24
|
+
metadata = 14
|
|
25
|
+
x86_mmx = 15
|
|
26
|
+
token = 16
|
|
27
|
+
scalable_vector = 17
|
|
28
|
+
bfloat = 18
|
|
29
|
+
x86_amx = 19
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
class TypeRef(ffi.ObjectRef):
|
|
33
|
+
"""A weak reference to a LLVM type
|
|
34
|
+
"""
|
|
35
|
+
@property
|
|
36
|
+
def name(self):
|
|
37
|
+
"""
|
|
38
|
+
Get type name
|
|
39
|
+
"""
|
|
40
|
+
return ffi.ret_string(ffi.lib.LLVMPY_GetTypeName(self))
|
|
41
|
+
|
|
42
|
+
@property
|
|
43
|
+
def is_struct(self):
|
|
44
|
+
"""
|
|
45
|
+
Returns true if the type is a struct type.
|
|
46
|
+
"""
|
|
47
|
+
return ffi.lib.LLVMPY_TypeIsStruct(self)
|
|
48
|
+
|
|
49
|
+
@property
|
|
50
|
+
def is_pointer(self):
|
|
51
|
+
"""
|
|
52
|
+
Returns true if the type is a pointer type.
|
|
53
|
+
"""
|
|
54
|
+
return ffi.lib.LLVMPY_TypeIsPointer(self)
|
|
55
|
+
|
|
56
|
+
@property
|
|
57
|
+
def is_array(self):
|
|
58
|
+
"""
|
|
59
|
+
Returns true if the type is an array type.
|
|
60
|
+
"""
|
|
61
|
+
return ffi.lib.LLVMPY_TypeIsArray(self)
|
|
62
|
+
|
|
63
|
+
@property
|
|
64
|
+
def is_vector(self):
|
|
65
|
+
"""
|
|
66
|
+
Returns true if the type is a vector type.
|
|
67
|
+
"""
|
|
68
|
+
return ffi.lib.LLVMPY_TypeIsVector(self)
|
|
69
|
+
|
|
70
|
+
@property
|
|
71
|
+
def is_function_vararg(self):
|
|
72
|
+
"""
|
|
73
|
+
Returns true if a function type accepts a variable number of arguments.
|
|
74
|
+
When the type is not a function, raises exception.
|
|
75
|
+
"""
|
|
76
|
+
if self.type_kind != TypeKind.function:
|
|
77
|
+
raise ValueError("Type {} is not a function".format(self))
|
|
78
|
+
return ffi.lib.LLVMPY_IsFunctionVararg(self)
|
|
79
|
+
|
|
80
|
+
@property
|
|
81
|
+
def elements(self):
|
|
82
|
+
"""
|
|
83
|
+
Returns iterator over enclosing types
|
|
84
|
+
"""
|
|
85
|
+
return _TypeListIterator(ffi.lib.LLVMPY_ElementIter(self))
|
|
86
|
+
|
|
87
|
+
@property
|
|
88
|
+
def element_type(self):
|
|
89
|
+
"""
|
|
90
|
+
Returns the pointed-to type. When the type is not a pointer,
|
|
91
|
+
raises exception.
|
|
92
|
+
"""
|
|
93
|
+
if not self.is_pointer:
|
|
94
|
+
raise ValueError("Type {} is not a pointer".format(self))
|
|
95
|
+
return TypeRef(ffi.lib.LLVMPY_GetElementType(self))
|
|
96
|
+
|
|
97
|
+
@property
|
|
98
|
+
def element_count(self):
|
|
99
|
+
"""
|
|
100
|
+
Returns the number of elements in an array or a vector. For scalable
|
|
101
|
+
vectors, returns minimum number of elements. When the type is neither
|
|
102
|
+
an array nor a vector, raises exception.
|
|
103
|
+
"""
|
|
104
|
+
if not self.is_array and not self.is_vector:
|
|
105
|
+
raise ValueError("Type {} is not an array nor vector".format(self))
|
|
106
|
+
return ffi.lib.LLVMPY_GetTypeElementCount(self)
|
|
107
|
+
|
|
108
|
+
@property
|
|
109
|
+
def type_width(self):
|
|
110
|
+
"""
|
|
111
|
+
Return the basic size of this type if it is a primitive type. These are
|
|
112
|
+
fixed by LLVM and are not target-dependent.
|
|
113
|
+
This will return zero if the type does not have a size or is not a
|
|
114
|
+
primitive type.
|
|
115
|
+
|
|
116
|
+
If this is a scalable vector type, the scalable property will be set and
|
|
117
|
+
the runtime size will be a positive integer multiple of the base size.
|
|
118
|
+
|
|
119
|
+
Note that this may not reflect the size of memory allocated for an
|
|
120
|
+
instance of the type or the number of bytes that are written when an
|
|
121
|
+
instance of the type is stored to memory.
|
|
122
|
+
"""
|
|
123
|
+
return ffi.lib.LLVMPY_GetTypeBitWidth(self)
|
|
124
|
+
|
|
125
|
+
@property
|
|
126
|
+
def type_kind(self):
|
|
127
|
+
"""
|
|
128
|
+
Returns the LLVMTypeKind enumeration of this type.
|
|
129
|
+
"""
|
|
130
|
+
return TypeKind(ffi.lib.LLVMPY_GetTypeKind(self))
|
|
131
|
+
|
|
132
|
+
def __str__(self):
|
|
133
|
+
return ffi.ret_string(ffi.lib.LLVMPY_PrintType(self))
|
|
134
|
+
|
|
135
|
+
|
|
136
|
+
class _TypeIterator(ffi.ObjectRef):
|
|
137
|
+
|
|
138
|
+
def __next__(self):
|
|
139
|
+
vp = self._next()
|
|
140
|
+
if vp:
|
|
141
|
+
return TypeRef(vp)
|
|
142
|
+
else:
|
|
143
|
+
raise StopIteration
|
|
144
|
+
|
|
145
|
+
next = __next__
|
|
146
|
+
|
|
147
|
+
def __iter__(self):
|
|
148
|
+
return self
|
|
149
|
+
|
|
150
|
+
|
|
151
|
+
class _TypeListIterator(_TypeIterator):
|
|
152
|
+
|
|
153
|
+
def _dispose(self):
|
|
154
|
+
self._capi.LLVMPY_DisposeElementIter(self)
|
|
155
|
+
|
|
156
|
+
def _next(self):
|
|
157
|
+
return ffi.lib.LLVMPY_ElementIterNext(self)
|
|
158
|
+
|
|
159
|
+
|
|
160
|
+
# FFI
|
|
161
|
+
|
|
162
|
+
ffi.lib.LLVMPY_PrintType.argtypes = [ffi.LLVMTypeRef]
|
|
163
|
+
ffi.lib.LLVMPY_PrintType.restype = c_void_p
|
|
164
|
+
|
|
165
|
+
ffi.lib.LLVMPY_GetElementType.argtypes = [ffi.LLVMTypeRef]
|
|
166
|
+
ffi.lib.LLVMPY_GetElementType.restype = ffi.LLVMTypeRef
|
|
167
|
+
|
|
168
|
+
ffi.lib.LLVMPY_TypeIsPointer.argtypes = [ffi.LLVMTypeRef]
|
|
169
|
+
ffi.lib.LLVMPY_TypeIsPointer.restype = c_bool
|
|
170
|
+
|
|
171
|
+
ffi.lib.LLVMPY_TypeIsArray.argtypes = [ffi.LLVMTypeRef]
|
|
172
|
+
ffi.lib.LLVMPY_TypeIsArray.restype = c_bool
|
|
173
|
+
|
|
174
|
+
ffi.lib.LLVMPY_TypeIsVector.argtypes = [ffi.LLVMTypeRef]
|
|
175
|
+
ffi.lib.LLVMPY_TypeIsVector.restype = c_bool
|
|
176
|
+
|
|
177
|
+
ffi.lib.LLVMPY_TypeIsStruct.argtypes = [ffi.LLVMTypeRef]
|
|
178
|
+
ffi.lib.LLVMPY_TypeIsStruct.restype = c_bool
|
|
179
|
+
|
|
180
|
+
ffi.lib.LLVMPY_IsFunctionVararg.argtypes = [ffi.LLVMTypeRef]
|
|
181
|
+
ffi.lib.LLVMPY_IsFunctionVararg.restype = c_bool
|
|
182
|
+
|
|
183
|
+
ffi.lib.LLVMPY_GetTypeKind.argtypes = [ffi.LLVMTypeRef]
|
|
184
|
+
ffi.lib.LLVMPY_GetTypeKind.restype = c_int
|
|
185
|
+
|
|
186
|
+
ffi.lib.LLVMPY_GetTypeElementCount.argtypes = [ffi.LLVMTypeRef]
|
|
187
|
+
ffi.lib.LLVMPY_GetTypeElementCount.restype = c_int
|
|
188
|
+
|
|
189
|
+
ffi.lib.LLVMPY_GetTypeBitWidth.argtypes = [ffi.LLVMTypeRef]
|
|
190
|
+
ffi.lib.LLVMPY_GetTypeBitWidth.restype = c_uint64
|
|
191
|
+
|
|
192
|
+
ffi.lib.LLVMPY_ElementIter.argtypes = [ffi.LLVMTypeRef]
|
|
193
|
+
ffi.lib.LLVMPY_ElementIter.restype = ffi.LLVMElementIterator
|
|
194
|
+
|
|
195
|
+
ffi.lib.LLVMPY_ElementIterNext.argtypes = [ffi.LLVMElementIterator]
|
|
196
|
+
ffi.lib.LLVMPY_ElementIterNext.restype = ffi.LLVMTypeRef
|
|
197
|
+
|
|
198
|
+
ffi.lib.LLVMPY_DisposeElementIter.argtypes = [ffi.LLVMElementIterator]
|
llvmlite/binding/value.py
CHANGED
|
@@ -4,6 +4,7 @@ import enum
|
|
|
4
4
|
|
|
5
5
|
from llvmlite.binding import ffi
|
|
6
6
|
from llvmlite.binding.common import _decode_string, _encode_string
|
|
7
|
+
from llvmlite.binding.typeref import TypeRef
|
|
7
8
|
|
|
8
9
|
|
|
9
10
|
class Linkage(enum.IntEnum):
|
|
@@ -79,37 +80,6 @@ class ValueKind(enum.IntEnum):
|
|
|
79
80
|
poison_value = 25
|
|
80
81
|
|
|
81
82
|
|
|
82
|
-
class TypeRef(ffi.ObjectRef):
|
|
83
|
-
"""A weak reference to a LLVM type
|
|
84
|
-
"""
|
|
85
|
-
@property
|
|
86
|
-
def name(self):
|
|
87
|
-
"""
|
|
88
|
-
Get type name
|
|
89
|
-
"""
|
|
90
|
-
return ffi.ret_string(ffi.lib.LLVMPY_GetTypeName(self))
|
|
91
|
-
|
|
92
|
-
@property
|
|
93
|
-
def is_pointer(self):
|
|
94
|
-
"""
|
|
95
|
-
Returns true is the type is a pointer type.
|
|
96
|
-
"""
|
|
97
|
-
return ffi.lib.LLVMPY_TypeIsPointer(self)
|
|
98
|
-
|
|
99
|
-
@property
|
|
100
|
-
def element_type(self):
|
|
101
|
-
"""
|
|
102
|
-
Returns the pointed-to type. When the type is not a pointer,
|
|
103
|
-
raises exception.
|
|
104
|
-
"""
|
|
105
|
-
if not self.is_pointer:
|
|
106
|
-
raise ValueError("Type {} is not a pointer".format(self))
|
|
107
|
-
return TypeRef(ffi.lib.LLVMPY_GetElementType(self))
|
|
108
|
-
|
|
109
|
-
def __str__(self):
|
|
110
|
-
return ffi.ret_string(ffi.lib.LLVMPY_PrintType(self))
|
|
111
|
-
|
|
112
|
-
|
|
113
83
|
class ValueRef(ffi.ObjectRef):
|
|
114
84
|
"""A weak reference to a LLVM value.
|
|
115
85
|
"""
|
|
@@ -343,6 +313,20 @@ class ValueRef(ffi.ObjectRef):
|
|
|
343
313
|
% (self._kind,))
|
|
344
314
|
return ffi.ret_string(ffi.lib.LLVMPY_GetOpcodeName(self))
|
|
345
315
|
|
|
316
|
+
@property
|
|
317
|
+
def incoming_blocks(self):
|
|
318
|
+
"""
|
|
319
|
+
Return an iterator over this phi instruction's incoming blocks.
|
|
320
|
+
The iterator will yield a ValueRef for each block.
|
|
321
|
+
"""
|
|
322
|
+
if not self.is_instruction or self.opcode != 'phi':
|
|
323
|
+
raise ValueError('expected phi instruction value, got %s'
|
|
324
|
+
% (self._kind,))
|
|
325
|
+
it = ffi.lib.LLVMPY_PhiIncomingBlocksIter(self)
|
|
326
|
+
parents = self._parents.copy()
|
|
327
|
+
parents.update(instruction=self)
|
|
328
|
+
return _IncomingBlocksIterator(it, parents)
|
|
329
|
+
|
|
346
330
|
def get_constant_value(self, signed_int=False, round_fp=False):
|
|
347
331
|
"""
|
|
348
332
|
Return the constant value, either as a literal (when supported)
|
|
@@ -492,6 +476,17 @@ class _OperandsIterator(_ValueIterator):
|
|
|
492
476
|
return ffi.lib.LLVMPY_OperandsIterNext(self)
|
|
493
477
|
|
|
494
478
|
|
|
479
|
+
class _IncomingBlocksIterator(_ValueIterator):
|
|
480
|
+
|
|
481
|
+
kind = 'block'
|
|
482
|
+
|
|
483
|
+
def _dispose(self):
|
|
484
|
+
self._capi.LLVMPY_DisposeIncomingBlocksIter(self)
|
|
485
|
+
|
|
486
|
+
def _next(self):
|
|
487
|
+
return ffi.lib.LLVMPY_IncomingBlocksIterNext(self)
|
|
488
|
+
|
|
489
|
+
|
|
495
490
|
# FFI
|
|
496
491
|
|
|
497
492
|
ffi.lib.LLVMPY_PrintValueToString.argtypes = [
|
|
@@ -510,17 +505,6 @@ ffi.lib.LLVMPY_SetValueName.argtypes = [ffi.LLVMValueRef, c_char_p]
|
|
|
510
505
|
ffi.lib.LLVMPY_TypeOf.argtypes = [ffi.LLVMValueRef]
|
|
511
506
|
ffi.lib.LLVMPY_TypeOf.restype = ffi.LLVMTypeRef
|
|
512
507
|
|
|
513
|
-
|
|
514
|
-
ffi.lib.LLVMPY_PrintType.argtypes = [ffi.LLVMTypeRef]
|
|
515
|
-
ffi.lib.LLVMPY_PrintType.restype = c_void_p
|
|
516
|
-
|
|
517
|
-
ffi.lib.LLVMPY_TypeIsPointer.argtypes = [ffi.LLVMTypeRef]
|
|
518
|
-
ffi.lib.LLVMPY_TypeIsPointer.restype = c_bool
|
|
519
|
-
|
|
520
|
-
ffi.lib.LLVMPY_GetElementType.argtypes = [ffi.LLVMTypeRef]
|
|
521
|
-
ffi.lib.LLVMPY_GetElementType.restype = ffi.LLVMTypeRef
|
|
522
|
-
|
|
523
|
-
|
|
524
508
|
ffi.lib.LLVMPY_GetTypeName.argtypes = [ffi.LLVMTypeRef]
|
|
525
509
|
ffi.lib.LLVMPY_GetTypeName.restype = c_void_p
|
|
526
510
|
|
|
@@ -574,6 +558,9 @@ ffi.lib.LLVMPY_BlockInstructionsIter.restype = ffi.LLVMInstructionsIterator
|
|
|
574
558
|
ffi.lib.LLVMPY_InstructionOperandsIter.argtypes = [ffi.LLVMValueRef]
|
|
575
559
|
ffi.lib.LLVMPY_InstructionOperandsIter.restype = ffi.LLVMOperandsIterator
|
|
576
560
|
|
|
561
|
+
ffi.lib.LLVMPY_PhiIncomingBlocksIter.argtypes = [ffi.LLVMValueRef]
|
|
562
|
+
ffi.lib.LLVMPY_PhiIncomingBlocksIter.restype = ffi.LLVMIncomingBlocksIterator
|
|
563
|
+
|
|
577
564
|
ffi.lib.LLVMPY_DisposeAttributeListIter.argtypes = [
|
|
578
565
|
ffi.LLVMAttributeListIterator]
|
|
579
566
|
|
|
@@ -585,6 +572,9 @@ ffi.lib.LLVMPY_DisposeInstructionsIter.argtypes = [ffi.LLVMInstructionsIterator]
|
|
|
585
572
|
|
|
586
573
|
ffi.lib.LLVMPY_DisposeOperandsIter.argtypes = [ffi.LLVMOperandsIterator]
|
|
587
574
|
|
|
575
|
+
ffi.lib.LLVMPY_DisposeIncomingBlocksIter.argtypes = [
|
|
576
|
+
ffi.LLVMIncomingBlocksIterator]
|
|
577
|
+
|
|
588
578
|
ffi.lib.LLVMPY_AttributeListIterNext.argtypes = [ffi.LLVMAttributeListIterator]
|
|
589
579
|
ffi.lib.LLVMPY_AttributeListIterNext.restype = c_void_p
|
|
590
580
|
|
|
@@ -603,6 +593,10 @@ ffi.lib.LLVMPY_InstructionsIterNext.restype = ffi.LLVMValueRef
|
|
|
603
593
|
ffi.lib.LLVMPY_OperandsIterNext.argtypes = [ffi.LLVMOperandsIterator]
|
|
604
594
|
ffi.lib.LLVMPY_OperandsIterNext.restype = ffi.LLVMValueRef
|
|
605
595
|
|
|
596
|
+
ffi.lib.LLVMPY_IncomingBlocksIterNext.argtypes = [
|
|
597
|
+
ffi.LLVMIncomingBlocksIterator]
|
|
598
|
+
ffi.lib.LLVMPY_IncomingBlocksIterNext.restype = ffi.LLVMValueRef
|
|
599
|
+
|
|
606
600
|
ffi.lib.LLVMPY_GetOpcodeName.argtypes = [ffi.LLVMValueRef]
|
|
607
601
|
ffi.lib.LLVMPY_GetOpcodeName.restype = c_void_p
|
|
608
602
|
|
llvmlite/ir/instructions.py
CHANGED
|
@@ -52,8 +52,8 @@ class Instruction(NamedValue, _HasMetadata):
|
|
|
52
52
|
|
|
53
53
|
|
|
54
54
|
class CallInstrAttributes(AttributeSet):
|
|
55
|
-
_known = frozenset(['
|
|
56
|
-
'noinline', 'alwaysinline'])
|
|
55
|
+
_known = frozenset(['convergent', 'noreturn', 'nounwind', 'readonly',
|
|
56
|
+
'readnone', 'noinline', 'alwaysinline'])
|
|
57
57
|
|
|
58
58
|
|
|
59
59
|
TailMarkerOptions = frozenset(['tail', 'musttail', 'notail'])
|
llvmlite/ir/values.py
CHANGED
|
@@ -878,7 +878,7 @@ class AttributeSet(set):
|
|
|
878
878
|
|
|
879
879
|
class FunctionAttributes(AttributeSet):
|
|
880
880
|
_known = frozenset([
|
|
881
|
-
'argmemonly', 'alwaysinline', 'builtin', 'cold',
|
|
881
|
+
'argmemonly', 'alwaysinline', 'builtin', 'cold', 'convergent',
|
|
882
882
|
'inaccessiblememonly', 'inaccessiblemem_or_argmemonly', 'inlinehint',
|
|
883
883
|
'jumptable', 'minsize', 'naked', 'nobuiltin', 'noduplicate',
|
|
884
884
|
'noimplicitfloat', 'noinline', 'nonlazybind', 'norecurse',
|
llvmlite/tests/test_binding.py
CHANGED
|
@@ -41,6 +41,7 @@ asm_sum = r"""
|
|
|
41
41
|
source_filename = "asm_sum.c"
|
|
42
42
|
target triple = "{triple}"
|
|
43
43
|
%struct.glob_type = type {{ i64, [2 x i64]}}
|
|
44
|
+
%struct.glob_type_vec = type {{ i64, <2 x i64>}}
|
|
44
45
|
|
|
45
46
|
@glob = global i32 0
|
|
46
47
|
@glob_b = global i8 0
|
|
@@ -144,6 +145,13 @@ asm_sum_declare = r"""
|
|
|
144
145
|
declare i32 @sum(i32 %.1, i32 %.2)
|
|
145
146
|
"""
|
|
146
147
|
|
|
148
|
+
asm_vararg_declare = r"""
|
|
149
|
+
; ModuleID = '<string>'
|
|
150
|
+
target triple = "{triple}"
|
|
151
|
+
|
|
152
|
+
declare i32 @vararg(i32 %.1, ...)
|
|
153
|
+
"""
|
|
154
|
+
|
|
147
155
|
asm_double_inaccurate = r"""
|
|
148
156
|
; ModuleID = '<string>'
|
|
149
157
|
target triple = "{triple}"
|
|
@@ -494,6 +502,26 @@ entry:
|
|
|
494
502
|
}
|
|
495
503
|
""" # noqa E501
|
|
496
504
|
|
|
505
|
+
asm_phi_blocks = r"""
|
|
506
|
+
; ModuleID = '<string>'
|
|
507
|
+
target triple = "{triple}"
|
|
508
|
+
|
|
509
|
+
define void @foo(i32 %N) {{
|
|
510
|
+
; unnamed block for testing
|
|
511
|
+
%cmp4 = icmp sgt i32 %N, 0
|
|
512
|
+
br i1 %cmp4, label %for.body, label %for.cond.cleanup
|
|
513
|
+
|
|
514
|
+
for.cond.cleanup:
|
|
515
|
+
ret void
|
|
516
|
+
|
|
517
|
+
for.body:
|
|
518
|
+
%i.05 = phi i32 [ %inc, %for.body ], [ 0, %0 ]
|
|
519
|
+
%inc = add nuw nsw i32 %i.05, 1
|
|
520
|
+
%exitcond.not = icmp eq i32 %inc, %N
|
|
521
|
+
br i1 %exitcond.not, label %for.cond.cleanup, label %for.body
|
|
522
|
+
}}
|
|
523
|
+
"""
|
|
524
|
+
|
|
497
525
|
|
|
498
526
|
class BaseTest(TestCase):
|
|
499
527
|
|
|
@@ -547,7 +575,7 @@ class TestDependencies(BaseTest):
|
|
|
547
575
|
out, _ = p.communicate()
|
|
548
576
|
self.assertEqual(0, p.returncode)
|
|
549
577
|
# Parse library dependencies
|
|
550
|
-
lib_pat = re.compile(r'^([
|
|
578
|
+
lib_pat = re.compile(r'^([+-_a-zA-Z0-9]+)\.so(?:\.\d+){0,3}$')
|
|
551
579
|
deps = set()
|
|
552
580
|
for line in out.decode().splitlines():
|
|
553
581
|
parts = line.split()
|
|
@@ -1685,6 +1713,112 @@ class TestValueRef(BaseTest):
|
|
|
1685
1713
|
self.assertTrue(arg.is_constant)
|
|
1686
1714
|
self.assertEqual(arg.get_constant_value(), 'i64* null')
|
|
1687
1715
|
|
|
1716
|
+
def test_incoming_phi_blocks(self):
|
|
1717
|
+
mod = self.module(asm_phi_blocks)
|
|
1718
|
+
func = mod.get_function('foo')
|
|
1719
|
+
blocks = list(func.blocks)
|
|
1720
|
+
instructions = list(blocks[-1].instructions)
|
|
1721
|
+
self.assertTrue(instructions[0].is_instruction)
|
|
1722
|
+
self.assertEqual(instructions[0].opcode, 'phi')
|
|
1723
|
+
|
|
1724
|
+
incoming_blocks = list(instructions[0].incoming_blocks)
|
|
1725
|
+
self.assertEqual(len(incoming_blocks), 2)
|
|
1726
|
+
self.assertTrue(incoming_blocks[0].is_block)
|
|
1727
|
+
self.assertTrue(incoming_blocks[1].is_block)
|
|
1728
|
+
# Test reference to blocks (named or unnamed)
|
|
1729
|
+
self.assertEqual(incoming_blocks[0], blocks[-1])
|
|
1730
|
+
self.assertEqual(incoming_blocks[1], blocks[0])
|
|
1731
|
+
|
|
1732
|
+
# Test case that should fail
|
|
1733
|
+
self.assertNotEqual(instructions[1].opcode, 'phi')
|
|
1734
|
+
with self.assertRaises(ValueError):
|
|
1735
|
+
instructions[1].incoming_blocks
|
|
1736
|
+
|
|
1737
|
+
|
|
1738
|
+
class TestTypeRef(BaseTest):
|
|
1739
|
+
|
|
1740
|
+
def test_str(self):
|
|
1741
|
+
mod = self.module()
|
|
1742
|
+
glob = mod.get_global_variable("glob")
|
|
1743
|
+
self.assertEqual(str(glob.type), "i32*")
|
|
1744
|
+
glob_struct_type = mod.get_struct_type("struct.glob_type")
|
|
1745
|
+
self.assertEqual(str(glob_struct_type),
|
|
1746
|
+
"%struct.glob_type = type { i64, [2 x i64] }")
|
|
1747
|
+
|
|
1748
|
+
elements = list(glob_struct_type.elements)
|
|
1749
|
+
self.assertEqual(len(elements), 2)
|
|
1750
|
+
self.assertEqual(str(elements[0]), "i64")
|
|
1751
|
+
self.assertEqual(str(elements[1]), "[2 x i64]")
|
|
1752
|
+
|
|
1753
|
+
def test_type_kind(self):
|
|
1754
|
+
mod = self.module()
|
|
1755
|
+
glob = mod.get_global_variable("glob")
|
|
1756
|
+
self.assertEqual(glob.type.type_kind, llvm.TypeKind.pointer)
|
|
1757
|
+
self.assertTrue(glob.type.is_pointer)
|
|
1758
|
+
|
|
1759
|
+
glob_struct = mod.get_global_variable("glob_struct")
|
|
1760
|
+
self.assertEqual(glob_struct.type.type_kind, llvm.TypeKind.pointer)
|
|
1761
|
+
self.assertTrue(glob_struct.type.is_pointer)
|
|
1762
|
+
|
|
1763
|
+
stype = next(iter(glob_struct.type.elements))
|
|
1764
|
+
self.assertEqual(stype.type_kind, llvm.TypeKind.struct)
|
|
1765
|
+
self.assertTrue(stype.is_struct)
|
|
1766
|
+
|
|
1767
|
+
stype_a, stype_b = stype.elements
|
|
1768
|
+
self.assertEqual(stype_a.type_kind, llvm.TypeKind.integer)
|
|
1769
|
+
self.assertEqual(stype_b.type_kind, llvm.TypeKind.array)
|
|
1770
|
+
self.assertTrue(stype_b.is_array)
|
|
1771
|
+
|
|
1772
|
+
glob_vec_struct_type = mod.get_struct_type("struct.glob_type_vec")
|
|
1773
|
+
_, vector_type = glob_vec_struct_type.elements
|
|
1774
|
+
self.assertEqual(vector_type.type_kind, llvm.TypeKind.vector)
|
|
1775
|
+
self.assertTrue(vector_type.is_vector)
|
|
1776
|
+
|
|
1777
|
+
funcptr = mod.get_function("sum").type
|
|
1778
|
+
self.assertEqual(funcptr.type_kind, llvm.TypeKind.pointer)
|
|
1779
|
+
functype, = funcptr.elements
|
|
1780
|
+
self.assertEqual(functype.type_kind, llvm.TypeKind.function)
|
|
1781
|
+
|
|
1782
|
+
def test_element_count(self):
|
|
1783
|
+
mod = self.module()
|
|
1784
|
+
glob_struct_type = mod.get_struct_type("struct.glob_type")
|
|
1785
|
+
_, array_type = glob_struct_type.elements
|
|
1786
|
+
self.assertEqual(array_type.element_count, 2)
|
|
1787
|
+
with self.assertRaises(ValueError):
|
|
1788
|
+
glob_struct_type.element_count
|
|
1789
|
+
|
|
1790
|
+
def test_type_width(self):
|
|
1791
|
+
mod = self.module()
|
|
1792
|
+
glob_struct_type = mod.get_struct_type("struct.glob_type")
|
|
1793
|
+
glob_vec_struct_type = mod.get_struct_type("struct.glob_type_vec")
|
|
1794
|
+
integer_type, array_type = glob_struct_type.elements
|
|
1795
|
+
_, vector_type = glob_vec_struct_type.elements
|
|
1796
|
+
self.assertEqual(integer_type.type_width, 64)
|
|
1797
|
+
self.assertEqual(vector_type.type_width, 64 * 2)
|
|
1798
|
+
|
|
1799
|
+
# Structs and arrays are not primitive types
|
|
1800
|
+
self.assertEqual(glob_struct_type.type_width, 0)
|
|
1801
|
+
self.assertEqual(array_type.type_width, 0)
|
|
1802
|
+
|
|
1803
|
+
def test_vararg_function(self):
|
|
1804
|
+
# Variadic function
|
|
1805
|
+
mod = self.module(asm_vararg_declare)
|
|
1806
|
+
func = mod.get_function('vararg')
|
|
1807
|
+
decltype = func.type.element_type
|
|
1808
|
+
self.assertTrue(decltype.is_function_vararg)
|
|
1809
|
+
|
|
1810
|
+
mod = self.module(asm_sum_declare)
|
|
1811
|
+
func = mod.get_function('sum')
|
|
1812
|
+
decltype = func.type.element_type
|
|
1813
|
+
self.assertFalse(decltype.is_function_vararg)
|
|
1814
|
+
|
|
1815
|
+
# test that the function pointer type cannot use is_function_vararg
|
|
1816
|
+
self.assertTrue(func.type.is_pointer)
|
|
1817
|
+
with self.assertRaises(ValueError) as raises:
|
|
1818
|
+
func.type.is_function_vararg
|
|
1819
|
+
self.assertIn("Type i32 (i32, i32)* is not a function",
|
|
1820
|
+
str(raises.exception))
|
|
1821
|
+
|
|
1688
1822
|
|
|
1689
1823
|
class TestTarget(BaseTest):
|
|
1690
1824
|
|
|
@@ -2087,6 +2221,7 @@ class TestPasses(BaseTest, PassManagerTestMixin):
|
|
|
2087
2221
|
pm.add_lint_pass()
|
|
2088
2222
|
pm.add_module_debug_info_pass()
|
|
2089
2223
|
pm.add_refprune_pass()
|
|
2224
|
+
pm.add_instruction_namer_pass()
|
|
2090
2225
|
|
|
2091
2226
|
@unittest.skipUnless(platform.machine().startswith("x86"), "x86 only")
|
|
2092
2227
|
def test_target_library_info_behavior(self):
|
|
@@ -2114,6 +2249,22 @@ class TestPasses(BaseTest, PassManagerTestMixin):
|
|
|
2114
2249
|
self.assertNotIn("call float @llvm.exp2.f32", str(mod))
|
|
2115
2250
|
self.assertIn("call float @ldexpf", str(mod))
|
|
2116
2251
|
|
|
2252
|
+
def test_instruction_namer_pass(self):
|
|
2253
|
+
asm = asm_inlineasm3.format(triple=llvm.get_default_triple())
|
|
2254
|
+
mod = llvm.parse_assembly(asm)
|
|
2255
|
+
|
|
2256
|
+
# Run instnamer pass
|
|
2257
|
+
pm = llvm.ModulePassManager()
|
|
2258
|
+
pm.add_instruction_namer_pass()
|
|
2259
|
+
pm.run(mod)
|
|
2260
|
+
|
|
2261
|
+
# Test that unnamed instructions are now named
|
|
2262
|
+
func = mod.get_function('foo')
|
|
2263
|
+
first_block = next(func.blocks)
|
|
2264
|
+
instructions = list(first_block.instructions)
|
|
2265
|
+
self.assertEqual(instructions[0].name, 'i')
|
|
2266
|
+
self.assertEqual(instructions[1].name, 'i2')
|
|
2267
|
+
|
|
2117
2268
|
|
|
2118
2269
|
class TestDylib(BaseTest):
|
|
2119
2270
|
|
llvmlite/tests/test_ir.py
CHANGED
|
@@ -133,13 +133,15 @@ class TestFunction(TestBase):
|
|
|
133
133
|
func = self.function()
|
|
134
134
|
func.attributes.add("optsize")
|
|
135
135
|
func.attributes.add("alwaysinline")
|
|
136
|
+
func.attributes.add("convergent")
|
|
136
137
|
func.attributes.alignstack = 16
|
|
137
138
|
tp_pers = ir.FunctionType(int8, (), var_arg=True)
|
|
138
139
|
pers = ir.Function(self.module(), tp_pers, '__gxx_personality_v0')
|
|
139
140
|
func.attributes.personality = pers
|
|
140
141
|
asm = self.descr(func).strip()
|
|
141
142
|
self.assertEqual(asm,
|
|
142
|
-
("declare %s alwaysinline optsize
|
|
143
|
+
("declare %s alwaysinline convergent optsize "
|
|
144
|
+
"alignstack(16) "
|
|
143
145
|
"personality i8 (...)* @\"__gxx_personality_v0\"") %
|
|
144
146
|
self.proto)
|
|
145
147
|
# Check pickling
|
|
@@ -1322,6 +1324,7 @@ my_block:
|
|
|
1322
1324
|
builder.call(f, (a, b), 'res_alwaysinline', attrs='alwaysinline')
|
|
1323
1325
|
builder.call(f, (a, b), 'res_noinline_ro', attrs=('noinline',
|
|
1324
1326
|
'readonly'))
|
|
1327
|
+
builder.call(f, (a, b), 'res_convergent', attrs='convergent')
|
|
1325
1328
|
self.check_block(block, """\
|
|
1326
1329
|
my_block:
|
|
1327
1330
|
%"res_f" = call float @"f"(i32 %".1", i32 %".2")
|
|
@@ -1334,6 +1337,7 @@ my_block:
|
|
|
1334
1337
|
%"res_noinline" = call float @"f"(i32 %".1", i32 %".2") noinline
|
|
1335
1338
|
%"res_alwaysinline" = call float @"f"(i32 %".1", i32 %".2") alwaysinline
|
|
1336
1339
|
%"res_noinline_ro" = call float @"f"(i32 %".1", i32 %".2") noinline readonly
|
|
1340
|
+
%"res_convergent" = call float @"f"(i32 %".1", i32 %".2") convergent
|
|
1337
1341
|
""") # noqa E501
|
|
1338
1342
|
|
|
1339
1343
|
def test_call_metadata(self):
|
|
@@ -0,0 +1,225 @@
|
|
|
1
|
+
The llvmlite source tree includes code from LLVM that is governed by the
|
|
2
|
+
following license.
|
|
3
|
+
|
|
4
|
+
==============================================================================
|
|
5
|
+
The Apache License v2.0 with LLVM Exceptions:
|
|
6
|
+
==============================================================================
|
|
7
|
+
|
|
8
|
+
Apache License
|
|
9
|
+
Version 2.0, January 2004
|
|
10
|
+
http://www.apache.org/licenses/
|
|
11
|
+
|
|
12
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
13
|
+
|
|
14
|
+
1. Definitions.
|
|
15
|
+
|
|
16
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
|
17
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
|
18
|
+
|
|
19
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
|
20
|
+
the copyright owner that is granting the License.
|
|
21
|
+
|
|
22
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
|
23
|
+
other entities that control, are controlled by, or are under common
|
|
24
|
+
control with that entity. For the purposes of this definition,
|
|
25
|
+
"control" means (i) the power, direct or indirect, to cause the
|
|
26
|
+
direction or management of such entity, whether by contract or
|
|
27
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
28
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
29
|
+
|
|
30
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
|
31
|
+
exercising permissions granted by this License.
|
|
32
|
+
|
|
33
|
+
"Source" form shall mean the preferred form for making modifications,
|
|
34
|
+
including but not limited to software source code, documentation
|
|
35
|
+
source, and configuration files.
|
|
36
|
+
|
|
37
|
+
"Object" form shall mean any form resulting from mechanical
|
|
38
|
+
transformation or translation of a Source form, including but
|
|
39
|
+
not limited to compiled object code, generated documentation,
|
|
40
|
+
and conversions to other media types.
|
|
41
|
+
|
|
42
|
+
"Work" shall mean the work of authorship, whether in Source or
|
|
43
|
+
Object form, made available under the License, as indicated by a
|
|
44
|
+
copyright notice that is included in or attached to the work
|
|
45
|
+
(an example is provided in the Appendix below).
|
|
46
|
+
|
|
47
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
|
48
|
+
form, that is based on (or derived from) the Work and for which the
|
|
49
|
+
editorial revisions, annotations, elaborations, or other modifications
|
|
50
|
+
represent, as a whole, an original work of authorship. For the purposes
|
|
51
|
+
of this License, Derivative Works shall not include works that remain
|
|
52
|
+
separable from, or merely link (or bind by name) to the interfaces of,
|
|
53
|
+
the Work and Derivative Works thereof.
|
|
54
|
+
|
|
55
|
+
"Contribution" shall mean any work of authorship, including
|
|
56
|
+
the original version of the Work and any modifications or additions
|
|
57
|
+
to that Work or Derivative Works thereof, that is intentionally
|
|
58
|
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
|
59
|
+
or by an individual or Legal Entity authorized to submit on behalf of
|
|
60
|
+
the copyright owner. For the purposes of this definition, "submitted"
|
|
61
|
+
means any form of electronic, verbal, or written communication sent
|
|
62
|
+
to the Licensor or its representatives, including but not limited to
|
|
63
|
+
communication on electronic mailing lists, source code control systems,
|
|
64
|
+
and issue tracking systems that are managed by, or on behalf of, the
|
|
65
|
+
Licensor for the purpose of discussing and improving the Work, but
|
|
66
|
+
excluding communication that is conspicuously marked or otherwise
|
|
67
|
+
designated in writing by the copyright owner as "Not a Contribution."
|
|
68
|
+
|
|
69
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
70
|
+
on behalf of whom a Contribution has been received by Licensor and
|
|
71
|
+
subsequently incorporated within the Work.
|
|
72
|
+
|
|
73
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
74
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
75
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
76
|
+
copyright license to reproduce, prepare Derivative Works of,
|
|
77
|
+
publicly display, publicly perform, sublicense, and distribute the
|
|
78
|
+
Work and such Derivative Works in Source or Object form.
|
|
79
|
+
|
|
80
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
|
81
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
82
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
83
|
+
(except as stated in this section) patent license to make, have made,
|
|
84
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
85
|
+
where such license applies only to those patent claims licensable
|
|
86
|
+
by such Contributor that are necessarily infringed by their
|
|
87
|
+
Contribution(s) alone or by combination of their Contribution(s)
|
|
88
|
+
with the Work to which such Contribution(s) was submitted. If You
|
|
89
|
+
institute patent litigation against any entity (including a
|
|
90
|
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
91
|
+
or a Contribution incorporated within the Work constitutes direct
|
|
92
|
+
or contributory patent infringement, then any patent licenses
|
|
93
|
+
granted to You under this License for that Work shall terminate
|
|
94
|
+
as of the date such litigation is filed.
|
|
95
|
+
|
|
96
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
|
97
|
+
Work or Derivative Works thereof in any medium, with or without
|
|
98
|
+
modifications, and in Source or Object form, provided that You
|
|
99
|
+
meet the following conditions:
|
|
100
|
+
|
|
101
|
+
(a) You must give any other recipients of the Work or
|
|
102
|
+
Derivative Works a copy of this License; and
|
|
103
|
+
|
|
104
|
+
(b) You must cause any modified files to carry prominent notices
|
|
105
|
+
stating that You changed the files; and
|
|
106
|
+
|
|
107
|
+
(c) You must retain, in the Source form of any Derivative Works
|
|
108
|
+
that You distribute, all copyright, patent, trademark, and
|
|
109
|
+
attribution notices from the Source form of the Work,
|
|
110
|
+
excluding those notices that do not pertain to any part of
|
|
111
|
+
the Derivative Works; and
|
|
112
|
+
|
|
113
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
|
114
|
+
distribution, then any Derivative Works that You distribute must
|
|
115
|
+
include a readable copy of the attribution notices contained
|
|
116
|
+
within such NOTICE file, excluding those notices that do not
|
|
117
|
+
pertain to any part of the Derivative Works, in at least one
|
|
118
|
+
of the following places: within a NOTICE text file distributed
|
|
119
|
+
as part of the Derivative Works; within the Source form or
|
|
120
|
+
documentation, if provided along with the Derivative Works; or,
|
|
121
|
+
within a display generated by the Derivative Works, if and
|
|
122
|
+
wherever such third-party notices normally appear. The contents
|
|
123
|
+
of the NOTICE file are for informational purposes only and
|
|
124
|
+
do not modify the License. You may add Your own attribution
|
|
125
|
+
notices within Derivative Works that You distribute, alongside
|
|
126
|
+
or as an addendum to the NOTICE text from the Work, provided
|
|
127
|
+
that such additional attribution notices cannot be construed
|
|
128
|
+
as modifying the License.
|
|
129
|
+
|
|
130
|
+
You may add Your own copyright statement to Your modifications and
|
|
131
|
+
may provide additional or different license terms and conditions
|
|
132
|
+
for use, reproduction, or distribution of Your modifications, or
|
|
133
|
+
for any such Derivative Works as a whole, provided Your use,
|
|
134
|
+
reproduction, and distribution of the Work otherwise complies with
|
|
135
|
+
the conditions stated in this License.
|
|
136
|
+
|
|
137
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
138
|
+
any Contribution intentionally submitted for inclusion in the Work
|
|
139
|
+
by You to the Licensor shall be under the terms and conditions of
|
|
140
|
+
this License, without any additional terms or conditions.
|
|
141
|
+
Notwithstanding the above, nothing herein shall supersede or modify
|
|
142
|
+
the terms of any separate license agreement you may have executed
|
|
143
|
+
with Licensor regarding such Contributions.
|
|
144
|
+
|
|
145
|
+
6. Trademarks. This License does not grant permission to use the trade
|
|
146
|
+
names, trademarks, service marks, or product names of the Licensor,
|
|
147
|
+
except as required for reasonable and customary use in describing the
|
|
148
|
+
origin of the Work and reproducing the content of the NOTICE file.
|
|
149
|
+
|
|
150
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
151
|
+
agreed to in writing, Licensor provides the Work (and each
|
|
152
|
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
153
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
154
|
+
implied, including, without limitation, any warranties or conditions
|
|
155
|
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
156
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
157
|
+
appropriateness of using or redistributing the Work and assume any
|
|
158
|
+
risks associated with Your exercise of permissions under this License.
|
|
159
|
+
|
|
160
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
|
161
|
+
whether in tort (including negligence), contract, or otherwise,
|
|
162
|
+
unless required by applicable law (such as deliberate and grossly
|
|
163
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
|
164
|
+
liable to You for damages, including any direct, indirect, special,
|
|
165
|
+
incidental, or consequential damages of any character arising as a
|
|
166
|
+
result of this License or out of the use or inability to use the
|
|
167
|
+
Work (including but not limited to damages for loss of goodwill,
|
|
168
|
+
work stoppage, computer failure or malfunction, or any and all
|
|
169
|
+
other commercial damages or losses), even if such Contributor
|
|
170
|
+
has been advised of the possibility of such damages.
|
|
171
|
+
|
|
172
|
+
9. Accepting Warranty or Additional Liability. While redistributing
|
|
173
|
+
the Work or Derivative Works thereof, You may choose to offer,
|
|
174
|
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
175
|
+
or other liability obligations and/or rights consistent with this
|
|
176
|
+
License. However, in accepting such obligations, You may act only
|
|
177
|
+
on Your own behalf and on Your sole responsibility, not on behalf
|
|
178
|
+
of any other Contributor, and only if You agree to indemnify,
|
|
179
|
+
defend, and hold each Contributor harmless for any liability
|
|
180
|
+
incurred by, or claims asserted against, such Contributor by reason
|
|
181
|
+
of your accepting any such warranty or additional liability.
|
|
182
|
+
|
|
183
|
+
END OF TERMS AND CONDITIONS
|
|
184
|
+
|
|
185
|
+
APPENDIX: How to apply the Apache License to your work.
|
|
186
|
+
|
|
187
|
+
To apply the Apache License to your work, attach the following
|
|
188
|
+
boilerplate notice, with the fields enclosed by brackets "[]"
|
|
189
|
+
replaced with your own identifying information. (Don't include
|
|
190
|
+
the brackets!) The text should be enclosed in the appropriate
|
|
191
|
+
comment syntax for the file format. We also recommend that a
|
|
192
|
+
file or class name and description of purpose be included on the
|
|
193
|
+
same "printed page" as the copyright notice for easier
|
|
194
|
+
identification within third-party archives.
|
|
195
|
+
|
|
196
|
+
Copyright [yyyy] [name of copyright owner]
|
|
197
|
+
|
|
198
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
199
|
+
you may not use this file except in compliance with the License.
|
|
200
|
+
You may obtain a copy of the License at
|
|
201
|
+
|
|
202
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
203
|
+
|
|
204
|
+
Unless required by applicable law or agreed to in writing, software
|
|
205
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
206
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
207
|
+
See the License for the specific language governing permissions and
|
|
208
|
+
limitations under the License.
|
|
209
|
+
|
|
210
|
+
|
|
211
|
+
---- LLVM Exceptions to the Apache 2.0 License ----
|
|
212
|
+
|
|
213
|
+
As an exception, if, as a result of your compiling your source code, portions
|
|
214
|
+
of this Software are embedded into an Object form of such source code, you
|
|
215
|
+
may redistribute such embedded portions in such Object form without complying
|
|
216
|
+
with the conditions of Sections 4(a), 4(b) and 4(d) of the License.
|
|
217
|
+
|
|
218
|
+
In addition, if you combine or link compiled forms of this Software with
|
|
219
|
+
software that is licensed under the GPLv2 ("Combined Software") and if a
|
|
220
|
+
court of competent jurisdiction determines that the patent provision (Section
|
|
221
|
+
3), the indemnity provision (Section 9) or other Section of the License
|
|
222
|
+
conflicts with the conditions of the GPLv2, you may retroactively and
|
|
223
|
+
prospectively choose to deem waived or otherwise exclude such Section(s) of
|
|
224
|
+
the License, but only in their entirety and only with respect to the Combined
|
|
225
|
+
Software.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: llvmlite
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.42.0
|
|
4
4
|
Summary: lightweight wrapper around basic LLVM functionality
|
|
5
5
|
Home-page: http://llvmlite.readthedocs.io
|
|
6
6
|
License: BSD
|
|
@@ -10,14 +10,15 @@ Classifier: Intended Audience :: Developers
|
|
|
10
10
|
Classifier: Operating System :: OS Independent
|
|
11
11
|
Classifier: Programming Language :: Python
|
|
12
12
|
Classifier: Programming Language :: Python :: 3
|
|
13
|
-
Classifier: Programming Language :: Python :: 3.8
|
|
14
13
|
Classifier: Programming Language :: Python :: 3.9
|
|
15
14
|
Classifier: Programming Language :: Python :: 3.10
|
|
16
15
|
Classifier: Programming Language :: Python :: 3.11
|
|
16
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
17
17
|
Classifier: Topic :: Software Development :: Code Generators
|
|
18
18
|
Classifier: Topic :: Software Development :: Compilers
|
|
19
|
-
Requires-Python: >=3.
|
|
19
|
+
Requires-Python: >=3.9
|
|
20
20
|
License-File: LICENSE
|
|
21
|
+
License-File: LICENSE.thirdparty
|
|
21
22
|
|
|
22
23
|
========
|
|
23
24
|
llvmlite
|
|
@@ -78,8 +79,8 @@ Key Benefits
|
|
|
78
79
|
Compatibility
|
|
79
80
|
=============
|
|
80
81
|
|
|
81
|
-
llvmlite
|
|
82
|
-
|
|
82
|
+
llvmlite has been tested with Python 3.9 -- 3.12 and is likely to work with
|
|
83
|
+
greater versions.
|
|
83
84
|
|
|
84
85
|
As of version 0.41.0, llvmlite requires LLVM 14.x.x on all architectures
|
|
85
86
|
|
|
@@ -1,43 +1,45 @@
|
|
|
1
|
-
llvmlite/_version.py,sha256=
|
|
1
|
+
llvmlite/_version.py,sha256=mrP_SVZnRr17yNMSPH6Pekgh9lG7Rzxay6eRNk2ThxI,418
|
|
2
2
|
llvmlite/utils.py,sha256=BwgrA2JaYaZiHRafshoZBHiYSBskJQMG_K2F2jbW2-w,695
|
|
3
3
|
llvmlite/__init__.py,sha256=PiUSiFLCm0YX5rbHS4xOLGdqdPDC8j3etV3nmEaelzI,92
|
|
4
4
|
llvmlite/tests/refprune_proto.py,sha256=I5g0jWHYlsLCOX3Ct9-fA5_udLfkipzuBAsEkrNsFIk,8677
|
|
5
5
|
llvmlite/tests/customize.py,sha256=85Af1gyZ5rtXXI3qpeTc2DXMrgETjv7hrLN-73A7Fhg,13268
|
|
6
6
|
llvmlite/tests/__main__.py,sha256=10_On1rLj4CX1xsBJ9TbjULvNSp_K0qk9U1N6azUTUw,40
|
|
7
7
|
llvmlite/tests/test_valuerepr.py,sha256=57MaGznJUnqCf0etajnOCoBRue5-nmFTx1bds_5atlE,1989
|
|
8
|
-
llvmlite/tests/test_ir.py,sha256=
|
|
9
|
-
llvmlite/tests/test_binding.py,sha256=
|
|
8
|
+
llvmlite/tests/test_ir.py,sha256=BdNnJwSzNdG3AsBF_v0xe7MTZMN36NbhrAYSV0mHUQk,105705
|
|
9
|
+
llvmlite/tests/test_binding.py,sha256=ny9nbYoxSvo_b-6ZpwpN7dRU1iWObwqA0FI5mUCk1Kk,86468
|
|
10
10
|
llvmlite/tests/__init__.py,sha256=TBHEOsEq-9M9rF94nES2HxefA-7GYwNE00Y7gTkHrD8,1378
|
|
11
11
|
llvmlite/tests/test_refprune.py,sha256=oyk3HBLCOMPyRG-bj-omO3Ec_1lI66S8iNgZwl81Zs0,14235
|
|
12
|
-
llvmlite/ir/values.py,sha256=
|
|
12
|
+
llvmlite/ir/values.py,sha256=XDUlrvVin0gWkDpaXd593S-oXaARbTnLq69bMALRsbI,34001
|
|
13
13
|
llvmlite/ir/_utils.py,sha256=mkpyEMlQ9nHMcWmBMBsJm4S16Y0BfvxBf5brsdMmKio,2001
|
|
14
14
|
llvmlite/ir/transforms.py,sha256=pV79pB20m4N_HLmBEksw5VVP8cxyf7AYGDCbS1E7fOQ,1552
|
|
15
15
|
llvmlite/ir/module.py,sha256=pfpAh-73WMLptKqwgARwZ7aLMHpm88AcJA2GPfGvyVM,9074
|
|
16
16
|
llvmlite/ir/__init__.py,sha256=rNPtrPLshsPJYO4GegWAU-rpbpiYo0xU-CQb3rt0JtE,258
|
|
17
17
|
llvmlite/ir/builder.py,sha256=t6ZCvkwXd1jmb-CGoTW12kLOSTnwjfS_eY9JJs6ij3g,33479
|
|
18
18
|
llvmlite/ir/context.py,sha256=npgEbox0MzChmH7nfHpTdSsN_G4zU-XrpGx5AIYwafk,518
|
|
19
|
-
llvmlite/ir/instructions.py,sha256=
|
|
19
|
+
llvmlite/ir/instructions.py,sha256=_fpnCyItoGgPJHhcuCrVxwkDEz4O9a_45thxcnBcDuQ,31767
|
|
20
20
|
llvmlite/ir/types.py,sha256=2GX-PIx_jDvt4GIfHkqiEkrJI_gPQqSktOsku2UZTgQ,16149
|
|
21
21
|
llvmlite/binding/object_file.py,sha256=qZMTAi6gcVQq2e3KghHNxVH3Ivzr7zxDPecfiZ1Riy8,2664
|
|
22
22
|
llvmlite/binding/orcjit.py,sha256=HUWDKicxrYK5s2trdrM_KEmkfvwifrP4E9MxmCb8JSM,11856
|
|
23
23
|
llvmlite/binding/common.py,sha256=eCSnnY4sctgeqVwDv9PrH6jpMI45nJPmAz4rfjbPsf8,742
|
|
24
|
-
llvmlite/binding/ffi.py,sha256=
|
|
25
|
-
llvmlite/binding/executionengine.py,sha256=
|
|
24
|
+
llvmlite/binding/ffi.py,sha256=sbN4vwClbgpnJHn4-ec2z8gmdCC95_TM3s6kjk6NXp4,12088
|
|
25
|
+
llvmlite/binding/executionengine.py,sha256=PgUFCVJdGvrxXCZAevMv8nUAL8n29Xm58FYO1XYLafc,11022
|
|
26
26
|
llvmlite/binding/transforms.py,sha256=C_Tp0XPV__aOHaVzLLL_QFa-yI9vkDx1gwZADk_KwG8,4947
|
|
27
|
-
llvmlite/binding/libllvmlite.so,sha256=
|
|
27
|
+
llvmlite/binding/libllvmlite.so,sha256=ioQTw3z8hzpRL9ee1BcYcd2ABqnyGuJbLjNqeyyKk40,131935840
|
|
28
|
+
llvmlite/binding/typeref.py,sha256=T_ZQfvjTdLtARDci2wVuRfnalgEt9Oc2qb7ZUiiTFJ4,5534
|
|
28
29
|
llvmlite/binding/linker.py,sha256=M4bAkoxVAUgxqai5S0_iCHS5EcNRPBX_9zldVqFLV90,489
|
|
29
30
|
llvmlite/binding/analysis.py,sha256=BbCcAAGY0GLAEUek6ZogHkBAmFA9kvpS7333XyIrbhc,2253
|
|
30
31
|
llvmlite/binding/initfini.py,sha256=zF9tJXmCONabkP0d_IqmiU6M_Wn8N8ArkwfXBxf1TDo,1595
|
|
31
32
|
llvmlite/binding/dylib.py,sha256=ypfikOYKiWQZi8h00LhLBXwmPlJ5d86yLOUn01pDjmM,1300
|
|
32
33
|
llvmlite/binding/module.py,sha256=Zf9GcuCEFf1xtOmP-jXqKtJbj4dO8l9a2NEPKTwsimI,11174
|
|
33
|
-
llvmlite/binding/__init__.py,sha256=
|
|
34
|
-
llvmlite/binding/value.py,sha256=
|
|
34
|
+
llvmlite/binding/__init__.py,sha256=LhAuO8C49hrQ7G2YqcjT8Udkus4ETI1N3zey9Qqt7Jo,405
|
|
35
|
+
llvmlite/binding/value.py,sha256=WGzbTt4bi42WHlOm-wrDkzIpLIV-EYiJU2ExwjeqmfE,18956
|
|
35
36
|
llvmlite/binding/targets.py,sha256=5nxDn73pK_ElQu86EU994Qcd-k5Ja2U127T_oLrW_kk,14802
|
|
36
|
-
llvmlite/binding/passmanagers.py,sha256=
|
|
37
|
+
llvmlite/binding/passmanagers.py,sha256=EW_DJdG54jOHhaUofowAbar2Rvyi7knV6MRWkox6pTg,34769
|
|
37
38
|
llvmlite/binding/context.py,sha256=l2vdKsJ038PfSKzaU17FCSDYWtByzIFYREmx93JwKW8,657
|
|
38
39
|
llvmlite/binding/options.py,sha256=aDH4SFh6VZ11agtUJO9vAxhVhQkIGAByK9IHKeuRcAI,509
|
|
39
|
-
llvmlite-0.
|
|
40
|
-
llvmlite-0.
|
|
41
|
-
llvmlite-0.
|
|
42
|
-
llvmlite-0.
|
|
43
|
-
llvmlite-0.
|
|
40
|
+
llvmlite-0.42.0.dist-info/LICENSE.thirdparty,sha256=3FJyk8_C5LTVkELgsgRmcWKEXYVIZRky9anS9K38kos,12561
|
|
41
|
+
llvmlite-0.42.0.dist-info/top_level.txt,sha256=WJi8Gq92jA2wv_aV1Oshp9iZ-zMa43Kcmw80kWeGYGA,9
|
|
42
|
+
llvmlite-0.42.0.dist-info/RECORD,,
|
|
43
|
+
llvmlite-0.42.0.dist-info/LICENSE,sha256=S5pyZLAROnsybuhPwkS3OZG1NbSDPkpW1YdQ8qciUNw,1298
|
|
44
|
+
llvmlite-0.42.0.dist-info/METADATA,sha256=KRN67iICEYpA5na5Vcxr2DeVZA_SbFEyfqllxsNxDNI,4785
|
|
45
|
+
llvmlite-0.42.0.dist-info/WHEEL,sha256=7-IJbjbL0nWUFP_cSrTULDrfI4l8JN0GBqGHPqza7ao,154
|
|
File without changes
|
|
File without changes
|