-
Notifications
You must be signed in to change notification settings - Fork 3.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Compiler-v2] Track live var info in spec blocks by default #14890
Conversation
⏱️ 5h 13m total CI duration on this PR
|
This stack of pull requests is managed by Graphite. Learn more about stacking. Join @rahxephon89 and the rest of your teammates on |
ff29628
to
4395e84
Compare
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #14890 +/- ##
===========================================
- Coverage 71.5% 60.1% -11.5%
===========================================
Files 2409 856 -1553
Lines 490368 211035 -279333
===========================================
- Hits 350832 126896 -223936
+ Misses 139536 84139 -55397 ☔ View full report in Codecov by Sentry. |
4a5545f
to
c755a04
Compare
0bf4cb6
to
e551142
Compare
@@ -1,64 +1,4 @@ | |||
Move prover returns: exiting with verification errors | |||
warning: Unused assignment to `x0`. Consider removing or prefixing with an underscore: `_x0` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Warnings are removed because these variables appear in the spec, which is consistent with the behavior of the prover when using V1 compiler.
@@ -373,12 +371,12 @@ impl<'a> TransferFunctions for LiveVarAnalysis<'a> { | |||
Branch(id, _, _, src) => { | |||
state.insert_or_update(*src, self.livevar_info(id, offset), self.track_all_usages); | |||
}, | |||
Prop(id, _, exp) if self.track_all_usages => { | |||
Prop(id, _, exp) => { | |||
for idx in exp.used_temporaries() { | |||
state.insert_or_update(idx, self.livevar_info(id, offset), true); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
state.insert_or_update(idx, self.livevar_info(id, offset), true); | |
state.insert_or_update(idx, self.livevar_info(id, offset), self.track_all_usages); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This would keep it up with how self.track_all_usages
are used elsewhere.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
for idx in exp.used_temporaries() { | ||
state.insert_or_update(idx, self.livevar_info(id, offset), true); | ||
} | ||
}, | ||
SpecBlock(id, spec) if self.track_all_usages => { | ||
SpecBlock(id, spec) => { | ||
for idx in spec.used_temporaries() { | ||
state.insert_or_update(idx, self.livevar_info(id, offset), true); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
state.insert_or_update(idx, self.livevar_info(id, offset), true); | |
state.insert_or_update(idx, self.livevar_info(id, offset), self.track_all_usages); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
e551142
to
cb59b44
Compare
┌─ tests/sources/functional/bug_14762.move:45:26 | ||
│ | ||
39 │ let (found, index) = find(&s.entries, |obj| { | ||
│ ---------- It is still being borrowed by this reference |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This error seems overly conservative. Shouldn't this reference &s.entries
not outlive the call to find
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is generated by V1 compiler. Do we want to take care of this?
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
✅ Forge suite
|
✅ Forge suite
|
✅ Forge suite
|
Description
Currently, live var analysis only tracks the live var info in specs when
track_all_usages
is set. This leads to the issue in #14762 because variables that appear in spec block but are not alive anymore will not be dropped in the generated bytecode. This PR resolves the issue by tracking the live var info by default.Close #14762
How Has This Been Tested?
Key Areas to Review
Type of Change
Which Components or Systems Does This Change Impact?
Checklist