ruby-llvm 15.0.2 → 15.0.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 79169ec6b39406ef0c395bee5bbc02578340808b2728ba61b5b89c1532e05c94
4
- data.tar.gz: 8fe97708a36b561acbd24433f1ddf5d940e6535a776d918eca463fd179a29aea
3
+ metadata.gz: 97fcfaf90ca0b317eef7e65c6b9da2429b0660c6b44f4758a88c4a13e8c5358f
4
+ data.tar.gz: ab7fd16b1a16d13992c7e697fba953304d9080869312656a558a5a4c4c3b9880
5
5
  SHA512:
6
- metadata.gz: 75303049be604101b44001f68264b0ba0e5902816cf8d001ed5302aa7b71067b1e8d4ac7f24cf3470e53f59aac5547391b31c5f1145dceb28661966e95c56928
7
- data.tar.gz: 9bad15b50111baf7dd2804d9bd6e61d8a2d05b892eacbbbc52df0194662f961eba8c7f9b81f5ebf1b5e9ce796e4aaeb4b4b47e858874d474ea39e54d3a6dd042
6
+ metadata.gz: be57e114f0c66e4cd720526258ccc9e5b0245d6f608d804b3aad877d74a21e8aaecfc74d9b0936cadefc9c4c09ae9feb6ed570b9f264e82ccd700e96386e0e3c
7
+ data.tar.gz: 80350a8cc8d9a6a34d338fb167604f1e44f2c7c6ea4aaee760f6fe818af08f90c9e8c750fcdc462f460a9a1137ec30e404ad9e9a5f3591a2ed2c2590b7f61cb6
@@ -1,5 +1,10 @@
1
1
  # frozen_string_literal: true
2
2
 
3
+ require "llvm/transforms/ipo"
4
+ require "llvm/transforms/scalar"
5
+ require "llvm/transforms/utils"
6
+ require "llvm/transforms/vectorize"
7
+
3
8
  module LLVM
4
9
  # The PassManager runs a queue of passes on a module. See
5
10
  # http://llvm.org/docs/Passes.html for the list of available passes.
@@ -9,72 +9,116 @@ module LLVM
9
9
  class PassManager
10
10
  # @LLVMpass arg_promotion
11
11
  def arg_promote!
12
- C.add_argument_promotion_pass(self)
12
+ warn('arg_promote! / LLVMAddArgumentPromotionPass was removed from LLVM')
13
13
  end
14
14
 
15
15
  # @LLVMpass const_merge
16
+ # /** See llvm::createConstantMergePass function. */
17
+ # void LLVMAddConstantMergePass(LLVMPassManagerRef PM);
16
18
  def const_merge!
17
19
  C.add_constant_merge_pass(self)
18
20
  end
19
21
 
22
+ # @LLVMpass mergefunc
23
+ # /** See llvm::createMergeFunctionsPass function. */
24
+ # void LLVMAddMergeFunctionsPass(LLVMPassManagerRef PM);
25
+ def mergefunc!
26
+ C.add_merge_functions_pass(self)
27
+ end
28
+
29
+ # @LLVMpass called-value-propagation
30
+ # /** See llvm::createCalledValuePropagationPass function. */
31
+ # void LLVMAddCalledValuePropagationPass(LLVMPassManagerRef PM);
32
+ def called_value_propagation!
33
+ C.add_called_value_propagation_pass(self)
34
+ end
35
+
20
36
  # @LLVMpass dae
37
+ # /** See llvm::createDeadArgEliminationPass function. */
38
+ # void LLVMAddDeadArgEliminationPass(LLVMPassManagerRef PM);
21
39
  def dae!
22
- C.add_dead_arg_elimination(self)
40
+ C.add_dead_arg_elimination_pass(self)
23
41
  end
24
42
 
25
43
  # @LLVMpass function_attrs
44
+ # /** See llvm::createFunctionAttrsPass function. */
45
+ # void LLVMAddFunctionAttrsPass(LLVMPassManagerRef PM);
26
46
  def fun_attrs!
27
47
  C.add_function_attrs_pass(self)
28
48
  end
29
49
 
30
50
  # @LLVMpass inline
