1 ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
2 ; RUN: opt -S -passes=verify,iroutliner -ir-outlining-no-cost --no-ir-sim-indirect-calls < %s | FileCheck %s
4 ; This test checks that we do not outline indirect calls when it is specified
7 declare void @f1(ptr, ptr);
8 declare void @f2(ptr, ptr);
10 define void @function1(ptr %func) {
11 ; CHECK-LABEL: @function1(
13 ; CHECK-NEXT: [[A:%.*]] = alloca i32, align 4
14 ; CHECK-NEXT: [[B:%.*]] = alloca i32, align 4
15 ; CHECK-NEXT: [[C:%.*]] = alloca i32, align 4
16 ; CHECK-NEXT: call void @outlined_ir_func_1(ptr [[A]], ptr [[B]], ptr [[C]])
17 ; CHECK-NEXT: call void [[FUNC:%.*]]()
18 ; CHECK-NEXT: call void @outlined_ir_func_0(ptr [[A]], ptr [[B]], ptr [[C]])
19 ; CHECK-NEXT: ret void
22 %a = alloca i32, align 4
23 %b = alloca i32, align 4
24 %c = alloca i32, align 4
25 store i32 2, ptr %a, align 4
26 store i32 3, ptr %b, align 4
27 store i32 4, ptr %c, align 4
29 %al = load i32, ptr %a
30 %bl = load i32, ptr %b
31 %cl = load i32, ptr %c
35 define void @function2(ptr %func) {
36 ; CHECK-LABEL: @function2(
38 ; CHECK-NEXT: [[A:%.*]] = alloca i32, align 4
39 ; CHECK-NEXT: [[B:%.*]] = alloca i32, align 4
40 ; CHECK-NEXT: [[C:%.*]] = alloca i32, align 4
41 ; CHECK-NEXT: call void @outlined_ir_func_1(ptr [[A]], ptr [[B]], ptr [[C]])
42 ; CHECK-NEXT: call void [[FUNC:%.*]]()
43 ; CHECK-NEXT: call void @outlined_ir_func_0(ptr [[A]], ptr [[B]], ptr [[C]])
44 ; CHECK-NEXT: ret void
47 %a = alloca i32, align 4
48 %b = alloca i32, align 4
49 %c = alloca i32, align 4
50 store i32 2, ptr %a, align 4
51 store i32 3, ptr %b, align 4
52 store i32 4, ptr %c, align 4
54 %al = load i32, ptr %a
55 %bl = load i32, ptr %b
56 %cl = load i32, ptr %c