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

1.11: allow external abstract interpreter compilation #53488

Open
wants to merge 1 commit into
base: release-1.11
Choose a base branch
from

Conversation

aviatesk
Copy link
Member

As mentioned in #53478, the precompilation support for external abstract interpreters in v1.11 isn't perfect, and directly cherry-picking the refined test cases from #53478 into the v1.11 backport branch leads to a test failure (note that this particular problem has likely been fixed in the master branch, probably thanks to #53300). To address this, this commit does more than just cherry-pick the test case, and it also modifies the CodeInstance(::AbstractInterpreter, ::InferenceResult) constructor to allow precompilation for external abstract interpreters in v1.11.

@aviatesk aviatesk requested review from vchuravy and vtjnash February 27, 2024 09:00
@@ -321,7 +321,7 @@ function CodeInstance(interp::AbstractInterpreter, result::InferenceResult,
t = @_gc_preserve_begin inferred_result
relocatability = unsafe_load(unsafe_convert(Ptr{UInt8}, inferred_result), Core.sizeof(inferred_result))
@_gc_preserve_end t
elseif inferred_result === nothing
elseif !(inferred_result isa CodeInfo)
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is the actual fix. The other changes are the refinements on the test cases (which were done in #53478).

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hm but on master we still have

elseif inferred_result === nothing

So I am not sure how it would be fixed there. IIRC even on master I needed a abs int overload that set relocatability?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The relocatability indicates that we know the inferred field is safe to duplicate, which doesn't seem would be the case if this is not one of the expected objects? (i.e. String or Nothing)

@KristofferC
Copy link
Member

KristofferC commented Feb 27, 2024

@nanosoldier runtests(vs=":release-1.10")

Edit: I made this on the wrong PR. Oh well.

@JuliaLang JuliaLang deleted a comment from nanosoldier Feb 27, 2024
Base automatically changed from backports-release-1.11 to release-1.11 March 1, 2024 08:30
@KristofferC KristofferC changed the base branch from release-1.11 to backports-release-1.11 March 14, 2024 11:51
As mentioned in #53478, the precompilation support for external abstract
interpreters in v1.11 isn't perfect, and directly cherry-picking the
refined test cases from #53478 into the v1.11 backport branch leads to
a test failure (note that this particular problem has likely been fixed
in the master branch, probably thanks to #53300). To address this, this
commit does more than just cherry-pick the test case, and it also
modifies the `CodeInstance(::AbstractInterpreter, ::InferenceResult)`
constructor to allow precompilation for external abstract interpreters
in v1.11.
@aviatesk aviatesk force-pushed the avi/1.11-precompile-ext-absint branch from e1c6f55 to bd7c92e Compare March 14, 2024 13:28
Base automatically changed from backports-release-1.11 to release-1.11 March 17, 2024 20:19
Copy link
Member

@vchuravy vchuravy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I must admit I don't fully understand how serialization of custom data works on master, but I do believe the current change is too permissive.

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.

4 participants