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 ;; TargetOpcode::FENTRY_CALL at the start of the function expands to a __fentry__
8 ;; call which must be present. Don't outline it.
9 define void @fentry0(i1 %a) nounwind "fentry-call"="true" {
10 ; CHECK-LABEL: fentry0:
11 ; CHECK-NEXT: # %bb.0:
12 ; CHECK-NEXT: # FEntry call
14 ; CHECK-NEXT: call t0, OUTLINED_FUNCTION_1
16 br i1 %a, label %if.then, label %if.end
18 call void @foo(i32 1, i32 2, i32 3, i32 4)
21 call void @foo(i32 5, i32 6, i32 7, i32 8)
25 define void @fentry1(i1 %a) nounwind "fentry-call"="true" {
26 ; CHECK-LABEL: fentry1:
27 ; CHECK-NEXT: # %bb.0:
28 ; CHECK-NEXT: # FEntry call
30 ; CHECK-NEXT: call t0, OUTLINED_FUNCTION_1
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 ;; TargetOpcode::PATCHABLE_FUNCTION_ENTER at the start of the function expands to
42 ;; NOPs which must be present. Don't outline them.
43 define void @patchable0(i1 %a) nounwind "patchable-function-entry"="2" {
44 ; CHECK-LABEL: patchable0:
45 ; CHECK-NEXT: .Lfunc_begin0:
46 ; CHECK-NEXT: # %bb.0:
50 ; CHECK-NEXT: call t0, OUTLINED_FUNCTION_1
52 br i1 %a, label %if.then, label %if.end
54 call void @foo(i32 1, i32 2, i32 3, i32 4)
57 call void @foo(i32 5, i32 6, i32 7, i32 8)
61 define void @patchable1(i1 %a) nounwind "patchable-function-entry"="2" {
62 ; CHECK-LABEL: patchable1:
63 ; CHECK-NEXT: .Lfunc_begin1:
64 ; CHECK-NEXT: # %bb.0:
68 ; CHECK-NEXT: call t0, OUTLINED_FUNCTION_1
70 br i1 %a, label %if.then, label %if.end
72 call void @foo(i32 1, i32 2, i32 3, i32 4)
75 call void @foo(i32 5, i32 6, i32 7, i32 8)