<div dir="ltr">The reason that GHC is forced to pass input to LLVM that is in CPS is ultimately quite simple: the GHC RTS expects to be able to move the GHC stack, because thread stacks are GC’d objects.  Until LLVM supports this, it is not possible for GHC to generate direct-style LLVM IR, because GHC“s implementation of lightweight threads depends on this.<div><br></div><div>Does LLVM have any support for the case where the stack pointer might change at a garbage collection?  If not, how difficult would it be to add such support?</div><div><br></div><div>Demi</div></div>