about summary refs log tree commit diff
path: root/compiler/rustc_mir_dataflow/src
AgeCommit message (Collapse)AuthorLines
2023-08-16Create bottom on-the-fly instead of cloning it.Camille GILLOT-3/+4
2023-08-16Simplify for_each_mut_borrow.Camille GILLOT-58/+9
2023-08-06Rollup merge of #114505 - ouz-a:cleanup_mir, r=RalfJungMatthias Krüger-1/+1
Add documentation to has_deref Documentation of `has_deref` needed some polish to be more clear about where it should be used and what's it's purpose. cc https://github.com/rust-lang/rust/issues/114401 r? `@RalfJung`
2023-08-06cleanup misinformation regarding has_derefouz-a-1/+1
2023-08-01Use upvar_tys in more places, make it a listMichael Goulet-8/+2
2023-07-30inline format!() args up to and including rustc_codegen_llvmMatthias Krüger-2/+2
2023-07-19Turn copy into moves during DSE.Camille GILLOT-1/+2
2023-07-14refactor(rustc_middle): Substs -> GenericArgMahdi Dibaiee-28/+32
2023-07-12Re-format let-else per rustfmt updateMark Rousskov-2/+6
2023-07-11Auto merge of #113316 - DrMeepster:underefer_perf, r=oli-obkbors-122/+184
Rewrite `UnDerefer`, again This PR is intended to improve the perf regression introduced by #112882. `UnDerefer` has been separated out again for borrowck reasons. It was a bit overzealous to remove it in the previous PR. r? `@oli-obk`
2023-07-10optimization round 2DrMeepster-34/+96
- moved work from `find_local` to `gather_statement` - created custom iterator for `iter_projections` - reverted change from `IndexVec` to `FxIndexMap`
2023-07-05Move `TyCtxt::mk_x` to `Ty::new_x` where applicableBoxy-5/+8
2023-07-04bring back un_derefer and rewrite it againDrMeepster-105/+105
2023-06-29Merge `un_derefer` into `MovePathLookup`DrMeepster-115/+129
2023-06-27Export AnalysisResults trait in rustc_mir_dataflowFlorian Groult-5/+5
2023-06-27Auto merge of #112693 - ericmarkmartin:use-more-placeref, r=spastorinobors-14/+5
Use PlaceRef abstractions more often Associated issue: https://github.com/rust-lang/rust/issues/80647 r? `@spastorino`
2023-06-25use PlaceRef abstractions more consistentlyEric Mark Martin-14/+5
2023-06-20merge `BorrowKind::Unique` into `BorrowKind::Mut`Ziru Niu-1/+1
2023-06-19Rollup merge of #112232 - fee1-dead-contrib:match-eq-const-msg, r=b-naberMichael Goulet-13/+5
Better error for non const `PartialEq` call generated by `match` Resolves #90237
2023-06-19Auto merge of #112617 - lqd:dump-mir-dataflow, r=tmiaskobors-7/+7
make mir dataflow graphviz dumps opt-in This should save some MIR traversals and allocations that are not really needed. Small win but noticeable locally. Let's see what LTO/PGO say. r? `@ghost`
2023-06-18Better error for non const `PartialEq` call generated by `match`Deadbeef-13/+5
2023-06-16remove box_free and replace with drop implDrMeepster-74/+26
2023-06-14make mir dataflow graphviz dumps opt-inRémy Rakic-7/+7
2023-06-08Auto merge of #108293 - Jarcho:mut_analyses, r=eholkbors-241/+426
Take MIR dataflow analyses by mutable reference The main motivation here is any analysis requiring dynamically sized scratch memory to work. One concrete example would be pointer target tracking, where tracking the results of a dereference can result in multiple possible targets. This leads to processing multi-level dereferences requiring the ability to handle a changing number of potential targets per step. A (simplified) function for this would be `fn apply_deref(potential_targets: &mut Vec<Target>)` which would use the scratch space contained in the analysis to send arguments and receive the results. The alternative to this would be to wrap everything in a `RefCell`, which is what `MaybeRequiresStorage` currently does. This comes with a small perf cost and loses the compiler's guarantee that we don't try to take multiple borrows at the same time. For the implementation: * `AnalysisResults` is an unfortunate requirement to avoid an unconstrained type parameter error. * `CloneAnalysis` could just be `Clone` instead, but that would result in more work than is required to have multiple cursors over the same result set. * `ResultsVisitor` now takes the results type on in each function as there's no other way to have access to the analysis without cloning it. This could use an associated type rather than a type parameter, but the current approach makes it easier to not care about the type when it's not necessary. * `MaybeRequiresStorage` now no longer uses a `RefCell`, but the graphviz formatter now does. It could be removed, but that would require even more changes and doesn't really seem necessary.
2023-05-29unique borrows are mutating useslcnr-2/+1
2023-05-25Remove DesugaringKind::Replace.Camille GILLOT-3/+9
2023-05-18Take MIR dataflow analyses by mutable reference.Jason Newcomb-241/+426
2023-05-17Rollup merge of #110930 - b-naber:normalize-elaborate-drops, r=cjgillotDylan DPC-0/+1
Don't expect normalization to succeed in elaborate_drops Fixes https://github.com/rust-lang/rust/issues/110682 This was exposed through the changes in https://github.com/rust-lang/rust/pull/109247, which causes more things to be inlined. Inlining can happen before monomorphization, so we can't expect normalization to succeed. In the elaborate_drops analysis we currently have [this call](https://github.com/rust-lang/rust/blob/033aa092ab23ba14cdad27073c5e37ba0eddb428/compiler/rustc_mir_dataflow/src/elaborate_drops.rs#L278) to `normalize_erasing_regions`, which ICEs when normalization fails. The types are used to infer [whether the type needs a drop](https://github.com/rust-lang/rust/blob/033aa092ab23ba14cdad27073c5e37ba0eddb428/compiler/rustc_mir_dataflow/src/elaborate_drops.rs#L374), where `needs_drop` itself [uses `try_normalize_erasing_regions`](https://github.com/rust-lang/rust/blob/033aa092ab23ba14cdad27073c5e37ba0eddb428/compiler/rustc_middle/src/ty/util.rs#L1121). ~[`instance_mir`](https://doc.rust-lang.org/stable/nightly-rustc/rustc_middle/ty/context/struct.TyCtxt.html#method.instance_mir) isn't explicit about whether it expects the instances corresponding to the `InstanceDef`s to be monomorphized (though I think in all other contexts the function is used post-monomorphization), so the use of `instance_mir` in inlining doesn't necessarily seem wrong to me.~
2023-05-10Auto merge of #110820 - cjgillot:faster-dcp, r=oli-obkbors-124/+166
Optimize dataflow-const-prop place-tracking infra Optimization opportunities found while investigating https://github.com/rust-lang/rust/pull/110719 Computing places breadth-first ensures that we create short projections before deep projections, since the former are more likely to be propagated. The most relevant is the pre-computation of flooded places. Callgrind showed `flood_*` methods and especially `preorder_preinvoke` were especially hot. This PR attempts to pre-compute the set of `ValueIndex` that `preorder_invoke` would visit. Using this information, we make some `PlaceIndex` inaccessible when they contain no `ValueIndex`, allowing to skip computations for those places. cc `@jachris` as original author
2023-05-10don't inline polymorphic adt instances whose fields contain projectionsb-naber-8/+3
in DropGlue.
2023-05-09Explicitly skip arguments.Camille GILLOT-0/+1
2023-05-09Implement SSA-based reference propagation.Camille GILLOT-1/+67
2023-05-09Prevent stack overflow.Camille GILLOT-1/+2
2023-05-09Add a few comments.Camille GILLOT-6/+12
2023-05-09Do not flood on copy_nonoverlapping.Camille GILLOT-5/+7
2023-05-09Extract handle_set_discriminant.Camille GILLOT-2/+20
2023-05-09Trim the places that will not be used.Camille GILLOT-1/+10
2023-05-09Precompute values to flood.Camille GILLOT-19/+51
2023-05-09Create tracked places breadth first.Camille GILLOT-65/+49
2023-05-09Make HasTop and HasBottom consts.Camille GILLOT-32/+22
2023-04-29Make PlaceMention a non-mutating use.Camille GILLOT-0/+1
2023-04-28dont expect normalization to succeed in elaborate_dropsb-naber-3/+9
2023-04-24Split `{Idx, IndexVec, IndexSlice}` into their own modulesMaybe Waffle-11/+11
2023-04-21offset_ofDrMeepster-1/+1
2023-04-19Auto merge of #110407 - Nilstrieb:fluent-macro, r=davidtwcobors-1/+1
Add `rustc_fluent_macro` to decouple fluent from `rustc_macros` Fluent, with all the icu4x it brings in, takes quite some time to compile. `fluent_messages!` is only needed in further downstream rustc crates, but is blocking more upstream crates like `rustc_index`. By splitting it out, we allow `rustc_macros` to be compiled earlier, which speeds up `x check compiler` by about 5 seconds (and even more after the needless dependency on `serde_json` is removed from `rustc_data_structures`).
2023-04-18Add `rustc_fluent_macro` to decouple fluent from `rustc_macros`Nilstrieb-1/+1
Fluent, with all the icu4x it brings in, takes quite some time to compile. `fluent_messages!` is only needed in further downstream rustc crates, but is blocking more upstream crates like `rustc_index`. By splitting it out, we allow `rustc_macros` to be compiled earlier, which speeds up `x check compiler` by about 5 seconds (and even more after the needless dependency on `serde_json` is removed from `rustc_data_structures`).
2023-04-17Spelling - compilerJosh Soref-1/+1
* account * achieved * advising * always * ambiguous * analysis * annotations * appropriate * build * candidates * cascading * category * character * clarification * compound * conceptually * constituent * consts * convenience * corresponds * debruijn * debug * debugable * debuggable * deterministic * discriminant * display * documentation * doesn't * ellipsis * erroneous * evaluability * evaluate * evaluation * explicitly * fallible * fulfill * getting * has * highlighting * illustrative * imported * incompatible * infringing * initialized * into * intrinsic * introduced * javascript * liveness * metadata * monomorphization * nonexistent * nontrivial * obligation * obligations * offset * opaque * opportunities * opt-in * outlive * overlapping * paragraph * parentheses * poisson * precisely * predecessors * predicates * preexisting * propagated * really * reentrant * referent * responsibility * rustonomicon * shortcircuit * simplifiable * simplifications * specify * stabilized * structurally * suggestibility * translatable * transmuting * two * unclosed * uninhabited * visibility * volatile * workaround Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>
2023-04-10Fix typos in compilerDaniPopes-8/+8
2023-04-06Revert box_free unwind actionGary Guo-1/+5
2023-04-06Fix new usage of old apiGary Guo-1/+1