[PATCH] ARM: Do not tail-call to an externally-defined function with weak linkage

Tim Northover t.p.northover at gmail.com
Fri Aug 15 06:22:35 PDT 2014


Hi Oliver,

I'm really sorry, I've realised I was confused yesterday. For some reason I'd convinced myself that the nop/"branch-to-next" was the correct behaviour and that's what I was checking for. I see more clearly what you mean now.

So going onto the patch itself, I think it's in the wrong place. The "tail call" instructions inserted at IR level are (usually) more of a hint than a strict requirement. The backends decide what really should and shouldn't be made a tail call, using the "isEligibleForTailCallOptimisation" in XYZISelLowering.cpp (at least in the AArch64 & ARM cases).

My confusion also affects where this is valid. It's almost certainly needed for Linux -static compilations too. Darwin platforms appear to be closest to the pre-emptable Linux situation.

Cheers.

Tim.

http://reviews.llvm.org/D4906






More information about the llvm-commits mailing list