2017-04-25 03:40:59 +08:00
|
|
|
; RUN: llc -mtriple=amdgcn--amdhsa -mcpu=fiji -verify-machineinstrs < %s | FileCheck -enable-var-scope -check-prefix=GCN -check-prefix=VI -check-prefix=OPT %s
|
|
|
|
; RUN: llc -mtriple=amdgcn--amdhsa -mcpu=hawaii -verify-machineinstrs < %s | FileCheck -enable-var-scope -check-prefix=GCN -check-prefix=CI -check-prefix=OPT %s
|
2017-08-17 12:04:11 +08:00
|
|
|
; RUN: llc -mtriple=amdgcn--amdhsa -mcpu=iceland -verify-machineinstrs < %s | FileCheck -enable-var-scope -check-prefix=GCN -check-prefix=VI -check-prefix=OPT %s
|
2017-04-25 03:40:59 +08:00
|
|
|
; RUN: llc -O0 -mtriple=amdgcn--amdhsa -mcpu=fiji -verify-machineinstrs < %s | FileCheck -enable-var-scope -check-prefix=GCN -check-prefix=OPTNONE %s
|
2016-10-29 03:43:31 +08:00
|
|
|
|
|
|
|
; There are no stack objects, but still a private memory access. The
|
|
|
|
; private access regiters need to be correctly initialized anyway, and
|
|
|
|
; shifted down to the end of the used registers.
|
2016-10-13 21:10:00 +08:00
|
|
|
|
|
|
|
; GCN-LABEL: {{^}}store_to_undef:
|
2017-08-17 12:04:11 +08:00
|
|
|
; OPT-DAG: s_mov_b64 s{{\[}}[[RSRC_LO:[0-9]+]]:{{[0-9]+\]}}, s[0:1]
|
|
|
|
; OPT-DAG: s_mov_b64 s{{\[[0-9]+}}:[[RSRC_HI:[0-9]+]]{{\]}}, s[2:3]
|
|
|
|
; OPT-DAG: s_mov_b32 [[SOFFSET:s[0-9]+]], s5{{$}}
|
|
|
|
; OPT: buffer_store_dword v{{[0-9]+}}, v{{[0-9]+}}, s{{\[}}[[RSRC_LO]]:[[RSRC_HI]]{{\]}}, [[SOFFSET]] offen{{$}}
|
2016-10-13 21:10:00 +08:00
|
|
|
|
|
|
|
; -O0 should assume spilling, so the input scratch resource descriptor
|
|
|
|
; -should be used directly without any copies.
|
|
|
|
|
|
|
|
; OPTNONE-NOT: s_mov_b32
|
2017-07-14 08:11:13 +08:00
|
|
|
; OPTNONE: buffer_store_dword v{{[0-9]+}}, v{{[0-9]+}}, s[0:3], s5 offen{{$}}
|
2017-03-22 05:39:51 +08:00
|
|
|
define amdgpu_kernel void @store_to_undef() #0 {
|
2016-10-13 21:10:00 +08:00
|
|
|
store volatile i32 0, i32* undef
|
|
|
|
ret void
|
|
|
|
}
|
|
|
|
|
|
|
|
; GCN-LABEL: {{^}}store_to_inttoptr:
|
2017-08-17 12:04:11 +08:00
|
|
|
; OPT-DAG: s_mov_b64 s{{\[}}[[RSRC_LO:[0-9]+]]:{{[0-9]+\]}}, s[0:1]
|
|
|
|
; OPT-DAG: s_mov_b64 s{{\[[0-9]+}}:[[RSRC_HI:[0-9]+]]{{\]}}, s[2:3]
|
|
|
|
; OPT-DAG: s_mov_b32 [[SOFFSET:s[0-9]+]], s5{{$}}
|
|
|
|
; OPT: buffer_store_dword v{{[0-9]+}}, off, s{{\[}}[[RSRC_LO]]:[[RSRC_HI]]{{\]}}, [[SOFFSET]] offset:124{{$}}
|
2017-03-22 05:39:51 +08:00
|
|
|
define amdgpu_kernel void @store_to_inttoptr() #0 {
|
2017-04-25 03:40:59 +08:00
|
|
|
store volatile i32 0, i32* inttoptr (i32 124 to i32*)
|
2016-10-13 21:10:00 +08:00
|
|
|
ret void
|
|
|
|
}
|
|
|
|
|
|
|
|
; GCN-LABEL: {{^}}load_from_undef:
|
2017-08-17 12:04:11 +08:00
|
|
|
; OPT-DAG: s_mov_b64 s{{\[}}[[RSRC_LO:[0-9]+]]:{{[0-9]+\]}}, s[0:1]
|
|
|
|
; OPT-DAG: s_mov_b64 s{{\[[0-9]+}}:[[RSRC_HI:[0-9]+]]{{\]}}, s[2:3]
|
|
|
|
; OPT-DAG: s_mov_b32 [[SOFFSET:s[0-9]+]], s5{{$}}
|
|
|
|
; OPT: buffer_load_dword v{{[0-9]+}}, v{{[0-9]+}}, s{{\[}}[[RSRC_LO]]:[[RSRC_HI]]{{\]}}, [[SOFFSET]] offen{{$}}
|
2017-03-22 05:39:51 +08:00
|
|
|
define amdgpu_kernel void @load_from_undef() #0 {
|
2016-10-13 21:10:00 +08:00
|
|
|
%ld = load volatile i32, i32* undef
|
|
|
|
ret void
|
|
|
|
}
|
|
|
|
|
|
|
|
; GCN-LABEL: {{^}}load_from_inttoptr:
|
2017-08-17 12:04:11 +08:00
|
|
|
; OPT-DAG: s_mov_b64 s{{\[}}[[RSRC_LO:[0-9]+]]:{{[0-9]+\]}}, s[0:1]
|
|
|
|
; OPT-DAG: s_mov_b64 s{{\[[0-9]+}}:[[RSRC_HI:[0-9]+]]{{\]}}, s[2:3]
|
|
|
|
; OPT-DAG: s_mov_b32 [[SOFFSET:s[0-9]+]], s5{{$}}
|
|
|
|
; OPT: buffer_load_dword v{{[0-9]+}}, off, s{{\[}}[[RSRC_LO]]:[[RSRC_HI]]{{\]}}, [[SOFFSET]] offset:124{{$}}
|
2017-03-22 05:39:51 +08:00
|
|
|
define amdgpu_kernel void @load_from_inttoptr() #0 {
|
2017-04-25 03:40:59 +08:00
|
|
|
%ld = load volatile i32, i32* inttoptr (i32 124 to i32*)
|
2016-10-13 21:10:00 +08:00
|
|
|
ret void
|
|
|
|
}
|
|
|
|
|
|
|
|
attributes #0 = { nounwind }
|