File: coro-async-notail-wasm.ll

package info (click to toggle)
llvm-toolchain-20 1%3A20.1.6-1~exp1
  • links: PTS, VCS
  • area: main
  • in suites: experimental
  • size: 2,111,304 kB
  • sloc: cpp: 7,438,677; ansic: 1,393,822; asm: 1,012,926; python: 241,650; f90: 86,635; objc: 75,479; lisp: 42,144; pascal: 17,286; sh: 10,027; ml: 5,082; perl: 4,730; awk: 3,523; makefile: 3,349; javascript: 2,251; xml: 892; fortran: 672
file content (31 lines) | stat: -rw-r--r-- 1,212 bytes parent folder | download | duplicates (10)
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
; RUN: opt < %s -O0 -S -mtriple=wasm32-unknown-unknown | FileCheck %s
; REQUIRES: webassembly-registered-target

%swift.async_func_pointer = type <{ i32, i32 }>
@checkTu = global %swift.async_func_pointer <{ i32 ptrtoint (ptr @check to i32), i32 8 }>

define swiftcc void @check(ptr %0) {
entry:
  %1 = call token @llvm.coro.id.async(i32 0, i32 0, i32 0, ptr @checkTu)
  %2 = call ptr @llvm.coro.begin(token %1, ptr null)
  %3 = call ptr @llvm.coro.async.resume()
  store ptr %3, ptr %0, align 4
  %4 = call { ptr, i32 } (i32, ptr, ptr, ...) @llvm.coro.suspend.async.sl_p0i32s(i32 0, ptr %3, ptr @__swift_async_resume_project_context, ptr @check.0, ptr null, ptr null)
  ret void
}

declare swiftcc void @check.0()
declare { ptr, i32 } @llvm.coro.suspend.async.sl_p0i32s(i32, ptr, ptr, ...)
declare token @llvm.coro.id.async(i32, i32, i32, ptr)
declare ptr @llvm.coro.begin(token, ptr writeonly)
declare ptr @llvm.coro.async.resume()

define ptr @__swift_async_resume_project_context(ptr %0) {
entry:
  ret ptr null
}

; Verify that the resume call is not marked as musttail.
; CHECK-LABEL: define swiftcc void @check(
; CHECK-NOT: musttail call swiftcc void @check.0()
; CHECK:     call swiftcc void @check.0()