[LLVMdev] Tail-calling

Arnold Schwaighofer arnold.schwaighofer at gmail.com
Fri Sep 12 00:27:30 PDT 2008


On Fri, Sep 12, 2008 at 8:24 AM, Arnold Schwaighofer
<arnold.schwaighofer at gmail.com> wrote:
> For marking a call site as a tail call you have to call  void
> setTailCall(bool isTC = true) on the CallInst. The calling convention
> of the function needs to be CallingConv::Fast (currently only fastcc
> calls are optimized) and the call has to be in tail position of
> course.
The function performing the tail call also needs to be CallingConv::Fast.

Some info about tail call optimization is located at
<http://llvm.org/docs/CodeGenerator.html#tailcallopt>.
Some examples are in > ls /llvm/test/CodeGen/X86/tailcall*

regards arnold



More information about the llvm-dev mailing list