about summary refs log tree commit diff
path: root/src/librustc_mir/transform
AgeCommit message (Collapse)AuthorLines
2020-04-23Lazily run dataflow for const qualificationDylan MacKenzie-43/+56
2020-04-23Don't cache result of `in_any_value_of_ty` for localsDylan MacKenzie-53/+51
This was needed by an early version of dataflow-based const qualification where `QualifCursor` needed to return a full `BitSet` with the current state.
2020-04-23Make type alias privateDylan MacKenzie-1/+1
2020-04-23Rollup merge of #71198 - oli-obk:const_check_cleanup, r=RalfJungDylan DPC-150/+164
Const check/promotion cleanup and sanity assertion r? @RalfJung This is just the part of https://github.com/rust-lang/rust/pull/70042#issuecomment-614592765 that does not change behaviour
2020-04-23Rollup merge of #71005 - jonas-schievink:no-place-like-return, r=oli-obkDylan DPC-11/+7
Reading from the return place is fine Const eval thinks that reading from local `_0` is UB, but it isn't. `_0` is just a normal local like any other, and codegen handles it that way too. The only special thing is that the `Return` terminator will read from it. I've hit these errors while working on an NRVO pass that can merge other locals with `_0` in https://github.com/rust-lang/rust/pull/71003. r? @oli-obk
2020-04-23Document our sanity assertion around explicit promotionOliver Scherer-0/+4
2020-04-23Catch and fix explicit promotions that fail to actually promoteOliver Scherer-0/+8
2020-04-23Use `ConstCx` for `validate_candidates`Oliver Scherer-9/+7
2020-04-23Use ConstCx in the promoted collectorOliver Scherer-16/+14
2020-04-23Use ConstCx in more placesOliver Scherer-10/+16
2020-04-23Rename `Item` to `ConstCx`.Oliver Scherer-120/+120
This renaming was already done in some modules via import renaming. It's strictly used as a context, and it contains a `TyCtxt`.
2020-04-23Auto merge of #71312 - wesleywiser:const_prop_bitset, r=Mark-Simulacrumbors-5/+4
[ConstProp] Use a `BitSet<Local>` instead of `IndexVec<Local, bool>`
2020-04-22Auto merge of #71044 - ecstatic-morse:body-predecessor-cache, r=oli-obkbors-167/+121
Remove `BodyAndCache` ...returning to the original approach using interior mutability within `Body`. This simplifies the API at the cost of some uncontended mutex locks when the parallel compiler is enabled. The current API requires you to either have a mutable reference to `Body` (`&mut BodyAndCache`), or to compute the predecessor graph ahead of time by creating a `ReadOnlyBodyAndCache`. This is not a good fit for, e.g., the dataflow framework, which 1. does not mutate the MIR 2. only sometimes needs the predecessor graph (for backward dataflow problems)
2020-04-22Use `Body` everywhereDylan MacKenzie-136/+90
2020-04-22Don't use `*` for deref-coercionDylan MacKenzie-31/+31
2020-04-22Rollup merge of #71401 - spastorino:remove-visit-place-base, r=wesleywiserDylan DPC-7/+6
visit_place_base is just visit_local r? @wesleywiser
2020-04-22Rollup merge of #71336 - ecstatic-morse:check-consts-asm, r=oli-obkDylan DPC-5/+31
Exhaustively match on `{Statement,Terminator}Kind` during const checking This adds a pre-monomorphization error for inline assembly in a const context as well. r? @oli-obk
2020-04-22Rollup merge of #70970 - eddyb:trait-vs-impl-mismatch, r=oli-obkDylan DPC-2/+3
Detect mistyped associated consts in `Instance::resolve`. *Based on #71049 to prevent redundant/misleading downstream errors.* Fixes #70942 by refusing to resolve an associated `const` if it doesn't have the same type in the `impl` that it does in the `trait` (which we assume had errored, and `delay_span_bug` guards against bugs).
2020-04-21visit_place_base is just visit_localSantiago Pastorino-7/+6
2020-04-21Assign correct span to new illegal opsDylan MacKenzie-0/+2
2020-04-21Rollup merge of #71285 - ljedrz:mir_inline_span_for_optimized_mir, ↵Dylan DPC-7/+5
r=ecstatic-morse MIR: use HirId instead of NodeId to avoid cycles while inlining I wanted to see if I could limit the number of uses of `NodeId` when `HirId` is available and I saw that some of the MIR `Inliner` code could use `Span` instead of `NodeId`, not unlike in https://github.com/rust-lang/rust/pull/71197. ~If I'm understanding the reason for not calling `optimized_mir` in incremental builds here correctly, this change could also allow us to do so.~ This change could affect performance, so if this approach makes sense, a perf run is probably a good idea.
2020-04-20const prop: don't special case return placeJonas Schievink-9/+5
2020-04-20Update const propJonas Schievink-5/+5
2020-04-20Remove some `Vec` allocations in an effort to improve perfEsteban Küber-2/+1
2020-04-19[ConstProp] Use a `BitSet<Local>` instead of `IndexVec<Local, bool>`Wesley Wiser-5/+4
2020-04-19Note that some terminators should cause an errorDylan MacKenzie-0/+2
2020-04-19Exhaustively match on `TerminatorKind` during const checkingDylan MacKenzie-1/+11
2020-04-19Exhaustively match on `StatementKind` during const checkingDylan MacKenzie-3/+8
2020-04-19Check for `llvm_asm` in a const contextDylan MacKenzie-1/+8
2020-04-19Auto merge of #70598 - vakaras:add-threads-cr3, r=oli-obk,RalfJungbors-4/+27
Make the necessary changes to support concurrency in Miri. This pull request makes the necessary changes to the Rust compiler to allow Miri to support concurrency: 1. Move stack from the interpretation context (`InterpCx`) to machine, so that the machine can switch the stacks when it changes the thread being executed. 2. Add the callbacks that allow the machine to generate fresh allocation ids for each thread local allocation and to translate them back to original allocations when needed. This allows the machine to ensure the property that allocation ids are unique, which allows using a simpler representation of the memory. r? @oli-obk cc @RalfJung
2020-04-19MIR: use span instead of NodeId to determine if optimized_mir should be runljedrz-7/+5
2020-04-19Dogfood more or_patterns in the compilerJosh Stone-22/+28
2020-04-18Detect mistyped associated consts in `Instance::resolve`.Eduard-Mihai Burtescu-2/+3
2020-04-18miri-unleashed: test that we detect heap allocationsRalf Jung-2/+0
2020-04-18check_consts: make ops module privateRalf Jung-1/+1
2020-04-16Rollup merge of #71197 - ljedrz:unsafe_unused, r=ecstatic-morseDylan DPC-7/+13
Don't use the HirId to NodeId map in MIR Another step towards not having to build a `HirId` to `NodeId` map other than for doc and RLS purposes. We are currently sorting `unsafe` blocks by `NodeId` in `check_unsafety`; change it to sorting by `Span` instead; this passes the tests, but better ideas are welcome. In addition, simplify the split between the used and unused `unsafe` blocks for readability and less sorting. cc https://github.com/rust-lang/rust/issues/50928
2020-04-16Auto merge of #71201 - Dylan-DPC:rollup-23202uf, r=Dylan-DPCbors-22/+11
Rollup of 5 pull requests Successful merges: - #70566 (Don't bail out before linting in generic contexts.) - #71141 (Provide better compiler output when using `?` on `Option` in fn returning `Result` and vice-versa) - #71149 (remove an impossible branch from check_consts) - #71179 (fix more clippy warnings) - #71191 (Clean up E0520 explanation) Failed merges: r? @ghost
2020-04-16comment on the sorting of unused unsafe blocksljedrz-0/+2
2020-04-16Move stack access methods in the Machine implementations out of the enforce_ ↵Vytautas Astrauskas-14/+14
method group.
2020-04-16Rollup merge of #71179 - matthiaskrgr:cl6ppy, r=Dylan-DPCDylan DPC-1/+1
fix more clippy warnings
2020-04-16Rollup merge of #71149 - RalfJung:check-const-call, r=eddybDylan DPC-16/+5
remove an impossible branch from check_consts All function calleess are either `FnPtr` or `FnDef`, so we can remove the alternative from check_consts and just make it ICE instead.
2020-04-16Rollup merge of #70566 - jumbatm:exceeding-bitshifts-constprop, r=RalfJungDylan DPC-5/+5
Don't bail out before linting in generic contexts. Fixes #69021. cc #70017 r? @RalfJung
2020-04-16sort unused unsafe blocks by Span instead of NodeIdljedrz-1/+1
2020-04-16Respond to code review feedbackWesley Wiser-1/+9
- Remove reads of indirect `Place`s - Add comments explaining what the algorithm does
2020-04-16simplify unused unsafe block handlingljedrz-7/+11
2020-04-16don't clone types that are copy (clippy::clone_on_copy)Matthias Krüger-1/+1
2020-04-15Directly modify the `used_locals` vecWesley Wiser-14/+12
Fixes perf regression in `optimized_mir` query
2020-04-15Run `SimplifyLocals` iteratively until we get to a fixedpointWesley Wiser-27/+131
2020-04-15Remove other RvaluesWesley Wiser-12/+30
2020-04-15Make the necessary changes to support concurrency in Miri.Vytautas Astrauskas-4/+27