about summary refs log tree commit diff
path: root/src/librustc/mir/transform.rs
AgeCommit message (Collapse)AuthorLines
2017-11-14rustc: split off BodyOwnerKind from MirSource.Eduard-Mihai Burtescu-74/+0
2017-11-14rustc: remove unused MirSource::GeneratorDrop.Eduard-Mihai Burtescu-4/+0
2017-11-14rustc: move the MIR pass infrastructure and list to rustc_mir.Eduard-Mihai Burtescu-113/+1
2017-10-31make `MirSource::from_local_def_id` invokable with 'gcx and 'tcxNiko Matsakis-1/+1
2017-10-31extend `dump_mir` to work for any tcx, not just global tcxNiko Matsakis-2/+2
2017-07-28Generator literal supportJohn Kåre Alsaker-1/+5
2017-05-02remove `mir_passes` from `Session` and add a FIXMENiko Matsakis-0/+2
2017-05-02simplify down to one query per pass suiteNiko Matsakis-6/+7
2017-05-02rip out everything but `MirPass`, move the logic into suitesNiko Matsakis-62/+10
2017-05-02remove `Pass` and (temporarily) drop `Inline`Niko Matsakis-29/+3
2017-05-02add a README describing the whole designNiko Matsakis-0/+2
2017-05-02convert the `inline` pass to use the new multi resultNiko Matsakis-19/+53
This involves changing various details about that system, though the basic shape remains the same.
2017-05-02introduce idea of "stealable" MIRNiko Matsakis-7/+7
This is a more principled version of the `RefCell` we were using before. We now allocate a `Steal<Mir<'tcx>>` for each intermediate MIR pass; when the next pass steals the entry, any later attempts to use it will panic (there is no way to *test* if MIR is stolen, you're just supposed to *know*).
2017-05-02rename `MirPassSet` to `MirSuite`Niko Matsakis-15/+15
This seems like a better noun.
2017-05-02retool MIR passes completelyNiko Matsakis-75/+65
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.
2017-05-02move to only def-id passesNiko Matsakis-6/+10
this temporary disables `inline`
2017-05-02rewrite `Passes` to have sets of passesNiko Matsakis-18/+33
Also, store the completed set of passes in the tcx.
2017-05-02introduce `DefIdPass` and remove all impls of `Pass` but `Inline`Niko Matsakis-27/+53
2017-05-02simplify the MirPass traits and passes dramaticallyNiko Matsakis-75/+58
Overall goal: reduce the amount of context a mir pass needs so that it resembles a query. - The hooks are no longer "threaded down" to the pass, but rather run automatically from the top-level (we also thread down the current pass number, so that the files are sorted better). - The hook now receives a *single* callback, rather than a callback per-MIR. - The traits are no longer lifetime parameters, which moved to the methods -- given that we required `for<'tcx>` objecs, there wasn't much point to that. - Several passes now store a `String` instead of a `&'l str` (again, no point).
2017-05-02rework `MirPass` API to be stateless and extract helper fnsNiko Matsakis-26/+44
2017-05-02introduce `mir_keys()`Niko Matsakis-7/+3
Each MIR key is a DefId that has MIR associated with it
2017-02-25rustc: consolidate dep-tracked hashmaps in tcx.maps.Eduard-Mihai Burtescu-2/+2
2017-01-26rustc: rename TyCtxt's `map` field to `hir`.Eduard-Mihai Burtescu-3/+3
2016-12-28rustc: separate TraitItem from their parent Item, just like ImplItem.Eduard-Mihai Burtescu-1/+1
2016-10-28rustc: move the MIR map into TyCtxt.Eduard Burtescu-8/+11
2016-10-28rustc: move mir::repr::* to mir.Eduard Burtescu-1/+1
2016-09-06Count and report time taken by MIR passesSimonas Kazlauskas-8/+9
2016-08-08track MIR through the dep-graphNiko Matsakis-8/+5
Per the discussion on #34765, we make one `DepNode::Mir` variant and use it to represent both the MIR tracking map as well as passes that operate on MIR. We also track loads of cached MIR (which naturally comes from metadata). Note that the "HAIR" pass adds a read of TypeckItemBody because it uses a myriad of tables that are not individually tracked.
2016-06-16fix MirSource::Promoted handlingAriel Ben-Yehuda-10/+11
2016-06-09use the type name as the pass nameAriel Ben-Yehuda-1/+3
2016-06-09add hook infrastructure for automatically dumping MIR on every passAriel Ben-Yehuda-5/+47
2016-05-16Revised mir-dataflow.Felix S. Klock II-1/+1
Incorporates many fixes contributed by arielb1. ---- revise borrowck::mir::dataflow code to allow varying domain for bitvectors. This particular code implements the `BitDenotation` trait for three analyses: * `MovingOutStatements`, which, like `borrowck::move_data`, maps each bit-index to a move instruction, and a 1 means "the effect of this move reaches this point" (and the assigned l-value, if a scoped declaration, is still in scope). * `MaybeInitializedLvals`, which maps each bit-index to an l-value. A 1 means "there exists a control flow path to this point that initializes the associated l-value." * `MaybeUninitializedLvals`, which maps each bit-index to an l-value A 1 means "there exists a control flow path to this point that de-initializes the associated l-value." ---- Revised `graphviz` dataflow-rendering support in `borrowck::mir`. One big difference is that this code is now parameterized over the `BitDenotation`, so that it can be used to render dataflow results independent of how the dataflow bitvectors are interpreted; see where reference to `MoveOut` is replaced by the type parameter `D`. ---- Factor out routine to query subattributes in `#[rustc_mir(..)]`. (Later commits build upon this for some unit testing and instrumentation.) ---- thread through a tcx so that I can query types of lvalues as part of analysis. ---- Revised `BitDenotation::Ctxt`, allowing variation beyond `MoveData`. The main motivation is to ease threading through a `TyCtxt`. (In hindsight it might have been better to instead attach the `TyCtxt` to each of the different dataflow implementations, but that would require e.g. switching away from having a `Default` impl, so I am leaving that experiment for another time.)
2016-05-11rustc: Split 'tcx into 'gcx and 'tcx for InferCtxt and its users.Eduard Burtescu-7/+8
2016-05-11rustc: Replace &'a TyCtxt<'tcx> with a TyCtxt<'a, 'tcx> wrapper.Eduard Burtescu-12/+12
2016-05-07mir: prepare for rvalue promotion support.Eduard Burtescu-3/+74
2016-03-27rustc: move cfg, infer, traits and ty from middle to top-level.Eduard Burtescu-1/+1
2016-03-07Change MirPass to also take NodeIdSimonas Kazlauskas-4/+4
2016-03-04Address commentsSimonas Kazlauskas-1/+3
2016-03-04Add Pass manager for MIRSimonas Kazlauskas-3/+60
2016-02-20use the FulfillmentContext and InferCtxt more correctlyAriel Ben-Yehuda-2/+2
2016-02-09refactor `MirPass` to always require a tcxOliver Schneider-0/+16