Skip to content

Commit 701b274

Browse files
committed
Remove optimize_function
It currently doesn't have any optimizations at all.
1 parent 1cac888 commit 701b274

File tree

2 files changed

+1
-29
lines changed

2 files changed

+1
-29
lines changed

src/base.rs

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ fn compile_fn<'tcx>(
148148
) {
149149
let tcx = cx.tcx;
150150

151-
let mut clif_comments = codegened_func.clif_comments;
151+
let clif_comments = codegened_func.clif_comments;
152152

153153
// Store function in context
154154
let context = cached_context;
@@ -165,17 +165,6 @@ fn compile_fn<'tcx>(
165165
// invalidate it when it would change.
166166
context.domtree.clear();
167167

168-
// Perform rust specific optimizations
169-
tcx.sess.time("optimize clif ir", || {
170-
crate::optimize::optimize_function(
171-
tcx,
172-
module.isa(),
173-
codegened_func.instance,
174-
context,
175-
&mut clif_comments,
176-
);
177-
});
178-
179168
#[cfg(any())] // This is never true
180169
let _clif_guard = {
181170
use std::fmt::Write;

src/optimize/mod.rs

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,3 @@
11
//! Various optimizations specific to cg_clif
22
3-
use cranelift_codegen::isa::TargetIsa;
4-
5-
use crate::prelude::*;
6-
73
pub(crate) mod peephole;
8-
9-
pub(crate) fn optimize_function<'tcx>(
10-
tcx: TyCtxt<'tcx>,
11-
isa: &dyn TargetIsa,
12-
instance: Instance<'tcx>,
13-
ctx: &mut Context,
14-
clif_comments: &mut crate::pretty_clif::CommentWriter,
15-
) {
16-
// FIXME classify optimizations over opt levels once we have more
17-
18-
crate::pretty_clif::write_clif_file(tcx, "preopt", isa, instance, &ctx.func, &*clif_comments);
19-
crate::base::verify_func(tcx, &*clif_comments, &ctx.func);
20-
}

0 commit comments

Comments
 (0)