Skip to content

[release-SPIRVIntrinsics-0.5] Port to LLVM.jl 10, and bump to 0.5.10 - #563

Draft
vchuravy wants to merge 1 commit into
release-SPIRVIntrinsics-0.5from
vc/spirvintrinsics-0.5-llvm10
Draft

vchuravy wants to merge 1 commit into
release-SPIRVIntrinsics-0.5from
vc/spirvintrinsics-0.5-llvm10

Conversation

@vchuravy

Copy link
Copy Markdown
Member

Backports LLVM.jl 10 support to the SPIRVIntrinsics 0.5 line and bumps it to 0.5.10, so that oneAPI.jl 2.6 (the last release line on GPUCompiler 1.x and SPIRVIntrinsics 0.5) can move to LLVM.jl 10. That's needed for Enzyme.jl, which moves to LLVM.jl 10 in EnzymeAD/Enzyme.jl#3741 while still supporting GPUCompiler 1.x through GPUCompiler 1.23.1 (JuliaGPU/GPUCompiler.jl#989, registered in JuliaRegistries/General#171343).

The base branch release-SPIRVIntrinsics-0.5 is a1d84b8. There, lib/intrinsics has the same tree as the registered 0.5.9 (ad282f32).

Changes, following the SPIRVIntrinsics part of #525 (1.2.0):

  • emit_localmemory and emit_printf replace the removed create_function/call_function with @llvmgenerated/generate_llvmcall. Local memory keeps 0.5.9's size and alignment.
  • Import the LLVM.IR and LLVM.Build vocabularies.
  • LLVM = "10", version 0.5.10.
  • The textual llvmcalls don't depend on LLVM.jl and are left alone.

Testing (no GPU): through oneAPI.jl 2.6.3 (the companion PR), on Julia 1.10 and 1.12 with GPUCompiler 1.23.1 and LLVM.jl 10.1.1.

  • Kernels that use local memory, barriers, @printf, atomics and work-item queries compile to SPIR-V that passes spirv-val.
  • After stripping debug info and metadata, their optimized LLVM IR matches 0.5.9 with LLVM.jl 9 (oneAPI 2.6.2, GPUCompiler 1.23.0) instruction for instruction. The only differences are a trivial br label %top block and one dead block that are no longer emitted.
  • OpenCL.jl's own test suite was not run: OpenCL.jl at this commit is still on LLVM.jl 9.

🤖 Generated with Claude Code

Backport of the SPIRVIntrinsics part of "Upgrade to LLVM.jl 10" (#525)
to the 0.5 release line. LLVM.jl 10 removed `create_function` and
`call_function`, so local memory and printf now generate their IR with
`@llvmgenerated` and `generate_llvmcall`, and use properties instead of
the removed accessors. `using LLVM` no longer exports the API, so import
the IR and Build vocabularies too. The textual `llvmcall`s are left as
they are, since they don't depend on LLVM.jl.

Local memory keeps 0.5.9's size and alignment computation.

Assisted-by: Claude Code (Opus 5.5)
@maleadt maleadt added the kernels Writing and compiling kernels: device intrinsics, codegen, KernelAbstractions back-end. label Oct 19, 2026

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

kernels Writing and compiling kernels: device intrinsics, codegen, KernelAbstractions back-end.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants