File: swifttailcc-store-ret-address-aliasing-stack-slot.ll

package info (click to toggle)
llvm-toolchain-21 1%3A21.1.6-3
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 2,245,028 kB
  • sloc: cpp: 7,619,726; ansic: 1,434,018; asm: 1,058,748; python: 252,740; f90: 94,671; objc: 70,685; lisp: 42,813; pascal: 18,401; sh: 8,601; ml: 5,111; perl: 4,720; makefile: 3,675; awk: 3,523; javascript: 2,409; xml: 892; fortran: 770
file content (44 lines) | stat: -rw-r--r-- 1,529 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
; RUN: llc %s -o - | FileCheck %s

target triple = "x86_64-apple-macosx"

declare swifttailcc void @tc_fn(ptr swiftasync, i64, ptr, i8, ptr swiftself)

declare void @foo()

; FIXME: Currently the return address is written to the stack before loading the
; argument from an aliasing stack slot.
define swifttailcc void @test(ptr %0, ptr swiftasync %1, i64 %2, i64 %3, ptr %4, ptr %5, i64 %6, ptr %7, i8 %8) {
; CHECK-LABEL: test:
; CHECK:       ## %bb.0: ## %entry
; CHECK-NEXT:    pushq %r15
; CHECK-NEXT:    .cfi_def_cfa_offset 16
; CHECK-NEXT:    pushq %rbx
; CHECK-NEXT:    .cfi_def_cfa_offset 24
; CHECK-NEXT:    pushq %rax
; CHECK-NEXT:    .cfi_def_cfa_offset 32
; CHECK-NEXT:    .cfi_offset %rbx, -24
; CHECK-NEXT:    .cfi_offset %r15, -16
; CHECK-NEXT:    movq %r9, %r13
; CHECK-NEXT:    movq %r8, %rbx
; CHECK-NEXT:    movq {{[0-9]+}}(%rsp), %r15
; CHECK-NEXT:    callq _foo
; CHECK-NEXT:    movq %r14, (%rax)
; CHECK-NEXT:    movl [[OFF:[0-9]+]](%rsp), %edx
; CHECK-NEXT:    movq {{[0-9]+}}(%rsp), %rcx
; CHECK-NEXT:    movq %rcx, [[OFF]](%rsp)
; CHECK-NEXT:    movq %rax, %r14
; CHECK-NEXT:    movq %r13, %rdi
; CHECK-NEXT:    movq %r15, %rsi
; CHECK-NEXT:    movq %rbx, %r13
; CHECK-NEXT:    addq $8, %rsp
; CHECK-NEXT:    popq %rbx
; CHECK-NEXT:    popq %r15
; CHECK-NEXT:    addq $16, %rsp
; CHECK-NEXT:    jmp _tc_fn ## TAILCALL
entry:
  %res = tail call ptr @foo()
  store ptr %1, ptr %res, align 8
  musttail call swifttailcc void @tc_fn(ptr swiftasync %res, i64 %6, ptr %7, i8 %8, ptr swiftself %5)
  ret void
}