how to turn off the tail optimization

Hello,

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?

Thanks!

Wei

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.

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 variables.

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.

Thanks!

Wei