[llvm-commits] [RFC] Patch 1/3 for the native code compiler of Erlang

Jakob Stoklund Olesen stoklund at 2pi.dk
Wed May 2 11:42:11 PDT 2012


On May 2, 2012, at 10:36 AM, Yiannis Tsiouris <gtsiour at softlab.ntua.gr> wrote:

> 0001:
> | Implemented a new calling convention (cc 11) for HiPE similar to GHC's
> | cc 10. In detail:
> | * Inserted new symbol "cc 11" (CallingConv::HiPE).
> | * Created cc and retcc for both 32 and 64 bit.
> | * HiPE cc defines no calleE-save registers.
> | * HiPE cc supports tail call optimization.

Please add test cases.

> 0002:
> | Hack fix for GR32_TC registers.
> | Add EBX, EDI to GR32_TC register class to handle a "ran out of
> | registers during register allocation" in case of tailcall existence
> | because in EAX, ECX, EDX are all argument registers in HiPE CC.

You can't just change GR32_TC to make an assertion go away. Those registers must not be callee-saved, they are used to hold the address of the function jumped to in a dynamic tail call.

How does a dynamic tail call work when all registers are callee-saved?

/jakob




More information about the llvm-commits mailing list