[patch] tailcall elimination

David Sehr sehr at google.com
Mon Feb 11 08:59:05 PST 2013


Hi Duncan,

Yes, my comments were a bit terse, to be sure.  Nick's patch enables tail
call elimination (including tail recursion elimination) subject to two
constraints on the function F being transformed:
1) alloca addresses cannot be *captured* by any call site in F.
2) alloca addresses cannot be *used* by the candidate call site S for tail
call elimination.

There was a small bug in how condition (2) was enforced.  It was only being
enforced for tail calls to functions other than F (recursive calls).  My
change checks the use of alloca both for labeling call sites with "tail"
and when converting them to iteration.

David


On Mon, Feb 11, 2013 at 6:12 AM, Duncan Sands <baldrick at free.fr> wrote:

> Hi David,
>
>
> On 10/02/13 23:50, David Sehr wrote:
>
>> This patch enables tail call optimization when alloca instructions are
>> present.
>>   It is based on
>> http://lists.cs.uiuc.edu/**pipermail/llvm-commits/Week-**
>> of-Mon-20121022/153958.html<http://lists.cs.uiuc.edu/pipermail/llvm-commits/Week-of-Mon-20121022/153958.html>,
>> by
>> adding a check that alloca addresses are not used by tail recursion
>> candidates.
>>
>
> did you change something wrt Nick's patch?
>
> Ciao, Duncan.
>
> ______________________________**_________________
> llvm-commits mailing list
> llvm-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/**mailman/listinfo/llvm-commits<http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20130211/428abb39/attachment.html>


More information about the llvm-commits mailing list