1 ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
2 ; RUN: opt -S -verify -iroutliner -ir-outlining-no-cost < %s | FileCheck %s
4 ; This test checks that we do not outline indirect calls. We cannot guarantee
5 ; that we have the same name in these cases, so two indirect calls cannot
6 ; be considered similar.
8 declare void @f1(i32*, i32*);
9 declare void @f2(i32*, i32*);
11 define void @function1(void()* %func) {
12 ; CHECK-LABEL: @function1(
14 ; CHECK-NEXT: [[A:%.*]] = alloca i32, align 4
15 ; CHECK-NEXT: [[B:%.*]] = alloca i32, align 4
16 ; CHECK-NEXT: [[C:%.*]] = alloca i32, align 4
17 ; CHECK-NEXT: call void @outlined_ir_func_1(i32* [[A]], i32* [[B]], i32* [[C]])
18 ; CHECK-NEXT: call void [[FUNC:%.*]]()
19 ; CHECK-NEXT: call void @outlined_ir_func_0(i32* [[A]], i32* [[B]], i32* [[C]])
20 ; CHECK-NEXT: ret void
23 %a = alloca i32, align 4
24 %b = alloca i32, align 4
25 %c = alloca i32, align 4
26 store i32 2, i32* %a, align 4
27 store i32 3, i32* %b, align 4
28 store i32 4, i32* %c, align 4
30 %al = load i32, i32* %a
31 %bl = load i32, i32* %b
32 %cl = load i32, i32* %c
36 define void @function2(void()* %func) {
37 ; CHECK-LABEL: @function2(
39 ; CHECK-NEXT: [[A:%.*]] = alloca i32, align 4
40 ; CHECK-NEXT: [[B:%.*]] = alloca i32, align 4
41 ; CHECK-NEXT: [[C:%.*]] = alloca i32, align 4
42 ; CHECK-NEXT: call void @outlined_ir_func_1(i32* [[A]], i32* [[B]], i32* [[C]])
43 ; CHECK-NEXT: call void [[FUNC:%.*]]()
44 ; CHECK-NEXT: call void @outlined_ir_func_0(i32* [[A]], i32* [[B]], i32* [[C]])
45 ; CHECK-NEXT: ret void
48 %a = alloca i32, align 4
49 %b = alloca i32, align 4
50 %c = alloca i32, align 4
51 store i32 2, i32* %a, align 4
52 store i32 3, i32* %b, align 4
53 store i32 4, i32* %c, align 4
55 %al = load i32, i32* %a
56 %bl = load i32, i32* %b
57 %cl = load i32, i32* %c