1 ; RUN: llc -mtriple=amdgcn-amd-amdhsa -mcpu=gfx900 -verify-machineinstrs -o /dev/null 2>&1 %s | FileCheck -check-prefix=ERR %s
3 ; ERR: warning: inline asm clobber list contains reserved registers: v42
4 ; ERR: note: Reserved registers on the clobber list may not be preserved across the asm statement, and clobbering them may lead to undefined behaviour.
5 define amdgpu_kernel void @clobber_occupancy_limited_vgpr() #0 {
7 call void asm sideeffect "; clobber $0", "~{v42}"()
11 ; ERR: warning: inline asm clobber list contains reserved registers: v[42:43]
12 ; ERR: note: Reserved registers on the clobber list may not be preserved across the asm statement, and clobbering them may lead to undefined behaviour.
13 define amdgpu_kernel void @clobber_occupancy_limited_vgpr64() #0 {
15 call void asm sideeffect "; clobber $0", "~{v[42:43]}"()
19 ; ERR: warning: inline asm clobber list contains reserved registers: m0
20 ; ERR: note: Reserved registers on the clobber list may not be preserved across the asm statement, and clobbering them may lead to undefined behaviour.
21 define amdgpu_kernel void @clobber_m0() {
23 call void asm sideeffect "; clobber $0", "~{m0}"()
27 ; ERR: warning: inline asm clobber list contains reserved registers: exec
28 ; ERR: note: Reserved registers on the clobber list may not be preserved across the asm statement, and clobbering them may lead to undefined behaviour.
29 define amdgpu_kernel void @clobber_exec() {
31 call void asm sideeffect "; clobber $0", "~{exec}"()
35 ; ERR: warning: inline asm clobber list contains reserved registers: exec_lo
36 ; ERR: note: Reserved registers on the clobber list may not be preserved across the asm statement, and clobbering them may lead to undefined behaviour.
37 define amdgpu_kernel void @clobber_exec_lo() {
39 call void asm sideeffect "; clobber $0", "~{exec_lo}"()
43 ; FIXME: This should warn too
45 define amdgpu_kernel void @def_exec(ptr addrspace(1) %ptr) {
47 %exec = call i64 asm sideeffect "; def $0", "={exec}"()
48 store i64 %exec, ptr addrspace(1) %ptr
52 attributes #0 = { "amdgpu-waves-per-eu"="10,10" }