-
-
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
Make Expr(:invoke) target be a CodeInstance, not MethodInstance #54899
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
vtjnash
force-pushed
the
jn/codeinfo-edges
branch
2 times, most recently
from
June 24, 2024 20:51
af03fd5
to
91be20b
Compare
vtjnash
force-pushed
the
jn/codeinfo-edges
branch
2 times, most recently
from
July 16, 2024 21:46
ce5726f
to
d2c2e51
Compare
vtjnash
force-pushed
the
jn/codeinfo-edges
branch
3 times, most recently
from
July 22, 2024 20:40
2f824bf
to
33701f1
Compare
vtjnash
force-pushed
the
jn/codeinfo-edges
branch
from
September 17, 2024 14:27
33701f1
to
4525784
Compare
aviatesk
force-pushed
the
jn/codeinfo-edges
branch
7 times, most recently
from
September 27, 2024 09:49
a9c4eeb
to
fe8d042
Compare
aviatesk
force-pushed
the
jn/codeinfo-edges
branch
2 times, most recently
from
October 4, 2024 06:30
a5a2db9
to
6f64fd6
Compare
aviatesk
force-pushed
the
jn/codeinfo-edges
branch
2 times, most recently
from
October 16, 2024 12:15
52efd2b
to
2ecae72
Compare
aviatesk
force-pushed
the
jn/codeinfo-edges
branch
7 times, most recently
from
October 25, 2024 13:49
140f560
to
23c3250
Compare
vtjnash
force-pushed
the
jn/codeinfo-edges
branch
2 times, most recently
from
October 31, 2024 18:26
d33a71e
to
809d3fb
Compare
vtjnash
force-pushed
the
jn/invoke-codeinstance
branch
from
November 20, 2024 20:29
692a21b
to
f89d58d
Compare
This should be ready to go now, since it seems working, it would be nice to merge before it picks up spurious conflicts. @nanosoldier Some improvements can be done later:
|
Make :invoke edges to CodeInstance (with rettype and edges) instead of MethodInstance, for more accuracy (except when inference made a mistake). Remove lookup parameter from codegen, since we no longer do any lookup.
Keno
force-pushed
the
jn/invoke-codeinstance
branch
from
November 21, 2024 05:11
f89d58d
to
cf3e3e3
Compare
@vtjnash small conflicts with my worldage PR, so I rebased this for you, just FYI |
Your benchmark job has completed - possible performance regressions were detected. A full report can be found here. |
aviatesk
added a commit
to JuliaDebug/Cthulhu.jl
that referenced
this pull request
Nov 21, 2024
Although these code paths don’t seem to be used very often.
Keno
added a commit
that referenced
this pull request
Nov 22, 2024
This PR allows generated functions to return a `CodeInstance` containing optimized IR, allowing them to bypass inference and directly adding inferred code into the ordinary course of execution. This is an enabling capability for various external compiler implementations that may want to provide compilation results to the Julia runtime. As a minimal demonstrator of this capability, this adds a Cassette-like `with_new_compiler` higher-order function, which will compile/execute its arguments with the currently loaded `Compiler` package. Unlike `@activate Compiler[:codegen]`, this change is not global and the cache is fully partitioned. This by itself is a very useful feature when developing Compiler code to be able to test the full end-to-end codegen behavior before the changes are capable of fully self-hosting. A key enabler for this was the recent merging of #54899. This PR includes a hacky version of the second TODO left at the end of that PR, just to make everthing work end-to-end. This PR is working end-to-end, but all three parts of it (the CodeInstance return from generated functions, the `with_new_compiler` feature, and the interpreter integration) need some additional cleanup. This PR is mostly intended as a discussion point for what that additional work needs to be.
Keno
added a commit
that referenced
this pull request
Dec 12, 2024
Together with #54899, this PR is intending to replicate the functionality of #54373, which allowed particular specializations to have a different ABI signature than what would be suggested by the MethodInstance's `specTypes` field. This PR handles that by adding a special `ABIOverwrite` type, which, when placed in the `def` field of a `CodeInstance` instructs the system to use the given signature instead.
Keno
added a commit
that referenced
this pull request
Dec 12, 2024
Together with #54899, this PR is intending to replicate the functionality of #54373, which allowed particular specializations to have a different ABI signature than what would be suggested by the MethodInstance's `specTypes` field. This PR handles that by adding a special `ABIOverwrite` type, which, when placed in the `def` field of a `CodeInstance` instructs the system to use the given signature instead.
Keno
added a commit
that referenced
this pull request
Dec 12, 2024
Together with #54899, this PR is intending to replicate the functionality of #54373, which allowed particular specializations to have a different ABI signature than what would be suggested by the MethodInstance's `specTypes` field. This PR handles that by adding a special `ABIOverwrite` type, which, when placed in the `def` field of a `CodeInstance` instructs the system to use the given signature instead.
Keno
added a commit
that referenced
this pull request
Dec 18, 2024
Together with #54899, this PR is intending to replicate the functionality of #54373, which allowed particular specializations to have a different ABI signature than what would be suggested by the MethodInstance's `specTypes` field. This PR handles that by adding a special `ABIOverwrite` type, which, when placed in the `def` field of a `CodeInstance` instructs the system to use the given signature instead.
Keno
added a commit
that referenced
this pull request
Dec 18, 2024
Together with #54899, this PR is intending to replicate the functionality of #54373, which allowed particular specializations to have a different ABI signature than what would be suggested by the MethodInstance's `specTypes` field. This PR handles that by adding a special `ABIOverwrite` type, which, when placed in the `def` field of a `CodeInstance` instructs the system to use the given signature instead.
Keno
added a commit
that referenced
this pull request
Dec 18, 2024
Together with #54899, this PR is intending to replicate the functionality of #54373, which allowed particular specializations to have a different ABI signature than what would be suggested by the MethodInstance's `specTypes` field. This PR handles that by adding a special `ABIOverwrite` type, which, when placed in the `def` field of a `CodeInstance` instructs the system to use the given signature instead.
Keno
added a commit
that referenced
this pull request
Dec 18, 2024
Together with #54899, this PR is intending to replicate the functionality of #54373, which allowed particular specializations to have a different ABI signature than what would be suggested by the MethodInstance's `specTypes` field. This PR handles that by adding a special `ABIOverwrite` type, which, when placed in the `def` field of a `CodeInstance` instructs the system to use the given signature instead.
Keno
added a commit
that referenced
this pull request
Dec 18, 2024
Together with #54899, this PR is intending to replicate the functionality of #54373, which allowed particular specializations to have a different ABI signature than what would be suggested by the MethodInstance's `specTypes` field. This PR handles that by adding a special `ABIOverwrite` type, which, when placed in the `def` field of a `CodeInstance` instructs the system to use the given signature instead.
Keno
added a commit
that referenced
this pull request
Dec 18, 2024
Together with #54899, this PR is intending to replicate the functionality of #54373, which allowed particular specializations to have a different ABI signature than what would be suggested by the MethodInstance's `specTypes` field. This PR handles that by adding a special `ABIOverwrite` type, which, when placed in the `def` field of a `CodeInstance` instructs the system to use the given signature instead.
Keno
added a commit
that referenced
this pull request
Dec 19, 2024
Together with #54899, this PR is intending to replicate the functionality of #54373, which allowed particular specializations to have a different ABI signature than what would be suggested by the MethodInstance's `specTypes` field. This PR handles that by adding a special `ABIOverwrite` type, which, when placed in the `def` field of a `CodeInstance` instructs the system to use the given signature instead.
Keno
added a commit
that referenced
this pull request
Dec 19, 2024
Together with #54899, this PR is intending to replicate the functionality of #54373, which allowed particular specializations to have a different ABI signature than what would be suggested by the MethodInstance's `specTypes` field. This PR handles that by adding a special `ABIOverwrite` type, which, when placed in the `def` field of a `CodeInstance` instructs the system to use the given signature instead.
aviatesk
added a commit
to JuliaDebug/Cthulhu.jl
that referenced
this pull request
Dec 19, 2024
Although these code paths don’t seem to be used very often.
aviatesk
added a commit
to JuliaDebug/Cthulhu.jl
that referenced
this pull request
Dec 19, 2024
Although these code paths don’t seem to be used very often.
Keno
added a commit
that referenced
this pull request
Dec 19, 2024
Together with #54899, this PR is intending to replicate the functionality of #54373, which allowed particular specializations to have a different ABI signature than what would be suggested by the MethodInstance's `specTypes` field. This PR handles that by adding a special `ABIOverwrite` type, which, when placed in the `def` field of a `CodeInstance` instructs the system to use the given signature instead.
Keno
added a commit
that referenced
this pull request
Dec 20, 2024
Together with #54899, this PR is intending to replicate the functionality of #54373, which allowed particular specializations to have a different ABI signature than what would be suggested by the MethodInstance's `specTypes` field. This PR handles that by adding a special `ABIOverwrite` type, which, when placed in the `owner` field of a `CodeInstance` instructs the system to use the given signature instead.
stevengj
pushed a commit
that referenced
this pull request
Jan 2, 2025
Together with #54899, this PR is intending to replicate the functionality of #54373, which allowed particular specializations to have a different ABI signature than what would be suggested by the MethodInstance's `specTypes` field. This PR handles that by adding a special `ABIOverwrite` type, which, when placed in the `owner` field of a `CodeInstance` instructs the system to use the given signature instead.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This is a look at what is necessary and what it would look like for codegen to be using CodeInstance directly to get the API for a function call (specifically the rettype), rather than using a lookup call at that point to decide upon the API. It is based around the idea that eventually we would keep track of these anyways to form a graph of the inferred edge data, for use later in validation anyways (instead of attempting to invert the backedges graph in staticdata_utils.c), so we might as well use the same target type for the :invoke call representation also.
This does not depend upon #54894, but is much better with it. It did depend upon #54738, thoughthere still remains work to do to teach it how to select a correct alternative CodeInstance after deserializing. Also still to do: codegen also should be looking for equivalent objects, not just using the exact one given, per the definition of equivalency in https://hackmd.io/@vtjnash/codeinstances (and that is what precompile should be doing also).Depends on
#56552,#56551,#56547,#56598