1 ; RUN: llc -mtriple=amdgcn-amd-amdhsa -mcpu=gfx900 -filetype=obj -o - < %s | llvm-readelf --notes - | FileCheck --check-prefix=CHECK %s
2 ; RUN: llc -mtriple=amdgcn-amd-amdhsa -mcpu=gfx900 -amdgpu-dump-hsa-metadata -amdgpu-verify-hsa-metadata -filetype=obj -o - < %s 2>&1 | FileCheck --check-prefix=PARSER %s
5 ; CHECK: amdhsa.kernels:
7 ; CHECK-NEXT: - .name: a
8 ; CHECK-NEXT: .offset: 0
10 ; CHECK-NEXT: .type_name: char
11 ; CHECK-NEXT: .value_kind: by_value
12 ; CHECK-NEXT: - .offset: 8
13 ; CHECK-NEXT: .size: 8
14 ; CHECK-NEXT: .value_kind: hidden_global_offset_x
15 ; CHECK-NEXT: - .offset: 16
16 ; CHECK-NEXT: .size: 8
17 ; CHECK-NEXT: .value_kind: hidden_global_offset_y
18 ; CHECK-NEXT: - .offset: 24
19 ; CHECK-NEXT: .size: 8
20 ; CHECK-NEXT: .value_kind: hidden_global_offset_z
21 ; CHECK-NOT: .value_kind: hidden_default_queue
22 ; CHECK-NOT: .value_kind: hidden_completion_action
23 ; CHECK: .language: OpenCL C
24 ; CHECK-NEXT: .language_version:
27 ; CHECK: .name: test_non_enqueue_kernel_caller
28 ; CHECK: .symbol: test_non_enqueue_kernel_caller.kd
29 define amdgpu_kernel void @test_non_enqueue_kernel_caller(i8 %a) #0
30 !kernel_arg_addr_space !1 !kernel_arg_access_qual !2 !kernel_arg_type !3
31 !kernel_arg_base_type !3 !kernel_arg_type_qual !4 {
36 ; CHECK-NEXT: - .name: a
37 ; CHECK-NEXT: .offset: 0
38 ; CHECK-NEXT: .size: 1
39 ; CHECK-NEXT: .type_name: char
40 ; CHECK-NEXT: .value_kind: by_value
41 ; CHECK-NEXT: - .offset: 8
42 ; CHECK-NEXT: .size: 8
43 ; CHECK-NEXT: .value_kind: hidden_global_offset_x
44 ; CHECK-NEXT: - .offset: 16
45 ; CHECK-NEXT: .size: 8
46 ; CHECK-NEXT: .value_kind: hidden_global_offset_y
47 ; CHECK-NEXT: - .offset: 24
48 ; CHECK-NEXT: .size: 8
49 ; CHECK-NEXT: .value_kind: hidden_global_offset_z
50 ; CHECK-NEXT: - .offset: 32
51 ; CHECK-NEXT: .size: 8
52 ; CHECK-NEXT: .value_kind: hidden_hostcall_buffer
53 ; CHECK-NEXT: - .offset: 40
54 ; CHECK-NEXT: .size: 8
55 ; CHECK-NEXT: .value_kind: hidden_default_queue
56 ; CHECK-NEXT: - .offset: 48
57 ; CHECK-NEXT: .size: 8
58 ; CHECK-NEXT: .value_kind: hidden_completion_action
59 ; CHECK: .language: OpenCL C
60 ; CHECK-NEXT: .language_version:
63 ; CHECK: .name: test_enqueue_kernel_caller
64 ; CHECK: .symbol: test_enqueue_kernel_caller.kd
65 define amdgpu_kernel void @test_enqueue_kernel_caller(i8 %a) #1
66 !kernel_arg_addr_space !1 !kernel_arg_access_qual !2 !kernel_arg_type !3
67 !kernel_arg_base_type !3 !kernel_arg_type_qual !4 {
72 ; CHECK-NEXT: - .name: a
73 ; CHECK-NEXT: .offset: 0
74 ; CHECK-NEXT: .size: 1
75 ; CHECK-NEXT: .type_name: char
76 ; CHECK-NEXT: .value_kind: by_value
77 ; CHECK-NEXT: - .offset: 8
78 ; CHECK-NEXT: .size: 8
79 ; CHECK-NEXT: .value_kind: hidden_global_offset_x
80 ; CHECK-NEXT: - .offset: 16
81 ; CHECK-NEXT: .size: 8
82 ; CHECK-NEXT: .value_kind: hidden_global_offset_y
83 ; CHECK-NEXT: - .offset: 24
84 ; CHECK-NEXT: .size: 8
85 ; CHECK-NEXT: .value_kind: hidden_global_offset_z
86 ; CHECK-NEXT: - .offset: 32
87 ; CHECK-NEXT: .size: 8
88 ; CHECK-NEXT: .value_kind: hidden_hostcall_buffer
89 ; CHECK-NEXT: - .offset: 40
90 ; CHECK-NEXT: .size: 8
91 ; CHECK-NEXT: .value_kind: hidden_default_queue
92 ; CHECK-NEXT: - .offset: 48
93 ; CHECK-NEXT: .size: 8
94 ; CHECK-NEXT: .value_kind: hidden_none
95 ; CHECK: .language: OpenCL C
96 ; CHECK-NEXT: .language_version:
99 ; CHECK: .name: test_no_completion_action
100 ; CHECK: .symbol: test_no_completion_action.kd
101 define amdgpu_kernel void @test_no_completion_action(i8 %a) #2
102 !kernel_arg_addr_space !1 !kernel_arg_access_qual !2 !kernel_arg_type !3
103 !kernel_arg_base_type !3 !kernel_arg_type_qual !4 {
108 ; CHECK-NEXT: - .name: a
109 ; CHECK-NEXT: .offset: 0
110 ; CHECK-NEXT: .size: 1
111 ; CHECK-NEXT: .type_name: char
112 ; CHECK-NEXT: .value_kind: by_value
113 ; CHECK-NEXT: - .offset: 8
114 ; CHECK-NEXT: .size: 8
115 ; CHECK-NEXT: .value_kind: hidden_global_offset_x
116 ; CHECK-NEXT: - .offset: 16
117 ; CHECK-NEXT: .size: 8
118 ; CHECK-NEXT: .value_kind: hidden_global_offset_y
119 ; CHECK-NEXT: - .offset: 24
120 ; CHECK-NEXT: .size: 8
121 ; CHECK-NEXT: .value_kind: hidden_global_offset_z
122 ; CHECK-NEXT: - .offset: 32
123 ; CHECK-NEXT: .size: 8
124 ; CHECK-NEXT: .value_kind: hidden_hostcall_buffer
125 ; CHECK-NEXT: - .offset: 40
126 ; CHECK-NEXT: .size: 8
127 ; CHECK-NEXT: .value_kind: hidden_none
128 ; CHECK-NEXT: - .offset: 48
129 ; CHECK-NEXT: .size: 8
130 ; CHECK-NEXT: .value_kind: hidden_completion_action
131 ; CHECK: .language: OpenCL C
132 ; CHECK-NEXT: .language_version:
135 ; CHECK: .name: test_no_default_queue
136 ; CHECK: .symbol: test_no_default_queue.kd
137 define amdgpu_kernel void @test_no_default_queue(i8 %a) #3
138 !kernel_arg_addr_space !1 !kernel_arg_access_qual !2 !kernel_arg_type !3
139 !kernel_arg_base_type !3 !kernel_arg_type_qual !4 {
143 ; CHECK: amdhsa.version:
146 ; CHECK-NOT: amdhsa.printf:
148 attributes #0 = { optnone noinline "amdgpu-no-default-queue" "amdgpu-no-completion-action" "amdgpu-implicitarg-num-bytes"="48" }
149 attributes #1 = { optnone noinline "amdgpu-implicitarg-num-bytes"="48" }
150 attributes #2 = { optnone noinline "amdgpu-no-completion-action" "amdgpu-implicitarg-num-bytes"="48" }
151 attributes #3 = { optnone noinline "amdgpu-no-default-queue" "amdgpu-implicitarg-num-bytes"="48" }
153 !llvm.module.flags = !{!0}
154 !0 = !{i32 1, !"amdhsa_code_object_version", i32 400}
161 !opencl.ocl.version = !{!90}
162 !90 = !{i32 2, i32 0}
164 ; PARSER: AMDGPU HSA Metadata Parser Test: PASS