I've been writing a toy language for LLVM. The most ambitious feature I want to implement is fibers. I've read much about the matter, and I think I have a vague idea of how they are traditionally implemented. As far as I can tell, fibers are usually modeled as an instruction pointer and a stack. (See: the Golang runtime)
Is there any LLVM support for asynchronous execution, with different instruction pointers? Multiple stacks?
I'm aware that LLVM is a register machine, is there any way to ensure that all the relevant data is saved on the stack? And/or a way to save and restore the current register state?
Implementing this by hand would be a real pest, so any help is appreciated!