1 ; RUN: opt < %s -passes='function(instcombine),cgscc(attributor-cgscc),print-callgraph' -disable-output 2>&1 | FileCheck %s
3 ; CHECK: Call graph node <<null function>><<{{.*}}>> #uses=0
4 ; CHECK-NEXT: CS<None> calls function 'dead_fork_call'
5 ; CHECK-NEXT: CS<None> calls function '__kmpc_fork_call'
6 ; CHECK-NEXT: CS<None> calls function 'live_fork_call'
7 ; CHECK-NEXT: CS<None> calls function 'd'
9 ; CHECK: Call graph node for function: '.omp_outlined..0'<<{{.*}}>> #uses=0
11 ; CHECK: Call graph node for function: '.omp_outlined..1'<<{{.*}}>> #uses=2
12 ; CHECK: CS<{{.*}}> calls function 'd'
14 ; CHECK: Call graph node for function: '__kmpc_fork_call'<<{{.*}}>> #uses=3
15 ; CHECK: CS<None> calls external node
17 ; CHECK: Call graph node for function: 'd'<<{{.*}}>> #uses=2
18 ; CHECK: CS<None> calls external node
20 ; CHECK: Call graph node for function: 'dead_fork_call'<<{{.*}}>> #uses=1
22 ; CHECK: Call graph node for function: 'dead_fork_call2'<<{{.*}}>> #uses=0
23 ; CHECK: CS<{{.*}}> calls function '__kmpc_fork_call'
24 ; CHECK: CS<None> calls function '.omp_outlined..1'
26 ; CHECK: Call graph node for function: 'live_fork_call'<<{{.*}}>> #uses=1
27 ; CHECK: CS<{{.*}}> calls function '__kmpc_fork_call'
28 ; CHECK: CS<None> calls function '.omp_outlined..1'
31 %struct.ident_t = type { i32, i32, i32, i32, ptr }
33 @.str = private unnamed_addr constant [23 x i8] c";unknown;unknown;0;0;;\00", align 1
34 @0 = private unnamed_addr global %struct.ident_t { i32 0, i32 2, i32 0, i32 0, ptr @.str }, align 8
36 define dso_local void @dead_fork_call() {
38 br i1 true, label %if.then, label %if.else
40 if.then: ; preds = %entry
43 if.else: ; preds = %entry
44 call void @dead_fork_call2()
45 call void (ptr, i32, ptr, ...) @__kmpc_fork_call(ptr @0, i32 0, ptr @.omp_outlined..0)
48 if.end: ; preds = %if.else, %if.then
52 define internal void @dead_fork_call2() {
54 call void (ptr, i32, ptr, ...) @__kmpc_fork_call(ptr @0, i32 0, ptr @.omp_outlined..1)
58 define internal void @.omp_outlined..0(ptr noalias %.global_tid., ptr noalias %.bound_tid.) {
60 %.global_tid..addr = alloca ptr, align 8
61 %.bound_tid..addr = alloca ptr, align 8
62 store ptr %.global_tid., ptr %.global_tid..addr, align 8
63 store ptr %.bound_tid., ptr %.bound_tid..addr, align 8
67 declare !callback !2 void @__kmpc_fork_call(ptr, i32, ptr, ...)
69 define dso_local void @live_fork_call() {
71 call void (ptr, i32, ptr, ...) @__kmpc_fork_call(ptr @0, i32 0, ptr @.omp_outlined..1)
75 define internal void @.omp_outlined..1(ptr noalias %.global_tid., ptr noalias %.bound_tid.) {
77 %.global_tid..addr = alloca ptr, align 8
78 %.bound_tid..addr = alloca ptr, align 8
79 store ptr %.global_tid., ptr %.global_tid..addr, align 8
80 store ptr %.bound_tid., ptr %.bound_tid..addr, align 8
85 declare dso_local void @d(...)
87 !0 = !{i32 1, !"wchar_size", i32 4}
88 !1 = !{!"clang version 11.0.0"}
90 !3 = !{i64 2, i64 -1, i64 -1, i1 true}