51
+ # /** See llvm::createFunctionInliningPass function. */
52
+ # void LLVMAddFunctionInliningPass(LLVMPassManagerRef PM);
31
53
  def inline!
32
54
  C.add_function_inlining_pass(self)
33
55
  end
34
56
 
35
57
  # @LLVMpass always_inline
58
+ # /** See llvm::createAlwaysInlinerPass function. */
59
+ # void LLVMAddAlwaysInlinerPass(LLVMPassManagerRef PM);
36
60
  def always_inline!
37
61
  C.add_always_inliner_pass(self)
38
62
  end
39
63
 
40
64
  # @LLVMpass gdce
65
+ # /** See llvm::createGlobalDCEPass function. */
66
+ # void LLVMAddGlobalDCEPass(LLVMPassManagerRef PM);
41
67
  def gdce!
42
68
  C.add_global_dce_pass(self)
43
69
  end
44
70
 
45
71
  # @LLVMpass global_opt
72
+ # /** See llvm::createGlobalOptimizerPass function. */
73
+ # void LLVMAddGlobalOptimizerPass(LLVMPassManagerRef PM);
46
74
  def global_opt!
47
75
  C.add_global_optimizer_pass(self)
48
76
  end
49
77
 
50
78
  # @LLVMpass ipcp
51
79
  def ipcp!
52
- C.add_ip_constant_propagation_pass(self)
80
+ warn('ipcp! / LLVMAddIPConstantPropagationPass was removed from LLVM')
53
81
  end
54
82
 
55
83
  # @LLVMpass prune_eh
84
+ # /** See llvm::createPruneEHPass function. */
85
+ # void LLVMAddPruneEHPass(LLVMPassManagerRef PM);
56
86
  def prune_eh!
57
87
  C.add_prune_eh_pass(self)
58
88
  end
59
89
 
60
90
  # @LLVMpass ipsccp
91
+ # /** See llvm::createIPSCCPPass function. */
92
+ # void LLVMAddIPSCCPPass(LLVMPassManagerRef PM);
61
93
  def ipsccp!
62
94
  C.add_ipsccp_pass(self)
63
95
  end
64
96
 
65
97
  # @LLVMpass internalize
98
+ # /** See llvm::createInternalizePass function. */
99
+ # void LLVMAddInternalizePass(LLVMPassManagerRef, unsigned AllButMain);
66
100
  def internalize!(all_but_main = true)
67
- C.add_internalize_pass(self, all_but_main)
101
+ C.add_internalize_pass(self, all_but_main ? 1 : 0)
68
102
  end
69
103
 
70
104
  # @LLVMpass sdp
105
+ # /** See llvm::createStripDeadPrototypesPass function. */
106
+ # void LLVMAddStripDeadPrototypesPass(LLVMPassManagerRef PM);
71
107
  def sdp!
72
108
  C.add_strip_dead_prototypes_pass(self)
73
109
  end
74
110
 
75
111
  # @LLVMpass strip
112
+ # /** See llvm::createStripSymbolsPass function. */
113
+ # void LLVMAddStripSymbolsPass(LLVMPassManagerRef PM);
76
114
  def strip!
77
115
  C.add_strip_symbols_pass(self)
78
116
  end
117
+
118
+ end
119
+
120
+ module C
121
+ attach_function :add_merge_functions_pass, :LLVMAddMergeFunctionsPass, [:pointer], :void
122
+ attach_function :add_called_value_propagation_pass, :LLVMAddCalledValuePropagationPass, [:pointer], :void
79
123
  end
80
124
  end
@@ -12,14 +12,6 @@ module LLVM::C
12
12
  end
13
13
  end
14
14
 
15
- # See llvm::createArgumentPromotionPass function.
16
- #
17
- # @method add_argument_promotion_pass(pm)
18
- # @param [FFI::Pointer(PassManagerRef)] pm
19
- # @return [nil]
20
- # @scope class
21
- attach_function :add_argument_promotion_pass, :LLVMAddArgumentPromotionPass, [:pointer], :void
22
-
23
15
  # See llvm::createConstantMergePass function.
24
16
  #
25
17
  # @method add_constant_merge_pass(pm)
