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

Török Edwin edwintorok at gmail.com
Tue Feb 2 10:41:22 PST 2010


On 2010-02-02 20:19, Chris Lattner wrote:
> On Feb 2, 2010, at 10:07 AM, Evan Cheng wrote:
>
>   
>> I'll deal with this later. To me if the call isn't before a proper  
>> function epilogue I don't see it as a "tail call". But if that's the  
>> definition, I'll move the check elsewhere.
>>     
>
> It seems legal and profitable (though potentially not worth the  
> trouble to implement) to turn:
>
> void bar(int a) {
>    call foo(a)
>    unreachable
> }
>
> into:
>
> bar:
>    jmp foo
>   

This should be turned into 'jmp foo' if the call is followed by a 'ret
void', or 'ret %call' to.

Best regards,
--Edwin



More information about the llvm-commits mailing list