@@ -54,12 +54,12 @@ let deadcode p =
54
54
let r, live_vars = deadcode' p in
55
55
Deadcode. remove_empty_blocks ~live_vars r
56
56
57
- let inline p =
57
+ let inline aggressive p =
58
58
if Config.Flag. inline () && Config.Flag. deadcode ()
59
59
then (
60
60
let p, live_vars = deadcode' p in
61
61
if debug () then Format. eprintf " Inlining...@." ;
62
- Inline. f p live_vars)
62
+ Inline. f ~aggressive p live_vars)
63
63
else p
64
64
65
65
let specialize_1 (p , info ) =
@@ -158,42 +158,44 @@ let identity x = x
158
158
159
159
(* o1 *)
160
160
161
- let o1 : 'a -> 'a =
161
+ let round opt : 'a -> 'a =
162
162
print
163
163
+> tailcall
164
164
+> flow_simple (* flow simple to keep information for future tailcall opt *)
165
165
+> specialize'
166
166
+> eval
167
- +> inline (* inlining may reveal new tailcall opt *)
167
+ +> inline opt (* inlining may reveal new tailcall opt *)
168
168
+> deadcode
169
169
+> tailcall
170
170
+> phi
171
171
+> flow
172
172
+> specialize'
173
173
+> eval
174
- +> inline
174
+ +> inline opt
175
175
+> deadcode
176
176
+> print
177
177
+> flow
178
178
+> specialize'
179
179
+> eval
180
- +> inline
180
+ +> inline opt
181
181
+> deadcode
182
182
+> phi
183
183
+> flow
184
184
+> specialize
185
185
+> identity
186
186
187
+ let o1 = round false
188
+
187
189
(* o2 *)
188
190
189
- let o2 : 'a -> 'a = loop 10 " o1" o1 1 +> print
191
+ let o2 : 'a -> 'a = loop 10 " o1" (round true ) 1 +> print
190
192
191
193
(* o3 *)
192
194
193
195
let round1 : 'a -> 'a =
194
196
print
195
197
+> tailcall
196
- +> inline (* inlining may reveal new tailcall opt *)
198
+ +> inline false (* inlining may reveal new tailcall opt *)
197
199
+> deadcode (* deadcode required before flow simple -> provided by constant *)
198
200
+> flow_simple (* flow simple to keep information for future tailcall opt *)
199
201
+> specialize'
@@ -452,7 +454,9 @@ let check_js js =
452
454
Javascript.IdentSet. fold
453
455
(fun x acc ->
454
456
match x with
455
- | V _ -> assert false
457
+ | V y ->
458
+ Format. eprintf " ZZZ %a@." Code.Var. print y;
459
+ assert false
456
460
| S { name = Utf8 x ; _ } -> StringSet. add x acc)
457
461
free
458
462
StringSet. empty
0 commit comments