[llvm-commits] [llvm] r94937 - in /llvm/trunk: lib/Transforms/Scalar/TailRecursionElimination.cpp test/Transforms/TailCallElim/no-return-calls.ll

Evan Cheng evan.cheng at apple.com
Sun Jan 31 17:04:39 PST 2010


I should clarify. The recursion case should be handled by turning the call into a jump. The case I am disabling is something like this:

call longjmp
unreachable

It doesn't make sense to mark the call "tail" which would mean epilogue followed by a jump. The epilogue is not needed here.

Evan

On Jan 31, 2010, at 4:59 PM, Evan Cheng wrote:

> That's handled by tail call recursion elimination. It's a different issue.
> 
> Evan
> 
> On Jan 31, 2010, at 11:46 AM, Sebastian Redl wrote:
> 
>> Evan Cheng wrote:
>>> No. But it doesn't make sense to tail call no return calls as far as I can tell.
>>> 
>> I don't know how realistic this is, but I might have a function that
>> looks like this:
>> 
>> void recurse_and_jump(int n) {
>> if (n > 0) {
>>   // do something interesting
>>   recurse_and_jump(n-1);
>> } else
>>   exit(0); // or any other noreturn thing
>> }
>> 
>> This function is technically noreturn and would benefit from a tail call
>> opt.
>> 
>> Sebastian
> 
> 
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits





More information about the llvm-commits mailing list