@@ -76,14 +68,6 @@ module LLVM::C
76
68
  # @scope class
77
69
  attach_function :add_global_optimizer_pass, :LLVMAddGlobalOptimizerPass, [:pointer], :void
78
70
 
79
- # See llvm::createIPConstantPropagationPass function.
80
- #
81
- # @method add_ip_constant_propagation_pass(pm)
82
- # @param [FFI::Pointer(PassManagerRef)] pm
83
- # @return [nil]
84
- # @scope class
85
- attach_function :add_ip_constant_propagation_pass, :LLVMAddIPConstantPropagationPass, [:pointer], :void
86
-
87
71
  # See llvm::createPruneEHPass function.
88
72
  #
89
73
  # @method add_prune_eh_pass(pm)
@@ -7,158 +7,320 @@ require 'llvm/transforms/scalar_ffi'
7
7
  module LLVM
8
8
  class PassManager
9
9
  # @LLVMpass adce
10
+ # /** See llvm::createAggressiveDCEPass function. */
11
+ # void LLVMAddAggressiveDCEPass(LLVMPassManagerRef PM);
10
12
  def adce!
11
13
  C.add_aggressive_dce_pass(self)
12
14
  end
13
15
 
16
+ # @LLVMpass dce
17
+ # /** See llvm::createDeadCodeEliminationPass function. */
18
+ # void LLVMAddDCEPass(LLVMPassManagerRef PM);
19
+ def dce!
20
+ C.add_dce_pass(self)
21
+ end
22
+
23
+ # @LLVMpass bdce
24
+ # /** See llvm::createBitTrackingDCEPass function. */
25
+ # void LLVMAddBitTrackingDCEPass(LLVMPassManagerRef PM);
26
+ def bdce!
27
+ C.add_bit_tracking_dce_pass(self)
28
+ end
29
+
30
+ # @LLVMpass alignment_from_assumptions
31
+ # /** See llvm::createAlignmentFromAssumptionsPass function. */
32
+ # void LLVMAddAlignmentFromAssumptionsPass(LLVMPassManagerRef PM);
33
+ def alignment_from_assumptions!
34
+ C.add_alignment_from_assumptions_pass(self)
35
+ end
36
+
14
37
  # @LLVMpass simplifycfg
38
+ # /** See llvm::createCFGSimplificationPass function. */
39
+ # void LLVMAddCFGSimplificationPass(LLVMPassManagerRef PM);
15
40
  def simplifycfg!
16
41
  C.add_cfg_simplification_pass(self)
17
42
  end
18
43
 
19
44
  # @LLVMpass dse
45
+ # /** See llvm::createDeadStoreEliminationPass function. */
46
+ # void LLVMAddDeadStoreEliminationPass(LLVMPassManagerRef PM);
20
47
  def dse!
21
48
  C.add_dead_store_elimination_pass(self)
22
49
  end
23
50
 
51
+ # @LLVMPass scalarizer
52
+ # /** See llvm::createScalarizerPass function. */
53
+ # void LLVMAddScalarizerPass(LLVMPassManagerRef PM);
54
+ def scalarizer!
55
+ C.add_scalarizer_pass(self)
56
+ end
57
+
58
+ # @LLVMpass mldst-motion
59
+ # /** See llvm::createMergedLoadStoreMotionPass function. */
60
+ # void LLVMAddMergedLoadStoreMotionPass(LLVMPassManagerRef PM);
61
+ def mldst_motion!
62
+ C.add_merged_load_store_motion_pass(self)
63
+ end
64
+
24
65
  # @LLVMpass gvn
66
+ # /** See llvm::createGVNPass function. */
67
+ # void LLVMAddGVNPass(LLVMPassManagerRef PM);
25
68
  def gvn!
26
69
  C.add_gvn_pass(self)
27
70
  end
28
71
 
72
+ # @LLVMpass newgvn
73
+ # /** See llvm::createGVNPass function. */
74
+ # void LLVMAddNewGVNPass(LLVMPassManagerRef PM);
75
+ def newgvn!
76
+ C.add_new_gvn_pass(self)
77
+ end
78
+
29
79
  # @LLVMpass indvars
