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

inference: handle LimitedAccuracy in handle_global_assignment! #54130

Merged
merged 1 commit into from Apr 18, 2024

Conversation

aviatesk
Copy link
Sponsor Member

@aviatesk aviatesk commented Apr 18, 2024

abstract_eval_statement may return LimitedAccuracy so we need to handle it before applying widenconst.

`abstract_eval_statement` may return `LimitedAccuracy` so we need to
handle it before applying `widenconst`.
@aviatesk aviatesk added the backport 1.11 Change should be backported to release-1.11 label Apr 18, 2024
@aviatesk
Copy link
Sponsor Member Author

Following up #53750.
And I've revisited the LimitedAccuracy-related code and here are some key findings:

  • abstract_eval_statement may return LimitedAccuracy, allowing it to be stored into states of SlotNumber and SSAValue
  • Their states are loaded by abstract_eval_special_value, whose callers include abstract_eval_value, abstract_eval_phi, and abstract_eval_statement, requiring these routines to properly handle LimitedAccuracy.
  • abstract_eval_value calls collect_limitations! right after calling abstract_eval_special_value, ensuring that LimitedAccuracy doesn't seep into things like argtypes.
  • abstract_eval_phi is mostly used for irinterp, so there's (currently) no need to handle LimitedAccuracy there.
  • abstract_eval_statement is solely called by abstract_eval_basic_statement, which must correctly handle LimitedAccuracy, and this PR specifically does this issue.

@aviatesk aviatesk requested a review from vtjnash April 18, 2024 11:14
@vtjnash vtjnash added the merge me PR is reviewed. Merge when all tests are passing label Apr 18, 2024
@aviatesk aviatesk merged commit f8b4b79 into master Apr 18, 2024
7 of 10 checks passed
@aviatesk aviatesk deleted the avi/global-assign-limited branch April 18, 2024 23:50
@oscardssmith oscardssmith added bugfix This change fixes an existing bug optimizer Optimization passes (mostly in base/compiler/ssair/) and removed merge me PR is reviewed. Merge when all tests are passing labels Apr 19, 2024
aviatesk added a commit that referenced this pull request Apr 19, 2024
…54130)

`abstract_eval_statement` may return `LimitedAccuracy` so we need to
handle it before applying `widenconst`.

- fixes #54125
@aviatesk aviatesk mentioned this pull request Apr 19, 2024
41 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport 1.11 Change should be backported to release-1.11 bugfix This change fixes an existing bug optimizer Optimization passes (mostly in base/compiler/ssair/)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

unhandled LimitedAccuracy when precompiling Tetris.jl on 1.11
3 participants