about summary refs log tree commit diff
path: root/src/librustc_mir/transform
AgeCommit message (Collapse)AuthorLines
2019-05-20Auto merge of #60815 - nnethercote:use-Symbol-more-2, r=petrochenkovbors-24/+19
Use `Symbol` even more These patches simplify the code a bit (fewer conversions) and also speed things up a bit (fewer `with_interner` calls). r? @petrochenkov
2019-05-20Introduce `InternedString::intern`.Nicholas Nethercote-24/+19
`InternedString::intern(x)` is preferable to `Symbol::intern(x).as_interned_str()`, because the former involves one call to `with_interner` while the latter involves two. The case within InternedString::decode() is particularly hot, and this change reduces the number of `with_interner` calls by up to 13%.
2019-05-19[const-prop] Don't const-prop into terminators unless mir-opt-level >= 2Wesley Wiser-10/+19
2019-05-19[const-prop] Remove catch all match and add FIXMEWesley Wiser-1/+14
2019-05-19[const-prop] Support propagating into SwitchInt's `discr` OperandWesley Wiser-0/+7
2019-05-19[const-prop] Support propagating into Assert's `cond` OperandWesley Wiser-67/+79
2019-05-16Rollup merge of #60597 - wesleywiser:const_prop, r=oli-obkManish Goregaokar-9/+62
Do some simple constant propagation in the ConstProp pass r? @oli-obk I added a few test cases. Let me know if you think there should be more.
2019-05-15Run const propagation at O2Wesley Wiser-1/+1
2019-05-15Do some simple constant propagation in the ConstProp passWesley Wiser-9/+62
2019-05-13Pass a `Symbol` to `check_name`, `emit_feature_err`, and related functions.Nicholas Nethercote-19/+21
2019-05-04Rollup merge of #60516 - JohnTitor:remove-typeck, r=matthewjasperMazdak Farrokhzad-2/+0
Remove TypeckMir Fixes #60422 r? @matthewjasper
2019-05-04Auto merge of #59897 - tmandry:variantful-generators, r=eddybbors-61/+103
Multi-variant layouts for generators This allows generators to overlap fields using variants, but doesn't do any such overlapping yet. It creates one variant for every state of the generator (unresumed, returned, panicked, plus one for every yield), and puts every stored local in each of the yield-point variants. Required for optimizing generator layouts (#52924). There was quite a lot of refactoring needed for this change. I've done my best in later commits to eliminate assumptions in the code that only certain kinds of types are multi-variant, and to centralize knowledge of the inner mechanics of generators in as few places as possible. This change also emits debuginfo about the fields contained in each variant, as well as preserving debuginfo about stored locals while running in the generator. Also, fixes #59972. Future work: - Use this change for an optimization pass that actually overlaps locals within the generator struct (#52924) - In the type layout fields, don't include locals that are uninitialized for a particular variant, so miri and UB sanitizers can check our memory (see https://github.com/rust-lang/rust/issues/59972#issuecomment-483058172) - Preserve debuginfo scopes across generator yield points
2019-05-03Address review commentsTyler Mandry-3/+4
2019-05-03Split out debuginfo from type info in MIR GeneratorLayoutTyler Mandry-5/+12
2019-05-03Make variant_fields inner an IndexVecTyler Mandry-2/+2
2019-05-03rustc: use DefKind instead of Def, where possible.Eduard-Mihai Burtescu-3/+3
2019-05-03rustc: factor most DefId-containing variants out of Def and into DefKind.Eduard-Mihai Burtescu-2/+2
2019-05-04Remove TypeckMirYuki Okushi-2/+0
2019-05-02Remove the `self.mir` field from `ConstPropagator`Wesley Wiser-53/+71
2019-05-02Rollup merge of #60428 - wesleywiser:refactor_const_eval, r=oli-obkMazdak Farrokhzad-1/+2
Refactor `eval_body_using_ecx` so that it doesn't need to query for MIR This is the first step toward removing the `mir` field of `ConstPropagator` which will eventually allow us to actually const propagate in MIR. r? @oli-obk
2019-05-01Refactor `eval_body_using_ecx` so that it doesn't need to query for MIRWesley Wiser-1/+2
2019-05-01Auto merge of #60195 - varkor:commontypes-to-common, r=eddybbors-2/+2
Split `CommonTypes` into `CommonTypes` and `CommonLifetimes` The so-called "`CommonTypes`" contains more than just types. r? @eddyb
2019-04-30Rollup merge of #60276 - matthewjasper:cleanup-mir-visitor, r=estebankMazdak Farrokhzad-71/+51
Cleanup the MIR visitor * Remove useless `BasicBlock` parameters on methods with `Location`s. * Prefer `visit_terminator_kind` to `visit_terminator`. * Remove `Region` from PlaceContexts. `visit_rvalue` should be used when the region is important. * Remove unused visitor methods.
2019-04-28Fix lint findings in librustc_mirflip1995-7/+7
2019-04-27Rollup merge of #60292 - varkor:ty-tuple-substs, r=nikomatsakisMazdak Farrokhzad-2/+5
Replace the `&'tcx List<Ty<'tcx>>` in `TyKind::Tuple` with `SubstsRef<'tcx>` Part of the suggested refactoring for https://github.com/rust-lang/rust/issues/42340. As expected, this is a little messy, because there are many places that the components of tuples are expected to be types, rather than arbitrary kinds. However, it should open up the way for a refactoring of `TyS` itself. r? @nikomatsakis
2019-04-26Remove region from borrow place contextsMatthew Jasper-27/+27
2019-04-26Use visit_terminator_kind when possibleMatthew Jasper-4/+4
2019-04-26Remove BasicBlock parameter from mir visitor methodsMatthew Jasper-41/+21
2019-04-26Update handling of Tuplevarkor-2/+5
2019-04-25Update existing usagesvarkor-2/+2
2019-04-25Describe generator variants in debuginfoTyler Mandry-3/+4
2019-04-25Support variantful generatorsTyler Mandry-60/+87
This allows generators to overlap fields using variants.
2019-04-25Give GeneratorLayout a list of fields for each variantTyler Mandry-1/+2
But don't really use it yet.
2019-04-25Define generator discriminant type in only one placeTyler Mandry-4/+9
2019-04-25Update mir_const_qualifJohn Kåre Alsaker-7/+4
2019-04-24Rollup merge of #59739 - cramertj:stabilize, r=withoutboatsMazdak Farrokhzad-2/+6
Stabilize futures_api cc https://github.com/rust-lang/rust/issues/59725. Based on https://github.com/rust-lang/rust/pull/59733 and https://github.com/rust-lang/rust/pull/59119 -- only the last two commits here are relevant. r? @withoutboats , @oli-obk for the introduction of `rustc_allow_const_fn_ptr`.
2019-04-24Rollup merge of #56278 - eddyb:mir-debuginfo-proof, r=nikomatsakisMazdak Farrokhzad-8/+8
Future-proof MIR for dedicated debuginfo. This is #56231 without the last commit (the one that actually moves to `VarDebuginfo`). Nothing should be broken, but it should no longer depend on debuginfo for anything else. r? @nikomatsakis
2019-04-23Add rustc_allow_const_fn_ptrTaylor Cramer-2/+6
2019-04-23rustc: dissuade compiler developers from misusing upvar debuginfo.Eduard-Mihai Burtescu-3/+3
2019-04-23rustc_mir: don't use upvar_decls in the generator state transform.Eduard-Mihai Burtescu-5/+5
2019-04-22Never stop due to errors before borrow checkingEsteban Küber-1/+3
2019-04-21Change return type of `TyCtxt::is_static` to boolVadim Petrochenkov-1/+1
Add `TyCtxt::is_mutable_static`
2019-04-21Auto merge of #60116 - RalfJung:miri-exit, r=oli-obkbors-0/+1
add Miri error variant for process exit This is to support https://github.com/rust-lang/miri/pull/702 r? @oli-obk
2019-04-20Auto merge of #59987 - saleemjaffer:refactor_adjust_castkinds, r=oli-obkbors-11/+7
Refactor Adjust and CastKind fixes rust-lang#59588
2019-04-19add Miri error variant for process exitRalf Jung-0/+1
2019-04-18Add own_requires_monomorphizationvarkor-2/+1
2019-04-17Rollup merge of #59646 - JohnTitor:improve-wording, r=oli-obkMazdak Farrokhzad-1/+6
const fn: Improve wording fixes #59611 This might need discussion. Feel free to close this PR if we don't need to fix.
2019-04-16refactor Adjustment to use new PointerCast enumSaleem Jaffer-6/+2
2019-04-16Make wording verboseYuki OKUSHI-1/+6
2019-04-15basic refactor. Adding PointerCast enumSaleem Jaffer-12/+12