summary refs log tree commit diff
path: root/src/librustc_mir/transform
AgeCommit message (Collapse)AuthorLines
2018-12-31Fix a recently introduces regressionOliver Scherer-1/+1
2018-11-30Pacify tidyPhilipp Hansch-9/+9
2018-11-30Fix const_fn ICE with non-const function pointerPhilipp Hansch-122/+137
2018-11-27avoid features_untrackedRalf Jung-9/+9
2018-11-26Auto merge of #56070 - oli-obk:const_let, r=eddybbors-6/+56
Allow assignments in const contexts fixes https://github.com/rust-lang/rust/issues/54098 fixes https://github.com/rust-lang/rust/issues/51251 fixes https://github.com/rust-lang/rust/issues/52613
2018-11-25Auto merge of #55959 - matthewjasper:remove-end-region, r=nikomatsakisbors-113/+14
Cleanup from lexical MIR borrowck removal Lexical MIR borrowck was removed months ago now, and `EndRegion`s are no longer used for MIRI verification. * Remove `rustc::mir::StatementKind::EndRegion` and the `-Zemit_end_regions` flag * Use `RegionVid` instead of `Region` in BorrowSet * Rewrite drop generation to create fewer goto terminators. r? @nikomatsakis
2018-11-21Auto merge of #56065 - oli-obk:min_const_fn_loop_ice, r=davidtwcobors-5/+3
Replace the ICEing on const fn loops with an error fixes #56035
2018-11-21Explain why we do not overwrite qualification of localsOliver Scherer-2/+5
2018-11-21Ensure assignments don't allow skipping projection checksOliver Scherer-1/+10
2018-11-21Properly assign to aggregate fieldsOliver Scherer-1/+6
2018-11-21rustc: remove {FxHash,Node,DefId,HirId,ItemLocal}{Map,Set} "constructor" fns.Eduard-Mihai Burtescu-1/+1
2018-11-20Document qualify_consts moreOliver Scherer-1/+6
2018-11-19use RawConst in miriRalf Jung-2/+4
2018-11-19Make const_eval_raw query return just an AllocIdRalf Jung-1/+1
2018-11-19Also catch static mutation at evaluation timeOliver Scherer-1/+7
2018-11-19Allow assignments in const contextsOliver Scherer-6/+28
2018-11-19Replace the ICEing on const fn loops with an errorOliver Scherer-5/+3
2018-11-18Remove mir::StatementKind::EndRegionMatthew Jasper-113/+14
Since lexical MIR borrow check is gone, and validation no longer uses these, they can be removed.
2018-11-15Auto merge of #55716 - RalfJung:escape-to-raw, r=oli-obkbors-38/+84
Add escape-to-raw MIR statement Add a new MIR "ghost state statement": Escaping a ptr to permit raw accesses. ~~This includes #55549, [click here](https://github.com/RalfJung/rust/compare/miri-visitor...RalfJung:escape-to-raw) for just the new commits.~~
2018-11-12Use type safe `VariantIdx` instead of `usize` everywhereOliver Scherer-4/+6
2018-11-11Rollup merge of #55802 - wesleywiser:inlined_calls_2_electric_boogaloo, r=nagisaPietro Albini-45/+49
Don't inline virtual calls (take 2) When I fixed the previous mis-optimizations, I didn't realize there were actually two different places where we mutate `callsites` and both of them should have the same behavior. As a result, if a function was inlined and that function contained virtual function calls, they were incorrectly being inlined. I also added a test case which covers this.
2018-11-11Rollup merge of #55792 - oli-obk:propsicle, r=RalfJungPietro Albini-8/+8
Prevent ICE in const-prop array oob check fixes https://github.com/rust-lang/rust/issues/55772 fixes https://github.com/rust-lang/rust/issues/54541
2018-11-11Rollup merge of #55745 - nnethercote:outlives_components-SmallVec, ↵Pietro Albini-1/+6
r=matthewjasper Convert `outlives_components`' return value to a `SmallVec` outparam. This avoids some allocations, reducing instruction counts by 1% on a couple of benchmarks.
2018-11-10Auto merge of #55650 - nikic:funnel-shift, r=nagisabors-0/+2
Implement rotate using funnel shift on LLVM >= 7 Implement the rotate_left and rotate_right operations using llvm.fshl and llvm.fshr if they are available (LLVM >= 7). Originally I wanted to expose the funnel_shift_left and funnel_shift_right intrinsics and implement rotate_left and rotate_right on top of them. However, emulation of funnel shifts requires emitting a conditional to check for zero shift amount, which is not necessary for rotates. I was uncomfortable doing that here, as I don't want to rely on LLVM to optimize away that conditional (and for variable rotates, I'm not sure it can). We should revisit that question when we raise our minimum version requirement to LLVM 7 and don't need emulation code anymore. Fixes #52457.
2018-11-09Don't inline virtual calls (take 2)Wesley Wiser-45/+49
When I fixed the previous mis-optimizations, I didn't realize there were actually two different places where we mutate `callsites` and both of them should have the same behavior. As a result, if a function was inlined and that function contained virtual function calls, they were incorrectly being inlined. I also added a test case which covers this.
2018-11-08Rollup merge of #55761 - ljedrz:fix_promote_candidate_hack, r=estebankMark Rousskov-10/+5
mir: remove a hacky recursive helper function It can be replaced with a `while let` loop.
2018-11-08Rollup merge of #55739 - wesleywiser:mir_inline_fuel, r=nikomatsakisMark Rousskov-1/+13
Consume optimization fuel from the MIR inliner This makes it easier to debug mis-optimizations that occur during inlining. Thanks to @nikomatsakis for the suggestion!
2018-11-08Prevent ICE in const-prop array oob checkOliver Scherer-8/+8
2018-11-08Use `SmallVec` outparams in several functions.Nicholas Nethercote-1/+6
This avoids some allocations, reducing instruction counts by 1% on a couple of benchmarks.
2018-11-07mir: remove a hacky recursive helper functionljedrz-10/+5
2018-11-07drop glue works with raw ptrs, it must EscapeToRawRalf Jung-0/+7
2018-11-07array index accesses are stable placesRalf Jung-6/+8
2018-11-07no more action on ref or cast, but add new MIR statement for escaping a ptr ↵Ralf Jung-32/+69
to raw
2018-11-07Rollup merge of #55734 - teresy:shorthand-fields, r=davidtwcokennytm-3/+3
refactor: use shorthand fields refactor: use shorthand for single fields everywhere (excluding tests).
2018-11-07Consume optimization fuel from the MIR inlinerWesley Wiser-1/+13
This makes it easier to debug mis-optimizations that occur during inlining. Thanks to @nikomatsakis for the suggestion!
2018-11-06refactor: use shorthand fieldsteresy-3/+3
2018-11-05miri: binary_op_val -> binary_op_immRalf Jung-1/+1
2018-11-04rustc_target: pass contexts by reference, not value.Eduard-Mihai Burtescu-4/+4
2018-11-04Auto merge of #55393 - oli-obk:immediate_immediately, r=RalfJungbors-10/+10
Rename `Value` to `Immediate` for miri r? @RalfJung
2018-11-03Implement rotate using funnel shift on LLVM >= 7Nikita Popov-0/+2
Implement the rotate_left and rotate_right operations using llvm.fshl and llvm.fshr if they are available (LLVM >= 7). Originally I wanted to expose the funnel_shift_left and funnel_shift_right intrinsics and implement rotate_left and rotate_right on top of them. However, emulation of funnel shifts requires emitting a conditional to check for zero shift amount, which is not necessary for rotates. I was uncomfortable doing that here, as I don't want to rely on LLVM to optimize away that conditional (and for variable rotates, I'm not sure it can). We should revisit that question when we raise our minimum version requirement to LLVM 7 and don't need emulation code anymore.
2018-11-03Rename `Binder::no_late_bound_regions` to `Binder::no_bound_vars`scalexm-1/+1
2018-11-02Rename `Value` to `Immediate` for miriOliver Scherer-10/+10
2018-10-29fix nitsRalf Jung-2/+7
2018-10-29make inliner remove the fn_entry flag on Retag statementsRalf Jung-0/+8
2018-10-29Emit Retag statements, kill Validate statementsRalf Jung-421/+184
Also "rename" -Zmir-emit-validate to -Zmir-emit-retag, which is just a boolean (yes or no).
2018-10-28Auto merge of #54487 - RalfJung:ctfe-backtrace, r=oli-obkbors-17/+8
Delayed CTFE backtraces This renames the env var that controls CTFE backtraces from `MIRI_BACKTRACE` to `RUST_CTFE_BACKTRACE` so that we can use `MIRI_BACKTRACE` in the miri tool to only show backtraces of the main miri execution. It also makes `RUST_CTFE_BACKTRACE` only show backtraces that actually get rendered as errors, instead of showing them eagerly when the `Err` happens. The current behavior is near useless in miri because it shows about one gazillion backtraces for errors that we later catch and do not care about. However, @oli-obk likes the current behavior for rustc CTFE work so it is still available via `RUST_CTFE_BACKTRACE=immediate`. NOTE: This is based on top of https://github.com/rust-lang/rust/pull/53821. Only [the last three commits](https://github.com/oli-obk/rust/compare/sanity_query...RalfJung:ctfe-backtrace) are new. Fixes https://github.com/rust-lang/rust/issues/53355
2018-10-28Rollup merge of #55412 - oli-obk:min_const_fn_ice, r=estebankkennytm-2/+3
Fix an ICE in the min_const_fn analysis fixes https://github.com/rust-lang/rust/issues/55395 cc @Centril
2018-10-28remove some unused CTFE error variantsRalf Jung-4/+0
2018-10-28rename env var to control ctfe backtraces, and make it usually show the ↵Ralf Jung-13/+8
backtrace delayed The env var is now RUST_CTFE_BACKTRACE. Similar to RUST_BACKTRACE, it usually only prints a backtrace when the error actually surfaces, not when it happens. This makes a difference when we catch errors. As per @oli-obk's request, one can set RUST_CTFE_BACKTRACE=immediate to get the backtrace shown immediately.
2018-10-28Rollup merge of #55244 - wesleywiser:issue-50411, r=nikomatsakiskennytm-57/+73
Don't rerun MIR passes when inlining Fixes #50411 r? @nikomatsakis I updated your commit message with additional details. Let me know if any of that is incorrect. I also added the appropriate `compile-flags` directive to the test. Thanks for you help on this! cc @RalfJung related to your PR #55086