[PATCH] [Commented On] D22529: Inlining of empty/small variadic functions.

Sunil Srivastava via llvm-commits llvm-commits at lists.llvm.org
Thu Sep 29 22:47:48 PDT 2016


Sunil_Srivastava added a comment.

> What's the motivation to inline cases where a variadic function calls some other variadic function but not with 'musttail'?

Hmm. I don't think I am looking for variadic function calling other variadic function; with or without 'musttail'.
Note that CallAnalyzer::FIsVarArg indicates whether CallAnalyzer::F is variadic, not whether any callee of CallAnalyzer::F is variadic. So if the call being considered for inlining is of A calling B, then the change being proposed only considers whether B is variadic, and if it is, then it also considers whether any call inside B is musttail.

Could you give an example of what you are concerned about here ?

> I understand that such a call can't usefully call 'va_start', but such a call seems unlikely to matter regardless? If this is important to handle for some reason, I think it would be important to understand why. If it isn't important, it would be much simpler to just match the old behavior but inside inline cost where we can ignore uses along dead code paths.

We can address this after I understand exactly what your concern is.

> I am a bit worried about C code with direct, trivial forwarding from one function to another without anything *explicitly* marking the inner call such that it is musttail, and just relying on a tail call occurring....

That one I am also concerned about, though I don't know why that would be a worry in C only. Any suggestions about it? Would setting such cloned calls to NoTail work ?

In the worst case we could just disqualify variadic callees having any calls irrespective of any tail-criteria. At least our use cases of interest are situation where the variadic callee is empty.


https://reviews.llvm.org/D22529





More information about the llvm-commits mailing list