[LLVMdev] Does LLVM optimize recursive call?

Journeyer J. Joh oosaprogrammer at gmail.com
Tue Oct 2 23:44:04 PDT 2012


Hi list,

I have a simple question about LLVM.

I learned that we need to use iterations than recursions in C programming.
That is because recursion is expensive. It can easily consume out all
the stack given to a program. And the call/return consumes time much
more.

But I've read a sentence that nowadays compilers can optimize
recursions in C or whatever languages not to consume heavy stack and
call/return.

I wonder what kind of optimization this is and if LLVM support this
kind of optimization.

I am not a compiler expert. Please consider this. ^^;

Thank you in advance

-- 
----------------------------------------
Journeyer J. Joh
o o s a p r o g r a m m e r
a t
g m a i l  d o t  c o m
----------------------------------------



More information about the llvm-dev mailing list