Hacker News new | ask | show | jobs
by mehrdadn 2826 days ago
Nope, if that's what LLVM says then they're wrong here. Tail call optimization has nothing inherently to do with recursion. Rather, "tail call" means that the call is the last (tail) thing the caller does. "Sibling call" doesn't really make a lot of sense to me either, since most calls are sibling calls, and most of them can't be optimized away like that.

For reference, back in 2001, Microsoft's .NET CIL specs already had [1] a "tail call" prefix, described as follows:

> Tail call prefix [indicates] that a method should relinquish its stack frame before executing a method call.

(LLVM's first release was in 2003.)

[1] https://www.ecma-international.org/publications/files/ECMA-S...