1 ; RUN: opt -passes=partial-inliner -S < %s | FileCheck %s
3 ; Checks that valid costs are computed for intrinsic calls.
4 ; https://bugs.llvm.org/show_bug.cgi?id=45932
7 @emit_notes = external global i8, align 2
9 ; CHECK: var_reg_delete
11 ; CHECK-NEXT: tail call void @delete_variable_part()
12 ; CHECK-NEXT: ret void
14 define void @var_reg_delete() {
16 tail call void @delete_variable_part()
20 ; CHECK: delete_variable_part
22 ; CHECK-NEXT: %tmp1.i = tail call i32 @find_variable_location_part()
23 ; CHECK-NEXT: %tmp3.i = icmp sgt i32 %tmp1.i, -1
24 ; CHECK-NEXT: br i1 %tmp3.i, label %bb4.i, label %delete_slot_part.exit
27 ; CHECK-NEXT: %tmp.i.i = load i8, ptr @emit_notes
28 ; CHECK-NEXT: %tmp1.i.i = icmp ne i8 %tmp.i.i, 0
29 ; CHECK-NEXT: tail call void @llvm.assume(i1 %tmp1.i.i)
30 ; CHECK-NEXT: unreachable
32 ; CHECK: delete_slot_part.exit
33 ; CHECK-NEXT: ret void
35 define void @delete_variable_part() {
37 %tmp1.i = tail call i32 @find_variable_location_part()
38 %tmp3.i = icmp sgt i32 %tmp1.i, -1
39 br i1 %tmp3.i, label %bb4.i, label %delete_slot_part.exit
42 %tmp.i.i = load i8, ptr @emit_notes, align 2
43 %tmp1.i.i = icmp ne i8 %tmp.i.i, 0
44 tail call void @llvm.assume(i1 %tmp1.i.i)
47 delete_slot_part.exit:
51 ; CHECK: declare i32 @find_variable_location_part
52 declare i32 @find_variable_location_part()
54 ; CHECK: declare void @llvm.assume(i1 noundef)
55 declare void @llvm.assume(i1 noundef)