1 ; RUN: llc -march=hexagon -hexagon-small-data-threshold=0 < %s | FileCheck %s
2 ; Disable small-data, or otherwise g3 will end up in .sdata. While that is
3 ; not a problem, this test was originally written with the g3 not being in
4 ; there, so keep it that way.
6 %s.0 = type { i32, i32, i32, i32, i32, i32 }
7 %s.1 = type { i64, i64, i64, i64, i64, i64 }
8 %s.2 = type { i16, i16, i16, i16, i16, i16 }
9 %s.3 = type { i8, i8, i8, i8, i8, i8 }
11 @g0 = external global %s.0
12 @g1 = external global %s.1
13 @g2 = external global %s.2
14 @g3 = external global %s.3
17 ; CHECK: [[REG1:(r[0-9]+)]] = {{[#]+}}g0
18 ; CHECK: r{{[0-9]+}} = memw([[REG1]]+#{{[0-9]+}})
20 ; CHECK: dealloc_return
23 %v0 = alloca %s.0, align 4
24 call void @llvm.memcpy.p0.p0.i32(ptr align 4 %v0, ptr align 4 @g0, i32 24, i1 false)
25 call void @f1(ptr %v0) #0
32 ; CHECK: [[REG2:(r[0-9]+)]] = {{[#]+}}g1
33 ; CHECK: r{{[0-9]+}}:{{[0-9]+}} = memd([[REG2]]+#{{[0-9]+}})
34 ; CHECK: dealloc_return
37 %v0 = alloca %s.1, align 8
38 call void @llvm.memcpy.p0.p0.i32(ptr align 8 %v0, ptr align 8 @g1, i32 48, i1 false)
39 call void @f3(ptr %v0) #0
46 ; CHECK: [[REG1:(r[0-9]+)]] = {{[#]+}}g2
47 ; CHECK: r{{[0-9]+}} = mem{{u?}}h([[REG1]]+#{{[0-9]+}})
49 ; CHECK: dealloc_return
52 %v0 = alloca %s.2, align 2
53 call void @llvm.memcpy.p0.p0.i32(ptr align 2 %v0, ptr align 2 @g2, i32 12, i1 false)
54 call void @f5(ptr %v0) #0
61 ; CHECK: [[REG1:(r[0-9]+)]] = {{[#]+}}g3
62 ; CHECK: r{{[0-9]+}} = mem{{u?}}b([[REG1]]+#{{[0-9]+}})
64 ; CHECK: dealloc_return
67 %v0 = alloca %s.3, align 1
68 call void @llvm.memcpy.p0.p0.i32(ptr align 1 %v0, ptr align 1 @g3, i32 6, i1 false)
69 call void @f7(ptr %v0) #0
75 declare void @llvm.memcpy.p0.p0.i32(ptr nocapture writeonly, ptr nocapture readonly, i32, i1) #1
77 attributes #0 = { nounwind }
78 attributes #1 = { argmemonly nounwind }