1 ; RUN: opt -passes=inline -S %s -inline-threshold=20 2>&1 | FileCheck %s
3 %struct.nodemask_t = type { [16 x i64] }
4 @numa_nodes_parsed = external constant %struct.nodemask_t, align 8
7 declare i64 @llvm.objectsize.i64.p0(ptr, i1 immarg, i1 immarg, i1 immarg)
9 ; Test that we inline @callee into @caller.
10 define i64 @caller() {
11 ; CHECK-LABEL: @caller(
12 ; CHECK-NEXT: [[TMP1:%.*]] = tail call i64 @llvm.objectsize.i64.p0(ptr @numa_nodes_parsed, i1 false, i1 false, i1 false)
13 ; CHECK-NEXT: [[TMP2:%.*]] = icmp uge i64 [[TMP1]], 128
14 ; CHECK-NEXT: br i1 [[TMP2]], label %[[CALLEE_EXIT:.*]], label %[[HANDLER_TYPE_MISMATCH94_I:.*]]
15 ; CHECK: [[HANDLER_TYPE_MISMATCH94_I]]:
16 ; CHECK-NEXT: call void @foo()
17 ; CHECK-NEXT: call void @foo()
18 ; CHECK-NEXT: call void @foo()
19 ; CHECK-NEXT: call void @foo()
20 ; CHECK-NEXT: call void @foo()
21 ; CHECK-NEXT: call void @foo()
22 ; CHECK-NEXT: br label %[[CALLEE_EXIT]]
23 ; CHECK: [[CALLEE_EXIT]]:
24 ; CHECK-NEXT: ret i64 [[TMP1]]
26 %1 = tail call i64 @callee()
30 ; Testing the InlineCost of the call to @llvm.objectsize.i64.p0.
31 ; Do not change the linkage of @callee; that will give it a severe discount in
32 ; cost (LastCallToStaticBonus).
33 define i64 @callee() {
34 %1 = tail call i64 @llvm.objectsize.i64.p0(ptr @numa_nodes_parsed, i1 false, i1 false, i1 false)
35 %2 = icmp uge i64 %1, 128
36 br i1 %2, label %cont95, label %handler.type_mismatch94
38 handler.type_mismatch94: