A function call as the last action of function body can be optimized by overwriting the stack frame of the caller. The callee returns directly to the caller of its caller. The gain of this program optimization is the stack space that is saved and a few instructions for restoring the return address and jumping to it. Tail recursion elimination is a special case.

-- EelcoVisser - 06 Dec 2001


CategoryOptimization

Revision: r1.1 - 06 Dec 2001 - 22:24 - EelcoVisser
Transform > ProgramOptimization > TailCallElimination
Copyright © 1999-2020 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki? Send feedback