1 ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --function-signature --check-globals
2 ; RUN: opt -mtriple=amdgcn-unknown-amdhsa -S -amdgpu-attributor %s | FileCheck %s
4 ; Check handling for pre-existing attributes on function declarations
6 declare void @marked_no_workitem_id_x() "amdgpu-no-workitem-id-x"
7 declare void @marked_no_workitem_id_y() "amdgpu-no-workitem-id-y"
8 declare void @marked_no_workitem_id_z() "amdgpu-no-workitem-id-z"
10 declare void @marked_no_workgroup_id_x() "amdgpu-no-workgroup-id-x"
11 declare void @marked_no_workgroup_id_y() "amdgpu-no-workgroup-id-y"
12 declare void @marked_no_workgroup_id_z() "amdgpu-no-workgroup-id-z"
14 declare void @marked_no_dispatch_ptr() "amdgpu-no-dispatch-ptr"
15 declare void @marked_no_queue_ptr() "amdgpu-no-queue-ptr"
16 declare void @marked_no_implicitarg_ptr() "amdgpu-no-implicitarg-ptr"
17 declare void @marked_no_dispatch_id() "amdgpu-no-dispatch-id"
20 define void @call_no_workitem_id_x() {
21 ; CHECK-LABEL: define {{[^@]+}}@call_no_workitem_id_x
22 ; CHECK-SAME: () #[[ATTR0:[0-9]+]] {
23 ; CHECK-NEXT: call void @marked_no_workitem_id_x()
24 ; CHECK-NEXT: ret void
26 call void @marked_no_workitem_id_x()
30 define void @call_no_workitem_id_y() {
31 ; CHECK-LABEL: define {{[^@]+}}@call_no_workitem_id_y
32 ; CHECK-SAME: () #[[ATTR1:[0-9]+]] {
33 ; CHECK-NEXT: call void @marked_no_workitem_id_y()
34 ; CHECK-NEXT: ret void
36 call void @marked_no_workitem_id_y()
40 define void @call_no_workitem_id_z() {
41 ; CHECK-LABEL: define {{[^@]+}}@call_no_workitem_id_z
42 ; CHECK-SAME: () #[[ATTR2:[0-9]+]] {
43 ; CHECK-NEXT: call void @marked_no_workitem_id_z()
44 ; CHECK-NEXT: ret void
46 call void @marked_no_workitem_id_z()
50 define void @call_no_workgroup_id_x() {
51 ; CHECK-LABEL: define {{[^@]+}}@call_no_workgroup_id_x
52 ; CHECK-SAME: () #[[ATTR3:[0-9]+]] {
53 ; CHECK-NEXT: call void @marked_no_workgroup_id_x()
54 ; CHECK-NEXT: ret void
56 call void @marked_no_workgroup_id_x()
60 define void @call_no_workgroup_id_y() {
61 ; CHECK-LABEL: define {{[^@]+}}@call_no_workgroup_id_y
62 ; CHECK-SAME: () #[[ATTR4:[0-9]+]] {
63 ; CHECK-NEXT: call void @marked_no_workgroup_id_y()
64 ; CHECK-NEXT: ret void
66 call void @marked_no_workgroup_id_y()
70 define void @call_no_workgroup_id_z() {
71 ; CHECK-LABEL: define {{[^@]+}}@call_no_workgroup_id_z
72 ; CHECK-SAME: () #[[ATTR5:[0-9]+]] {
73 ; CHECK-NEXT: call void @marked_no_workgroup_id_z()
74 ; CHECK-NEXT: ret void
76 call void @marked_no_workgroup_id_z()
80 define void @call_no_dispatch_ptr() {
81 ; CHECK-LABEL: define {{[^@]+}}@call_no_dispatch_ptr
82 ; CHECK-SAME: () #[[ATTR6:[0-9]+]] {
83 ; CHECK-NEXT: call void @marked_no_dispatch_ptr()
84 ; CHECK-NEXT: ret void
86 call void @marked_no_dispatch_ptr()
90 define void @call_no_queue_ptr() {
91 ; CHECK-LABEL: define {{[^@]+}}@call_no_queue_ptr
92 ; CHECK-SAME: () #[[ATTR7:[0-9]+]] {
93 ; CHECK-NEXT: call void @marked_no_queue_ptr()
94 ; CHECK-NEXT: ret void
96 call void @marked_no_queue_ptr()
100 define void @call_no_implicitarg_ptr() {
101 ; CHECK-LABEL: define {{[^@]+}}@call_no_implicitarg_ptr
102 ; CHECK-SAME: () #[[ATTR8:[0-9]+]] {
103 ; CHECK-NEXT: call void @marked_no_implicitarg_ptr()
104 ; CHECK-NEXT: ret void
106 call void @marked_no_implicitarg_ptr()
110 define void @call_no_dispatch_id() {
111 ; CHECK-LABEL: define {{[^@]+}}@call_no_dispatch_id
112 ; CHECK-SAME: () #[[ATTR9:[0-9]+]] {
113 ; CHECK-NEXT: call void @marked_no_dispatch_id()
114 ; CHECK-NEXT: ret void
116 call void @marked_no_dispatch_id()
120 ; CHECK: attributes #[[ATTR0]] = { "amdgpu-no-workitem-id-x" "uniform-work-group-size"="false" }
121 ; CHECK: attributes #[[ATTR1]] = { "amdgpu-no-workitem-id-y" "uniform-work-group-size"="false" }
122 ; CHECK: attributes #[[ATTR2]] = { "amdgpu-no-workitem-id-z" "uniform-work-group-size"="false" }
123 ; CHECK: attributes #[[ATTR3]] = { "amdgpu-no-workgroup-id-x" "uniform-work-group-size"="false" }
124 ; CHECK: attributes #[[ATTR4]] = { "amdgpu-no-workgroup-id-y" "uniform-work-group-size"="false" }
125 ; CHECK: attributes #[[ATTR5]] = { "amdgpu-no-workgroup-id-z" "uniform-work-group-size"="false" }
126 ; CHECK: attributes #[[ATTR6]] = { "amdgpu-no-dispatch-ptr" "uniform-work-group-size"="false" }
127 ; CHECK: attributes #[[ATTR7]] = { "amdgpu-no-queue-ptr" "uniform-work-group-size"="false" }
128 ; CHECK: attributes #[[ATTR8]] = { "amdgpu-no-implicitarg-ptr" "uniform-work-group-size"="false" }
129 ; CHECK: attributes #[[ATTR9]] = { "amdgpu-no-dispatch-id" "uniform-work-group-size"="false" }