Skip to content
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

Clear up meaning of MayEscape & Distinguish a local becoming reachable via globals from being reachable by other threads #1544

Open
michael-schwarz opened this issue Jul 16, 2024 · 1 comment
Labels
bug cleanup Refactoring, clean-up documentation Documentation, comments question

Comments

@michael-schwarz
Copy link
Member

We make inconsistent assumptions about what "has escaped" is supposed to mean:

  • The analysis that answers the MayEscape queries claims it is about Escape analysis for thread-local variables ([escape]).
  • Thus, one would assume adding an override to say things have not escaped when the program has never been multi-threaded would be a precision improvement.
  • However, adding such a check, leads test 45/05 to fail which requires MayEscape to answer true also in single-threaded settings.

I came across this when considering #1542, where this distinction leads to a new global variable being created when reading to g#in that has not received any values as the value of the variable is still tracked locally.

@sim642
Copy link
Member

sim642 commented Jul 16, 2024

The description of the escape analysis should definitely at least be amended.
I guess it would be possible to have two separate analyses and queries for the two different notions but that might be overkill. In the multi-threaded case they would probably have to amplify each other anyway.

Our notion of escaping would generalize anyway with #1491.

@sim642 sim642 added documentation Documentation, comments cleanup Refactoring, clean-up labels Jul 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug cleanup Refactoring, clean-up documentation Documentation, comments question
Projects
None yet
Development

No branches or pull requests

2 participants