[llvm] [ctxprof] Instrumentation: handle direct call targets to aliases (PR #142657)

Teresa Johnson via llvm-commits llvm-commits at lists.llvm.org
Wed Jun 4 09:25:46 PDT 2025


https://github.com/teresajohnson approved this pull request.

lgtm. This is an annoying subtlety to getCalledFunction that I had forgotten about (looks like it bit me in the past: https://reviews.llvm.org/D25384). IMO we should document this on getCalledFunction() in the header. Right now it just says:

```
  /// Returns the function called, or null if this is an indirect function
  /// invocation or the function signature does not match the call signature.
```

Can you expand this comment to note it also returns null if the callee value is an alias. I wonder how many other places in the compiler are conservative in some fashion for aliases, and how much of an issue it would be to change this to look through them (not for this PR, but maybe it should have a FIXME to investigate making that change?).

https://github.com/llvm/llvm-project/pull/142657


More information about the llvm-commits mailing list