<div dir="auto">I am the developer of a compiler frontend that generates llvm IR. The language is garbage collected, but currently doesn't have any support for stack maps yet, which severely limits the places where garbage collection can occur.<div dir="auto"><br></div><div dir="auto">I would like to fix this, and am familiar with the documents online relating to gc strategies and statepoints in llvm. However, it seems much of the support for state points is dependent on the assumption that references are never passed to unmanaged functions, and you never have a pointer that might be garbage collected, or might not be, and you don't know at compile time.</div><div dir="auto"><br></div><div dir="auto">Our language violates both of these constraints. There are certain built in functions in the language that are implemented in c++ and passed direct pointers to garbage collected values (although garbage collection will never occur during these functions). There are also some types for which some constants are allocated statically in the data segment, and other non-constant values are allocated on the heap. Dereferencing the pointer can tell me which is which. Finally, some values of pointer type actually contain integer data, making use of the fact that all real pointers in our language are aligned, a la ocaml.</div><div dir="auto"><br></div><div dir="auto">Bearing these things in mind, what would I need to do in order to be able to use the llvm statepoint functionality to generate stack maps? Is it even practical to do so given the current code?</div></div>