# Using Base.llvmcall for cross language LTO

**URL:** <https://discourse.julialang.org/t/using-base-llvmcall-for-cross-language-lto/136082>\
**Category:** General Usage\
**Created:** [March 7, 2026, 3:24pm UTC](https://discourse.julialang.org/t/using-base-llvmcall-for-cross-language-lto/136082 "2026-03-07T15:24:35Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![giordano](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/giordano/32/2166_2.png) [@giordano](https://discourse.julialang.org/u/giordano)\
**Post date:** [March 7, 2026, 5:47pm UTC](https://discourse.julialang.org/t/using-base-llvmcall-for-cross-language-lto/136082/2 "2026-03-07T17:47:32Z")

</div>

> [@obsidianjulua](#):
>
> This also opens the door for AD across language boundries since traditional ccall stopped the julia jit from following in the IR  
> […]  
> The real payoff is that AD tools can now differentiate through C/C++ code. Since llvmcall makes the IR visible to Julia’s compiler, Enzyme (or any LLVM-level AD) can follow the data  
> flow straight through what used to be an opaque ccall wall.

To be extremely clear, there’s nothing novel about this. This approach had been demonstrated in the paper [Scalable Automatic Differentiation of Multiple Parallel Paradigms through Compiler Augmentation](https://doi.org/10.1109/SC41404.2022.00065), by @wsmoses @vchuravy and their collaborators, and has been discussed a few times already here on Discourse. As mentioned in [Is there an equivalent to cross-language link time optimization via LLVM? - #18 by vchuravy](https://discourse.julialang.org/t/is-there-an-equivalent-to-cross-language-link-time-optimization-via-llvm/135625/18) (you even intervened in that thread), the main challenge is an infrastructural one: you need to make sure you use compatible versions of LLVM to compile every piece of code, to be able to merge all bitcodes.

---

_[View the full topic](https://discourse.julialang.org/t/using-base-llvmcall-for-cross-language-lto/136082)._