80
+ # /** See llvm::createIndVarSimplifyPass function. */
81
+ # void LLVMAddIndVarSimplifyPass(LLVMPassManagerRef PM);
30
82
  def indvars!
31
83
  C.add_ind_var_simplify_pass(self)
32
84
  end
33
85
 
34
86
  # @LLVMpass instcombine
87
+ # /** See llvm::createInstructionCombiningPass function. */
88
+ # void LLVMAddInstructionCombiningPass(LLVMPassManagerRef PM);
35
89
  def instcombine!
36
90
  C.add_instruction_combining_pass(self)
37
91
  end
38
92
 
93
+ # @LLVMpass instsimplify
94
+ # /** See llvm::createInstSimplifyLegacyPass function. */
95
+ # void LLVMAddInstructionSimplifyPass(LLVMPassManagerRef PM);
96
+ def instsimplify!
97
+ C.add_instruction_simplify_pass(self)
98
+ end
99
+
39
100
  # @LLVMpass jump-threading
101
+ # /** See llvm::createJumpThreadingPass function. */
102
+ # void LLVMAddJumpThreadingPass(LLVMPassManagerRef PM);
40
103
  def jump_threading!
41
104
  C.add_jump_threading_pass(self)
42
105
  end
43
106
 
44
107
  # @LLVMpass licm
108
+ # /** See llvm::createLICMPass function. */
109
+ # void LLVMAddLICMPass(LLVMPassManagerRef PM);
45
110
  def licm!
46
111
  C.add_licm_pass(self)
47
112
  end
48
113
 
49
114
  # @LLVMpass loop-deletion
115
+ # /** See llvm::createLoopDeletionPass function. */
116
+ # void LLVMAddLoopDeletionPass(LLVMPassManagerRef PM);
50
117
  def loop_deletion!
51
118
  C.add_loop_deletion_pass(self)
52
119
  end
53
120
 
54
121
  # @LLVMpass loop-idiom
122
+ # /** See llvm::createLoopIdiomPass function */
123
+ # void LLVMAddLoopIdiomPass(LLVMPassManagerRef PM);
55
124
  def loop_idiom!
56
125
  C.add_loop_idiom_pass(self)
57
126
  end
58
127
 
59
128
  # @LLVMpass loop-rotate
129
+ # /** See llvm::createLoopRotatePass function. */
130
+ # void LLVMAddLoopRotatePass(LLVMPassManagerRef PM);
60
131
  def loop_rotate!
61
132
  C.add_loop_rotate_pass(self)
62
133
  end
63
134
 
135
+ # @LLVMpass loop-reroll
136
+ # /** See llvm::createLoopRerollPass function. */
137
+ # void LLVMAddLoopRerollPass(LLVMPassManagerRef PM);
138
+ def loop_reroll!
139
+ C.add_loop_reroll_pass(self)
140
+ end
141
+
64
142
  # @LLVMpass loop-unroll
143
+ # /** See llvm::createLoopUnrollPass function. */
144
+ # void LLVMAddLoopUnrollPass(LLVMPassManagerRef PM);
65
145
  def loop_unroll!
66
146
  C.add_loop_unroll_pass(self)
67
147
  end
68
148
 
149
+ # @LLVMpass loop-unroll-and-jam
150
+ # /** See llvm::createLoopUnrollAndJamPass function. */
151
+ # void LLVMAddLoopUnrollAndJamPass(LLVMPassManagerRef PM);
152
+ def loop_unroll_and_jam!
153
+ C.add_loop_unroll_and_jam_pass(self)
154
+ end
155
+
69
156
  # @LLVMpass loop-unswitch
70
157
  def loop_unswitch!
71
- C.add_loop_unswitch_pass(self)
158
+ warn('loop_unswitch! / LLVMAddLoopUnswitchPass was removed in LLVM 15')
159
+ end
160
+
161
+ # @LLVMpass loweratomic
162
+ # /** See llvm::createLowerAtomicPass function. */
163
+ # void LLVMAddLowerAtomicPass(LLVMPassManagerRef PM);
164
+ def loweratomic!
165
+ C.add_lower_atomic_pass(self)
72
166
  end
73
167
 
