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

AbsInt: add interfaces to customize cases when cached results are used #53318

Merged
merged 1 commit into from
Feb 14, 2024

Conversation

aviatesk
Copy link
Member

For external abstract interpreters like JET, which propagate custom data interprocedurally, it is essential to inject custom behaviors into where cached regular/constant inference results are used. Previously, this was accomplished by overloading both abstract_call_method and get(::WorldView{CustomView}, ...) (and const_prop_call and cached_lookup), that method was admittedly hacky and should probably better to be avoided. Moreover, after #52233, doing so has become infeasible when the external abstract interpreter uses InternalCodeCache.

To address this issue, this commit provides an interface named return_cached_result. This allows external abstract interpreters to inject custom interprocedural data propagation during abstract interpretation even when they use InternalCodeCache.

For external abstract interpreters like JET, which propagate custom data
interprocedurally, it is essential to inject custom behaviors into where
cached regular/constant inference results are used. Previously, this was
accomplished by overloading both `abstract_call_method` and
`get(::WorldView{CustomView}, ...)` (and `const_prop_call` and
`cached_lookup`), that method was admittedly hacky and should probably
better to be avoided. Moreover, after #52233, doing so has become
infeasible when the external abstract interpreter uses `InternalCodeCache`.

To address this issue, this commit provides an interface named
`return_cached_result`. This allows external abstract interpreters to
inject custom interprocedural data propagation during abstract
interpretation even when they use `InternalCodeCache`.
aviatesk added a commit to aviatesk/JET.jl that referenced this pull request Feb 13, 2024
Leverages JuliaLang/julia#52233 to use the internal code cache that
comes with the inherent invalidation support.

Still requires:
- JuliaLang/julia#53300 (or JuliaLang/julia#53219)
- JuliaLang/julia#53318
aviatesk added a commit to aviatesk/JET.jl that referenced this pull request Feb 13, 2024
Leverages JuliaLang/julia#52233 to use the internal code cache that
comes with the inherent invalidation support.

Still requires:
- JuliaLang/julia#53300 (or JuliaLang/julia#53219)
- JuliaLang/julia#53318
aviatesk added a commit to aviatesk/JET.jl that referenced this pull request Feb 14, 2024
Leverages JuliaLang/julia#52233 to use the internal code cache that
comes with the inherent invalidation support.

Still requires:
- JuliaLang/julia#53300 (or JuliaLang/julia#53219)
- JuliaLang/julia#53318
aviatesk added a commit to aviatesk/JET.jl that referenced this pull request Feb 14, 2024
Leverages JuliaLang/julia#52233 to use the internal code cache that
comes with the inherent invalidation support.

Still requires:
- JuliaLang/julia#53300 (or JuliaLang/julia#53219)
- JuliaLang/julia#53318
@aviatesk aviatesk merged commit 09a27b3 into master Feb 14, 2024
4 of 7 checks passed
@aviatesk aviatesk deleted the avi/absint-cached-context branch February 14, 2024 10:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant