ruby-llvm 18.1.7 → 18.2.0
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.
- checksums.yaml +4 -4
- data/ext/ruby-llvm-support/Rakefile +0 -1
- data/lib/llvm/config.rb +6 -5
- data/lib/llvm/core/attribute.rb +0 -4
- data/lib/llvm/core/builder.rb +89 -27
- data/lib/llvm/core/module.rb +1 -2
- data/lib/llvm/core/type.rb +150 -13
- data/lib/llvm/core/value.rb +218 -152
- data/lib/llvm/core.rb +2 -199
- data/lib/llvm/core_ffi.rb +0 -117
- data/lib/llvm/core_ffi_v2.rb +353 -0
- data/lib/llvm/execution_engine.rb +1 -1
- data/lib/llvm/lljit.rb +0 -1
- data/lib/llvm/{transforms/pass_builder.rb → pass_builder.rb} +48 -17
- data/lib/llvm/support.rb +0 -1
- data/lib/llvm/target_ffi.rb +0 -1
- data/lib/llvm/transforms/ipo.rb +0 -1
- data/lib/llvm/transforms/scalar.rb +0 -1
- data/lib/llvm/transforms/utils.rb +0 -1
- data/lib/llvm/version.rb +2 -2
- metadata +18 -3
|
@@ -0,0 +1,353 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module LLVM
|
|
4
|
+
# @private
|
|
5
|
+
module C
|
|
6
|
+
attach_function :dispose_message, :LLVMDisposeMessage, [:pointer], :void
|
|
7
|
+
|
|
8
|
+
# typedef unsigned LLVMAttributeIndex;
|
|
9
|
+
typedef(:uint, :llvmattributeindex)
|
|
10
|
+
|
|
11
|
+
# void LLVMAddAttributeAtIndex
|
|
12
|
+
# (LLVMValueRef F, LLVMAttributeIndex Idx, LLVMAttributeRef A);
|
|
13
|
+
attach_function :add_attribute_at_index, :LLVMAddAttributeAtIndex, [:pointer, :llvmattributeindex, :pointer], :void
|
|
14
|
+
|
|
15
|
+
# void LLVMRemoveEnumAttributeAtIndex
|
|
16
|
+
# (LLVMValueRef F, LLVMAttributeIndex Idx, unsigned KindID);
|
|
17
|
+
attach_function :remove_enum_attribute_at_index, :LLVMRemoveEnumAttributeAtIndex, [:pointer, :llvmattributeindex, :uint], :void
|
|
18
|
+
|
|
19
|
+
# LLVMAttributeRef LLVMCreateEnumAttribute
|
|
20
|
+
# (LLVMContextRef C, unsigned KindID, uint64_t Val);
|
|
21
|
+
attach_function :create_enum_attribute, :LLVMCreateEnumAttribute, [:pointer, :uint, :uint64], :pointer
|
|
22
|
+
|
|
23
|
+
# LLVMAttributeRef LLVMCreateStringAttribute(LLVMContextRef C,
|
|
24
|
+
# const char *K, unsigned KLength,
|
|
25
|
+
# const char *V, unsigned VLength);
|
|
26
|
+
attach_function :create_string_attribute, :LLVMCreateStringAttribute, [:pointer, :string, :uint, :string, :uint], :pointer
|
|
27
|
+
|
|
28
|
+
# unsigned LLVMGetEnumAttributeKindForName
|
|
29
|
+
# (const char *Name, size_t SLen);
|
|
30
|
+
attach_function :get_enum_attribute_kind_for_name, :LLVMGetEnumAttributeKindForName, [:pointer, :size_t], :uint
|
|
31
|
+
|
|
32
|
+
attach_function :get_last_enum_attribute_kind, :LLVMGetLastEnumAttributeKind, [], :uint
|
|
33
|
+
|
|
34
|
+
# unsigned LLVMGetAttributeCountAtIndex
|
|
35
|
+
# (LLVMValueRef F, LLVMAttributeIndex Idx);
|
|
36
|
+
attach_function :get_attribute_count_at_index, :LLVMGetAttributeCountAtIndex, [:pointer, :llvmattributeindex], :uint
|
|
37
|
+
|
|
38
|
+
# void LLVMGetAttributesAtIndex
|
|
39
|
+
# (LLVMValueRef F, LLVMAttributeIndex Idx, LLVMAttributeRef *Attrs);
|
|
40
|
+
attach_function :get_attributes_at_index, :LLVMGetAttributesAtIndex, [:pointer, :llvmattributeindex, :pointer], :void
|
|
41
|
+
|
|
42
|
+
# unsigned LLVMGetEnumAttributeKind
|
|
43
|
+
# (LLVMAttributeRef A);
|
|
44
|
+
attach_function :get_enum_attribute_kind, :LLVMGetEnumAttributeKind, [:pointer], :uint
|
|
45
|
+
|
|
46
|
+
# uint64_t LLVMGetEnumAttributeValue
|
|
47
|
+
# (LLVMAttributeRef A);
|
|
48
|
+
attach_function :get_enum_attribute_value, :LLVMGetEnumAttributeValue, [:pointer], :uint64
|
|
49
|
+
|
|
50
|
+
# const char *LLVMGetStringAttributeKind
|
|
51
|
+
# (LLVMAttributeRef A, unsigned *Length);
|
|
52
|
+
attach_function :get_string_attribute_kind, :LLVMGetStringAttributeKind, [:pointer, :pointer], :string
|
|
53
|
+
|
|
54
|
+
# const char *LLVMGetStringAttributeValue
|
|
55
|
+
# (LLVMAttributeRef A, unsigned *Length);
|
|
56
|
+
attach_function :get_string_attribute_value, :LLVMGetStringAttributeValue, [:pointer, :pointer], :string
|
|
57
|
+
|
|
58
|
+
attach_function :is_enum_attribute, :LLVMIsEnumAttribute, [:pointer], :bool
|
|
59
|
+
attach_function :is_string_attribute, :LLVMIsStringAttribute, [:pointer], :bool
|
|
60
|
+
attach_function :is_type_attribute, :LLVMIsTypeAttribute, [:pointer], :bool
|
|
61
|
+
|
|
62
|
+
# LLVMValueRef LLVMBuildLoad2(LLVMBuilderRef, LLVMTypeRef Ty, LLVMValueRef PointerVal, const char *Name);
|
|
63
|
+
attach_function :build_load2, :LLVMBuildLoad2, [:pointer, :pointer, :pointer, :string], :pointer
|
|
64
|
+
|
|
65
|
+
# LLVMValueRef LLVMBuildGEP2(LLVMBuilderRef B, LLVMTypeRef Ty,
|
|
66
|
+
# LLVMValueRef Pointer, LLVMValueRef *Indices,
|
|
67
|
+
# unsigned NumIndices, const char *Name);
|
|
68
|
+
attach_function :build_gep2, :LLVMBuildGEP2, [:pointer, :pointer, :pointer, :pointer, :uint, :string], :pointer
|
|
69
|
+
|
|
70
|
+
# LLVMValueRef LLVMBuildInBoundsGEP2(LLVMBuilderRef B, LLVMTypeRef Ty,
|
|
71
|
+
# LLVMValueRef Pointer, LLVMValueRef *Indices,
|
|
72
|
+
# unsigned NumIndices, const char *Name);
|
|
73
|
+
attach_function :build_inbounds_gep2, :LLVMBuildInBoundsGEP2, [:pointer, :pointer, :pointer, :pointer, :uint, :string], :pointer
|
|
74
|
+
|
|
75
|
+
# LLVMValueRef LLVMBuildStructGEP2(LLVMBuilderRef B, LLVMTypeRef Ty,
|
|
76
|
+
# LLVMValueRef Pointer, unsigned Idx,
|
|
77
|
+
# const char *Name);
|
|
78
|
+
attach_function :build_struct_gep2, :LLVMBuildStructGEP2, [:pointer, :pointer, :pointer, :uint, :string], :pointer
|
|
79
|
+
|
|
80
|
+
# LLVMValueRef LLVMBuildCall2(LLVMBuilderRef, LLVMTypeRef, LLVMValueRef Fn,
|
|
81
|
+
# LLVMValueRef *Args, unsigned NumArgs,
|
|
82
|
+
# const char *Name);
|
|
83
|
+
attach_function :build_call2, :LLVMBuildCall2, [:pointer, :pointer, :pointer, :pointer, :uint, :string], :pointer
|
|
84
|
+
|
|
85
|
+
# LLVMValueRef LLVMBuildInvoke2(LLVMBuilderRef, LLVMTypeRef Ty, LLVMValueRef Fn,
|
|
86
|
+
# LLVMValueRef *Args, unsigned NumArgs,
|
|
87
|
+
# LLVMBasicBlockRef Then, LLVMBasicBlockRef Catch,
|
|
88
|
+
# const char *Name);
|
|
89
|
+
attach_function :build_invoke2, :LLVMBuildInvoke2, [:pointer, :pointer, :pointer, :pointer, :uint, :pointer, :pointer, :string], :pointer
|
|
90
|
+
|
|
91
|
+
# LLVMValueRef LLVMBuildPtrDiff2(LLVMBuilderRef, LLVMTypeRef ElemTy,
|
|
92
|
+
# LLVMValueRef LHS, LLVMValueRef RHS,
|
|
93
|
+
# const char *Name);
|
|
94
|
+
attach_function :build_ptr_diff2, :LLVMBuildPtrDiff2, [:pointer, :pointer, :pointer, :pointer, :string], :pointer
|
|
95
|
+
|
|
96
|
+
# LLVMTypeRef LLVMGlobalGetValueType(LLVMValueRef Global);
|
|
97
|
+
attach_function :global_get_value_type, :LLVMGlobalGetValueType, [:pointer], :pointer
|
|
98
|
+
|
|
99
|
+
# LLVMTypeRef LLVMGetGEPSourceElementType(LLVMValueRef GEP);
|
|
100
|
+
attach_function :get_gep_source_element_type, :LLVMGetGEPSourceElementType, [:pointer], :pointer
|
|
101
|
+
|
|
102
|
+
# (Not documented)
|
|
103
|
+
#
|
|
104
|
+
# @method x86amx_type()
|
|
105
|
+
# @return [FFI::Pointer(TypeRef)]
|
|
106
|
+
# @scope class
|
|
107
|
+
attach_function :x86amx_type, :LLVMX86AMXType, [], :pointer
|
|
108
|
+
|
|
109
|
+
# LLVMTypeRef LLVMGetAllocatedType(LLVMValueRef Alloca);
|
|
110
|
+
attach_function :get_allocated_type, :LLVMGetAllocatedType, [:pointer], :pointer
|
|
111
|
+
|
|
112
|
+
# LLVMTypeRef LLVMGlobalGetValueType(LLVMValueRef Global);
|
|
113
|
+
attach_function :get_value_type, :LLVMGlobalGetValueType, [:pointer], :pointer
|
|
114
|
+
|
|
115
|
+
# LLVMValueRef LLVMGetAggregateElement(LLVMValueRef C, unsigned Idx);
|
|
116
|
+
attach_function :get_aggregate_element, :LLVMGetAggregateElement, [:pointer, :int], :pointer
|
|
117
|
+
|
|
118
|
+
attach_function :get_type_by_name2, :LLVMGetTypeByName2, [:pointer, :string], :pointer
|
|
119
|
+
|
|
120
|
+
# Determine whether a structure is packed.
|
|
121
|
+
#
|
|
122
|
+
# @see llvm::StructType::isPacked()
|
|
123
|
+
#
|
|
124
|
+
# @method is_packed_struct(struct_ty)
|
|
125
|
+
# @param [FFI::Pointer(TypeRef)] struct_ty
|
|
126
|
+
# @return [Bool]
|
|
127
|
+
# @scope class
|
|
128
|
+
attach_function :is_packed_struct, :LLVMIsPackedStruct, [:pointer], :bool
|
|
129
|
+
|
|
130
|
+
# Determine whether a structure is opaque.
|
|
131
|
+
#
|
|
132
|
+
# @see llvm::StructType::isOpaque()
|
|
133
|
+
#
|
|
134
|
+
# @method is_opaque_struct(struct_ty)
|
|
135
|
+
# @param [FFI::Pointer(TypeRef)] struct_ty
|
|
136
|
+
# @return [Bool]
|
|
137
|
+
# @scope class
|
|
138
|
+
attach_function :is_opaque_struct, :LLVMIsOpaqueStruct, [:pointer], :bool
|
|
139
|
+
|
|
140
|
+
# Determine whether a structure is literal.
|
|
141
|
+
#
|
|
142
|
+
# @see llvm::StructType::isLiteral()
|
|
143
|
+
#
|
|
144
|
+
# @method is_literal_struct(struct_ty)
|
|
145
|
+
# @param [FFI::Pointer(TypeRef)] struct_ty
|
|
146
|
+
# @return [Bool]
|
|
147
|
+
# @scope class
|
|
148
|
+
attach_function :is_literal_struct, :LLVMIsLiteralStruct, [:pointer], :bool
|
|
149
|
+
|
|
150
|
+
# /**
|
|
151
|
+
# * Read LLVM IR from a memory buffer and convert it into an in-memory Module
|
|
152
|
+
# * object. Returns 0 on success.
|
|
153
|
+
# * Optionally returns a human-readable description of any errors that
|
|
154
|
+
# * occurred during parsing IR. OutMessage must be disposed with
|
|
155
|
+
# * LLVMDisposeMessage.
|
|
156
|
+
# *
|
|
157
|
+
# * @see llvm::ParseIR()
|
|
158
|
+
# */
|
|
159
|
+
# LLVMBool LLVMParseIRInContext(LLVMContextRef ContextRef,
|
|
160
|
+
# LLVMMemoryBufferRef MemBuf, LLVMModuleRef *OutM,
|
|
161
|
+
# char **OutMessage);
|
|
162
|
+
attach_function :parse_ir_in_context, :LLVMParseIRInContext, [:pointer, :pointer, :pointer, :pointer], :bool
|
|
163
|
+
|
|
164
|
+
enum :value_kind, [
|
|
165
|
+
:argument, 0,
|
|
166
|
+
:basic_block, 1,
|
|
167
|
+
:memory_use, 2,
|
|
168
|
+
:memory_def, 3,
|
|
169
|
+
:memory_phi, 4,
|
|
170
|
+
:function, 5,
|
|
171
|
+
:global_alias, 6,
|
|
172
|
+
:global_ifunc, 7,
|
|
173
|
+
:global_variable, 8,
|
|
174
|
+
:block_address, 9,
|
|
175
|
+
:const_expr, 10,
|
|
176
|
+
:const_array, 11,
|
|
177
|
+
:const_struct, 12,
|
|
178
|
+
:const_vector, 13,
|
|
179
|
+
:undef, 14,
|
|
180
|
+
:const_aggregregate_zero, 15,
|
|
181
|
+
:const_data_array, 16,
|
|
182
|
+
:const_data_vector, 17,
|
|
183
|
+
:const_int, 18,
|
|
184
|
+
:const_fp, 19,
|
|
185
|
+
:const_null, 20,
|
|
186
|
+
:const_none, 21,
|
|
187
|
+
:metadata, 22,
|
|
188
|
+
:inline_asm, 23,
|
|
189
|
+
:instruction, 24,
|
|
190
|
+
:poison, 25,
|
|
191
|
+
]
|
|
192
|
+
|
|
193
|
+
# /**
|
|
194
|
+
# * Obtain the enumerated type of a Value instance.
|
|
195
|
+
# *
|
|
196
|
+
# * @see llvm::Value::getValueID()
|
|
197
|
+
# */
|
|
198
|
+
attach_function :get_value_kind, :LLVMGetValueKind, [:pointer], :value_kind
|
|
199
|
+
|
|
200
|
+
attach_function :get_poison, :LLVMGetPoison, [:pointer], :pointer
|
|
201
|
+
|
|
202
|
+
attach_function :const_int_get_sext_value, :LLVMConstIntGetSExtValue, [:pointer], :long_long
|
|
203
|
+
|
|
204
|
+
attach_function :const_int_get_zext_value, :LLVMConstIntGetZExtValue, [:pointer], :ulong_long
|
|
205
|
+
|
|
206
|
+
# (Not documented)
|
|
207
|
+
#
|
|
208
|
+
# <em>This entry is only for documentation and no real method. The FFI::Enum can be accessed via #enum_type(:atomic_rmw_bin_op).</em>
|
|
209
|
+
#
|
|
210
|
+
# === Options:
|
|
211
|
+
# :xchg ::
|
|
212
|
+
#
|
|
213
|
+
# :add ::
|
|
214
|
+
# < Set the new value and return the one old
|
|
215
|
+
# :sub ::
|
|
216
|
+
# < Add a value and return the old one
|
|
217
|
+
# :and_ ::
|
|
218
|
+
# < Subtract a value and return the old one
|
|
219
|
+
# :nand ::
|
|
220
|
+
# < And a value and return the old one
|
|
221
|
+
# :or_ ::
|
|
222
|
+
# < Not-And a value and return the old one
|
|
223
|
+
# :xor ::
|
|
224
|
+
# < OR a value and return the old one
|
|
225
|
+
# :max ::
|
|
226
|
+
# < Xor a value and return the old one
|
|
227
|
+
# :min ::
|
|
228
|
+
# < Sets the value if it's greater than the
|
|
229
|
+
# original using a signed comparison and return
|
|
230
|
+
# the old one
|
|
231
|
+
# :u_max ::
|
|
232
|
+
# < Sets the value if it's Smaller than the
|
|
233
|
+
# original using a signed comparison and return
|
|
234
|
+
# the old one
|
|
235
|
+
# :u_min ::
|
|
236
|
+
# < Sets the value if it's greater than the
|
|
237
|
+
# original using an unsigned comparison and return
|
|
238
|
+
# the old one
|
|
239
|
+
#
|
|
240
|
+
# @method _enum_atomic_rmw_bin_op_
|
|
241
|
+
# @return [Symbol]
|
|
242
|
+
# @scope class
|
|
243
|
+
enum :atomic_rmw_bin_op, [
|
|
244
|
+
:xchg,
|
|
245
|
+
:add,
|
|
246
|
+
:sub,
|
|
247
|
+
:and,
|
|
248
|
+
:nand,
|
|
249
|
+
:or,
|
|
250
|
+
:xor,
|
|
251
|
+
:max,
|
|
252
|
+
:min,
|
|
253
|
+
:umax,
|
|
254
|
+
:umin,
|
|
255
|
+
:fadd,
|
|
256
|
+
:fsub,
|
|
257
|
+
:fmax,
|
|
258
|
+
:fmin,
|
|
259
|
+
:uincwrap,
|
|
260
|
+
:udecwrap,
|
|
261
|
+
]
|
|
262
|
+
|
|
263
|
+
# (Not documented)
|
|
264
|
+
#
|
|
265
|
+
# @method build_atomic_rmw(b, op, ptr, val, ordering, single_thread)
|
|
266
|
+
# @param [FFI::Pointer(BuilderRef)] b
|
|
267
|
+
# @param [Symbol from _enum_atomic_rmw_bin_op_] op
|
|
268
|
+
# @param [FFI::Pointer(ValueRef)] ptr
|
|
269
|
+
# @param [FFI::Pointer(ValueRef)] val
|
|
270
|
+
# @param [Symbol from _enum_atomic_ordering_] ordering
|
|
271
|
+
# @param [Integer] single_thread
|
|
272
|
+
# @return [FFI::Pointer(ValueRef)]
|
|
273
|
+
# @scope class
|
|
274
|
+
attach_function :build_atomic_rmw, :LLVMBuildAtomicRMW, [:pointer, :atomic_rmw_bin_op, :pointer, :pointer, :atomic_ordering, :int], :pointer
|
|
275
|
+
|
|
276
|
+
# Create a ConstantDataSequential and initialize it with a string.
|
|
277
|
+
#
|
|
278
|
+
# @see llvm::ConstantDataArray::getString()
|
|
279
|
+
#
|
|
280
|
+
# @method const_string_in_context(c, str, length, dont_null_terminate)
|
|
281
|
+
# @param [FFI::Pointer(ContextRef)] c
|
|
282
|
+
# @param [String] str
|
|
283
|
+
# @param [Integer] length
|
|
284
|
+
# @param [Integer] dont_null_terminate
|
|
285
|
+
# @return [FFI::Pointer(ValueRef)]
|
|
286
|
+
# @scope class
|
|
287
|
+
attach_function :const_string_in_context, :LLVMConstStringInContext, [:pointer, :string, :size_t, :int], :pointer
|
|
288
|
+
|
|
289
|
+
# Determine whether the specified constant instance is constant.
|
|
290
|
+
#
|
|
291
|
+
# @method is_constant(val)
|
|
292
|
+
# @param [FFI::Pointer(ValueRef)] val
|
|
293
|
+
# @return [Integer]
|
|
294
|
+
# @scope class
|
|
295
|
+
attach_function :is_constant, :LLVMIsConstant, [:pointer], :bool
|
|
296
|
+
|
|
297
|
+
# Determine whether a value instance is undefined.
|
|
298
|
+
#
|
|
299
|
+
# @method is_undef(val)
|
|
300
|
+
# @param [FFI::Pointer(ValueRef)] val
|
|
301
|
+
# @return [Integer]
|
|
302
|
+
# @scope class
|
|
303
|
+
attach_function :is_undef, :LLVMIsUndef, [:pointer], :bool
|
|
304
|
+
|
|
305
|
+
# Determine whether a value instance is null.
|
|
306
|
+
#
|
|
307
|
+
# @see llvm::Constant::isNullValue()
|
|
308
|
+
#
|
|
309
|
+
# @method is_null(val)
|
|
310
|
+
# @param [FFI::Pointer(ValueRef)] val
|
|
311
|
+
# @return [Integer]
|
|
312
|
+
# @scope class
|
|
313
|
+
attach_function :is_null, :LLVMIsNull, [:pointer], :bool
|
|
314
|
+
|
|
315
|
+
attach_function :is_poison, :LLVMIsPoison, [:pointer], :bool
|
|
316
|
+
|
|
317
|
+
# (Not documented)
|
|
318
|
+
#
|
|
319
|
+
# @method is_thread_local(global_var)
|
|
320
|
+
# @param [FFI::Pointer(ValueRef)] global_var
|
|
321
|
+
# @return [Integer]
|
|
322
|
+
# @scope class
|
|
323
|
+
attach_function :is_thread_local, :LLVMIsThreadLocal, [:pointer], :bool
|
|
324
|
+
|
|
325
|
+
# (Not documented)
|
|
326
|
+
#
|
|
327
|
+
# @method is_global_constant(global_var)
|
|
328
|
+
# @param [FFI::Pointer(ValueRef)] global_var
|
|
329
|
+
# @return [Integer]
|
|
330
|
+
# @scope class
|
|
331
|
+
attach_function :is_global_constant, :LLVMIsGlobalConstant, [:pointer], :bool
|
|
332
|
+
|
|
333
|
+
attach_function :build_int_cast2, :LLVMBuildIntCast2, [:pointer, :pointer, :pointer, :bool, :string], :pointer
|
|
334
|
+
|
|
335
|
+
# LLVMBool LLVMGetNUW(LLVMValueRef ArithInst);
|
|
336
|
+
attach_function :get_nuw, :LLVMGetNUW, [:pointer], :bool
|
|
337
|
+
|
|
338
|
+
# void LLVMSetNUW(LLVMValueRef ArithInst, LLVMBool HasNUW);
|
|
339
|
+
attach_function :set_nuw, :LLVMSetNUW, [:pointer, :bool], :void
|
|
340
|
+
|
|
341
|
+
# LLVMBool LLVMGetNSW(LLVMValueRef ArithInst);
|
|
342
|
+
attach_function :get_nsw, :LLVMGetNSW, [:pointer], :bool
|
|
343
|
+
|
|
344
|
+
# void LLVMSetNSW(LLVMValueRef ArithInst, LLVMBool HasNSW);
|
|
345
|
+
attach_function :set_nsw, :LLVMSetNSW, [:pointer, :bool], :void
|
|
346
|
+
|
|
347
|
+
# LLVMBool LLVMGetExact(LLVMValueRef DivOrShrInst);
|
|
348
|
+
attach_function :get_exact, :LLVMGetExact, [:pointer], :bool
|
|
349
|
+
|
|
350
|
+
# void LLVMSetExact(LLVMValueRef DivOrShrInst, LLVMBool IsExact);
|
|
351
|
+
attach_function :set_exact, :LLVMSetExact, [:pointer, :bool], :void
|
|
352
|
+
end
|
|
353
|
+
end
|
data/lib/llvm/lljit.rb
CHANGED
|
@@ -10,12 +10,14 @@ module LLVM
|
|
|
10
10
|
|
|
11
11
|
# rubocop:disable Layout/LineLength
|
|
12
12
|
OPT_PASSES = {
|
|
13
|
+
# :nocov:
|
|
13
14
|
'0' => 'always-inline,coro-cond(coro-early,cgscc(coro-split),coro-cleanup,globaldce),function(annotation-remarks),verify',
|
|
14
15
|
'1' => 'annotation2metadata,forceattrs,inferattrs,coro-early,function<eager-inv>(lower-expect,simplifycfg<bonus-inst-threshold=1;no-forward-switch-cond;no-switch-range-to-icmp;no-switch-to-lookup;keep-loops;no-hoist-common-insts;no-sink-common-insts;speculate-blocks;simplify-cond-branch>,sroa<modify-cfg>,early-cse<>),openmp-opt,ipsccp,called-value-propagation,globalopt,function<eager-inv>(mem2reg,instcombine<max-iterations=1;no-use-loop-info;no-verify-fixpoint>,simplifycfg<bonus-inst-threshold=1;no-forward-switch-cond;switch-range-to-icmp;no-switch-to-lookup;keep-loops;no-hoist-common-insts;no-sink-common-insts;speculate-blocks;simplify-cond-branch>),always-inline,require<globals-aa>,function(invalidate<aa>),require<profile-summary>,cgscc(devirt<4>(inline,function-attrs<skip-non-recursive-function-attrs>,function<eager-inv;no-rerun>(sroa<modify-cfg>,early-cse<memssa>,simplifycfg<bonus-inst-threshold=1;no-forward-switch-cond;switch-range-to-icmp;no-switch-to-lookup;keep-loops;no-hoist-common-insts;no-sink-common-insts;speculate-blocks;simplify-cond-branch>,instcombine<max-iterations=1;no-use-loop-info;no-verify-fixpoint>,libcalls-shrinkwrap,simplifycfg<bonus-inst-threshold=1;no-forward-switch-cond;switch-range-to-icmp;no-switch-to-lookup;keep-loops;no-hoist-common-insts;no-sink-common-insts;speculate-blocks;simplify-cond-branch>,reassociate,loop-mssa(loop-instsimplify,loop-simplifycfg,licm<no-allowspeculation>,loop-rotate<header-duplication;no-prepare-for-lto>,licm<allowspeculation>,simple-loop-unswitch<no-nontrivial;trivial>),simplifycfg<bonus-inst-threshold=1;no-forward-switch-cond;switch-range-to-icmp;no-switch-to-lookup;keep-loops;no-hoist-common-insts;no-sink-common-insts;speculate-blocks;simplify-cond-branch>,instcombine<max-iterations=1;no-use-loop-info;no-verify-fixpoint>,loop(loop-idiom,indvars,loop-deletion,loop-unroll-full),sroa<modify-cfg>,memcpyopt,sccp,bdce,instcombine<max-iterations=1;no-use-loop-info;no-verify-fixpoint>,coro-elide,adce,simplifycfg<bonus-inst-threshold=1;no-forward-switch-cond;switch-range-to-icmp;no-switch-to-lookup;keep-loops;no-hoist-common-insts;no-sink-common-insts;speculate-blocks;simplify-cond-branch>,instcombine<max-iterations=1;no-use-loop-info;no-verify-fixpoint>),function-attrs,function(require<should-not-run-function-passes>),coro-split)),deadargelim,coro-cleanup,globalopt,globaldce,elim-avail-extern,rpo-function-attrs,recompute-globalsaa,function<eager-inv>(float2int,lower-constant-intrinsics,loop(loop-rotate<header-duplication;no-prepare-for-lto>,loop-deletion),loop-distribute,inject-tli-mappings,loop-vectorize<no-interleave-forced-only;vectorize-forced-only;>,infer-alignment,loop-load-elim,instcombine<max-iterations=1;no-use-loop-info;no-verify-fixpoint>,simplifycfg<bonus-inst-threshold=1;forward-switch-cond;switch-range-to-icmp;switch-to-lookup;no-keep-loops;hoist-common-insts;sink-common-insts;speculate-blocks;simplify-cond-branch>,vector-combine,instcombine<max-iterations=1;no-use-loop-info;no-verify-fixpoint>,loop-unroll<O1>,transform-warning,sroa<preserve-cfg>,infer-alignment,instcombine<max-iterations=1;no-use-loop-info;no-verify-fixpoint>,loop-mssa(licm<allowspeculation>),alignment-from-assumptions,loop-sink,instsimplify,div-rem-pairs,tailcallelim,simplifycfg<bonus-inst-threshold=1;no-forward-switch-cond;switch-range-to-icmp;no-switch-to-lookup;keep-loops;no-hoist-common-insts;no-sink-common-insts;speculate-blocks;simplify-cond-branch>),globaldce,constmerge,cg-profile,rel-lookup-table-converter,function(annotation-remarks),verify',
|
|
15
16
|
'2' => 'annotation2metadata,forceattrs,inferattrs,coro-early,function<eager-inv>(lower-expect,simplifycfg<bonus-inst-threshold=1;no-forward-switch-cond;no-switch-range-to-icmp;no-switch-to-lookup;keep-loops;no-hoist-common-insts;no-sink-common-insts;speculate-blocks;simplify-cond-branch>,sroa<modify-cfg>,early-cse<>),openmp-opt,ipsccp,called-value-propagation,globalopt,function<eager-inv>(mem2reg,instcombine<max-iterations=1;no-use-loop-info;no-verify-fixpoint>,simplifycfg<bonus-inst-threshold=1;no-forward-switch-cond;switch-range-to-icmp;no-switch-to-lookup;keep-loops;no-hoist-common-insts;no-sink-common-insts;speculate-blocks;simplify-cond-branch>),always-inline,require<globals-aa>,function(invalidate<aa>),require<profile-summary>,cgscc(devirt<4>(inline,function-attrs<skip-non-recursive-function-attrs>,openmp-opt-cgscc,function<eager-inv;no-rerun>(sroa<modify-cfg>,early-cse<memssa>,speculative-execution<only-if-divergent-target>,jump-threading,correlated-propagation,simplifycfg<bonus-inst-threshold=1;no-forward-switch-cond;switch-range-to-icmp;no-switch-to-lookup;keep-loops;no-hoist-common-insts;no-sink-common-insts;speculate-blocks;simplify-cond-branch>,instcombine<max-iterations=1;no-use-loop-info;no-verify-fixpoint>,aggressive-instcombine,libcalls-shrinkwrap,tailcallelim,simplifycfg<bonus-inst-threshold=1;no-forward-switch-cond;switch-range-to-icmp;no-switch-to-lookup;keep-loops;no-hoist-common-insts;no-sink-common-insts;speculate-blocks;simplify-cond-branch>,reassociate,constraint-elimination,loop-mssa(loop-instsimplify,loop-simplifycfg,licm<no-allowspeculation>,loop-rotate<header-duplication;no-prepare-for-lto>,licm<allowspeculation>,simple-loop-unswitch<no-nontrivial;trivial>),simplifycfg<bonus-inst-threshold=1;no-forward-switch-cond;switch-range-to-icmp;no-switch-to-lookup;keep-loops;no-hoist-common-insts;no-sink-common-insts;speculate-blocks;simplify-cond-branch>,instcombine<max-iterations=1;no-use-loop-info;no-verify-fixpoint>,loop(loop-idiom,indvars,loop-deletion,loop-unroll-full),sroa<modify-cfg>,vector-combine,mldst-motion<no-split-footer-bb>,gvn<>,sccp,bdce,instcombine<max-iterations=1;no-use-loop-info;no-verify-fixpoint>,jump-threading,correlated-propagation,adce,memcpyopt,dse,move-auto-init,loop-mssa(licm<allowspeculation>),coro-elide,simplifycfg<bonus-inst-threshold=1;no-forward-switch-cond;switch-range-to-icmp;no-switch-to-lookup;keep-loops;hoist-common-insts;sink-common-insts;speculate-blocks;simplify-cond-branch>,instcombine<max-iterations=1;no-use-loop-info;no-verify-fixpoint>),function-attrs,function(require<should-not-run-function-passes>),coro-split)),deadargelim,coro-cleanup,globalopt,globaldce,elim-avail-extern,rpo-function-attrs,recompute-globalsaa,function<eager-inv>(float2int,lower-constant-intrinsics,loop(loop-rotate<header-duplication;no-prepare-for-lto>,loop-deletion),loop-distribute,inject-tli-mappings,loop-vectorize<no-interleave-forced-only;no-vectorize-forced-only;>,infer-alignment,loop-load-elim,instcombine<max-iterations=1;no-use-loop-info;no-verify-fixpoint>,simplifycfg<bonus-inst-threshold=1;forward-switch-cond;switch-range-to-icmp;switch-to-lookup;no-keep-loops;hoist-common-insts;sink-common-insts;speculate-blocks;simplify-cond-branch>,slp-vectorizer,vector-combine,instcombine<max-iterations=1;no-use-loop-info;no-verify-fixpoint>,loop-unroll<O2>,transform-warning,sroa<preserve-cfg>,infer-alignment,instcombine<max-iterations=1;no-use-loop-info;no-verify-fixpoint>,loop-mssa(licm<allowspeculation>),alignment-from-assumptions,loop-sink,instsimplify,div-rem-pairs,tailcallelim,simplifycfg<bonus-inst-threshold=1;no-forward-switch-cond;switch-range-to-icmp;no-switch-to-lookup;keep-loops;no-hoist-common-insts;no-sink-common-insts;speculate-blocks;simplify-cond-branch>),globaldce,constmerge,cg-profile,rel-lookup-table-converter,function(annotation-remarks),verify',
|
|
16
17
|
'3' => 'annotation2metadata,forceattrs,inferattrs,coro-early,function<eager-inv>(lower-expect,simplifycfg<bonus-inst-threshold=1;no-forward-switch-cond;no-switch-range-to-icmp;no-switch-to-lookup;keep-loops;no-hoist-common-insts;no-sink-common-insts;speculate-blocks;simplify-cond-branch>,sroa<modify-cfg>,early-cse<>,callsite-splitting),openmp-opt,ipsccp,called-value-propagation,globalopt,function<eager-inv>(mem2reg,instcombine<max-iterations=1;no-use-loop-info;no-verify-fixpoint>,simplifycfg<bonus-inst-threshold=1;no-forward-switch-cond;switch-range-to-icmp;no-switch-to-lookup;keep-loops;no-hoist-common-insts;no-sink-common-insts;speculate-blocks;simplify-cond-branch>),always-inline,require<globals-aa>,function(invalidate<aa>),require<profile-summary>,cgscc(devirt<4>(inline,function-attrs<skip-non-recursive-function-attrs>,argpromotion,openmp-opt-cgscc,function<eager-inv;no-rerun>(sroa<modify-cfg>,early-cse<memssa>,speculative-execution<only-if-divergent-target>,jump-threading,correlated-propagation,simplifycfg<bonus-inst-threshold=1;no-forward-switch-cond;switch-range-to-icmp;no-switch-to-lookup;keep-loops;no-hoist-common-insts;no-sink-common-insts;speculate-blocks;simplify-cond-branch>,instcombine<max-iterations=1;no-use-loop-info;no-verify-fixpoint>,aggressive-instcombine,libcalls-shrinkwrap,tailcallelim,simplifycfg<bonus-inst-threshold=1;no-forward-switch-cond;switch-range-to-icmp;no-switch-to-lookup;keep-loops;no-hoist-common-insts;no-sink-common-insts;speculate-blocks;simplify-cond-branch>,reassociate,constraint-elimination,loop-mssa(loop-instsimplify,loop-simplifycfg,licm<no-allowspeculation>,loop-rotate<header-duplication;no-prepare-for-lto>,licm<allowspeculation>,simple-loop-unswitch<nontrivial;trivial>),simplifycfg<bonus-inst-threshold=1;no-forward-switch-cond;switch-range-to-icmp;no-switch-to-lookup;keep-loops;no-hoist-common-insts;no-sink-common-insts;speculate-blocks;simplify-cond-branch>,instcombine<max-iterations=1;no-use-loop-info;no-verify-fixpoint>,loop(loop-idiom,indvars,loop-deletion,loop-unroll-full),sroa<modify-cfg>,vector-combine,mldst-motion<no-split-footer-bb>,gvn<>,sccp,bdce,instcombine<max-iterations=1;no-use-loop-info;no-verify-fixpoint>,jump-threading,correlated-propagation,adce,memcpyopt,dse,move-auto-init,loop-mssa(licm<allowspeculation>),coro-elide,simplifycfg<bonus-inst-threshold=1;no-forward-switch-cond;switch-range-to-icmp;no-switch-to-lookup;keep-loops;hoist-common-insts;sink-common-insts;speculate-blocks;simplify-cond-branch>,instcombine<max-iterations=1;no-use-loop-info;no-verify-fixpoint>),function-attrs,function(require<should-not-run-function-passes>),coro-split)),deadargelim,coro-cleanup,globalopt,globaldce,elim-avail-extern,rpo-function-attrs,recompute-globalsaa,function<eager-inv>(float2int,lower-constant-intrinsics,chr,loop(loop-rotate<header-duplication;no-prepare-for-lto>,loop-deletion),loop-distribute,inject-tli-mappings,loop-vectorize<no-interleave-forced-only;no-vectorize-forced-only;>,infer-alignment,loop-load-elim,instcombine<max-iterations=1;no-use-loop-info;no-verify-fixpoint>,simplifycfg<bonus-inst-threshold=1;forward-switch-cond;switch-range-to-icmp;switch-to-lookup;no-keep-loops;hoist-common-insts;sink-common-insts;speculate-blocks;simplify-cond-branch>,slp-vectorizer,vector-combine,instcombine<max-iterations=1;no-use-loop-info;no-verify-fixpoint>,loop-unroll<O3>,transform-warning,sroa<preserve-cfg>,infer-alignment,instcombine<max-iterations=1;no-use-loop-info;no-verify-fixpoint>,loop-mssa(licm<allowspeculation>),alignment-from-assumptions,loop-sink,instsimplify,div-rem-pairs,tailcallelim,simplifycfg<bonus-inst-threshold=1;no-forward-switch-cond;switch-range-to-icmp;no-switch-to-lookup;keep-loops;no-hoist-common-insts;no-sink-common-insts;speculate-blocks;simplify-cond-branch>),globaldce,constmerge,cg-profile,rel-lookup-table-converter,function(annotation-remarks),verify',
|
|
17
18
|
's' => 'annotation2metadata,forceattrs,inferattrs,coro-early,function<eager-inv>(lower-expect,simplifycfg<bonus-inst-threshold=1;no-forward-switch-cond;no-switch-range-to-icmp;no-switch-to-lookup;keep-loops;no-hoist-common-insts;no-sink-common-insts;speculate-blocks;simplify-cond-branch>,sroa<modify-cfg>,early-cse<>),openmp-opt,ipsccp,called-value-propagation,globalopt,function<eager-inv>(mem2reg,instcombine<max-iterations=1;no-use-loop-info;no-verify-fixpoint>,simplifycfg<bonus-inst-threshold=1;no-forward-switch-cond;switch-range-to-icmp;no-switch-to-lookup;keep-loops;no-hoist-common-insts;no-sink-common-insts;speculate-blocks;simplify-cond-branch>),always-inline,require<globals-aa>,function(invalidate<aa>),require<profile-summary>,cgscc(devirt<4>(inline,function-attrs<skip-non-recursive-function-attrs>,function<eager-inv;no-rerun>(sroa<modify-cfg>,early-cse<memssa>,speculative-execution<only-if-divergent-target>,jump-threading,correlated-propagation,simplifycfg<bonus-inst-threshold=1;no-forward-switch-cond;switch-range-to-icmp;no-switch-to-lookup;keep-loops;no-hoist-common-insts;no-sink-common-insts;speculate-blocks;simplify-cond-branch>,instcombine<max-iterations=1;no-use-loop-info;no-verify-fixpoint>,aggressive-instcombine,tailcallelim,simplifycfg<bonus-inst-threshold=1;no-forward-switch-cond;switch-range-to-icmp;no-switch-to-lookup;keep-loops;no-hoist-common-insts;no-sink-common-insts;speculate-blocks;simplify-cond-branch>,reassociate,constraint-elimination,loop-mssa(loop-instsimplify,loop-simplifycfg,licm<no-allowspeculation>,loop-rotate<header-duplication;no-prepare-for-lto>,licm<allowspeculation>,simple-loop-unswitch<no-nontrivial;trivial>),simplifycfg<bonus-inst-threshold=1;no-forward-switch-cond;switch-range-to-icmp;no-switch-to-lookup;keep-loops;no-hoist-common-insts;no-sink-common-insts;speculate-blocks;simplify-cond-branch>,instcombine<max-iterations=1;no-use-loop-info;no-verify-fixpoint>,loop(loop-idiom,indvars,loop-deletion,loop-unroll-full),sroa<modify-cfg>,vector-combine,mldst-motion<no-split-footer-bb>,gvn<>,sccp,bdce,instcombine<max-iterations=1;no-use-loop-info;no-verify-fixpoint>,jump-threading,correlated-propagation,adce,memcpyopt,dse,move-auto-init,loop-mssa(licm<allowspeculation>),coro-elide,simplifycfg<bonus-inst-threshold=1;no-forward-switch-cond;switch-range-to-icmp;no-switch-to-lookup;keep-loops;hoist-common-insts;sink-common-insts;speculate-blocks;simplify-cond-branch>,instcombine<max-iterations=1;no-use-loop-info;no-verify-fixpoint>),function-attrs,function(require<should-not-run-function-passes>),coro-split)),deadargelim,coro-cleanup,globalopt,globaldce,elim-avail-extern,rpo-function-attrs,recompute-globalsaa,function<eager-inv>(float2int,lower-constant-intrinsics,loop(loop-rotate<header-duplication;no-prepare-for-lto>,loop-deletion),loop-distribute,inject-tli-mappings,loop-vectorize<no-interleave-forced-only;no-vectorize-forced-only;>,infer-alignment,loop-load-elim,instcombine<max-iterations=1;no-use-loop-info;no-verify-fixpoint>,simplifycfg<bonus-inst-threshold=1;forward-switch-cond;switch-range-to-icmp;switch-to-lookup;no-keep-loops;hoist-common-insts;sink-common-insts;speculate-blocks;simplify-cond-branch>,slp-vectorizer,vector-combine,instcombine<max-iterations=1;no-use-loop-info;no-verify-fixpoint>,loop-unroll<O2>,transform-warning,sroa<preserve-cfg>,infer-alignment,instcombine<max-iterations=1;no-use-loop-info;no-verify-fixpoint>,loop-mssa(licm<allowspeculation>),alignment-from-assumptions,loop-sink,instsimplify,div-rem-pairs,tailcallelim,simplifycfg<bonus-inst-threshold=1;no-forward-switch-cond;switch-range-to-icmp;no-switch-to-lookup;keep-loops;no-hoist-common-insts;no-sink-common-insts;speculate-blocks;simplify-cond-branch>),globaldce,constmerge,cg-profile,rel-lookup-table-converter,function(annotation-remarks),verify',
|
|
18
19
|
'z' => 'annotation2metadata,forceattrs,inferattrs,coro-early,function<eager-inv>(lower-expect,simplifycfg<bonus-inst-threshold=1;no-forward-switch-cond;no-switch-range-to-icmp;no-switch-to-lookup;keep-loops;no-hoist-common-insts;no-sink-common-insts;speculate-blocks;simplify-cond-branch>,sroa<modify-cfg>,early-cse<>),openmp-opt,ipsccp,called-value-propagation,globalopt,function<eager-inv>(mem2reg,instcombine<max-iterations=1;no-use-loop-info;no-verify-fixpoint>,simplifycfg<bonus-inst-threshold=1;no-forward-switch-cond;switch-range-to-icmp;no-switch-to-lookup;keep-loops;no-hoist-common-insts;no-sink-common-insts;speculate-blocks;simplify-cond-branch>),always-inline,require<globals-aa>,function(invalidate<aa>),require<profile-summary>,cgscc(devirt<4>(inline,function-attrs<skip-non-recursive-function-attrs>,function<eager-inv;no-rerun>(sroa<modify-cfg>,early-cse<memssa>,speculative-execution<only-if-divergent-target>,jump-threading,correlated-propagation,simplifycfg<bonus-inst-threshold=1;no-forward-switch-cond;switch-range-to-icmp;no-switch-to-lookup;keep-loops;no-hoist-common-insts;no-sink-common-insts;speculate-blocks;simplify-cond-branch>,instcombine<max-iterations=1;no-use-loop-info;no-verify-fixpoint>,aggressive-instcombine,tailcallelim,simplifycfg<bonus-inst-threshold=1;no-forward-switch-cond;switch-range-to-icmp;no-switch-to-lookup;keep-loops;no-hoist-common-insts;no-sink-common-insts;speculate-blocks;simplify-cond-branch>,reassociate,constraint-elimination,loop-mssa(loop-instsimplify,loop-simplifycfg,licm<no-allowspeculation>,loop-rotate<no-header-duplication;no-prepare-for-lto>,licm<allowspeculation>,simple-loop-unswitch<no-nontrivial;trivial>),simplifycfg<bonus-inst-threshold=1;no-forward-switch-cond;switch-range-to-icmp;no-switch-to-lookup;keep-loops;no-hoist-common-insts;no-sink-common-insts;speculate-blocks;simplify-cond-branch>,instcombine<max-iterations=1;no-use-loop-info;no-verify-fixpoint>,loop(loop-idiom,indvars,loop-deletion,loop-unroll-full),sroa<modify-cfg>,vector-combine,mldst-motion<no-split-footer-bb>,gvn<>,sccp,bdce,instcombine<max-iterations=1;no-use-loop-info;no-verify-fixpoint>,jump-threading,correlated-propagation,adce,memcpyopt,dse,move-auto-init,loop-mssa(licm<allowspeculation>),coro-elide,simplifycfg<bonus-inst-threshold=1;no-forward-switch-cond;switch-range-to-icmp;no-switch-to-lookup;keep-loops;hoist-common-insts;sink-common-insts;speculate-blocks;simplify-cond-branch>,instcombine<max-iterations=1;no-use-loop-info;no-verify-fixpoint>),function-attrs,function(require<should-not-run-function-passes>),coro-split)),deadargelim,coro-cleanup,globalopt,globaldce,elim-avail-extern,rpo-function-attrs,recompute-globalsaa,function<eager-inv>(float2int,lower-constant-intrinsics,loop(loop-rotate<no-header-duplication;no-prepare-for-lto>,loop-deletion),loop-distribute,inject-tli-mappings,loop-vectorize<no-interleave-forced-only;vectorize-forced-only;>,infer-alignment,loop-load-elim,instcombine<max-iterations=1;no-use-loop-info;no-verify-fixpoint>,simplifycfg<bonus-inst-threshold=1;forward-switch-cond;switch-range-to-icmp;switch-to-lookup;no-keep-loops;hoist-common-insts;sink-common-insts;speculate-blocks;simplify-cond-branch>,vector-combine,instcombine<max-iterations=1;no-use-loop-info;no-verify-fixpoint>,loop-unroll<O2>,transform-warning,sroa<preserve-cfg>,infer-alignment,instcombine<max-iterations=1;no-use-loop-info;no-verify-fixpoint>,loop-mssa(licm<allowspeculation>),alignment-from-assumptions,loop-sink,instsimplify,div-rem-pairs,tailcallelim,simplifycfg<bonus-inst-threshold=1;no-forward-switch-cond;switch-range-to-icmp;no-switch-to-lookup;keep-loops;no-hoist-common-insts;no-sink-common-insts;speculate-blocks;simplify-cond-branch>),globaldce,constmerge,cg-profile,rel-lookup-table-converter,function(annotation-remarks),verify',
|
|
20
|
+
# :nocov:
|
|
19
21
|
}.freeze
|
|
20
22
|
# rubocop:enable Layout/LineLength
|
|
21
23
|
|
|
@@ -159,7 +161,7 @@ module LLVM
|
|
|
159
161
|
|
|
160
162
|
# @return self
|
|
161
163
|
def loop_reroll!
|
|
162
|
-
|
|
164
|
+
deprecated('loop-reroll pass was removed in LLVM 19')
|
|
163
165
|
end
|
|
164
166
|
|
|
165
167
|
# @return self
|
|
@@ -214,10 +216,13 @@ module LLVM
|
|
|
214
216
|
end
|
|
215
217
|
|
|
216
218
|
# @return self
|
|
217
|
-
def
|
|
219
|
+
def lower_atomic!
|
|
220
|
+
# TODO: change in LLVM-19
|
|
218
221
|
add_pass('loweratomic')
|
|
219
222
|
end
|
|
220
223
|
|
|
224
|
+
alias_method :loweratomic!, :lower_atomic!
|
|
225
|
+
|
|
221
226
|
# @return self
|
|
222
227
|
def partially_inline_libcalls!
|
|
223
228
|
add_pass('partially-inline-libcalls')
|
|
@@ -363,10 +368,10 @@ module LLVM
|
|
|
363
368
|
add_pass('require<basic-aa>')
|
|
364
369
|
end
|
|
365
370
|
|
|
366
|
-
|
|
371
|
+
alias_method :basicaa!, :basic_aa!
|
|
367
372
|
|
|
368
373
|
# @return self
|
|
369
|
-
def objc_arc_aa
|
|
374
|
+
def objc_arc_aa!
|
|
370
375
|
add_pass('require<objc-arc-aa>')
|
|
371
376
|
end
|
|
372
377
|
|
|
@@ -391,10 +396,13 @@ module LLVM
|
|
|
391
396
|
end
|
|
392
397
|
|
|
393
398
|
# @return self
|
|
394
|
-
def
|
|
399
|
+
def lower_switch!
|
|
400
|
+
# TODO: change in LLVM-19
|
|
395
401
|
add_pass('lowerswitch')
|
|
396
402
|
end
|
|
397
403
|
|
|
404
|
+
alias_method :lowerswitch!, :lower_switch!
|
|
405
|
+
|
|
398
406
|
# Inlines functions marked as "always_inline".
|
|
399
407
|
# https://llvm.org/doxygen/AlwaysInliner_8h_source.html
|
|
400
408
|
# https://llvm.org/doxygen/AlwaysInliner_8cpp_source.html
|
|
@@ -442,7 +450,7 @@ module LLVM
|
|
|
442
450
|
add_pass('deadargelim')
|
|
443
451
|
end
|
|
444
452
|
|
|
445
|
-
|
|
453
|
+
alias_method :dae!, :deadargelim!
|
|
446
454
|
|
|
447
455
|
# ConstantMerge is designed to build up a map of available constants and eliminate duplicates when it is initialized.
|
|
448
456
|
# https://llvm.org/doxygen/ConstantMerge_8cpp_source.html
|
|
@@ -452,7 +460,7 @@ module LLVM
|
|
|
452
460
|
add_pass('constmerge')
|
|
453
461
|
end
|
|
454
462
|
|
|
455
|
-
|
|
463
|
+
alias_method :const_merge!, :constmerge!
|
|
456
464
|
|
|
457
465
|
# Aggressive Dead Code Elimination
|
|
458
466
|
# @return self
|
|
@@ -465,7 +473,7 @@ module LLVM
|
|
|
465
473
|
add_pass('function-attrs')
|
|
466
474
|
end
|
|
467
475
|
|
|
468
|
-
|
|
476
|
+
alias_method :fun_attrs!, :function_attrs!
|
|
469
477
|
|
|
470
478
|
# @return self
|
|
471
479
|
def strip!
|
|
@@ -477,12 +485,29 @@ module LLVM
|
|
|
477
485
|
add_pass('strip-dead-prototypes')
|
|
478
486
|
end
|
|
479
487
|
|
|
480
|
-
|
|
488
|
+
alias_method :sdp!, :strip_dead_prototypes!
|
|
481
489
|
|
|
482
490
|
# @return self
|
|
483
|
-
#
|
|
484
|
-
|
|
485
|
-
|
|
491
|
+
# preserve_gv - true / false to support previous option of all_but_main
|
|
492
|
+
# otherwise preserve_gv is assumed to be an array of global variable names
|
|
493
|
+
# internalize<preserve-gv=GV>
|
|
494
|
+
# tests showing usage: https://github.com/llvm/llvm-project/blob/a4b429f9e4175a06cc95f054c5dab3d4bc8fa690/llvm/test/Transforms/Internalize/lists.ll#L17
|
|
495
|
+
def internalize!(preserve_gv = [])
|
|
496
|
+
preserved = case preserve_gv
|
|
497
|
+
when true
|
|
498
|
+
['main']
|
|
499
|
+
when false
|
|
500
|
+
[]
|
|
501
|
+
else
|
|
502
|
+
preserve_gv
|
|
503
|
+
end
|
|
504
|
+
preserved_string = preserved.map { |gv| "preserve-gv=#{gv}" }.join(';')
|
|
505
|
+
|
|
506
|
+
if preserved_string.empty?
|
|
507
|
+
add_pass('internalize')
|
|
508
|
+
else
|
|
509
|
+
add_pass("internalize<#{preserved_string}>")
|
|
510
|
+
end
|
|
486
511
|
end
|
|
487
512
|
|
|
488
513
|
# This pass implements interprocedural sparse conditional constant propagation and merging.
|
|
@@ -506,7 +531,7 @@ module LLVM
|
|
|
506
531
|
add_pass('globaldce')
|
|
507
532
|
end
|
|
508
533
|
|
|
509
|
-
|
|
534
|
+
alias_method :gdce!, :globaldce!
|
|
510
535
|
|
|
511
536
|
# Bit-Tracking Dead Code Elimination pass
|
|
512
537
|
# @return self
|
|
@@ -527,7 +552,7 @@ module LLVM
|
|
|
527
552
|
add_pass('argpromotion')
|
|
528
553
|
end
|
|
529
554
|
|
|
530
|
-
|
|
555
|
+
alias_method :arg_promote!, :argpromotion!
|
|
531
556
|
|
|
532
557
|
# The inliner pass for the new pass manager.
|
|
533
558
|
# https://llvm.org/doxygen/classllvm_1_1InlinerPass.html
|
|
@@ -633,16 +658,22 @@ module LLVM
|
|
|
633
658
|
deprecated('simplify_libcalls! / LLVMAddSimplifyLibCallsPass was removed from LLVM')
|
|
634
659
|
end
|
|
635
660
|
|
|
661
|
+
# https://reviews.llvm.org/D21316
|
|
636
662
|
def scalarrepl!
|
|
637
|
-
deprecated('
|
|
663
|
+
deprecated('scalarrepl was removed from LLVM in 2016 - use sroa')
|
|
664
|
+
sroa!
|
|
638
665
|
end
|
|
639
666
|
|
|
667
|
+
# https://reviews.llvm.org/D21316
|
|
640
668
|
def scalarrepl_ssa!
|
|
641
|
-
deprecated('
|
|
669
|
+
deprecated('scalarrepl_ssa was removed from LLVM in 2016 - use sroa')
|
|
670
|
+
sroa!
|
|
642
671
|
end
|
|
643
672
|
|
|
673
|
+
# https://reviews.llvm.org/D21316
|
|
644
674
|
def scalarrepl_threshold!(_threshold = 0)
|
|
645
|
-
deprecated('
|
|
675
|
+
deprecated('scalarrepl_threshold was removed from LLVM in 2016 - use sroa')
|
|
676
|
+
sroa!
|
|
646
677
|
end
|
|
647
678
|
|
|
648
679
|
def bb_vectorize!
|
data/lib/llvm/support.rb
CHANGED
data/lib/llvm/target_ffi.rb
CHANGED
data/lib/llvm/transforms/ipo.rb
CHANGED
data/lib/llvm/version.rb
CHANGED