[LLVMdev] how to turn off the tail optimization

Wei Zhang wzh at cs.wisc.edu
Tue Feb 28 09:08:45 PST 2012

Hi Duncan,

At this point, I just want to turn off all inlining of calls that are 
tail calls.

I am doing some analysis that pick function calls that only access local 

Assume (1) A calls B, (2) A accesses only local variables, (3) B 
accesses both
local variables and heap/global variables, (4) B is the tail call, thus B is
inlined in A.

Then my analysis will point out that A also accesses non-local 
variables. So I
want to turn off this inlining.


On 02/28/2012 04:40 AM, Duncan Sands wrote:
> Hi Wei,
>> It seems to me that LLVM is merging/in-lining the tail function to its
>> caller.
>> I am wondering if there is a flag that I can use to turn off this
>> optimization?
> do you want to turn off all inlining, or only inlining of calls that are tail
> calls?  Why do you want to turn it off?
> Ciao, Duncan.
> _______________________________________________
> LLVM Developers mailing list
> LLVMdev at cs.uiuc.edu         http://llvm.cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev

More information about the llvm-dev mailing list