1 ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
2 ; RUN: opt -S -passes=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: call void @outlined_ir_func_0(i32 [[B]])
20 ; CHECK-NEXT: ret i32 0
26 callbr void asm "xorl $0, $0; jmp ${1:l}", "r,!i,~{dirflag},~{fpsr},~{flags}"(i32 %0) to label %normal [label %fail1]
37 define i32 @function2(i32 %a, i32 %b) {
38 ; CHECK-LABEL: @function2(
40 ; CHECK-NEXT: [[TMP0:%.*]] = add i32 [[A:%.*]], 4
41 ; CHECK-NEXT: call void @outlined_ir_func_0(i32 [[B:%.*]])
42 ; CHECK-NEXT: callbr void asm "xorl $0, $0
43 ; CHECK-NEXT: to label [[NORMAL:%.*]] [label %fail1]
45 ; CHECK-NEXT: call void @outlined_ir_func_0(i32 [[B]])
46 ; CHECK-NEXT: ret i32 0
48 ; CHECK-NEXT: call void @outlined_ir_func_0(i32 [[B]])
49 ; CHECK-NEXT: ret i32 0
55 callbr void asm "xorl $0, $0; jmp ${1:l}", "r,!i,~{dirflag},~{fpsr},~{flags}"(i32 %0) to label %normal [label %fail1]