1 | // RUN: %clang_cc1 %s -cl-std=CL2.0 -ffake-address-space-map -O0 -emit-llvm -o - -triple "spir-unknown-unknown" | FileCheck %s --check-prefix=COMMON --check-prefix=B32 |
2 | // RUN: %clang_cc1 %s -cl-std=CL2.0 -ffake-address-space-map -O0 -emit-llvm -o - -triple "spir64-unknown-unknown" | FileCheck %s --check-prefix=COMMON --check-prefix=B64 |
3 | // RUN: %clang_cc1 %s -cl-std=CL2.0 -ffake-address-space-map -O1 -emit-llvm -o - -triple "spir64-unknown-unknown" | FileCheck %s --check-prefix=CHECK-LIFETIMES |
4 | |
5 | #pragma OPENCL EXTENSION cl_khr_subgroups : enable |
6 | |
7 | typedef void (^bl_t)(local void *); |
8 | typedef struct {int a;} ndrange_t; |
9 | |
10 | // COMMON: %struct.__opencl_block_literal_generic = type { i32, i32, i8 addrspace(4)* } |
11 | |
12 | // For a block global variable, first emit the block literal as a global variable, then emit the block variable itself. |
13 | // COMMON: [[BL_GLOBAL:@__block_literal_global[^ ]*]] = internal addrspace(1) constant { i32, i32, i8 addrspace(4)* } { i32 {{[0-9]+}}, i32 {{[0-9]+}}, i8 addrspace(4)* addrspacecast (i8* bitcast (void (i8 addrspace(4)*, i8 addrspace(3)*)* [[INV_G:@[^ ]+]] to i8*) to i8 addrspace(4)*) } |
14 | // COMMON: @block_G = addrspace(1) constant %struct.__opencl_block_literal_generic addrspace(4)* addrspacecast (%struct.__opencl_block_literal_generic addrspace(1)* bitcast ({ i32, i32, i8 addrspace(4)* } addrspace(1)* [[BL_GLOBAL]] to %struct.__opencl_block_literal_generic addrspace(1)*) to %struct.__opencl_block_literal_generic addrspace(4)*) |
15 | |
16 | // For anonymous blocks without captures, emit block literals as global variable. |
17 | // COMMON: [[BLG1:@__block_literal_global[^ ]*]] = internal addrspace(1) constant { i32, i32, i8 addrspace(4)* } { i32 {{[0-9]+}}, i32 {{[0-9]+}}, i8 addrspace(4)* addrspacecast (i8* bitcast (void (i8 addrspace(4)*, i8 addrspace(3)*)* {{@[^ ]+}} to i8*) to i8 addrspace(4)*) } |
18 | // COMMON: [[BLG2:@__block_literal_global[^ ]*]] = internal addrspace(1) constant { i32, i32, i8 addrspace(4)* } { i32 {{[0-9]+}}, i32 {{[0-9]+}}, i8 addrspace(4)* addrspacecast (i8* bitcast (void (i8 addrspace(4)*, i8 addrspace(3)*)* {{@[^ ]+}} to i8*) to i8 addrspace(4)*) } |
19 | // COMMON: [[BLG3:@__block_literal_global[^ ]*]] = internal addrspace(1) constant { i32, i32, i8 addrspace(4)* } { i32 {{[0-9]+}}, i32 {{[0-9]+}}, i8 addrspace(4)* addrspacecast (i8* bitcast (void (i8 addrspace(4)*, i8 addrspace(3)*)* {{@[^ ]+}} to i8*) to i8 addrspace(4)*) } |
20 | // COMMON: [[BLG4:@__block_literal_global[^ ]*]] = internal addrspace(1) constant { i32, i32, i8 addrspace(4)* } { i32 {{[0-9]+}}, i32 {{[0-9]+}}, i8 addrspace(4)* addrspacecast (i8* bitcast (void (i8 addrspace(4)*, i8 addrspace(3)*)* {{@[^ ]+}} to i8*) to i8 addrspace(4)*) } |
21 | // COMMON: [[BLG5:@__block_literal_global[^ ]*]] = internal addrspace(1) constant { i32, i32, i8 addrspace(4)* } { i32 {{[0-9]+}}, i32 {{[0-9]+}}, i8 addrspace(4)* addrspacecast (i8* bitcast (void (i8 addrspace(4)*, i8 addrspace(3)*)* {{@[^ ]+}} to i8*) to i8 addrspace(4)*) } |
22 | // COMMON: [[BLG6:@__block_literal_global[^ ]*]] = internal addrspace(1) constant { i32, i32, i8 addrspace(4)* } { i32 {{[0-9]+}}, i32 {{[0-9]+}}, i8 addrspace(4)* addrspacecast (i8* bitcast (void (i8 addrspace(4)*, i8 addrspace(3)*, i8 addrspace(3)*, i8 addrspace(3)*)* {{@[^ ]+}} to i8*) to i8 addrspace(4)*) } |
23 | // COMMON: [[BLG7:@__block_literal_global[^ ]*]] = internal addrspace(1) constant { i32, i32, i8 addrspace(4)* } { i32 {{[0-9]+}}, i32 {{[0-9]+}}, i8 addrspace(4)* addrspacecast (i8* bitcast (void (i8 addrspace(4)*, i8 addrspace(3)*)* {{@[^ ]+}} to i8*) to i8 addrspace(4)*) } |
24 | // COMMON: [[BLG8:@__block_literal_global[^ ]*]] = internal addrspace(1) constant { i32, i32, i8 addrspace(4)* } { i32 {{[0-9]+}}, i32 {{[0-9]+}}, i8 addrspace(4)* addrspacecast (i8* bitcast (void (i8 addrspace(4)*)* [[INVG8:@[^ ]+]] to i8*) to i8 addrspace(4)*) } |
25 | // COMMON: [[BLG9:@__block_literal_global[^ ]*]] = internal addrspace(1) constant { i32, i32, i8 addrspace(4)* } { i32 {{[0-9]+}}, i32 {{[0-9]+}}, i8 addrspace(4)* addrspacecast (i8* bitcast (void (i8 addrspace(4)*, i8 addrspace(3)*)* [[INVG9:@[^ ]+]] to i8*) to i8 addrspace(4)*) } |
26 | // COMMON: [[BLG10:@__block_literal_global[^ ]*]] = internal addrspace(1) constant { i32, i32, i8 addrspace(4)* } { i32 {{[0-9]+}}, i32 {{[0-9]+}}, i8 addrspace(4)* addrspacecast (i8* bitcast (void (i8 addrspace(4)*)* {{@[^ ]+}} to i8*) to i8 addrspace(4)*) } |
27 | // COMMON: [[BLG11:@__block_literal_global[^ ]*]] = internal addrspace(1) constant { i32, i32, i8 addrspace(4)* } { i32 {{[0-9]+}}, i32 {{[0-9]+}}, i8 addrspace(4)* addrspacecast (i8* bitcast (void (i8 addrspace(4)*)* {{@[^ ]+}} to i8*) to i8 addrspace(4)*) } |
28 | |
29 | // Emits block literal [[BL_GLOBAL]], invoke function [[INV_G]] and global block variable @block_G |
30 | // COMMON: define internal spir_func void [[INV_G]](i8 addrspace(4)* %{{.*}}, i8 addrspace(3)* %{{.*}}) |
31 | const bl_t block_G = (bl_t) ^ (local void *a) {}; |
32 | |
33 | void callee(int id, __global int *out) { |
34 | out[id] = id; |
35 | } |
36 | |
37 | // COMMON-LABEL: define spir_kernel void @device_side_enqueue(i32 addrspace(1)* %{{.*}}, i32 addrspace(1)* %b, i32 %i) |
38 | kernel void device_side_enqueue(global int *a, global int *b, int i) { |
39 | // COMMON: %default_queue = alloca %opencl.queue_t* |
40 | queue_t default_queue; |
41 | // COMMON: %flags = alloca i32 |
42 | unsigned flags = 0; |
43 | // COMMON: %ndrange = alloca %struct.ndrange_t |
44 | ndrange_t ndrange; |
45 | // COMMON: %clk_event = alloca %opencl.clk_event_t* |
46 | clk_event_t clk_event; |
47 | // COMMON: %event_wait_list = alloca %opencl.clk_event_t* |
48 | clk_event_t event_wait_list; |
49 | // COMMON: %event_wait_list2 = alloca [1 x %opencl.clk_event_t*] |
50 | clk_event_t event_wait_list2[] = {clk_event}; |
51 | |
52 | // COMMON: [[NDR:%[a-z0-9]+]] = alloca %struct.ndrange_t, align 4 |
53 | |
54 | // B32: %[[BLOCK_SIZES1:.*]] = alloca [1 x i32] |
55 | // B64: %[[BLOCK_SIZES1:.*]] = alloca [1 x i64] |
56 | // CHECK-LIFETIMES: %[[BLOCK_SIZES1:.*]] = alloca [1 x i64] |
57 | // B32: %[[BLOCK_SIZES2:.*]] = alloca [1 x i32] |
58 | // B64: %[[BLOCK_SIZES2:.*]] = alloca [1 x i64] |
59 | // CHECK-LIFETIMES: %[[BLOCK_SIZES2:.*]] = alloca [1 x i64] |
60 | // B32: %[[BLOCK_SIZES3:.*]] = alloca [1 x i32] |
61 | // B64: %[[BLOCK_SIZES3:.*]] = alloca [1 x i64] |
62 | // CHECK-LIFETIMES: %[[BLOCK_SIZES3:.*]] = alloca [1 x i64] |
63 | // B32: %[[BLOCK_SIZES4:.*]] = alloca [1 x i32] |
64 | // B64: %[[BLOCK_SIZES4:.*]] = alloca [1 x i64] |
65 | // CHECK-LIFETIMES: %[[BLOCK_SIZES4:.*]] = alloca [1 x i64] |
66 | // B32: %[[BLOCK_SIZES5:.*]] = alloca [1 x i32] |
67 | // B64: %[[BLOCK_SIZES5:.*]] = alloca [1 x i64] |
68 | // CHECK-LIFETIMES: %[[BLOCK_SIZES5:.*]] = alloca [1 x i64] |
69 | // B32: %[[BLOCK_SIZES6:.*]] = alloca [3 x i32] |
70 | // B64: %[[BLOCK_SIZES6:.*]] = alloca [3 x i64] |
71 | // CHECK-LIFETIMES: %[[BLOCK_SIZES6:.*]] = alloca [3 x i64] |
72 | // B32: %[[BLOCK_SIZES7:.*]] = alloca [1 x i32] |
73 | // B64: %[[BLOCK_SIZES7:.*]] = alloca [1 x i64] |
74 | // CHECK-LIFETIMES: %[[BLOCK_SIZES7:.*]] = alloca [1 x i64] |
75 | |
76 | // Emits block literal on stack and block kernel [[INVLK1]]. |
77 | // COMMON: [[DEF_Q:%[0-9]+]] = load %opencl.queue_t{{.*}}*, %opencl.queue_t{{.*}}** %default_queue |
78 | // COMMON: [[FLAGS:%[0-9]+]] = load i32, i32* %flags |
79 | // COMMON: store i8 addrspace(4)* addrspacecast (i8* bitcast (void (i8 addrspace(4)*)* [[INVL1:@__device_side_enqueue_block_invoke[^ ]*]] to i8*) to i8 addrspace(4)*), i8 addrspace(4)** %block.invoke |
80 | // B32: [[BL:%[0-9]+]] = bitcast <{ i32, i32, i8 addrspace(4)*, i32 addrspace(1)*, i32, i32 addrspace(1)* }>* %block to %struct.__opencl_block_literal_generic* |
81 | // B64: [[BL:%[0-9]+]] = bitcast <{ i32, i32, i8 addrspace(4)*, i32 addrspace(1)*, i32 addrspace(1)*, i32 }>* %block to %struct.__opencl_block_literal_generic* |
82 | // COMMON: [[BL_I8:%[0-9]+]] = addrspacecast %struct.__opencl_block_literal_generic* [[BL]] to i8 addrspace(4)* |
83 | // COMMON-LABEL: call i32 @__enqueue_kernel_basic( |
84 | // COMMON-SAME: %opencl.queue_t{{.*}}* [[DEF_Q]], i32 [[FLAGS]], %struct.ndrange_t* byval [[NDR]]{{([0-9]+)?}}, |
85 | // COMMON-SAME: i8 addrspace(4)* addrspacecast (i8* bitcast ({{.*}} [[INVLK1:[^ ]+_kernel]] to i8*) to i8 addrspace(4)*), |
86 | // COMMON-SAME: i8 addrspace(4)* [[BL_I8]]) |
87 | enqueue_kernel(default_queue, flags, ndrange, |
88 | ^(void) { |
89 | a[i] = b[i]; |
90 | }); |
91 | |
92 | // Emits block literal on stack and block kernel [[INVLK2]]. |
93 | // COMMON: [[DEF_Q:%[0-9]+]] = load %opencl.queue_t{{.*}}*, %opencl.queue_t{{.*}}** %default_queue |
94 | // COMMON: [[FLAGS:%[0-9]+]] = load i32, i32* %flags |
95 | // COMMON: [[WAIT_EVNT:%[0-9]+]] = addrspacecast %opencl.clk_event_t{{.*}}** %event_wait_list to %opencl.clk_event_t{{.*}}* addrspace(4)* |
96 | // COMMON: [[EVNT:%[0-9]+]] = addrspacecast %opencl.clk_event_t{{.*}}** %clk_event to %opencl.clk_event_t{{.*}}* addrspace(4)* |
97 | // COMMON: store i8 addrspace(4)* addrspacecast (i8* bitcast (void (i8 addrspace(4)*)* [[INVL2:@__device_side_enqueue_block_invoke[^ ]*]] to i8*) to i8 addrspace(4)*), i8 addrspace(4)** %block.invoke |
98 | // COMMON: [[BL:%[0-9]+]] = bitcast <{ i32, i32, i8 addrspace(4)*, i32{{.*}}, i32{{.*}}, i32{{.*}} }>* %block3 to %struct.__opencl_block_literal_generic* |
99 | // COMMON: [[BL_I8:%[0-9]+]] = addrspacecast %struct.__opencl_block_literal_generic* [[BL]] to i8 addrspace(4)* |
100 | // COMMON-LABEL: call i32 @__enqueue_kernel_basic_events |
101 | // COMMON-SAME: (%opencl.queue_t{{.*}}* [[DEF_Q]], i32 [[FLAGS]], %struct.ndrange_t* {{.*}}, i32 2, %opencl.clk_event_t{{.*}}* addrspace(4)* [[WAIT_EVNT]], %opencl.clk_event_t{{.*}}* addrspace(4)* [[EVNT]], |
102 | // COMMON-SAME: i8 addrspace(4)* addrspacecast (i8* bitcast ({{.*}} [[INVLK2:[^ ]+_kernel]] to i8*) to i8 addrspace(4)*), |
103 | // COMMON-SAME: i8 addrspace(4)* [[BL_I8]]) |
104 | enqueue_kernel(default_queue, flags, ndrange, 2, &event_wait_list, &clk_event, |
105 | ^(void) { |
106 | a[i] = b[i]; |
107 | }); |
108 | |
109 | // COMMON-LABEL: call i32 @__enqueue_kernel_basic_events |
110 | // COMMON-SAME: (%opencl.queue_t{{.*}}* {{%[0-9]+}}, i32 {{%[0-9]+}}, %struct.ndrange_t* {{.*}}, i32 1, %opencl.clk_event_t{{.*}}* addrspace(4)* {{%[0-9]+}}, %opencl.clk_event_t{{.*}}* addrspace(4)* null, |
111 | enqueue_kernel(default_queue, flags, ndrange, 1, &event_wait_list, 0, |
112 | ^(void) { |
113 | return; |
114 | }); |
115 | |
116 | // Emits global block literal [[BLG1]] and block kernel [[INVGK1]]. |
117 | // COMMON: [[DEF_Q:%[0-9]+]] = load %opencl.queue_t{{.*}}*, %opencl.queue_t{{.*}}** %default_queue |
118 | // COMMON: [[FLAGS:%[0-9]+]] = load i32, i32* %flags |
119 | // CHECK-LIFETIMES: [[LIFETIME_PTR:%[0-9]+]] = bitcast [1 x i64]* %[[BLOCK_SIZES1]] to i8* |
120 | // CHECK-LIFETIMES-NEXT: call void @llvm.lifetime.start.p0i8(i64 8, i8* nonnull [[LIFETIME_PTR]]) |
121 | // CHECK-LIFETIMES-NEXT: getelementptr inbounds [1 x i64], [1 x i64]* %[[BLOCK_SIZES1]], i64 0, i64 0 |
122 | // CHECK-LIFETIMES-LABEL: call i32 @__enqueue_kernel_varargs( |
123 | // CHECK-LIFETIMES-NEXT: call void @llvm.lifetime.end.p0i8(i64 8, i8* nonnull [[LIFETIME_PTR]]) |
124 | // B32: %[[TMP:.*]] = getelementptr [1 x i32], [1 x i32]* %[[BLOCK_SIZES1]], i32 0, i32 0 |
125 | // B32: store i32 256, i32* %[[TMP]], align 4 |
126 | // B64: %[[TMP:.*]] = getelementptr [1 x i64], [1 x i64]* %[[BLOCK_SIZES1]], i32 0, i32 0 |
127 | // B64: store i64 256, i64* %[[TMP]], align 8 |
128 | // COMMON-LABEL: call i32 @__enqueue_kernel_varargs( |
129 | // COMMON-SAME: %opencl.queue_t{{.*}}* [[DEF_Q]], i32 [[FLAGS]], %struct.ndrange_t* [[NDR]]{{([0-9]+)?}}, |
130 | // COMMON-SAME: i8 addrspace(4)* addrspacecast (i8* bitcast ({{.*}} [[INVGK1:[^ ]+_kernel]] to i8*) to i8 addrspace(4)*), |
131 | // COMMON-SAME: i8 addrspace(4)* addrspacecast (i8 addrspace(1)* bitcast ({ i32, i32, i8 addrspace(4)* } addrspace(1)* [[BLG1]] to i8 addrspace(1)*) to i8 addrspace(4)*), i32 1, |
132 | // B32-SAME: i32* %[[TMP]]) |
133 | // B64-SAME: i64* %[[TMP]]) |
134 | enqueue_kernel(default_queue, flags, ndrange, |
135 | ^(local void *p) { |
136 | return; |
137 | }, |
138 | 256); |
139 | |
140 | char c; |
141 | // Emits global block literal [[BLG2]] and block kernel [[INVGK2]]. |
142 | // COMMON: [[DEF_Q:%[0-9]+]] = load %opencl.queue_t{{.*}}*, %opencl.queue_t{{.*}}** %default_queue |
143 | // COMMON: [[FLAGS:%[0-9]+]] = load i32, i32* %flags |
144 | // CHECK-LIFETIMES: [[LIFETIME_PTR:%[0-9]+]] = bitcast [1 x i64]* %[[BLOCK_SIZES2]] to i8* |
145 | // CHECK-LIFETIMES-NEXT: call void @llvm.lifetime.start.p0i8(i64 8, i8* nonnull [[LIFETIME_PTR]]) |
146 | // CHECK-LIFETIMES-NEXT: getelementptr inbounds [1 x i64], [1 x i64]* %[[BLOCK_SIZES2]], i64 0, i64 0 |
147 | // CHECK-LIFETIMES-LABEL: call i32 @__enqueue_kernel_varargs( |
148 | // CHECK-LIFETIMES-NEXT: call void @llvm.lifetime.end.p0i8(i64 8, i8* nonnull [[LIFETIME_PTR]]) |
149 | // B32: %[[TMP:.*]] = getelementptr [1 x i32], [1 x i32]* %[[BLOCK_SIZES2]], i32 0, i32 0 |
150 | // B32: store i32 %{{.*}}, i32* %[[TMP]], align 4 |
151 | // B64: %[[TMP:.*]] = getelementptr [1 x i64], [1 x i64]* %[[BLOCK_SIZES2]], i32 0, i32 0 |
152 | // B64: store i64 %{{.*}}, i64* %[[TMP]], align 8 |
153 | // COMMON-LABEL: call i32 @__enqueue_kernel_varargs( |
154 | // COMMON-SAME: %opencl.queue_t{{.*}}* [[DEF_Q]], i32 [[FLAGS]], %struct.ndrange_t* [[NDR]]{{([0-9]+)?}}, |
155 | // COMMON-SAME: i8 addrspace(4)* addrspacecast (i8* bitcast ({{.*}} [[INVGK2:[^ ]+_kernel]] to i8*) to i8 addrspace(4)*), |
156 | // COMMON-SAME: i8 addrspace(4)* addrspacecast (i8 addrspace(1)* bitcast ({ i32, i32, i8 addrspace(4)* } addrspace(1)* [[BLG2]] to i8 addrspace(1)*) to i8 addrspace(4)*), i32 1, |
157 | // B32-SAME: i32* %[[TMP]]) |
158 | // B64-SAME: i64* %[[TMP]]) |
159 | enqueue_kernel(default_queue, flags, ndrange, |
160 | ^(local void *p) { |
161 | return; |
162 | }, |
163 | c); |
164 | |
165 | // Emits global block literal [[BLG3]] and block kernel [[INVGK3]]. |
166 | // COMMON: [[DEF_Q:%[0-9]+]] = load %opencl.queue_t{{.*}}*, %opencl.queue_t{{.*}}** %default_queue |
167 | // COMMON: [[FLAGS:%[0-9]+]] = load i32, i32* %flags |
168 | // COMMON: [[AD:%arraydecay[0-9]*]] = getelementptr inbounds [1 x %opencl.clk_event_t*], [1 x %opencl.clk_event_t*]* %event_wait_list2, i{{32|64}} 0, i{{32|64}} 0 |
169 | // COMMON: [[WAIT_EVNT:%[0-9]+]] = addrspacecast %opencl.clk_event_t{{.*}}** [[AD]] to %opencl.clk_event_t{{.*}}* addrspace(4)* |
170 | // COMMON: [[EVNT:%[0-9]+]] = addrspacecast %opencl.clk_event_t{{.*}}** %clk_event to %opencl.clk_event_t{{.*}}* addrspace(4)* |
171 | // CHECK-LIFETIMES: [[LIFETIME_PTR:%[0-9]+]] = bitcast [1 x i64]* %[[BLOCK_SIZES3]] to i8* |
172 | // CHECK-LIFETIMES-NEXT: call void @llvm.lifetime.start.p0i8(i64 8, i8* nonnull [[LIFETIME_PTR]]) |
173 | // CHECK-LIFETIMES-NEXT: getelementptr inbounds [1 x i64], [1 x i64]* %[[BLOCK_SIZES3]], i64 0, i64 0 |
174 | // CHECK-LIFETIMES-LABEL: call i32 @__enqueue_kernel_events_varargs( |
175 | // CHECK-LIFETIMES-NEXT: call void @llvm.lifetime.end.p0i8(i64 8, i8* nonnull [[LIFETIME_PTR]]) |
176 | // B32: %[[TMP:.*]] = getelementptr [1 x i32], [1 x i32]* %[[BLOCK_SIZES3]], i32 0, i32 0 |
177 | // B32: store i32 256, i32* %[[TMP]], align 4 |
178 | // B64: %[[TMP:.*]] = getelementptr [1 x i64], [1 x i64]* %[[BLOCK_SIZES3]], i32 0, i32 0 |
179 | // B64: store i64 256, i64* %[[TMP]], align 8 |
180 | // COMMON-LABEL: call i32 @__enqueue_kernel_events_varargs |
181 | // COMMON-SAME: (%opencl.queue_t{{.*}}* [[DEF_Q]], i32 [[FLAGS]], %struct.ndrange_t* {{.*}}, i32 2, %opencl.clk_event_t{{.*}} [[WAIT_EVNT]], %opencl.clk_event_t{{.*}} [[EVNT]], |
182 | // COMMON-SAME: i8 addrspace(4)* addrspacecast (i8* bitcast ({{.*}} [[INVGK3:[^ ]+_kernel]] to i8*) to i8 addrspace(4)*), |
183 | // COMMON-SAME: i8 addrspace(4)* addrspacecast (i8 addrspace(1)* bitcast ({ i32, i32, i8 addrspace(4)* } addrspace(1)* [[BLG3]] to i8 addrspace(1)*) to i8 addrspace(4)*), i32 1, |
184 | // B32-SAME: i32* %[[TMP]]) |
185 | // B64-SAME: i64* %[[TMP]]) |
186 | enqueue_kernel(default_queue, flags, ndrange, 2, event_wait_list2, &clk_event, |
187 | ^(local void *p) { |
188 | return; |
189 | }, |
190 | 256); |
191 | |
192 | // Emits global block literal [[BLG4]] and block kernel [[INVGK4]]. |
193 | // COMMON: [[DEF_Q:%[0-9]+]] = load %opencl.queue_t{{.*}}*, %opencl.queue_t{{.*}}** %default_queue |
194 | // COMMON: [[FLAGS:%[0-9]+]] = load i32, i32* %flags |
195 | // COMMON: [[AD:%arraydecay[0-9]*]] = getelementptr inbounds [1 x %opencl.clk_event_t*], [1 x %opencl.clk_event_t*]* %event_wait_list2, i{{32|64}} 0, i{{32|64}} 0 |
196 | // COMMON: [[WAIT_EVNT:%[0-9]+]] = addrspacecast %opencl.clk_event_t{{.*}}** [[AD]] to %opencl.clk_event_t{{.*}}* addrspace(4)* |
197 | // COMMON: [[EVNT:%[0-9]+]] = addrspacecast %opencl.clk_event_t{{.*}}** %clk_event to %opencl.clk_event_t{{.*}}* addrspace(4)* |
198 | // CHECK-LIFETIMES: [[LIFETIME_PTR:%[0-9]+]] = bitcast [1 x i64]* %[[BLOCK_SIZES4]] to i8* |
199 | // CHECK-LIFETIMES-NEXT: call void @llvm.lifetime.start.p0i8(i64 8, i8* nonnull [[LIFETIME_PTR]]) |
200 | // CHECK-LIFETIMES-NEXT: getelementptr inbounds [1 x i64], [1 x i64]* %[[BLOCK_SIZES4]], i64 0, i64 0 |
201 | // CHECK-LIFETIMES-LABEL: call i32 @__enqueue_kernel_events_varargs( |
202 | // CHECK-LIFETIMES-NEXT: call void @llvm.lifetime.end.p0i8(i64 8, i8* nonnull [[LIFETIME_PTR]]) |
203 | // B32: %[[TMP:.*]] = getelementptr [1 x i32], [1 x i32]* %[[BLOCK_SIZES4]], i32 0, i32 0 |
204 | // B32: store i32 %{{.*}}, i32* %[[TMP]], align 4 |
205 | // B64: %[[TMP:.*]] = getelementptr [1 x i64], [1 x i64]* %[[BLOCK_SIZES4]], i32 0, i32 0 |
206 | // B64: store i64 %{{.*}}, i64* %[[TMP]], align 8 |
207 | // COMMON-LABEL: call i32 @__enqueue_kernel_events_varargs |
208 | // COMMON-SAME: (%opencl.queue_t{{.*}}* [[DEF_Q]], i32 [[FLAGS]], %struct.ndrange_t* {{.*}}, i32 2, %opencl.clk_event_t{{.*}}* addrspace(4)* [[WAIT_EVNT]], %opencl.clk_event_t{{.*}}* addrspace(4)* [[EVNT]], |
209 | // COMMON-SAME: i8 addrspace(4)* addrspacecast (i8* bitcast ({{.*}} [[INVGK4:[^ ]+_kernel]] to i8*) to i8 addrspace(4)*), |
210 | // COMMON-SAME: i8 addrspace(4)* addrspacecast (i8 addrspace(1)* bitcast ({ i32, i32, i8 addrspace(4)* } addrspace(1)* [[BLG4]] to i8 addrspace(1)*) to i8 addrspace(4)*), i32 1, |
211 | // B32-SAME: i32* %[[TMP]]) |
212 | // B64-SAME: i64* %[[TMP]]) |
213 | enqueue_kernel(default_queue, flags, ndrange, 2, event_wait_list2, &clk_event, |
214 | ^(local void *p) { |
215 | return; |
216 | }, |
217 | c); |
218 | |
219 | long l; |
220 | // Emits global block literal [[BLG5]] and block kernel [[INVGK5]]. |
221 | // COMMON: [[DEF_Q:%[0-9]+]] = load %opencl.queue_t{{.*}}*, %opencl.queue_t{{.*}}** %default_queue |
222 | // COMMON: [[FLAGS:%[0-9]+]] = load i32, i32* %flags |
223 | // CHECK-LIFETIMES: [[LIFETIME_PTR:%[0-9]+]] = bitcast [1 x i64]* %[[BLOCK_SIZES5]] to i8* |
224 | // CHECK-LIFETIMES-NEXT: call void @llvm.lifetime.start.p0i8(i64 8, i8* nonnull [[LIFETIME_PTR]]) |
225 | // CHECK-LIFETIMES-NEXT: getelementptr inbounds [1 x i64], [1 x i64]* %[[BLOCK_SIZES5]], i64 0, i64 0 |
226 | // CHECK-LIFETIMES-LABEL: call i32 @__enqueue_kernel_varargs( |
227 | // CHECK-LIFETIMES-NEXT: call void @llvm.lifetime.end.p0i8(i64 8, i8* nonnull [[LIFETIME_PTR]]) |
228 | // B32: %[[TMP:.*]] = getelementptr [1 x i32], [1 x i32]* %[[BLOCK_SIZES5]], i32 0, i32 0 |
229 | // B32: store i32 %{{.*}}, i32* %[[TMP]], align 4 |
230 | // B64: %[[TMP:.*]] = getelementptr [1 x i64], [1 x i64]* %[[BLOCK_SIZES5]], i32 0, i32 0 |
231 | // B64: store i64 %{{.*}}, i64* %[[TMP]], align 8 |
232 | // COMMON-LABEL: call i32 @__enqueue_kernel_varargs |
233 | // COMMON-SAME: (%opencl.queue_t{{.*}}* [[DEF_Q]], i32 [[FLAGS]], %struct.ndrange_t* [[NDR]]{{([0-9]+)?}}, |
234 | // COMMON-SAME: i8 addrspace(4)* addrspacecast (i8* bitcast ({{.*}} [[INVGK5:[^ ]+_kernel]] to i8*) to i8 addrspace(4)*), |
235 | // COMMON-SAME: i8 addrspace(4)* addrspacecast (i8 addrspace(1)* bitcast ({ i32, i32, i8 addrspace(4)* } addrspace(1)* [[BLG5]] to i8 addrspace(1)*) to i8 addrspace(4)*), i32 1, |
236 | // B32-SAME: i32* %[[TMP]]) |
237 | // B64-SAME: i64* %[[TMP]]) |
238 | enqueue_kernel(default_queue, flags, ndrange, |
239 | ^(local void *p) { |
240 | return; |
241 | }, |
242 | l); |
243 | |
244 | // Emits global block literal [[BLG6]] and block kernel [[INVGK6]]. |
245 | // COMMON: [[DEF_Q:%[0-9]+]] = load %opencl.queue_t{{.*}}*, %opencl.queue_t{{.*}}** %default_queue |
246 | // COMMON: [[FLAGS:%[0-9]+]] = load i32, i32* %flags |
247 | // CHECK-LIFETIMES: [[LIFETIME_PTR:%[0-9]+]] = bitcast [3 x i64]* %[[BLOCK_SIZES6]] to i8* |
248 | // CHECK-LIFETIMES-NEXT: call void @llvm.lifetime.start.p0i8(i64 24, i8* nonnull [[LIFETIME_PTR]]) |
249 | // CHECK-LIFETIMES-NEXT: getelementptr inbounds [3 x i64], [3 x i64]* %[[BLOCK_SIZES6]], i64 0, i64 0 |
250 | // CHECK-LIFETIMES-LABEL: call i32 @__enqueue_kernel_varargs( |
251 | // CHECK-LIFETIMES-NEXT: call void @llvm.lifetime.end.p0i8(i64 24, i8* nonnull [[LIFETIME_PTR]]) |
252 | // B32: %[[TMP:.*]] = getelementptr [3 x i32], [3 x i32]* %[[BLOCK_SIZES6]], i32 0, i32 0 |
253 | // B32: store i32 1, i32* %[[TMP]], align 4 |
254 | // B32: %[[BLOCK_SIZES62:.*]] = getelementptr [3 x i32], [3 x i32]* %[[BLOCK_SIZES6]], i32 0, i32 1 |
255 | // B32: store i32 2, i32* %[[BLOCK_SIZES62]], align 4 |
256 | // B32: %[[BLOCK_SIZES63:.*]] = getelementptr [3 x i32], [3 x i32]* %[[BLOCK_SIZES6]], i32 0, i32 2 |
257 | // B32: store i32 4, i32* %[[BLOCK_SIZES63]], align 4 |
258 | // B64: %[[TMP:.*]] = getelementptr [3 x i64], [3 x i64]* %[[BLOCK_SIZES6]], i32 0, i32 0 |
259 | // B64: store i64 1, i64* %[[TMP]], align 8 |
260 | // B64: %[[BLOCK_SIZES62:.*]] = getelementptr [3 x i64], [3 x i64]* %[[BLOCK_SIZES6]], i32 0, i32 1 |
261 | // B64: store i64 2, i64* %[[BLOCK_SIZES62]], align 8 |
262 | // B64: %[[BLOCK_SIZES63:.*]] = getelementptr [3 x i64], [3 x i64]* %[[BLOCK_SIZES6]], i32 0, i32 2 |
263 | // B64: store i64 4, i64* %[[BLOCK_SIZES63]], align 8 |
264 | // COMMON-LABEL: call i32 @__enqueue_kernel_varargs |
265 | // COMMON-SAME: (%opencl.queue_t{{.*}}* [[DEF_Q]], i32 [[FLAGS]], %struct.ndrange_t* [[NDR]]{{([0-9]+)?}}, |
266 | // COMMON-SAME: i8 addrspace(4)* addrspacecast (i8* bitcast ({{.*}} [[INVGK6:[^ ]+_kernel]] to i8*) to i8 addrspace(4)*), |
267 | // COMMON-SAME: i8 addrspace(4)* addrspacecast (i8 addrspace(1)* bitcast ({ i32, i32, i8 addrspace(4)* } addrspace(1)* [[BLG6]] to i8 addrspace(1)*) to i8 addrspace(4)*), i32 3, |
268 | // B32-SAME: i32* %[[TMP]]) |
269 | // B64-SAME: i64* %[[TMP]]) |
270 | enqueue_kernel(default_queue, flags, ndrange, |
271 | ^(local void *p1, local void *p2, local void *p3) { |
272 | return; |
273 | }, |
274 | 1, 2, 4); |
275 | |
276 | // Emits global block literal [[BLG7]] and block kernel [[INVGK7]]. |
277 | // COMMON: [[DEF_Q:%[0-9]+]] = load %opencl.queue_t*, %opencl.queue_t** %default_queue |
278 | // COMMON: [[FLAGS:%[0-9]+]] = load i32, i32* %flags |
279 | // CHECK-LIFETIMES: [[LIFETIME_PTR:%[0-9]+]] = bitcast [1 x i64]* %[[BLOCK_SIZES7]] to i8* |
280 | // CHECK-LIFETIMES-NEXT: call void @llvm.lifetime.start.p0i8(i64 8, i8* nonnull [[LIFETIME_PTR]]) |
281 | // CHECK-LIFETIMES-NEXT: getelementptr inbounds [1 x i64], [1 x i64]* %[[BLOCK_SIZES7]], i64 0, i64 0 |
282 | // CHECK-LIFETIMES-LABEL: call i32 @__enqueue_kernel_varargs( |
283 | // CHECK-LIFETIMES-NEXT: call void @llvm.lifetime.end.p0i8(i64 8, i8* nonnull [[LIFETIME_PTR]]) |
284 | // B32: %[[TMP:.*]] = getelementptr [1 x i32], [1 x i32]* %[[BLOCK_SIZES7]], i32 0, i32 0 |
285 | // B32: store i32 0, i32* %[[TMP]], align 4 |
286 | // B64: %[[TMP:.*]] = getelementptr [1 x i64], [1 x i64]* %[[BLOCK_SIZES7]], i32 0, i32 0 |
287 | // B64: store i64 4294967296, i64* %[[TMP]], align 8 |
288 | // COMMON-LABEL: call i32 @__enqueue_kernel_varargs |
289 | // COMMON-SAME: (%opencl.queue_t{{.*}}* [[DEF_Q]], i32 [[FLAGS]], %struct.ndrange_t* [[NDR]]{{([0-9]+)?}}, |
290 | // COMMON-SAME: i8 addrspace(4)* addrspacecast (i8* bitcast ({{.*}} [[INVGK7:[^ ]+_kernel]] to i8*) to i8 addrspace(4)*), |
291 | // COMMON-SAME: i8 addrspace(4)* addrspacecast (i8 addrspace(1)* bitcast ({ i32, i32, i8 addrspace(4)* } addrspace(1)* [[BLG7]] to i8 addrspace(1)*) to i8 addrspace(4)*), i32 1, |
292 | // B32-SAME: i32* %[[TMP]]) |
293 | // B64-SAME: i64* %[[TMP]]) |
294 | enqueue_kernel(default_queue, flags, ndrange, |
295 | ^(local void *p) { |
296 | return; |
297 | }, |
298 | 4294967296L); |
299 | |
300 | // Emits global block literal [[BLG8]] and invoke function [[INVG8]]. |
301 | // The full type of these expressions are long (and repeated elsewhere), so we |
302 | // capture it as part of the regex for convenience and clarity. |
303 | // COMMON: store %struct.__opencl_block_literal_generic addrspace(4)* addrspacecast (%struct.__opencl_block_literal_generic addrspace(1)* bitcast ({ i32, i32, i8 addrspace(4)* } addrspace(1)* [[BLG8]] to %struct.__opencl_block_literal_generic addrspace(1)*) to %struct.__opencl_block_literal_generic addrspace(4)*), %struct.__opencl_block_literal_generic addrspace(4)** %block_A |
304 | void (^const block_A)(void) = ^{ |
305 | return; |
306 | }; |
307 | |
308 | // Emits global block literal [[BLG9]] and invoke function [[INVG9]]. |
309 | // COMMON: store %struct.__opencl_block_literal_generic addrspace(4)* addrspacecast (%struct.__opencl_block_literal_generic addrspace(1)* bitcast ({ i32, i32, i8 addrspace(4)* } addrspace(1)* [[BLG9]] to %struct.__opencl_block_literal_generic addrspace(1)*) to %struct.__opencl_block_literal_generic addrspace(4)*), %struct.__opencl_block_literal_generic addrspace(4)** %block_B |
310 | void (^const block_B)(local void *) = ^(local void *a) { |
311 | return; |
312 | }; |
313 | |
314 | // Uses global block literal [[BLG8]] and invoke function [[INVG8]]. |
315 | // COMMON: call spir_func void @__device_side_enqueue_block_invoke_11(i8 addrspace(4)* addrspacecast (i8 addrspace(1)* bitcast ({ i32, i32, i8 addrspace(4)* } addrspace(1)* [[BLG8]] to i8 addrspace(1)*) to i8 addrspace(4)*)) |
316 | block_A(); |
317 | |
318 | // Emits global block literal [[BLG8]] and block kernel [[INVGK8]]. [[INVGK8]] calls [[INVG8]]. |
319 | // COMMON: [[DEF_Q:%[0-9]+]] = load %opencl.queue_t{{.*}}*, %opencl.queue_t{{.*}}** %default_queue |
320 | // COMMON: [[FLAGS:%[0-9]+]] = load i32, i32* %flags |
321 | // COMMON-LABEL: call i32 @__enqueue_kernel_basic( |
322 | // COMMON-SAME: %opencl.queue_t{{.*}}* [[DEF_Q]], i32 [[FLAGS]], %struct.ndrange_t* byval [[NDR]]{{([0-9]+)?}}, |
323 | // COMMON-SAME: i8 addrspace(4)* addrspacecast (i8* bitcast ({{.*}} [[INVGK8:[^ ]+_kernel]] to i8*) to i8 addrspace(4)*), |
324 | // COMMON-SAME: i8 addrspace(4)* addrspacecast (i8 addrspace(1)* bitcast ({ i32, i32, i8 addrspace(4)* } addrspace(1)* [[BLG8]] to i8 addrspace(1)*) to i8 addrspace(4)*)) |
325 | enqueue_kernel(default_queue, flags, ndrange, block_A); |
326 | |
327 | // Uses block kernel [[INVGK8]] and global block literal [[BLG8]]. |
328 | // COMMON: call i32 @__get_kernel_work_group_size_impl( |
329 | // COMMON-SAME: i8 addrspace(4)* addrspacecast (i8* bitcast ({{.*}} [[INVGK8]] to i8*) to i8 addrspace(4)*), |
330 | // COMMON-SAME: i8 addrspace(4)* addrspacecast (i8 addrspace(1)* bitcast ({ i32, i32, i8 addrspace(4)* } addrspace(1)* [[BLG8]] to i8 addrspace(1)*) to i8 addrspace(4)*)) |
331 | unsigned size = get_kernel_work_group_size(block_A); |
332 | |
333 | // Uses global block literal [[BLG8]] and invoke function [[INVG8]]. Make sure no redundant block literal and invoke functions are emitted. |
334 | // COMMON: call spir_func void @__device_side_enqueue_block_invoke_11(i8 addrspace(4)* addrspacecast (i8 addrspace(1)* bitcast ({ i32, i32, i8 addrspace(4)* } addrspace(1)* [[BLG8]] to i8 addrspace(1)*) to i8 addrspace(4)*)) |
335 | block_A(); |
336 | |
337 | // Make sure that block invoke function is resolved correctly after sequence of assignements. |
338 | // COMMON: store %struct.__opencl_block_literal_generic addrspace(4)* |
339 | // COMMON-SAME: addrspacecast (%struct.__opencl_block_literal_generic addrspace(1)* |
340 | // COMMON-SAME: bitcast ({ i32, i32, i8 addrspace(4)* } addrspace(1)* [[BL_GLOBAL]] to %struct.__opencl_block_literal_generic addrspace(1)*) |
341 | // COMMON-SAME: to %struct.__opencl_block_literal_generic addrspace(4)*), |
342 | // COMMON-SAME: %struct.__opencl_block_literal_generic addrspace(4)** %b1, |
343 | bl_t b1 = block_G; |
344 | // COMMON: store %struct.__opencl_block_literal_generic addrspace(4)* |
345 | // COMMON-SAME: addrspacecast (%struct.__opencl_block_literal_generic addrspace(1)* |
346 | // COMMON-SAME: bitcast ({ i32, i32, i8 addrspace(4)* } addrspace(1)* [[BL_GLOBAL]] to %struct.__opencl_block_literal_generic addrspace(1)*) |
347 | // COMMON-SAME: to %struct.__opencl_block_literal_generic addrspace(4)*), |
348 | // COMMON-SAME: %struct.__opencl_block_literal_generic addrspace(4)** %b2, |
349 | bl_t b2 = b1; |
350 | // COMMON: call spir_func void @block_G_block_invoke(i8 addrspace(4)* addrspacecast (i8 addrspace(1)* |
351 | // COMMON-SAME: bitcast ({ i32, i32, i8 addrspace(4)* } addrspace(1)* [[BL_GLOBAL]] to i8 addrspace(1)*) |
352 | // COOMON-SAME: to i8 addrspace(4)*), i8 addrspace(3)* null) |
353 | b2(0); |
354 | // Uses global block literal [[BL_GLOBAL]] and block kernel [[INV_G_K]]. [[INV_G_K]] calls [[INV_G]]. |
355 | // COMMON: call i32 @__get_kernel_preferred_work_group_size_multiple_impl( |
356 | // COMMON-SAME: i8 addrspace(4)* addrspacecast (i8* bitcast ({{.*}} [[INV_G_K:[^ ]+_kernel]] to i8*) to i8 addrspace(4)*), |
357 | // COMMON-SAME: i8 addrspace(4)* addrspacecast (i8 addrspace(1)* bitcast ({ i32, i32, i8 addrspace(4)* } addrspace(1)* [[BL_GLOBAL]] to i8 addrspace(1)*) to i8 addrspace(4)*)) |
358 | size = get_kernel_preferred_work_group_size_multiple(b2); |
359 | |
360 | void (^block_C)(void) = ^{ |
361 | callee(i, a); |
362 | }; |
363 | // Emits block literal on stack and block kernel [[INVLK3]]. |
364 | // COMMON: store i8 addrspace(4)* addrspacecast (i8* bitcast (void (i8 addrspace(4)*)* [[INVL3:@__device_side_enqueue_block_invoke[^ ]*]] to i8*) to i8 addrspace(4)*), i8 addrspace(4)** %block.invoke |
365 | // COMMON: [[DEF_Q:%[0-9]+]] = load %opencl.queue_t{{.*}}*, %opencl.queue_t{{.*}}** %default_queue |
366 | // COMMON: [[FLAGS:%[0-9]+]] = load i32, i32* %flags |
367 | // COMMON: [[BL_I8:%[0-9]+]] = addrspacecast %struct.__opencl_block_literal_generic* {{.*}} to i8 addrspace(4)* |
368 | // COMMON-LABEL: call i32 @__enqueue_kernel_basic( |
369 | // COMMON-SAME: %opencl.queue_t{{.*}}* [[DEF_Q]], i32 [[FLAGS]], %struct.ndrange_t* byval [[NDR]]{{([0-9]+)?}}, |
370 | // COMMON-SAME: i8 addrspace(4)* addrspacecast (i8* bitcast ({{.*}} [[INVLK3:[^ ]+_kernel]] to i8*) to i8 addrspace(4)*), |
371 | // COMMON-SAME: i8 addrspace(4)* [[BL_I8]]) |
372 | enqueue_kernel(default_queue, flags, ndrange, block_C); |
373 | |
374 | // Emits global block literal [[BLG9]] and block kernel [[INVGK9]]. [[INVGK9]] calls [[INV9]]. |
375 | // COMMON: call i32 @__get_kernel_work_group_size_impl( |
376 | // COMMON-SAME: i8 addrspace(4)* addrspacecast (i8* bitcast ({{.*}} [[INVGK9:[^ ]+_kernel]] to i8*) to i8 addrspace(4)*), |
377 | // COMMON-SAME: i8 addrspace(4)* addrspacecast (i8 addrspace(1)* bitcast ({ i32, i32, i8 addrspace(4)* } addrspace(1)* [[BLG9]] to i8 addrspace(1)*) to i8 addrspace(4)*)) |
378 | size = get_kernel_work_group_size(block_B); |
379 | |
380 | // Uses global block literal [[BLG8]] and block kernel [[INVGK8]]. Make sure no redundant block literal ind invoke functions are emitted. |
381 | // COMMON: call i32 @__get_kernel_preferred_work_group_size_multiple_impl( |
382 | // COMMON-SAME: i8 addrspace(4)* addrspacecast (i8* bitcast ({{.*}} [[INVGK8]] to i8*) to i8 addrspace(4)*), |
383 | // COMMON-SAME: i8 addrspace(4)* addrspacecast (i8 addrspace(1)* bitcast ({ i32, i32, i8 addrspace(4)* } addrspace(1)* [[BLG8]] to i8 addrspace(1)*) to i8 addrspace(4)*)) |
384 | size = get_kernel_preferred_work_group_size_multiple(block_A); |
385 | |
386 | // Uses global block literal [[BL_GLOBAL]] and block kernel [[INV_G_K]]. [[INV_G_K]] calls [[INV_G]]. |
387 | // COMMON: call i32 @__get_kernel_preferred_work_group_size_multiple_impl( |
388 | // COMMON-SAME: i8 addrspace(4)* addrspacecast (i8* bitcast ({{.*}} [[INV_G_K:[^ ]+_kernel]] to i8*) to i8 addrspace(4)*), |
389 | // COMMON-SAME: i8 addrspace(4)* addrspacecast (i8 addrspace(1)* bitcast ({ i32, i32, i8 addrspace(4)* } addrspace(1)* [[BL_GLOBAL]] to i8 addrspace(1)*) to i8 addrspace(4)*)) |
390 | size = get_kernel_preferred_work_group_size_multiple(block_G); |
391 | |
392 | // Emits global block literal [[BLG10]] and block kernel [[INVGK10]]. |
393 | // COMMON: call i32 @__get_kernel_max_sub_group_size_for_ndrange_impl(%struct.ndrange_t* {{[^,]+}}, |
394 | // COMMON-SAME: i8 addrspace(4)* addrspacecast (i8* bitcast ({{.*}} [[INVGK10:[^ ]+_kernel]] to i8*) to i8 addrspace(4)*), |
395 | // COMMON-SAME: i8 addrspace(4)* addrspacecast (i8 addrspace(1)* bitcast ({ i32, i32, i8 addrspace(4)* } addrspace(1)* [[BLG10]] to i8 addrspace(1)*) to i8 addrspace(4)*)) |
396 | size = get_kernel_max_sub_group_size_for_ndrange(ndrange, ^(){}); |
397 | |
398 | // Emits global block literal [[BLG11]] and block kernel [[INVGK11]]. |
399 | // COMMON: call i32 @__get_kernel_sub_group_count_for_ndrange_impl(%struct.ndrange_t* {{[^,]+}}, |
400 | // COMMON-SAME: i8 addrspace(4)* addrspacecast (i8* bitcast ({{.*}} [[INVGK11:[^ ]+_kernel]] to i8*) to i8 addrspace(4)*), |
401 | // COMMON-SAME: i8 addrspace(4)* addrspacecast (i8 addrspace(1)* bitcast ({ i32, i32, i8 addrspace(4)* } addrspace(1)* [[BLG11]] to i8 addrspace(1)*) to i8 addrspace(4)*)) |
402 | size = get_kernel_sub_group_count_for_ndrange(ndrange, ^(){}); |
403 | } |
404 | |
405 | // COMMON: define internal spir_kernel void [[INVLK1]](i8 addrspace(4)*) #{{[0-9]+}} { |
406 | // COMMON: entry: |
407 | // COMMON: call void @__device_side_enqueue_block_invoke(i8 addrspace(4)* %0) |
408 | // COMMON: ret void |
409 | // COMMON: } |
410 | // COMMON: define internal spir_kernel void [[INVLK2]](i8 addrspace(4)*{{.*}}) |
411 | // COMMON: define internal spir_kernel void [[INVGK1]](i8 addrspace(4)*{{.*}}, i8 addrspace(3)*{{.*}}) |
412 | // COMMON: define internal spir_kernel void [[INVGK2]](i8 addrspace(4)*{{.*}}, i8 addrspace(3)*{{.*}}) |
413 | // COMMON: define internal spir_kernel void [[INVGK3]](i8 addrspace(4)*{{.*}}, i8 addrspace(3)*{{.*}}) |
414 | // COMMON: define internal spir_kernel void [[INVGK4]](i8 addrspace(4)*{{.*}}, i8 addrspace(3)*{{.*}}) |
415 | // COMMON: define internal spir_kernel void [[INVGK5]](i8 addrspace(4)*{{.*}}, i8 addrspace(3)*{{.*}}) |
416 | // COMMON: define internal spir_kernel void [[INVGK6]](i8 addrspace(4)*, i8 addrspace(3)*, i8 addrspace(3)*, i8 addrspace(3)*) #{{[0-9]+}} { |
417 | // COMMON: entry: |
418 | // COMMON: call void @__device_side_enqueue_block_invoke_9(i8 addrspace(4)* %0, i8 addrspace(3)* %1, i8 addrspace(3)* %2, i8 addrspace(3)* %3) |
419 | // COMMON: ret void |
420 | // COMMON: } |
421 | // COMMON: define internal spir_kernel void [[INVGK7]](i8 addrspace(4)*{{.*}}, i8 addrspace(3)*{{.*}}) |
422 | // COMMON: define internal spir_func void [[INVG8]](i8 addrspace(4)*{{.*}}) |
423 | // COMMON: define internal spir_func void [[INVG9]](i8 addrspace(4)*{{.*}}, i8 addrspace(3)* %{{.*}}) |
424 | // COMMON: define internal spir_kernel void [[INVGK8]](i8 addrspace(4)*{{.*}}) |
425 | // COMMON: define internal spir_kernel void [[INV_G_K]](i8 addrspace(4)*{{.*}}, i8 addrspace(3)*{{.*}}) |
426 | // COMMON: define internal spir_kernel void [[INVLK3]](i8 addrspace(4)*{{.*}}) |
427 | // COMMON: define internal spir_kernel void [[INVGK9]](i8 addrspace(4)*{{.*}}, i8 addrspace(3)*{{.*}}) |
428 | // COMMON: define internal spir_kernel void [[INVGK10]](i8 addrspace(4)*{{.*}}) |
429 | // COMMON: define internal spir_kernel void [[INVGK11]](i8 addrspace(4)*{{.*}}) |
430 | |