1 # RUN: llc -march=amdgcn -mcpu=gfx940 -verify-machineinstrs -run-pass si-insert-waitcnts -o - %s | FileCheck -check-prefix=GCN %s
3 # GCN-LABEL: name: buffer_load_dword_lds_ds_read
4 # GCN: BUFFER_LOAD_DWORD_LDS_IDXEN
5 # GCN-NEXT: S_WAITCNT 3952
7 # GCN-NEXT: DS_READ_B32_gfx9
9 name: buffer_load_dword_lds_ds_read
13 BUFFER_LOAD_DWORD_LDS_IDXEN $vgpr0, $sgpr0_sgpr1_sgpr2_sgpr3, $sgpr4, 4, 0, 0, implicit $exec, implicit $m0 :: (load (s32) from `ptr addrspace(1) undef` + 4), (store (s32) into `ptr addrspace(3) undef` + 4)
14 $vgpr0 = DS_READ_B32_gfx9 $vgpr1, 0, 0, implicit $m0, implicit $exec :: (load (s32) from `ptr addrspace(3) undef`)
19 # GCN-LABEL: name: buffer_load_dword_lds_vmcnt_1
20 # GCN: BUFFER_LOAD_DWORD_LDS_IDXEN
21 # GCN-NEXT: BUFFER_LOAD_DWORD_IDXEN
22 # GCN-NEXT: S_WAITCNT 3953
24 # GCN-NEXT: DS_READ_B32_gfx9
26 name: buffer_load_dword_lds_vmcnt_1
30 BUFFER_LOAD_DWORD_LDS_IDXEN $vgpr0, $sgpr0_sgpr1_sgpr2_sgpr3, $sgpr4, 4, 0, 0, implicit $exec, implicit $m0 :: (load (s32) from `ptr addrspace(1) undef`), (store (s32) into `ptr addrspace(3) undef`)
31 $vgpr10 = BUFFER_LOAD_DWORD_IDXEN $vgpr0, $sgpr0_sgpr1_sgpr2_sgpr3, $sgpr4, 4, 0, 0, implicit $exec, implicit $m0 :: (load (s32) from `ptr addrspace(1) undef`)
32 $vgpr0 = DS_READ_B32_gfx9 $vgpr1, 0, 0, implicit $m0, implicit $exec :: (load (s32) from `ptr addrspace(3) undef`)
37 # GCN-LABEL: name: buffer_load_dword_lds_flat_read
38 # GCN: BUFFER_LOAD_DWORD_LDS_IDXEN
39 # GCN-NEXT: S_WAITCNT 3952
41 # GCN-NEXT: FLAT_LOAD_DWORD
43 name: buffer_load_dword_lds_flat_read
47 BUFFER_LOAD_DWORD_LDS_IDXEN $vgpr0, $sgpr0_sgpr1_sgpr2_sgpr3, $sgpr4, 4, 0, 0, implicit $exec, implicit $m0 :: (load (s32) from `ptr addrspace(1) undef`), (store (s32) into `ptr addrspace(3) undef`)
48 $vgpr0 = FLAT_LOAD_DWORD $vgpr0_vgpr1, 0, 0, implicit $exec, implicit $flat_scr :: (load (s32) from `ptr undef`)
54 # GCN-LABEL: name: global_load_lds_dword_ds_read
55 # GCN: GLOBAL_LOAD_LDS_DWORD
56 # GCN-NEXT: S_WAITCNT 3952
58 # GCN-NEXT: DS_READ_B32_gfx9
60 name: global_load_lds_dword_ds_read
64 GLOBAL_LOAD_LDS_DWORD $vgpr0_vgpr1, 4, 0, implicit $exec, implicit $m0 :: (load (s32) from `ptr addrspace(1) undef` + 4), (store (s32) into `ptr addrspace(3) undef` + 4)
65 $vgpr0 = DS_READ_B32_gfx9 $vgpr1, 0, 0, implicit $m0, implicit $exec :: (load (s32) from `ptr addrspace(3) undef`)
70 # GCN-LABEL: name: scratch_load_lds_dword_ds_read
71 # GCN: SCRATCH_LOAD_LDS_DWORD
72 # GCN-NEXT: S_WAITCNT 3952
74 # GCN-NEXT: DS_READ_B32_gfx9
76 name: scratch_load_lds_dword_ds_read
80 SCRATCH_LOAD_LDS_DWORD $vgpr0, 4, 0, implicit $exec, implicit $m0 :: (load (s32) from `ptr addrspace(5) undef` + 4), (store (s32) into `ptr addrspace(3) undef` + 4)
81 $vgpr0 = DS_READ_B32_gfx9 $vgpr1, 0, 0, implicit $m0, implicit $exec :: (load (s32) from `ptr addrspace(3) undef`)
86 # GCN-LABEL: name: buffer_store_lds_dword_ds_read
87 # GCN: BUFFER_STORE_LDS_DWORD
88 # GCN-NEXT: DS_READ_B32_gfx9
90 name: buffer_store_lds_dword_ds_read
94 BUFFER_STORE_LDS_DWORD $sgpr0_sgpr1_sgpr2_sgpr3, $sgpr4, 4, 0, 0, implicit $exec, implicit $m0 :: (load (s32) from `ptr addrspace(3) undef` + 4), (store (s32) into `ptr addrspace(1) undef` + 4)
95 $vgpr0 = DS_READ_B32_gfx9 $vgpr1, 0, 0, implicit $m0, implicit $exec :: (load (s32) from `ptr addrspace(3) undef`)
100 # No need to wait before load from VMEM to LDS.
101 # GCN-LABEL: name: series_of_buffer_load_dword_lds_ds_read
102 # GCN: BUFFER_LOAD_DWORD_LDS_IDXEN
103 # GCN-NEXT: BUFFER_LOAD_DWORD_LDS_IDXEN
104 # GCN-NEXT: BUFFER_LOAD_DWORD_LDS_IDXEN
105 # GCN-NEXT: S_WAITCNT 3952
107 # GCN-NEXT: DS_READ_B32_gfx9
109 name: series_of_buffer_load_dword_lds_ds_read
113 BUFFER_LOAD_DWORD_LDS_IDXEN $vgpr0, $sgpr0_sgpr1_sgpr2_sgpr3, $sgpr4, 0, 0, 0, implicit $exec, implicit $m0 :: (load (s32) from `ptr addrspace(1) undef`), (store (s32) into `ptr addrspace(3) undef`)
114 BUFFER_LOAD_DWORD_LDS_IDXEN $vgpr0, $sgpr0_sgpr1_sgpr2_sgpr3, $sgpr4, 4, 0, 0, implicit $exec, implicit $m0 :: (load (s32) from `ptr addrspace(1) undef` + 4), (store (s32) into `ptr addrspace(3) undef` + 4)
115 BUFFER_LOAD_DWORD_LDS_IDXEN $vgpr0, $sgpr0_sgpr1_sgpr2_sgpr3, $sgpr4, 8, 0, 0, implicit $exec, implicit $m0 :: (load (s32) from `ptr addrspace(1) undef` + 8), (store (s32) into `ptr addrspace(3) undef` + 8)
116 $vgpr0 = DS_READ_B32_gfx9 $vgpr1, 0, 0, implicit $m0, implicit $exec :: (load (s32) from `ptr addrspace(3) undef`)