diff options
| author | bjorn3 <bjorn3@users.noreply.github.com> | 2021-05-18 19:41:04 +0200 |
|---|---|---|
| committer | bjorn3 <bjorn3@users.noreply.github.com> | 2021-05-18 19:41:04 +0200 |
| commit | beab7510cfbfb3aaa541922f2298b91b5bfff99d (patch) | |
| tree | 0b94e51d1297ba2a524f134fcb4335faa6b2abf8 /src | |
| parent | a9d033d0e5e29551fc578e8ea4eb3d5f43166b94 (diff) | |
| download | rust-beab7510cfbfb3aaa541922f2298b91b5bfff99d.tar.gz rust-beab7510cfbfb3aaa541922f2298b91b5bfff99d.zip | |
Move some code around a bit
Diffstat (limited to 'src')
| -rw-r--r-- | src/base.rs | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/src/base.rs b/src/base.rs index 2e16dc37c08..ec3e17e5b75 100644 --- a/src/base.rs +++ b/src/base.rs @@ -110,11 +110,6 @@ pub(crate) fn codegen_fn<'tcx>( // Verify function verify_func(tcx, &clif_comments, &context.func); - // Perform rust specific optimizations - tcx.sess.time("optimize clif ir", || { - crate::optimize::optimize_function(tcx, instance, context, &mut clif_comments); - }); - // If the return block is not reachable, then the SSA builder may have inserted an `iconst.i128` // instruction, which doesn't have an encoding. context.compute_cfg(); @@ -125,10 +120,14 @@ pub(crate) fn codegen_fn<'tcx>( // invalidate it when it would change. context.domtree.clear(); - context.want_disasm = crate::pretty_clif::should_write_ir(tcx); + // Perform rust specific optimizations + tcx.sess.time("optimize clif ir", || { + crate::optimize::optimize_function(tcx, instance, context, &mut clif_comments); + }); // Define function tcx.sess.time("define function", || { + context.want_disasm = crate::pretty_clif::should_write_ir(tcx); module .define_function(func_id, context, &mut NullTrapSink {}, &mut NullStackMapSink {}) .unwrap() |
