How to generate a reusable static LLVM IR module?

Hello, I am a beginner in Julia programming.

I need a way to generate a static LLVM IR module for functions written in Julia and modify the LLVM IR that was generated.

I saw on CUDAnative.jl , there are some features like CodegenHooks, CodegenParams to disable some incompatible language features and the function _dump_function . How can I use the same approach by using Julia 1.7.1 or a more recent version because CUDAnative was implemented for Julia 1.O ?

In the package GPUcompiler.jl the function Irgen can help me , but I don’t know how to use it. If someone could explain to me it would be great.

If there is another way to generate a static LLVM IR module by using Julia 1.7.1 or a more recent version. Don’t hesitate to explain to me.

Thanks in advance for your help.

While this isn’t super begginer stuff, you can use GPUCompiler.jl together with LLVM.jl to play around with the LLVM IR

1 Like