about summary refs log tree commit diff
path: root/compiler/rustc_mir_dataflow/src/impls
AgeCommit message (Collapse)AuthorLines
2023-03-09Introduce a no-op PlaceMention statement for `let _ =`.Camille GILLOT-0/+2
2023-03-07Remove DropAndReplace terminatorGiacomo Pasini-4/+1
PR 107844 made DropAndReplace unused, let's remove it completely from the codebase.
2023-02-16Replace some `then`s with some `then_some`sMaybe Waffle-1/+1
2023-02-16`if $c:expr { Some($r:expr) } else { None }` =>> `$c.then(|| $r)`Maybe Waffle-7/+1
2023-02-06Only exclude locals if the place is not indirect.Camille GILLOT-1/+3
2023-01-23Create stable metric to measure long computation in Const EvalBryan Garza-0/+2
This patch adds a `MirPass` that tracks the number of back-edges and function calls in the CFG, adds a new MIR instruction to increment a counter every time they are encountered during Const Eval, and emit a warning if a configured limit is breached.
2023-01-17Remove double spaces after dots in commentsMaybe Waffle-1/+1
2022-12-20rustc: Remove needless lifetimesJeremy Stucki-2/+2
2022-12-13Don't require owned data in `MaybeStorageLive`Jakob Degen-6/+7
2022-11-26Rewrite dest prop.Jakob Degen-124/+0
This fixes a number of correctness issues from the previous version. Additionally, we use a new strategy which has much better performance charactersitics and also finds more opportunities to apply the optimization.
2022-09-06Generalize the Assume intrinsic statement to a general Intrinsic statementOli Scherer-4/+2
2022-09-06Lower the assume intrinsic to a MIR statementOli Scherer-0/+2
2022-08-25Add method that applies DefUse effectTomasz Miąsko-15/+11
2022-08-25Fix liveness analysis for yield terminatorsTomasz Miąsko-32/+61
A resume place is evaluated and assigned to only after a yield terminator resumes. Ensure that locals used when evaluating the resume place are live across the yield.
2022-08-01Remove redundant `TransferWrapper` structTomasz Miąsko-14/+2
2022-07-13Rename `debugging_opts` to `unstable_opts`Joshua Nelson-4/+4
This is no longer used only for debugging options (e.g. `-Zoutput-width`, `-Zallow-features`). Rename it to be more clear.
2022-07-12add new rval, pull deref earlyouz-a-1/+2
2022-07-06Fix missing word in commentpierwill-1/+1
2022-07-01cleanup mir visitor for `rustc::pass_by_value`lcnr-5/+5
2022-06-17Auto merge of #97863 - JakobDegen:bitset-choice, r=nnethercotebors-2/+2
`BitSet` related perf improvements This commit makes two changes: 1. Changes `MaybeLiveLocals` to use `ChunkedBitSet` 2. Overrides the `fold` method for the iterator for `ChunkedBitSet` I have local benchmarks verifying that each of these changes individually yield significant perf improvements to #96451 . I'm hoping this will be true outside of that context too. If that is not the case, I'll try to gate things on where they help as needed r? `@nnethercote` who I believe was working on closely related things, cc `@tmiasko` because of the destprop pr
2022-06-14`BitSet` perf improvementsJakob Degen-2/+2
This commit makes two changes: 1. Changes `MaybeLiveLocals` to use `ChunkedBitSet` 2. Overrides the `fold` method for the iterator for `ChunkedBitSet`
2022-06-12Merge arms in borrowed locals transfer functionTomasz Miąsko-7/+1
2022-06-12Remove duplicated implementations of borrowed locals analysisTomasz Miąsko-0/+21
2022-06-08Rollup merge of #97597 - tmiasko:simplify-locals-side-effects, ↵Dylan DPC-6/+3
r=RalfJung,JakobDegen Preserve unused pointer to address casts Fixes #97421. cc `@RalfJung`
2022-06-07Preserve unused pointer to address castsTomasz Miąsko-6/+3
2022-06-07Remove `AlwaysLiveLocals` wrapper structTomasz Miąsko-3/+2
It is just a wrapper around a `BitSet` and doesn't have any functionality of its own.
2022-05-31Add a pointer to address cast kindTomasz Miąsko-15/+8
A pointer to address cast are often special-cased. Introduce a dedicated cast kind to make them easy distinguishable.
2022-05-24Add dead store elimination passJakob Degen-22/+161
2022-05-23Refactor call terminator to always hold a destination placeJakob Degen-8/+6
2022-05-02fix most compiler/ doctestsElliot Roberts-36/+36
2022-04-11Add new `MutatatingUseContext`s for deinit and `SetDiscriminant`Jakob Degen-25/+14
2022-04-11Add new `Deinit` statement kindJakob Degen-1/+2
2022-03-30Spellchecking compiler commentsYuri Astrakhan-2/+2
This PR cleans up the rest of the spelling mistakes in the compiler comments. This PR does not change any literal or code spelling issues.
2022-03-11Improve `AdtDef` interning.Nicholas Nethercote-3/+3
This commit makes `AdtDef` use `Interned`. Much the commit is tedious changes to introduce getter functions. The interesting changes are in `compiler/rustc_middle/src/ty/adt.rs`.
2022-02-26Rollup merge of #94087 - tmiasko:rm-ignore-borrow-on-drop, r=jackh726Matthias Krüger-34/+11
Remove unused `unsound_ignore_borrow_on_drop`
2022-02-26Rollup merge of #93870 - tmiasko:const-precise-live-drops-with-coverage, ↵Matthias Krüger-15/+18
r=ecstatic-morse Fix switch on discriminant detection in a presence of coverage counters Fixes #93848. r? ``@ecstatic-morse``
2022-02-23Introduce `ChunkedBitSet` and use it for some dataflow analyses.Nicholas Nethercote-7/+7
This reduces peak memory usage significantly for some programs with very large functions, such as: - `keccak`, `unicode_normalization`, and `match-stress-enum`, from the `rustc-perf` benchmark suite; - `http-0.2.6` from crates.io. The new type is used in the analyses where the bitsets can get huge (e.g. 10s of thousands of bits): `MaybeInitializedPlaces`, `MaybeUninitializedPlaces`, and `EverInitializedPlaces`. Some refactoring was required in `rustc_mir_dataflow`. All existing analysis domains are either `BitSet` or a trivial wrapper around `BitSet`, and access in a few places is done via `Borrow<BitSet>` or `BorrowMut<BitSet>`. Now that some of these domains are `ClusterBitSet`, that no longer works. So this commit replaces the `Borrow`/`BorrowMut` usage with a new trait `BitSetExt` containing the needed bitset operations. The impls just forward these to the underlying bitset type. This required fiddling with trait bounds in a few places. The commit also: - Moves `static_assert_size` from `rustc_data_structures` to `rustc_index` so it can be used in the latter; the former now re-exports it so existing users are unaffected. - Factors out some common "clear excess bits in the final word" functionality in `bit_set.rs`. - Uses `fill` in a few places instead of loops.
2022-02-19Adopt let else in more placesest31-12/+8
2022-02-17Remove unused `unsound_ignore_borrow_on_drop`Tomasz Miąsko-34/+11
2022-02-10Fix switch on discriminant detection in a presence of coverage countersTomasz Miąsko-15/+18
2022-01-12Remove deprecated LLVM-style inline assemblyTomasz Miąsko-6/+0
2021-12-16Remove `in_band_lifetimes` from `rustc_mir_dataflow`LegionMammal978-12/+12
See #91867 for more information.
2021-12-03Add initial AST and MIR support for unwinding from inline assemblyAmanieu d'Antras-75/+77
2021-11-13Mark mutably borrowed places as maybe initializedDylan MacKenzie-6/+67
2021-11-03Remove `MaybeMutBorrowedLocals`Tomasz Miąsko-118/+16
2021-10-04Discuss field-sensitivity and enums in context of `MaybeLiveLocals`Dylan MacKenzie-0/+31
2021-09-28More tracing instrumentationOli Scherer-12/+6
2021-09-25Introduce `Rvalue::ShallowInitBox`Gary Guo-0/+1
2021-09-07Move the dataflow framework to its own crate.Camille GILLOT-0/+1570