about summary refs log tree commit diff
path: root/compiler/rustc_mir_transform
AgeCommit message (Collapse)AuthorLines
2022-06-30Check history earlier.Camille GILLOT-14/+5
2022-06-29Rollup merge of #98625 - RalfJung:retag, r=oli-obkDylan DPC-5/+18
emit Retag for compound types with reference fields I want to add an option to Miri to do retagging inside reference fields. But that means we first have to even emit `Retag` for types that *contain* references (rather than being of reference types). :) Stacked Borrows originally did that, but we stopped doing it when hitting bunch of issues in the standard library. However I have since realized that we actually do emit `noalias` for newtypes references, which means for soundness we should recurse into fields. Also it'd probably be bad news if newtypes lose out on optimizations (and they don't, for anything else). I want to add an option for that to Miri so that we can start experimenting with those semantics. r? ``@oli-obk``
2022-06-28emit Retag for compound types with reference fieldsRalf Jung-5/+18
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-10/+270
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-20Rollup merge of #98267 - compiler-errors:suggest-wildcard-arm, r=oli-obkMatthias Krüger-2/+2
Don't omit comma when suggesting wildcard arm after macro expr * Also adds `Span::eq_ctxt` to consolidate the various usages of `span.ctxt() == other.ctxt()` * Also fixes an unhygenic usage of spans which caused the suggestion to render weirdly when we had one arm match in a macro * Also always suggests a comma (i.e. even after a block) if we're rendering a wildcard arm in a single-line match (looks prettier :rose:) Fixes #94866
2022-06-20Rollup merge of #98235 - liuw:mir-gen-drop-magic-value, r=davidtwcoMatthias Krüger-2/+6
Drop magic value 3 from code Magic value 3 is used to create state for a yield point. It is in fact the number of reserved variants. Lift RESERVED_VARIANTS out to module scope and use it instead.
2022-06-20Drop magic value 3 from codeWei Liu-2/+6
Magic value 3 is used to create state for a yield point. It is in fact the number of reserved variants. Lift RESERVED_VARIANTS out to module scope and use it instead.
2022-06-19Use `Span::eq_ctxt` method instead of `.ctxt() == .ctxt()`Michael Goulet-2/+2
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-1/+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-16Move/rename `lazy::Sync{OnceCell,Lazy}` to `sync::{Once,Lazy}Lock`Maybe Waffle-2/+2
2022-06-15fix box derefs in var debug infoDrMeepster-0/+31
2022-06-15condense duplicate code into seperate functionsDrMeepster-22/+45
2022-06-15fix typos & docsDrMeepster-6/+7
2022-06-15remove box derefs from codgenDrMeepster-10/+215
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-1/+2
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-23/+20
2022-06-14Rename the `ConstS::val` field as `kind`.Nicholas Nethercote-5/+5
And likewise for the `Const::val` method. Because its type is called `ConstKind`. Also `val` is a confusing name because `ConstKind` is an enum with seven variants, one of which is called `Value`. Also, this gives consistency with `TyS` and `PredicateS` which have `kind` fields. The commit also renames a few `Const` variables from `val` to `c`, to avoid confusion with the `ConstKind::Value` variant.
2022-06-13remove currently unused depsklensy-1/+0
2022-06-12Auto merge of #98018 - scottmcm:miri-yeet, r=RalfJungbors-0/+1
Try out `yeet` in the MIR interpreter Since we got a new bootstrap, we can give this a shot. r? `@oli-obk`
2022-06-11Try out `yeet` in the MIR interpreterScott McMurray-0/+1
2022-06-12Remove duplicated implementations of borrowed locals analysisTomasz Miąsko-133/+8
2022-06-09Add a explanation about required panic strategy computationGary Guo-0/+21
2022-06-09Auto merge of #97740 - RalfJung:ctfe-cycle-spans, r=lcnrbors-10/+19
use precise spans for recursive const evaluation This fixes https://github.com/rust-lang/rust/issues/73283 by using a `TyCtxtAt` with a more precise span when the interpreter recursively calls itself. Hopefully such calls are sufficiently rare that this does not cost us too much performance. (In theory, cycles can also arise through layout computation, as layout can depend on consts -- but layout computation happens all the time so we'd have to do something to not make this terrible for performance.)
2022-06-08Rename `panic_strategy` query to `required_panic_strategy`Gary Guo-2/+4
2022-06-08Use is_fn_like instead of matching on DefKindGary Guo-12/+2
2022-06-08Handle panic runtime speciallyGary Guo-1/+5
2022-06-08Fix FFI-unwind unsoundness with mixed panic modeGary Guo-0/+153
2022-06-08Rollup merge of #97597 - tmiasko:simplify-locals-side-effects, ↵Dylan DPC-3/+7
r=RalfJung,JakobDegen Preserve unused pointer to address casts Fixes #97421. cc `@RalfJung`
2022-06-07Preserve unused pointer to address castsTomasz Miąsko-3/+7
2022-06-07Remove `AlwaysLiveLocals` wrapper structTomasz Miąsko-5/+5
It is just a wrapper around a `BitSet` and doesn't have any functionality of its own.
2022-06-05Auto merge of #97697 - WaffleLapkin:no_ref_vec, r=WaffleLapkinbors-19/+17
Replace `&Vec<_>`s with `&[_]`s It's generally preferable to use `&[_]` since it's one less indirection and it can be created from types other that `Vec`. I've left `&Vec` in some locals where it doesn't really matter, in cases where `TypeFoldable` is expected (`TypeFoldable: Clone` so slice can't implement it) and in cases where it's `&TypeAliasThatIsActiallyVec`. Nothing important, really, I was just a little annoyed by `visit_generic_param_vec` :D r? `@compiler-errors`
2022-06-04const_prop_lint: ensure we have up-to-date cur_span()Ralf Jung-10/+19
2022-06-04Rollup merge of #97696 - cjgillot:normalize-inline, r=compiler-errorsMatthias Krüger-10/+15
Do not ICE when failing to normalize during inlining. Fixes https://github.com/rust-lang/rust/issues/97695
2022-06-03Do not ICE when failing to normalize during inlining.Camille GILLOT-10/+15
2022-06-03Replace `&Vec<_>`s with `&[_]`sMaybe Waffle-19/+17
2022-05-31Add a pointer to address cast kindTomasz Miąsko-2/+2
A pointer to address cast are often special-cased. Introduce a dedicated cast kind to make them easy distinguishable.
2022-05-30validate derefer, run derefer inside generatorouz-a-52/+65
2022-05-28Make TyCtxt implement Interner, make HashStable generic and move to ↵Michael Goulet-2/+2
rustc_type_ir
2022-05-28Initial fixes on top of type interner commitMichael Goulet-2/+4
2022-05-24Add dead store elimination passJakob Degen-1/+151
2022-05-24coverage: Don't underflow column numberTyler Mandry-1/+1
I noticed this when running coverage on a debug build of rustc. There may be other places that do this but I'm just fixing the one I hit.
2022-05-23Refactor call terminator to always hold a destination placeJakob Degen-98/+92
2022-05-23Rollup merge of #97292 - compiler-errors:tcxify-rustc, r=davidtwcoDylan DPC-17/+8
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-17/+8
2022-05-22Remove box syntax from rustc_mir_dataflow and rustc_mir_transformest31-5/+5
2022-05-20Remove `crate` visibility usage in compilerJacob Pratt-4/+3
2022-05-19Rollup merge of #97142 - SparrowLii:inline, r=tmiaskoDylan DPC-28/+27
move processing of `source_scope_data` into `MutVisitor`'s impl of `Integrator` when inline This PR fixes the FIXME in the inline mir-opt which moves processing of `source_scope_data` into `MutVisitor`'s impl of `Integrator` when inline