[patch] tailcall elimination
David Sehr
sehr at google.com
Tue Feb 12 09:27:05 PST 2013
All,
Just on the off chance people were curious: when I picked up Nick's change
I had some (mostly aesthetic) issues with using std::sort and
std::binary_search for this CL, but went ahead. When someone asked me
off-line mail why I was using WeakVH when my changes were entirely within
an optimization pass, I hit the tipping point, and decided to take the step
back and try using DenseSet, etc. I didn't want the community wasting any
more time reviewing the patch. So I am making it waste time reading my
missives instead. :-) Thanks for your patience.
David
On Mon, Feb 11, 2013 at 3:22 PM, David Sehr <sehr at google.com> wrote:
> Please ignore this patch for now. I am revising it according to some
> input provided off-line.
>
> David
>
>
> On Mon, Feb 11, 2013 at 8:59 AM, David Sehr <sehr at google.com> wrote:
>
>> 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/20130212/2660f2cc/attachment.html>
More information about the llvm-commits
mailing list