[llvm] [TailCallElim] Do not mark a call tail when it is handed the frame (PR #218797)
Matt Turner via llvm-commits
llvm-commits at lists.llvm.org
Wed Aug 26 19:01:49 PDT 2026
================
@@ -13725,10 +13725,16 @@ 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
- dereferenced inside the callee. For example:
+ Both markers imply that the callee does not access allocas, va_args, byval
+ arguments, or any other part of the caller's stack frame. The frame is torn
+ down before the callee runs, so this covers addresses of the frame itself:
+ the callee may not access the result of `llvm.frameaddress` with a level of
+ zero, `llvm.addressofreturnaddress`, `llvm.eh.dwarf.cfa`,
+ `llvm.localaddress`, `llvm.sponentry`, `llvm.stackaddress`,
+ `llvm.stacksave`, or `llvm.swift.async.context.addr` evaluated in the
----------------
mattst88 wrote:
Good point -- the closed list goes stale as soon as someone adds a ninth intrinsic, and it duplicates the switch in the pass. Reworded to state the rule and keep three intrinsics as examples. Kept `byval` named since the exception below refers to it.
https://github.com/llvm/llvm-project/pull/218797
More information about the llvm-commits
mailing list