[LLVMdev] Repost: question about tail call elimination pass
srikumarks at mac.com
Sun Aug 3 21:12:37 PDT 2008
NOTE: My original post was MIME mangled.
So I'm reposting it. Sorry for that.
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)-
if n < 2
else fact(n-1,result *n)
is converted into a loop correctly. However the following
mutually recursive pair -
if n == 0
doesn't get to run in constant stack space.
Is that possible with llvm?
More information about the llvm-dev