1 # NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py
2 # RUN: llc -mtriple=riscv32 -x mir -run-pass=machine-outliner -simplify-mir -verify-machineinstrs < %s \
3 # RUN: | FileCheck -check-prefixes=RV32I-MO %s
4 # RUN: llc -mtriple=riscv64 -x mir -run-pass=machine-outliner -simplify-mir -verify-machineinstrs < %s \
5 # RUN: | FileCheck -check-prefixes=RV64I-MO %s
7 # Position instructions are illegal to outline. The first instruction won't be outlined
8 # because position instructions break the sequence.
11 define void @func1(i32 %a, i32 %b) { ret void }
13 define void @func2(i32 %a, i32 %b) { ret void }
15 define void @func3(i32 %a, i32 %b) { ret void }
19 tracksRegLiveness: true
23 ; RV32I-MO-LABEL: name: func1
24 ; RV32I-MO: liveins: $x10, $x11
25 ; RV32I-MO-NEXT: {{ $}}
26 ; RV32I-MO-NEXT: $x10 = ORI $x10, 1023
27 ; RV32I-MO-NEXT: EH_LABEL <mcsymbol .Ltmp0>
28 ; RV32I-MO-NEXT: $x5 = PseudoCALLReg target-flags(riscv-call) @OUTLINED_FUNCTION_0, implicit-def $x5, implicit-def $x10, implicit-def $x11, implicit-def $x12, implicit $x10, implicit $x11
29 ; RV32I-MO-NEXT: PseudoRET
30 ; RV64I-MO-LABEL: name: func1
31 ; RV64I-MO: liveins: $x10, $x11
32 ; RV64I-MO-NEXT: {{ $}}
33 ; RV64I-MO-NEXT: $x10 = ORI $x10, 1023
34 ; RV64I-MO-NEXT: EH_LABEL <mcsymbol .Ltmp0>
35 ; RV64I-MO-NEXT: $x5 = PseudoCALLReg target-flags(riscv-call) @OUTLINED_FUNCTION_0, implicit-def $x5, implicit-def $x10, implicit-def $x11, implicit-def $x12, implicit $x10, implicit $x11
36 ; RV64I-MO-NEXT: PseudoRET
38 EH_LABEL <mcsymbol .Ltmp0>
47 tracksRegLiveness: true
51 ; RV32I-MO-LABEL: name: func2
52 ; RV32I-MO: liveins: $x10, $x11
53 ; RV32I-MO-NEXT: {{ $}}
54 ; RV32I-MO-NEXT: $x10 = ORI $x10, 1023
55 ; RV32I-MO-NEXT: GC_LABEL <mcsymbol .Ltmp1>
56 ; RV32I-MO-NEXT: $x5 = PseudoCALLReg target-flags(riscv-call) @OUTLINED_FUNCTION_0, implicit-def $x5, implicit-def $x10, implicit-def $x11, implicit-def $x12, implicit $x10, implicit $x11
57 ; RV32I-MO-NEXT: PseudoRET
58 ; RV64I-MO-LABEL: name: func2
59 ; RV64I-MO: liveins: $x10, $x11
60 ; RV64I-MO-NEXT: {{ $}}
61 ; RV64I-MO-NEXT: $x10 = ORI $x10, 1023
62 ; RV64I-MO-NEXT: GC_LABEL <mcsymbol .Ltmp1>
63 ; RV64I-MO-NEXT: $x5 = PseudoCALLReg target-flags(riscv-call) @OUTLINED_FUNCTION_0, implicit-def $x5, implicit-def $x10, implicit-def $x11, implicit-def $x12, implicit $x10, implicit $x11
64 ; RV64I-MO-NEXT: PseudoRET
66 GC_LABEL <mcsymbol .Ltmp1>
75 tracksRegLiveness: true
79 ; RV32I-MO-LABEL: name: func3
80 ; RV32I-MO: liveins: $x10, $x11
81 ; RV32I-MO-NEXT: {{ $}}
82 ; RV32I-MO-NEXT: $x10 = ORI $x10, 1023
83 ; RV32I-MO-NEXT: ANNOTATION_LABEL <mcsymbol .Ltmp2>
84 ; RV32I-MO-NEXT: $x5 = PseudoCALLReg target-flags(riscv-call) @OUTLINED_FUNCTION_0, implicit-def $x5, implicit-def $x10, implicit-def $x11, implicit-def $x12, implicit $x10, implicit $x11
85 ; RV32I-MO-NEXT: PseudoRET
86 ; RV64I-MO-LABEL: name: func3
87 ; RV64I-MO: liveins: $x10, $x11
88 ; RV64I-MO-NEXT: {{ $}}
89 ; RV64I-MO-NEXT: $x10 = ORI $x10, 1023
90 ; RV64I-MO-NEXT: ANNOTATION_LABEL <mcsymbol .Ltmp2>
91 ; RV64I-MO-NEXT: $x5 = PseudoCALLReg target-flags(riscv-call) @OUTLINED_FUNCTION_0, implicit-def $x5, implicit-def $x10, implicit-def $x11, implicit-def $x12, implicit $x10, implicit $x11
92 ; RV64I-MO-NEXT: PseudoRET
94 ANNOTATION_LABEL <mcsymbol .Ltmp2>