File tree Expand file tree Collapse file tree 1 file changed +14
-8
lines changed Expand file tree Collapse file tree 1 file changed +14
-8
lines changed Original file line number Diff line number Diff line change @@ -263,10 +263,20 @@ const __llvm_initialized = Ref(false)
263
263
# merge constants (such as exception messages)
264
264
constant_merge! (pm)
265
265
266
- if do_deferred_codegen
266
+ run! (pm, ir)
267
+ end
268
+ end
269
+
270
+ if optimize
271
+ @timeit_debug to " optimization" begin
272
+ optimize! (job, ir)
273
+
274
+ # deferred codegen has some special optimization requirements,
275
+ # which also need to happen _after_ regular optimization.
276
+ # XXX : make these part of the optimizer pipeline?
277
+ do_deferred_codegen && ModulePassManager () do pm
267
278
# inline and optimize the call to e deferred code. in particular we want
268
279
# to remove unnecessary alloca's created by pass-by-ref semantics.
269
- # TODO : is this still necesary, now that we optimize after codegen?
270
280
instruction_combining! (pm)
271
281
always_inliner! (pm)
272
282
scalar_repl_aggregates_ssa! (pm)
@@ -276,14 +286,10 @@ const __llvm_initialized = Ref(false)
276
286
# merge duplicate functions, since each compilation invocation emits everything
277
287
# XXX : ideally we want to avoid emitting these in the first place
278
288
merge_functions! (pm)
279
- end
280
289
281
- run! (pm, ir)
290
+ run! (pm, ir)
291
+ end
282
292
end
283
- end
284
-
285
- if optimize
286
- @timeit_debug to " optimization" optimize! (job, ir)
287
293
288
294
# optimization may have replaced functions, so look the entry point up again
289
295
entry = functions (ir)[entry_fn]
You can’t perform that action at this time.
0 commit comments