1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py UTC_ARGS: --version 5
3 ; RUN: llc -mtriple=amdgcn-amd-amdhsa -mcpu=gfx1030 %s -o - | FileCheck %s
5 ; Testing codegen for memmove with scalar reads.
8 define void @memmove_p1_p4_sz16_align_4_4(ptr addrspace(1) align 4 %dst, ptr addrspace(4) align 4 readonly inreg %src) {
9 ; CHECK-LABEL: memmove_p1_p4_sz16_align_4_4:
10 ; CHECK: ; %bb.0: ; %entry
11 ; CHECK-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
12 ; CHECK-NEXT: s_load_dwordx4 s[4:7], s[6:7], 0x0
13 ; CHECK-NEXT: s_waitcnt lgkmcnt(0)
14 ; CHECK-NEXT: v_mov_b32_e32 v2, s4
15 ; CHECK-NEXT: v_mov_b32_e32 v3, s5
16 ; CHECK-NEXT: v_mov_b32_e32 v4, s6
17 ; CHECK-NEXT: v_mov_b32_e32 v5, s7
18 ; CHECK-NEXT: global_store_dwordx4 v[0:1], v[2:5], off
19 ; CHECK-NEXT: s_setpc_b64 s[30:31]
21 tail call void @llvm.memmove.p1.p4.i64(ptr addrspace(1) noundef nonnull align 4 %dst, ptr addrspace(4) noundef nonnull align 4 %src, i64 16, i1 false)
25 define void @memmove_p1_p4_sz31_align_4_4(ptr addrspace(1) align 4 %dst, ptr addrspace(4) align 4 readonly inreg %src) {
26 ; CHECK-LABEL: memmove_p1_p4_sz31_align_4_4:
27 ; CHECK: ; %bb.0: ; %entry
28 ; CHECK-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
29 ; CHECK-NEXT: v_mov_b32_e32 v2, 0
30 ; CHECK-NEXT: global_load_ubyte v9, v2, s[6:7] offset:30
31 ; CHECK-NEXT: s_load_dwordx8 s[4:11], s[6:7], 0x0
32 ; CHECK-NEXT: s_waitcnt lgkmcnt(0)
33 ; CHECK-NEXT: v_mov_b32_e32 v2, s4
34 ; CHECK-NEXT: v_mov_b32_e32 v3, s5
35 ; CHECK-NEXT: v_mov_b32_e32 v4, s6
36 ; CHECK-NEXT: v_mov_b32_e32 v5, s7
37 ; CHECK-NEXT: v_mov_b32_e32 v10, s11
38 ; CHECK-NEXT: v_mov_b32_e32 v6, s8
39 ; CHECK-NEXT: v_mov_b32_e32 v7, s9
40 ; CHECK-NEXT: v_mov_b32_e32 v8, s10
41 ; CHECK-NEXT: global_store_dwordx4 v[0:1], v[2:5], off
42 ; CHECK-NEXT: global_store_short v[0:1], v10, off offset:28
43 ; CHECK-NEXT: s_waitcnt vmcnt(0)
44 ; CHECK-NEXT: global_store_byte v[0:1], v9, off offset:30
45 ; CHECK-NEXT: global_store_dwordx3 v[0:1], v[6:8], off offset:16
46 ; CHECK-NEXT: s_setpc_b64 s[30:31]
48 tail call void @llvm.memmove.p1.p4.i64(ptr addrspace(1) noundef nonnull align 4 %dst, ptr addrspace(4) noundef nonnull align 4 %src, i64 31, i1 false)
52 define void @memmove_p1_p4_sz32_align_4_4(ptr addrspace(1) align 4 %dst, ptr addrspace(4) align 4 readonly inreg %src) {
53 ; CHECK-LABEL: memmove_p1_p4_sz32_align_4_4:
54 ; CHECK: ; %bb.0: ; %entry
55 ; CHECK-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
56 ; CHECK-NEXT: s_load_dwordx8 s[4:11], s[6:7], 0x0
57 ; CHECK-NEXT: s_waitcnt lgkmcnt(0)
58 ; CHECK-NEXT: v_mov_b32_e32 v2, s8
59 ; CHECK-NEXT: v_mov_b32_e32 v3, s9
60 ; CHECK-NEXT: v_mov_b32_e32 v4, s10
61 ; CHECK-NEXT: v_mov_b32_e32 v5, s11
62 ; CHECK-NEXT: v_mov_b32_e32 v9, s7
63 ; CHECK-NEXT: v_mov_b32_e32 v8, s6
64 ; CHECK-NEXT: v_mov_b32_e32 v7, s5
65 ; CHECK-NEXT: v_mov_b32_e32 v6, s4
66 ; CHECK-NEXT: global_store_dwordx4 v[0:1], v[2:5], off offset:16
67 ; CHECK-NEXT: global_store_dwordx4 v[0:1], v[6:9], off
68 ; CHECK-NEXT: s_setpc_b64 s[30:31]
70 tail call void @llvm.memmove.p1.p4.i64(ptr addrspace(1) noundef nonnull align 4 %dst, ptr addrspace(4) noundef nonnull align 4 %src, i64 32, i1 false)
74 declare void @llvm.memmove.p1.p4.i64(ptr addrspace(1) nocapture writeonly, ptr addrspace(4) nocapture readonly, i64, i1 immarg) #2
76 attributes #0 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }