2018-02-14 04:03:32 +08:00
|
|
|
; RUN: llc -mtriple=amdgcn-amd- -mcpu=gfx803 -verify-machineinstrs < %s | FileCheck --check-prefixes=GCN,GFX8,GFX89 %s
|
|
|
|
; RUN: llc -mtriple=amdgcn-amd-amdhsa -mcpu=gfx803 -verify-machineinstrs < %s | FileCheck --check-prefixes=GCN,GFX8,GFX89 %s
|
2018-12-01 02:29:17 +08:00
|
|
|
; RUN: llc -mtriple=amdgcn-amd- -mcpu=gfx900 -verify-machineinstrs -amdgpu-enable-global-sgpr-addr < %s | FileCheck --check-prefixes=GCN,GFX9,GFX89 %s
|
|
|
|
; RUN: llc -mtriple=amdgcn-amd-amdhsa -mcpu=gfx900 -verify-machineinstrs -amdgpu-enable-global-sgpr-addr < %s | FileCheck --check-prefixes=GCN,GFX9,GFX89 %s
|
2017-07-22 05:19:23 +08:00
|
|
|
|
2017-10-26 01:04:46 +08:00
|
|
|
declare i32 @llvm.amdgcn.workitem.id.x()
|
|
|
|
|
2018-02-14 04:03:32 +08:00
|
|
|
; GCN-LABEL: {{^}}system_unordered:
|
2017-10-26 01:04:46 +08:00
|
|
|
; GCN-NOT: s_waitcnt vmcnt(0){{$}}
|
|
|
|
; GCN: flat_store_dword v[{{[0-9]+}}:{{[0-9]+}}], {{v[0-9]+}}{{$}}
|
2017-07-22 05:19:23 +08:00
|
|
|
define amdgpu_kernel void @system_unordered(
|
2018-02-03 00:07:16 +08:00
|
|
|
i32 %in, i32* %out) {
|
2017-07-22 05:19:23 +08:00
|
|
|
entry:
|
2018-02-03 00:07:16 +08:00
|
|
|
store atomic i32 %in, i32* %out unordered, align 4
|
2017-07-22 05:19:23 +08:00
|
|
|
ret void
|
|
|
|
}
|
|
|
|
|
2018-02-14 04:03:32 +08:00
|
|
|
; GCN-LABEL: {{^}}system_monotonic:
|
2017-10-26 01:04:46 +08:00
|
|
|
; GCN-NOT: s_waitcnt vmcnt(0){{$}}
|
|
|
|
; GCN: flat_store_dword v[{{[0-9]+}}:{{[0-9]+}}], {{v[0-9]+}}{{$}}
|
2017-07-22 05:19:23 +08:00
|
|
|
define amdgpu_kernel void @system_monotonic(
|
2018-02-03 00:07:16 +08:00
|
|
|
i32 %in, i32* %out) {
|
2017-07-22 05:19:23 +08:00
|
|
|
entry:
|
2018-02-03 00:07:16 +08:00
|
|
|
store atomic i32 %in, i32* %out monotonic, align 4
|
2017-07-22 05:19:23 +08:00
|
|
|
ret void
|
|
|
|
}
|
|
|
|
|
2018-02-14 04:03:32 +08:00
|
|
|
; GCN-LABEL: {{^}}system_release:
|
|
|
|
; GCN: s_waitcnt vmcnt(0){{$}}
|
|
|
|
; GCN-NEXT: flat_store_dword v[{{[0-9]+}}:{{[0-9]+}}], {{v[0-9]+}}{{$}}
|
2017-07-22 05:19:23 +08:00
|
|
|
define amdgpu_kernel void @system_release(
|
2018-02-03 00:07:16 +08:00
|
|
|
i32 %in, i32* %out) {
|
2017-07-22 05:19:23 +08:00
|
|
|
entry:
|
2018-02-03 00:07:16 +08:00
|
|
|
store atomic i32 %in, i32* %out release, align 4
|
2017-07-22 05:19:23 +08:00
|
|
|
ret void
|
|
|
|
}
|
|
|
|
|
2018-02-14 04:03:32 +08:00
|
|
|
; GCN-LABEL: {{^}}system_seq_cst:
|
|
|
|
; GCN: s_waitcnt vmcnt(0){{$}}
|
|
|
|
; GCN-NEXT: flat_store_dword v[{{[0-9]+}}:{{[0-9]+}}], {{v[0-9]+}}{{$}}
|
2017-07-22 05:19:23 +08:00
|
|
|
define amdgpu_kernel void @system_seq_cst(
|
2018-02-03 00:07:16 +08:00
|
|
|
i32 %in, i32* %out) {
|
2017-07-22 05:19:23 +08:00
|
|
|
entry:
|
2018-02-03 00:07:16 +08:00
|
|
|
store atomic i32 %in, i32* %out seq_cst, align 4
|
2017-07-22 05:19:23 +08:00
|
|
|
ret void
|
|
|
|
}
|
|
|
|
|
2018-02-14 04:03:32 +08:00
|
|
|
; GCN-LABEL: {{^}}singlethread_unordered:
|
2017-10-26 01:04:46 +08:00
|
|
|
; GCN-NOT: s_waitcnt vmcnt(0){{$}}
|
|
|
|
; GCN: flat_store_dword v[{{[0-9]+}}:{{[0-9]+}}], {{v[0-9]+}}{{$}}
|
2017-07-22 05:19:23 +08:00
|
|
|
define amdgpu_kernel void @singlethread_unordered(
|
2018-02-03 00:07:16 +08:00
|
|
|
i32 %in, i32* %out) {
|
2017-07-22 05:19:23 +08:00
|
|
|
entry:
|
2018-02-03 00:07:16 +08:00
|
|
|
store atomic i32 %in, i32* %out syncscope("singlethread") unordered, align 4
|
2017-07-22 05:19:23 +08:00
|
|
|
ret void
|
|
|
|
}
|
|
|
|
|
2018-02-14 04:03:32 +08:00
|
|
|
; GCN-LABEL: {{^}}singlethread_monotonic:
|
2017-10-26 01:04:46 +08:00
|
|
|
; GCN-NOT: s_waitcnt vmcnt(0){{$}}
|
|
|
|
; GCN: flat_store_dword v[{{[0-9]+}}:{{[0-9]+}}], {{v[0-9]+}}{{$}}
|
2017-07-22 05:19:23 +08:00
|
|
|
define amdgpu_kernel void @singlethread_monotonic(
|
2018-02-03 00:07:16 +08:00
|
|
|
i32 %in, i32* %out) {
|
2017-07-22 05:19:23 +08:00
|
|
|
entry:
|
2018-02-03 00:07:16 +08:00
|
|
|
store atomic i32 %in, i32* %out syncscope("singlethread") monotonic, align 4
|
2017-07-22 05:19:23 +08:00
|
|
|
ret void
|
|
|
|
}
|
|
|
|
|
2018-02-14 04:03:32 +08:00
|
|
|
; GCN-LABEL: {{^}}singlethread_release:
|
2017-10-26 01:04:46 +08:00
|
|
|
; GCN-NOT: s_waitcnt vmcnt(0){{$}}
|
|
|
|
; GCN: flat_store_dword v[{{[0-9]+}}:{{[0-9]+}}], {{v[0-9]+}}{{$}}
|
2017-07-22 05:19:23 +08:00
|
|
|
define amdgpu_kernel void @singlethread_release(
|
2018-02-03 00:07:16 +08:00
|
|
|
i32 %in, i32* %out) {
|
2017-07-22 05:19:23 +08:00
|
|
|
entry:
|
2018-02-03 00:07:16 +08:00
|
|
|
store atomic i32 %in, i32* %out syncscope("singlethread") release, align 4
|
2017-07-22 05:19:23 +08:00
|
|
|
ret void
|
|
|
|
}
|
|
|
|
|
2018-02-14 04:03:32 +08:00
|
|
|
; GCN-LABEL: {{^}}singlethread_seq_cst:
|
2017-10-26 01:04:46 +08:00
|
|
|
; GCN-NOT: s_waitcnt vmcnt(0){{$}}
|
|
|
|
; GCN: flat_store_dword v[{{[0-9]+}}:{{[0-9]+}}], {{v[0-9]+}}{{$}}
|
2017-07-22 05:19:23 +08:00
|
|
|
define amdgpu_kernel void @singlethread_seq_cst(
|
2018-02-03 00:07:16 +08:00
|
|
|
i32 %in, i32* %out) {
|
2017-07-22 05:19:23 +08:00
|
|
|
entry:
|
2018-02-03 00:07:16 +08:00
|
|
|
store atomic i32 %in, i32* %out syncscope("singlethread") seq_cst, align 4
|
2017-07-22 05:19:23 +08:00
|
|
|
ret void
|
|
|
|
}
|
|
|
|
|
2018-02-14 04:03:32 +08:00
|
|
|
; GCN-LABEL: {{^}}agent_unordered:
|
2017-10-26 01:04:46 +08:00
|
|
|
; GCN-NOT: s_waitcnt vmcnt(0){{$}}
|
|
|
|
; GCN: flat_store_dword v[{{[0-9]+}}:{{[0-9]+}}], {{v[0-9]+}}{{$}}
|
2017-07-22 05:19:23 +08:00
|
|
|
define amdgpu_kernel void @agent_unordered(
|
2018-02-03 00:07:16 +08:00
|
|
|
i32 %in, i32* %out) {
|
2017-07-22 05:19:23 +08:00
|
|
|
entry:
|
2018-02-03 00:07:16 +08:00
|
|
|
store atomic i32 %in, i32* %out syncscope("agent") unordered, align 4
|
2017-07-22 05:19:23 +08:00
|
|
|
ret void
|
|
|
|
}
|
|
|
|
|
2018-02-14 04:03:32 +08:00
|
|
|
; GCN-LABEL: {{^}}agent_monotonic:
|
2017-10-26 01:04:46 +08:00
|
|
|
; GCN-NOT: s_waitcnt vmcnt(0){{$}}
|
|
|
|
; GCN: flat_store_dword v[{{[0-9]+}}:{{[0-9]+}}], {{v[0-9]+}}{{$}}
|
2017-07-22 05:19:23 +08:00
|
|
|
define amdgpu_kernel void @agent_monotonic(
|
2018-02-03 00:07:16 +08:00
|
|
|
i32 %in, i32* %out) {
|
2017-07-22 05:19:23 +08:00
|
|
|
entry:
|
2018-02-03 00:07:16 +08:00
|
|
|
store atomic i32 %in, i32* %out syncscope("agent") monotonic, align 4
|
2017-07-22 05:19:23 +08:00
|
|
|
ret void
|
|
|
|
}
|
|
|
|
|
2018-02-14 04:03:32 +08:00
|
|
|
; GCN-LABEL: {{^}}agent_release:
|
|
|
|
; GCN: s_waitcnt vmcnt(0){{$}}
|
|
|
|
; GCN-NEXT: flat_store_dword v[{{[0-9]+}}:{{[0-9]+}}], {{v[0-9]+}}{{$}}
|
2017-07-22 05:19:23 +08:00
|
|
|
define amdgpu_kernel void @agent_release(
|
2018-02-03 00:07:16 +08:00
|
|
|
i32 %in, i32* %out) {
|
2017-07-22 05:19:23 +08:00
|
|
|
entry:
|
2018-02-03 00:07:16 +08:00
|
|
|
store atomic i32 %in, i32* %out syncscope("agent") release, align 4
|
2017-07-22 05:19:23 +08:00
|
|
|
ret void
|
|
|
|
}
|
|
|
|
|
2018-02-14 04:03:32 +08:00
|
|
|
; GCN-LABEL: {{^}}agent_seq_cst:
|
|
|
|
; GCN: s_waitcnt vmcnt(0){{$}}
|
|
|
|
; GCN-NEXT: flat_store_dword v[{{[0-9]+}}:{{[0-9]+}}], {{v[0-9]+}}{{$}}
|
2017-07-22 05:19:23 +08:00
|
|
|
define amdgpu_kernel void @agent_seq_cst(
|
2018-02-03 00:07:16 +08:00
|
|
|
i32 %in, i32* %out) {
|
2017-07-22 05:19:23 +08:00
|
|
|
entry:
|
2018-02-03 00:07:16 +08:00
|
|
|
store atomic i32 %in, i32* %out syncscope("agent") seq_cst, align 4
|
2017-07-22 05:19:23 +08:00
|
|
|
ret void
|
|
|
|
}
|
|
|
|
|
2018-02-14 04:03:32 +08:00
|
|
|
; GCN-LABEL: {{^}}workgroup_unordered:
|
2017-10-26 01:04:46 +08:00
|
|
|
; GCN-NOT: s_waitcnt vmcnt(0){{$}}
|
|
|
|
; GCN: flat_store_dword v[{{[0-9]+}}:{{[0-9]+}}], {{v[0-9]+}}{{$}}
|
2017-07-22 05:19:23 +08:00
|
|
|
define amdgpu_kernel void @workgroup_unordered(
|
2018-02-03 00:07:16 +08:00
|
|
|
i32 %in, i32* %out) {
|
2017-07-22 05:19:23 +08:00
|
|
|
entry:
|
2018-02-03 00:07:16 +08:00
|
|
|
store atomic i32 %in, i32* %out syncscope("workgroup") unordered, align 4
|
2017-07-22 05:19:23 +08:00
|
|
|
ret void
|
|
|
|
}
|
|
|
|
|
2018-02-14 04:03:32 +08:00
|
|
|
; GCN-LABEL: {{^}}workgroup_monotonic:
|
2017-10-26 01:04:46 +08:00
|
|
|
; GCN-NOT: s_waitcnt vmcnt(0){{$}}
|
|
|
|
; GCN: flat_store_dword v[{{[0-9]+}}:{{[0-9]+}}], {{v[0-9]+}}{{$}}
|
2017-07-22 05:19:23 +08:00
|
|
|
define amdgpu_kernel void @workgroup_monotonic(
|
2018-02-03 00:07:16 +08:00
|
|
|
i32 %in, i32* %out) {
|
2017-07-22 05:19:23 +08:00
|
|
|
entry:
|
2018-02-03 00:07:16 +08:00
|
|
|
store atomic i32 %in, i32* %out syncscope("workgroup") monotonic, align 4
|
2017-07-22 05:19:23 +08:00
|
|
|
ret void
|
|
|
|
}
|
|
|
|
|
2018-02-14 04:03:32 +08:00
|
|
|
; GCN-LABEL: {{^}}workgroup_release:
|
|
|
|
; GFX89-NOT: s_waitcnt vmcnt(0){{$}}
|
|
|
|
; GCN: flat_store_dword v[{{[0-9]+}}:{{[0-9]+}}], {{v[0-9]+}}{{$}}
|
2017-07-22 05:19:23 +08:00
|
|
|
define amdgpu_kernel void @workgroup_release(
|
2018-02-03 00:07:16 +08:00
|
|
|
i32 %in, i32* %out) {
|
2017-07-22 05:19:23 +08:00
|
|
|
entry:
|
2018-02-03 00:07:16 +08:00
|
|
|
store atomic i32 %in, i32* %out syncscope("workgroup") release, align 4
|
2017-07-22 05:19:23 +08:00
|
|
|
ret void
|
|
|
|
}
|
|
|
|
|
2018-02-14 04:03:32 +08:00
|
|
|
; GCN-LABEL: {{^}}workgroup_seq_cst:
|
|
|
|
; GFX89-NOT: s_waitcnt vmcnt(0){{$}}
|
|
|
|
; GCN: flat_store_dword v[{{[0-9]+}}:{{[0-9]+}}], {{v[0-9]+}}{{$}}
|
2017-07-22 05:19:23 +08:00
|
|
|
define amdgpu_kernel void @workgroup_seq_cst(
|
2018-02-03 00:07:16 +08:00
|
|
|
i32 %in, i32* %out) {
|
2017-07-22 05:19:23 +08:00
|
|
|
entry:
|
2018-02-03 00:07:16 +08:00
|
|
|
store atomic i32 %in, i32* %out syncscope("workgroup") seq_cst, align 4
|
2017-07-22 05:19:23 +08:00
|
|
|
ret void
|
|
|
|
}
|
|
|
|
|
2018-02-14 04:03:32 +08:00
|
|
|
; GCN-LABEL: {{^}}wavefront_unordered:
|
2017-10-26 01:04:46 +08:00
|
|
|
; GCN-NOT: s_waitcnt vmcnt(0){{$}}
|
|
|
|
; GCN: flat_store_dword v[{{[0-9]+}}:{{[0-9]+}}], {{v[0-9]+}}{{$}}
|
2017-07-22 05:19:23 +08:00
|
|
|
define amdgpu_kernel void @wavefront_unordered(
|
2018-02-03 00:07:16 +08:00
|
|
|
i32 %in, i32* %out) {
|
2017-07-22 05:19:23 +08:00
|
|
|
entry:
|
2018-02-03 00:07:16 +08:00
|
|
|
store atomic i32 %in, i32* %out syncscope("wavefront") unordered, align 4
|
2017-07-22 05:19:23 +08:00
|
|
|
ret void
|
|
|
|
}
|
|
|
|
|
2018-02-14 04:03:32 +08:00
|
|
|
; GCN-LABEL: {{^}}wavefront_monotonic:
|
2017-10-26 01:04:46 +08:00
|
|
|
; GCN-NOT: s_waitcnt vmcnt(0){{$}}
|
|
|
|
; GCN: flat_store_dword v[{{[0-9]+}}:{{[0-9]+}}], {{v[0-9]+}}{{$}}
|
2017-07-22 05:19:23 +08:00
|
|
|
define amdgpu_kernel void @wavefront_monotonic(
|
2018-02-03 00:07:16 +08:00
|
|
|
i32 %in, i32* %out) {
|
2017-07-22 05:19:23 +08:00
|
|
|
entry:
|
2018-02-03 00:07:16 +08:00
|
|
|
store atomic i32 %in, i32* %out syncscope("wavefront") monotonic, align 4
|
2017-07-22 05:19:23 +08:00
|
|
|
ret void
|
|
|
|
}
|
|
|
|
|
2018-02-14 04:03:32 +08:00
|
|
|
; GCN-LABEL: {{^}}wavefront_release:
|
2017-10-26 01:04:46 +08:00
|
|
|
; GCN-NOT: s_waitcnt vmcnt(0){{$}}
|
|
|
|
; GCN: flat_store_dword v[{{[0-9]+}}:{{[0-9]+}}], {{v[0-9]+}}{{$}}
|
2017-07-22 05:19:23 +08:00
|
|
|
define amdgpu_kernel void @wavefront_release(
|
2018-02-03 00:07:16 +08:00
|
|
|
i32 %in, i32* %out) {
|
2017-07-22 05:19:23 +08:00
|
|
|
entry:
|
2018-02-03 00:07:16 +08:00
|
|
|
store atomic i32 %in, i32* %out syncscope("wavefront") release, align 4
|
2017-07-22 05:19:23 +08:00
|
|
|
ret void
|
|
|
|
}
|
|
|
|
|
2018-02-14 04:03:32 +08:00
|
|
|
; GCN-LABEL: {{^}}wavefront_seq_cst:
|
2017-10-26 01:04:46 +08:00
|
|
|
; GCN-NOT: s_waitcnt vmcnt(0){{$}}
|
|
|
|
; GCN: flat_store_dword v[{{[0-9]+}}:{{[0-9]+}}], {{v[0-9]+}}{{$}}
|
2017-07-22 05:19:23 +08:00
|
|
|
define amdgpu_kernel void @wavefront_seq_cst(
|
2018-02-03 00:07:16 +08:00
|
|
|
i32 %in, i32* %out) {
|
2017-07-22 05:19:23 +08:00
|
|
|
entry:
|
2018-02-03 00:07:16 +08:00
|
|
|
store atomic i32 %in, i32* %out syncscope("wavefront") seq_cst, align 4
|
2017-07-22 05:19:23 +08:00
|
|
|
ret void
|
|
|
|
}
|
2017-10-26 01:04:46 +08:00
|
|
|
|
2018-02-14 04:03:32 +08:00
|
|
|
; GCN-LABEL: {{^}}nontemporal_private_0:
|
|
|
|
; GFX89: buffer_store_dword v{{[0-9]+}}, v{{[0-9]+}}, s[{{[0-9]+}}:{{[0-9]+}}], s{{[0-9]+}} offen glc slc{{$}}
|
2017-10-26 01:04:46 +08:00
|
|
|
define amdgpu_kernel void @nontemporal_private_0(
|
2018-02-03 00:07:16 +08:00
|
|
|
i32* %in, i32 addrspace(5)* %out) {
|
2017-10-26 01:04:46 +08:00
|
|
|
entry:
|
2018-02-03 00:07:16 +08:00
|
|
|
%val = load i32, i32* %in, align 4
|
|
|
|
store i32 %val, i32 addrspace(5)* %out, !nontemporal !0
|
2017-10-26 01:04:46 +08:00
|
|
|
ret void
|
|
|
|
}
|
|
|
|
|
2018-02-14 04:03:32 +08:00
|
|
|
; GCN-LABEL: {{^}}nontemporal_private_1:
|
|
|
|
; GFX89: buffer_store_dword v{{[0-9]+}}, v{{[0-9]+}}, s[{{[0-9]+}}:{{[0-9]+}}], s{{[0-9]+}} offen glc slc{{$}}
|
2017-10-26 01:04:46 +08:00
|
|
|
define amdgpu_kernel void @nontemporal_private_1(
|
2018-02-03 00:07:16 +08:00
|
|
|
i32* %in, i32 addrspace(5)* %out) {
|
2017-10-26 01:04:46 +08:00
|
|
|
entry:
|
|
|
|
%tid = call i32 @llvm.amdgcn.workitem.id.x()
|
2018-02-03 00:07:16 +08:00
|
|
|
%val = load i32, i32* %in, align 4
|
|
|
|
%out.gep = getelementptr inbounds i32, i32 addrspace(5)* %out, i32 %tid
|
|
|
|
store i32 %val, i32 addrspace(5)* %out.gep, !nontemporal !0
|
2017-10-26 01:04:46 +08:00
|
|
|
ret void
|
|
|
|
}
|
|
|
|
|
2018-02-14 04:03:32 +08:00
|
|
|
; GCN-LABEL: {{^}}nontemporal_global_0:
|
|
|
|
; GFX8: flat_store_dword v[{{[0-9]+}}:{{[0-9]+}}], v{{[0-9]+}} glc slc{{$}}
|
|
|
|
; GFX9: global_store_dword v[{{[0-9]+}}:{{[0-9]+}}], v{{[0-9]+}}, off glc slc{{$}}
|
2017-10-26 01:04:46 +08:00
|
|
|
define amdgpu_kernel void @nontemporal_global_0(
|
2018-02-03 00:07:16 +08:00
|
|
|
i32* %in, i32 addrspace(1)* %out) {
|
2017-10-26 01:04:46 +08:00
|
|
|
entry:
|
2018-02-03 00:07:16 +08:00
|
|
|
%val = load i32, i32* %in, align 4
|
2017-10-26 01:04:46 +08:00
|
|
|
store i32 %val, i32 addrspace(1)* %out, !nontemporal !0
|
|
|
|
ret void
|
|
|
|
}
|
|
|
|
|
2018-02-14 04:03:32 +08:00
|
|
|
; GCN-LABEL: {{^}}nontemporal_global_1:
|
|
|
|
; GFX8: flat_store_dword v[{{[0-9]+}}:{{[0-9]+}}], v{{[0-9]+}} glc slc{{$}}
|
2018-11-16 09:13:34 +08:00
|
|
|
; GFX9: global_store_dword v[{{[0-9]+}}:{{[0-9]+}}], v{{[0-9]+}}, s[{{[0-9]+}}:{{[0-9]+}}] glc slc{{$}}
|
2017-10-26 01:04:46 +08:00
|
|
|
define amdgpu_kernel void @nontemporal_global_1(
|
2018-02-03 00:07:16 +08:00
|
|
|
i32* %in, i32 addrspace(1)* %out) {
|
2017-10-26 01:04:46 +08:00
|
|
|
entry:
|
|
|
|
%tid = call i32 @llvm.amdgcn.workitem.id.x()
|
2018-02-03 00:07:16 +08:00
|
|
|
%val = load i32, i32* %in, align 4
|
2017-10-26 01:04:46 +08:00
|
|
|
%out.gep = getelementptr inbounds i32, i32 addrspace(1)* %out, i32 %tid
|
|
|
|
store i32 %val, i32 addrspace(1)* %out.gep, !nontemporal !0
|
|
|
|
ret void
|
|
|
|
}
|
|
|
|
|
2018-02-14 04:03:32 +08:00
|
|
|
; GCN-LABEL: {{^}}nontemporal_local_0:
|
2017-10-26 01:04:46 +08:00
|
|
|
; GCN: ds_write_b32 v{{[0-9]+}}, v{{[0-9]+}}{{$}}
|
|
|
|
define amdgpu_kernel void @nontemporal_local_0(
|
2018-02-03 00:07:16 +08:00
|
|
|
i32* %in, i32 addrspace(3)* %out) {
|
2017-10-26 01:04:46 +08:00
|
|
|
entry:
|
2018-02-03 00:07:16 +08:00
|
|
|
%val = load i32, i32* %in, align 4
|
2017-10-26 01:04:46 +08:00
|
|
|
store i32 %val, i32 addrspace(3)* %out, !nontemporal !0
|
|
|
|
ret void
|
|
|
|
}
|
|
|
|
|
2018-02-14 04:03:32 +08:00
|
|
|
; GCN-LABEL: {{^}}nontemporal_local_1:
|
2017-10-26 01:04:46 +08:00
|
|
|
; GCN: ds_write_b32 v{{[0-9]+}}, v{{[0-9]+}}{{$}}
|
|
|
|
define amdgpu_kernel void @nontemporal_local_1(
|
2018-02-03 00:07:16 +08:00
|
|
|
i32* %in, i32 addrspace(3)* %out) {
|
2017-10-26 01:04:46 +08:00
|
|
|
entry:
|
|
|
|
%tid = call i32 @llvm.amdgcn.workitem.id.x()
|
2018-02-03 00:07:16 +08:00
|
|
|
%val = load i32, i32* %in, align 4
|
2017-10-26 01:04:46 +08:00
|
|
|
%out.gep = getelementptr inbounds i32, i32 addrspace(3)* %out, i32 %tid
|
|
|
|
store i32 %val, i32 addrspace(3)* %out.gep, !nontemporal !0
|
|
|
|
ret void
|
|
|
|
}
|
|
|
|
|
2018-02-14 04:03:32 +08:00
|
|
|
; GCN-LABEL: {{^}}nontemporal_flat_0:
|
|
|
|
; GFX89: flat_store_dword v[{{[0-9]+}}:{{[0-9]+}}], v{{[0-9]+}} glc slc{{$}}
|
2017-10-26 01:04:46 +08:00
|
|
|
define amdgpu_kernel void @nontemporal_flat_0(
|
2018-02-03 00:07:16 +08:00
|
|
|
i32* %in, i32* %out) {
|
2017-10-26 01:04:46 +08:00
|
|
|
entry:
|
2018-02-03 00:07:16 +08:00
|
|
|
%val = load i32, i32* %in, align 4
|
|
|
|
store i32 %val, i32* %out, !nontemporal !0
|
2017-10-26 01:04:46 +08:00
|
|
|
ret void
|
|
|
|
}
|
|
|
|
|
2018-02-14 04:03:32 +08:00
|
|
|
; GCN-LABEL: {{^}}nontemporal_flat_1:
|
|
|
|
; GFX89: flat_store_dword v[{{[0-9]+}}:{{[0-9]+}}], v{{[0-9]+}} glc slc{{$}}
|
2017-10-26 01:04:46 +08:00
|
|
|
define amdgpu_kernel void @nontemporal_flat_1(
|
2018-02-03 00:07:16 +08:00
|
|
|
i32* %in, i32* %out) {
|
2017-10-26 01:04:46 +08:00
|
|
|
entry:
|
|
|
|
%tid = call i32 @llvm.amdgcn.workitem.id.x()
|
2018-02-03 00:07:16 +08:00
|
|
|
%val = load i32, i32* %in, align 4
|
|
|
|
%out.gep = getelementptr inbounds i32, i32* %out, i32 %tid
|
|
|
|
store i32 %val, i32* %out.gep, !nontemporal !0
|
2017-10-26 01:04:46 +08:00
|
|
|
ret void
|
|
|
|
}
|
|
|
|
|
|
|
|
!0 = !{i32 1}
|