Skip to content
This repository
Browse code

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

  • Loading branch information...
commit 2a7b342b126cf7a94d907a197f7e34b29ebefe1c 1 parent e619a83
Peter Zotov authored January 21, 2013
68  lib/llvm/transforms/ipo.rb
@@ -5,14 +5,74 @@
5 5
 
6 6
 module LLVM
7 7
   class PassManager
8  
-    # @LLVMpass gdce
9  
-    def gdce!
10  
-      C.add_global_dce_pass(self)
  8
+    # @LLVMpass arg_promotion
  9
+    def arg_promote!
  10
+      C.add_argument_promotion_pass(self)
  11
+    end
  12
+
  13
+    # @LLVMpass const_merge
  14
+    def const_merge!
  15
+      C.add_constant_merge_pass(self)
  16
+    end
  17
+
  18
+    # @LLVMpass dae
  19
+    def dae!
  20
+      C.add_dead_arg_elimination(self)
  21
+    end
  22
+
  23
+    # @LLVMpass function_attrs
  24
+    def fun_attrs!
  25
+      C.add_function_attrs_pass(self)
11 26
     end
12  
-    
  27
+
13 28
     # @LLVMpass inline
14 29
     def inline!
15 30
       C.add_function_inlining_pass(self)
16 31
     end
  32
+
  33
+    # @LLVMpass always_inline
  34
+    def always_inline!
  35
+      C.add_always_inliner_pass(self)
  36
+    end
  37
+
  38
+    # @LLVMpass gdce
  39
+    def gdce!
  40
+      C.add_global_dce_pass(self)
  41
+    end
  42
+
  43
+    # @LLVMpass global_opt
  44
+    def global_opt!
  45
+      C.add_global_optimizer_pass(self)
  46
+    end
  47
+
  48
+    # @LLVMpass ipcp
  49
+    def ipcp!
  50
+      C.add_ip_constant_propagation_pass(self)
  51
+    end
  52
+
  53
+    # @LLVMpass prune_eh
  54
+    def prune_eh!
  55
+      C.add_prune_eh_pass(self)
  56
+    end
  57
+
  58
+    # @LLVMpass ipsccp
  59
+    def ipsccp!
  60
+      C.add_ipsccp_pass(self)
  61
+    end
  62
+
  63
+    # @LLVMpass internalize
  64
+    def internalize!(all_but_main=true)
  65
+      C.add_internalize_pass(self, all_but_main)
  66
+    end
  67
+
  68
+    # @LLVMpass sdp
  69
+    def sdp!
  70
+      C.add_strip_dead_prototypes_pass(self)
  71
+    end
  72
+
  73
+    # @LLVMpass strip
  74
+    def strip!
  75
+      C.add_strip_symbols_pass(self)
  76
+    end
17 77
   end
18 78
 end
80  lib/llvm/transforms/scalar.rb
@@ -8,105 +8,145 @@ class PassManager
8 8
     def adce!
9 9
       C.add_aggressive_dce_pass(self)
10 10
     end
11  
-    
  11
+
12 12
     # @LLVMpass simplifycfg
13 13
     def simplifycfg!
14 14
       C.add_cfg_simplification_pass(self)
15 15
     end
16  
-    
  16
+
17 17
     # @LLVMpass dse
18 18
     def dse!
19 19
       C.add_dead_store_elimination_pass(self)
20 20
     end
21  
-    
  21
+
22 22
     # @LLVMpass gvn
23 23
     def gvn!
24 24
       C.add_gvn_pass(self)
25 25
     end
26  
-    
  26
+
27 27
     # @LLVMpass indvars
28 28
     def indvars!
29 29
       C.add_ind_var_simplify_pass(self)
30 30
     end
31  
-    
  31
+
32 32
     # @LLVMpass instcombine
33 33
     def instcombine!
34 34
       C.add_instruction_combining_pass(self)
35 35
     end
36  
-    
  36
+
37 37
     # @LLVMpass jump-threading
38 38
     def jump_threading!
39 39
       C.add_jump_threading_pass(self)
40 40
     end
41  
-    
  41
