[PATCH] D12923: Add support for function attribute "notail"
Sanjoy Das via llvm-commits
llvm-commits at lists.llvm.org
Wed Sep 16 22:04:23 PDT 2015
sanjoy added a comment.
In http://reviews.llvm.org/D12923#247639, @ahatanak wrote:
> No, tail call optimization doesn't have to be disabled on indirect calls.
What if the indirect callee is marked with `notail`? Isn't the whole point of `notail` that functions marked `notail` won't have tail calls to them?
Perhaps I'm missing something here, so it helps to be concrete -- in the C example I gave, what's the expected behavior of the program if the function pointer passed to `f` via `ptr` is a `notail` function?
I think the `notail` should be on the call instruction, not on the callee; as some sort of "inverse" of `musttail`. Then we can teach the optimizer to never codegen a `notail` call as a tail call.
http://reviews.llvm.org/D12923
More information about the llvm-commits
mailing list