Repository navigation
Conversation
|
Some changes occurred to constck cc @fee1-dead
cc @bjorn3 This PR changes MIR cc @oli-obk, @RalfJung, @JakobDegen, @vakaras
cc @rust-lang/clippy Some changes occurred to MIR optimizations cc @rust-lang/wg-mir-opt Some changes occurred to the CTFE machinery This PR changes rustc_public cc @oli-obk, @celinval, @ouz-a, @makai410 Some changes occurred to the intrinsics. Make sure the CTFE / Miri interpreter cc @rust-lang/miri, @RalfJung, @oli-obk, @lcnr Some changes occurred to the CTFE / Miri interpreter cc @rust-lang/miri |
|
LLM disclosure: this PR is in large part the result of an LLM-assisted audit of all existing MIR transformations against the new MIR semantics as implemented in Miri in #163340. LLMs were also used to generate the boilerplate for the MIR tests, but each test was manually reviewed and adjusted before committing. |
|
We started with a single pull request with 65 files changed, and now ended up with multiple "smaller" pull requests, where the first one has 115 files changed. This is not exactly what I expected. Could you move some parts to smaller pull requests still. For example parts of "Fix missing ZST initialization in MIR passes" which don't depend on |
|
I'm currently working to make none of the changes in this PR depend on The main concern is that this means restricting I will then move all of the ZST-related changes to a separate PR since they no longer depend on the flag. |
a4912a3 to
43c741c
Compare
|
I've moved the ZST-related changes to #163359.
Most of the difference come from this preparation work which adjusts the rest of the compiler to work with the new semantics, which ends up touching a lot of tests. The actual compiler code changes are not that big. |
This comment has been minimized.
This comment has been minimized.
43c741c to
7d28b47
Compare
|
I moved the MIR validity changes to the Miri PR. |
|
I addressed all the review comments, as well as #163388. I also noticed that the handling of the destination place in inlining was incorrect: the destination place must become allocated-but-uninitialized if the call unwinds. This means we always need to use |
This comment has been minimized.
This comment has been minimized.
|
Given that the semantics have been overhauled, we should probably ensure t-opsem had a chance to look at the new semantics. In particular this PR seems to already alter MIR semantics by adding a new statement (StorageAlloc)?
|
This comment has been minimized.
This comment has been minimized.
b366400 to
d39204c
Compare
This comment has been minimized.
This comment has been minimized.
f352c99 to
dc6558c
Compare
|
This PR was rebased onto a different main commit. Here's a range-diff highlighting what actually changed. Rebasing is a normal part of keeping PRs up to date, so no action is needed—this note is just to help reviewers. |
|
☔ The latest upstream changes (presumably #163783) made this pull request unmergeable. Please resolve the merge conflicts by rebasing. |
…iveness, r=tmiasko MIR move elimination [3/6]: PreciseLiveness Depends on rust-lang#163335 This PR implements the lifetime analysis used by the `MoveElimination` pass from rust-lang/rfcs#3943. `PreciseLiveness` calculates, at a sub-statement granularity, the points in a function where a local requires storage to be allocated. This is more fine-grained than `MaybeStorageLive`, and takes borrows into account. r? tmiasko
…iveness, r=tmiasko MIR move elimination [3/6]: PreciseLiveness Depends on rust-lang#163335 This PR implements the lifetime analysis used by the `MoveElimination` pass from rust-lang/rfcs#3943. `PreciseLiveness` calculates, at a sub-statement granularity, the points in a function where a local requires storage to be allocated. This is more fine-grained than `MaybeStorageLive`, and takes borrows into account. r? tmiasko
View all comments
This PR contains preparatory work for supporting the new MIR semantics from rust-lang/rfcs#3943.
-Zmir-move-eliminationwhich both opts-in to the new semantics and enables the new optimization pass.StorageAllocMIR statement. This is used by the MIR inliner when it needs to borrow a destination place that hasn't been initialized.r? tmiasko