[llvm] [CGP] Consider arguments and ret values in `dupRetToEnableTailCallOpts` (PR #76613)

Yingwei Zheng via llvm-commits llvm-commits at lists.llvm.org
Tue Jan 16 06:08:08 PST 2024


dtcxzyw wrote:

> @dvyukov, hard to assess the impact of the change qualitatively. Looking for calls in tail position w/ ret value used over glibc (`grep -r -P 'return.*\b(strcpy|strncpy|memset|memcpy|memmove).*\(.*\).*;' .`) reveals 52 instances of tail call opportunities, which possibly doesn't seem a huge number (out of total # functions?), but they all seem within highly recurring functions (e.g., malloc, strdup – as already noted in the issue).

I found 342 potential tail call opportunities in my [benchmark](https://github.com/dtcxzyw/llvm-opt-benchmark). But most of them are only associated with `llvm.memcpy/llvm.memset`.



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


More information about the llvm-commits mailing list