[llvm-commits] [llvm] r106662 - /llvm/trunk/lib/Target/ARM/ARMISelLowering.cpp
Dale Johannesen
dalej at apple.com
Thu Jun 24 10:47:18 PDT 2010
On Jun 23, 2010, at 11:51 PMPDT, Chris Lattner wrote:
> On Jun 23, 2010, at 11:52 AM, Dale Johannesen wrote:
>> Author: johannes
>> Date: Wed Jun 23 13:52:34 2010
>> New Revision: 106662
>>
>> URL: http://llvm.org/viewvc/llvm-project?rev=106662&view=rev
>> Log:
>> Do not do tail calls to external symbols. If the
>> branch turns out to be ARM-to-Thumb or vice versa
>> the linker cannot resolve this. 8120438.
>>
>> If this optimization is going to be useful we probably
>> need a compiler flag "assume callees are same architecture"
>> or something like that.
>
> Wow, this is a pretty bad limitation. Does GCC have the same
> limitation?
The limitation is imposed by the linker, not the compiler. Yes,
gcc-4.2 on darwin behaves the same way: it does tail calls to
functions defined in the same module, but not external calls.
As Bob says, doing tail call on ARM-to-thumb calls is a loser, as can
be seen from Rafael's example, which executes an extra instruction
over doing the call normally. However I would guess most external
calls will not be cross-architecture in practice, so it might win
pragmatically (apparently the GNU people think so, I wonder if they
have any actual data behind this belief?).
More information about the llvm-commits
mailing list