3 ms·
> A non-copying GC, because LLVM doesn't currently support copying GC satisfactorily This is a shame that this is so badly documented. I stumbled upon this way
by Raphael_Amiard 14y ago
> A non-copying GC, because LLVM doesn't currently support copying GC satisfactorily
This is a shame that this is so badly documented. I stumbled upon this way after having coded the whole code generator of my Z3 project (https://github.com/raph-amiard/Z3 https://github.com/raph-amiard/Z3 - Ocaml bytecode -> LLVM compiler). The fact that you have to explicitly handle live roots with stacks instructions defeats a lot of the purpose of LLVM IR.
- pcwalton 14y agoI've got a bunch of code in a branch to allow register roots: https://github.com/pcwalton/llvm/tree/noteroots-ir https://github.com/pcwalton/llvm/tree/noteroots-ir It just automatically roots live values that are pointers in a nonzero addrspace. Still doesn't support copying GC, and only works in the fast instruction selector at the moment, but it goes a long way toward making GC performant in LLVM.
- cwzwarich 14y agoThe fast instruction selector only supports some constructs, whereas others are handled by fallback to the standard SelectionDAG instruction selection. In order to use this, do you have to ensure that you never trigger any of these fallbacks?
- pcwalton 14y agoYes. This is just for now, as fast isel is much easier to work with. I have other branches that implement most of the SelectionDAG support needed as well, but they aren't updated to the most recent work.