2018-10-30 05:07:27 +08:00
|
|
|
; RUN: llc -mtriple=amdgcn--amdhsa -mcpu=kaveri -mattr=-code-object-v3 -verify-machineinstrs < %s | FileCheck -check-prefix=GCN %s
|
2016-01-12 05:18:33 +08:00
|
|
|
; RUN: not llc -mtriple=amdgcn-unknown-unknown -mcpu=kaveri -verify-machineinstrs < %s 2>&1 | FileCheck -check-prefix=ERROR %s
|
|
|
|
|
2016-02-02 21:52:43 +08:00
|
|
|
; ERROR: in function test{{.*}}: unsupported hsa intrinsic without hsa target
|
2015-11-26 08:43:29 +08:00
|
|
|
|
|
|
|
; GCN-LABEL: {{^}}test:
|
|
|
|
; GCN: enable_sgpr_dispatch_ptr = 1
|
2015-12-01 05:16:03 +08:00
|
|
|
; GCN: s_load_dword s{{[0-9]+}}, s[4:5], 0x0
|
2017-03-22 05:39:51 +08:00
|
|
|
define amdgpu_kernel void @test(i32 addrspace(1)* %out) {
|
2018-02-14 02:00:25 +08:00
|
|
|
%dispatch_ptr = call noalias i8 addrspace(4)* @llvm.amdgcn.dispatch.ptr() #0
|
|
|
|
%header_ptr = bitcast i8 addrspace(4)* %dispatch_ptr to i32 addrspace(4)*
|
|
|
|
%value = load i32, i32 addrspace(4)* %header_ptr
|
2015-11-26 08:43:29 +08:00
|
|
|
store i32 %value, i32 addrspace(1)* %out
|
|
|
|
ret void
|
|
|
|
}
|
|
|
|
|
2018-02-14 02:00:25 +08:00
|
|
|
declare noalias i8 addrspace(4)* @llvm.amdgcn.dispatch.ptr() #0
|
2015-11-26 08:43:29 +08:00
|
|
|
|
|
|
|
attributes #0 = { readnone }
|