[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
Tue Sep 1 05:17:23 PDT 2026


mattst88 wrote:

Rebased onto main and respun with the review feedback:

- LangRef states the rule rather than enumerating a closed list, using
  @antoniofrighetto's suggested wording.
- `namesCurrentFrame` -> `returnsCurrentFrameAddress`.
- The `stackrestore` check stays local per @efriedma-quic, with the reasoning
  recorded in the comment.

On the judgement call from the description: I read "stacksave [...] is abused
by clang to get the current value of the stack pointer" as an argument for
keeping it in the list, so I've gone with option 1 (as posted) and dropped the
open question. @efriedma-quic, please say if you meant otherwise -- option 2 is
a two-line change.

check-llvm-transforms: 10020 passed, 0 unexpected failures. I also diffed the
patched and unpatched `opt` over the new tests to confirm they discriminate:
all nine frame-naming cases lose the `tail`, `llvm.frameaddress` with a
non-zero level and `llvm.returnaddress` keep it, and stackrestore.ll gains a
`tail` that trunk does not set.

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


More information about the llvm-commits mailing list