-
-
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
codegen restructuring #25984
codegen restructuring #25984
Conversation
Cool! How should I access the call targets from CUDAnative in order to build a module with all functions defined? |
Feel free to add exports from aotlayers.cpp to expose these with C wrappers. I know |
029e6fb
to
16f53fe
Compare
OK. Could you describe the behavior/indented use of eg. does this look sane jn/codegen-norecursion...tb/codegen-norecursion |
52ea79e
to
3e4a182
Compare
I'm thinking of moving the creation of the Module into the caller, to sidestep this question entirely. |
What about my other questions? Also, I was using |
That other method is not exported – I didn't change the signature of
Yes, probably true. But I don't really expect |
Also, renaming But this passes CUDAnative tests so 👍 from me (with the additions from jn/codegen-norecursion...tb/codegen-norecursion, that is). |
43f5ab9
to
4da4982
Compare
4da4982
to
4ac634d
Compare
4ac634d
to
50be707
Compare
50be707
to
333da81
Compare
This FreeBSD CI build already ran more than 9 hrs: https://freebsdci.julialang.org/#/builders/1/builds/9298 |
333da81
to
d28eaf3
Compare
@nanosoldier |
Your benchmark job has completed - possible performance regressions were detected. A full report can be found here. cc @ararslan |
d28eaf3
to
3c90511
Compare
extern JITEventListener *CreateJuliaJITEventListener(); | ||
|
||
// for image reloading | ||
bool imaging_mode = false; | ||
|
||
// shared llvm state | ||
static LLVMContext &jl_LLVMContext = *(new LLVMContext()); |
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.
static LLVMContext &jl_LLVMContext = *(new LLVMContext()); | |
JL_DLLEXPORT LLVMContext &jl_LLVMContext = *(new LLVMContext()); |
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.
One of the purpose of this change is to eliminate this state object. (There's a function accessor for it in the aotcompiler file)
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.
OK, so I can't be assuming a global state anymore starting with this PR? That'll require some more work on my side then 🙂
also provides support for using a different code_native format, as a fallback, later we'll want to make this more configurable there are now several primary interfaces to native code: - codegen: mostly internal, support for translating IR to LLVM - jitlayers: manages runtime codegen results and executable memory - aotcompile: support for managing external code output - disasm: pretty-printer for code objects - debuginfo: tracking for unwind info also removes the global type caches and move all codegen pass handling to aotcompile.cpp
4fdefdf
to
973aefe
Compare
A non-global LLVM context (but |
also provides support for using a different code_native format, as a fallback, later we'll want to make this more configurable there are now several primary interfaces to native code: - codegen: mostly internal, support for translating IR to LLVM - jitlayers: manages runtime codegen results and executable memory - aotcompile: support for managing external code output - disasm: pretty-printer for code objects - debuginfo: tracking for unwind info also removes the global type caches and move all codegen pass handling to aotcompile.cpp
also provides support for using a different code_native format, as a fallback, later we'll want to make this more configurable there are now several primary interfaces to native code: - codegen: mostly internal, support for translating IR to LLVM - jitlayers: manages runtime codegen results and executable memory - aotcompile: support for managing external code output - disasm: pretty-printer for code objects - debuginfo: tracking for unwind info also removes the global type caches and move all codegen pass handling to aotcompile.cpp
|
||
|
||
extern "C" JL_DLLEXPORT | ||
void *jl_get_llvmf_decl(jl_method_instance_t *mi, size_t world, bool getwrapper, const jl_cgparams_t params) |
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.
Is there an alternative function to use instead of this one? It was used in Cxx.jl: https://github.com/JuliaInterop/Cxx.jl/blob/256485c04c76feee515e83f091ba0d6c8f3286ee/src/cxxstr.jl#L107
This creates the function
jl_create_native
for outputting allvm::Module
from a list (jl_array_t
) of functions (jl_method_instance_t
) which is independent from the JIT (as needed by JuliaGPU/CUDAnative.jl#122). It's now used by the build system also, so that it'll be tested too. This (mostly) eliminates theshadow_module
, and does a slightly more aggressive job at ensuring functions are getting precompiled.There's still some more work to do to make that work even better, but that can be done later. I'm also now printing out errors that happen as a result of codegen bugs, rather than propagating them to the user, which makes a few of the tests (for codegen breakage) are a bit noisier now – those will need to be fixed now.
fixes #26767
fixes #26714