diff options
| author | Niko Matsakis <niko@alum.mit.edu> | 2017-04-27 16:48:48 -0400 |
|---|---|---|
| committer | Niko Matsakis <niko@alum.mit.edu> | 2017-05-02 14:01:01 -0400 |
| commit | 2b32cb90c72d90c722d56324ca0ea9f748ebf4e1 (patch) | |
| tree | 0cfe6e0ea8e729d8c0d3ec2781201a1ea5e6a01f /src/librustc_driver | |
| parent | f23a7bc98a221db000991f6a618602a9a4b35759 (diff) | |
| download | rust-2b32cb90c72d90c722d56324ca0ea9f748ebf4e1.tar.gz rust-2b32cb90c72d90c722d56324ca0ea9f748ebf4e1.zip | |
retool MIR passes completely
The new setup is as follows. There is a pipeline of MIR passes that each
run **per def-id** to optimize a particular function. You are intended
to request MIR at whatever stage you need it. At the moment, there is
only one stage you can request:
- `optimized_mir(def_id)`
This yields the final product. Internally, it pulls the MIR for the
given def-id through a series of steps. Right now, these are still using
an "interned ref-cell" but they are intended to "steal" from one
another:
- `mir_build` -- performs the initial construction for local MIR
- `mir_pass_set` -- performs a suite of optimizations and transformations
- `mir_pass` -- an individual optimization within a suite
So, to construct the optimized MIR, we invoke:
mir_pass_set((MIR_OPTIMIZED, def_id))
which will build up the final MIR.
Diffstat (limited to 'src/librustc_driver')
| -rw-r--r-- | src/librustc_driver/driver.rs | 19 |
1 files changed, 0 insertions, 19 deletions
diff --git a/src/librustc_driver/driver.rs b/src/librustc_driver/driver.rs index 4c984559428..9b11d168e00 100644 --- a/src/librustc_driver/driver.rs +++ b/src/librustc_driver/driver.rs @@ -1005,11 +1005,6 @@ pub fn phase_3_run_analysis_passes<'tcx, F, R>(sess: &'tcx Session, mir_stats::print_mir_stats(tcx, "PRE CLEANUP MIR STATS"); } - time(time_passes, "MIR cleanup and validation", || { - tcx.mir_passes.run_passes(tcx, MIR_CONST); - tcx.mir_passes.run_passes(tcx, MIR_VALIDATED); - }); - time(time_passes, "borrow checking", || borrowck::check_crate(tcx)); @@ -1058,20 +1053,6 @@ pub fn phase_4_translate_to_llvm<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>, "resolving dependency formats", || dependency_format::calculate(&tcx.sess)); - if tcx.sess.opts.debugging_opts.mir_stats { - mir_stats::print_mir_stats(tcx, "PRE OPTIMISATION MIR STATS"); - } - - // Run the passes that transform the MIR into a more suitable form for translation to LLVM - // code. - time(time_passes, "MIR optimisations", || { - tcx.mir_passes.run_passes(tcx, MIR_OPTIMIZED); - }); - - if tcx.sess.opts.debugging_opts.mir_stats { - mir_stats::print_mir_stats(tcx, "POST OPTIMISATION MIR STATS"); - } - let translation = time(time_passes, "translation", |