74
168
  # @LLVMpass memcpyopt
169
+ # /** See llvm::createMemCpyOptPass function. */
170
+ # void LLVMAddMemCpyOptPass(LLVMPassManagerRef PM);
75
171
  def memcpyopt!
76
172
  C.add_mem_cpy_opt_pass(self)
77
173
  end
78
174
 
79
- # @LLVMpass mem2reg
80
- def mem2reg!
81
- C.add_promote_memory_to_register_pass(self)
175
+ # @LLVMpass partially-inline-libcalls
176
+ # /** See llvm::createPartiallyInlineLibCallsPass function. */
177
+ # void LLVMAddPartiallyInlineLibCallsPass(LLVMPassManagerRef PM);
178
+ def partially_inline_libcalls!
179
+ C.add_partially_inline_lib_calls_pass(self)
82
180
  end
83
181
 
84
182
  # @LLVMpass reassociate
183
+ # /** See llvm::createReassociatePass function. */
184
+ # void LLVMAddReassociatePass(LLVMPassManagerRef PM);
85
185
  def reassociate!
86
186
  C.add_reassociate_pass(self)
87
187
  end
88
188
 
89
189
  # @LLVMpass sccp
190
+ # /** See llvm::createSCCPPass function. */
191
+ # void LLVMAddSCCPPass(LLVMPassManagerRef PM);
90
192
  def sccp!
91
193
  C.add_sccp_pass(self)
92
194
  end
93
195
 
94
- # @LLVMpass scalarrepl
196
+ # @LLVMpass sroa
197
+ # /** See llvm::createSROAPass function. */
198
+ # void LLVMAddScalarReplAggregatesPass(LLVMPassManagerRef PM);
95
199
  def scalarrepl!
96
200
  C.add_scalar_repl_aggregates_pass(self)
97
201
  end
98
202
 
99
- # @LLVMpass scalarrepl
203
+ # @LLVMpass sroa
204
+ # /** See llvm::createSROAPass function. */
205
+ # void LLVMAddScalarReplAggregatesPassSSA(LLVMPassManagerRef PM);
100
206
  def scalarrepl_ssa!
101
207
  C.add_scalar_repl_aggregates_pass_ssa(self)
102
208
  end
103
209
 
104
- # @LLVMpass scalarrepl
105
- def scalarrepl_threshold!(threshold)
106
- C.add_scalar_repl_aggregates_pass(self, threshold)
210
+ # @LLVMpass sroa
211
+ # /** See llvm::createSROAPass function. */
212
+ # void LLVMAddScalarReplAggregatesPassWithThreshold(LLVMPassManagerRef PM,
213
+ # int Threshold);
214
+ # threshold appears unused: https://llvm.org/doxygen/Scalar_8cpp_source.html#l00211
215
+ def scalarrepl_threshold!(threshold = 0)
216
+ C.add_scalar_repl_aggregates_pass_with_threshold(self, threshold)
107
217
  end
108
218
 
109
219
  # @LLVMpass simplify-libcalls
220
+ # /** See llvm::createSimplifyLibCallsPass function. */
221
+ # void LLVMAddSimplifyLibCallsPass(LLVMPassManagerRef PM);
222
+ # removed: https://llvm.org/doxygen/Scalar_8cpp_source.html#l00211
110
223
  def simplify_libcalls!
111
- C.add_simplify_lib_calls_pass(self)
224
+ warn('simplify_libcalls! / LLVMAddSimplifyLibCallsPass was removed from LLVM')
112
225
  end
113
226
 
114
227
  # @LLVMpass tailcallelim
228
+ # /** See llvm::createTailCallEliminationPass function. */
229
+ # void LLVMAddTailCallEliminationPass(LLVMPassManagerRef PM);
115
230
  def tailcallelim!
116
231
  C.add_tail_call_elimination_pass(self)
117
232
  end
118
233
 
119
234
  # @LLVMpass constprop
120
235
  def constprop!
121
- C.add_constant_propagation_pass(self)
236
+ warn('constprop! / LLVMAddConstantPropagationPass was removed from LLVM')
122
237
  end
123
238
 
124
239
  # @LLVMpass reg2mem
