[llvm] [X86] Allow "sibcall" optimization on call sites marked `musttail` (PR #150157)

Brandt Bucher via llvm-commits llvm-commits at lists.llvm.org
Fri Aug 1 11:54:33 PDT 2025


brandtbucher wrote:

@rnk, maybe I'm missing something, but this PR emits the same code as the example you linked. Would you like me to add a test for it?

```ll
define void @caller_flip7(ptr %r0, ptr %r1, ptr %r2, ptr %r3, ptr %r4, ptr %r5, ptr %x) {
; X64-LABEL: caller_flip7:
; X64:       # %bb.0:
; X64-NEXT:    movq {{[0-9]+}}(%rsp), %rax
; X64-NEXT:    movq %r9, {{[0-9]+}}(%rsp)
; X64-NEXT:    movq %rax, %r9
; X64-NEXT:    jmp callee7 at PLT # TAILCALL
  musttail call void @callee7(ptr %r0, ptr %r1, ptr %r2, ptr %r3, ptr %r4, ptr %x, ptr %r5)
  ret void
}
```

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


More information about the llvm-commits mailing list