Garbage Collection

Thanks for the example code. Its gives a good idea how the shadow stack
works.

But I have another question. Using the shadow stack is a nice and simple
way to implement GC, but it might have a large runtime overhead per
function call. Is there another way to preserve garbage specific
information (gcroots) through the llvm optimizer and native code
generator? This information could be used to create static stack
descriptors.

Another question, is it easy to tell which optimizations will break static
stack descriptors? I guess the Mem2Reg will break it, but are there any
others? Or can the llc native code generator break the static stack
descriptors as well? It might be possible to just disable these specific
dangerous optimizations.

Greets,
Paul.

And thanks for the fix to gc_alloc(), can't believe that didn't cause
problems. For reference I included the updated code here.

Paul

semigc.tar.gz (5.02 KB)