Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Add missing scalar and IPO passes (ruby-llvm/ruby-llvm#10).

  • Loading branch information...
commit 2a7b342b126cf7a94d907a197f7e34b29ebefe1c 1 parent e619a83
@whitequark whitequark authored
Showing with 124 additions and 24 deletions.
  1. +64 −4 lib/llvm/transforms/ipo.rb
  2. +60 −20 lib/llvm/transforms/scalar.rb
View
68 lib/llvm/transforms/ipo.rb
@@ -5,14 +5,74 @@
module LLVM
class PassManager
- # @LLVMpass gdce
- def gdce!
- C.add_global_dce_pass(self)
+ # @LLVMpass arg_promotion
+ def arg_promote!
+ C.add_argument_promotion_pass(self)
+ end
+
+ # @LLVMpass const_merge
+ def const_merge!
+ C.add_constant_merge_pass(self)
+ end
+
+ # @LLVMpass dae
+ def dae!
+ C.add_dead_arg_elimination(self)
+ end
+
+ # @LLVMpass function_attrs
+ def fun_attrs!
+ C.add_function_attrs_pass(self)
end
-
+
# @LLVMpass inline
def inline!
C.add_function_inlining_pass(self)
end
+
+ # @LLVMpass always_inline
+ def always_inline!
+ C.add_always_inliner_pass(self)
+ end
+
+ # @LLVMpass gdce
+ def gdce!
+ C.add_global_dce_pass(self)
+ end
+
+ # @LLVMpass global_opt
+ def global_opt!
+ C.add_global_optimizer_pass(self)
+ end
+
+ # @LLVMpass ipcp
+ def ipcp!
+ C.add_ip_constant_propagation_pass(self)
+ end
+
+ # @LLVMpass prune_eh
+ def prune_eh!
+ C.add_prune_eh_pass(self)
+ end
+
+ # @LLVMpass ipsccp
+ def ipsccp!
+ C.add_ipsccp_pass(self)
+ end
+
+ # @LLVMpass internalize
+ def internalize!(all_but_main=true)
+ C.add_internalize_pass(self, all_but_main)
+ end
+
+ # @LLVMpass sdp
+ def sdp!
+ C.add_strip_dead_prototypes_pass(self)
+ end
+
+ # @LLVMpass strip
+ def strip!
+ C.add_strip_symbols_pass(self)
+ end
end
end
View
80 lib/llvm/transforms/scalar.rb
@@ -8,105 +8,145 @@ class PassManager
def adce!
C.add_aggressive_dce_pass(self)
end
-
+
# @LLVMpass simplifycfg
def simplifycfg!
C.add_cfg_simplification_pass(self)
end
-
+
# @LLVMpass dse
def dse!
C.add_dead_store_elimination_pass(self)
end
-
+
# @LLVMpass gvn
def gvn!
C.add_gvn_pass(self)
end
-
+
# @LLVMpass indvars
def indvars!
C.add_ind_var_simplify_pass(self)
end
-
+
# @LLVMpass instcombine
def instcombine!
C.add_instruction_combining_pass(self)
end
-
+
# @LLVMpass jump-threading
def jump_threading!
C.add_jump_threading_pass(self)
end
-
+
# @LLVMpass licm
def licm!
C.add_licm_pass(self)
end
-
+
# @LLVMpass loop-deletion
def loop_deletion!
C.add_loop_deletion_pass(self)
end
-
+
+ # @LLVMpass loop-idion
+ def loop_idiom!
+ C.add_loop_idiom_pass(self)
+ end
+
# @LLVMpass loop-rotate
def loop_rotate!
C.add_loop_rotate_pass(self)
end
-
+
# @LLVMpass loop-unroll
def loop_unroll!
C.add_loop_unroll_pass(self)
end
-
+
# @LLVMpass loop-unswitch
def loop_unswitch!
C.add_loop_unswitch_pass(self)
end
-
+
# @LLVMpass memcpyopt
def memcpyopt!
C.add_mem_cpy_opt_pass(self)
end
-
+
# @LLVMpass mem2reg
def mem2reg!
C.add_promote_memory_to_register_pass(self)
end
-
+
# @LLVMpass reassociate
def reassociate!
C.add_reassociate_pass(self)
end
-
+
# @LLVMpass sccp
def sccp!
C.add_sccp_pass(self)
end
-
+
# @LLVMpass scalarrepl
def scalarrepl!
C.add_scalar_repl_aggregates_pass(self)
end
-
+
+ # @LLVMpass scalarrepl
+ def scalarrepl_ssa!
+ C.add_scalar_repl_aggregates_ssa_pass(self)
+ end
+
+ # @LLVMpass scalarrepl
+ def scalarrepl_threshold!(threshold)
+ C.add_scalar_repl_aggregates_pass(self, threshold)
+ end
+
# @LLVMpass simplify-libcalls
def simplify_libcalls!
C.add_simplify_lib_calls_pass(self)
end
-
+
# @LLVMpass tailcallelim
def tailcallelim!
C.add_tail_call_elimination_pass(self)
end
-
+
# @LLVMpass constprop
def constprop!
C.add_constant_propagation_pass(self)
end
-
+
# @LLVMpass reg2mem
def reg2mem!
C.add_demote_memory_to_register_pass(self)
end
+
+ # @LLVMpass cvprop
+ def cvprop!
+ C.add_correlated_value_propagation_pass(self)
+ end
+
+ # @LLVMpass early-cse
+ def early_cse!
+ C.add_early_cse_pass(self)
+ end
+
+ # @LLVMpass lower-expect
+ def lower_expect!
+ C.add_lower_expect_intrinsic_pass(self)
+ end
+
+ # @LLVMpass tbaa
+ def tbaa!
+ C.add_type_based_alias_analysis_pass(self)
+ end
+
+ # @LLVMpass basicaa
+ def basicaa!
+ C.add_basicaa_pass(self)
+ end
end
end
Please sign in to comment.
Something went wrong with that request. Please try again.