1 ; Based on llvm/test/Transforms/Coroutines/coro-split-02.ll
2 ; Corosplit will keep f1 and add 3 more functions.
3 ; RUN: opt -passes='default<O1>,print<inline-advisor>' -training-log=/dev/null \
4 ; RUN: -S -enable-ml-inliner=development -enable-scc-inline-advisor-printing < %s 2>&1 | FileCheck %s
5 ; REQUIRES: have_tflite
7 ; CHECK: [MLInlineAdvisor] Nodes: 1 Edges: 0
8 ; CHECK: [MLInlineAdvisor] Nodes: 4 Edges: 0
10 %"struct.std::coroutine_handle" = type { ptr }
11 %"struct.std::coroutine_handle.0" = type { %"struct.std::coroutine_handle" }
12 %"struct.lean_future<int>::Awaiter" = type { i32, %"struct.std::coroutine_handle.0" }
14 declare ptr @malloc(i64)
15 declare void @print(i32)
17 define void @a() presplitcoroutine {
19 %ref.tmp7 = alloca %"struct.lean_future<int>::Awaiter", align 8
21 %id = call token @llvm.coro.id(i32 0, ptr null, ptr null, ptr null)
22 %alloc = call ptr @malloc(i64 16) #3
23 %vFrame = call noalias nonnull ptr @llvm.coro.begin(token %id, ptr %alloc)
25 %save = call token @llvm.coro.save(ptr null)
26 %suspend = call i8 @llvm.coro.suspend(token %save, i1 false)
27 switch i8 %suspend, label %exit [
28 i8 0, label %await.ready
32 %StrayCoroSave = call token @llvm.coro.save(ptr null)
33 %val = load i32, ptr %ref.tmp7
34 call void @llvm.lifetime.start.p0(i64 4, ptr %testval)
35 %test = load i32, ptr %testval
36 call void @print(i32 %test)
37 call void @llvm.lifetime.end.p0(i64 4, ptr %testval)
38 call void @print(i32 %val)
41 call i1 @llvm.coro.end(ptr null, i1 false)
45 declare token @llvm.coro.id(i32, ptr readnone, ptr nocapture readonly, ptr)
46 declare i1 @llvm.coro.alloc(token) #3
47 declare noalias nonnull ptr @"\01??2@YAPEAX_K@Z"(i64) local_unnamed_addr
48 declare i64 @llvm.coro.size.i64() #5
49 declare ptr @llvm.coro.begin(token, ptr writeonly) #3
50 declare void @"\01?puts@@YAXZZ"(...)
51 declare token @llvm.coro.save(ptr) #3
52 declare ptr @llvm.coro.frame() #5
53 declare i8 @llvm.coro.suspend(token, i1) #3
54 declare void @"\01??3@YAXPEAX@Z"(ptr) local_unnamed_addr #10
55 declare ptr @llvm.coro.free(token, ptr nocapture readonly) #2
56 declare i1 @llvm.coro.end(ptr, i1) #3
57 declare void @llvm.lifetime.start.p0(i64, ptr nocapture) #4
58 declare void @llvm.lifetime.end.p0(i64, ptr nocapture) #4