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.
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
Expose the Julia JIT with a C API #49858
Expose the Julia JIT with a C API #49858
Changes from all commits
c8e5305
9b418ed
fe67d67
5ad6f4a
f8dee84
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
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.
Long-term we might want many ExternalJDs and was considering a design where we had one JD per world in Julia.
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.
We can add as many JDs as we want with the ExecutionSession. The difference is that this one is linked in by default.
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.
There should not be any way for ExternalJD to access JD or vice versa. Neither of those should be accidentally breaking the content of the other.
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 guess this one is kind of wrong, but we do want to keep the ability to llvmcall a function from an external JD to avoid doing the trampoline/function pointer dance we do right now.
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.
That seems likely to go very badly for users. The llvmcall itself right now should not be able to access JD state either, but that is a different bug.
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.
How would it go bad for the users? (llvmcall currently aborts if it doesn't find a symbol but that's separate)
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.
JD is an implementation detail and not one that is stable, or one that we think is good right now. We could fix the llvmcall crash by checking that it does not contain declarations (except of intrinsic things) and otherwise reject it when we parsed it. That would do the right thing.
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 change should be reverted?
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 should take some sort of handle that was returned by from addExternalModule / addObjectFile to do the lookup inside of. No global variables (esp. GlobalJD and JD) should be accessed here since their content is unreliable.
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 C API supports DataLayout objects, so just return it directly?
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.
Oh, I didn't know that, because the other functions (GetDataLayout,SetDatalayout etc) that move it around all use C strings
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.
Ah, I see that the existing APIs use strings too (
LLVMOrcLLJITGetDataLayoutStr
), so I'm OK keeping it as strings for consistency.