Uh oh!
There was an error while loading. Please reload this page.
Add utility to find locals that don't use StorageLive annotations and use it for MaybeStorageLive - #70447
Conversation
Unfortunately this causes an assertion to trigger. @tmandry I would like to make |
rust-highfive
commented
Mar 26, 2020
The job Click to expand the log.I'm a bot! I can only do what humans tell me to, so if this was not helpful or you have suggestions for improvements, please ping or otherwise contact |
bors
commented
Mar 27, 2020
☔ The latest upstream changes (presumably #70451) made this pull request unmergeable. Please resolve the merge conflicts. |
RalfJung
commented
Mar 27, 2020
I wonder if it makes sense to share code with the part of Miri that decides which locals are live when a stack frame is pushed? On the one hand, having independent implementations could be useful as they can check each other, on the other hand, sharing code always seems nice. Currently, these to analyses differ in the sense that Miri treats all locals as initially-live in consts and statics, to avoid the overhead of walking the entire MIR. @oli-obk added this optimization a while ago, but @eddyb said it probably never was correct. An alternative would be to just say that the CTFE machine, for performance reasons, just ignores |
tmandry
commented
Mar 28, 2020
@ecstatic-morse I think you can take that part out of |
ecstatic-morse
commented
Mar 28, 2020
@RalfJung We should probably be encoding whether a variable is live on function entry in its |
RalfJung
commented
Mar 29, 2020
If we can be explicit in the MIR about this, that would be even better. :) |
6645209 to
ae89af5Comparerust-highfive
commented
Mar 29, 2020
The job Click to expand the log.I'm a bot! I can only do what humans tell me to, so if this was not helpful or you have suggestions for improvements, please ping or otherwise contact |
ae89af5 to
cde5ad0Comparebors
commented
Mar 30, 2020
☔ The latest upstream changes (presumably #70449) made this pull request unmergeable. Please resolve the merge conflicts. |
cde5ad0 to
240c7deComparebors
commented
Apr 1, 2020
☔ The latest upstream changes (presumably #70672) made this pull request unmergeable. Please resolve the merge conflicts. |
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
This entire function only cares about stored_locals, to be clear
Before, it ignored the first argument and marked all variables without `Storage*` annotations as dead.
240c7de to
209087bCompareecstatic-morse
commented
Apr 9, 2020
bors
commented
Apr 9, 2020
📌 Commit 209087b has been approved by |
bors
commented
Apr 9, 2020
🌲 The tree is currently closed for pull requests below priority 10, this pull request will be tested once the tree is reopened |
… r=tmandry Add utility to find locals that don't use `StorageLive` annotations and use it for `MaybeStorageLive` Addresses rust-lang#70004 (comment) (cc @RalfJung). The only dataflow analysis that is incorrect in this case is `MaybeStorageLive`. `transform/generator.rs` implemented custom handling for this class of locals, but other consumers of this analysis (there's one in [clippy](https://github.com/rust-lang/rust-clippy/blob/513b46793e98ce5b412d388a91f6371d6a9b290b/clippy_lints/src/redundant_clone.rs#L402)) would be incorrect. r? @tmandry
bors
commented
Apr 10, 2020
bors
commented
Apr 10, 2020
☀️ Test successful - checks-azure |
Addresses #70004 (comment) (cc @RalfJung).
The only dataflow analysis that is incorrect in this case is
MaybeStorageLive.transform/generator.rsimplemented custom handling for this class of locals, but other consumers of this analysis (there's one in clippy) would be incorrect.r? @tmandry