[llvm] [TailCallElim] Do not mark a call tail when it is handed the frame (PR #218797)

Antonio Frighetto via llvm-commits llvm-commits at lists.llvm.org
Fri Aug 28 04:05:05 PDT 2026


================
@@ -13730,9 +13725,13 @@ This instruction requires several arguments:
       the return value of the callee is returned to the caller's caller, even
       if a void return type is in use.
 
-   Both markers imply that the callee does not access allocas, va_args, or
-   byval arguments from the caller. As an exception to that, an alloca or byval
-   argument may be passed to the callee as a byval argument, which can be
+   Both markers imply that the callee does not access any value derived from
+   the caller's stack frame, which is torn down before the callee runs. That
+   covers allocas, va_args, and byval arguments, and equally an address of the
+   frame itself, however obtained -- for example the result of
+   `llvm.frameaddress` with a level of zero, `llvm.localaddress`, or
----------------
antoniofrighetto wrote:

```suggestion
   frame itself, including pointers returned by intrinsics such as
   `llvm.frameaddress` with a level of zero, `llvm.localaddress`, or
```

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


More information about the llvm-commits mailing list