-
-
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
Enable getting non-boxed LLVM type from Julia Type #56890
base: master
Are you sure you want to change the base?
Conversation
The current method :jl_type_to_llvm takes a pointer-to-bool parameter isboxed, which if non-null, is set to true if the Julia Type requires boxing. However, one may want to know the julia type without boxing and there is no mechanism for doing so. If the isboxed parameter is null and cannot be set, we can return the LLVM struct inside the jlvaluet as a way of returning the information. Users like LLVM.jl, GPUCompiler.jl, and ClangCompiler.jl always request the isboxed parameter set to a non-null value and would not be affected: https://github.com/maleadt/LLVM.jl/blob/ff15977666b313c25e0b66302fa789898e00279e/src/interop/base.jl#L74C25-L74C40 https://github.com/maleadt/GPUCompiler.jl/blob/8fb9b50d85df93183aba852c59dd7ae8e58c0abc/src/driver.jl#L65 https://github.com/Gnimuc/ClangCompiler.jl/blob/0e503fe94dff1b6965a6b43d9527258ba0c9593c/src/utils.jl#L2 and an old commit of staticcompiler.jl (https://github.com/el-oso/StaticCompiler.jl/blob/145ef4ad788acb0dc2928ded53827636fdf37563/src/utils.jl#L5). There are other users of this function on github
Why aren't you calling |
Iirc it’s not exported, though I can export it if that would be reasonable? |
Yeah, that could be exported, though seems very rare someone should call that |
Okay made a version for export. The reason we need it is essentially to avoid a GC error by figuring out the correct location of GC'd pointers in a gc_alloc call [and place atomic stores of nothing there rahter than undef] |
Those properties are normally queried by calling |
our recursive fixer requires the llvm version of the type [to cast to and recurses through the LLVM Type with geps to find the GC objects] |
The current method :jl_type_to_llvm takes a pointer-to-bool parameter isboxed, which if non-null, is set to true if the Julia Type requires boxing. However, one may want to know the julia type without boxing and there is no mechanism for doing so. If the isboxed parameter is null and cannot be set, we can return the LLVM struct inside the jlvaluet as a way of returning the information.
Users like LLVM.jl, GPUCompiler.jl, and ClangCompiler.jl always request the isboxed parameter set to a non-null value and would not be affected: https://github.com/maleadt/LLVM.jl/blob/ff15977666b313c25e0b66302fa789898e00279e/src/interop/base.jl#L74C25-L74C40 https://github.com/maleadt/GPUCompiler.jl/blob/8fb9b50d85df93183aba852c59dd7ae8e58c0abc/src/driver.jl#L65 https://github.com/Gnimuc/ClangCompiler.jl/blob/0e503fe94dff1b6965a6b43d9527258ba0c9593c/src/utils.jl#L2 and an old commit of staticcompiler.jl (https://github.com/el-oso/StaticCompiler.jl/blob/145ef4ad788acb0dc2928ded53827636fdf37563/src/utils.jl#L5).
There are other users of this function on github