1 ; RUN: llc -march=hexagon -O2 -mno-pairing -mno-compound < %s | FileCheck %s
3 ; Test to see if we inline calls to memcpy/memmove when
4 ; the array size is small.
6 target triple = "hexagon-unknown--elf"
9 ; CHECK-DAG: [[REG1:r[0-9]*]] = memw(r{{[0-9]*}}+#0)
10 ; CHECK-DAG: [[REG2:r[0-9]*]] = memuh(r{{[0-9]*}}+#4)
11 ; CHECK-DAG: [[REG3:r[0-9]*]] = memub(r{{[0-9]*}}+#6)
12 ; CHECK-DAG: memw(r{{[0-9]*}}+#0) = [[REG1]]
13 ; CHECK-DAG: memh(r{{[0-9]*}}+#4) = [[REG2]]
14 ; CHECK-DAG: memb(r{{[0-9]*}}+#6) = [[REG3]]
16 define i32 @f0(ptr %a0) #0 {
18 %v0 = alloca [10 x i32], align 8
19 call void @llvm.memcpy.p0.p0.i32(ptr align 4 %v0, ptr align 4 %a0, i32 7, i1 false)
20 call void @f1(ptr %v0, ptr %a0) #0
24 declare void @f1(ptr, ptr)
27 ; CHECK-DAG: [[REG4:r[0-9]*]] = memub(r{{[0-9]*}}+#6)
28 ; CHECK-DAG: [[REG5:r[0-9]*]] = memuh(r{{[0-9]*}}+#4)
29 ; CHECK-DAG: [[REG6:r[0-9]*]] = memw(r{{[0-9]*}}+#0)
30 ; CHECK-DAG: memw(r{{[0-9]*}}+#0) = [[REG6]]
31 ; CHECK-DAG: memh(r{{[0-9]*}}+#4) = [[REG5]]
32 ; CHECK-DAG: memb(r{{[0-9]*}}+#6) = [[REG4]]
34 define i32 @f2(ptr %a0, ptr %a1) #0 {
36 call void @llvm.memmove.p0.p0.i32(ptr align 4 %a1, ptr align 4 %a0, i32 7, i1 false)
37 tail call void @f1(ptr %a1, ptr %a0) #0
41 declare void @llvm.memcpy.p0.p0.i32(ptr nocapture writeonly, ptr nocapture readonly, i32, i1) #1
42 declare void @llvm.memmove.p0.p0.i32(ptr nocapture, ptr nocapture readonly, i32, i1) #1
44 attributes #0 = { nounwind }
45 attributes #1 = { argmemonly nounwind }