Add Miri support for move elimination semantics - #162048
Conversation
- Changed `iter_intervals` to return `RangeInclusive` instead of `Range` - Added `clear_row`, `disjoint_rows` and `intersects_range` methods
This flag also has the effect of disabling DestinationPropagation, which is already covered by move elimination.
|
cc @rust-lang/miri This PR changes rustc_public cc @oli-obk, @celinval, @ouz-a, @makai410 Some changes occurred to the CTFE / Miri interpreter cc @rust-lang/miri Some changes occurred to MIR optimizations cc @rust-lang/wg-mir-opt Some changes occurred to the CTFE machinery This PR changes MIR cc @oli-obk, @RalfJung, @JakobDegen, @vakaras Some changes occurred to the CTFE / Miri interpreter |
|
Oops, that should've been a draft. |
|
☔ The latest upstream changes (presumably #160524) made this pull request unmergeable. Please resolve the merge conflicts by rebasing. |
Adds support to Miri for the new MIR semantics from RFC 3943 when
-Zmir-move-eliminationis enabled. This builds on top of #157943, look at the last commit only.Notable changes:
LocalValue::LiveUnallocatedstate to represent a local that isStorageLivebut hasn't been eliminated yet.StorageLive. This is necessary for theRemoveZstspass and because several MIR constructors leave ZST places uninitialized.eval_place_for_writewhich allocates a local if it is currentlyLiveUnallocated.move_out_local: it copies the value to a temporary allocation freed at the end of the statement, and then frees the original allocation, switching the local toLiveUnallocated.FnArg::InPlacearguments that are bare locals are recorded as part of theReturnContinuation. They are freed upon returning or unwinding back to the caller.r? @ghost