ruby-llvm 18.1.8 → 18.2.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -161,7 +161,7 @@ module LLVM
161
161
 
162
162
  # @return self
163
163
  def loop_reroll!
164
- add_pass('loop-reroll')
164
+ deprecated('loop-reroll pass was removed in LLVM 19')
165
165
  end
166
166
 
167
167
  # @return self
@@ -216,10 +216,13 @@ module LLVM
216
216
  end
217
217
 
218
218
  # @return self
219
- def loweratomic!
219
+ def lower_atomic!
220
+ # TODO: change in LLVM-19
220
221
  add_pass('loweratomic')
221
222
  end
222
223
 
224
+ alias_method :loweratomic!, :lower_atomic!
225
+
223
226
  # @return self
224
227
  def partially_inline_libcalls!
225
228
  add_pass('partially-inline-libcalls')
@@ -365,7 +368,7 @@ module LLVM
365
368
  add_pass('require<basic-aa>')
366
369
  end
367
370
 
368
- alias basicaa! basic_aa!
371
+ alias_method :basicaa!, :basic_aa!
369
372
 
370
373
  # @return self
371
374
  def objc_arc_aa!
@@ -393,10 +396,13 @@ module LLVM
393
396
  end
394
397
 
395
398
  # @return self
396
- def lowerswitch!
399
+ def lower_switch!
400
+ # TODO: change in LLVM-19
397
401
  add_pass('lowerswitch')
398
402
  end
399
403
 
404
+ alias_method :lowerswitch!, :lower_switch!
405
+
400
406
  # Inlines functions marked as "always_inline".
401
407
  # https://llvm.org/doxygen/AlwaysInliner_8h_source.html
402
408
  # https://llvm.org/doxygen/AlwaysInliner_8cpp_source.html
@@ -444,7 +450,7 @@ module LLVM
444
450
  add_pass('deadargelim')
445
451
  end
446
452
 
447
- alias dae! deadargelim!
453
+ alias_method :dae!, :deadargelim!
448
454
 
449
455
  # ConstantMerge is designed to build up a map of available constants and eliminate duplicates when it is initialized.
450
456
  # https://llvm.org/doxygen/ConstantMerge_8cpp_source.html
@@ -454,7 +460,7 @@ module LLVM
454
460
  add_pass('constmerge')
455
461
  end
456
462
 
457
- alias const_merge! constmerge!
463
+ alias_method :const_merge!, :constmerge!
458
464
 
459
465
  # Aggressive Dead Code Elimination
460
466
  # @return self
@@ -467,7 +473,7 @@ module LLVM
467
473
  add_pass('function-attrs')
468
474
  end
469
475
 
470
- alias fun_attrs! function_attrs!
476
+ alias_method :fun_attrs!, :function_attrs!
471
477
 
472
478
  # @return self
473
479
  def strip!
@@ -479,12 +485,29 @@ module LLVM
479
485
  add_pass('strip-dead-prototypes')
480
486
  end
481
487
 
482
- alias sdp! strip_dead_prototypes!
488
+ alias_method :sdp!, :strip_dead_prototypes!
483
489
 
484
490
  # @return self
485
- # TODO: test this
486
- def internalize!(_all_but_main = true) # rubocop:disable Style/OptionalBooleanParameter
487
- add_pass('internalize')
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
488
511
  end
489
512
 
490
513
  # This pass implements interprocedural sparse conditional constant propagation and merging.
@@ -508,7 +531,7 @@ module LLVM
508
531
  add_pass('globaldce')
509
532
  end
510
533
 
511
- alias gdce! globaldce!
534
+ alias_method :gdce!, :globaldce!
512
535
 
513
536
  # Bit-Tracking Dead Code Elimination pass
514
537
  # @return self
@@ -529,7 +552,7 @@ module LLVM
529
552
  add_pass('argpromotion')
530
553
  end
531
554
 
532
- alias arg_promote! argpromotion!
555
+ alias_method :arg_promote!, :argpromotion!
533
556
 
534
557
  # The inliner pass for the new pass manager.
535
558
  # https://llvm.org/doxygen/classllvm_1_1InlinerPass.html
@@ -635,16 +658,22 @@ module LLVM
635
658
  deprecated('simplify_libcalls! / LLVMAddSimplifyLibCallsPass was removed from LLVM')
636
659
  end
637
660
 
661
+ # https://reviews.llvm.org/D21316
638
662
  def scalarrepl!
