2018-02-14 04:03:32 +08:00
|
|
|
; RUN: llc -mtriple=amdgcn-amd- -mcpu=gfx600 -verify-machineinstrs < %s | FileCheck -check-prefixes=FUNC,GCN,GFX6,GFX68 %s
|
|
|
|
; RUN: llc -mtriple=amdgcn-amd- -mcpu=gfx803 -verify-machineinstrs < %s | FileCheck -check-prefixes=FUNC,GCN,GFX8,GFX68 %s
|
|
|
|
; RUN: llc -mtriple=amdgcn-amd-amdhsa -mcpu=gfx803 -verify-machineinstrs < %s | FileCheck -check-prefixes=FUNC,GCN,GFX8,GFX68 %s
|
2017-07-22 05:19:23 +08:00
|
|
|
|
2018-02-14 04:03:32 +08:00
|
|
|
; FUNC-LABEL: {{^}}system_acquire:
|
2017-12-05 01:18:51 +08:00
|
|
|
; GCN: %bb.0
|
2017-07-22 05:19:23 +08:00
|
|
|
; GCN-NOT: ATOMIC_FENCE
|
|
|
|
; GFX6: s_waitcnt vmcnt(0){{$}}
|
|
|
|
; GFX6-NEXT: buffer_wbinvl1{{$}}
|
|
|
|
; GFX8: s_waitcnt vmcnt(0){{$}}
|
|
|
|
; GFX8-NEXT: buffer_wbinvl1_vol{{$}}
|
|
|
|
; GCN: s_endpgm
|
|
|
|
define amdgpu_kernel void @system_acquire() {
|
|
|
|
entry:
|
|
|
|
fence acquire
|
|
|
|
ret void
|
|
|
|
}
|
|
|
|
|
2018-02-14 04:03:32 +08:00
|
|
|
; FUNC-LABEL: {{^}}system_release:
|
2017-12-05 01:18:51 +08:00
|
|
|
; GCN: %bb.0
|
2017-07-22 05:19:23 +08:00
|
|
|
; GCN-NOT: ATOMIC_FENCE
|
|
|
|
; GCN: s_waitcnt vmcnt(0){{$}}
|
|
|
|
; GCN: s_endpgm
|
|
|
|
define amdgpu_kernel void @system_release() {
|
|
|
|
entry:
|
|
|
|
fence release
|
|
|
|
ret void
|
|
|
|
}
|
|
|
|
|
2018-02-14 04:03:32 +08:00
|
|
|
; FUNC-LABEL: {{^}}system_acq_rel:
|
2017-12-05 01:18:51 +08:00
|
|
|
; GCN: %bb.0
|
2017-07-22 05:19:23 +08:00
|
|
|
; GCN-NOT: ATOMIC_FENCE
|
|
|
|
; GCN: s_waitcnt vmcnt(0){{$}}
|
|
|
|
; GFX6: buffer_wbinvl1{{$}}
|
|
|
|
; GFX8: buffer_wbinvl1_vol{{$}}
|
|
|
|
; GCN: s_endpgm
|
|
|
|
define amdgpu_kernel void @system_acq_rel() {
|
|
|
|
entry:
|
|
|
|
fence acq_rel
|
|
|
|
ret void
|
|
|
|
}
|
|
|
|
|
2018-02-14 04:03:32 +08:00
|
|
|
; FUNC-LABEL: {{^}}system_seq_cst:
|
2017-12-05 01:18:51 +08:00
|
|
|
; GCN: %bb.0
|
2017-07-22 05:19:23 +08:00
|
|
|
; GCN-NOT: ATOMIC_FENCE
|
|
|
|
; GCN: s_waitcnt vmcnt(0){{$}}
|
|
|
|
; GFX6: buffer_wbinvl1{{$}}
|
|
|
|
; GFX8: buffer_wbinvl1_vol{{$}}
|
|
|
|
; GCN: s_endpgm
|
|
|
|
define amdgpu_kernel void @system_seq_cst() {
|
|
|
|
entry:
|
|
|
|
fence seq_cst
|
|
|
|
ret void
|
|
|
|
}
|
|
|
|
|
2018-02-14 04:03:32 +08:00
|
|
|
; FUNC-LABEL: {{^}}singlethread_acquire:
|
2017-12-05 01:18:51 +08:00
|
|
|
; GCN: %bb.0
|
2017-07-22 05:19:23 +08:00
|
|
|
; GCN-NOT: ATOMIC_FENCE
|
|
|
|
; GCN: s_endpgm
|
|
|
|
define amdgpu_kernel void @singlethread_acquire() {
|
|
|
|
entry:
|
|
|
|
fence syncscope("singlethread") acquire
|
|
|
|
ret void
|
|
|
|
}
|
|
|
|
|
2018-02-14 04:03:32 +08:00
|
|
|
; FUNC-LABEL: {{^}}singlethread_release:
|
2017-12-05 01:18:51 +08:00
|
|
|
; GCN: %bb.0
|
2017-07-22 05:19:23 +08:00
|
|
|
; GCN-NOT: ATOMIC_FENCE
|
|
|
|
; GCN: s_endpgm
|
|
|
|
define amdgpu_kernel void @singlethread_release() {
|
|
|
|
entry:
|
|
|
|
fence syncscope("singlethread") release
|
|
|
|
ret void
|
|
|
|
}
|
|
|
|
|
2018-02-14 04:03:32 +08:00
|
|
|
; FUNC-LABEL: {{^}}singlethread_acq_rel:
|
2017-12-05 01:18:51 +08:00
|
|
|
; GCN: %bb.0
|
2017-07-22 05:19:23 +08:00
|
|
|
; GCN-NOT: ATOMIC_FENCE
|
|
|
|
; GCN: s_endpgm
|
|
|
|
define amdgpu_kernel void @singlethread_acq_rel() {
|
|
|
|
entry:
|
|
|
|
fence syncscope("singlethread") acq_rel
|
|
|
|
ret void
|
|
|
|
}
|
|
|
|
|
2018-02-14 04:03:32 +08:00
|
|
|
; FUNC-LABEL: {{^}}singlethread_seq_cst:
|
2017-12-05 01:18:51 +08:00
|
|
|
; GCN: %bb.0
|
2017-07-22 05:19:23 +08:00
|
|
|
; GCN-NOT: ATOMIC_FENCE
|
|
|
|
; GCN: s_endpgm
|
|
|
|
define amdgpu_kernel void @singlethread_seq_cst() {
|
|
|
|
entry:
|
|
|
|
fence syncscope("singlethread") seq_cst
|
|
|
|
ret void
|
|
|
|
}
|
|
|
|
|
2018-02-14 04:03:32 +08:00
|
|
|
; FUNC-LABEL: {{^}}agent_acquire:
|
2017-12-05 01:18:51 +08:00
|
|
|
; GCN: %bb.0
|
2017-07-22 05:19:23 +08:00
|
|
|
; GCN-NOT: ATOMIC_FENCE
|
|
|
|
; GFX6: s_waitcnt vmcnt(0){{$}}
|
|
|
|
; GFX6-NEXT: buffer_wbinvl1{{$}}
|
|
|
|
; GFX8: s_waitcnt vmcnt(0){{$}}
|
|
|
|
; GFX8-NEXT: buffer_wbinvl1_vol{{$}}
|
|
|
|
; GCN: s_endpgm
|
|
|
|
define amdgpu_kernel void @agent_acquire() {
|
|
|
|
entry:
|
|
|
|
fence syncscope("agent") acquire
|
|
|
|
ret void
|
|
|
|
}
|
|
|
|
|
2018-02-14 04:03:32 +08:00
|
|
|
; FUNC-LABEL: {{^}}agent_release:
|
2017-12-05 01:18:51 +08:00
|
|
|
; GCN: %bb.0
|
2017-07-22 05:19:23 +08:00
|
|
|
; GCN-NOT: ATOMIC_FENCE
|
|
|
|
; GCN: s_waitcnt vmcnt(0){{$}}
|
|
|
|
; GCN: s_endpgm
|
|
|
|
define amdgpu_kernel void @agent_release() {
|
|
|
|
entry:
|
|
|
|
fence syncscope("agent") release
|
|
|
|
ret void
|
|
|
|
}
|
|
|
|
|
2018-02-14 04:03:32 +08:00
|
|
|
; FUNC-LABEL: {{^}}agent_acq_rel:
|
2017-12-05 01:18:51 +08:00
|
|
|
; GCN: %bb.0
|
2017-07-22 05:19:23 +08:00
|
|
|
; GCN-NOT: ATOMIC_FENCE
|
|
|
|
; GCN: s_waitcnt vmcnt(0){{$}}
|
|
|
|
; GFX6: buffer_wbinvl1{{$}}
|
|
|
|
; GFX8: buffer_wbinvl1_vol{{$}}
|
|
|
|
; GCN: s_endpgm
|
|
|
|
define amdgpu_kernel void @agent_acq_rel() {
|
|
|
|
entry:
|
|
|
|
fence syncscope("agent") acq_rel
|
|
|
|
ret void
|
|
|
|
}
|
|
|
|
|
2018-02-14 04:03:32 +08:00
|
|
|
; FUNC-LABEL: {{^}}agent_seq_cst:
|
2017-12-05 01:18:51 +08:00
|
|
|
; GCN: %bb.0
|
2017-07-22 05:19:23 +08:00
|
|
|
; GCN-NOT: ATOMIC_FENCE
|
|
|
|
; GCN: s_waitcnt vmcnt(0){{$}}
|
|
|
|
; GFX6: buffer_wbinvl1{{$}}
|
|
|
|
; GFX8: buffer_wbinvl1_vol{{$}}
|
|
|
|
; GCN: s_endpgm
|
|
|
|
define amdgpu_kernel void @agent_seq_cst() {
|
|
|
|
entry:
|
|
|
|
fence syncscope("agent") seq_cst
|
|
|
|
ret void
|
|
|
|
}
|
|
|
|
|
2018-02-14 04:03:32 +08:00
|
|
|
; FUNC-LABEL: {{^}}workgroup_acquire:
|
2017-12-05 01:18:51 +08:00
|
|
|
; GCN: %bb.0
|
2018-02-14 04:03:32 +08:00
|
|
|
; GFX68-NOT: s_waitcnt vmcnt(0){{$}}
|
2017-07-22 05:19:23 +08:00
|
|
|
; GCN-NOT: ATOMIC_FENCE
|
|
|
|
; GCN: s_endpgm
|
|
|
|
define amdgpu_kernel void @workgroup_acquire() {
|
|
|
|
entry:
|
|
|
|
fence syncscope("workgroup") acquire
|
|
|
|
ret void
|
|
|
|
}
|
|
|
|
|
2018-02-14 04:03:32 +08:00
|
|
|
; FUNC-LABEL: {{^}}workgroup_release:
|
2017-12-05 01:18:51 +08:00
|
|
|
; GCN: %bb.0
|
2018-02-14 04:03:32 +08:00
|
|
|
; GFX68-NOT: s_waitcnt vmcnt(0){{$}}
|
2017-07-22 05:19:23 +08:00
|
|
|
; GCN-NOT: ATOMIC_FENCE
|
|
|
|
; GCN: s_endpgm
|
|
|
|
define amdgpu_kernel void @workgroup_release() {
|
|
|
|
entry:
|
|
|
|
fence syncscope("workgroup") release
|
|
|
|
ret void
|
|
|
|
}
|
|
|
|
|
2018-02-14 04:03:32 +08:00
|
|
|
; FUNC-LABEL: {{^}}workgroup_acq_rel:
|
2017-12-05 01:18:51 +08:00
|
|
|
; GCN: %bb.0
|
2018-02-14 04:03:32 +08:00
|
|
|
; GFX68-NOT: s_waitcnt vmcnt(0){{$}}
|
2017-07-22 05:19:23 +08:00
|
|
|
; GCN-NOT: ATOMIC_FENCE
|
|
|
|
; GCN: s_endpgm
|
|
|
|
define amdgpu_kernel void @workgroup_acq_rel() {
|
|
|
|
entry:
|
|
|
|
fence syncscope("workgroup") acq_rel
|
|
|
|
ret void
|
|
|
|
}
|
|
|
|
|
2018-02-14 04:03:32 +08:00
|
|
|
; FUNC-LABEL: {{^}}workgroup_seq_cst:
|
2017-12-05 01:18:51 +08:00
|
|
|
; GCN: %bb.0
|
2018-02-14 04:03:32 +08:00
|
|
|
; GFX68-NOT: s_waitcnt vmcnt(0){{$}}
|
2017-07-22 05:19:23 +08:00
|
|
|
; GCN-NOT: ATOMIC_FENCE
|
|
|
|
; GCN: s_endpgm
|
|
|
|
define amdgpu_kernel void @workgroup_seq_cst() {
|
|
|
|
entry:
|
|
|
|
fence syncscope("workgroup") seq_cst
|
|
|
|
ret void
|
|
|
|
}
|
|
|
|
|
2018-02-14 04:03:32 +08:00
|
|
|
; FUNC-LABEL: {{^}}wavefront_acquire:
|
2017-12-05 01:18:51 +08:00
|
|
|
; GCN: %bb.0
|
2017-07-22 05:19:23 +08:00
|
|
|
; GCN-NOT: ATOMIC_FENCE
|
|
|
|
; GCN: s_endpgm
|
|
|
|
define amdgpu_kernel void @wavefront_acquire() {
|
|
|
|
entry:
|
|
|
|
fence syncscope("wavefront") acquire
|
|
|
|
ret void
|
|
|
|
}
|
|
|
|
|
2018-02-14 04:03:32 +08:00
|
|
|
; FUNC-LABEL: {{^}}wavefront_release:
|
2017-12-05 01:18:51 +08:00
|
|
|
; GCN: %bb.0
|
2017-07-22 05:19:23 +08:00
|
|
|
; GCN-NOT: ATOMIC_FENCE
|
|
|
|
; GCN: s_endpgm
|
|
|
|
define amdgpu_kernel void @wavefront_release() {
|
|
|
|
entry:
|
|
|
|
fence syncscope("wavefront") release
|
|
|
|
ret void
|
|
|
|
}
|
|
|
|
|
2018-02-14 04:03:32 +08:00
|
|
|
; FUNC-LABEL: {{^}}wavefront_acq_rel:
|
2017-12-05 01:18:51 +08:00
|
|
|
; GCN: %bb.0
|
2017-07-22 05:19:23 +08:00
|
|
|
; GCN-NOT: ATOMIC_FENCE
|
|
|
|
; GCN: s_endpgm
|
|
|
|
define amdgpu_kernel void @wavefront_acq_rel() {
|
|
|
|
entry:
|
|
|
|
fence syncscope("wavefront") acq_rel
|
|
|
|
ret void
|
|
|
|
}
|
|
|
|
|
2018-02-14 04:03:32 +08:00
|
|
|
; FUNC-LABEL: {{^}}wavefront_seq_cst:
|
2017-12-05 01:18:51 +08:00
|
|
|
; GCN: %bb.0
|
2017-07-22 05:19:23 +08:00
|
|
|
; GCN-NOT: ATOMIC_FENCE
|
|
|
|
; GCN: s_endpgm
|
|
|
|
define amdgpu_kernel void @wavefront_seq_cst() {
|
|
|
|
entry:
|
|
|
|
fence syncscope("wavefront") seq_cst
|
|
|
|
ret void
|
|
|
|
}
|