1; RUN: opt < %s -instcombine -attributor-cgscc -print-callgraph -disable-output -verify 2>&1 -enable-new-pm=0 | FileCheck %s 2 3; CHECK: Call graph node <<null function>><<{{.*}}>> #uses=0 4; CHECK: CS<None> calls function 'dead_fork_call' 5; CHECK: CS<None> calls function 'd' 6; CHECK: CS<None> calls function '__kmpc_fork_call' 7; CHECK: CS<None> calls function 'live_fork_call' 8; CHECK: CS<None> calls function '.omp_outlined..1' 9; 10; CHECK: Call graph node for function: '.omp_outlined..1'<<{{.*}}>> #uses=3 11; CHECK: CS<{{.*}}> calls function 'd' 12; 13; CHECK: Call graph node for function: '__kmpc_fork_call'<<{{.*}}>> #uses=3 14; CHECK: CS<None> calls external node 15; 16; CHECK: Call graph node for function: 'd'<<{{.*}}>> #uses=2 17; CHECK: CS<None> calls external node 18; 19; CHECK: Call graph node for function: 'dead_fork_call'<<{{.*}}>> #uses=1 20; 21; CHECK: Call graph node for function: 'dead_fork_call2'<<{{.*}}>> #uses=0 22; CHECK: CS<{{.*}}> calls function '__kmpc_fork_call' 23; CHECK: CS<None> calls function '.omp_outlined..1' 24; 25; CHECK: Call graph node for function: 'live_fork_call'<<{{.*}}>> #uses=1 26; CHECK: CS<{{.*}}> calls function '__kmpc_fork_call' 27; CHECK: CS<None> calls function '.omp_outlined..1' 28 29 30%struct.ident_t = type { i32, i32, i32, i32, i8* } 31 32@.str = private unnamed_addr constant [23 x i8] c";unknown;unknown;0;0;;\00", align 1 33@0 = private unnamed_addr global %struct.ident_t { i32 0, i32 2, i32 0, i32 0, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i32 0, i32 0) }, align 8 34 35define dso_local void @dead_fork_call() { 36entry: 37 br i1 true, label %if.then, label %if.else 38 39if.then: ; preds = %entry 40 br label %if.end 41 42if.else: ; preds = %entry 43 call void @dead_fork_call2() 44 call void (%struct.ident_t*, i32, void (i32*, i32*, ...)*, ...) @__kmpc_fork_call(%struct.ident_t* @0, i32 0, void (i32*, i32*, ...)* bitcast (void (i32*, i32*)* @.omp_outlined..0 to void (i32*, i32*, ...)*)) 45 br label %if.end 46 47if.end: ; preds = %if.else, %if.then 48 ret void 49} 50 51define internal void @dead_fork_call2() { 52entry: 53 call void (%struct.ident_t*, i32, void (i32*, i32*, ...)*, ...) @__kmpc_fork_call(%struct.ident_t* @0, i32 0, void (i32*, i32*, ...)* bitcast (void (i32*, i32*)* @.omp_outlined..1 to void (i32*, i32*, ...)*)) 54 ret void 55} 56 57define internal void @.omp_outlined..0(i32* noalias %.global_tid., i32* noalias %.bound_tid.) { 58entry: 59 %.global_tid..addr = alloca i32*, align 8 60 %.bound_tid..addr = alloca i32*, align 8 61 store i32* %.global_tid., i32** %.global_tid..addr, align 8 62 store i32* %.bound_tid., i32** %.bound_tid..addr, align 8 63 ret void 64} 65 66declare !callback !2 void @__kmpc_fork_call(%struct.ident_t*, i32, void (i32*, i32*, ...)*, ...) 67 68define dso_local void @live_fork_call() { 69entry: 70 call void (%struct.ident_t*, i32, void (i32*, i32*, ...)*, ...) @__kmpc_fork_call(%struct.ident_t* @0, i32 0, void (i32*, i32*, ...)* bitcast (void (i32*, i32*)* @.omp_outlined..1 to void (i32*, i32*, ...)*)) 71 ret void 72} 73 74define internal void @.omp_outlined..1(i32* noalias %.global_tid., i32* noalias %.bound_tid.) { 75entry: 76 %.global_tid..addr = alloca i32*, align 8 77 %.bound_tid..addr = alloca i32*, align 8 78 store i32* %.global_tid., i32** %.global_tid..addr, align 8 79 store i32* %.bound_tid., i32** %.bound_tid..addr, align 8 80 call void (...) @d() 81 ret void 82} 83 84declare dso_local void @d(...) 85 86!0 = !{i32 1, !"wchar_size", i32 4} 87!1 = !{!"clang version 11.0.0"} 88!2 = !{!3} 89!3 = !{i64 2, i64 -1, i64 -1, i1 true} 90