Skip to content

C-API for Julia dialect - #62939

Draft
vchuravy wants to merge 2 commits into
vc/llvm-dialects-internal-usagefrom
vc/llvm-dialects-capi
Draft

C-API for Julia dialect#62939
vchuravy wants to merge 2 commits into
vc/llvm-dialects-internal-usagefrom
vc/llvm-dialects-capi

Conversation

@vchuravy

Copy link
Copy Markdown
Member

Introducing a C-API to be used by LLVM.jl for our Julia dialect

Assisted-by: Claude


Stack created with GitHub Stacks CLIGive Feedback 💬

@vchuravy
vchuravy force-pushed the vc/llvm-dialects-capi branch 2 times, most recently from 15a373e to 840dddc Compare August 31, 2026 16:58
@vchuravy
vchuravy force-pushed the vc/llvm-dialects-capi branch from 840dddc to 7fc9139 Compare August 31, 2026 17:52
@vchuravy
vchuravy force-pushed the vc/llvm-dialects-capi branch from 7fc9139 to 8ad2842 Compare August 31, 2026 18:17
@vchuravy
vchuravy force-pushed the vc/llvm-dialects-capi branch from 8ad2842 to 742e19d Compare August 31, 2026 18:48
Expose the Julia dialect to external IR producers (GPUCompiler.jl,
Enzyme.jl, and eventually a Julia port of codegen itself) through a C API
in libjulia-codegen: JLDialectsAttachContext/JLDialectsDisposeContext to
attach the dialect to an LLVMContext, JLBuild* functions that construct
each op with the correct name, type, and attributes at an LLVMBuilderRef's
insertion point, and JLDialectsVerifyModule to run the llvm-dialects
verifier over a module.

Assisted-by: Claude Code (Fable 5)
Follow the LLVMVerifyModule conventions in JLDialectsVerifyModule: return
0 on success, and optionally capture the verifier diagnostics into a
caller-disposed message instead of printing them to stderr, so wrappers
can surface them in exceptions. Add JLDialectsGCAllocBytesSizeType to
query the target-dependent integer type of julia.gc_alloc_bytes' size
and type-tag arguments.

Assisted-by: Claude Code (Fable 5)
@vchuravy
vchuravy force-pushed the vc/llvm-dialects-capi branch from 742e19d to 53b2018 Compare August 31, 2026 19:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant