Repository navigation
Conversation
Local memory, invariant loads, the constant tables for randn, printf and the additional kernel arguments all built their IR with create_function/call_function around a lot of context and builder boilerplate. LLVM.jl 9.14's @llvmgenerated and generate_llvmcall derive the LLVM signature from the Julia one and verify the generated IR, so use those instead. printf needs the Julia types of its varargs, so it stays a @generated function that uses generate_llvmcall.
maleadt
force-pushed
the
tb/llvmgenerated
branch
from
September 28, 2026 20:24
2bfc507 to
acd2a56
Compare
Merged
Member
Author
|
Superseded by #525, which includes this commit and ports OpenCL.jl to the released LLVM.jl 10. |
This file contains hidden or 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
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.
Ports OpenCL.jl's and SPIRVIntrinsics' IR-generating functions to the interface added in JuliaLLVM/LLVM.jl#596: local memory,
unsafe_invariant_load, the constant tables used byrandn,@printf, and the additional kernel arguments for the RNG state.emit_printfneeds the Julia types of its varargs, so it stays a@generatedfunction that usesgenerate_llvmcall.This requires LLVM.jl 9.14, which hasn't been released yet, so it stays a draft until then. It also bumps SPIRVIntrinsics' LLVM compat, so that package needs a new release as well.
Tested locally on PoCL with LLVM.jl's
tb/llvmgeneratedbranch: the test suite passes, with both the SPIR-V and OpenCL C back-ends.