Repository navigation
Conversation
|
LLM disclosure: the initial miri support for the new semantics was LLM generated, but I've been iterating on it for a few months now and there is little of that original draft left. LLMs were also used to generate the boilerplate for the Miri pass/fail tests, but each test was manually reviewed and adjusted before committing. |
This comment has been minimized.
This comment has been minimized.
f01190d to
262618f
Compare
This comment has been minimized.
This comment has been minimized.
262618f to
4b56c27
Compare
This comment was marked as outdated.
This comment was marked as outdated.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
| fn eval_callee_and_args( | ||
| &mut self, | ||
| terminator: &mir::Terminator<'tcx>, | ||
| is_tail_call: bool, |
There was a problem hiding this comment.
The entire point of this function was to carry the common code between tail calls and regular calls. So adding a parameter like this defeats the purpose of having this function in the first place.
This also changes the semantics of move operands for tail calls even without M::move_elimination_semantics. In fact it makes move a complete NOP for tail calls, which IIUC is not what the RFC says.
There was a problem hiding this comment.
It doesn't actually change the semantics: we were later forcing FnArg::InPlace into FnArg::Copy for tail calls anyways (in-place doesn't make sense when the stack frame is about to be destroyed).
There was a problem hiding this comment.
That's a hack with a FIXME. Very different from how the code is presented here.
13a904a to
0873572
Compare
0873572 to
f686996
Compare
|
☔ The latest upstream changes (presumably #163783) made this pull request unmergeable. Please resolve the merge conflicts by rebasing. |
Depends on #163335 and #163359
This PR implements the new MIR semantics from rust-lang/rfcs#3943 in Miri.
Notable changes:
LocalValue::LiveUnallocatedstate to represent a local that isStorageLivebut hasn't been eliminated yet.eval_place_for_writewill automatically allocate a local if needed.eval_operandreturns a "snapshot" copy of the operand at the time it was evaluated. This uses a temporary allocation that is freed at the end of the current machine step.move_out_local: it snapshots the value and then frees the original allocation, switching the local toLiveUnallocated.EvaluatedRvaluewhich allows all rvalue operands to be evaluated and snapshotted (if needed) before the destination place of an assignment is evaluated.