240
+ # /** See llvm::demotePromoteMemoryToRegisterPass function. */
241
+ # void LLVMAddDemoteMemoryToRegisterPass(LLVMPassManagerRef PM);
125
242
  def reg2mem!
126
243
  C.add_demote_memory_to_register_pass(self)
127
244
  end
128
245
 
246
+ # @LLVMpass verify
247
+ # /** See llvm::createVerifierPass function. */
248
+ # void LLVMAddVerifierPass(LLVMPassManagerRef PM);
249
+ def verify!
250
+ C.add_verifier_pass(self)
251
+ end
252
+
129
253
  # @LLVMpass cvprop
254
+ # /** See llvm::createCorrelatedValuePropagationPass function */
255
+ # void LLVMAddCorrelatedValuePropagationPass(LLVMPassManagerRef PM);
130
256
  def cvprop!
131
257
  C.add_correlated_value_propagation_pass(self)
132
258
  end
133
259
 
134
260
  # @LLVMpass early-cse
261
+ # /** See llvm::createEarlyCSEPass function */
262
+ # void LLVMAddEarlyCSEPass(LLVMPassManagerRef PM);
135
263
  def early_cse!
136
264
  C.add_early_cse_pass(self)
137
265
  end
138
266
 
267
+ # @LLVMpass early-cse-memssa
268
+ # /** See llvm::createEarlyCSEPass function */
269
+ # void LLVMAddEarlyCSEMemSSAPass(LLVMPassManagerRef PM);
270
+ def early_cse_memssa!
271
+ C.add_early_cse_mem_ssa_pass(self)
272
+ end
273
+
139
274
  # @LLVMpass lower-expect
275
+ # /** See llvm::createLowerExpectIntrinsicPass function */
276
+ # void LLVMAddLowerExpectIntrinsicPass(LLVMPassManagerRef PM);
140
277
  def lower_expect!
141
278
  C.add_lower_expect_intrinsic_pass(self)
142
279
  end
143
280
 
281
+ # @LLVMPass lower-constant-intrinsics
282
+ # /** See llvm::createLowerConstantIntrinsicsPass function */
283
+ # void LLVMAddLowerConstantIntrinsicsPass(LLVMPassManagerRef PM);
284
+ def lower_constant_intrinsics!
285
+ C.add_lower_constant_intrinsics_pass(self)
286
+ end
287
+
144
288
  # @LLVMpass tbaa
289
+ # /** See llvm::createTypeBasedAliasAnalysisPass function */
290
+ # void LLVMAddTypeBasedAliasAnalysisPass(LLVMPassManagerRef PM);
145
291
  def tbaa!
146
292
  C.add_type_based_alias_analysis_pass(self)
147
293
  end
148
294
 
295
+ # @ LLVMPass scoped-noalias-aa
296
+ # /** See llvm::createScopedNoAliasAAPass function */
297
+ # void LLVMAddScopedNoAliasAAPass(LLVMPassManagerRef PM);
298
+ def scoped_noalias_aa!
299
+ C.add_scoped_no_alias_aa_pass(self)
300
+ end
301
+
149
302
  # @LLVMpass basicaa
303
+ # /** See llvm::createBasicAliasAnalysisPass function */
304
+ # void LLVMAddBasicAliasAnalysisPass(LLVMPassManagerRef PM);
150
305
  def basicaa!
151
306
  C.add_basic_alias_analysis_pass(self)
152
307
  end
153
308
 
154
- # @LLVMpass mergefunc
155
- def mergefunc!
156
- C.add_merge_functions_pass(self)
309
+ # @LLVMpass mergereturn
310
+ # /** See llvm::createUnifyFunctionExitNodesPass function */
311
+ # void LLVMAddUnifyFunctionExitNodesPass(LLVMPassManagerRef PM);
312
+ def mergereturn!
313
+ C.add_unify_function_exit_nodes_pass(self)
157
314
  end
158
315
 
159
316
  end
160
317
 
161
318
  module C
