xref: /llvm-project/llvm/test/CodeGen/Mips/GlobalISel/legalizer/truncStore_and_aExtLoad.mir (revision 3f3ff0e4309ac317ebea3e44188751451b88862f)
1# NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py
2# RUN: llc -O0 -mtriple=mipsel-linux-gnu -run-pass=legalizer -verify-machineinstrs %s -o - | FileCheck %s -check-prefixes=MIPS32
3---
4name:            load1_s8_to_load1_s32
5alignment:       4
6tracksRegLiveness: true
7body:             |
8  bb.0:
9    liveins: $a0
10
11    ; MIPS32-LABEL: name: load1_s8_to_load1_s32
12    ; MIPS32: liveins: $a0
13    ; MIPS32-NEXT: {{  $}}
14    ; MIPS32-NEXT: [[COPY:%[0-9]+]]:_(p0) = COPY $a0
15    ; MIPS32-NEXT: [[LOAD:%[0-9]+]]:_(s32) = G_LOAD [[COPY]](p0) :: (load (s8))
16    ; MIPS32-NEXT: $v0 = COPY [[LOAD]](s32)
17    ; MIPS32-NEXT: RetRA implicit $v0
18    %0:_(p0) = COPY $a0
19    %2:_(s32) = G_LOAD %0(p0) :: (load (s8))
20    $v0 = COPY %2(s32)
21    RetRA implicit $v0
22
23...
24---
25name:            load2_s16_to_load2_s32
26alignment:       4
27tracksRegLiveness: true
28body:             |
29  bb.0:
30    liveins: $a0
31
32    ; MIPS32-LABEL: name: load2_s16_to_load2_s32
33    ; MIPS32: liveins: $a0
34    ; MIPS32-NEXT: {{  $}}
35    ; MIPS32-NEXT: [[COPY:%[0-9]+]]:_(p0) = COPY $a0
36    ; MIPS32-NEXT: [[LOAD:%[0-9]+]]:_(s32) = G_LOAD [[COPY]](p0) :: (load (s16))
37    ; MIPS32-NEXT: $v0 = COPY [[LOAD]](s32)
38    ; MIPS32-NEXT: RetRA implicit $v0
39    %0:_(p0) = COPY $a0
40    %2:_(s32) = G_LOAD %0(p0) :: (load (s16))
41    $v0 = COPY %2(s32)
42    RetRA implicit $v0
43
44...
45---
46name:            load_store_i1
47alignment:       4
48tracksRegLiveness: true
49body:             |
50  bb.0:
51    liveins: $a0, $a1
52
53    ; MIPS32-LABEL: name: load_store_i1
54    ; MIPS32: liveins: $a0, $a1
55    ; MIPS32-NEXT: {{  $}}
56    ; MIPS32-NEXT: [[COPY:%[0-9]+]]:_(p0) = COPY $a0
57    ; MIPS32-NEXT: [[COPY1:%[0-9]+]]:_(p0) = COPY $a1
58    ; MIPS32-NEXT: [[LOAD:%[0-9]+]]:_(s32) = G_LOAD [[COPY1]](p0) :: (load (s8))
59    ; MIPS32-NEXT: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 1
60    ; MIPS32-NEXT: [[AND:%[0-9]+]]:_(s32) = G_AND [[LOAD]], [[C]]
61    ; MIPS32-NEXT: [[AND1:%[0-9]+]]:_(s32) = G_AND [[AND]], [[C]]
62    ; MIPS32-NEXT: G_STORE [[AND1]](s32), [[COPY]](p0) :: (store (s8))
63    ; MIPS32-NEXT: RetRA
64    %0:_(p0) = COPY $a0
65    %1:_(p0) = COPY $a1
66    %2:_(s1) = G_LOAD %1(p0) :: (load (s1))
67    G_STORE %2(s1), %0(p0) :: (store (s1))
68    RetRA
69
70...
71---
72name:            load_store_i8
73alignment:       4
74tracksRegLiveness: true
75body:             |
76  bb.0:
77    liveins: $a0, $a1
78
79    ; MIPS32-LABEL: name: load_store_i8
80    ; MIPS32: liveins: $a0, $a1
81    ; MIPS32-NEXT: {{  $}}
82    ; MIPS32-NEXT: [[COPY:%[0-9]+]]:_(p0) = COPY $a0
83    ; MIPS32-NEXT: [[COPY1:%[0-9]+]]:_(p0) = COPY $a1
84    ; MIPS32-NEXT: [[LOAD:%[0-9]+]]:_(s32) = G_LOAD [[COPY1]](p0) :: (load (s8))
85    ; MIPS32-NEXT: G_STORE [[LOAD]](s32), [[COPY]](p0) :: (store (s8))
86    ; MIPS32-NEXT: RetRA
87    %0:_(p0) = COPY $a0
88    %1:_(p0) = COPY $a1
89    %2:_(s8) = G_LOAD %1(p0) :: (load (s8))
90    G_STORE %2(s8), %0(p0) :: (store (s8))
91    RetRA
92
93...
94---
95name:            load_store_i16
96alignment:       4
97tracksRegLiveness: true
98body:             |
99  bb.0:
100    liveins: $a0, $a1
101
102    ; MIPS32-LABEL: name: load_store_i16
103    ; MIPS32: liveins: $a0, $a1
104    ; MIPS32-NEXT: {{  $}}
105    ; MIPS32-NEXT: [[COPY:%[0-9]+]]:_(p0) = COPY $a0
106    ; MIPS32-NEXT: [[COPY1:%[0-9]+]]:_(p0) = COPY $a1
107    ; MIPS32-NEXT: [[LOAD:%[0-9]+]]:_(s32) = G_LOAD [[COPY1]](p0) :: (load (s16))
108    ; MIPS32-NEXT: G_STORE [[LOAD]](s32), [[COPY]](p0) :: (store (s16))
109    ; MIPS32-NEXT: RetRA
110    %0:_(p0) = COPY $a0
111    %1:_(p0) = COPY $a1
112    %2:_(s16) = G_LOAD %1(p0) :: (load (s16))
113    G_STORE %2(s16), %0(p0) :: (store (s16))
114    RetRA
115
116...
117---
118name:            load_store_i32
119alignment:       4
120tracksRegLiveness: true
121body:             |
122  bb.0:
123    liveins: $a0, $a1
124
125    ; MIPS32-LABEL: name: load_store_i32
126    ; MIPS32: liveins: $a0, $a1
127    ; MIPS32-NEXT: {{  $}}
128    ; MIPS32-NEXT: [[COPY:%[0-9]+]]:_(p0) = COPY $a0
129    ; MIPS32-NEXT: [[COPY1:%[0-9]+]]:_(p0) = COPY $a1
130    ; MIPS32-NEXT: [[LOAD:%[0-9]+]]:_(s32) = G_LOAD [[COPY1]](p0) :: (load (s32))
131    ; MIPS32-NEXT: G_STORE [[LOAD]](s32), [[COPY]](p0) :: (store (s32))
132    ; MIPS32-NEXT: RetRA
133    %0:_(p0) = COPY $a0
134    %1:_(p0) = COPY $a1
135    %2:_(s32) = G_LOAD %1(p0) :: (load (s32))
136    G_STORE %2(s32), %0(p0) :: (store (s32))
137    RetRA
138
139...
140