about summary refs log tree commit diff
path: root/compiler/rustc_mir_dataflow
AgeCommit message (Collapse)AuthorLines
2022-07-16Rollup merge of #98582 - oli-obk:unconstrained_opaque_type, r=estebankMatthias Krüger-0/+1
Allow destructuring opaque types in their defining scopes fixes #96572 Before this PR, the following code snippet failed with an incomprehensible error, and similar code just ICEd in mir borrowck. ```rust type T = impl Copy; let foo: T = (1u32, 2u32); let (a, b) = foo; ``` The problem was that the last line created MIR projections of the form `foo.0` and `foo.1`, but `foo`'s type is `T`, which doesn't have fields (only its hidden type does). But the pattern supplies enough type information (a tuple of two different inference types) to bind a hidden type.
2022-07-15Introduce opaque type to hidden type projectionOli Scherer-0/+1
2022-07-14Remove FIXME from MIR `always_storage_live_locals`pierwill-3/+0
2022-07-13Rename `debugging_opts` to `unstable_opts`Joshua Nelson-7/+7
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-2/+68
2022-07-09Rollup merge of #99022 - pierwill:always-storage-live-locals, r=pierwillMatthias Krüger-1/+1
MIR dataflow: Rename function to `always_storage_live_locals` Related to #99021. r? ```@JakobDegen``` (as discussed on Zulip)
2022-07-07MIR dataflow: Rename function to `always_storage_live_locals`pierwill-1/+1
Related to #99021.
2022-07-07Rollup merge of #98986 - pierwill:patch-5, r=oli-obkMatthias Krüger-1/+1
Fix missing word in comment
2022-07-07Rollup merge of #98981 - pierwill:pierwill/dataflow-docs-edits, r=Dylan-DPCDylan DPC-8/+8
Edit `rustc_mir_dataflow::framework` documentation Some edits for clarity and consistency.
2022-07-07Move `switch_sources` from Body to BasicBlocksTomasz Miąsko-1/+1
2022-07-07Move `predecessors` from Body to BasicBlocksTomasz Miąsko-1/+1
2022-07-07Move `is_cfg_cyclic` from Body to BasicBlocksTomasz Miąsko-1/+1
2022-07-06Fix missing word in commentpierwill-1/+1
2022-07-06Edit `rustc_mir_dataflow::framework` documentationpierwill-8/+8
2022-07-05Rollup merge of #98944 - pierwill:flatset-docs, r=Dylan-DPCGuillaume Gomez-5/+7
Edit `rustc_mir_dataflow::framework::lattice::FlatSet` docs Cosmetic improvements. Adds a paragraph break, and ellipses to signify arbitrary size of a flat set.
2022-07-05Edit `rustc_mir_dataflow::framework::lattice::FlatSet` docspierwill-5/+7
Cosmetic improvements. Adds a paragraph break, and ellipses to signify arbitrary size of a flat set.
2022-07-01cleanup mir visitor for `rustc::pass_by_value`lcnr-5/+5
2022-06-27Update `smallvec` to 1.8.1.Nicholas Nethercote-1/+1
This pulls in https://github.com/servo/rust-smallvec/pull/282, which gives some small wins for rustc.
2022-06-21Auto merge of #95576 - DrMeepster:box_erasure, r=oli-obkbors-1/+12
Remove dereferencing of Box from codegen Through #94043, #94414, #94873, and #95328, I've been fixing issues caused by Box being treated like a pointer when it is not a pointer. However, these PRs just introduced special cases for Box. This PR removes those special cases and instead transforms a deref of Box into a deref of the pointer it contains. Hopefully, this is the end of the Box<T, A> ICEs.
2022-06-19Rollup merge of #98165 - WaffleLapkin:once_things_renamings, r=m-ou-seMatthias Krüger-2/+2
once cell renamings This PR does the renamings proposed in https://github.com/rust-lang/rust/issues/74465#issuecomment-1153703128 - Move/rename `lazy::{OnceCell, Lazy}` to `cell::{OnceCell, LazyCell}` - Move/rename `lazy::{SyncOnceCell, SyncLazy}` to `sync::{OnceLock, LazyLock}` (I used `Lazy...` instead of `...Lazy` as it seems to be more consistent, easier to pronounce, etc) ```@rustbot``` label +T-libs-api -T-libs
2022-06-17Auto merge of #97863 - JakobDegen:bitset-choice, r=nnethercotebors-4/+4
`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-16Move/rename `lazy::Sync{OnceCell,Lazy}` to `sync::{Once,Lazy}Lock`Maybe Waffle-2/+2
2022-06-15remove box derefs from codgenDrMeepster-1/+12
2022-06-15Rollup merge of #98067 - klensy:compiler-deps2, r=Dylan-DPCYuki Okushi-1/+0
compiler: remove unused deps Removed unused dependencies in compiler crates and moves few `libc` under `target.cfg(unix)` .
2022-06-14`BitSet` perf improvementsJakob Degen-4/+4
This commit makes two changes: 1. Changes `MaybeLiveLocals` to use `ChunkedBitSet` 2. Overrides the `fold` method for the iterator for `ChunkedBitSet`
2022-06-14implement valtrees as the type-system representation for constant valuesb-naber-1/+1
2022-06-13remove currently unused depsklensy-1/+0
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-07Rollup merge of #97832 - tmiasko:const-direction, r=cjgillotMatthias Krüger-22/+16
Change `Direction::{is_forward,is_backward}` functions into constants Make it explicit that the analysis direction is constant. This also makes the value immediately available for optimizations. Previously those functions were neither inline nor generic and so their definition was unavailable when using data flow framework from other crates.
2022-06-07Preserve unused pointer to address castsTomasz Miąsko-6/+3
2022-06-07Change `Direction::{is_forward,is_backward}` functions into constantsTomasz Miąsko-22/+16
Make it explicit that the analysis direction is constant. This also makes the value immediately available for optimizations. Previously those functions were neither inline nor generic and so their definition was unavailable when using data flow framework from other crates.
2022-06-07Remove `AlwaysLiveLocals` wrapper structTomasz Miąsko-29/+10
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-24/+33
2022-05-23Rollup merge of #97292 - compiler-errors:tcxify-rustc, r=davidtwcoDylan DPC-4/+4
Lifetime variance fixes for rustc #97287 migrates rustc to a `Ty` type that is invariant over its lifetime `'tcx`, so I need to fix a bunch of places that assume that `Ty<'a>` and `Ty<'b>` can be unified by shortening both to some common lifetime. This is doable, since many lifetimes are already `'tcx`, so all this PR does is be a bit more explicit that elided lifetimes are actually `'tcx`. Split out from #97287 so the compiler team can review independently.
2022-05-22Lifetime variance fixes for rustcMichael Goulet-4/+4
2022-05-22Remove box syntax from rustc_mir_dataflow and rustc_mir_transformest31-1/+0
2022-05-17Auto merge of #97111 - JohnTitor:rollup-x3vjf6u, r=JohnTitorbors-1/+1
Rollup of 7 pull requests Successful merges: - #96329 (Add a couple tests for #90887 fixes) - #97009 (Allow `unused_macro_rules` in path tests) - #97075 (Add regression test for #81804) - #97079 (Change `Successors` to `impl Iterator<Item = BasicBlock>`) - #97080 (remove the `RelateResultCompare` trait) - #97093 (Migrate `maybe_recover_from_bad_type_plus` diagnostic) - #97102 (Update function pointer call error message) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2022-05-17Auto merge of #97012 - oli-obk:🦀_intrinsics, r=davidtwcobors-3/+1
Add a query for checking whether a function is an intrinsic. work towards #93145 This will reduce churn when we add more ways to declare intrinsics r? `@scottmcm`
2022-05-17Change `Successors` to `impl Iterator<Item = BasicBlock>`SparrowLii-1/+1
2022-05-16Add a query for checking whether a function is an intrinsic.Oli Scherer-3/+1
2022-05-10only_local: always check for misuselcnr-34/+21
2022-05-08Use sparse representation of switch sourcesTomasz Miąsko-1/+1
to avoid quadratic space overhead
2022-05-08Avoid constructing switch sources unless necessaryTomasz Miąsko-3/+4
Switch sources are used by backward analysis with a custom switch int edge effects, but are otherwise unnecessarily computed. Delay the computation until we know that switch sources are indeed required and avoid the computation otherwise.
2022-05-07Auto merge of #96094 - Elliot-Roberts:fix_doctests, r=compiler-errorsbors-36/+36
Begin fixing all the broken doctests in `compiler/` Begins to fix #95994. All of them pass now but 24 of them I've marked with `ignore HELP (<explanation>)` (asking for help) as I'm unsure how to get them to work / if we should leave them as they are. There are also a few that I marked `ignore` that could maybe be made to work but seem less important. Each `ignore` has a rough "reason" for ignoring after it parentheses, with - `(pseudo-rust)` meaning "mostly rust-like but contains foreign syntax" - `(illustrative)` a somewhat catchall for either a fragment of rust that doesn't stand on its own (like a lone type), or abbreviated rust with ellipses and undeclared types that would get too cluttered if made compile-worthy. - `(not-rust)` stuff that isn't rust but benefits from the syntax highlighting, like MIR. - `(internal)` uses `rustc_*` code which would be difficult to make work with the testing setup. Those reason notes are a bit inconsistently applied and messy though. If that's important I can go through them again and try a more principled approach. When I run `rg '```ignore \(' .` on the repo, there look to be lots of different conventions other people have used for this sort of thing. I could try unifying them all if that would be helpful. I'm not sure if there was a better existing way to do this but I wrote my own script to help me run all the doctests and wade through the output. If that would be useful to anyone else, I put it here: https://github.com/Elliot-Roberts/rust_doctest_fixing_tool
2022-05-04Stabilize `bool::then_some`Josh Triplett-1/+0
2022-05-02fix most compiler/ doctestsElliot Roberts-36/+36