about summary refs log tree commit diff
path: root/compiler/rustc_mir_dataflow/src/impls
AgeCommit message (Collapse)AuthorLines
2024-07-29Stop using MoveDataParamEnv for places that don't need a param-envMichael Goulet-34/+26
2024-07-29Reformat `use` declarations.Nicholas Nethercote-13/+11
The previous commit updated `rustfmt.toml` appropriately. This commit is the outcome of running `x fmt --all` with the new formatting options.
2024-07-19Avoid ref when using format! in compilerYuri Astrakhan-1/+1
Clean up a few minor refs in `format!` macro, as it has a performance cost. Apparently the compiler is unable to inline `format!("{}", &variable)`, and does a run-time double-reference instead (format macro already does one level referencing). Inlining format args prevents accidental `&` misuse.
2024-07-14Stop using the gen keyword in the compilerMichael Goulet-21/+21
2024-07-07Support tail calls in mir via `TerminatorKind::TailCall`Maybe Waffle-0/+3
2024-06-26Split lifetimes on mir borrowck dataflowOli Scherer-23/+31
2024-05-23Remove `#[macro_use] extern crate tracing` from `rustc_mir_dataflow`.Nicholas Nethercote-0/+1
2024-05-17Remove `Rvalue::CheckedBinaryOp`Scott McMurray-1/+0
2024-04-29Remove `extern crate rustc_middle` from numerous crates.Nicholas Nethercote-0/+1
2024-04-20Add a non-shallow fake borrowNadrieril-1/+1
2024-02-24Implement asm goto in MIR and MIR loweringGary Guo-1/+2
2024-01-22Use a plain bitset for liveness analyses.Camille GILLOT-5/+12
2023-12-21Don't require owned data in `MaybeStorageDead`Tomasz Miąsko-6/+6
2023-12-08Tweak `GenKillAnalysis`.Nicholas Nethercote-10/+10
`GenKillAnalysis` has five methods that take a transfer function arg: - `statement_effect` - `before_statement_effect` - `terminator_effect` - `before_terminator_effect` - `call_return_effect` All the transfer function args have type `&mut impl GenKill<Self::Idx>`, except for `terminator_effect`, which takes the simpler `Self::Domain`. But only the first two need to be `impl GenKill`. The other three can all be `Self::Domain`, just like `Analysis`. So this commit changes the last two to take `Self::Domain`, making `GenKillAnalysis` and `Analysis` more similar. (Another idea would be to make all these methods `impl GenKill`. But that doesn't work: `MaybeInitializedPlaces::terminator_effect` requires the arg be `Self::Domain` so that `self_is_unwind_dead(place, state)` can be called on it.)
2023-11-27Remove uses of `ResultsClonedCursor`.Nicholas Nethercote-13/+12
By just cloning the entire `Results` in the one place where `ResultsClonedCursor` was used. This is extra allocations but the performance effect is negligible.
2023-11-27Remove some unused code relating to `ResultsCloned`.Nicholas Nethercote-12/+0
2023-11-24Remove unused arguments from `on_all_children_bits`.Nicholas Nethercote-24/+13
`on_all_children_bits` has two arguments that are unused: `tcx` and `body`. This was not detected by the compiler because it's a recursive function. This commit removes them, and removes lots of other arguments and fields that are no longer necessary.
2023-11-24Remove unused `EverInitializedPlaces::tcx` field.Nicholas Nethercote-4/+2
2023-11-24Remove unneeded derives from `MaybeLiveLocals`.Nicholas Nethercote-1/+0
2023-11-21Fix `clippy::needless_borrow` in the compilerNilstrieb-2/+2
`x clippy compiler -Aclippy::all -Wclippy::needless_borrow --fix`. Then I had to remove a few unnecessary parens and muts that were exposed now.
2023-11-08rename `BorrowKind::Shallow` to `Fake`lcnr-2/+2
also adds some comments
2023-11-08generator layout: ignore fake borrowslcnr-2/+7
2023-10-21Remove on_all_drop_children_bits.Camille GILLOT-2/+2
As drop elaboration only tracks places that need dropping, is has become equivalent to `on_all_children_bits`.
2023-10-21Avoid using a magic value for untracked locals.Camille GILLOT-3/+7
2023-10-20s/generator/coroutine/Oli Scherer-4/+4
2023-10-20s/Generator/Coroutine/Oli Scherer-4/+4
2023-08-24when terminating during unwinding, show the reason whyRalf Jung-3/+3
2023-08-20give some unwind-related terminators a more clear nameRalf Jung-6/+6
2023-08-16Use Terminator::edges for backward analysis too.Camille GILLOT-1/+1
2023-08-16Only evaluate yield place after resume in liveness.Camille GILLOT-15/+31
2023-08-16Rename YieldResumeEffect.Camille GILLOT-6/+6
2023-08-16Make TerminatorEdge plural.Camille GILLOT-15/+15
2023-08-16Rename MaybeUnreachable.Camille GILLOT-7/+6
2023-08-16Only run MaybeInitializedPlaces once for drop elaboration.Camille GILLOT-9/+63
2023-08-16Allow apply_terminator_effect to customize edges.Camille GILLOT-99/+78
2023-08-16Move domain_size to GenKillAnalysis.Camille GILLOT-0/+36
2023-08-16Move initialization dataflow impls into their own module.Camille GILLOT-749/+756
2023-08-16Simplify for_each_mut_borrow.Camille GILLOT-58/+9
2023-07-19Turn copy into moves during DSE.Camille GILLOT-1/+2
2023-07-12Re-format let-else per rustfmt updateMark Rousskov-2/+6
2023-07-04bring back un_derefer and rewrite it againDrMeepster-4/+4
2023-06-08Auto merge of #108293 - Jarcho:mut_analyses, r=eholkbors-66/+74
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-18Take MIR dataflow analyses by mutable reference.Jason Newcomb-66/+74
2023-05-09Explicitly skip arguments.Camille GILLOT-0/+1
2023-05-09Implement SSA-based reference propagation.Camille GILLOT-1/+67
2023-04-29Make PlaceMention a non-mutating use.Camille GILLOT-0/+1
2023-04-24Split `{Idx, IndexVec, IndexSlice}` into their own modulesMaybe Waffle-1/+1
2023-04-06Rename `Abort` terminator to `Terminate`Gary Guo-3/+3
Unify terminology used in unwind action and terminator, and reflect the fact that a nounwind panic is triggered instead of an immediate abort is triggered for this terminator.
2023-03-09Introduce a no-op PlaceMention statement for `let _ =`.Camille GILLOT-0/+2