crystal-lang / crystal

The Crystal Programming Language
https://crystal-lang.org
Apache License 2.0
19.33k stars 1.61k forks source link

Creating bindings to OrcJIT #14856

Open JarnaChao09 opened 1 month ago

JarnaChao09 commented 1 month ago

The current JITCompiler class utilizes LLVM MCJIT. MCJIT, while still supported by LLVM, is no longer preferred. The preferred JIT engine is now LLJIT/LLLazyJIT which uses the ORCv2 API. There should not be any breaking changes as a new module (LLVM::Orc) can be introduced and all Orc-related APIs could be under said module.

A preliminary test to bind against the ORCv2 C bindings can be seen here: https://gist.github.com/JarnaChao09/85ea2ec924ead8dd87b9937d5d5a94e5

HertzDevil commented 1 month ago

There are now plans to deprecate or remove MCJIT entirely: https://discourse.llvm.org/t/rfc-removing-mcjit-and-runtimedyld/80464

JarnaChao09 commented 1 month ago

There are now plans to deprecate or remove MCJIT entirely: https://discourse.llvm.org/t/rfc-removing-mcjit-and-runtimedyld/80464

This means that LLVM::JITCompiler will also need to be deprecated right? Does any of the core compiler rely on the jit compiler? My initial searches have turned up nothing.