Skip to content

Commit beab751

Browse files
committed
Move some code around a bit
1 parent a9d033d commit beab751

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

src/base.rs

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -110,11 +110,6 @@ pub(crate) fn codegen_fn<'tcx>(
110110
// Verify function
111111
verify_func(tcx, &clif_comments, &context.func);
112112

113-
// Perform rust specific optimizations
114-
tcx.sess.time("optimize clif ir", || {
115-
crate::optimize::optimize_function(tcx, instance, context, &mut clif_comments);
116-
});
117-
118113
// If the return block is not reachable, then the SSA builder may have inserted an `iconst.i128`
119114
// instruction, which doesn't have an encoding.
120115
context.compute_cfg();
@@ -125,10 +120,14 @@ pub(crate) fn codegen_fn<'tcx>(
125120
// invalidate it when it would change.
126121
context.domtree.clear();
127122

128-
context.want_disasm = crate::pretty_clif::should_write_ir(tcx);
123+
// Perform rust specific optimizations
124+
tcx.sess.time("optimize clif ir", || {
125+
crate::optimize::optimize_function(tcx, instance, context, &mut clif_comments);
126+
});
129127

130128
// Define function
131129
tcx.sess.time("define function", || {
130+
context.want_disasm = crate::pretty_clif::should_write_ir(tcx);
132131
module
133132
.define_function(func_id, context, &mut NullTrapSink {}, &mut NullStackMapSink {})
134133
.unwrap()

0 commit comments

Comments
 (0)