162
- attach_function :add_merge_functions_pass, :LLVMAddMergeFunctionsPass, [:pointer], :void
319
+ attach_function :add_dce_pass, :LLVMAddDCEPass, [:pointer], :void
320
+ attach_function :add_instruction_simplify_pass, :LLVMAddInstructionSimplifyPass, [:pointer], :void
321
+ attach_function :add_loop_unroll_and_jam_pass, :LLVMAddLoopUnrollAndJamPass, [:pointer], :void
322
+ attach_function :add_lower_atomic_pass, :LLVMAddLowerAtomicPass, [:pointer], :void
323
+ attach_function :add_lower_constant_intrinsics_pass, :LLVMAddLowerConstantIntrinsicsPass, [:pointer], :void
324
+ attach_function :add_unify_function_exit_nodes_pass, :LLVMAddUnifyFunctionExitNodesPass, [:pointer], :void
163
325
  end
164
326
  end
@@ -164,14 +164,6 @@ module LLVM::C
164
164
  # @scope class
165
165
  attach_function :add_loop_unroll_pass, :LLVMAddLoopUnrollPass, [:pointer], :void
166
166
 
167
- # See llvm::createLoopUnswitchPass function.
168
- #
169
- # @method add_loop_unswitch_pass(pm)
170
- # @param [FFI::Pointer(PassManagerRef)] pm
171
- # @return [nil]
172
- # @scope class
173
- attach_function :add_loop_unswitch_pass, :LLVMAddLoopUnswitchPass, [:pointer], :void
174
-
175
167
  # See llvm::createMemCpyOptPass function.
176
168
  #
177
169
  # @method add_mem_cpy_opt_pass(pm)
@@ -245,14 +237,6 @@ module LLVM::C
245
237
  # @scope class
246
238
  attach_function :add_scalar_repl_aggregates_pass_with_threshold, :LLVMAddScalarReplAggregatesPassWithThreshold, [:pointer, :int], :void
247
239
 
248
- # See llvm::createSimplifyLibCallsPass function.
249
- #
250
- # @method add_simplify_lib_calls_pass(pm)
251
- # @param [FFI::Pointer(PassManagerRef)] pm
252
- # @return [nil]
253
- # @scope class
254
- attach_function :add_simplify_lib_calls_pass, :LLVMAddSimplifyLibCallsPass, [:pointer], :void
255
-
256
240
  # See llvm::createTailCallEliminationPass function.
257
241
  #
258
242
  # @method add_tail_call_elimination_pass(pm)
@@ -261,14 +245,6 @@ module LLVM::C
261
245
  # @scope class
262
246
  attach_function :add_tail_call_elimination_pass, :LLVMAddTailCallEliminationPass, [:pointer], :void
263
247
 
264
- # See llvm::createConstantPropagationPass function.
265
- #
266
- # @method add_constant_propagation_pass(pm)
267
- # @param [FFI::Pointer(PassManagerRef)] pm
268
- # @return [nil]
269
- # @scope class
270
- attach_function :add_constant_propagation_pass, :LLVMAddConstantPropagationPass, [:pointer], :void
271
-
272
248
  # See llvm::demotePromoteMemoryToRegisterPass function.
273
249
  #
274
250
  # @method add_demote_memory_to_register_pass(pm)
@@ -0,0 +1,34 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'llvm'
4
+ require 'llvm/core'
5
+
6
+ module LLVM
7
+ class PassManager
8
+
9
+ # @LLVMpass lowerswitch
10
+ # /** See llvm::createLowerSwitchPass function. */
11
+ # void LLVMAddLowerSwitchPass(LLVMPassManagerRef PM);
12
+ def lowerswitch!
13
+ C.add_lower_switch_pass(self)
14
+ end
15
+
16
+ # @LLVMpass mem2reg
17
+ # /** See llvm::createPromoteMemoryToRegisterPass function. */
18
+ # void LLVMAddPromoteMemoryToRegisterPass(LLVMPassManagerRef PM);
19
+ def mem2reg!
20
+ C.add_promote_memory_to_register_pass(self)
21
+ end
22
+
23
+ # @LLVMpass add-discriminators
24
+ # /** See llvm::createAddDiscriminatorsPass function. */
25
+ # void LLVMAddAddDiscriminatorsPass(LLVMPassManagerRef PM);
26
+ def add_discriminators!
27
+ C.add_add_discriminators_pass(self)
28
+ end
29
+ end
30
+
31
+ module C
32
+ attach_function :add_add_discriminators_pass, :LLVMAddAddDiscriminatorsPass, [:pointer], :void
33
+ end
34
+ end
@@ -8,15 +8,20 @@ module LLVM
8
8
  class PassManager