639
- deprecated('TODO: scalarrepl')
663
+ deprecated('scalarrepl was removed from LLVM in 2016 - use sroa')
664
+ sroa!
640
665
  end
641
666
 
667
+ # https://reviews.llvm.org/D21316
642
668
  def scalarrepl_ssa!
643
- deprecated('TODO: scalarrepl_ssa')
669
+ deprecated('scalarrepl_ssa was removed from LLVM in 2016 - use sroa')
670
+ sroa!
644
671
  end
645
672
 
673
+ # https://reviews.llvm.org/D21316
646
674
  def scalarrepl_threshold!(_threshold = 0)
647
- deprecated('TODO: scalarrepl_threshold')
675
+ deprecated('scalarrepl_threshold was removed from LLVM in 2016 - use sroa')
676
+ sroa!
648
677
  end
649
678
 
650
679
  def bb_vectorize!
data/lib/llvm/support.rb CHANGED
@@ -3,7 +3,6 @@
3
3
  require 'llvm/core_ffi'
4
4
 
5
5
  module LLVM
6
-
7
6
  module Support
8
7
  # @private
9
8
 
@@ -624,5 +624,4 @@ module LLVM::C
624
624
  # @return [nil]
625
625
  # @scope class
626
626
  attach_function :add_analysis_passes, :LLVMAddAnalysisPasses, [OpaqueTargetMachine, :pointer], :void
627
-
628
627
  end
@@ -113,6 +113,5 @@ module LLVM
113
113
  def strip!
114
114
  raise DeprecationError
115
115
  end
116
-
117
116
  end
118
117
  end
@@ -311,6 +311,5 @@ module LLVM
311
311
  def mergereturn!
312
312
  raise DeprecationError
313
313
  end
314
-
315
314
  end
316
315
  end
@@ -5,7 +5,6 @@ require 'llvm/core'
5
5
 
6
6
  module LLVM
7
7
  class PassManager
8
-
9
8
  # @LLVMpass lowerswitch
10
9
  # /** See llvm::createLowerSwitchPass function. */
11
10
  # void LLVMAddLowerSwitchPass(LLVMPassManagerRef PM);
data/lib/llvm/version.rb CHANGED
@@ -3,5 +3,5 @@
3
3
  module LLVM
4
4
  LLVM_VERSION = "18"
5
5
  LLVM_REQUIRED_VERSION = "18.1.8"
6
- RUBY_LLVM_VERSION = "18.1.8"
6
+ RUBY_LLVM_VERSION = "18.2.0"
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: 18.1.8
4
+ version: 18.2.0
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: 2024-06-29 00:00:00.000000000 Z
12
+ date: 2024-09-16 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: ffi
@@ -87,6 +87,20 @@ dependencies:
87
87
  - - "~>"
88
88
  - !ruby/object:Gem::Version
89
89
  version: '5.16'
90
+ - !ruby/object:Gem::Dependency
91
+ name: minitest-fail-fast
92
+ requirement: !ruby/object:Gem::Requirement
93
+ requirements:
94
+ - - ">="
95
+ - !ruby/object:Gem::Version
96
+ version: '0'
97
+ type: :development
98
+ prerelease: false
99
+ version_requirements: !ruby/object:Gem::Requirement
100
+ requirements:
101
+ - - ">="
102
+ - !ruby/object:Gem::Version
103
+ version: '0'
90
104
  - !ruby/object:Gem::Dependency
91
105
  name: minitest-reporters
92
106
  requirement: !ruby/object:Gem::Requirement
@@ -202,16 +216,17 @@ files:
202
216
  - lib/llvm/core/type.rb
203
217
  - lib/llvm/core/value.rb
204
218
  - lib/llvm/core_ffi.rb
219
+ - lib/llvm/core_ffi_v2.rb
205
220
  - lib/llvm/execution_engine.rb
206
221
  - lib/llvm/execution_engine_ffi.rb
207
222
  - lib/llvm/linker.rb
208
223
  - lib/llvm/linker_ffi.rb
209
224
  - lib/llvm/lljit.rb
225
+ - lib/llvm/pass_builder.rb
210
226
  - lib/llvm/support.rb
211
227
  - lib/llvm/target.rb
212
228
  - lib/llvm/target_ffi.rb
213
229
  - lib/llvm/transforms/ipo.rb
214
- - lib/llvm/transforms/pass_builder.rb
215
230
  - lib/llvm/transforms/pass_manager_builder.rb
216
231
  - lib/llvm/transforms/scalar.rb
217
232
  - lib/llvm/transforms/utils.rb