1 ; RUN: llc -mtriple=amdgcn-amd-amdhsa -mcpu=gfx700 -filetype=obj -o - < %s | llvm-readelf --notes - | FileCheck --check-prefix=CHECK %s
2 ; RUN: llc -mtriple=amdgcn-amd-amdhsa -mcpu=gfx803 -filetype=obj -o - < %s | llvm-readelf --notes - | FileCheck --check-prefix=CHECK %s
3 ; RUN: llc -mtriple=amdgcn-amd-amdhsa -mcpu=gfx900 -filetype=obj -o - < %s | llvm-readelf --notes - | FileCheck --check-prefix=CHECK %s
5 ; RUN: llc -mtriple=amdgcn-amd-amdhsa -mcpu=gfx700 < %s | FileCheck --check-prefix=CHECK %s
6 ; RUN: llc -mtriple=amdgcn-amd-amdhsa -mcpu=gfx803 < %s | FileCheck --check-prefix=CHECK %s
7 ; RUN: llc -mtriple=amdgcn-amd-amdhsa -mcpu=gfx900 < %s | FileCheck --check-prefix=CHECK %s
10 ; CHECK: amdhsa.kernels:
11 ; CHECK-NEXT: - .args:
12 ; CHECK-NEXT: - .address_space: global
13 ; CHECK-NEXT: .name: r
14 ; CHECK-NEXT: .offset: 0
15 ; CHECK-NEXT: .size: 8
16 ; CHECK-NEXT: .value_kind: global_buffer
17 ; CHECK-NEXT: - .address_space: global
18 ; CHECK-NEXT: .name: a
19 ; CHECK-NEXT: .offset: 8
20 ; CHECK-NEXT: .size: 8
21 ; CHECK-NEXT: .value_kind: global_buffer
22 ; CHECK-NEXT: - .address_space: global
23 ; CHECK-NEXT: .name: b
24 ; CHECK-NEXT: .offset: 16
25 ; CHECK-NEXT: .size: 8
26 ; CHECK-NEXT: .value_kind: global_buffer
27 ; CHECK-NEXT: - .offset: 24
28 ; CHECK-NEXT: .size: 4
29 ; CHECK-NEXT: .value_kind: hidden_block_count_x
30 ; CHECK-NEXT: - .offset: 28
31 ; CHECK-NEXT: .size: 4
32 ; CHECK-NEXT: .value_kind: hidden_block_count_y
33 ; CHECK-NEXT: - .offset: 32
34 ; CHECK-NEXT: .size: 4
35 ; CHECK-NEXT: .value_kind: hidden_block_count_z
36 ; CHECK-NEXT: - .offset: 36
37 ; CHECK-NEXT: .size: 2
38 ; CHECK-NEXT: .value_kind: hidden_group_size_x
39 ; CHECK-NEXT: - .offset: 38
40 ; CHECK-NEXT: .size: 2
41 ; CHECK-NEXT: .value_kind: hidden_group_size_y
42 ; CHECK-NEXT: - .offset: 40
43 ; CHECK-NEXT: .size: 2
44 ; CHECK-NEXT: .value_kind: hidden_group_size_z
45 ; CHECK-NEXT: - .offset: 42
46 ; CHECK-NEXT: .size: 2
47 ; CHECK-NEXT: .value_kind: hidden_remainder_x
48 ; CHECK-NEXT: - .offset: 44
49 ; CHECK-NEXT: .size: 2
50 ; CHECK-NEXT: .value_kind: hidden_remainder_y
51 ; CHECK-NEXT: - .offset: 46
52 ; CHECK-NEXT: .size: 2
53 ; CHECK-NEXT: .value_kind: hidden_remainder_z
54 ; CHECK-NEXT: - .offset: 64
55 ; CHECK-NEXT: .size: 8
56 ; CHECK-NEXT: .value_kind: hidden_global_offset_x
57 ; CHECK-NEXT: - .offset: 72
58 ; CHECK-NEXT: .size: 8
59 ; CHECK-NEXT: .value_kind: hidden_global_offset_y
60 ; CHECK-NEXT: - .offset: 80
61 ; CHECK-NEXT: .size: 8
62 ; CHECK-NEXT: .value_kind: hidden_global_offset_z
63 ; CHECK-NEXT: - .offset: 88
64 ; CHECK-NEXT: .size: 2
65 ; CHECK-NEXT: .value_kind: hidden_grid_dims
66 ; CHECK-NEXT: - .offset: 96
67 ; CHECK-NEXT: .size: 8
68 ; CHECK-NEXT: .value_kind: hidden_printf_buffer
69 ; CHECK-NEXT: - .offset: 104
70 ; CHECK-NEXT: .size: 8
71 ; CHECK-NEXT: .value_kind: hidden_hostcall_buffer
72 ; CHECK-NEXT: - .offset: 112
73 ; CHECK-NEXT: .size: 8
74 ; CHECK-NEXT: .value_kind: hidden_multigrid_sync_arg
75 ; CHECK-NEXT: - .offset: 120
76 ; CHECK-NEXT: .size: 8
77 ; CHECK-NEXT: .value_kind: hidden_heap_v1
78 ; CHECK-NEXT: - .offset: 128
79 ; CHECK-NEXT: .size: 8
80 ; CHECK-NEXT: .value_kind: hidden_default_queue
81 ; CHECK-NEXT: - .offset: 136
82 ; CHECK-NEXT: .size: 8
83 ; CHECK-NEXT: .value_kind: hidden_completion_action
84 ; CHECK: - .offset: 144
85 ; CHECK-NEXT: .size: 4
86 ; CHECK-NEXT: .value_kind: hidden_dynamic_lds_size
87 ; CHECK: - .offset: 224
88 ; CHECK-NEXT: .size: 8
89 ; CHECK-NEXT: .value_kind: hidden_queue_ptr
91 ; CHECK: .name: test_v5
92 ; CHECK: .symbol: test_v5.kd
94 ; CHECK: amdhsa.version:
97 @lds = external hidden addrspace(3) global [0 x i32], align 4
99 define void @funcs_dyn_lds(ptr addrspace(3) %lds_ptr) {
100 store i32 1234, ptr addrspace(3) %lds_ptr, align 4
104 define amdgpu_kernel void @test_v5(
107 ptr addrspace(1) %b) #0 {
109 %a.val = load half, ptr addrspace(1) %a
110 %b.val = load half, ptr addrspace(1) %b
111 %r.val = fadd half %a.val, %b.val
112 store half %r.val, ptr addrspace(1) %r
113 call void @funcs_dyn_lds(ptr addrspace(3) @lds)
117 !llvm.module.flags = !{!0}
118 !0 = !{i32 1, !"amdhsa_code_object_version", i32 500}
119 !llvm.printf.fmts = !{!1, !2}
120 !1 = !{!"1:1:4:%d\5Cn"}
121 !2 = !{!"2:1:8:%g\5Cn"}
123 attributes #0 = { optnone noinline }