[LLVMdev] Tail calls

Sandro Magi naasking at gmail.com
Wed Jun 20 13:22:55 PDT 2007


The ref manual states: The optional "tail" marker indicates whether
the callee function accesses any allocas or varargs in the caller. If
the "tail" marker is present, the function call is eligible for tail
call optimization. Note that calls may be marked "tail" even if they
do not occur before a ret instruction.

Does "eligible" in the above mean that some analysis is performed, and
if the call is found to meet certain criteria it is turned into a tail
call? Or is it guaranteed to perform a tail call if 'tail' is
specified?

The last statement of that paragraph implies that some analysis is
involved, but [1] states that there is no analysis performed.

Sandro

[1] http://nondot.org/sabre/LLVMNotes/GuaranteedEfficientTailCalls.txt



More information about the llvm-dev mailing list