# LLVM Bitcode for Graal

**URL:** https://discourse.julialang.org/t/llvm-bitcode-for-graal/103581
**Category:** New to Julia
**Tags:** question
**Created:** [September 6, 2023, 8:14pm UTC](https://discourse.julialang.org/t/llvm-bitcode-for-graal/103581 "2023-09-06T20:14:58Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![ShalokShalom](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/shalokshalom/32/52462_2.png) [@ShalokShalom](https://discourse.julialang.org/u/ShalokShalom)
#### Post date: [September 6, 2023, 8:14pm UTC](https://discourse.julialang.org/t/llvm-bitcode-for-graal/103581/1 "2023-09-06T20:14:58Z")

</div>

Hi there.

I know, there is already [an old thread open](https://discourse.julialang.org/t/getting-llvm-bitcode-from-julia-script/15249/3), that explains how to evaluate a single function as llvm bitcode.

I would like to translate a whole program to it - in order to [run it on Graal.](https://www.graalvm.org/latest/reference-manual/llvm/Compiling/)

---

<div class="post-metadata">

### Author: ![Benny](https://avatars.discourse-cdn.com/v4/letter/b/49beb7/32.png) [@Benny](https://discourse.julialang.org/u/Benny)
#### Post date: [September 6, 2023, 10:14pm UTC](https://discourse.julialang.org/t/llvm-bitcode-for-graal/103581/2 "2023-09-06T22:14:40Z")

</div>

That old thread says to put it in a function, which makes sense because all the Graal examples’ languages use a main function. Like those languages, only part of the program should go into a main function (which won’t need to be called `main` to put into `code_llvm`), and that old thread suggests `code_llvm` can include the rest of the module outside the main function with `dump_module=true` (`optimize=true` and `raw=true` also look relevant). I have no idea if that’ll work because the old thread doesn’t go on to say, but that seems like a good starting point for a github project.
