[LLVMdev] [PATCH] Go on dragonegg

Duncan Sands baldrick at free.fr
Thu Aug 18 08:06:16 PDT 2011


Hi Sanjoy,

> Attached patches change how dragonegg lowers trampolines (for
> compatibility with Go).

I think the right approach is to add an llvm.adjust.trampoline intrinsic
to LLVM (and change llvm.init.trampoline to not return a result).  Then the
dragonegg trampoline code will become trivial, and the Go problem will just
Go away :)  In fact this was how I first did it: two intrinsics, just like in
GCC (probably the commits are still in the repository history).  Chris asked me
to combine them into one if possible, and I did but I now think that that was a
mistake because they don't go naturally together: the call to adjust_trampoline
can occur far away from the call to init.trampoline (eg: in a different
function).  As you can see in the dragonegg code, by doing evil tricks you can
overcome this difference between the intrinsics, but as you also discovered it
is fragile and broke the moment Go generalized the use of trampolines.

Ciao, Duncan.



More information about the llvm-dev mailing list