123 lines · plain
1; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py2; RUN: llc -mtriple=amdgcn-amd-amdhsa -mcpu=gfx1010 < %s | FileCheck --check-prefixes=GFX10-WGP %s3; RUN: llc -mtriple=amdgcn-amd-amdhsa -mcpu=gfx1100 < %s | FileCheck --check-prefixes=GFX11-WGP %s4; RUN: llc -mtriple=amdgcn-amd-amdhsa -mcpu=gfx1200 < %s | FileCheck --check-prefixes=GFX12-WGP %s5; RUN: llc -mtriple=amdgcn-amd-amdhsa -mcpu=gfx1250 < %s | FileCheck --check-prefixes=GFX1250 %s6 7 8define float @test_barrier_workgroup_local_mmra(ptr addrspace(3) noundef %x, ptr addrspace(3) noundef %y, float %val) {9; GFX10-WGP-LABEL: test_barrier_workgroup_local_mmra:10; GFX10-WGP: ; %bb.0:11; GFX10-WGP-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)12; GFX10-WGP-NEXT: ds_write_b32 v0, v213; GFX10-WGP-NEXT: s_waitcnt lgkmcnt(0)14; GFX10-WGP-NEXT: s_barrier15; GFX10-WGP-NEXT: ds_read_b32 v0, v116; GFX10-WGP-NEXT: s_waitcnt lgkmcnt(0)17; GFX10-WGP-NEXT: s_setpc_b64 s[30:31]18;19; GFX11-WGP-LABEL: test_barrier_workgroup_local_mmra:20; GFX11-WGP: ; %bb.0:21; GFX11-WGP-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)22; GFX11-WGP-NEXT: ds_store_b32 v0, v223; GFX11-WGP-NEXT: s_waitcnt lgkmcnt(0)24; GFX11-WGP-NEXT: s_barrier25; GFX11-WGP-NEXT: ds_load_b32 v0, v126; GFX11-WGP-NEXT: s_waitcnt lgkmcnt(0)27; GFX11-WGP-NEXT: s_setpc_b64 s[30:31]28;29; GFX12-WGP-LABEL: test_barrier_workgroup_local_mmra:30; GFX12-WGP: ; %bb.0:31; GFX12-WGP-NEXT: s_wait_loadcnt_dscnt 0x032; GFX12-WGP-NEXT: s_wait_expcnt 0x033; GFX12-WGP-NEXT: s_wait_samplecnt 0x034; GFX12-WGP-NEXT: s_wait_bvhcnt 0x035; GFX12-WGP-NEXT: s_wait_kmcnt 0x036; GFX12-WGP-NEXT: ds_store_b32 v0, v237; GFX12-WGP-NEXT: s_wait_dscnt 0x038; GFX12-WGP-NEXT: s_barrier_signal -139; GFX12-WGP-NEXT: s_barrier_wait -140; GFX12-WGP-NEXT: ds_load_b32 v0, v141; GFX12-WGP-NEXT: s_wait_dscnt 0x042; GFX12-WGP-NEXT: s_setpc_b64 s[30:31]43;44; GFX1250-LABEL: test_barrier_workgroup_local_mmra:45; GFX1250: ; %bb.0:46; GFX1250-NEXT: s_wait_loadcnt_dscnt 0x047; GFX1250-NEXT: s_wait_kmcnt 0x048; GFX1250-NEXT: ds_store_b32 v0, v249; GFX1250-NEXT: s_wait_dscnt 0x050; GFX1250-NEXT: s_barrier_signal -151; GFX1250-NEXT: s_barrier_wait -152; GFX1250-NEXT: ds_load_b32 v0, v153; GFX1250-NEXT: s_wait_dscnt 0x054; GFX1250-NEXT: s_set_pc_i64 s[30:31]55 store float %val, ptr addrspace(3) %x56 fence syncscope("workgroup") release, !mmra !057 tail call void @llvm.amdgcn.s.barrier()58 fence syncscope("workgroup") acquire, !mmra !059 %ret = load float, ptr addrspace(3) %y60 ret float %ret61}62 63define float @test_barrier_workgroup_global_mmra(ptr addrspace(1) noundef %x, ptr addrspace(1) noundef %y, float %val) {64; GFX10-WGP-LABEL: test_barrier_workgroup_global_mmra:65; GFX10-WGP: ; %bb.0:66; GFX10-WGP-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)67; GFX10-WGP-NEXT: global_store_dword v[0:1], v4, off68; GFX10-WGP-NEXT: s_waitcnt_vscnt null, 0x069; GFX10-WGP-NEXT: s_barrier70; GFX10-WGP-NEXT: buffer_gl0_inv71; GFX10-WGP-NEXT: global_load_dword v0, v[2:3], off72; GFX10-WGP-NEXT: s_waitcnt vmcnt(0)73; GFX10-WGP-NEXT: s_setpc_b64 s[30:31]74;75; GFX11-WGP-LABEL: test_barrier_workgroup_global_mmra:76; GFX11-WGP: ; %bb.0:77; GFX11-WGP-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)78; GFX11-WGP-NEXT: global_store_b32 v[0:1], v4, off79; GFX11-WGP-NEXT: s_waitcnt_vscnt null, 0x080; GFX11-WGP-NEXT: s_barrier81; GFX11-WGP-NEXT: buffer_gl0_inv82; GFX11-WGP-NEXT: global_load_b32 v0, v[2:3], off83; GFX11-WGP-NEXT: s_waitcnt vmcnt(0)84; GFX11-WGP-NEXT: s_setpc_b64 s[30:31]85;86; GFX12-WGP-LABEL: test_barrier_workgroup_global_mmra:87; GFX12-WGP: ; %bb.0:88; GFX12-WGP-NEXT: s_wait_loadcnt_dscnt 0x089; GFX12-WGP-NEXT: s_wait_expcnt 0x090; GFX12-WGP-NEXT: s_wait_samplecnt 0x091; GFX12-WGP-NEXT: s_wait_bvhcnt 0x092; GFX12-WGP-NEXT: s_wait_kmcnt 0x093; GFX12-WGP-NEXT: global_store_b32 v[0:1], v4, off94; GFX12-WGP-NEXT: s_wait_storecnt 0x095; GFX12-WGP-NEXT: s_barrier_signal -196; GFX12-WGP-NEXT: s_barrier_wait -197; GFX12-WGP-NEXT: global_inv scope:SCOPE_SE98; GFX12-WGP-NEXT: global_load_b32 v0, v[2:3], off99; GFX12-WGP-NEXT: s_wait_loadcnt 0x0100; GFX12-WGP-NEXT: s_setpc_b64 s[30:31]101;102; GFX1250-LABEL: test_barrier_workgroup_global_mmra:103; GFX1250: ; %bb.0:104; GFX1250-NEXT: s_wait_loadcnt_dscnt 0x0105; GFX1250-NEXT: s_wait_kmcnt 0x0106; GFX1250-NEXT: global_store_b32 v[0:1], v4, off107; GFX1250-NEXT: s_wait_storecnt 0x0108; GFX1250-NEXT: s_barrier_signal -1109; GFX1250-NEXT: s_barrier_wait -1110; GFX1250-NEXT: global_load_b32 v0, v[2:3], off111; GFX1250-NEXT: s_wait_loadcnt 0x0112; GFX1250-NEXT: s_set_pc_i64 s[30:31]113 store float %val, ptr addrspace(1) %x114 fence syncscope("workgroup") release, !mmra !1115 tail call void @llvm.amdgcn.s.barrier()116 fence syncscope("workgroup") acquire, !mmra !1117 %ret = load float, ptr addrspace(1) %y118 ret float %ret119}120 121!0 = !{!"amdgpu-synchronize-as", !"local"}122!1 = !{!"amdgpu-synchronize-as", !"global"}123