Add provenance tracking for array cells#129
Open
CT075 wants to merge 4 commits intoTiarkRompf:masterfrom
Open
Conversation
Signed-off-by: Cameron Wong <cam@camdar.io>
Signed-off-by: Cameron Wong <cam@camdar.io>
Signed-off-by: Cameron Wong <cam@camdar.io>
Contributor
|
@Kraks -- any thoughts on this? |
Owner
|
This seems useful, but I think I would indeed prefer to see this done in a more general way based on reachability types. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR improves tracking of alias information for nested mutable arrays.
Currently, writes to nested mutable structures are extremely likely to be incorrectly marked as dead code. This is because the current means of effect tracking only tracks one "parent" at a time. That is, in the following snippet:
the write to
a0(0)is correctly associated with the cella0, but that write is not propagated to the parent arraya, leaving LMS to conclude that the writes are unobservable and can be optimized out.This PR seeks to fix this by adding a new parameter to the
Wrapclass,provenance, holding the set of all cells from which the wrapped node originated. For example, the valuea0has provenance[a]. Now, when writing toa0(0), we can properly mark the write as also affectinga.Presumably, in the future, this change can be subsumed by a more general mechanism like reachability types, but for now this is a simple mechanism that fixes a bug right now.