-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
base: release-1.11
Are you sure you want to change the base?
Conversation
@@ -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) |
There was a problem hiding this comment.
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).
There was a problem hiding this comment.
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
julia/base/compiler/typeinfer.jl
Line 331 in b3b2736
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?
There was a problem hiding this comment.
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)
@nanosoldier Edit: I made this on the wrong PR. Oh well. |
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.
e1c6f55
to
bd7c92e
Compare
There was a problem hiding this 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.
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.