NOTE: My original post was MIME mangled.
So I'm reposting it. Sorry for that.
Hi,
createTailCallEliminationPass() is able to turn recursive
functions into loops when the functions are written
in tail recursive form. However, I'm unable to get it
to convert mutually recursive functions to run without
a growing stack.
For example (in pseudo code)-
define fact(n,result)
if n < 2
then result
else fact(n-1,result *n)
is converted into a loop correctly. However the following
mutually recursive pair -
define even(n)
if n == 0
then true
else odd(n-1)
define odd(n)
if n==0
then false
else even(n-1)
doesn't get to run in constant stack space.
Is that possible with llvm?
-Srikumar
Chris Lattner
2008-Aug-04 04:49 UTC
[LLVMdev] Repost: question about tail call elimination pass
On Aug 3, 2008, at 9:12 PM, kumar wrote:> NOTE: My original post was MIME mangled. > So I'm reposting it. Sorry for that.Please see: http://lists.cs.uiuc.edu/pipermail/llvmdev/2008-August/016285.html -Chris
Possibly Parallel Threads
- [LLVMdev] question about tail call elimination pass ..
- [LLVMdev] question about tail call elimination pass ..
- repost - Can one edit the file that generates the scaffolding.css?
- [PATCH repost] virtio-net: remove useless disable on freeze
- [PATCH repost] virtio-net: remove useless disable on freeze