File: swift-async-win.ll

package info (click to toggle)
llvm-toolchain-17 1%3A17.0.6-22
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 1,799,624 kB
  • sloc: cpp: 6,428,607; ansic: 1,383,196; asm: 793,408; python: 223,504; objc: 75,364; f90: 60,502; lisp: 33,869; pascal: 15,282; sh: 9,684; perl: 7,453; ml: 4,937; awk: 3,523; makefile: 2,889; javascript: 2,149; xml: 888; fortran: 619; cs: 573
file content (56 lines) | stat: -rw-r--r-- 2,222 bytes parent folder | download | duplicates (2)
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
45
46
47
48
49
50
51
52
53
54
55
56
; RUN: llc -mtriple aarch64-unknown-windows -swift-async-fp=never -filetype asm -o - %s | FileCheck %s

; ModuleID = '_Concurrency.ll'
source_filename = "_Concurrency.ll"
target datalayout = "e-m:w-p:64:64-i32:32-i64:64-i128:128-n32:64-S128"
target triple = "aarch64-unknown-windows-msvc19.32.31302"

%swift.context = type { ptr, ptr }

; Function Attrs: argmemonly nofree nosync nounwind willreturn
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #0

; Function Attrs: nounwind
define hidden swifttailcc void @"$ss23withCheckedContinuation8function_xSS_yScCyxs5NeverOGXEtYalFTQ0_"(ptr nocapture readonly %0) #1 {
entryresume.0:
  %1 = load ptr, ptr %0, align 8
  %2 = tail call ptr @llvm.swift.async.context.addr() #4
  store ptr %1, ptr %2, align 8
  %async.ctx.frameptr1 = getelementptr inbounds i8, ptr %1, i64 16
  %.reload.addr4 = getelementptr inbounds i8, ptr %1, i64 24
  %.reload5 = load ptr, ptr %.reload.addr4, align 8
  %.reload = load ptr, ptr %async.ctx.frameptr1, align 8
  %3 = load ptr, ptr %0, align 8
  store ptr %3, ptr %2, align 8
  tail call swiftcc void @swift_task_dealloc(ptr %.reload5) #4
  tail call void @llvm.lifetime.end.p0(i64 -1, ptr %.reload5)
  tail call swiftcc void @swift_task_dealloc(ptr %.reload) #4
  %4 = getelementptr inbounds i8, ptr %3, i64 8
  %5 = load ptr, ptr %4, align 8
  musttail call swifttailcc void %5(ptr %3) #4
  ret void
}

; NOTE: we do not see the canonical windows frame setup due to the `nounwind`
; attribtue on the function.

; CHECK: sub sp, sp, #48
; CHECK: stp x30, x29, [sp, #24]
; CHECK: add x29, sp, #24
; CHECK: str x19, [sp, #40]
; CHECK: sub x8, x29, #8
; CHECK: ldr x9, [x0]
; CHECK: str x9, [x8]

; Function Attrs: nounwind readnone
declare ptr @llvm.swift.async.context.addr() #2

; Function Attrs: argmemonly nounwind
declare dllimport swiftcc void @swift_task_dealloc(ptr) local_unnamed_addr #3

attributes #0 = { argmemonly nofree nosync nounwind willreturn }
attributes #1 = { nounwind "frame-pointer"="none" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="generic" "target-features"="+neon" }
attributes #2 = { nounwind readnone }
attributes #3 = { argmemonly nounwind }
attributes #4 = { nounwind }