1 ; RUN: llc -march=hexagon < %s | FileCheck %s
4 ; CHECK: m[[REG1:([0-1])]] = r0
5 ; CHECK: cs[[REG1]] = r1
6 ; CHECK: = memub(r1++#4:circ(m[[REG1]])
7 define zeroext i8 @test1(i32 %mod, ptr %start) local_unnamed_addr #0 {
9 %0 = tail call { i32, ptr } @llvm.hexagon.L2.loadrub.pci(ptr %start, i32 4, i32 %mod, ptr %start)
10 %1 = extractvalue { i32, ptr } %0, 0
11 %conv = trunc i32 %1 to i8
15 declare { i32, ptr } @llvm.hexagon.L2.loadrub.pci(ptr, i32, i32, ptr nocapture) #1
18 ; CHECK: m[[REG2:([0-1])]] = r0
19 ; CHECK: cs[[REG2]] = r1
20 ; CHECK: = memb(r1++#4:circ(m[[REG2]])
21 define zeroext i8 @test2(i32 %mod, ptr %start) local_unnamed_addr #0 {
23 %0 = tail call { i32, ptr } @llvm.hexagon.L2.loadrb.pci(ptr %start, i32 4, i32 %mod, ptr %start)
24 %1 = extractvalue { i32, ptr } %0, 0
25 %conv = trunc i32 %1 to i8
29 declare { i32, ptr } @llvm.hexagon.L2.loadrb.pci(ptr, i32, i32, ptr nocapture) #1
32 ; CHECK: m[[REG3:([0-1])]] = r0
33 ; CHECK: cs[[REG3]] = r1
34 ; CHECK: = memuh(r1++#4:circ(m[[REG3]])
35 define zeroext i16 @test3(i32 %mod, ptr %start) local_unnamed_addr #0 {
37 %0 = tail call { i32, ptr } @llvm.hexagon.L2.loadruh.pci(ptr %start, i32 4, i32 %mod, ptr %start)
38 %1 = extractvalue { i32, ptr } %0, 0
39 %conv = trunc i32 %1 to i16
43 declare { i32, ptr } @llvm.hexagon.L2.loadruh.pci(ptr, i32, i32, ptr nocapture) #1
46 ; CHECK: m[[REG4:([0-1])]] = r0
47 ; CHECK: cs[[REG4]] = r1
48 ; CHECK: = memh(r1++#4:circ(m[[REG4]])
49 define signext i16 @test4(i32 %mod, ptr %start) local_unnamed_addr #0 {
51 %0 = tail call { i32, ptr } @llvm.hexagon.L2.loadrh.pci(ptr %start, i32 4, i32 %mod, ptr %start)
52 %1 = extractvalue { i32, ptr } %0, 0
53 %conv = trunc i32 %1 to i16
57 declare { i32, ptr } @llvm.hexagon.L2.loadrh.pci(ptr, i32, i32, ptr nocapture) #1
60 ; CHECK: m[[REG5:([0-1])]] = r0
61 ; CHECK: cs[[REG5]] = r1
62 ; CHECK: = memw(r1++#4:circ(m[[REG5]])
63 define i32 @test5(i32 %mod, ptr %start) local_unnamed_addr #0 {
65 %0 = tail call { i32, ptr } @llvm.hexagon.L2.loadri.pci(ptr %start, i32 4, i32 %mod, ptr %start)
66 %1 = extractvalue { i32, ptr } %0, 0
70 declare { i32, ptr } @llvm.hexagon.L2.loadri.pci(ptr, i32, i32, ptr nocapture) #1
73 ; CHECK: m[[REG6:([0-1])]] = r0
74 ; CHECK: cs[[REG6]] = r1
75 ; CHECK: = memd(r1++#8:circ(m[[REG6]])
76 define i64 @test6(i32 %mod, ptr %start) local_unnamed_addr #0 {
78 %0 = tail call { i64, ptr } @llvm.hexagon.L2.loadrd.pci(ptr %start, i32 8, i32 %mod, ptr %start)
79 %1 = extractvalue { i64, ptr } %0, 0
83 declare { i64, ptr } @llvm.hexagon.L2.loadrd.pci(ptr, i32, i32, ptr nocapture) #1
86 ; CHECK: m[[REG7:([0-1])]] = r0
87 ; CHECK: cs[[REG7]] = r1
88 ; CHECK: = memub(r1++I:circ(m[[REG7]])
89 define zeroext i8 @test7(i32 %mod, ptr %start) local_unnamed_addr #0 {
91 %0 = tail call { i32, ptr } @llvm.hexagon.L2.loadrub.pcr(ptr %start, i32 %mod, ptr %start)
92 %1 = extractvalue { i32, ptr } %0, 0
93 %conv = trunc i32 %1 to i8
97 declare { i32, ptr } @llvm.hexagon.L2.loadrub.pcr(ptr, i32, ptr nocapture) #1
100 ; CHECK: m[[REG8:([0-1])]] = r0
101 ; CHECK: cs[[REG8]] = r1
102 ; CHECK: = memb(r1++I:circ(m[[REG8]])
103 define zeroext i8 @test8(i32 %mod, ptr %start) local_unnamed_addr #0 {
105 %0 = tail call { i32, ptr } @llvm.hexagon.L2.loadrb.pcr(ptr %start, i32 %mod, ptr %start)
106 %1 = extractvalue { i32, ptr } %0, 0
107 %conv = trunc i32 %1 to i8
111 declare { i32, ptr } @llvm.hexagon.L2.loadrb.pcr(ptr, i32, ptr nocapture) #1
114 ; CHECK: m[[REG9:([0-1])]] = r0
115 ; CHECK: cs[[REG9]] = r1
116 ; CHECK: = memuh(r1++I:circ(m[[REG9]])
117 define zeroext i16 @test9(i32 %mod, ptr %start) local_unnamed_addr #0 {
119 %0 = tail call { i32, ptr } @llvm.hexagon.L2.loadruh.pcr(ptr %start, i32 %mod, ptr %start)
120 %1 = extractvalue { i32, ptr } %0, 0
121 %conv = trunc i32 %1 to i16
125 declare { i32, ptr } @llvm.hexagon.L2.loadruh.pcr(ptr, i32, ptr nocapture) #1
127 ; CHECK-LABEL: test10
128 ; CHECK: m[[REG10:([0-1])]] = r0
129 ; CHECK: cs[[REG10]] = r1
130 ; CHECK: = memh(r1++I:circ(m[[REG10]])
131 define signext i16 @test10(i32 %mod, ptr %start) local_unnamed_addr #0 {
133 %0 = tail call { i32, ptr } @llvm.hexagon.L2.loadrh.pcr(ptr %start, i32 %mod, ptr %start)
134 %1 = extractvalue { i32, ptr } %0, 0
135 %conv = trunc i32 %1 to i16
139 declare { i32, ptr } @llvm.hexagon.L2.loadrh.pcr(ptr, i32, ptr nocapture) #1
141 ; CHECK-LABEL: test11
142 ; CHECK: m[[REG11:([0-1])]] = r0
143 ; CHECK: cs[[REG11]] = r1
144 ; CHECK: = memw(r1++I:circ(m[[REG11]])
145 define i32 @test11(i32 %mod, ptr %start) local_unnamed_addr #0 {
147 %0 = tail call { i32, ptr } @llvm.hexagon.L2.loadri.pcr(ptr %start, i32 %mod, ptr %start)
148 %1 = extractvalue { i32, ptr } %0, 0
152 declare { i32, ptr } @llvm.hexagon.L2.loadri.pcr(ptr, i32, ptr nocapture) #1
154 ; CHECK-LABEL: test12
155 ; CHECK: m[[REG12:([0-1])]] = r0
156 ; CHECK: cs[[REG12]] = r1
157 ; CHECK: = memd(r1++I:circ(m[[REG12]])
158 define i64 @test12(i32 %mod, ptr %start) local_unnamed_addr #0 {
160 %0 = tail call { i64, ptr } @llvm.hexagon.L2.loadrd.pcr(ptr %start, i32 %mod, ptr %start)
161 %1 = extractvalue { i64, ptr } %0, 0
165 declare { i64, ptr } @llvm.hexagon.L2.loadrd.pcr(ptr, i32, ptr nocapture) #1
167 ; CHECK-LABEL: test13
168 ; CHECK: m[[REG13:([0-1])]] = r0
169 ; CHECK: cs[[REG13]] = r1
170 ; CHECK: memb(r1++#4:circ(m[[REG13]])) =
171 define void @test13(i32 %mod, ptr %start, i8 zeroext %v) local_unnamed_addr #0 {
173 %conv = zext i8 %v to i32
174 %0 = tail call ptr @llvm.hexagon.S2.storerb.pci(ptr %start, i32 4, i32 %mod, i32 %conv, ptr %start)
178 declare ptr @llvm.hexagon.S2.storerb.pci(ptr, i32, i32, i32, ptr nocapture) #1
180 ; CHECK-LABEL: test14
181 ; CHECK: m[[REG14:([0-1])]] = r0
182 ; CHECK: cs[[REG14]] = r1
183 ; CHECK: memh(r1++#4:circ(m[[REG14]])) =
184 define void @test14(i32 %mod, ptr %start, i16 signext %v) local_unnamed_addr #0 {
186 %conv = sext i16 %v to i32
187 %0 = tail call ptr @llvm.hexagon.S2.storerh.pci(ptr %start, i32 4, i32 %mod, i32 %conv, ptr %start)
191 declare ptr @llvm.hexagon.S2.storerh.pci(ptr, i32, i32, i32, ptr nocapture) #1
193 ; CHECK-LABEL: test15
194 ; CHECK: m[[REG15:([0-1])]] = r0
195 ; CHECK: cs[[REG15]] = r1
196 ; CHECK: memh(r1++#4:circ(m[[REG15]])) = r{{[0-9]+}}.h
197 define void @test15(i32 %mod, ptr %start, i16 signext %v) local_unnamed_addr #0 {
199 %conv = sext i16 %v to i32
200 %0 = tail call ptr @llvm.hexagon.S2.storerf.pci(ptr %start, i32 4, i32 %mod, i32 %conv, ptr %start)
204 declare ptr @llvm.hexagon.S2.storerf.pci(ptr, i32, i32, i32, ptr nocapture) #1
206 ; CHECK-LABEL: test16
207 ; CHECK: m[[REG16:([0-1])]] = r0
208 ; CHECK: cs[[REG16]] = r1
209 ; CHECK: memw(r1++#4:circ(m[[REG16]])) =
210 define void @test16(i32 %mod, ptr %start, i32 %v) local_unnamed_addr #0 {
212 %0 = tail call ptr @llvm.hexagon.S2.storeri.pci(ptr %start, i32 4, i32 %mod, i32 %v, ptr %start)
216 declare ptr @llvm.hexagon.S2.storeri.pci(ptr, i32, i32, i32, ptr nocapture) #1
218 ; CHECK-LABEL: test17
219 ; CHECK: m[[REG17:([0-1])]] = r0
220 ; CHECK: cs[[REG17]] = r1
221 ; CHECK: memd(r1++#8:circ(m[[REG17]])) =
222 define void @test17(i32 %mod, ptr %start, i64 %v) local_unnamed_addr #0 {
224 %0 = tail call ptr @llvm.hexagon.S2.storerd.pci(ptr %start, i32 8, i32 %mod, i64 %v, ptr %start)
228 declare ptr @llvm.hexagon.S2.storerd.pci(ptr, i32, i32, i64, ptr nocapture) #1
230 ; CHECK-LABEL: test18
231 ; CHECK: m[[REG18:([0-1])]] = r0
232 ; CHECK: cs[[REG18]] = r1
233 ; CHECK: memb(r1++I:circ(m[[REG18]])) =
234 define void @test18(i32 %mod, ptr %start, i8 zeroext %v) local_unnamed_addr #0 {
236 %conv = zext i8 %v to i32
237 %0 = tail call ptr @llvm.hexagon.S2.storerb.pcr(ptr %start, i32 %mod, i32 %conv, ptr %start)
241 declare ptr @llvm.hexagon.S2.storerb.pcr(ptr, i32, i32, ptr nocapture) #1
243 ; CHECK-LABEL: test19
244 ; CHECK: m[[REG19:([0-1])]] = r0
245 ; CHECK: cs[[REG19]] = r1
246 ; CHECK: memh(r1++I:circ(m[[REG19]])) =
247 define void @test19(i32 %mod, ptr %start, i16 signext %v) local_unnamed_addr #0 {
249 %conv = sext i16 %v to i32
250 %0 = tail call ptr @llvm.hexagon.S2.storerh.pcr(ptr %start, i32 %mod, i32 %conv, ptr %start)
254 declare ptr @llvm.hexagon.S2.storerh.pcr(ptr, i32, i32, ptr nocapture) #1
256 ; CHECK-LABEL: test20
257 ; CHECK: m[[REG20:([0-1])]] = r0
258 ; CHECK: cs[[REG20]] = r1
259 ; CHECK: memh(r1++I:circ(m[[REG20]])) = r{{[0-9]+}}.h
260 define void @test20(i32 %mod, ptr %start, i16 signext %v) local_unnamed_addr #0 {
262 %conv = sext i16 %v to i32
263 %0 = tail call ptr @llvm.hexagon.S2.storerf.pcr(ptr %start, i32 %mod, i32 %conv, ptr %start)
267 declare ptr @llvm.hexagon.S2.storerf.pcr(ptr, i32, i32, ptr nocapture) #1
269 ; CHECK-LABEL: test21
270 ; CHECK: m[[REG21:([0-1])]] = r0
271 ; CHECK: cs[[REG21]] = r1
272 ; CHECK: memw(r1++I:circ(m[[REG21]])) =
273 define void @test21(i32 %mod, ptr %start, i32 %v) local_unnamed_addr #0 {
275 %0 = tail call ptr @llvm.hexagon.S2.storeri.pcr(ptr %start, i32 %mod, i32 %v, ptr %start)
279 declare ptr @llvm.hexagon.S2.storeri.pcr(ptr, i32, i32, ptr nocapture) #1
281 ; CHECK-LABEL: test22
282 ; CHECK: m[[REG22:([0-1])]] = r0
283 ; CHECK: cs[[REG22]] = r1
284 ; CHECK: memd(r1++I:circ(m[[REG1]])) =
285 define void @test22(i32 %mod, ptr %start, i64 %v) local_unnamed_addr #0 {
287 %0 = tail call ptr @llvm.hexagon.S2.storerd.pcr(ptr %start, i32 %mod, i64 %v, ptr %start)
291 declare ptr @llvm.hexagon.S2.storerd.pcr(ptr, i32, i64, ptr nocapture) #1
293 attributes #0 = { nounwind "target-cpu"="hexagonv60" }
294 attributes #1 = { argmemonly nounwind }