[llvm] [MemProf] Handle missing tail call frames (PR #75823)
Teresa Johnson via llvm-commits
llvm-commits at lists.llvm.org
Wed Dec 20 14:12:39 PST 2023
teresajohnson wrote:
> Hi, @teresajohnson. I have one question. For example, there are two call chain:
>
> ```
> A->B(tail call)->C(tail call)->D(tail call)->G
> A->B(tail call)->E(tail call)->F(tail call)->G
> ```
>
> It seems in `calleesMatch` only the chain(A->B->C->D->G) will be recorded while the chain(A->B->E->F->G) won't. Is this what you expected?
Yes I should have mentioned that this algorithm is greedy and therefore won't currently find all possible paths, so we would miss the second case here. I was thinking it was a simple extension to handle all paths, but there is a slight complication. I hacked up the change to see how difficult it would be and it works for a test case like this, but I need to do a bit broader testing of it.
Not sure yet whether it is worth handling this in this patch or as a follow-on. Let me do a bit more investigation on my prototyped change and circle back.
> Another question is, is it possible that the tail call occurs at thin backend for instrument binary? If it's possible, can this patch handle it? Or the instrument binary shouldn't be compiled with lto/thinlto.
If we're missing a frame for something not marked as a tail call during the LTO link, then this approach would not be able to recover it. We only search through calls marked as tail calls at that phase to keep the overhead smaller.
https://github.com/llvm/llvm-project/pull/75823
More information about the llvm-commits
mailing list