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 callbr instruction since as we do not
5 ; outline any control flow change instructions.
8 define i32 @function1(i32 %a, i32 %b) {
9 ; CHECK-LABEL: @function1(
11 ; CHECK-NEXT: [[TMP0:%.*]] = add i32 [[A:%.*]], 4
12 ; CHECK-NEXT: call void @outlined_ir_func_0(i32 [[B:%.*]])
13 ; CHECK-NEXT: callbr void asm "xorl $0, $0
14 ; CHECK-NEXT: to label [[NORMAL:%.*]] [label %fail1]
16 ; CHECK-NEXT: call void @outlined_ir_func_0(i32 [[B]])
17 ; CHECK-NEXT: ret i32 0
19 ; CHECK-NEXT: [[TMP1:%.*]] = add i32 [[B]], 1
20 ; CHECK-NEXT: [[TMP2:%.*]] = add i32 [[B]], 1
21 ; CHECK-NEXT: ret i32 0
27 callbr void asm "xorl $0, $0; jmp ${1:l}", "r,X,~{dirflag},~{fpsr},~{flags}"(i32 %0, i8* blockaddress(@function1, %fail1)) to label %normal [label %fail1]
38 define i32 @function2(i32 %a, i32 %b) {
39 ; CHECK-LABEL: @function2(
41 ; CHECK-NEXT: [[TMP0:%.*]] = add i32 [[A:%.*]], 4
42 ; CHECK-NEXT: call void @outlined_ir_func_0(i32 [[B:%.*]])
43 ; CHECK-NEXT: callbr void asm "xorl $0, $0
44 ; CHECK-NEXT: to label [[NORMAL:%.*]] [label %fail1]
46 ; CHECK-NEXT: call void @outlined_ir_func_0(i32 [[B]])
47 ; CHECK-NEXT: ret i32 0
49 ; CHECK-NEXT: [[TMP1:%.*]] = add i32 [[B]], 1
50 ; CHECK-NEXT: [[TMP2:%.*]] = add i32 [[B]], 1
51 ; CHECK-NEXT: ret i32 0
57 callbr void asm "xorl $0, $0; jmp ${1:l}", "r,X,~{dirflag},~{fpsr},~{flags}"(i32 %0, i8* blockaddress(@function2, %fail1)) to label %normal [label %fail1]