stevefan1999 opened issue #3593:
For example, you want to build a RISC-V JIT which does not exist ATM, or exotic platforms such as Atmel and Xtensa, or even targets different bitcode such as LLVM and RyuJIT. We could also retain the x86 target this way which is vital to building some legacy application for legacy platform such as Windows XP.
cfallin commented on issue #3593:
Hi @stevefan1999 -- thanks for the suggestion!
I think that while there's no technical reason that would prevent definition of a machine backend out-of-tree, it would also mean that we would need to expose more API than we do today, and make some guarantees about the stability of these APIs. Otherwise, an externally-maintained machine backend would need frequent changes to continue working.
In practice we tend to make changes to the backend framework together with all backends, when we need to do so, without much hesitation; for example, introducing a new trait method or tweaking a function signature. It would be a significant limitation to not be able to do such refactors easily.
We'd be happy to accept contributions for new machine backends in-tree; RISC-V, for example, is of interest to a bunch of folks. If it were to exist, there would be significant willingness to maintain and improve it in-tree, I think. Likewise for x86-32: if someone wants to build this out, it would be perfectly reasonable to keep it in-tree.
Translators to another IR, such as LLVM bitcode, are a bit of different matter IMHO as these generally do not operate within our compiler-backend framework (LLVM bitcode is at a similar abstraction level to CLIF and doesn't need CFG lowering or register allocation, for example). @bjorn3 prototyped a CLIF-to-LLVM translator in #3391 and we suggested then to maintain it out-of-tree for now. That' s an existence proof that such things are possible today :-)
akirilov-arm labeled issue #3593:
For example, you want to build a RISC-V JIT which does not exist ATM, or exotic platforms such as Atmel and Xtensa, or even targets different bitcode such as LLVM and RyuJIT. We could also retain the x86 target this way which is vital to building some legacy application for legacy platform such as Windows XP.
akirilov-arm labeled issue #3593:
For example, you want to build a RISC-V JIT which does not exist ATM, or exotic platforms such as Atmel and Xtensa, or even targets different bitcode such as LLVM and RyuJIT. We could also retain the x86 target this way which is vital to building some legacy application for legacy platform such as Windows XP.
Last updated: Nov 22 2024 at 16:03 UTC