xref: /llvm-project/llvm/test/CodeGen/Mips/GlobalISel/instruction-select/implicit_def.mir (revision 75e43a607c8bfbb33cc56b74bbe6becd2021731a)
1# NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py
2# RUN: llc -O0 -mtriple=mipsel-linux-gnu -run-pass=instruction-select -verify-machineinstrs %s -o - | FileCheck %s -check-prefixes=MIPS32
3--- |
4
5  declare void @f_i32(i32)
6  define void @g_i32() {entry: ret void}
7
8  declare void @f_i64(i64)
9  define void @g_i64() {entry: ret void}
10
11  declare void @f_float(float)
12  define void @g_float() {entry: ret void}
13
14  declare void @f_double(double)
15  define void @g_double() {entry: ret void}
16
17...
18---
19name:            g_i32
20alignment:       2
21legalized:       true
22regBankSelected: true
23tracksRegLiveness: true
24body:             |
25  bb.1.entry:
26    ; MIPS32-LABEL: name: g_i32
27    ; MIPS32: [[DEF:%[0-9]+]]:gpr32 = IMPLICIT_DEF
28    ; MIPS32: ADJCALLSTACKDOWN 16, 0, implicit-def $sp, implicit $sp
29    ; MIPS32: $a0 = COPY [[DEF]]
30    ; MIPS32: JAL @f_i32, csr_o32, implicit-def $ra, implicit-def $sp, implicit $a0
31    ; MIPS32: ADJCALLSTACKUP 16, 0, implicit-def $sp, implicit $sp
32    ; MIPS32: RetRA
33    %0:gprb(s32) = G_IMPLICIT_DEF
34    ADJCALLSTACKDOWN 16, 0, implicit-def $sp, implicit $sp
35    $a0 = COPY %0(s32)
36    JAL @f_i32, csr_o32, implicit-def $ra, implicit-def $sp, implicit $a0
37    ADJCALLSTACKUP 16, 0, implicit-def $sp, implicit $sp
38    RetRA
39
40...
41---
42name:            g_i64
43alignment:       2
44legalized:       true
45regBankSelected: true
46tracksRegLiveness: true
47body:             |
48  bb.1.entry:
49    ; MIPS32-LABEL: name: g_i64
50    ; MIPS32: [[DEF:%[0-9]+]]:gpr32 = IMPLICIT_DEF
51    ; MIPS32: [[DEF1:%[0-9]+]]:gpr32 = IMPLICIT_DEF
52    ; MIPS32: ADJCALLSTACKDOWN 16, 0, implicit-def $sp, implicit $sp
53    ; MIPS32: $a0 = COPY [[DEF]]
54    ; MIPS32: $a1 = COPY [[DEF1]]
55    ; MIPS32: JAL @f_i64, csr_o32, implicit-def $ra, implicit-def $sp, implicit $a0, implicit $a1
56    ; MIPS32: ADJCALLSTACKUP 16, 0, implicit-def $sp, implicit $sp
57    ; MIPS32: RetRA
58    %3:gprb(s32) = G_IMPLICIT_DEF
59    %4:gprb(s32) = G_IMPLICIT_DEF
60    ADJCALLSTACKDOWN 16, 0, implicit-def $sp, implicit $sp
61    $a0 = COPY %3(s32)
62    $a1 = COPY %4(s32)
63    JAL @f_i64, csr_o32, implicit-def $ra, implicit-def $sp, implicit $a0, implicit $a1
64    ADJCALLSTACKUP 16, 0, implicit-def $sp, implicit $sp
65    RetRA
66
67...
68---
69name:            g_float
70alignment:       2
71legalized:       true
72regBankSelected: true
73tracksRegLiveness: true
74body:             |
75  bb.1.entry:
76    ; MIPS32-LABEL: name: g_float
77    ; MIPS32: [[DEF:%[0-9]+]]:fgr32 = IMPLICIT_DEF
78    ; MIPS32: ADJCALLSTACKDOWN 16, 0, implicit-def $sp, implicit $sp
79    ; MIPS32: $f12 = COPY [[DEF]]
80    ; MIPS32: JAL @f_float, csr_o32, implicit-def $ra, implicit-def $sp, implicit $f12
81    ; MIPS32: ADJCALLSTACKUP 16, 0, implicit-def $sp, implicit $sp
82    ; MIPS32: RetRA
83    %0:fprb(s32) = G_IMPLICIT_DEF
84    ADJCALLSTACKDOWN 16, 0, implicit-def $sp, implicit $sp
85    $f12 = COPY %0(s32)
86    JAL @f_float, csr_o32, implicit-def $ra, implicit-def $sp, implicit $f12
87    ADJCALLSTACKUP 16, 0, implicit-def $sp, implicit $sp
88    RetRA
89
90...
91---
92name:            g_double
93alignment:       2
94legalized:       true
95regBankSelected: true
96tracksRegLiveness: true
97body:             |
98  bb.1.entry:
99    ; MIPS32-LABEL: name: g_double
100    ; MIPS32: [[DEF:%[0-9]+]]:afgr64 = IMPLICIT_DEF
101    ; MIPS32: ADJCALLSTACKDOWN 16, 0, implicit-def $sp, implicit $sp
102    ; MIPS32: $d6 = COPY [[DEF]]
103    ; MIPS32: JAL @f_double, csr_o32, implicit-def $ra, implicit-def $sp, implicit $d6
104    ; MIPS32: ADJCALLSTACKUP 16, 0, implicit-def $sp, implicit $sp
105    ; MIPS32: RetRA
106    %0:fprb(s64) = G_IMPLICIT_DEF
107    ADJCALLSTACKDOWN 16, 0, implicit-def $sp, implicit $sp
108    $d6 = COPY %0(s64)
109    JAL @f_double, csr_o32, implicit-def $ra, implicit-def $sp, implicit $d6
110    ADJCALLSTACKUP 16, 0, implicit-def $sp, implicit $sp
111    RetRA
112
113...
114
115