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 # RUN: llc -O0 -mtriple=mipsel-linux-gnu -run-pass=legalizer -mcpu=mips32r6 -verify-machineinstrs %s -o - | FileCheck %s -check-prefixes=MIPS32R6
6 @float_align1 = common global float 0.000000e+00, align 1
7 @float_align2 = common global float 0.000000e+00, align 2
8 @float_align4 = common global float 0.000000e+00, align 4
9 @float_align8 = common global float 0.000000e+00, align 8
10 @i32_align1 = common global i32 0, align 1
11 @i32_align2 = common global i32 0, align 2
12 @i32_align4 = common global i32 0, align 4
13 @i32_align8 = common global i32 0, align 8
15 define float @load_float_align1() {
17 %0 = load float, ptr @float_align1, align 1
21 define float @load_float_align2() {
23 %0 = load float, ptr @float_align2, align 2
27 define float @load_float_align4() {
29 %0 = load float, ptr @float_align4, align 4
33 define float @load_float_align8() {
35 %0 = load float, ptr @float_align8, align 8
39 define i32 @load_i32_align1() {
41 %0 = load i32, ptr @i32_align1, align 1
45 define i32 @load_i32_align2() {
47 %0 = load i32, ptr @i32_align2, align 2
51 define i32 @load_i32_align4() {
53 %0 = load i32, ptr @i32_align4, align 4
57 define i32 @load_i32_align8() {
59 %0 = load i32, ptr @i32_align8, align 8
65 name: load_float_align1
67 tracksRegLiveness: true
70 ; MIPS32-LABEL: name: load_float_align1
71 ; MIPS32: [[GV:%[0-9]+]]:_(p0) = G_GLOBAL_VALUE @float_align1
72 ; MIPS32: [[LOAD:%[0-9]+]]:_(s32) = G_LOAD [[GV]](p0) :: (dereferenceable load (s32) from @float_align1, align 1)
73 ; MIPS32: $f0 = COPY [[LOAD]](s32)
74 ; MIPS32: RetRA implicit $f0
75 ; MIPS32R6-LABEL: name: load_float_align1
76 ; MIPS32R6: [[GV:%[0-9]+]]:_(p0) = G_GLOBAL_VALUE @float_align1
77 ; MIPS32R6: [[LOAD:%[0-9]+]]:_(s32) = G_LOAD [[GV]](p0) :: (dereferenceable load (s32) from @float_align1, align 1)
78 ; MIPS32R6: $f0 = COPY [[LOAD]](s32)
79 ; MIPS32R6: RetRA implicit $f0
80 %1:_(p0) = G_GLOBAL_VALUE @float_align1
81 %0:_(s32) = G_LOAD %1(p0) :: (dereferenceable load (s32) from @float_align1, align 1)
87 name: load_float_align2
89 tracksRegLiveness: true
92 ; MIPS32-LABEL: name: load_float_align2
93 ; MIPS32: [[GV:%[0-9]+]]:_(p0) = G_GLOBAL_VALUE @float_align2
94 ; MIPS32: [[LOAD:%[0-9]+]]:_(s32) = G_LOAD [[GV]](p0) :: (dereferenceable load (s32) from @float_align2, align 2)
95 ; MIPS32: $f0 = COPY [[LOAD]](s32)
96 ; MIPS32: RetRA implicit $f0
97 ; MIPS32R6-LABEL: name: load_float_align2
98 ; MIPS32R6: [[GV:%[0-9]+]]:_(p0) = G_GLOBAL_VALUE @float_align2
99 ; MIPS32R6: [[LOAD:%[0-9]+]]:_(s32) = G_LOAD [[GV]](p0) :: (dereferenceable load (s32) from @float_align2, align 2)
100 ; MIPS32R6: $f0 = COPY [[LOAD]](s32)
101 ; MIPS32R6: RetRA implicit $f0
102 %1:_(p0) = G_GLOBAL_VALUE @float_align2
103 %0:_(s32) = G_LOAD %1(p0) :: (dereferenceable load (s32) from @float_align2, align 2)
109 name: load_float_align4
111 tracksRegLiveness: true
114 ; MIPS32-LABEL: name: load_float_align4
115 ; MIPS32: [[GV:%[0-9]+]]:_(p0) = G_GLOBAL_VALUE @float_align4
116 ; MIPS32: [[LOAD:%[0-9]+]]:_(s32) = G_LOAD [[GV]](p0) :: (dereferenceable load (s32) from @float_align4)
117 ; MIPS32: $f0 = COPY [[LOAD]](s32)
118 ; MIPS32: RetRA implicit $f0
119 ; MIPS32R6-LABEL: name: load_float_align4
120 ; MIPS32R6: [[GV:%[0-9]+]]:_(p0) = G_GLOBAL_VALUE @float_align4
121 ; MIPS32R6: [[LOAD:%[0-9]+]]:_(s32) = G_LOAD [[GV]](p0) :: (dereferenceable load (s32) from @float_align4)
122 ; MIPS32R6: $f0 = COPY [[LOAD]](s32)
123 ; MIPS32R6: RetRA implicit $f0
124 %1:_(p0) = G_GLOBAL_VALUE @float_align4
125 %0:_(s32) = G_LOAD %1(p0) :: (dereferenceable load (s32) from @float_align4)
131 name: load_float_align8
133 tracksRegLiveness: true
136 ; MIPS32-LABEL: name: load_float_align8
137 ; MIPS32: [[GV:%[0-9]+]]:_(p0) = G_GLOBAL_VALUE @float_align8
138 ; MIPS32: [[LOAD:%[0-9]+]]:_(s32) = G_LOAD [[GV]](p0) :: (dereferenceable load (s32) from @float_align8, align 8)
139 ; MIPS32: $f0 = COPY [[LOAD]](s32)
140 ; MIPS32: RetRA implicit $f0
141 ; MIPS32R6-LABEL: name: load_float_align8
142 ; MIPS32R6: [[GV:%[0-9]+]]:_(p0) = G_GLOBAL_VALUE @float_align8
143 ; MIPS32R6: [[LOAD:%[0-9]+]]:_(s32) = G_LOAD [[GV]](p0) :: (dereferenceable load (s32) from @float_align8, align 8)
144 ; MIPS32R6: $f0 = COPY [[LOAD]](s32)
145 ; MIPS32R6: RetRA implicit $f0
146 %1:_(p0) = G_GLOBAL_VALUE @float_align8
147 %0:_(s32) = G_LOAD %1(p0) :: (dereferenceable load (s32) from @float_align8, align 8)
153 name: load_i32_align1
155 tracksRegLiveness: true
158 ; MIPS32-LABEL: name: load_i32_align1
159 ; MIPS32: [[GV:%[0-9]+]]:_(p0) = G_GLOBAL_VALUE @i32_align1
160 ; MIPS32: [[LOAD:%[0-9]+]]:_(s32) = G_LOAD [[GV]](p0) :: (dereferenceable load (s32) from @i32_align1, align 1)
161 ; MIPS32: $v0 = COPY [[LOAD]](s32)
162 ; MIPS32: RetRA implicit $v0
163 ; MIPS32R6-LABEL: name: load_i32_align1
164 ; MIPS32R6: [[GV:%[0-9]+]]:_(p0) = G_GLOBAL_VALUE @i32_align1
165 ; MIPS32R6: [[LOAD:%[0-9]+]]:_(s32) = G_LOAD [[GV]](p0) :: (dereferenceable load (s32) from @i32_align1, align 1)
166 ; MIPS32R6: $v0 = COPY [[LOAD]](s32)
167 ; MIPS32R6: RetRA implicit $v0
168 %1:_(p0) = G_GLOBAL_VALUE @i32_align1
169 %0:_(s32) = G_LOAD %1(p0) :: (dereferenceable load (s32) from @i32_align1, align 1)
175 name: load_i32_align2
177 tracksRegLiveness: true
180 ; MIPS32-LABEL: name: load_i32_align2
181 ; MIPS32: [[GV:%[0-9]+]]:_(p0) = G_GLOBAL_VALUE @i32_align2
182 ; MIPS32: [[LOAD:%[0-9]+]]:_(s32) = G_LOAD [[GV]](p0) :: (dereferenceable load (s32) from @i32_align2, align 2)
183 ; MIPS32: $v0 = COPY [[LOAD]](s32)
184 ; MIPS32: RetRA implicit $v0
185 ; MIPS32R6-LABEL: name: load_i32_align2
186 ; MIPS32R6: [[GV:%[0-9]+]]:_(p0) = G_GLOBAL_VALUE @i32_align2
187 ; MIPS32R6: [[LOAD:%[0-9]+]]:_(s32) = G_LOAD [[GV]](p0) :: (dereferenceable load (s32) from @i32_align2, align 2)
188 ; MIPS32R6: $v0 = COPY [[LOAD]](s32)
189 ; MIPS32R6: RetRA implicit $v0
190 %1:_(p0) = G_GLOBAL_VALUE @i32_align2
191 %0:_(s32) = G_LOAD %1(p0) :: (dereferenceable load (s32) from @i32_align2, align 2)
197 name: load_i32_align4
199 tracksRegLiveness: true
202 ; MIPS32-LABEL: name: load_i32_align4
203 ; MIPS32: [[GV:%[0-9]+]]:_(p0) = G_GLOBAL_VALUE @i32_align4
204 ; MIPS32: [[LOAD:%[0-9]+]]:_(s32) = G_LOAD [[GV]](p0) :: (dereferenceable load (s32) from @i32_align4)
205 ; MIPS32: $v0 = COPY [[LOAD]](s32)
206 ; MIPS32: RetRA implicit $v0
207 ; MIPS32R6-LABEL: name: load_i32_align4
208 ; MIPS32R6: [[GV:%[0-9]+]]:_(p0) = G_GLOBAL_VALUE @i32_align4
209 ; MIPS32R6: [[LOAD:%[0-9]+]]:_(s32) = G_LOAD [[GV]](p0) :: (dereferenceable load (s32) from @i32_align4)
210 ; MIPS32R6: $v0 = COPY [[LOAD]](s32)
211 ; MIPS32R6: RetRA implicit $v0
212 %1:_(p0) = G_GLOBAL_VALUE @i32_align4
213 %0:_(s32) = G_LOAD %1(p0) :: (dereferenceable load (s32) from @i32_align4)
219 name: load_i32_align8
221 tracksRegLiveness: true
224 ; MIPS32-LABEL: name: load_i32_align8
225 ; MIPS32: [[GV:%[0-9]+]]:_(p0) = G_GLOBAL_VALUE @i32_align8
226 ; MIPS32: [[LOAD:%[0-9]+]]:_(s32) = G_LOAD [[GV]](p0) :: (dereferenceable load (s32) from @i32_align8, align 8)
227 ; MIPS32: $v0 = COPY [[LOAD]](s32)
228 ; MIPS32: RetRA implicit $v0
229 ; MIPS32R6-LABEL: name: load_i32_align8
230 ; MIPS32R6: [[GV:%[0-9]+]]:_(p0) = G_GLOBAL_VALUE @i32_align8
231 ; MIPS32R6: [[LOAD:%[0-9]+]]:_(s32) = G_LOAD [[GV]](p0) :: (dereferenceable load (s32) from @i32_align8, align 8)
232 ; MIPS32R6: $v0 = COPY [[LOAD]](s32)
233 ; MIPS32R6: RetRA implicit $v0
234 %1:_(p0) = G_GLOBAL_VALUE @i32_align8
235 %0:_(s32) = G_LOAD %1(p0) :: (dereferenceable load (s32) from @i32_align8, align 8)