about summary refs log tree commit diff
path: root/src/librustc_mir/transform/dump_mir.rs
AgeCommit message (Collapse)AuthorLines
2020-08-30mv compiler to compiler/mark-61/+0
2020-04-22Use `Body` everywhereDylan MacKenzie-8/+2
2020-04-01Rollup merge of #70511 - ecstatic-morse:mir-dataflow-graphviz, r=davidtwcoMazdak Farrokhzad-1/+1
Add `-Z dump-mir-dataflow` flag for dumping dataflow results visualization Previously, to visualize the results of a MIR dataflow pass, one had to add a `#[rustc_mir(borrowck_graphviz_postflow)]` attribute to functions of interest. However, there is no way to specify this attribute on closures and generators, so it was impossible to view results for these MIR bodies. This PR adds a flag, `-Z dump-mir-dataflow`, which will output the dataflow results for any functions specified in `-Z dump-mir` to the output directory specified by `-Z dump-mir-dir`. This behavior is modeled on the `-Z dump-mir-graphviz` flag.
2020-03-30rustc -> rustc_middle part 2Mazdak Farrokhzad-2/+2
2020-03-28`dump_enabled` takes a `DefId` instead of `MirSource`Dylan MacKenzie-1/+1
2020-03-16use direct imports for `rustc::{lint, session}`.Mazdak Farrokhzad-1/+1
2020-02-01Use BufWriterShotaro Yamada-1/+1
2019-12-22Format the worldMark Rousskov-12/+18
2019-12-05rustc: Apply clearer naming to BodyAndCache, fix Deref impl, remove unneeded ↵Paul Daniel Faria-2/+2
Index impl, remove body fn rustc_codegen_ssa: Fix BodyAndCache reborrow to Body and change instances of body() call to derefence rustc_mir: Fix BodyAndCache reborrow to Body and change intances of body() call to derefence
2019-12-02Remove HasLocalDecls impl from BodyCache's, properly reborrow to Body, ↵Paul Daniel Faria-1/+1
rename all body_cache back to body
2019-12-02Fix tidy errorsPaul Daniel Faria-2/+3
2019-12-02Simplify BodyCache impl and fix all remaining type errors in librustc_mir ↵Paul Daniel Faria-2/+2
(lifetime errors still exist)
2019-08-22Move 'tcx lifetime on MirPassWesley Wiser-2/+2
2019-07-03Remove needless lifetimesJeremy Stucki-2/+2
2019-06-14Run `rustfmt --file-lines ...` for changes from previous commits.Eduard-Mihai Burtescu-6/+1
2019-06-14Unify all uses of 'gcx and 'tcx.Eduard-Mihai Burtescu-3/+3
2019-06-12Run `rustfmt --file-lines ...` for changes from previous commits.Eduard-Mihai Burtescu-17/+15
2019-06-12rustc: replace `TyCtxt<'tcx, 'gcx, 'tcx>` with `TyCtxt<'gcx, 'tcx>`.Eduard-Mihai Burtescu-3/+3
2019-06-12Fix fallout from `deny(unused_lifetimes)`.Eduard-Mihai Burtescu-3/+3
2019-06-12rustc: replace `TyCtxt<'a, 'gcx, 'tcx>` with `TyCtxt<'tcx, 'gcx, 'tcx>`.Eduard-Mihai Burtescu-3/+3
2019-06-09Changed usages of `mir` in librustc::mir and librustc_mir to `body`Jad Ghalayini-3/+3
2019-05-28Changes the type `mir::Mir` into `mir::Body`Claude-Alban RANÉLY-VERGÉ-DÉPRÉ-3/+3
The commit should have changed comments as well. At the time of writting, it passes the tidy and check tool. Revisions asked by eddyb : - Renamed of all the occurences of {visit/super}_mir - Renamed test structures `CachedMir` to `Cached` Fixing the missing import on `AggregateKind`
2019-02-09fix rebase falloutRalf Jung-2/+2
2019-02-08librustc_mir => 2018Taiki Endo-3/+3
2018-12-25Remove licensesMark Rousskov-10/+0
2018-03-02Run Rustfix on librustc_mirManish Goregaokar-1/+1
2017-11-14rustc: split off BodyOwnerKind from MirSource.Eduard-Mihai Burtescu-2/+1
2017-11-14rustc_mir: drive passes directly with a macro.Eduard-Mihai Burtescu-31/+15
2017-11-14rustc: move the MIR pass infrastructure and list to rustc_mir.Eduard-Mihai Burtescu-1/+2
2017-10-04Expand mir dump in order to handle NLL passChristopher Vittal-1/+12
Extend `dump_mir` and functions it calls in order to allow callers to add custom information. We do this by adding an enum `PassWhere` and an extra argument of type `FnMut(PassWhere, &mut Write) -> io::Result<()>`. This callback is responsible for printing the extra information when MIR is dumped at various stages. For the "nll" pass, use the new mechanism to dump the `Region` information after the header, but before the control flow graph for every function. In the interest of keeping the output somewhat concise, implement a custom Debug impl for `Region` Open Questions: * What should we call what has been called `PassWhere` so far?
2017-05-02rip out everything but `MirPass`, move the logic into suitesNiko Matsakis-32/+18
2017-05-02convert the `inline` pass to use the new multi resultNiko Matsakis-6/+14
This involves changing various details about that system, though the basic shape remains the same.
2017-05-02introduce idea of "stealable" MIRNiko Matsakis-5/+4
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-02retool MIR passes completelyNiko Matsakis-27/+29
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-2/+2
this temporary disables `inline`
2017-05-02introduce `DefIdPass` and remove all impls of `Pass` but `Inline`Niko Matsakis-4/+4
2017-05-02simplify the MirPass traits and passes dramaticallyNiko Matsakis-34/+35
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-2/+2
2017-05-02introduce `mir_keys()`Niko Matsakis-1/+1
Each MIR key is a DefId that has MIR associated with it
2017-03-21Teach rustc --emit=mirJake Goulding-0/+14
2017-03-18move the drop expansion code to rustc_mirAriel Ben-Yehuda-2/+2
2016-11-14Remove `scope_auxiliary`.Nicholas Nethercote-2/+1
This reduces the peak RSS for a cut-down version of the program in #36799 by 10%, from 951MB to 856MB.
2016-10-28rustc: move mir::repr::* to mir.Eduard Burtescu-1/+1
2016-09-06Count and report time taken by MIR passesSimonas Kazlauskas-2/+2
2016-06-09use the type name as the pass nameAriel Ben-Yehuda-3/+1
2016-06-09add hook infrastructure for automatically dumping MIR on every passAriel Ben-Yehuda-7/+55
2016-06-05break critical edges only when neededAriel Ben-Yehuda-0/+27
the *only* place where critical edges need to be broken is on Call instructions, so only break them there.