1 ; RUN: llc < %s -verify-machineinstrs -enable-machine-outliner | FileCheck %s
3 target triple = "riscv64-unknown-linux-gnu"
5 declare void @foo(i32, i32, i32, i32) minsize
7 define void @fentry0(i1 %a) nounwind {
8 ; CHECK-LABEL: fentry0:
10 ; CHECK-NEXT: call t0, OUTLINED_FUNCTION_[[BB1:[0-9]+]]
11 ; CHECK-NEXT: call foo
12 ; CHECK-LABEL: .LBB0_2:
13 ; CHECK-NEXT: tail OUTLINED_FUNCTION_[[BB2:[0-9]+]]
15 br i1 %a, label %if.then, label %if.end
17 call void @foo(i32 1, i32 2, i32 3, i32 4)
20 call void @foo(i32 5, i32 6, i32 7, i32 8)
24 define void @fentry1(i1 %a) nounwind {
25 ; CHECK-LABEL: fentry1:
27 ; CHECK-NEXT: call t0, OUTLINED_FUNCTION_[[BB1:[0-9]+]]
28 ; CHECK-NEXT: call foo
29 ; CHECK-LABEL: .LBB1_2:
30 ; CHECK-NEXT: tail OUTLINED_FUNCTION_[[BB2:[0-9]+]]
32 br i1 %a, label %if.then, label %if.end
34 call void @foo(i32 1, i32 2, i32 3, i32 4)
37 call void @foo(i32 5, i32 6, i32 7, i32 8)
41 define void @fentry2(i1 %a) nounwind {
42 ; CHECK-LABEL: fentry2:
44 ; CHECK-NEXT: call t0, OUTLINED_FUNCTION_[[BB1:[0-9]+]]
45 ; CHECK-NEXT: call foo
46 ; CHECK-LABEL: .LBB2_2:
47 ; CHECK-NEXT: tail OUTLINED_FUNCTION_[[BB2:[0-9]+]]
49 br i1 %a, label %if.then, label %if.end
51 call void @foo(i32 1, i32 2, i32 3, i32 4)
54 call void @foo(i32 5, i32 6, i32 7, i32 8)
58 ; CHECK: OUTLINED_FUNCTION_[[BB2]]:
60 ; CHECK-NEXT: li a1, 6
61 ; CHECK-NEXT: li a2, 7
62 ; CHECK-NEXT: li a3, 8
63 ; CHECK-NEXT: call foo
65 ; CHECK: OUTLINED_FUNCTION_[[BB1]]:
67 ; CHECK-NEXT: li a1, 2
68 ; CHECK-NEXT: li a2, 3
69 ; CHECK-NEXT: li a3, 4