summary refs log tree commit diff
path: root/src/librustc_mir/transform
AgeCommit message (Collapse)AuthorLines
2020-05-10Remove some `Vec` allocations in an effort to improve perfEsteban Küber-2/+1
2020-04-22Revert "Move early needs_subst bailout to _after_ linting."Ralf Jung-5/+5
This reverts commit 99492e41b60f21f2f461e8131605e054020d328e.
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-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-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
2020-04-15Rollup merge of #71100 - RalfJung:miri-frame-hook, r=oli-obkMazdak Farrokhzad-2/+5
Miri: expand frame hooks This is needed to make https://github.com/rust-lang/miri/pull/1330 work. r? @oli-obk @eddyb
2020-04-15Rollup merge of #70891 - lcnr:replace-rvalue_aggregate, r=eddybMazdak Farrokhzad-1/+5
unit rvalue, use constant `()` instead of tuple fixes #70886 r? @eddyb
2020-04-15remove rustfmt-induced spurious trailing commaRalf Jung-1/+1
2020-04-15remove an impossible branch from check_constsRalf Jung-16/+5
2020-04-15Auto merge of #71106 - jonas-schievink:remove-call-guard-pass, ↵bors-5/+7
r=ecstatic-morse,RalfJung Don't always run `add_call_guards` pass It is only needed when `add_retag` runs. (the pass is run again to split critical edges before codegen, that one is required)
2020-04-15Move early needs_subst bailout to _after_ linting.jumbatm-5/+5
This ensures we get still get lints for generic contexts.
2020-04-13unit rvalue: use constant `()` instead of tupleBastian Kauschke-1/+5
2020-04-13Don't always run `add_call_guards` passJonas Schievink-5/+7
2020-04-13Miri: let machine hook dynamically decide about alignment checksRalf Jung-1/+4
2020-04-13Miri: let push_frame hook also access and mutate the rest of the frame dataRalf Jung-2/+5
2020-04-12Rollup merge of #71013 - jonas-schievink:visit-projection, r=eddybDylan DPC-35/+0
Pass the `PlaceElem::Index` local to `visit_local` Fixes https://github.com/rust-lang/rust/issues/71008 cc @rust-lang/wg-mir-opt r? @spastorino
2020-04-11Auto merge of #71014 - Centril:rollup-3lc8cnt, r=Centrilbors-1/+4
Rollup of 5 pull requests Successful merges: - #69573 (tests encoding current behavior for various cases of "binding" to _.) - #70881 (bootstrap: work around "unused attribute" errors in incremental stdlib rebuilds.) - #70957 (Normalize MIR locals' types for generator layout computation.) - #70962 (added machine hooks to track deallocations) - #70982 (Normalize function signature in function casting check procedure) Failed merges: r? @ghost
2020-04-11Rollup merge of #70957 - oli-obk:lazy_repeat_length_eval_ice, r=matthewjasperMazdak Farrokhzad-1/+4
Normalize MIR locals' types for generator layout computation. fixes #70905
2020-04-11Pass the `PlaceElem::Index` local to `visit_local`Jonas Schievink-35/+0
2020-04-10Auto merge of #70986 - marmeladema:issue70853/librustc_middle-local-def-id, ↵bors-2/+2
r=eddyb rustc_middle: return `LocalDefId` where possible in hir::map module This changes the return type of the following functions to return a `LocalDefId` instead of a `DefId`: * opt_local_def_id_from_node_id * opt_local_def_id * body_owner_def_id * local_def_id_from_node_id * get_parent_id This is another step in the right direction for #70853 This pull request will be followed by another (substantial one) which changes the return type of `local_def_id` function but this change being more invasive, we might want to wait for #70956 or #70961 (or some other form it) to land first.
2020-04-10Rollup merge of #69745 - estebank:predicate-obligations-3, r=nikomatsakis,eddybMazdak Farrokhzad-1/+1
Use `PredicateObligation`s instead of `Predicate`s Keep more information about trait binding failures. Use more specific spans by pointing at bindings that introduce obligations. Subset of #69709. r? @eddyb
2020-04-10librustc_middle: return LocalDefId instead of DefId in body_owner_def_idmarmeladema-2/+2
2020-04-09Explain why we remove `self` from storage live localsDylan MacKenzie-0/+1
2020-04-09Use new utility in `transform/generator.rs`Dylan MacKenzie-34/+40
2020-04-09Normalize MIR locals' types for generator layout computation.Oliver Scherer-1/+4
2020-04-08Use `PredicateObligation`s instead of `Predicate`sEsteban Küber-1/+1
Keep more information about trait binding failures.
2020-04-06ty: switch `Ty::walk` from `Ty` to `GenericArg`.Eduard-Mihai Burtescu-1/+10
2020-04-06Auto merge of #70771 - RalfJung:ctfe-loop, r=oli-obkbors-2/+4
Miri terminator handling: only do progress sanity check for 'Call' terminator This will still catch mistakes in bad intrinsic/foreign-item shims, which is the main source of errors here. Fixes https://github.com/rust-lang/rust/issues/70723 r? @oli-obk
2020-04-05set span more accurately during const_propRalf Jung-2/+4
2020-04-05Stop importing int/float modules in librustc_*Linus Färnstrand-1/+1
2020-04-03Rollup merge of #70595 - wesleywiser:remove_unused_discriminant_reads, r=oli-obkMazdak Farrokhzad-11/+15
Remove unused discriminant reads from MIR bodies Allow the `SimplifyLocals` pass to remove reads of discriminants if the read is never used. Fixes #70531 r? @oli-obk
2020-04-02Remove unused discriminant reads from MIR bodiesWesley Wiser-11/+15
Allow the `SimplifyLocals` pass to remove reads of discriminants if the read is never used.