1 ; RUN: llc -march=amdgcn -mcpu=kaveri -verify-machineinstrs < %s | FileCheck -check-prefix=CI -check-prefix=GCN %s
2 ; RUN: llc -march=amdgcn -mcpu=fiji -verify-machineinstrs < %s | FileCheck -check-prefix=VI-NOXNACK -check-prefix=GCN %s
4 ; RUN: llc -march=amdgcn -mcpu=carrizo -mattr=-xnack -verify-machineinstrs < %s | FileCheck -check-prefix=VI-NOXNACK -check-prefix=GCN %s
5 ; RUN: llc -march=amdgcn -mcpu=stoney -mattr=-xnack -verify-machineinstrs < %s | FileCheck -check-prefix=VI-NOXNACK -check-prefix=GCN %s
7 ; RUN: llc -march=amdgcn -mcpu=carrizo -verify-machineinstrs < %s | FileCheck -check-prefix=VI-XNACK -check-prefix=GCN %s
8 ; RUN: llc -march=amdgcn -mcpu=stoney -verify-machineinstrs < %s | FileCheck -check-prefix=VI-XNACK -check-prefix=GCN %s
10 ; RUN: llc -march=amdgcn -mtriple=amdgcn--amdhsa -mcpu=kaveri -mattr=-code-object-v3 -verify-machineinstrs < %s | FileCheck -check-prefix=HSA-CI -check-prefix=GCN %s
11 ; RUN: llc -march=amdgcn -mtriple=amdgcn--amdhsa -mcpu=carrizo -mattr=-code-object-v3,-xnack -verify-machineinstrs < %s | FileCheck -check-prefix=HSA-VI-NOXNACK -check-prefix=GCN %s
12 ; RUN: llc -march=amdgcn -mtriple=amdgcn--amdhsa -mcpu=carrizo -mattr=-code-object-v3,+xnack -verify-machineinstrs < %s | FileCheck -check-prefix=HSA-VI-XNACK -check-prefix=GCN %s
14 ; GCN-LABEL: {{^}}no_vcc_no_flat:
15 ; HSA-CI: is_xnack_enabled = 0
16 ; HSA-VI-NOXNACK: is_xnack_enabled = 0
17 ; HSA-VI-XNACK: is_xnack_enabled = 1
20 ; VI-NOXNACK: ; NumSgprs: 8
21 ; VI-XNACK: ; NumSgprs: 12
22 define amdgpu_kernel void @no_vcc_no_flat() {
24 call void asm sideeffect "", "~{s7}"()
28 ; GCN-LABEL: {{^}}vcc_no_flat:
29 ; HSA-CI: is_xnack_enabled = 0
30 ; HSA-VI-NOXNACK: is_xnack_enabled = 0
31 ; HSA-VI-XNACK: is_xnack_enabled = 1
34 ; VI-NOXNACK: ; NumSgprs: 10
35 ; VI-XNACK: ; NumSgprs: 12
36 define amdgpu_kernel void @vcc_no_flat() {
38 call void asm sideeffect "", "~{s7},~{vcc}"()
42 ; GCN-LABEL: {{^}}no_vcc_flat:
43 ; HSA-CI: is_xnack_enabled = 0
44 ; HSA-VI-NOXNACK: is_xnack_enabled = 0
45 ; HSA-VI-XNACK: is_xnack_enabled = 1
48 ; VI-NOXNACK: ; NumSgprs: 14
49 ; VI-XNACK: ; NumSgprs: 14
50 ; HSA-CI: ; NumSgprs: 12
51 ; HSA-VI-NOXNACK: ; NumSgprs: 14
52 ; HSA-VI-XNACK: ; NumSgprs: 14
53 define amdgpu_kernel void @no_vcc_flat() {
55 call void asm sideeffect "", "~{s7},~{flat_scratch}"()
59 ; GCN-LABEL: {{^}}vcc_flat:
60 ; HSA-NOXNACK: is_xnack_enabled = 0
61 ; HSA-XNACK: is_xnack_enabled = 1
64 ; VI-NOXNACK: ; NumSgprs: 14
65 ; VI-XNACK: ; NumSgprs: 14
66 ; HSA-CI: ; NumSgprs: 12
67 ; HSA-VI-NOXNACK: ; NumSgprs: 14
68 ; HSA-VI-XNACK: ; NumSgprs: 14
69 define amdgpu_kernel void @vcc_flat() {
71 call void asm sideeffect "", "~{s7},~{vcc},~{flat_scratch}"()
75 ; Make sure used SGPR count for flat_scr is correct when there is no
76 ; scratch usage and implicit flat uses.
78 ; GCN-LABEL: {{^}}use_flat_scr:
80 ; VI-NOXNACK: NumSgprs: 6
81 ; VI-XNACK: NumSgprs: 6
82 define amdgpu_kernel void @use_flat_scr() #0 {
84 call void asm sideeffect "; clobber ", "~{flat_scratch}"()
88 ; GCN-LABEL: {{^}}use_flat_scr_lo:
90 ; VI-NOXNACK: NumSgprs: 6
91 ; VI-XNACK: NumSgprs: 6
92 define amdgpu_kernel void @use_flat_scr_lo() #0 {
94 call void asm sideeffect "; clobber ", "~{flat_scratch_lo}"()
98 ; GCN-LABEL: {{^}}use_flat_scr_hi:
100 ; VI-NOXNACK: NumSgprs: 6
101 ; VI-XNACK: NumSgprs: 6
102 define amdgpu_kernel void @use_flat_scr_hi() #0 {
104 call void asm sideeffect "; clobber ", "~{flat_scratch_hi}"()
108 attributes #0 = { nounwind }