+
42 42
     # @LLVMpass licm
43 43
     def licm!
44 44
       C.add_licm_pass(self)
45 45
     end
46  
-    
  46
+
47 47
     # @LLVMpass loop-deletion
48 48
     def loop_deletion!
49 49
       C.add_loop_deletion_pass(self)
50 50
     end
51  
-    
  51
+
  52
+    # @LLVMpass loop-idion
  53
+    def loop_idiom!
  54
+      C.add_loop_idiom_pass(self)
  55
+    end
  56
+
52 57
     # @LLVMpass loop-rotate
53 58
     def loop_rotate!
54 59
       C.add_loop_rotate_pass(self)
55 60
     end
56  
-    
  61
+
57 62
     # @LLVMpass loop-unroll
58 63
     def loop_unroll!
59 64
       C.add_loop_unroll_pass(self)
60 65
     end
61  
-    
  66
+
62 67
     # @LLVMpass loop-unswitch
63 68
     def loop_unswitch!
64 69
       C.add_loop_unswitch_pass(self)
65 70
     end
66  
-    
  71
+
67 72
     # @LLVMpass memcpyopt
68 73
     def memcpyopt!
69 74
       C.add_mem_cpy_opt_pass(self)
70 75
     end
71  
-    
  76
+
72 77
     # @LLVMpass mem2reg
73 78
     def mem2reg!
74 79
       C.add_promote_memory_to_register_pass(self)
75 80
     end
76  
-    
  81
+
77 82
     # @LLVMpass reassociate
78 83
     def reassociate!
79 84
       C.add_reassociate_pass(self)
80 85
     end
81  
-    
  86
+
82 87
     # @LLVMpass sccp
83 88
     def sccp!
84 89
       C.add_sccp_pass(self)
85 90
     end
86  
-    
  91
+
87 92
     # @LLVMpass scalarrepl
88 93
     def scalarrepl!
89 94
       C.add_scalar_repl_aggregates_pass(self)
90 95
     end
91  
-    
  96
+
  97
+    # @LLVMpass scalarrepl
  98
+    def scalarrepl_ssa!
  99
+      C.add_scalar_repl_aggregates_ssa_pass(self)
  100
+    end
  101
+
  102
+    # @LLVMpass scalarrepl
  103
+    def scalarrepl_threshold!(threshold)
  104
+      C.add_scalar_repl_aggregates_pass(self, threshold)
  105
+    end
  106
+
92 107
     # @LLVMpass simplify-libcalls
93 108
     def simplify_libcalls!
94 109
       C.add_simplify_lib_calls_pass(self)
95 110
     end
96  
-    
  111
+
97 112
     # @LLVMpass tailcallelim
98 113
     def tailcallelim!
99 114
       C.add_tail_call_elimination_pass(self)
100 115
     end
101  
-    
  116
+
102 117
     # @LLVMpass constprop
103 118
     def constprop!
104 119
       C.add_constant_propagation_pass(self)
105 120
     end
106  
-    
  121
+
107 122
     # @LLVMpass reg2mem
108 123
     def reg2mem!
109 124
       C.add_demote_memory_to_register_pass(self)
110 125
     end
  126
+
  127
+    # @LLVMpass cvprop
  128
+    def cvprop!
  129
+      C.add_correlated_value_propagation_pass(self)
  130
+    end
  131
+
  132
+    # @LLVMpass early-cse
  133
+    def early_cse!
  134
+      C.add_early_cse_pass(self)
  135
+    end
  136
+
  137
+    # @LLVMpass lower-expect
  138
+    def lower_expect!
  139
+      C.add_lower_expect_intrinsic_pass(self)
  140
+    end
  141
+
  142
+    # @LLVMpass tbaa
  143
+    def tbaa!
  144
+      C.add_type_based_alias_analysis_pass(self)
  145
+    end
  146
+
  147
+    # @LLVMpass basicaa
  148
+    def basicaa!
  149
+      C.add_basicaa_pass(self)
  150
+    end
111 151
   end
112 152
 end

0 notes on commit 2a7b342

Please sign in to comment.
Something went wrong with that request. Please try again.