9
9
  # @LLVMpass bb_vectorize
10
10
  def bb_vectorize!
11
- C.add_bb_vectorize_pass(self)
11
+ warn('bb_vectorize! / LLVMAddBBVectorizePass was removed from LLVM - replace with slp_vectorize!')
12
+ slp_vectorize!
12
13
  end
13
14
 
14
15
  # @LLVMpass loop_vectorize
16
+ # /** See llvm::createLoopVectorizePass function. */
17
+ # void LLVMAddLoopVectorizePass(LLVMPassManagerRef PM);
15
18
  def loop_vectorize!
16
19
  C.add_loop_vectorize_pass(self)
17
20
  end
18
21
 
19
22
  # @LLVMpass slp_vectorize
23
+ # /** See llvm::createSLPVectorizerPass function. */
24
+ # void LLVMAddSLPVectorizePass(LLVMPassManagerRef PM);
20
25
  def slp_vectorize!
21
26
  C.add_slp_vectorize_pass(self)
22
27
  end
data/lib/llvm/version.rb CHANGED
@@ -3,5 +3,5 @@
3
3
  module LLVM
4
4
  LLVM_VERSION = "15"
5
5
  LLVM_REQUIRED_VERSION = "15.0"
6
- RUBY_LLVM_VERSION = "15.0.2"
6
+ RUBY_LLVM_VERSION = "15.0.3"
7
7
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ruby-llvm
3
3
  version: !ruby/object:Gem::Version
4
- version: 15.0.2
4
+ version: 15.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jesse Johnson
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2023-01-31 00:00:00.000000000 Z
12
+ date: 2023-02-25 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: ffi
@@ -197,7 +197,6 @@ files:
197
197
  - lib/llvm/core/builder.rb
198
198
  - lib/llvm/core/context.rb
199
199
  - lib/llvm/core/module.rb
200
- - lib/llvm/core/opaque_pointer_builder.rb
201
200
  - lib/llvm/core/pass_manager.rb
202
201
  - lib/llvm/core/type.rb
203
202
  - lib/llvm/core/value.rb
@@ -215,6 +214,7 @@ files:
215
214
  - lib/llvm/transforms/ipo_ffi.rb
216
215
  - lib/llvm/transforms/scalar.rb
217
216
  - lib/llvm/transforms/scalar_ffi.rb
217
+ - lib/llvm/transforms/utils.rb
218
218
  - lib/llvm/transforms/vectorize.rb
219
219
  - lib/llvm/transforms/vectorize_ffi.rb
220
220
  - lib/llvm/version.rb
@@ -1,26 +0,0 @@
1
- # frozen_string_literal: true
2
- # module LLVM
3
- # module OpaquePointerBuilder
4
- # # Builds a struct getelementptr Instruction.
5
- # #
6
- # # @param [LLVM::Value] pointer A pointer to a structure
7
- # # @param [LLVM::Value] idx Unsigned integer representing the index of a
8
- # # structure member
9
- # # @param [String] name The name of the result in LLVM IR
10
- # # @return [LLVM::Instruction] The resulting pointer
11
- # # @LLVMinst gep
12
- # # @see http://llvm.org/docs/GetElementPtr.html
13
- # def struct_gep1(pointer, idx, name = "")
14
- # Instruction.from_ptr(C.build_struct_gep(self, pointer, idx, name))
15
- # end
16
- #
17
- # private def struct_gep2(type, pointer, idx, name)
18
- # Instruction.from_ptr(C.build_struct_gep2(self, type, pointer, idx, name))
19
- # end
20
- #
21
- # def struct_gep(pointer, idx, name = "", type = nil)
22
- # type2 = type || must_infer_type(pointer)
23
- # struct_gep2(types2, pointer, idx, name)
24
- # end
25
- # end
26
- # end