Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

> 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 - 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.



I've got a bunch of code in a branch to allow register roots: 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.


The 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?


Yes.

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.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: