[TySan] Don't report globals with incomplete types. (#121922)
[llvm-project.git] / clang / test / OpenMP / nvptx_teams_reduction_codegen.cpp
blob350b6f761e573aadfb77695f52208309fbac511b
1 // NOTE: Assertions have been autogenerated by utils/update_cc_test_checks.py UTC_ARGS: --function-signature --include-generated-funcs --replace-value-regex "__omp_offloading_[0-9a-z]+_[0-9a-z]+" "reduction_size[.].+[.]" "pl_cond[.].+[.|,]" --prefix-filecheck-ir-name _
2 // Test target codegen - host bc file has to be created first.
3 // RUN: %clang_cc1 -verify -fopenmp -x c++ -triple powerpc64le-unknown-unknown -fopenmp-targets=nvptx64-nvidia-cuda -emit-llvm-bc %s -o %t-ppc-host.bc
4 // RUN: %clang_cc1 -verify -fopenmp -x c++ -triple nvptx64-unknown-unknown -fopenmp-targets=nvptx64-nvidia-cuda -emit-llvm %s -fopenmp-is-target-device -fopenmp-host-ir-file-path %t-ppc-host.bc -o - | FileCheck %s --check-prefix=CHECK1
5 // RUN: %clang_cc1 -verify -fopenmp -x c++ -triple i386-unknown-unknown -fopenmp-targets=nvptx-nvidia-cuda -emit-llvm-bc %s -o %t-x86-host.bc
6 // RUN: %clang_cc1 -verify -fopenmp -x c++ -triple nvptx-unknown-unknown -fopenmp-targets=nvptx-nvidia-cuda -emit-llvm %s -fopenmp-is-target-device -fopenmp-host-ir-file-path %t-x86-host.bc -o - | FileCheck %s --check-prefix=CHECK2
7 // RUN: %clang_cc1 -verify -fopenmp -fexceptions -fcxx-exceptions -x c++ -triple nvptx-unknown-unknown -fopenmp-targets=nvptx-nvidia-cuda -fopenmp-cuda-teams-reduction-recs-num=2048 -emit-llvm %s -fopenmp-is-target-device -fopenmp-host-ir-file-path %t-x86-host.bc -o - | FileCheck %s --check-prefix=CHECK3
8 // expected-no-diagnostics
9 #ifndef HEADER
10 #define HEADER
12 template<typename tx>
13 tx ftemplate(int n) {
14 int a;
15 short b;
16 tx c;
17 float d;
18 double e;
20 #pragma omp target
21 #pragma omp teams reduction(+: e)
23 e += 5;
26 #pragma omp target
27 #pragma omp teams reduction(^: c) reduction(*: d)
29 c ^= 2;
30 d *= 33;
33 #pragma omp target
34 #pragma omp teams reduction(|: a) reduction(max: b)
35 #pragma omp parallel reduction(|: a) reduction(max: b)
37 a |= 1;
38 b = 99 > b ? 99 : b;
41 return a+b+c+d+e;
44 int bar(int n){
45 int a = 0;
47 a += ftemplate<char>(n);
49 return a;
52 #endif
53 // CHECK1-LABEL: define {{[^@]+}}@{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z9ftemplateIcET_i_l20
54 // CHECK1-SAME: (ptr noalias noundef [[DYN_PTR:%.*]], i64 noundef [[E:%.*]]) #[[ATTR0:[0-9]+]] {
55 // CHECK1-NEXT: entry:
56 // CHECK1-NEXT: [[DYN_PTR_ADDR:%.*]] = alloca ptr, align 8
57 // CHECK1-NEXT: [[E_ADDR:%.*]] = alloca i64, align 8
58 // CHECK1-NEXT: [[DOTZERO_ADDR:%.*]] = alloca i32, align 4
59 // CHECK1-NEXT: [[DOTTHREADID_TEMP_:%.*]] = alloca i32, align 4
60 // CHECK1-NEXT: store ptr [[DYN_PTR]], ptr [[DYN_PTR_ADDR]], align 8
61 // CHECK1-NEXT: store i64 [[E]], ptr [[E_ADDR]], align 8
62 // CHECK1-NEXT: [[TMP0:%.*]] = call i32 @__kmpc_target_init(ptr @{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z9ftemplateIcET_i_l20_kernel_environment, ptr [[DYN_PTR]])
63 // CHECK1-NEXT: [[EXEC_USER_CODE:%.*]] = icmp eq i32 [[TMP0]], -1
64 // CHECK1-NEXT: br i1 [[EXEC_USER_CODE]], label [[USER_CODE_ENTRY:%.*]], label [[WORKER_EXIT:%.*]]
65 // CHECK1: user_code.entry:
66 // CHECK1-NEXT: [[TMP1:%.*]] = load double, ptr [[E_ADDR]], align 8
67 // CHECK1-NEXT: [[E1:%.*]] = call align 8 ptr @__kmpc_alloc_shared(i64 8)
68 // CHECK1-NEXT: store double [[TMP1]], ptr [[E1]], align 8
69 // CHECK1-NEXT: [[TMP2:%.*]] = call i32 @__kmpc_global_thread_num(ptr @[[GLOB1:[0-9]+]])
70 // CHECK1-NEXT: store i32 0, ptr [[DOTZERO_ADDR]], align 4
71 // CHECK1-NEXT: store i32 [[TMP2]], ptr [[DOTTHREADID_TEMP_]], align 4
72 // CHECK1-NEXT: call void @{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z9ftemplateIcET_i_l20_omp_outlined(ptr [[DOTTHREADID_TEMP_]], ptr [[DOTZERO_ADDR]], ptr [[E1]]) #[[ATTR4:[0-9]+]]
73 // CHECK1-NEXT: call void @__kmpc_free_shared(ptr [[E1]], i64 8)
74 // CHECK1-NEXT: call void @__kmpc_target_deinit()
75 // CHECK1-NEXT: ret void
76 // CHECK1: worker.exit:
77 // CHECK1-NEXT: ret void
80 // CHECK1-LABEL: define {{[^@]+}}@{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z9ftemplateIcET_i_l20_omp_outlined
81 // CHECK1-SAME: (ptr noalias noundef [[DOTGLOBAL_TID_:%.*]], ptr noalias noundef [[DOTBOUND_TID_:%.*]], ptr noundef nonnull align 8 dereferenceable(8) [[E:%.*]]) #[[ATTR2:[0-9]+]] {
82 // CHECK1-NEXT: entry:
83 // CHECK1-NEXT: [[DOTGLOBAL_TID__ADDR:%.*]] = alloca ptr, align 8
84 // CHECK1-NEXT: [[DOTBOUND_TID__ADDR:%.*]] = alloca ptr, align 8
85 // CHECK1-NEXT: [[E_ADDR:%.*]] = alloca ptr, align 8
86 // CHECK1-NEXT: [[DOTOMP_REDUCTION_RED_LIST:%.*]] = alloca [1 x ptr], align 8
87 // CHECK1-NEXT: store ptr [[DOTGLOBAL_TID_]], ptr [[DOTGLOBAL_TID__ADDR]], align 8
88 // CHECK1-NEXT: store ptr [[DOTBOUND_TID_]], ptr [[DOTBOUND_TID__ADDR]], align 8
89 // CHECK1-NEXT: store ptr [[E]], ptr [[E_ADDR]], align 8
90 // CHECK1-NEXT: [[TMP0:%.*]] = load ptr, ptr [[E_ADDR]], align 8
91 // CHECK1-NEXT: [[E1:%.*]] = call align 8 ptr @__kmpc_alloc_shared(i64 8)
92 // CHECK1-NEXT: store double 0.000000e+00, ptr [[E1]], align 8
93 // CHECK1-NEXT: [[TMP1:%.*]] = load double, ptr [[E1]], align 8
94 // CHECK1-NEXT: [[ADD:%.*]] = fadd double [[TMP1]], 5.000000e+00
95 // CHECK1-NEXT: store double [[ADD]], ptr [[E1]], align 8
96 // CHECK1-NEXT: [[TMP2:%.*]] = getelementptr inbounds [1 x ptr], ptr [[DOTOMP_REDUCTION_RED_LIST]], i64 0, i64 0
97 // CHECK1-NEXT: store ptr [[E1]], ptr [[TMP2]], align 8
98 // CHECK1-NEXT: %"_openmp_teams_reductions_buffer_$_$ptr" = call ptr @__kmpc_reduction_get_fixed_buffer()
99 // CHECK1-NEXT: [[TMP3:%.*]] = call i32 @__kmpc_nvptx_teams_reduce_nowait_v2(ptr @[[GLOB1]], ptr %"_openmp_teams_reductions_buffer_$_$ptr", i32 1024, i64 8, ptr [[DOTOMP_REDUCTION_RED_LIST]], ptr @_omp_reduction_shuffle_and_reduce_func, ptr @_omp_reduction_inter_warp_copy_func, ptr @_omp_reduction_list_to_global_copy_func, ptr @_omp_reduction_list_to_global_reduce_func, ptr @_omp_reduction_global_to_list_copy_func, ptr @_omp_reduction_global_to_list_reduce_func)
100 // CHECK1-NEXT: [[TMP4:%.*]] = icmp eq i32 [[TMP3]], 1
101 // CHECK1-NEXT: br i1 [[TMP4]], label [[DOTOMP_REDUCTION_THEN:%.*]], label [[DOTOMP_REDUCTION_DONE:%.*]]
102 // CHECK1: .omp.reduction.then:
103 // CHECK1-NEXT: [[TMP5:%.*]] = load double, ptr [[TMP0]], align 8
104 // CHECK1-NEXT: [[TMP6:%.*]] = load double, ptr [[E1]], align 8
105 // CHECK1-NEXT: [[ADD2:%.*]] = fadd double [[TMP5]], [[TMP6]]
106 // CHECK1-NEXT: store double [[ADD2]], ptr [[TMP0]], align 8
107 // CHECK1-NEXT: br label [[DOTOMP_REDUCTION_DONE]]
108 // CHECK1: .omp.reduction.done:
109 // CHECK1-NEXT: call void @__kmpc_free_shared(ptr [[E1]], i64 8)
110 // CHECK1-NEXT: ret void
113 // CHECK1-LABEL: define {{[^@]+}}@_omp_reduction_shuffle_and_reduce_func
114 // CHECK1-SAME: (ptr noundef [[TMP0:%.*]], i16 noundef signext [[TMP1:%.*]], i16 noundef signext [[TMP2:%.*]], i16 noundef signext [[TMP3:%.*]]) #[[ATTR3:[0-9]+]] {
115 // CHECK1-NEXT: entry:
116 // CHECK1-NEXT: [[DOTADDR:%.*]] = alloca ptr, align 8
117 // CHECK1-NEXT: [[DOTADDR1:%.*]] = alloca i16, align 2
118 // CHECK1-NEXT: [[DOTADDR2:%.*]] = alloca i16, align 2
119 // CHECK1-NEXT: [[DOTADDR3:%.*]] = alloca i16, align 2
120 // CHECK1-NEXT: [[DOTOMP_REDUCTION_REMOTE_REDUCE_LIST:%.*]] = alloca [1 x ptr], align 8
121 // CHECK1-NEXT: [[DOTOMP_REDUCTION_ELEMENT:%.*]] = alloca double, align 8
122 // CHECK1-NEXT: store ptr [[TMP0]], ptr [[DOTADDR]], align 8
123 // CHECK1-NEXT: store i16 [[TMP1]], ptr [[DOTADDR1]], align 2
124 // CHECK1-NEXT: store i16 [[TMP2]], ptr [[DOTADDR2]], align 2
125 // CHECK1-NEXT: store i16 [[TMP3]], ptr [[DOTADDR3]], align 2
126 // CHECK1-NEXT: [[TMP4:%.*]] = load ptr, ptr [[DOTADDR]], align 8
127 // CHECK1-NEXT: [[TMP5:%.*]] = load i16, ptr [[DOTADDR1]], align 2
128 // CHECK1-NEXT: [[TMP6:%.*]] = load i16, ptr [[DOTADDR2]], align 2
129 // CHECK1-NEXT: [[TMP7:%.*]] = load i16, ptr [[DOTADDR3]], align 2
130 // CHECK1-NEXT: [[TMP8:%.*]] = getelementptr inbounds [1 x ptr], ptr [[TMP4]], i64 0, i64 0
131 // CHECK1-NEXT: [[TMP9:%.*]] = load ptr, ptr [[TMP8]], align 8
132 // CHECK1-NEXT: [[TMP10:%.*]] = getelementptr inbounds [1 x ptr], ptr [[DOTOMP_REDUCTION_REMOTE_REDUCE_LIST]], i64 0, i64 0
133 // CHECK1-NEXT: [[TMP11:%.*]] = getelementptr double, ptr [[TMP9]], i64 1
134 // CHECK1-NEXT: [[TMP12:%.*]] = load i64, ptr [[TMP9]], align 8
135 // CHECK1-NEXT: [[TMP13:%.*]] = call i32 @__kmpc_get_warp_size()
136 // CHECK1-NEXT: [[TMP14:%.*]] = trunc i32 [[TMP13]] to i16
137 // CHECK1-NEXT: [[TMP15:%.*]] = call i64 @__kmpc_shuffle_int64(i64 [[TMP12]], i16 [[TMP6]], i16 [[TMP14]])
138 // CHECK1-NEXT: store i64 [[TMP15]], ptr [[DOTOMP_REDUCTION_ELEMENT]], align 8
139 // CHECK1-NEXT: [[TMP16:%.*]] = getelementptr i64, ptr [[TMP9]], i64 1
140 // CHECK1-NEXT: [[TMP17:%.*]] = getelementptr i64, ptr [[DOTOMP_REDUCTION_ELEMENT]], i64 1
141 // CHECK1-NEXT: store ptr [[DOTOMP_REDUCTION_ELEMENT]], ptr [[TMP10]], align 8
142 // CHECK1-NEXT: [[TMP18:%.*]] = icmp eq i16 [[TMP7]], 0
143 // CHECK1-NEXT: [[TMP19:%.*]] = icmp eq i16 [[TMP7]], 1
144 // CHECK1-NEXT: [[TMP20:%.*]] = icmp ult i16 [[TMP5]], [[TMP6]]
145 // CHECK1-NEXT: [[TMP21:%.*]] = and i1 [[TMP19]], [[TMP20]]
146 // CHECK1-NEXT: [[TMP22:%.*]] = icmp eq i16 [[TMP7]], 2
147 // CHECK1-NEXT: [[TMP23:%.*]] = and i16 [[TMP5]], 1
148 // CHECK1-NEXT: [[TMP24:%.*]] = icmp eq i16 [[TMP23]], 0
149 // CHECK1-NEXT: [[TMP25:%.*]] = and i1 [[TMP22]], [[TMP24]]
150 // CHECK1-NEXT: [[TMP26:%.*]] = icmp sgt i16 [[TMP6]], 0
151 // CHECK1-NEXT: [[TMP27:%.*]] = and i1 [[TMP25]], [[TMP26]]
152 // CHECK1-NEXT: [[TMP28:%.*]] = or i1 [[TMP18]], [[TMP21]]
153 // CHECK1-NEXT: [[TMP29:%.*]] = or i1 [[TMP28]], [[TMP27]]
154 // CHECK1-NEXT: br i1 [[TMP29]], label [[THEN:%.*]], label [[ELSE:%.*]]
155 // CHECK1: then:
156 // CHECK1-NEXT: call void @"{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z9ftemplateIcET_i_l20_omp_outlined_omp$reduction$reduction_func"(ptr [[TMP4]], ptr [[DOTOMP_REDUCTION_REMOTE_REDUCE_LIST]]) #[[ATTR4]]
157 // CHECK1-NEXT: br label [[IFCONT:%.*]]
158 // CHECK1: else:
159 // CHECK1-NEXT: br label [[IFCONT]]
160 // CHECK1: ifcont:
161 // CHECK1-NEXT: [[TMP30:%.*]] = icmp eq i16 [[TMP7]], 1
162 // CHECK1-NEXT: [[TMP31:%.*]] = icmp uge i16 [[TMP5]], [[TMP6]]
163 // CHECK1-NEXT: [[TMP32:%.*]] = and i1 [[TMP30]], [[TMP31]]
164 // CHECK1-NEXT: br i1 [[TMP32]], label [[THEN4:%.*]], label [[ELSE5:%.*]]
165 // CHECK1: then4:
166 // CHECK1-NEXT: [[TMP33:%.*]] = getelementptr inbounds [1 x ptr], ptr [[DOTOMP_REDUCTION_REMOTE_REDUCE_LIST]], i64 0, i64 0
167 // CHECK1-NEXT: [[TMP34:%.*]] = load ptr, ptr [[TMP33]], align 8
168 // CHECK1-NEXT: [[TMP35:%.*]] = getelementptr inbounds [1 x ptr], ptr [[TMP4]], i64 0, i64 0
169 // CHECK1-NEXT: [[TMP36:%.*]] = load ptr, ptr [[TMP35]], align 8
170 // CHECK1-NEXT: [[TMP37:%.*]] = load double, ptr [[TMP34]], align 8
171 // CHECK1-NEXT: store double [[TMP37]], ptr [[TMP36]], align 8
172 // CHECK1-NEXT: br label [[IFCONT6:%.*]]
173 // CHECK1: else5:
174 // CHECK1-NEXT: br label [[IFCONT6]]
175 // CHECK1: ifcont6:
176 // CHECK1-NEXT: ret void
179 // CHECK1-LABEL: define {{[^@]+}}@_omp_reduction_inter_warp_copy_func
180 // CHECK1-SAME: (ptr noundef [[TMP0:%.*]], i32 noundef [[TMP1:%.*]]) #[[ATTR3]] {
181 // CHECK1-NEXT: entry:
182 // CHECK1-NEXT: [[DOTADDR:%.*]] = alloca ptr, align 8
183 // CHECK1-NEXT: [[DOTADDR1:%.*]] = alloca i32, align 4
184 // CHECK1-NEXT: [[DOTCNT_ADDR:%.*]] = alloca i32, align 4
185 // CHECK1-NEXT: store ptr [[TMP0]], ptr [[DOTADDR]], align 8
186 // CHECK1-NEXT: store i32 [[TMP1]], ptr [[DOTADDR1]], align 4
187 // CHECK1-NEXT: [[TMP3:%.*]] = call i32 @__kmpc_get_hardware_thread_id_in_block()
188 // CHECK1-NEXT: [[TMP4:%.*]] = call i32 @__kmpc_get_hardware_thread_id_in_block()
189 // CHECK1-NEXT: [[NVPTX_LANE_ID:%.*]] = and i32 [[TMP4]], 31
190 // CHECK1-NEXT: [[TMP5:%.*]] = call i32 @__kmpc_get_hardware_thread_id_in_block()
191 // CHECK1-NEXT: [[NVPTX_WARP_ID:%.*]] = ashr i32 [[TMP5]], 5
192 // CHECK1-NEXT: [[TMP6:%.*]] = load ptr, ptr [[DOTADDR]], align 8
193 // CHECK1-NEXT: store i32 0, ptr [[DOTCNT_ADDR]], align 4
194 // CHECK1-NEXT: br label [[PRECOND:%.*]]
195 // CHECK1: precond:
196 // CHECK1-NEXT: [[TMP7:%.*]] = load i32, ptr [[DOTCNT_ADDR]], align 4
197 // CHECK1-NEXT: [[TMP8:%.*]] = icmp ult i32 [[TMP7]], 2
198 // CHECK1-NEXT: br i1 [[TMP8]], label [[BODY:%.*]], label [[EXIT:%.*]]
199 // CHECK1: body:
200 // CHECK1-NEXT: [[TMP2:%.*]] = call i32 @__kmpc_global_thread_num(ptr @[[GLOB1]])
201 // CHECK1-NEXT: call void @__kmpc_barrier(ptr @[[GLOB2:[0-9]+]], i32 [[TMP2]])
202 // CHECK1-NEXT: [[WARP_MASTER:%.*]] = icmp eq i32 [[NVPTX_LANE_ID]], 0
203 // CHECK1-NEXT: br i1 [[WARP_MASTER]], label [[THEN:%.*]], label [[ELSE:%.*]]
204 // CHECK1: then:
205 // CHECK1-NEXT: [[TMP9:%.*]] = getelementptr inbounds [1 x ptr], ptr [[TMP6]], i64 0, i64 0
206 // CHECK1-NEXT: [[TMP10:%.*]] = load ptr, ptr [[TMP9]], align 8
207 // CHECK1-NEXT: [[TMP11:%.*]] = getelementptr i32, ptr [[TMP10]], i32 [[TMP7]]
208 // CHECK1-NEXT: [[TMP12:%.*]] = getelementptr inbounds [32 x i32], ptr addrspace(3) @__openmp_nvptx_data_transfer_temporary_storage, i64 0, i32 [[NVPTX_WARP_ID]]
209 // CHECK1-NEXT: [[TMP13:%.*]] = load i32, ptr [[TMP11]], align 4
210 // CHECK1-NEXT: store volatile i32 [[TMP13]], ptr addrspace(3) [[TMP12]], align 4
211 // CHECK1-NEXT: br label [[IFCONT:%.*]]
212 // CHECK1: else:
213 // CHECK1-NEXT: br label [[IFCONT]]
214 // CHECK1: ifcont:
215 // CHECK1-NEXT: [[TMP2:%.*]] = call i32 @__kmpc_global_thread_num(ptr @[[GLOB1]])
216 // CHECK1-NEXT: call void @__kmpc_barrier(ptr @[[GLOB2]], i32 [[TMP2]])
217 // CHECK1-NEXT: [[TMP14:%.*]] = load i32, ptr [[DOTADDR1]], align 4
218 // CHECK1-NEXT: [[IS_ACTIVE_THREAD:%.*]] = icmp ult i32 [[TMP3]], [[TMP14]]
219 // CHECK1-NEXT: br i1 [[IS_ACTIVE_THREAD]], label [[THEN2:%.*]], label [[ELSE3:%.*]]
220 // CHECK1: then3:
221 // CHECK1-NEXT: [[TMP15:%.*]] = getelementptr inbounds [32 x i32], ptr addrspace(3) @__openmp_nvptx_data_transfer_temporary_storage, i64 0, i32 [[TMP3]]
222 // CHECK1-NEXT: [[TMP16:%.*]] = getelementptr inbounds [1 x ptr], ptr [[TMP6]], i64 0, i64 0
223 // CHECK1-NEXT: [[TMP17:%.*]] = load ptr, ptr [[TMP16]], align 8
224 // CHECK1-NEXT: [[TMP18:%.*]] = getelementptr i32, ptr [[TMP17]], i32 [[TMP7]]
225 // CHECK1-NEXT: [[TMP19:%.*]] = load volatile i32, ptr addrspace(3) [[TMP15]], align 4
226 // CHECK1-NEXT: store i32 [[TMP19]], ptr [[TMP18]], align 4
227 // CHECK1-NEXT: br label [[IFCONT4:%.*]]
228 // CHECK1: else4:
229 // CHECK1-NEXT: br label [[IFCONT4]]
230 // CHECK1: ifcont5:
231 // CHECK1-NEXT: [[TMP20:%.*]] = add nsw i32 [[TMP7]], 1
232 // CHECK1-NEXT: store i32 [[TMP20]], ptr [[DOTCNT_ADDR]], align 4
233 // CHECK1-NEXT: br label [[PRECOND]]
234 // CHECK1: exit:
235 // CHECK1-NEXT: ret void
238 // CHECK1-LABEL: define {{[^@]+}}@_omp_reduction_list_to_global_copy_func
239 // CHECK1-SAME: (ptr noundef [[TMP0:%.*]], i32 noundef [[TMP1:%.*]], ptr noundef [[TMP2:%.*]]) #[[ATTR3]] {
240 // CHECK1-NEXT: entry:
241 // CHECK1-NEXT: [[DOTADDR:%.*]] = alloca ptr, align 8
242 // CHECK1-NEXT: [[DOTADDR1:%.*]] = alloca i32, align 4
243 // CHECK1-NEXT: [[DOTADDR2:%.*]] = alloca ptr, align 8
244 // CHECK1-NEXT: store ptr [[TMP0]], ptr [[DOTADDR]], align 8
245 // CHECK1-NEXT: store i32 [[TMP1]], ptr [[DOTADDR1]], align 4
246 // CHECK1-NEXT: store ptr [[TMP2]], ptr [[DOTADDR2]], align 8
247 // CHECK1-NEXT: [[TMP3:%.*]] = load ptr, ptr [[DOTADDR2]], align 8
248 // CHECK1-NEXT: [[TMP4:%.*]] = load ptr, ptr [[DOTADDR]], align 8
249 // CHECK1-NEXT: [[TMP5:%.*]] = load i32, ptr [[DOTADDR1]], align 4
250 // CHECK1-NEXT: [[TMP6:%.*]] = getelementptr inbounds [1 x ptr], ptr [[TMP3]], i64 0, i64 0
251 // CHECK1-NEXT: [[TMP7:%.*]] = load ptr, ptr [[TMP6]], align 8
252 // CHECK1-NEXT: [[TMP8:%.*]] = getelementptr inbounds [[STRUCT__GLOBALIZED_LOCALS_TY:%.*]], ptr [[TMP4]], i32 [[TMP5]]
253 // CHECK1-NEXT: [[E:%.*]] = getelementptr inbounds [[STRUCT__GLOBALIZED_LOCALS_TY]], ptr [[TMP8]], i32 0, i32 0
254 // CHECK1-NEXT: [[TMP9:%.*]] = load double, ptr [[TMP7]], align 8
255 // CHECK1-NEXT: store double [[TMP9]], ptr [[E]], align 8
256 // CHECK1-NEXT: ret void
259 // CHECK1-LABEL: define {{[^@]+}}@_omp_reduction_list_to_global_reduce_func
260 // CHECK1-SAME: (ptr noundef [[TMP0:%.*]], i32 noundef [[TMP1:%.*]], ptr noundef [[TMP2:%.*]]) #[[ATTR3]] {
261 // CHECK1-NEXT: entry:
262 // CHECK1-NEXT: [[DOTADDR:%.*]] = alloca ptr, align 8
263 // CHECK1-NEXT: [[DOTADDR1:%.*]] = alloca i32, align 4
264 // CHECK1-NEXT: [[DOTADDR2:%.*]] = alloca ptr, align 8
265 // CHECK1-NEXT: [[DOTOMP_REDUCTION_RED_LIST:%.*]] = alloca [1 x ptr], align 8
266 // CHECK1-NEXT: store ptr [[TMP0]], ptr [[DOTADDR]], align 8
267 // CHECK1-NEXT: store i32 [[TMP1]], ptr [[DOTADDR1]], align 4
268 // CHECK1-NEXT: store ptr [[TMP2]], ptr [[DOTADDR2]], align 8
269 // CHECK1-NEXT: [[TMP3:%.*]] = load ptr, ptr [[DOTADDR]], align 8
270 // CHECK1-NEXT: [[TMP4:%.*]] = load i32, ptr [[DOTADDR1]], align 4
271 // CHECK1-NEXT: [[TMP5:%.*]] = getelementptr inbounds [1 x ptr], ptr [[DOTOMP_REDUCTION_RED_LIST]], i64 0, i64 0
272 // CHECK1-NEXT: [[TMP6:%.*]] = getelementptr inbounds [[STRUCT__GLOBALIZED_LOCALS_TY:%.*]], ptr [[TMP3]], i32 [[TMP4]]
273 // CHECK1-NEXT: [[E:%.*]] = getelementptr inbounds [[STRUCT__GLOBALIZED_LOCALS_TY]], ptr [[TMP6]], i32 0, i32 0
274 // CHECK1-NEXT: store ptr [[E]], ptr [[TMP5]], align 8
275 // CHECK1-NEXT: [[TMP7:%.*]] = load ptr, ptr [[DOTADDR2]], align 8
276 // CHECK1-NEXT: call void @"{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z9ftemplateIcET_i_l20_omp_outlined_omp$reduction$reduction_func"(ptr [[DOTOMP_REDUCTION_RED_LIST]], ptr [[TMP7]]) #[[ATTR4]]
277 // CHECK1-NEXT: ret void
280 // CHECK1-LABEL: define {{[^@]+}}@_omp_reduction_global_to_list_copy_func
281 // CHECK1-SAME: (ptr noundef [[TMP0:%.*]], i32 noundef [[TMP1:%.*]], ptr noundef [[TMP2:%.*]]) #[[ATTR3]] {
282 // CHECK1-NEXT: entry:
283 // CHECK1-NEXT: [[DOTADDR:%.*]] = alloca ptr, align 8
284 // CHECK1-NEXT: [[DOTADDR1:%.*]] = alloca i32, align 4
285 // CHECK1-NEXT: [[DOTADDR2:%.*]] = alloca ptr, align 8
286 // CHECK1-NEXT: store ptr [[TMP0]], ptr [[DOTADDR]], align 8
287 // CHECK1-NEXT: store i32 [[TMP1]], ptr [[DOTADDR1]], align 4
288 // CHECK1-NEXT: store ptr [[TMP2]], ptr [[DOTADDR2]], align 8
289 // CHECK1-NEXT: [[TMP3:%.*]] = load ptr, ptr [[DOTADDR2]], align 8
290 // CHECK1-NEXT: [[TMP4:%.*]] = load ptr, ptr [[DOTADDR]], align 8
291 // CHECK1-NEXT: [[TMP5:%.*]] = load i32, ptr [[DOTADDR1]], align 4
292 // CHECK1-NEXT: [[TMP6:%.*]] = getelementptr inbounds [1 x ptr], ptr [[TMP3]], i64 0, i64 0
293 // CHECK1-NEXT: [[TMP7:%.*]] = load ptr, ptr [[TMP6]], align 8
294 // CHECK1-NEXT: [[TMP8:%.*]] = getelementptr inbounds [[STRUCT__GLOBALIZED_LOCALS_TY:%.*]], ptr [[TMP4]], i32 [[TMP5]]
295 // CHECK1-NEXT: [[E:%.*]] = getelementptr inbounds [[STRUCT__GLOBALIZED_LOCALS_TY]], ptr [[TMP8]], i32 0, i32 0
296 // CHECK1-NEXT: [[TMP9:%.*]] = load double, ptr [[E]], align 8
297 // CHECK1-NEXT: store double [[TMP9]], ptr [[TMP7]], align 8
298 // CHECK1-NEXT: ret void
301 // CHECK1-LABEL: define {{[^@]+}}@_omp_reduction_global_to_list_reduce_func
302 // CHECK1-SAME: (ptr noundef [[TMP0:%.*]], i32 noundef [[TMP1:%.*]], ptr noundef [[TMP2:%.*]]) #[[ATTR3]] {
303 // CHECK1-NEXT: entry:
304 // CHECK1-NEXT: [[DOTADDR:%.*]] = alloca ptr, align 8
305 // CHECK1-NEXT: [[DOTADDR1:%.*]] = alloca i32, align 4
306 // CHECK1-NEXT: [[DOTADDR2:%.*]] = alloca ptr, align 8
307 // CHECK1-NEXT: [[DOTOMP_REDUCTION_RED_LIST:%.*]] = alloca [1 x ptr], align 8
308 // CHECK1-NEXT: store ptr [[TMP0]], ptr [[DOTADDR]], align 8
309 // CHECK1-NEXT: store i32 [[TMP1]], ptr [[DOTADDR1]], align 4
310 // CHECK1-NEXT: store ptr [[TMP2]], ptr [[DOTADDR2]], align 8
311 // CHECK1-NEXT: [[TMP3:%.*]] = load ptr, ptr [[DOTADDR]], align 8
312 // CHECK1-NEXT: [[TMP4:%.*]] = load i32, ptr [[DOTADDR1]], align 4
313 // CHECK1-NEXT: [[TMP5:%.*]] = getelementptr inbounds [1 x ptr], ptr [[DOTOMP_REDUCTION_RED_LIST]], i64 0, i64 0
314 // CHECK1-NEXT: [[TMP6:%.*]] = getelementptr inbounds [[STRUCT__GLOBALIZED_LOCALS_TY:%.*]], ptr [[TMP3]], i32 [[TMP4]]
315 // CHECK1-NEXT: [[E:%.*]] = getelementptr inbounds [[STRUCT__GLOBALIZED_LOCALS_TY]], ptr [[TMP6]], i32 0, i32 0
316 // CHECK1-NEXT: store ptr [[E]], ptr [[TMP5]], align 8
317 // CHECK1-NEXT: [[TMP7:%.*]] = load ptr, ptr [[DOTADDR2]], align 8
318 // CHECK1-NEXT: call void @"{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z9ftemplateIcET_i_l20_omp_outlined_omp$reduction$reduction_func"(ptr [[TMP7]], ptr [[DOTOMP_REDUCTION_RED_LIST]]) #[[ATTR4]]
319 // CHECK1-NEXT: ret void
322 // CHECK1-LABEL: define {{[^@]+}}@{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z9ftemplateIcET_i_l26
323 // CHECK1-SAME: (ptr noalias noundef [[DYN_PTR:%.*]], i64 noundef [[C:%.*]], i64 noundef [[D:%.*]]) #[[ATTR0]] {
324 // CHECK1-NEXT: entry:
325 // CHECK1-NEXT: [[DYN_PTR_ADDR:%.*]] = alloca ptr, align 8
326 // CHECK1-NEXT: [[C_ADDR:%.*]] = alloca i64, align 8
327 // CHECK1-NEXT: [[D_ADDR:%.*]] = alloca i64, align 8
328 // CHECK1-NEXT: [[DOTZERO_ADDR:%.*]] = alloca i32, align 4
329 // CHECK1-NEXT: [[DOTTHREADID_TEMP_:%.*]] = alloca i32, align 4
330 // CHECK1-NEXT: store ptr [[DYN_PTR]], ptr [[DYN_PTR_ADDR]], align 8
331 // CHECK1-NEXT: store i64 [[C]], ptr [[C_ADDR]], align 8
332 // CHECK1-NEXT: store i64 [[D]], ptr [[D_ADDR]], align 8
333 // CHECK1-NEXT: [[TMP0:%.*]] = call i32 @__kmpc_target_init(ptr @{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z9ftemplateIcET_i_l26_kernel_environment, ptr [[DYN_PTR]])
334 // CHECK1-NEXT: [[EXEC_USER_CODE:%.*]] = icmp eq i32 [[TMP0]], -1
335 // CHECK1-NEXT: br i1 [[EXEC_USER_CODE]], label [[USER_CODE_ENTRY:%.*]], label [[WORKER_EXIT:%.*]]
336 // CHECK1: user_code.entry:
337 // CHECK1-NEXT: [[TMP1:%.*]] = load i8, ptr [[C_ADDR]], align 1
338 // CHECK1-NEXT: [[C1:%.*]] = call align 8 ptr @__kmpc_alloc_shared(i64 1)
339 // CHECK1-NEXT: store i8 [[TMP1]], ptr [[C1]], align 1
340 // CHECK1-NEXT: [[TMP2:%.*]] = load float, ptr [[D_ADDR]], align 4
341 // CHECK1-NEXT: [[D2:%.*]] = call align 8 ptr @__kmpc_alloc_shared(i64 4)
342 // CHECK1-NEXT: store float [[TMP2]], ptr [[D2]], align 4
343 // CHECK1-NEXT: [[TMP3:%.*]] = call i32 @__kmpc_global_thread_num(ptr @[[GLOB1]])
344 // CHECK1-NEXT: store i32 0, ptr [[DOTZERO_ADDR]], align 4
345 // CHECK1-NEXT: store i32 [[TMP3]], ptr [[DOTTHREADID_TEMP_]], align 4
346 // CHECK1-NEXT: call void @{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z9ftemplateIcET_i_l26_omp_outlined(ptr [[DOTTHREADID_TEMP_]], ptr [[DOTZERO_ADDR]], ptr [[C1]], ptr [[D2]]) #[[ATTR4]]
347 // CHECK1-NEXT: call void @__kmpc_free_shared(ptr [[D2]], i64 4)
348 // CHECK1-NEXT: call void @__kmpc_free_shared(ptr [[C1]], i64 1)
349 // CHECK1-NEXT: call void @__kmpc_target_deinit()
350 // CHECK1-NEXT: ret void
351 // CHECK1: worker.exit:
352 // CHECK1-NEXT: ret void
355 // CHECK1-LABEL: define {{[^@]+}}@{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z9ftemplateIcET_i_l26_omp_outlined
356 // CHECK1-SAME: (ptr noalias noundef [[DOTGLOBAL_TID_:%.*]], ptr noalias noundef [[DOTBOUND_TID_:%.*]], ptr noundef nonnull align 1 dereferenceable(1) [[C:%.*]], ptr noundef nonnull align 4 dereferenceable(4) [[D:%.*]]) #[[ATTR2]] {
357 // CHECK1-NEXT: entry:
358 // CHECK1-NEXT: [[DOTGLOBAL_TID__ADDR:%.*]] = alloca ptr, align 8
359 // CHECK1-NEXT: [[DOTBOUND_TID__ADDR:%.*]] = alloca ptr, align 8
360 // CHECK1-NEXT: [[C_ADDR:%.*]] = alloca ptr, align 8
361 // CHECK1-NEXT: [[D_ADDR:%.*]] = alloca ptr, align 8
362 // CHECK1-NEXT: [[DOTOMP_REDUCTION_RED_LIST:%.*]] = alloca [2 x ptr], align 8
363 // CHECK1-NEXT: store ptr [[DOTGLOBAL_TID_]], ptr [[DOTGLOBAL_TID__ADDR]], align 8
364 // CHECK1-NEXT: store ptr [[DOTBOUND_TID_]], ptr [[DOTBOUND_TID__ADDR]], align 8
365 // CHECK1-NEXT: store ptr [[C]], ptr [[C_ADDR]], align 8
366 // CHECK1-NEXT: store ptr [[D]], ptr [[D_ADDR]], align 8
367 // CHECK1-NEXT: [[TMP0:%.*]] = load ptr, ptr [[C_ADDR]], align 8
368 // CHECK1-NEXT: [[TMP1:%.*]] = load ptr, ptr [[D_ADDR]], align 8
369 // CHECK1-NEXT: [[C1:%.*]] = call align 8 ptr @__kmpc_alloc_shared(i64 1)
370 // CHECK1-NEXT: [[D2:%.*]] = call align 8 ptr @__kmpc_alloc_shared(i64 4)
371 // CHECK1-NEXT: store i8 0, ptr [[C1]], align 1
372 // CHECK1-NEXT: store float 1.000000e+00, ptr [[D2]], align 4
373 // CHECK1-NEXT: [[TMP2:%.*]] = load i8, ptr [[C1]], align 1
374 // CHECK1-NEXT: [[CONV:%.*]] = sext i8 [[TMP2]] to i32
375 // CHECK1-NEXT: [[XOR:%.*]] = xor i32 [[CONV]], 2
376 // CHECK1-NEXT: [[CONV3:%.*]] = trunc i32 [[XOR]] to i8
377 // CHECK1-NEXT: store i8 [[CONV3]], ptr [[C1]], align 1
378 // CHECK1-NEXT: [[TMP3:%.*]] = load float, ptr [[D2]], align 4
379 // CHECK1-NEXT: [[MUL:%.*]] = fmul float [[TMP3]], 3.300000e+01
380 // CHECK1-NEXT: store float [[MUL]], ptr [[D2]], align 4
381 // CHECK1-NEXT: [[TMP4:%.*]] = getelementptr inbounds [2 x ptr], ptr [[DOTOMP_REDUCTION_RED_LIST]], i64 0, i64 0
382 // CHECK1-NEXT: store ptr [[C1]], ptr [[TMP4]], align 8
383 // CHECK1-NEXT: [[TMP5:%.*]] = getelementptr inbounds [2 x ptr], ptr [[DOTOMP_REDUCTION_RED_LIST]], i64 0, i64 1
384 // CHECK1-NEXT: store ptr [[D2]], ptr [[TMP5]], align 8
385 // CHECK1-NEXT: %"_openmp_teams_reductions_buffer_$_$ptr" = call ptr @__kmpc_reduction_get_fixed_buffer()
386 // CHECK1-NEXT: [[TMP6:%.*]] = call i32 @__kmpc_nvptx_teams_reduce_nowait_v2(ptr @[[GLOB1]], ptr %"_openmp_teams_reductions_buffer_$_$ptr", i32 1024, i64 8, ptr [[DOTOMP_REDUCTION_RED_LIST]], ptr @_omp_reduction_shuffle_and_reduce_func1, ptr @_omp_reduction_inter_warp_copy_func2, ptr @_omp_reduction_list_to_global_copy_func3, ptr @_omp_reduction_list_to_global_reduce_func4, ptr @_omp_reduction_global_to_list_copy_func5, ptr @_omp_reduction_global_to_list_reduce_func6)
387 // CHECK1-NEXT: [[TMP7:%.*]] = icmp eq i32 [[TMP6]], 1
388 // CHECK1-NEXT: br i1 [[TMP7]], label [[DOTOMP_REDUCTION_THEN:%.*]], label [[DOTOMP_REDUCTION_DONE:%.*]]
389 // CHECK1: .omp.reduction.then:
390 // CHECK1-NEXT: [[TMP8:%.*]] = load i8, ptr [[TMP0]], align 1
391 // CHECK1-NEXT: [[CONV4:%.*]] = sext i8 [[TMP8]] to i32
392 // CHECK1-NEXT: [[TMP9:%.*]] = load i8, ptr [[C1]], align 1
393 // CHECK1-NEXT: [[CONV5:%.*]] = sext i8 [[TMP9]] to i32
394 // CHECK1-NEXT: [[XOR6:%.*]] = xor i32 [[CONV4]], [[CONV5]]
395 // CHECK1-NEXT: [[CONV7:%.*]] = trunc i32 [[XOR6]] to i8
396 // CHECK1-NEXT: store i8 [[CONV7]], ptr [[TMP0]], align 1
397 // CHECK1-NEXT: [[TMP10:%.*]] = load float, ptr [[TMP1]], align 4
398 // CHECK1-NEXT: [[TMP11:%.*]] = load float, ptr [[D2]], align 4
399 // CHECK1-NEXT: [[MUL8:%.*]] = fmul float [[TMP10]], [[TMP11]]
400 // CHECK1-NEXT: store float [[MUL8]], ptr [[TMP1]], align 4
401 // CHECK1-NEXT: br label [[DOTOMP_REDUCTION_DONE]]
402 // CHECK1: .omp.reduction.done:
403 // CHECK1-NEXT: call void @__kmpc_free_shared(ptr [[D2]], i64 4)
404 // CHECK1-NEXT: call void @__kmpc_free_shared(ptr [[C1]], i64 1)
405 // CHECK1-NEXT: ret void
408 // CHECK1-LABEL: define {{[^@]+}}@_omp_reduction_shuffle_and_reduce_func1
409 // CHECK1-SAME: (ptr noundef [[TMP0:%.*]], i16 noundef signext [[TMP1:%.*]], i16 noundef signext [[TMP2:%.*]], i16 noundef signext [[TMP3:%.*]]) #[[ATTR3]] {
410 // CHECK1-NEXT: entry:
411 // CHECK1-NEXT: [[DOTADDR:%.*]] = alloca ptr, align 8
412 // CHECK1-NEXT: [[DOTADDR1:%.*]] = alloca i16, align 2
413 // CHECK1-NEXT: [[DOTADDR2:%.*]] = alloca i16, align 2
414 // CHECK1-NEXT: [[DOTADDR3:%.*]] = alloca i16, align 2
415 // CHECK1-NEXT: [[DOTOMP_REDUCTION_REMOTE_REDUCE_LIST:%.*]] = alloca [2 x ptr], align 8
416 // CHECK1-NEXT: [[DOTOMP_REDUCTION_ELEMENT:%.*]] = alloca i8, align 1
417 // CHECK1-NEXT: [[DOTOMP_REDUCTION_ELEMENT4:%.*]] = alloca float, align 4
418 // CHECK1-NEXT: store ptr [[TMP0]], ptr [[DOTADDR]], align 8
419 // CHECK1-NEXT: store i16 [[TMP1]], ptr [[DOTADDR1]], align 2
420 // CHECK1-NEXT: store i16 [[TMP2]], ptr [[DOTADDR2]], align 2
421 // CHECK1-NEXT: store i16 [[TMP3]], ptr [[DOTADDR3]], align 2
422 // CHECK1-NEXT: [[TMP4:%.*]] = load ptr, ptr [[DOTADDR]], align 8
423 // CHECK1-NEXT: [[TMP5:%.*]] = load i16, ptr [[DOTADDR1]], align 2
424 // CHECK1-NEXT: [[TMP6:%.*]] = load i16, ptr [[DOTADDR2]], align 2
425 // CHECK1-NEXT: [[TMP7:%.*]] = load i16, ptr [[DOTADDR3]], align 2
426 // CHECK1-NEXT: [[TMP8:%.*]] = getelementptr inbounds [2 x ptr], ptr [[TMP4]], i64 0, i64 0
427 // CHECK1-NEXT: [[TMP9:%.*]] = load ptr, ptr [[TMP8]], align 8
428 // CHECK1-NEXT: [[TMP10:%.*]] = getelementptr inbounds [2 x ptr], ptr [[DOTOMP_REDUCTION_REMOTE_REDUCE_LIST]], i64 0, i64 0
429 // CHECK1-NEXT: [[TMP11:%.*]] = getelementptr i8, ptr [[TMP9]], i64 1
430 // CHECK1-NEXT: [[TMP12:%.*]] = load i8, ptr [[TMP9]], align 1
431 // CHECK1-NEXT: [[TMP13:%.*]] = sext i8 [[TMP12]] to i32
432 // CHECK1-NEXT: [[TMP14:%.*]] = call i32 @__kmpc_get_warp_size()
433 // CHECK1-NEXT: [[TMP15:%.*]] = trunc i32 [[TMP14]] to i16
434 // CHECK1-NEXT: [[TMP16:%.*]] = call i32 @__kmpc_shuffle_int32(i32 [[TMP13]], i16 [[TMP6]], i16 [[TMP15]])
435 // CHECK1-NEXT: [[TMP17:%.*]] = trunc i32 [[TMP16]] to i8
436 // CHECK1-NEXT: store i8 [[TMP17]], ptr [[DOTOMP_REDUCTION_ELEMENT]], align 1
437 // CHECK1-NEXT: [[TMP18:%.*]] = getelementptr i8, ptr [[TMP9]], i64 1
438 // CHECK1-NEXT: [[TMP19:%.*]] = getelementptr i8, ptr [[DOTOMP_REDUCTION_ELEMENT]], i64 1
439 // CHECK1-NEXT: store ptr [[DOTOMP_REDUCTION_ELEMENT]], ptr [[TMP10]], align 8
440 // CHECK1-NEXT: [[TMP20:%.*]] = getelementptr inbounds [2 x ptr], ptr [[TMP4]], i64 0, i64 1
441 // CHECK1-NEXT: [[TMP21:%.*]] = load ptr, ptr [[TMP20]], align 8
442 // CHECK1-NEXT: [[TMP22:%.*]] = getelementptr inbounds [2 x ptr], ptr [[DOTOMP_REDUCTION_REMOTE_REDUCE_LIST]], i64 0, i64 1
443 // CHECK1-NEXT: [[TMP23:%.*]] = getelementptr float, ptr [[TMP21]], i64 1
444 // CHECK1-NEXT: [[TMP24:%.*]] = load i32, ptr [[TMP21]], align 4
445 // CHECK1-NEXT: [[TMP25:%.*]] = call i32 @__kmpc_get_warp_size()
446 // CHECK1-NEXT: [[TMP26:%.*]] = trunc i32 [[TMP25]] to i16
447 // CHECK1-NEXT: [[TMP27:%.*]] = call i32 @__kmpc_shuffle_int32(i32 [[TMP24]], i16 [[TMP6]], i16 [[TMP26]])
448 // CHECK1-NEXT: store i32 [[TMP27]], ptr [[DOTOMP_REDUCTION_ELEMENT4]], align 4
449 // CHECK1-NEXT: [[TMP28:%.*]] = getelementptr i32, ptr [[TMP21]], i64 1
450 // CHECK1-NEXT: [[TMP29:%.*]] = getelementptr i32, ptr [[DOTOMP_REDUCTION_ELEMENT4]], i64 1
451 // CHECK1-NEXT: store ptr [[DOTOMP_REDUCTION_ELEMENT4]], ptr [[TMP22]], align 8
452 // CHECK1-NEXT: [[TMP30:%.*]] = icmp eq i16 [[TMP7]], 0
453 // CHECK1-NEXT: [[TMP31:%.*]] = icmp eq i16 [[TMP7]], 1
454 // CHECK1-NEXT: [[TMP32:%.*]] = icmp ult i16 [[TMP5]], [[TMP6]]
455 // CHECK1-NEXT: [[TMP33:%.*]] = and i1 [[TMP31]], [[TMP32]]
456 // CHECK1-NEXT: [[TMP34:%.*]] = icmp eq i16 [[TMP7]], 2
457 // CHECK1-NEXT: [[TMP35:%.*]] = and i16 [[TMP5]], 1
458 // CHECK1-NEXT: [[TMP36:%.*]] = icmp eq i16 [[TMP35]], 0
459 // CHECK1-NEXT: [[TMP37:%.*]] = and i1 [[TMP34]], [[TMP36]]
460 // CHECK1-NEXT: [[TMP38:%.*]] = icmp sgt i16 [[TMP6]], 0
461 // CHECK1-NEXT: [[TMP39:%.*]] = and i1 [[TMP37]], [[TMP38]]
462 // CHECK1-NEXT: [[TMP40:%.*]] = or i1 [[TMP30]], [[TMP33]]
463 // CHECK1-NEXT: [[TMP41:%.*]] = or i1 [[TMP40]], [[TMP39]]
464 // CHECK1-NEXT: br i1 [[TMP41]], label [[THEN:%.*]], label [[ELSE:%.*]]
465 // CHECK1: then:
466 // CHECK1-NEXT: call void @"{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z9ftemplateIcET_i_l26_omp_outlined_omp$reduction$reduction_func"(ptr [[TMP4]], ptr [[DOTOMP_REDUCTION_REMOTE_REDUCE_LIST]]) #[[ATTR4]]
467 // CHECK1-NEXT: br label [[IFCONT:%.*]]
468 // CHECK1: else:
469 // CHECK1-NEXT: br label [[IFCONT]]
470 // CHECK1: ifcont:
471 // CHECK1-NEXT: [[TMP42:%.*]] = icmp eq i16 [[TMP7]], 1
472 // CHECK1-NEXT: [[TMP43:%.*]] = icmp uge i16 [[TMP5]], [[TMP6]]
473 // CHECK1-NEXT: [[TMP44:%.*]] = and i1 [[TMP42]], [[TMP43]]
474 // CHECK1-NEXT: br i1 [[TMP44]], label [[THEN5:%.*]], label [[ELSE6:%.*]]
475 // CHECK1: then5:
476 // CHECK1-NEXT: [[TMP45:%.*]] = getelementptr inbounds [2 x ptr], ptr [[DOTOMP_REDUCTION_REMOTE_REDUCE_LIST]], i64 0, i64 0
477 // CHECK1-NEXT: [[TMP46:%.*]] = load ptr, ptr [[TMP45]], align 8
478 // CHECK1-NEXT: [[TMP47:%.*]] = getelementptr inbounds [2 x ptr], ptr [[TMP4]], i64 0, i64 0
479 // CHECK1-NEXT: [[TMP48:%.*]] = load ptr, ptr [[TMP47]], align 8
480 // CHECK1-NEXT: [[TMP49:%.*]] = load i8, ptr [[TMP46]], align 1
481 // CHECK1-NEXT: store i8 [[TMP49]], ptr [[TMP48]], align 1
482 // CHECK1-NEXT: [[TMP50:%.*]] = getelementptr inbounds [2 x ptr], ptr [[DOTOMP_REDUCTION_REMOTE_REDUCE_LIST]], i64 0, i64 1
483 // CHECK1-NEXT: [[TMP51:%.*]] = load ptr, ptr [[TMP50]], align 8
484 // CHECK1-NEXT: [[TMP52:%.*]] = getelementptr inbounds [2 x ptr], ptr [[TMP4]], i64 0, i64 1
485 // CHECK1-NEXT: [[TMP53:%.*]] = load ptr, ptr [[TMP52]], align 8
486 // CHECK1-NEXT: [[TMP54:%.*]] = load float, ptr [[TMP51]], align 4
487 // CHECK1-NEXT: store float [[TMP54]], ptr [[TMP53]], align 4
488 // CHECK1-NEXT: br label [[IFCONT7:%.*]]
489 // CHECK1: else6:
490 // CHECK1-NEXT: br label [[IFCONT7]]
491 // CHECK1: ifcont7:
492 // CHECK1-NEXT: ret void
495 // CHECK1-LABEL: define {{[^@]+}}@_omp_reduction_inter_warp_copy_func2
496 // CHECK1-SAME: (ptr noundef [[TMP0:%.*]], i32 noundef [[TMP1:%.*]]) #[[ATTR3]] {
497 // CHECK1-NEXT: entry:
498 // CHECK1-NEXT: [[DOTADDR:%.*]] = alloca ptr, align 8
499 // CHECK1-NEXT: [[DOTADDR1:%.*]] = alloca i32, align 4
500 // CHECK1-NEXT: store ptr [[TMP0]], ptr [[DOTADDR]], align 8
501 // CHECK1-NEXT: store i32 [[TMP1]], ptr [[DOTADDR1]], align 4
502 // CHECK1-NEXT: [[TMP3:%.*]] = call i32 @__kmpc_get_hardware_thread_id_in_block()
503 // CHECK1-NEXT: [[TMP4:%.*]] = call i32 @__kmpc_get_hardware_thread_id_in_block()
504 // CHECK1-NEXT: [[NVPTX_LANE_ID:%.*]] = and i32 [[TMP4]], 31
505 // CHECK1-NEXT: [[TMP5:%.*]] = call i32 @__kmpc_get_hardware_thread_id_in_block()
506 // CHECK1-NEXT: [[NVPTX_WARP_ID:%.*]] = ashr i32 [[TMP5]], 5
507 // CHECK1-NEXT: [[TMP6:%.*]] = load ptr, ptr [[DOTADDR]], align 8
508 // CHECK1-NEXT: [[TMP2:%.*]] = call i32 @__kmpc_global_thread_num(ptr @[[GLOB1]])
509 // CHECK1-NEXT: call void @__kmpc_barrier(ptr @[[GLOB2]], i32 [[TMP2]])
510 // CHECK1-NEXT: [[WARP_MASTER:%.*]] = icmp eq i32 [[NVPTX_LANE_ID]], 0
511 // CHECK1-NEXT: br i1 [[WARP_MASTER]], label [[THEN:%.*]], label [[ELSE:%.*]]
512 // CHECK1: then:
513 // CHECK1-NEXT: [[TMP7:%.*]] = getelementptr inbounds [2 x ptr], ptr [[TMP6]], i64 0, i64 0
514 // CHECK1-NEXT: [[TMP8:%.*]] = load ptr, ptr [[TMP7]], align 8
515 // CHECK1-NEXT: [[TMP9:%.*]] = getelementptr inbounds [32 x i32], ptr addrspace(3) @__openmp_nvptx_data_transfer_temporary_storage, i64 0, i32 [[NVPTX_WARP_ID]]
516 // CHECK1-NEXT: [[TMP10:%.*]] = load i8, ptr [[TMP8]], align 1
517 // CHECK1-NEXT: store volatile i8 [[TMP10]], ptr addrspace(3) [[TMP9]], align 1
518 // CHECK1-NEXT: br label [[IFCONT:%.*]]
519 // CHECK1: else:
520 // CHECK1-NEXT: br label [[IFCONT]]
521 // CHECK1: ifcont:
522 // CHECK1-NEXT: [[TMP2:%.*]] = call i32 @__kmpc_global_thread_num(ptr @[[GLOB1]])
523 // CHECK1-NEXT: call void @__kmpc_barrier(ptr @[[GLOB2]], i32 [[TMP2]])
524 // CHECK1-NEXT: [[TMP11:%.*]] = load i32, ptr [[DOTADDR1]], align 4
525 // CHECK1-NEXT: [[IS_ACTIVE_THREAD:%.*]] = icmp ult i32 [[TMP3]], [[TMP11]]
526 // CHECK1-NEXT: br i1 [[IS_ACTIVE_THREAD]], label [[THEN2:%.*]], label [[ELSE3:%.*]]
527 // CHECK1: then3:
528 // CHECK1-NEXT: [[TMP12:%.*]] = getelementptr inbounds [32 x i32], ptr addrspace(3) @__openmp_nvptx_data_transfer_temporary_storage, i64 0, i32 [[TMP3]]
529 // CHECK1-NEXT: [[TMP13:%.*]] = getelementptr inbounds [2 x ptr], ptr [[TMP6]], i64 0, i64 0
530 // CHECK1-NEXT: [[TMP14:%.*]] = load ptr, ptr [[TMP13]], align 8
531 // CHECK1-NEXT: [[TMP15:%.*]] = load volatile i8, ptr addrspace(3) [[TMP12]], align 1
532 // CHECK1-NEXT: store i8 [[TMP15]], ptr [[TMP14]], align 1
533 // CHECK1-NEXT: br label [[IFCONT4:%.*]]
534 // CHECK1: else4:
535 // CHECK1-NEXT: br label [[IFCONT4]]
536 // CHECK1: ifcont5
537 // CHECK1-NEXT: [[TMP2:%.*]] = call i32 @__kmpc_global_thread_num(ptr @[[GLOB1]])
538 // CHECK1-NEXT: call void @__kmpc_barrier(ptr @[[GLOB2]], i32 [[TMP2]])
539 // CHECK1-NEXT: [[WARP_MASTER5:%.*]] = icmp eq i32 [[NVPTX_LANE_ID]], 0
540 // CHECK1-NEXT: br i1 [[WARP_MASTER5]], label [[THEN6:%.*]], label [[ELSE7:%.*]]
541 // CHECK1: then8:
542 // CHECK1-NEXT: [[TMP16:%.*]] = getelementptr inbounds [2 x ptr], ptr [[TMP6]], i64 0, i64 1
543 // CHECK1-NEXT: [[TMP17:%.*]] = load ptr, ptr [[TMP16]], align 8
544 // CHECK1-NEXT: [[TMP18:%.*]] = getelementptr inbounds [32 x i32], ptr addrspace(3) @__openmp_nvptx_data_transfer_temporary_storage, i64 0, i32 [[NVPTX_WARP_ID]]
545 // CHECK1-NEXT: [[TMP19:%.*]] = load i32, ptr [[TMP17]], align 4
546 // CHECK1-NEXT: store volatile i32 [[TMP19]], ptr addrspace(3) [[TMP18]], align 4
547 // CHECK1-NEXT: br label [[IFCONT8:%.*]]
548 // CHECK1: else9:
549 // CHECK1-NEXT: br label [[IFCONT8]]
550 // CHECK1: ifcont10:
551 // CHECK1-NEXT: [[TMP2:%.*]] = call i32 @__kmpc_global_thread_num(ptr @[[GLOB1]])
552 // CHECK1-NEXT: call void @__kmpc_barrier(ptr @[[GLOB2]], i32 [[TMP2]])
553 // CHECK1-NEXT: [[TMP20:%.*]] = load i32, ptr [[DOTADDR1]], align 4
554 // CHECK1-NEXT: [[IS_ACTIVE_THREAD9:%.*]] = icmp ult i32 [[TMP3]], [[TMP20]]
555 // CHECK1-NEXT: br i1 [[IS_ACTIVE_THREAD9]], label [[THEN10:%.*]], label [[ELSE11:%.*]]
556 // CHECK1: then13:
557 // CHECK1-NEXT: [[TMP21:%.*]] = getelementptr inbounds [32 x i32], ptr addrspace(3) @__openmp_nvptx_data_transfer_temporary_storage, i64 0, i32 [[TMP3]]
558 // CHECK1-NEXT: [[TMP22:%.*]] = getelementptr inbounds [2 x ptr], ptr [[TMP6]], i64 0, i64 1
559 // CHECK1-NEXT: [[TMP23:%.*]] = load ptr, ptr [[TMP22]], align 8
560 // CHECK1-NEXT: [[TMP24:%.*]] = load volatile i32, ptr addrspace(3) [[TMP21]], align 4
561 // CHECK1-NEXT: store i32 [[TMP24]], ptr [[TMP23]], align 4
562 // CHECK1-NEXT: br label [[IFCONT12:%.*]]
563 // CHECK1: else14:
564 // CHECK1-NEXT: br label [[IFCONT12]]
565 // CHECK1: ifcont15:
566 // CHECK1-NEXT: ret void
569 // CHECK1-LABEL: define {{[^@]+}}@_omp_reduction_list_to_global_copy_func3
570 // CHECK1-SAME: (ptr noundef [[TMP0:%.*]], i32 noundef [[TMP1:%.*]], ptr noundef [[TMP2:%.*]]) #[[ATTR3]] {
571 // CHECK1-NEXT: entry:
572 // CHECK1-NEXT: [[DOTADDR:%.*]] = alloca ptr, align 8
573 // CHECK1-NEXT: [[DOTADDR1:%.*]] = alloca i32, align 4
574 // CHECK1-NEXT: [[DOTADDR2:%.*]] = alloca ptr, align 8
575 // CHECK1-NEXT: store ptr [[TMP0]], ptr [[DOTADDR]], align 8
576 // CHECK1-NEXT: store i32 [[TMP1]], ptr [[DOTADDR1]], align 4
577 // CHECK1-NEXT: store ptr [[TMP2]], ptr [[DOTADDR2]], align 8
578 // CHECK1-NEXT: [[TMP3:%.*]] = load ptr, ptr [[DOTADDR2]], align 8
579 // CHECK1-NEXT: [[TMP4:%.*]] = load ptr, ptr [[DOTADDR]], align 8
580 // CHECK1-NEXT: [[TMP5:%.*]] = load i32, ptr [[DOTADDR1]], align 4
581 // CHECK1-NEXT: [[TMP6:%.*]] = getelementptr inbounds [2 x ptr], ptr [[TMP3]], i64 0, i64 0
582 // CHECK1-NEXT: [[TMP7:%.*]] = load ptr, ptr [[TMP6]], align 8
583 // CHECK1-NEXT: [[TMP8:%.*]] = getelementptr inbounds [[STRUCT__GLOBALIZED_LOCALS_TY_0:%.*]], ptr [[TMP4]], i32 [[TMP5]]
584 // CHECK1-NEXT: [[C:%.*]] = getelementptr inbounds [[STRUCT__GLOBALIZED_LOCALS_TY_0]], ptr [[TMP8]], i32 0, i32 0
585 // CHECK1-NEXT: [[TMP9:%.*]] = load i8, ptr [[TMP7]], align 1
586 // CHECK1-NEXT: store i8 [[TMP9]], ptr [[C]], align 1
587 // CHECK1-NEXT: [[TMP10:%.*]] = getelementptr inbounds [2 x ptr], ptr [[TMP3]], i64 0, i64 1
588 // CHECK1-NEXT: [[TMP11:%.*]] = load ptr, ptr [[TMP10]], align 8
589 // CHECK1-NEXT: [[TMP12:%.*]] = getelementptr inbounds [[STRUCT__GLOBALIZED_LOCALS_TY_0]], ptr [[TMP4]], i32 [[TMP5]]
590 // CHECK1-NEXT: [[D:%.*]] = getelementptr inbounds [[STRUCT__GLOBALIZED_LOCALS_TY_0]], ptr [[TMP12]], i32 0, i32 1
591 // CHECK1-NEXT: [[TMP13:%.*]] = load float, ptr [[TMP11]], align 4
592 // CHECK1-NEXT: store float [[TMP13]], ptr [[D]], align 4
593 // CHECK1-NEXT: ret void
596 // CHECK1-LABEL: define {{[^@]+}}@_omp_reduction_list_to_global_reduce_func4
597 // CHECK1-SAME: (ptr noundef [[TMP0:%.*]], i32 noundef [[TMP1:%.*]], ptr noundef [[TMP2:%.*]]) #[[ATTR3]] {
598 // CHECK1-NEXT: entry:
599 // CHECK1-NEXT: [[DOTADDR:%.*]] = alloca ptr, align 8
600 // CHECK1-NEXT: [[DOTADDR1:%.*]] = alloca i32, align 4
601 // CHECK1-NEXT: [[DOTADDR2:%.*]] = alloca ptr, align 8
602 // CHECK1-NEXT: [[DOTOMP_REDUCTION_RED_LIST:%.*]] = alloca [2 x ptr], align 8
603 // CHECK1-NEXT: store ptr [[TMP0]], ptr [[DOTADDR]], align 8
604 // CHECK1-NEXT: store i32 [[TMP1]], ptr [[DOTADDR1]], align 4
605 // CHECK1-NEXT: store ptr [[TMP2]], ptr [[DOTADDR2]], align 8
606 // CHECK1-NEXT: [[TMP3:%.*]] = load ptr, ptr [[DOTADDR]], align 8
607 // CHECK1-NEXT: [[TMP4:%.*]] = load i32, ptr [[DOTADDR1]], align 4
608 // CHECK1-NEXT: [[TMP5:%.*]] = getelementptr inbounds [2 x ptr], ptr [[DOTOMP_REDUCTION_RED_LIST]], i64 0, i64 0
609 // CHECK1-NEXT: [[TMP6:%.*]] = getelementptr inbounds [[STRUCT__GLOBALIZED_LOCALS_TY_0:%.*]], ptr [[TMP3]], i32 [[TMP4]]
610 // CHECK1-NEXT: [[C:%.*]] = getelementptr inbounds [[STRUCT__GLOBALIZED_LOCALS_TY_0]], ptr [[TMP6]], i32 0, i32 0
611 // CHECK1-NEXT: store ptr [[C]], ptr [[TMP5]], align 8
612 // CHECK1-NEXT: [[TMP7:%.*]] = getelementptr inbounds [2 x ptr], ptr [[DOTOMP_REDUCTION_RED_LIST]], i64 0, i64 1
613 // CHECK1-NEXT: [[TMP8:%.*]] = getelementptr inbounds [[STRUCT__GLOBALIZED_LOCALS_TY_0]], ptr [[TMP3]], i32 [[TMP4]]
614 // CHECK1-NEXT: [[D:%.*]] = getelementptr inbounds [[STRUCT__GLOBALIZED_LOCALS_TY_0]], ptr [[TMP8]], i32 0, i32 1
615 // CHECK1-NEXT: store ptr [[D]], ptr [[TMP7]], align 8
616 // CHECK1-NEXT: [[TMP9:%.*]] = load ptr, ptr [[DOTADDR2]], align 8
617 // CHECK1-NEXT: call void @"{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z9ftemplateIcET_i_l26_omp_outlined_omp$reduction$reduction_func"(ptr [[DOTOMP_REDUCTION_RED_LIST]], ptr [[TMP9]]) #[[ATTR4]]
618 // CHECK1-NEXT: ret void
621 // CHECK1-LABEL: define {{[^@]+}}@_omp_reduction_global_to_list_copy_func5
622 // CHECK1-SAME: (ptr noundef [[TMP0:%.*]], i32 noundef [[TMP1:%.*]], ptr noundef [[TMP2:%.*]]) #[[ATTR3]] {
623 // CHECK1-NEXT: entry:
624 // CHECK1-NEXT: [[DOTADDR:%.*]] = alloca ptr, align 8
625 // CHECK1-NEXT: [[DOTADDR1:%.*]] = alloca i32, align 4
626 // CHECK1-NEXT: [[DOTADDR2:%.*]] = alloca ptr, align 8
627 // CHECK1-NEXT: store ptr [[TMP0]], ptr [[DOTADDR]], align 8
628 // CHECK1-NEXT: store i32 [[TMP1]], ptr [[DOTADDR1]], align 4
629 // CHECK1-NEXT: store ptr [[TMP2]], ptr [[DOTADDR2]], align 8
630 // CHECK1-NEXT: [[TMP3:%.*]] = load ptr, ptr [[DOTADDR2]], align 8
631 // CHECK1-NEXT: [[TMP4:%.*]] = load ptr, ptr [[DOTADDR]], align 8
632 // CHECK1-NEXT: [[TMP5:%.*]] = load i32, ptr [[DOTADDR1]], align 4
633 // CHECK1-NEXT: [[TMP6:%.*]] = getelementptr inbounds [2 x ptr], ptr [[TMP3]], i64 0, i64 0
634 // CHECK1-NEXT: [[TMP7:%.*]] = load ptr, ptr [[TMP6]], align 8
635 // CHECK1-NEXT: [[TMP8:%.*]] = getelementptr inbounds [[STRUCT__GLOBALIZED_LOCALS_TY_0:%.*]], ptr [[TMP4]], i32 [[TMP5]]
636 // CHECK1-NEXT: [[C:%.*]] = getelementptr inbounds [[STRUCT__GLOBALIZED_LOCALS_TY_0]], ptr [[TMP8]], i32 0, i32 0
637 // CHECK1-NEXT: [[TMP9:%.*]] = load i8, ptr [[C]], align 1
638 // CHECK1-NEXT: store i8 [[TMP9]], ptr [[TMP7]], align 1
639 // CHECK1-NEXT: [[TMP10:%.*]] = getelementptr inbounds [2 x ptr], ptr [[TMP3]], i64 0, i64 1
640 // CHECK1-NEXT: [[TMP11:%.*]] = load ptr, ptr [[TMP10]], align 8
641 // CHECK1-NEXT: [[TMP12:%.*]] = getelementptr inbounds [[STRUCT__GLOBALIZED_LOCALS_TY_0]], ptr [[TMP4]], i32 [[TMP5]]
642 // CHECK1-NEXT: [[D:%.*]] = getelementptr inbounds [[STRUCT__GLOBALIZED_LOCALS_TY_0]], ptr [[TMP12]], i32 0, i32 1
643 // CHECK1-NEXT: [[TMP13:%.*]] = load float, ptr [[D]], align 4
644 // CHECK1-NEXT: store float [[TMP13]], ptr [[TMP11]], align 4
645 // CHECK1-NEXT: ret void
648 // CHECK1-LABEL: define {{[^@]+}}@_omp_reduction_global_to_list_reduce_func6
649 // CHECK1-SAME: (ptr noundef [[TMP0:%.*]], i32 noundef [[TMP1:%.*]], ptr noundef [[TMP2:%.*]]) #[[ATTR3]] {
650 // CHECK1-NEXT: entry:
651 // CHECK1-NEXT: [[DOTADDR:%.*]] = alloca ptr, align 8
652 // CHECK1-NEXT: [[DOTADDR1:%.*]] = alloca i32, align 4
653 // CHECK1-NEXT: [[DOTADDR2:%.*]] = alloca ptr, align 8
654 // CHECK1-NEXT: [[DOTOMP_REDUCTION_RED_LIST:%.*]] = alloca [2 x ptr], align 8
655 // CHECK1-NEXT: store ptr [[TMP0]], ptr [[DOTADDR]], align 8
656 // CHECK1-NEXT: store i32 [[TMP1]], ptr [[DOTADDR1]], align 4
657 // CHECK1-NEXT: store ptr [[TMP2]], ptr [[DOTADDR2]], align 8
658 // CHECK1-NEXT: [[TMP3:%.*]] = load ptr, ptr [[DOTADDR]], align 8
659 // CHECK1-NEXT: [[TMP4:%.*]] = load i32, ptr [[DOTADDR1]], align 4
660 // CHECK1-NEXT: [[TMP5:%.*]] = getelementptr inbounds [2 x ptr], ptr [[DOTOMP_REDUCTION_RED_LIST]], i64 0, i64 0
661 // CHECK1-NEXT: [[TMP6:%.*]] = getelementptr inbounds [[STRUCT__GLOBALIZED_LOCALS_TY_0:%.*]], ptr [[TMP3]], i32 [[TMP4]]
662 // CHECK1-NEXT: [[C:%.*]] = getelementptr inbounds [[STRUCT__GLOBALIZED_LOCALS_TY_0]], ptr [[TMP6]], i32 0, i32 0
663 // CHECK1-NEXT: store ptr [[C]], ptr [[TMP5]], align 8
664 // CHECK1-NEXT: [[TMP7:%.*]] = getelementptr inbounds [2 x ptr], ptr [[DOTOMP_REDUCTION_RED_LIST]], i64 0, i64 1
665 // CHECK1-NEXT: [[TMP8:%.*]] = getelementptr inbounds [[STRUCT__GLOBALIZED_LOCALS_TY_0]], ptr [[TMP3]], i32 [[TMP4]]
666 // CHECK1-NEXT: [[D:%.*]] = getelementptr inbounds [[STRUCT__GLOBALIZED_LOCALS_TY_0]], ptr [[TMP8]], i32 0, i32 1
667 // CHECK1-NEXT: store ptr [[D]], ptr [[TMP7]], align 8
668 // CHECK1-NEXT: [[TMP9:%.*]] = load ptr, ptr [[DOTADDR2]], align 8
669 // CHECK1-NEXT: call void @"{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z9ftemplateIcET_i_l26_omp_outlined_omp$reduction$reduction_func"(ptr [[TMP9]], ptr [[DOTOMP_REDUCTION_RED_LIST]]) #[[ATTR4]]
670 // CHECK1-NEXT: ret void
673 // CHECK1-LABEL: define {{[^@]+}}@{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z9ftemplateIcET_i_l33
674 // CHECK1-SAME: (ptr noalias noundef [[DYN_PTR:%.*]], i64 noundef [[A:%.*]], i64 noundef [[B:%.*]]) #[[ATTR0]] {
675 // CHECK1-NEXT: entry:
676 // CHECK1-NEXT: [[DYN_PTR_ADDR:%.*]] = alloca ptr, align 8
677 // CHECK1-NEXT: [[A_ADDR:%.*]] = alloca i64, align 8
678 // CHECK1-NEXT: [[B_ADDR:%.*]] = alloca i64, align 8
679 // CHECK1-NEXT: [[DOTZERO_ADDR:%.*]] = alloca i32, align 4
680 // CHECK1-NEXT: [[DOTTHREADID_TEMP_:%.*]] = alloca i32, align 4
681 // CHECK1-NEXT: store ptr [[DYN_PTR]], ptr [[DYN_PTR_ADDR]], align 8
682 // CHECK1-NEXT: store i64 [[A]], ptr [[A_ADDR]], align 8
683 // CHECK1-NEXT: store i64 [[B]], ptr [[B_ADDR]], align 8
684 // CHECK1-NEXT: [[TMP0:%.*]] = call i32 @__kmpc_target_init(ptr @{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z9ftemplateIcET_i_l33_kernel_environment, ptr [[DYN_PTR]])
685 // CHECK1-NEXT: [[EXEC_USER_CODE:%.*]] = icmp eq i32 [[TMP0]], -1
686 // CHECK1-NEXT: br i1 [[EXEC_USER_CODE]], label [[USER_CODE_ENTRY:%.*]], label [[WORKER_EXIT:%.*]]
687 // CHECK1: user_code.entry:
688 // CHECK1-NEXT: [[TMP1:%.*]] = call i32 @__kmpc_global_thread_num(ptr @[[GLOB1]])
689 // CHECK1-NEXT: store i32 0, ptr [[DOTZERO_ADDR]], align 4
690 // CHECK1-NEXT: store i32 [[TMP1]], ptr [[DOTTHREADID_TEMP_]], align 4
691 // CHECK1-NEXT: call void @{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z9ftemplateIcET_i_l33_omp_outlined(ptr [[DOTTHREADID_TEMP_]], ptr [[DOTZERO_ADDR]], ptr [[A_ADDR]], ptr [[B_ADDR]]) #[[ATTR4]]
692 // CHECK1-NEXT: call void @__kmpc_target_deinit()
693 // CHECK1-NEXT: ret void
694 // CHECK1: worker.exit:
695 // CHECK1-NEXT: ret void
698 // CHECK1-LABEL: define {{[^@]+}}@{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z9ftemplateIcET_i_l33_omp_outlined
699 // CHECK1-SAME: (ptr noalias noundef [[DOTGLOBAL_TID_:%.*]], ptr noalias noundef [[DOTBOUND_TID_:%.*]], ptr noundef nonnull align 4 dereferenceable(4) [[A:%.*]], ptr noundef nonnull align 2 dereferenceable(2) [[B:%.*]]) #[[ATTR2]] {
700 // CHECK1-NEXT: entry:
701 // CHECK1-NEXT: [[DOTGLOBAL_TID__ADDR:%.*]] = alloca ptr, align 8
702 // CHECK1-NEXT: [[DOTBOUND_TID__ADDR:%.*]] = alloca ptr, align 8
703 // CHECK1-NEXT: [[A_ADDR:%.*]] = alloca ptr, align 8
704 // CHECK1-NEXT: [[B_ADDR:%.*]] = alloca ptr, align 8
705 // CHECK1-NEXT: [[A1:%.*]] = alloca i32, align 4
706 // CHECK1-NEXT: [[B2:%.*]] = alloca i16, align 2
707 // CHECK1-NEXT: [[CAPTURED_VARS_ADDRS:%.*]] = alloca [2 x ptr], align 8
708 // CHECK1-NEXT: [[DOTOMP_REDUCTION_RED_LIST:%.*]] = alloca [2 x ptr], align 8
709 // CHECK1-NEXT: store ptr [[DOTGLOBAL_TID_]], ptr [[DOTGLOBAL_TID__ADDR]], align 8
710 // CHECK1-NEXT: store ptr [[DOTBOUND_TID_]], ptr [[DOTBOUND_TID__ADDR]], align 8
711 // CHECK1-NEXT: store ptr [[A]], ptr [[A_ADDR]], align 8
712 // CHECK1-NEXT: store ptr [[B]], ptr [[B_ADDR]], align 8
713 // CHECK1-NEXT: [[TMP0:%.*]] = load ptr, ptr [[A_ADDR]], align 8
714 // CHECK1-NEXT: [[TMP1:%.*]] = load ptr, ptr [[B_ADDR]], align 8
715 // CHECK1-NEXT: store i32 0, ptr [[A1]], align 4
716 // CHECK1-NEXT: store i16 -32768, ptr [[B2]], align 2
717 // CHECK1-NEXT: [[TMP2:%.*]] = getelementptr inbounds [2 x ptr], ptr [[CAPTURED_VARS_ADDRS]], i64 0, i64 0
718 // CHECK1-NEXT: store ptr [[A1]], ptr [[TMP2]], align 8
719 // CHECK1-NEXT: [[TMP3:%.*]] = getelementptr inbounds [2 x ptr], ptr [[CAPTURED_VARS_ADDRS]], i64 0, i64 1
720 // CHECK1-NEXT: store ptr [[B2]], ptr [[TMP3]], align 8
721 // CHECK1-NEXT: [[TMP4:%.*]] = load ptr, ptr [[DOTGLOBAL_TID__ADDR]], align 8
722 // CHECK1-NEXT: [[TMP5:%.*]] = load i32, ptr [[TMP4]], align 4
723 // CHECK1-NEXT: call void @__kmpc_parallel_51(ptr @[[GLOB1]], i32 [[TMP5]], i32 1, i32 -1, i32 -1, ptr @{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z9ftemplateIcET_i_l33_omp_outlined_omp_outlined, ptr null, ptr [[CAPTURED_VARS_ADDRS]], i64 2)
724 // CHECK1-NEXT: [[TMP6:%.*]] = getelementptr inbounds [2 x ptr], ptr [[DOTOMP_REDUCTION_RED_LIST]], i64 0, i64 0
725 // CHECK1-NEXT: store ptr [[A1]], ptr [[TMP6]], align 8
726 // CHECK1-NEXT: [[TMP7:%.*]] = getelementptr inbounds [2 x ptr], ptr [[DOTOMP_REDUCTION_RED_LIST]], i64 0, i64 1
727 // CHECK1-NEXT: store ptr [[B2]], ptr [[TMP7]], align 8
728 // CHECK1-NEXT: %"_openmp_teams_reductions_buffer_$_$ptr" = call ptr @__kmpc_reduction_get_fixed_buffer()
729 // CHECK1-NEXT: [[TMP8:%.*]] = call i32 @__kmpc_nvptx_teams_reduce_nowait_v2(ptr @[[GLOB1]], ptr %"_openmp_teams_reductions_buffer_$_$ptr", i32 1024, i64 8, ptr [[DOTOMP_REDUCTION_RED_LIST]], ptr @_omp_reduction_shuffle_and_reduce_func9, ptr @_omp_reduction_inter_warp_copy_func10, ptr @_omp_reduction_list_to_global_copy_func11, ptr @_omp_reduction_list_to_global_reduce_func12, ptr @_omp_reduction_global_to_list_copy_func13, ptr @_omp_reduction_global_to_list_reduce_func14)
730 // CHECK1-NEXT: [[TMP9:%.*]] = icmp eq i32 [[TMP8]], 1
731 // CHECK1-NEXT: br i1 [[TMP9]], label [[DOTOMP_REDUCTION_THEN:%.*]], label [[DOTOMP_REDUCTION_DONE:%.*]]
732 // CHECK1: .omp.reduction.then:
733 // CHECK1-NEXT: [[TMP10:%.*]] = load i32, ptr [[TMP0]], align 4
734 // CHECK1-NEXT: [[TMP11:%.*]] = load i32, ptr [[A1]], align 4
735 // CHECK1-NEXT: [[OR:%.*]] = or i32 [[TMP10]], [[TMP11]]
736 // CHECK1-NEXT: store i32 [[OR]], ptr [[TMP0]], align 4
737 // CHECK1-NEXT: [[TMP12:%.*]] = load i16, ptr [[TMP1]], align 2
738 // CHECK1-NEXT: [[CONV:%.*]] = sext i16 [[TMP12]] to i32
739 // CHECK1-NEXT: [[TMP13:%.*]] = load i16, ptr [[B2]], align 2
740 // CHECK1-NEXT: [[CONV3:%.*]] = sext i16 [[TMP13]] to i32
741 // CHECK1-NEXT: [[CMP:%.*]] = icmp sgt i32 [[CONV]], [[CONV3]]
742 // CHECK1-NEXT: br i1 [[CMP]], label [[COND_TRUE:%.*]], label [[COND_FALSE:%.*]]
743 // CHECK1: cond.true:
744 // CHECK1-NEXT: [[TMP14:%.*]] = load i16, ptr [[TMP1]], align 2
745 // CHECK1-NEXT: br label [[COND_END:%.*]]
746 // CHECK1: cond.false:
747 // CHECK1-NEXT: [[TMP15:%.*]] = load i16, ptr [[B2]], align 2
748 // CHECK1-NEXT: br label [[COND_END]]
749 // CHECK1: cond.end:
750 // CHECK1-NEXT: [[COND:%.*]] = phi i16 [ [[TMP14]], [[COND_TRUE]] ], [ [[TMP15]], [[COND_FALSE]] ]
751 // CHECK1-NEXT: store i16 [[COND]], ptr [[TMP1]], align 2
752 // CHECK1-NEXT: br label [[DOTOMP_REDUCTION_DONE]]
753 // CHECK1: .omp.reduction.done:
754 // CHECK1-NEXT: ret void
757 // CHECK1-LABEL: define {{[^@]+}}@{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z9ftemplateIcET_i_l33_omp_outlined_omp_outlined
758 // CHECK1-SAME: (ptr noalias noundef [[DOTGLOBAL_TID_:%.*]], ptr noalias noundef [[DOTBOUND_TID_:%.*]], ptr noundef nonnull align 4 dereferenceable(4) [[A:%.*]], ptr noundef nonnull align 2 dereferenceable(2) [[B:%.*]]) #[[ATTR2]] {
759 // CHECK1-NEXT: entry:
760 // CHECK1-NEXT: [[DOTGLOBAL_TID__ADDR:%.*]] = alloca ptr, align 8
761 // CHECK1-NEXT: [[DOTBOUND_TID__ADDR:%.*]] = alloca ptr, align 8
762 // CHECK1-NEXT: [[A_ADDR:%.*]] = alloca ptr, align 8
763 // CHECK1-NEXT: [[B_ADDR:%.*]] = alloca ptr, align 8
764 // CHECK1-NEXT: [[A1:%.*]] = alloca i32, align 4
765 // CHECK1-NEXT: [[B2:%.*]] = alloca i16, align 2
766 // CHECK1-NEXT: [[DOTOMP_REDUCTION_RED_LIST:%.*]] = alloca [2 x ptr], align 8
767 // CHECK1-NEXT: store ptr [[DOTGLOBAL_TID_]], ptr [[DOTGLOBAL_TID__ADDR]], align 8
768 // CHECK1-NEXT: store ptr [[DOTBOUND_TID_]], ptr [[DOTBOUND_TID__ADDR]], align 8
769 // CHECK1-NEXT: store ptr [[A]], ptr [[A_ADDR]], align 8
770 // CHECK1-NEXT: store ptr [[B]], ptr [[B_ADDR]], align 8
771 // CHECK1-NEXT: [[TMP0:%.*]] = load ptr, ptr [[A_ADDR]], align 8
772 // CHECK1-NEXT: [[TMP1:%.*]] = load ptr, ptr [[B_ADDR]], align 8
773 // CHECK1-NEXT: store i32 0, ptr [[A1]], align 4
774 // CHECK1-NEXT: store i16 -32768, ptr [[B2]], align 2
775 // CHECK1-NEXT: [[TMP2:%.*]] = load i32, ptr [[A1]], align 4
776 // CHECK1-NEXT: [[OR:%.*]] = or i32 [[TMP2]], 1
777 // CHECK1-NEXT: store i32 [[OR]], ptr [[A1]], align 4
778 // CHECK1-NEXT: [[TMP3:%.*]] = load i16, ptr [[B2]], align 2
779 // CHECK1-NEXT: [[CONV:%.*]] = sext i16 [[TMP3]] to i32
780 // CHECK1-NEXT: [[CMP:%.*]] = icmp sgt i32 99, [[CONV]]
781 // CHECK1-NEXT: br i1 [[CMP]], label [[COND_TRUE:%.*]], label [[COND_FALSE:%.*]]
782 // CHECK1: cond.true:
783 // CHECK1-NEXT: br label [[COND_END:%.*]]
784 // CHECK1: cond.false:
785 // CHECK1-NEXT: [[TMP4:%.*]] = load i16, ptr [[B2]], align 2
786 // CHECK1-NEXT: [[CONV3:%.*]] = sext i16 [[TMP4]] to i32
787 // CHECK1-NEXT: br label [[COND_END]]
788 // CHECK1: cond.end:
789 // CHECK1-NEXT: [[COND:%.*]] = phi i32 [ 99, [[COND_TRUE]] ], [ [[CONV3]], [[COND_FALSE]] ]
790 // CHECK1-NEXT: [[CONV4:%.*]] = trunc i32 [[COND]] to i16
791 // CHECK1-NEXT: store i16 [[CONV4]], ptr [[B2]], align 2
792 // CHECK1-NEXT: [[TMP5:%.*]] = getelementptr inbounds [2 x ptr], ptr [[DOTOMP_REDUCTION_RED_LIST]], i64 0, i64 0
793 // CHECK1-NEXT: store ptr [[A1]], ptr [[TMP5]], align 8
794 // CHECK1-NEXT: [[TMP6:%.*]] = getelementptr inbounds [2 x ptr], ptr [[DOTOMP_REDUCTION_RED_LIST]], i64 0, i64 1
795 // CHECK1-NEXT: store ptr [[B2]], ptr [[TMP6]], align 8
796 // CHECK1-NEXT: [[TMP7:%.*]] = call i32 @__kmpc_nvptx_parallel_reduce_nowait_v2(ptr @[[GLOB1]], i64 8, ptr [[DOTOMP_REDUCTION_RED_LIST]], ptr @_omp_reduction_shuffle_and_reduce_func7, ptr @_omp_reduction_inter_warp_copy_func8)
797 // CHECK1-NEXT: [[TMP8:%.*]] = icmp eq i32 [[TMP7]], 1
798 // CHECK1-NEXT: br i1 [[TMP8]], label [[DOTOMP_REDUCTION_THEN:%.*]], label [[DOTOMP_REDUCTION_DONE:%.*]]
799 // CHECK1: .omp.reduction.then:
800 // CHECK1-NEXT: [[TMP9:%.*]] = load i32, ptr [[TMP0]], align 4
801 // CHECK1-NEXT: [[TMP10:%.*]] = load i32, ptr [[A1]], align 4
802 // CHECK1-NEXT: [[OR5:%.*]] = or i32 [[TMP9]], [[TMP10]]
803 // CHECK1-NEXT: store i32 [[OR5]], ptr [[TMP0]], align 4
804 // CHECK1-NEXT: [[TMP11:%.*]] = load i16, ptr [[TMP1]], align 2
805 // CHECK1-NEXT: [[CONV6:%.*]] = sext i16 [[TMP11]] to i32
806 // CHECK1-NEXT: [[TMP12:%.*]] = load i16, ptr [[B2]], align 2
807 // CHECK1-NEXT: [[CONV7:%.*]] = sext i16 [[TMP12]] to i32
808 // CHECK1-NEXT: [[CMP8:%.*]] = icmp sgt i32 [[CONV6]], [[CONV7]]
809 // CHECK1-NEXT: br i1 [[CMP8]], label [[COND_TRUE9:%.*]], label [[COND_FALSE10:%.*]]
810 // CHECK1: cond.true9:
811 // CHECK1-NEXT: [[TMP13:%.*]] = load i16, ptr [[TMP1]], align 2
812 // CHECK1-NEXT: br label [[COND_END11:%.*]]
813 // CHECK1: cond.false10:
814 // CHECK1-NEXT: [[TMP14:%.*]] = load i16, ptr [[B2]], align 2
815 // CHECK1-NEXT: br label [[COND_END11]]
816 // CHECK1: cond.end11:
817 // CHECK1-NEXT: [[COND12:%.*]] = phi i16 [ [[TMP13]], [[COND_TRUE9]] ], [ [[TMP14]], [[COND_FALSE10]] ]
818 // CHECK1-NEXT: store i16 [[COND12]], ptr [[TMP1]], align 2
819 // CHECK1-NEXT: br label [[DOTOMP_REDUCTION_DONE]]
820 // CHECK1: .omp.reduction.done:
821 // CHECK1-NEXT: ret void
824 // CHECK1-LABEL: define {{[^@]+}}@_omp_reduction_shuffle_and_reduce_func7
825 // CHECK1-SAME: (ptr noundef [[TMP0:%.*]], i16 noundef signext [[TMP1:%.*]], i16 noundef signext [[TMP2:%.*]], i16 noundef signext [[TMP3:%.*]]) #[[ATTR3]] {
826 // CHECK1-NEXT: entry:
827 // CHECK1-NEXT: [[DOTADDR:%.*]] = alloca ptr, align 8
828 // CHECK1-NEXT: [[DOTADDR1:%.*]] = alloca i16, align 2
829 // CHECK1-NEXT: [[DOTADDR2:%.*]] = alloca i16, align 2
830 // CHECK1-NEXT: [[DOTADDR3:%.*]] = alloca i16, align 2
831 // CHECK1-NEXT: [[DOTOMP_REDUCTION_REMOTE_REDUCE_LIST:%.*]] = alloca [2 x ptr], align 8
832 // CHECK1-NEXT: [[DOTOMP_REDUCTION_ELEMENT:%.*]] = alloca i32, align 4
833 // CHECK1-NEXT: [[DOTOMP_REDUCTION_ELEMENT4:%.*]] = alloca i16, align 2
834 // CHECK1-NEXT: store ptr [[TMP0]], ptr [[DOTADDR]], align 8
835 // CHECK1-NEXT: store i16 [[TMP1]], ptr [[DOTADDR1]], align 2
836 // CHECK1-NEXT: store i16 [[TMP2]], ptr [[DOTADDR2]], align 2
837 // CHECK1-NEXT: store i16 [[TMP3]], ptr [[DOTADDR3]], align 2
838 // CHECK1-NEXT: [[TMP4:%.*]] = load ptr, ptr [[DOTADDR]], align 8
839 // CHECK1-NEXT: [[TMP5:%.*]] = load i16, ptr [[DOTADDR1]], align 2
840 // CHECK1-NEXT: [[TMP6:%.*]] = load i16, ptr [[DOTADDR2]], align 2
841 // CHECK1-NEXT: [[TMP7:%.*]] = load i16, ptr [[DOTADDR3]], align 2
842 // CHECK1-NEXT: [[TMP8:%.*]] = getelementptr inbounds [2 x ptr], ptr [[TMP4]], i64 0, i64 0
843 // CHECK1-NEXT: [[TMP9:%.*]] = load ptr, ptr [[TMP8]], align 8
844 // CHECK1-NEXT: [[TMP10:%.*]] = getelementptr inbounds [2 x ptr], ptr [[DOTOMP_REDUCTION_REMOTE_REDUCE_LIST]], i64 0, i64 0
845 // CHECK1-NEXT: [[TMP11:%.*]] = getelementptr i32, ptr [[TMP9]], i64 1
846 // CHECK1-NEXT: [[TMP12:%.*]] = load i32, ptr [[TMP9]], align 4
847 // CHECK1-NEXT: [[TMP13:%.*]] = call i32 @__kmpc_get_warp_size()
848 // CHECK1-NEXT: [[TMP14:%.*]] = trunc i32 [[TMP13]] to i16
849 // CHECK1-NEXT: [[TMP15:%.*]] = call i32 @__kmpc_shuffle_int32(i32 [[TMP12]], i16 [[TMP6]], i16 [[TMP14]])
850 // CHECK1-NEXT: store i32 [[TMP15]], ptr [[DOTOMP_REDUCTION_ELEMENT]], align 4
851 // CHECK1-NEXT: [[TMP16:%.*]] = getelementptr i32, ptr [[TMP9]], i64 1
852 // CHECK1-NEXT: [[TMP17:%.*]] = getelementptr i32, ptr [[DOTOMP_REDUCTION_ELEMENT]], i64 1
853 // CHECK1-NEXT: store ptr [[DOTOMP_REDUCTION_ELEMENT]], ptr [[TMP10]], align 8
854 // CHECK1-NEXT: [[TMP18:%.*]] = getelementptr inbounds [2 x ptr], ptr [[TMP4]], i64 0, i64 1
855 // CHECK1-NEXT: [[TMP19:%.*]] = load ptr, ptr [[TMP18]], align 8
856 // CHECK1-NEXT: [[TMP20:%.*]] = getelementptr inbounds [2 x ptr], ptr [[DOTOMP_REDUCTION_REMOTE_REDUCE_LIST]], i64 0, i64 1
857 // CHECK1-NEXT: [[TMP21:%.*]] = getelementptr i16, ptr [[TMP19]], i64 1
858 // CHECK1-NEXT: [[TMP22:%.*]] = load i16, ptr [[TMP19]], align 2
859 // CHECK1-NEXT: [[TMP23:%.*]] = sext i16 [[TMP22]] to i32
860 // CHECK1-NEXT: [[TMP24:%.*]] = call i32 @__kmpc_get_warp_size()
861 // CHECK1-NEXT: [[TMP25:%.*]] = trunc i32 [[TMP24]] to i16
862 // CHECK1-NEXT: [[TMP26:%.*]] = call i32 @__kmpc_shuffle_int32(i32 [[TMP23]], i16 [[TMP6]], i16 [[TMP25]])
863 // CHECK1-NEXT: [[TMP27:%.*]] = trunc i32 [[TMP26]] to i16
864 // CHECK1-NEXT: store i16 [[TMP27]], ptr [[DOTOMP_REDUCTION_ELEMENT4]], align 2
865 // CHECK1-NEXT: [[TMP28:%.*]] = getelementptr i16, ptr [[TMP19]], i64 1
866 // CHECK1-NEXT: [[TMP29:%.*]] = getelementptr i16, ptr [[DOTOMP_REDUCTION_ELEMENT4]], i64 1
867 // CHECK1-NEXT: store ptr [[DOTOMP_REDUCTION_ELEMENT4]], ptr [[TMP20]], align 8
868 // CHECK1-NEXT: [[TMP30:%.*]] = icmp eq i16 [[TMP7]], 0
869 // CHECK1-NEXT: [[TMP31:%.*]] = icmp eq i16 [[TMP7]], 1
870 // CHECK1-NEXT: [[TMP32:%.*]] = icmp ult i16 [[TMP5]], [[TMP6]]
871 // CHECK1-NEXT: [[TMP33:%.*]] = and i1 [[TMP31]], [[TMP32]]
872 // CHECK1-NEXT: [[TMP34:%.*]] = icmp eq i16 [[TMP7]], 2
873 // CHECK1-NEXT: [[TMP35:%.*]] = and i16 [[TMP5]], 1
874 // CHECK1-NEXT: [[TMP36:%.*]] = icmp eq i16 [[TMP35]], 0
875 // CHECK1-NEXT: [[TMP37:%.*]] = and i1 [[TMP34]], [[TMP36]]
876 // CHECK1-NEXT: [[TMP38:%.*]] = icmp sgt i16 [[TMP6]], 0
877 // CHECK1-NEXT: [[TMP39:%.*]] = and i1 [[TMP37]], [[TMP38]]
878 // CHECK1-NEXT: [[TMP40:%.*]] = or i1 [[TMP30]], [[TMP33]]
879 // CHECK1-NEXT: [[TMP41:%.*]] = or i1 [[TMP40]], [[TMP39]]
880 // CHECK1-NEXT: br i1 [[TMP41]], label [[THEN:%.*]], label [[ELSE:%.*]]
881 // CHECK1: then:
882 // CHECK1-NEXT: call void @"{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z9ftemplateIcET_i_l33_omp_outlined_omp_outlined_omp$reduction$reduction_func"(ptr [[TMP4]], ptr [[DOTOMP_REDUCTION_REMOTE_REDUCE_LIST]]) #[[ATTR4]]
883 // CHECK1-NEXT: br label [[IFCONT:%.*]]
884 // CHECK1: else:
885 // CHECK1-NEXT: br label [[IFCONT]]
886 // CHECK1: ifcont:
887 // CHECK1-NEXT: [[TMP42:%.*]] = icmp eq i16 [[TMP7]], 1
888 // CHECK1-NEXT: [[TMP43:%.*]] = icmp uge i16 [[TMP5]], [[TMP6]]
889 // CHECK1-NEXT: [[TMP44:%.*]] = and i1 [[TMP42]], [[TMP43]]
890 // CHECK1-NEXT: br i1 [[TMP44]], label [[THEN5:%.*]], label [[ELSE6:%.*]]
891 // CHECK1: then5:
892 // CHECK1-NEXT: [[TMP45:%.*]] = getelementptr inbounds [2 x ptr], ptr [[DOTOMP_REDUCTION_REMOTE_REDUCE_LIST]], i64 0, i64 0
893 // CHECK1-NEXT: [[TMP46:%.*]] = load ptr, ptr [[TMP45]], align 8
894 // CHECK1-NEXT: [[TMP47:%.*]] = getelementptr inbounds [2 x ptr], ptr [[TMP4]], i64 0, i64 0
895 // CHECK1-NEXT: [[TMP48:%.*]] = load ptr, ptr [[TMP47]], align 8
896 // CHECK1-NEXT: [[TMP49:%.*]] = load i32, ptr [[TMP46]], align 4
897 // CHECK1-NEXT: store i32 [[TMP49]], ptr [[TMP48]], align 4
898 // CHECK1-NEXT: [[TMP50:%.*]] = getelementptr inbounds [2 x ptr], ptr [[DOTOMP_REDUCTION_REMOTE_REDUCE_LIST]], i64 0, i64 1
899 // CHECK1-NEXT: [[TMP51:%.*]] = load ptr, ptr [[TMP50]], align 8
900 // CHECK1-NEXT: [[TMP52:%.*]] = getelementptr inbounds [2 x ptr], ptr [[TMP4]], i64 0, i64 1
901 // CHECK1-NEXT: [[TMP53:%.*]] = load ptr, ptr [[TMP52]], align 8
902 // CHECK1-NEXT: [[TMP54:%.*]] = load i16, ptr [[TMP51]], align 2
903 // CHECK1-NEXT: store i16 [[TMP54]], ptr [[TMP53]], align 2
904 // CHECK1-NEXT: br label [[IFCONT7:%.*]]
905 // CHECK1: else6:
906 // CHECK1-NEXT: br label [[IFCONT7]]
907 // CHECK1: ifcont7:
908 // CHECK1-NEXT: ret void
911 // CHECK1-LABEL: define {{[^@]+}}@_omp_reduction_inter_warp_copy_func8
912 // CHECK1-SAME: (ptr noundef [[TMP0:%.*]], i32 noundef [[TMP1:%.*]]) #[[ATTR3]] {
913 // CHECK1-NEXT: entry:
914 // CHECK1-NEXT: [[DOTADDR:%.*]] = alloca ptr, align 8
915 // CHECK1-NEXT: [[DOTADDR1:%.*]] = alloca i32, align 4
916 // CHECK1-NEXT: store ptr [[TMP0]], ptr [[DOTADDR]], align 8
917 // CHECK1-NEXT: store i32 [[TMP1]], ptr [[DOTADDR1]], align 4
918 // CHECK1-NEXT: [[TMP3:%.*]] = call i32 @__kmpc_get_hardware_thread_id_in_block()
919 // CHECK1-NEXT: [[TMP4:%.*]] = call i32 @__kmpc_get_hardware_thread_id_in_block()
920 // CHECK1-NEXT: [[NVPTX_LANE_ID:%.*]] = and i32 [[TMP4]], 31
921 // CHECK1-NEXT: [[TMP5:%.*]] = call i32 @__kmpc_get_hardware_thread_id_in_block()
922 // CHECK1-NEXT: [[NVPTX_WARP_ID:%.*]] = ashr i32 [[TMP5]], 5
923 // CHECK1-NEXT: [[TMP6:%.*]] = load ptr, ptr [[DOTADDR]], align 8
924 // CHECK1-NEXT: [[TMP2:%.*]] = call i32 @__kmpc_global_thread_num(ptr @[[GLOB1]])
925 // CHECK1-NEXT: call void @__kmpc_barrier(ptr @[[GLOB2]], i32 [[TMP2]])
926 // CHECK1-NEXT: [[WARP_MASTER:%.*]] = icmp eq i32 [[NVPTX_LANE_ID]], 0
927 // CHECK1-NEXT: br i1 [[WARP_MASTER]], label [[THEN:%.*]], label [[ELSE:%.*]]
928 // CHECK1: then:
929 // CHECK1-NEXT: [[TMP7:%.*]] = getelementptr inbounds [2 x ptr], ptr [[TMP6]], i64 0, i64 0
930 // CHECK1-NEXT: [[TMP8:%.*]] = load ptr, ptr [[TMP7]], align 8
931 // CHECK1-NEXT: [[TMP9:%.*]] = getelementptr inbounds [32 x i32], ptr addrspace(3) @__openmp_nvptx_data_transfer_temporary_storage, i64 0, i32 [[NVPTX_WARP_ID]]
932 // CHECK1-NEXT: [[TMP10:%.*]] = load i32, ptr [[TMP8]], align 4
933 // CHECK1-NEXT: store volatile i32 [[TMP10]], ptr addrspace(3) [[TMP9]], align 4
934 // CHECK1-NEXT: br label [[IFCONT:%.*]]
935 // CHECK1: else:
936 // CHECK1-NEXT: br label [[IFCONT]]
937 // CHECK1: ifcont:
938 // CHECK1-NEXT: [[TMP2:%.*]] = call i32 @__kmpc_global_thread_num(ptr @[[GLOB1]])
939 // CHECK1-NEXT: call void @__kmpc_barrier(ptr @[[GLOB2]], i32 [[TMP2]])
940 // CHECK1-NEXT: [[TMP11:%.*]] = load i32, ptr [[DOTADDR1]], align 4
941 // CHECK1-NEXT: [[IS_ACTIVE_THREAD:%.*]] = icmp ult i32 [[TMP3]], [[TMP11]]
942 // CHECK1-NEXT: br i1 [[IS_ACTIVE_THREAD]], label [[THEN2:%.*]], label [[ELSE3:%.*]]
943 // CHECK1: then3:
944 // CHECK1-NEXT: [[TMP12:%.*]] = getelementptr inbounds [32 x i32], ptr addrspace(3) @__openmp_nvptx_data_transfer_temporary_storage, i64 0, i32 [[TMP3]]
945 // CHECK1-NEXT: [[TMP13:%.*]] = getelementptr inbounds [2 x ptr], ptr [[TMP6]], i64 0, i64 0
946 // CHECK1-NEXT: [[TMP14:%.*]] = load ptr, ptr [[TMP13]], align 8
947 // CHECK1-NEXT: [[TMP15:%.*]] = load volatile i32, ptr addrspace(3) [[TMP12]], align 4
948 // CHECK1-NEXT: store i32 [[TMP15]], ptr [[TMP14]], align 4
949 // CHECK1-NEXT: br label [[IFCONT4:%.*]]
950 // CHECK1: else4:
951 // CHECK1-NEXT: br label [[IFCONT4]]
952 // CHECK1: ifcont5:
953 // CHECK1-NEXT: [[TMP2:%.*]] = call i32 @__kmpc_global_thread_num(ptr @[[GLOB1]])
954 // CHECK1-NEXT: call void @__kmpc_barrier(ptr @[[GLOB2]], i32 [[TMP2]])
955 // CHECK1-NEXT: [[WARP_MASTER5:%.*]] = icmp eq i32 [[NVPTX_LANE_ID]], 0
956 // CHECK1-NEXT: br i1 [[WARP_MASTER5]], label [[THEN6:%.*]], label [[ELSE7:%.*]]
957 // CHECK1: then8:
958 // CHECK1-NEXT: [[TMP16:%.*]] = getelementptr inbounds [2 x ptr], ptr [[TMP6]], i64 0, i64 1
959 // CHECK1-NEXT: [[TMP17:%.*]] = load ptr, ptr [[TMP16]], align 8
960 // CHECK1-NEXT: [[TMP18:%.*]] = getelementptr inbounds [32 x i32], ptr addrspace(3) @__openmp_nvptx_data_transfer_temporary_storage, i64 0, i32 [[NVPTX_WARP_ID]]
961 // CHECK1-NEXT: [[TMP19:%.*]] = load i16, ptr [[TMP17]], align 2
962 // CHECK1-NEXT: store volatile i16 [[TMP19]], ptr addrspace(3) [[TMP18]], align 2
963 // CHECK1-NEXT: br label [[IFCONT8:%.*]]
964 // CHECK1: else9:
965 // CHECK1-NEXT: br label [[IFCONT8]]
966 // CHECK1: ifcont10:
967 // CHECK1-NEXT: [[TMP2:%.*]] = call i32 @__kmpc_global_thread_num(ptr @[[GLOB1]])
968 // CHECK1-NEXT: call void @__kmpc_barrier(ptr @[[GLOB2]], i32 [[TMP2]])
969 // CHECK1-NEXT: [[TMP20:%.*]] = load i32, ptr [[DOTADDR1]], align 4
970 // CHECK1-NEXT: [[IS_ACTIVE_THREAD9:%.*]] = icmp ult i32 [[TMP3]], [[TMP20]]
971 // CHECK1-NEXT: br i1 [[IS_ACTIVE_THREAD9]], label [[THEN10:%.*]], label [[ELSE11:%.*]]
972 // CHECK1: then13:
973 // CHECK1-NEXT: [[TMP21:%.*]] = getelementptr inbounds [32 x i32], ptr addrspace(3) @__openmp_nvptx_data_transfer_temporary_storage, i64 0, i32 [[TMP3]]
974 // CHECK1-NEXT: [[TMP22:%.*]] = getelementptr inbounds [2 x ptr], ptr [[TMP6]], i64 0, i64 1
975 // CHECK1-NEXT: [[TMP23:%.*]] = load ptr, ptr [[TMP22]], align 8
976 // CHECK1-NEXT: [[TMP24:%.*]] = load volatile i16, ptr addrspace(3) [[TMP21]], align 2
977 // CHECK1-NEXT: store i16 [[TMP24]], ptr [[TMP23]], align 2
978 // CHECK1-NEXT: br label [[IFCONT12:%.*]]
979 // CHECK1: else14:
980 // CHECK1-NEXT: br label [[IFCONT12]]
981 // CHECK1: ifcont15:
982 // CHECK1-NEXT: ret void
985 // CHECK1-LABEL: define {{[^@]+}}@_omp_reduction_shuffle_and_reduce_func9
986 // CHECK1-SAME: (ptr noundef [[TMP0:%.*]], i16 noundef signext [[TMP1:%.*]], i16 noundef signext [[TMP2:%.*]], i16 noundef signext [[TMP3:%.*]]) #[[ATTR3]] {
987 // CHECK1-NEXT: entry:
988 // CHECK1-NEXT: [[DOTADDR:%.*]] = alloca ptr, align 8
989 // CHECK1-NEXT: [[DOTADDR1:%.*]] = alloca i16, align 2
990 // CHECK1-NEXT: [[DOTADDR2:%.*]] = alloca i16, align 2
991 // CHECK1-NEXT: [[DOTADDR3:%.*]] = alloca i16, align 2
992 // CHECK1-NEXT: [[DOTOMP_REDUCTION_REMOTE_REDUCE_LIST:%.*]] = alloca [2 x ptr], align 8
993 // CHECK1-NEXT: [[DOTOMP_REDUCTION_ELEMENT:%.*]] = alloca i32, align 4
994 // CHECK1-NEXT: [[DOTOMP_REDUCTION_ELEMENT4:%.*]] = alloca i16, align 2
995 // CHECK1-NEXT: store ptr [[TMP0]], ptr [[DOTADDR]], align 8
996 // CHECK1-NEXT: store i16 [[TMP1]], ptr [[DOTADDR1]], align 2
997 // CHECK1-NEXT: store i16 [[TMP2]], ptr [[DOTADDR2]], align 2
998 // CHECK1-NEXT: store i16 [[TMP3]], ptr [[DOTADDR3]], align 2
999 // CHECK1-NEXT: [[TMP4:%.*]] = load ptr, ptr [[DOTADDR]], align 8
1000 // CHECK1-NEXT: [[TMP5:%.*]] = load i16, ptr [[DOTADDR1]], align 2
1001 // CHECK1-NEXT: [[TMP6:%.*]] = load i16, ptr [[DOTADDR2]], align 2
1002 // CHECK1-NEXT: [[TMP7:%.*]] = load i16, ptr [[DOTADDR3]], align 2
1003 // CHECK1-NEXT: [[TMP8:%.*]] = getelementptr inbounds [2 x ptr], ptr [[TMP4]], i64 0, i64 0
1004 // CHECK1-NEXT: [[TMP9:%.*]] = load ptr, ptr [[TMP8]], align 8
1005 // CHECK1-NEXT: [[TMP10:%.*]] = getelementptr inbounds [2 x ptr], ptr [[DOTOMP_REDUCTION_REMOTE_REDUCE_LIST]], i64 0, i64 0
1006 // CHECK1-NEXT: [[TMP11:%.*]] = getelementptr i32, ptr [[TMP9]], i64 1
1007 // CHECK1-NEXT: [[TMP12:%.*]] = load i32, ptr [[TMP9]], align 4
1008 // CHECK1-NEXT: [[TMP13:%.*]] = call i32 @__kmpc_get_warp_size()
1009 // CHECK1-NEXT: [[TMP14:%.*]] = trunc i32 [[TMP13]] to i16
1010 // CHECK1-NEXT: [[TMP15:%.*]] = call i32 @__kmpc_shuffle_int32(i32 [[TMP12]], i16 [[TMP6]], i16 [[TMP14]])
1011 // CHECK1-NEXT: store i32 [[TMP15]], ptr [[DOTOMP_REDUCTION_ELEMENT]], align 4
1012 // CHECK1-NEXT: [[TMP16:%.*]] = getelementptr i32, ptr [[TMP9]], i64 1
1013 // CHECK1-NEXT: [[TMP17:%.*]] = getelementptr i32, ptr [[DOTOMP_REDUCTION_ELEMENT]], i64 1
1014 // CHECK1-NEXT: store ptr [[DOTOMP_REDUCTION_ELEMENT]], ptr [[TMP10]], align 8
1015 // CHECK1-NEXT: [[TMP18:%.*]] = getelementptr inbounds [2 x ptr], ptr [[TMP4]], i64 0, i64 1
1016 // CHECK1-NEXT: [[TMP19:%.*]] = load ptr, ptr [[TMP18]], align 8
1017 // CHECK1-NEXT: [[TMP20:%.*]] = getelementptr inbounds [2 x ptr], ptr [[DOTOMP_REDUCTION_REMOTE_REDUCE_LIST]], i64 0, i64 1
1018 // CHECK1-NEXT: [[TMP21:%.*]] = getelementptr i16, ptr [[TMP19]], i64 1
1019 // CHECK1-NEXT: [[TMP22:%.*]] = load i16, ptr [[TMP19]], align 2
1020 // CHECK1-NEXT: [[TMP23:%.*]] = sext i16 [[TMP22]] to i32
1021 // CHECK1-NEXT: [[TMP24:%.*]] = call i32 @__kmpc_get_warp_size()
1022 // CHECK1-NEXT: [[TMP25:%.*]] = trunc i32 [[TMP24]] to i16
1023 // CHECK1-NEXT: [[TMP26:%.*]] = call i32 @__kmpc_shuffle_int32(i32 [[TMP23]], i16 [[TMP6]], i16 [[TMP25]])
1024 // CHECK1-NEXT: [[TMP27:%.*]] = trunc i32 [[TMP26]] to i16
1025 // CHECK1-NEXT: store i16 [[TMP27]], ptr [[DOTOMP_REDUCTION_ELEMENT4]], align 2
1026 // CHECK1-NEXT: [[TMP28:%.*]] = getelementptr i16, ptr [[TMP19]], i64 1
1027 // CHECK1-NEXT: [[TMP29:%.*]] = getelementptr i16, ptr [[DOTOMP_REDUCTION_ELEMENT4]], i64 1
1028 // CHECK1-NEXT: store ptr [[DOTOMP_REDUCTION_ELEMENT4]], ptr [[TMP20]], align 8
1029 // CHECK1-NEXT: [[TMP30:%.*]] = icmp eq i16 [[TMP7]], 0
1030 // CHECK1-NEXT: [[TMP31:%.*]] = icmp eq i16 [[TMP7]], 1
1031 // CHECK1-NEXT: [[TMP32:%.*]] = icmp ult i16 [[TMP5]], [[TMP6]]
1032 // CHECK1-NEXT: [[TMP33:%.*]] = and i1 [[TMP31]], [[TMP32]]
1033 // CHECK1-NEXT: [[TMP34:%.*]] = icmp eq i16 [[TMP7]], 2
1034 // CHECK1-NEXT: [[TMP35:%.*]] = and i16 [[TMP5]], 1
1035 // CHECK1-NEXT: [[TMP36:%.*]] = icmp eq i16 [[TMP35]], 0
1036 // CHECK1-NEXT: [[TMP37:%.*]] = and i1 [[TMP34]], [[TMP36]]
1037 // CHECK1-NEXT: [[TMP38:%.*]] = icmp sgt i16 [[TMP6]], 0
1038 // CHECK1-NEXT: [[TMP39:%.*]] = and i1 [[TMP37]], [[TMP38]]
1039 // CHECK1-NEXT: [[TMP40:%.*]] = or i1 [[TMP30]], [[TMP33]]
1040 // CHECK1-NEXT: [[TMP41:%.*]] = or i1 [[TMP40]], [[TMP39]]
1041 // CHECK1-NEXT: br i1 [[TMP41]], label [[THEN:%.*]], label [[ELSE:%.*]]
1042 // CHECK1: then:
1043 // CHECK1-NEXT: call void @"{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z9ftemplateIcET_i_l33_omp_outlined_omp$reduction$reduction_func"(ptr [[TMP4]], ptr [[DOTOMP_REDUCTION_REMOTE_REDUCE_LIST]]) #[[ATTR4]]
1044 // CHECK1-NEXT: br label [[IFCONT:%.*]]
1045 // CHECK1: else:
1046 // CHECK1-NEXT: br label [[IFCONT]]
1047 // CHECK1: ifcont:
1048 // CHECK1-NEXT: [[TMP42:%.*]] = icmp eq i16 [[TMP7]], 1
1049 // CHECK1-NEXT: [[TMP43:%.*]] = icmp uge i16 [[TMP5]], [[TMP6]]
1050 // CHECK1-NEXT: [[TMP44:%.*]] = and i1 [[TMP42]], [[TMP43]]
1051 // CHECK1-NEXT: br i1 [[TMP44]], label [[THEN5:%.*]], label [[ELSE6:%.*]]
1052 // CHECK1: then5:
1053 // CHECK1-NEXT: [[TMP45:%.*]] = getelementptr inbounds [2 x ptr], ptr [[DOTOMP_REDUCTION_REMOTE_REDUCE_LIST]], i64 0, i64 0
1054 // CHECK1-NEXT: [[TMP46:%.*]] = load ptr, ptr [[TMP45]], align 8
1055 // CHECK1-NEXT: [[TMP47:%.*]] = getelementptr inbounds [2 x ptr], ptr [[TMP4]], i64 0, i64 0
1056 // CHECK1-NEXT: [[TMP48:%.*]] = load ptr, ptr [[TMP47]], align 8
1057 // CHECK1-NEXT: [[TMP49:%.*]] = load i32, ptr [[TMP46]], align 4
1058 // CHECK1-NEXT: store i32 [[TMP49]], ptr [[TMP48]], align 4
1059 // CHECK1-NEXT: [[TMP50:%.*]] = getelementptr inbounds [2 x ptr], ptr [[DOTOMP_REDUCTION_REMOTE_REDUCE_LIST]], i64 0, i64 1
1060 // CHECK1-NEXT: [[TMP51:%.*]] = load ptr, ptr [[TMP50]], align 8
1061 // CHECK1-NEXT: [[TMP52:%.*]] = getelementptr inbounds [2 x ptr], ptr [[TMP4]], i64 0, i64 1
1062 // CHECK1-NEXT: [[TMP53:%.*]] = load ptr, ptr [[TMP52]], align 8
1063 // CHECK1-NEXT: [[TMP54:%.*]] = load i16, ptr [[TMP51]], align 2
1064 // CHECK1-NEXT: store i16 [[TMP54]], ptr [[TMP53]], align 2
1065 // CHECK1-NEXT: br label [[IFCONT7:%.*]]
1066 // CHECK1: else6:
1067 // CHECK1-NEXT: br label [[IFCONT7]]
1068 // CHECK1: ifcont7:
1069 // CHECK1-NEXT: ret void
1072 // CHECK1-LABEL: define {{[^@]+}}@_omp_reduction_inter_warp_copy_func10
1073 // CHECK1-SAME: (ptr noundef [[TMP0:%.*]], i32 noundef [[TMP1:%.*]]) #[[ATTR3]] {
1074 // CHECK1-NEXT: entry:
1075 // CHECK1-NEXT: [[DOTADDR:%.*]] = alloca ptr, align 8
1076 // CHECK1-NEXT: [[DOTADDR1:%.*]] = alloca i32, align 4
1077 // CHECK1-NEXT: store ptr [[TMP0]], ptr [[DOTADDR]], align 8
1078 // CHECK1-NEXT: store i32 [[TMP1]], ptr [[DOTADDR1]], align 4
1079 // CHECK1-NEXT: [[TMP3:%.*]] = call i32 @__kmpc_get_hardware_thread_id_in_block()
1080 // CHECK1-NEXT: [[TMP4:%.*]] = call i32 @__kmpc_get_hardware_thread_id_in_block()
1081 // CHECK1-NEXT: [[NVPTX_LANE_ID:%.*]] = and i32 [[TMP4]], 31
1082 // CHECK1-NEXT: [[TMP5:%.*]] = call i32 @__kmpc_get_hardware_thread_id_in_block()
1083 // CHECK1-NEXT: [[NVPTX_WARP_ID:%.*]] = ashr i32 [[TMP5]], 5
1084 // CHECK1-NEXT: [[TMP6:%.*]] = load ptr, ptr [[DOTADDR]], align 8
1085 // CHECK1-NEXT: [[TMP2:%.*]] = call i32 @__kmpc_global_thread_num(ptr @[[GLOB1]])
1086 // CHECK1-NEXT: call void @__kmpc_barrier(ptr @[[GLOB2]], i32 [[TMP2]])
1087 // CHECK1-NEXT: [[WARP_MASTER:%.*]] = icmp eq i32 [[NVPTX_LANE_ID]], 0
1088 // CHECK1-NEXT: br i1 [[WARP_MASTER]], label [[THEN:%.*]], label [[ELSE:%.*]]
1089 // CHECK1: then:
1090 // CHECK1-NEXT: [[TMP7:%.*]] = getelementptr inbounds [2 x ptr], ptr [[TMP6]], i64 0, i64 0
1091 // CHECK1-NEXT: [[TMP8:%.*]] = load ptr, ptr [[TMP7]], align 8
1092 // CHECK1-NEXT: [[TMP9:%.*]] = getelementptr inbounds [32 x i32], ptr addrspace(3) @__openmp_nvptx_data_transfer_temporary_storage, i64 0, i32 [[NVPTX_WARP_ID]]
1093 // CHECK1-NEXT: [[TMP10:%.*]] = load i32, ptr [[TMP8]], align 4
1094 // CHECK1-NEXT: store volatile i32 [[TMP10]], ptr addrspace(3) [[TMP9]], align 4
1095 // CHECK1-NEXT: br label [[IFCONT:%.*]]
1096 // CHECK1: else:
1097 // CHECK1-NEXT: br label [[IFCONT]]
1098 // CHECK1: ifcont:
1099 // CHECK1-NEXT: [[TMP2:%.*]] = call i32 @__kmpc_global_thread_num(ptr @[[GLOB1]])
1100 // CHECK1-NEXT: call void @__kmpc_barrier(ptr @[[GLOB2]], i32 [[TMP2]])
1101 // CHECK1-NEXT: [[TMP11:%.*]] = load i32, ptr [[DOTADDR1]], align 4
1102 // CHECK1-NEXT: [[IS_ACTIVE_THREAD:%.*]] = icmp ult i32 [[TMP3]], [[TMP11]]
1103 // CHECK1-NEXT: br i1 [[IS_ACTIVE_THREAD]], label [[THEN2:%.*]], label [[ELSE3:%.*]]
1104 // CHECK1: then3:
1105 // CHECK1-NEXT: [[TMP12:%.*]] = getelementptr inbounds [32 x i32], ptr addrspace(3) @__openmp_nvptx_data_transfer_temporary_storage, i64 0, i32 [[TMP3]]
1106 // CHECK1-NEXT: [[TMP13:%.*]] = getelementptr inbounds [2 x ptr], ptr [[TMP6]], i64 0, i64 0
1107 // CHECK1-NEXT: [[TMP14:%.*]] = load ptr, ptr [[TMP13]], align 8
1108 // CHECK1-NEXT: [[TMP15:%.*]] = load volatile i32, ptr addrspace(3) [[TMP12]], align 4
1109 // CHECK1-NEXT: store i32 [[TMP15]], ptr [[TMP14]], align 4
1110 // CHECK1-NEXT: br label [[IFCONT4:%.*]]
1111 // CHECK1: else4:
1112 // CHECK1-NEXT: br label [[IFCONT4]]
1113 // CHECK1: ifcont5:
1114 // CHECK1-NEXT: [[TMP2:%.*]] = call i32 @__kmpc_global_thread_num(ptr @[[GLOB1]])
1115 // CHECK1-NEXT: call void @__kmpc_barrier(ptr @[[GLOB2]], i32 [[TMP2]])
1116 // CHECK1-NEXT: [[WARP_MASTER5:%.*]] = icmp eq i32 [[NVPTX_LANE_ID]], 0
1117 // CHECK1-NEXT: br i1 [[WARP_MASTER5]], label [[THEN6:%.*]], label [[ELSE7:%.*]]
1118 // CHECK1: then8:
1119 // CHECK1-NEXT: [[TMP16:%.*]] = getelementptr inbounds [2 x ptr], ptr [[TMP6]], i64 0, i64 1
1120 // CHECK1-NEXT: [[TMP17:%.*]] = load ptr, ptr [[TMP16]], align 8
1121 // CHECK1-NEXT: [[TMP18:%.*]] = getelementptr inbounds [32 x i32], ptr addrspace(3) @__openmp_nvptx_data_transfer_temporary_storage, i64 0, i32 [[NVPTX_WARP_ID]]
1122 // CHECK1-NEXT: [[TMP19:%.*]] = load i16, ptr [[TMP17]], align 2
1123 // CHECK1-NEXT: store volatile i16 [[TMP19]], ptr addrspace(3) [[TMP18]], align 2
1124 // CHECK1-NEXT: br label [[IFCONT8:%.*]]
1125 // CHECK1: else9:
1126 // CHECK1-NEXT: br label [[IFCONT8]]
1127 // CHECK1: ifcont10:
1128 // CHECK1-NEXT: [[TMP2:%.*]] = call i32 @__kmpc_global_thread_num(ptr @[[GLOB1]])
1129 // CHECK1-NEXT: call void @__kmpc_barrier(ptr @[[GLOB2]], i32 [[TMP2]])
1130 // CHECK1-NEXT: [[TMP20:%.*]] = load i32, ptr [[DOTADDR1]], align 4
1131 // CHECK1-NEXT: [[IS_ACTIVE_THREAD9:%.*]] = icmp ult i32 [[TMP3]], [[TMP20]]
1132 // CHECK1-NEXT: br i1 [[IS_ACTIVE_THREAD9]], label [[THEN10:%.*]], label [[ELSE11:%.*]]
1133 // CHECK1: then13:
1134 // CHECK1-NEXT: [[TMP21:%.*]] = getelementptr inbounds [32 x i32], ptr addrspace(3) @__openmp_nvptx_data_transfer_temporary_storage, i64 0, i32 [[TMP3]]
1135 // CHECK1-NEXT: [[TMP22:%.*]] = getelementptr inbounds [2 x ptr], ptr [[TMP6]], i64 0, i64 1
1136 // CHECK1-NEXT: [[TMP23:%.*]] = load ptr, ptr [[TMP22]], align 8
1137 // CHECK1-NEXT: [[TMP24:%.*]] = load volatile i16, ptr addrspace(3) [[TMP21]], align 2
1138 // CHECK1-NEXT: store i16 [[TMP24]], ptr [[TMP23]], align 2
1139 // CHECK1-NEXT: br label [[IFCONT12:%.*]]
1140 // CHECK1: else14:
1141 // CHECK1-NEXT: br label [[IFCONT12]]
1142 // CHECK1: ifcont15:
1143 // CHECK1-NEXT: ret void
1146 // CHECK1-LABEL: define {{[^@]+}}@_omp_reduction_list_to_global_copy_func11
1147 // CHECK1-SAME: (ptr noundef [[TMP0:%.*]], i32 noundef [[TMP1:%.*]], ptr noundef [[TMP2:%.*]]) #[[ATTR3]] {
1148 // CHECK1-NEXT: entry:
1149 // CHECK1-NEXT: [[DOTADDR:%.*]] = alloca ptr, align 8
1150 // CHECK1-NEXT: [[DOTADDR1:%.*]] = alloca i32, align 4
1151 // CHECK1-NEXT: [[DOTADDR2:%.*]] = alloca ptr, align 8
1152 // CHECK1-NEXT: store ptr [[TMP0]], ptr [[DOTADDR]], align 8
1153 // CHECK1-NEXT: store i32 [[TMP1]], ptr [[DOTADDR1]], align 4
1154 // CHECK1-NEXT: store ptr [[TMP2]], ptr [[DOTADDR2]], align 8
1155 // CHECK1-NEXT: [[TMP3:%.*]] = load ptr, ptr [[DOTADDR2]], align 8
1156 // CHECK1-NEXT: [[TMP4:%.*]] = load ptr, ptr [[DOTADDR]], align 8
1157 // CHECK1-NEXT: [[TMP5:%.*]] = load i32, ptr [[DOTADDR1]], align 4
1158 // CHECK1-NEXT: [[TMP6:%.*]] = getelementptr inbounds [2 x ptr], ptr [[TMP3]], i64 0, i64 0
1159 // CHECK1-NEXT: [[TMP7:%.*]] = load ptr, ptr [[TMP6]], align 8
1160 // CHECK1-NEXT: [[TMP8:%.*]] = getelementptr inbounds [[STRUCT__GLOBALIZED_LOCALS_TY_2:%.*]], ptr [[TMP4]], i32 [[TMP5]]
1161 // CHECK1-NEXT: [[A:%.*]] = getelementptr inbounds [[STRUCT__GLOBALIZED_LOCALS_TY_2]], ptr [[TMP8]], i32 0, i32 0
1162 // CHECK1-NEXT: [[TMP9:%.*]] = load i32, ptr [[TMP7]], align 4
1163 // CHECK1-NEXT: store i32 [[TMP9]], ptr [[A]], align 4
1164 // CHECK1-NEXT: [[TMP10:%.*]] = getelementptr inbounds [2 x ptr], ptr [[TMP3]], i64 0, i64 1
1165 // CHECK1-NEXT: [[TMP11:%.*]] = load ptr, ptr [[TMP10]], align 8
1166 // CHECK1-NEXT: [[TMP12:%.*]] = getelementptr inbounds [[STRUCT__GLOBALIZED_LOCALS_TY_2]], ptr [[TMP4]], i32 [[TMP5]]
1167 // CHECK1-NEXT: [[B:%.*]] = getelementptr inbounds [[STRUCT__GLOBALIZED_LOCALS_TY_2]], ptr [[TMP12]], i32 0, i32 1
1168 // CHECK1-NEXT: [[TMP13:%.*]] = load i16, ptr [[TMP11]], align 2
1169 // CHECK1-NEXT: store i16 [[TMP13]], ptr [[B]], align 2
1170 // CHECK1-NEXT: ret void
1173 // CHECK1-LABEL: define {{[^@]+}}@_omp_reduction_list_to_global_reduce_func12
1174 // CHECK1-SAME: (ptr noundef [[TMP0:%.*]], i32 noundef [[TMP1:%.*]], ptr noundef [[TMP2:%.*]]) #[[ATTR3]] {
1175 // CHECK1-NEXT: entry:
1176 // CHECK1-NEXT: [[DOTADDR:%.*]] = alloca ptr, align 8
1177 // CHECK1-NEXT: [[DOTADDR1:%.*]] = alloca i32, align 4
1178 // CHECK1-NEXT: [[DOTADDR2:%.*]] = alloca ptr, align 8
1179 // CHECK1-NEXT: [[DOTOMP_REDUCTION_RED_LIST:%.*]] = alloca [2 x ptr], align 8
1180 // CHECK1-NEXT: store ptr [[TMP0]], ptr [[DOTADDR]], align 8
1181 // CHECK1-NEXT: store i32 [[TMP1]], ptr [[DOTADDR1]], align 4
1182 // CHECK1-NEXT: store ptr [[TMP2]], ptr [[DOTADDR2]], align 8
1183 // CHECK1-NEXT: [[TMP3:%.*]] = load ptr, ptr [[DOTADDR]], align 8
1184 // CHECK1-NEXT: [[TMP4:%.*]] = load i32, ptr [[DOTADDR1]], align 4
1185 // CHECK1-NEXT: [[TMP5:%.*]] = getelementptr inbounds [2 x ptr], ptr [[DOTOMP_REDUCTION_RED_LIST]], i64 0, i64 0
1186 // CHECK1-NEXT: [[TMP6:%.*]] = getelementptr inbounds [[STRUCT__GLOBALIZED_LOCALS_TY_2:%.*]], ptr [[TMP3]], i32 [[TMP4]]
1187 // CHECK1-NEXT: [[A:%.*]] = getelementptr inbounds [[STRUCT__GLOBALIZED_LOCALS_TY_2]], ptr [[TMP6]], i32 0, i32 0
1188 // CHECK1-NEXT: store ptr [[A]], ptr [[TMP5]], align 8
1189 // CHECK1-NEXT: [[TMP7:%.*]] = getelementptr inbounds [2 x ptr], ptr [[DOTOMP_REDUCTION_RED_LIST]], i64 0, i64 1
1190 // CHECK1-NEXT: [[TMP8:%.*]] = getelementptr inbounds [[STRUCT__GLOBALIZED_LOCALS_TY_2]], ptr [[TMP3]], i32 [[TMP4]]
1191 // CHECK1-NEXT: [[B:%.*]] = getelementptr inbounds [[STRUCT__GLOBALIZED_LOCALS_TY_2]], ptr [[TMP8]], i32 0, i32 1
1192 // CHECK1-NEXT: store ptr [[B]], ptr [[TMP7]], align 8
1193 // CHECK1-NEXT: [[TMP9:%.*]] = load ptr, ptr [[DOTADDR2]], align 8
1194 // CHECK1-NEXT: call void @"{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z9ftemplateIcET_i_l33_omp_outlined_omp$reduction$reduction_func"(ptr [[DOTOMP_REDUCTION_RED_LIST]], ptr [[TMP9]]) #[[ATTR4]]
1195 // CHECK1-NEXT: ret void
1198 // CHECK1-LABEL: define {{[^@]+}}@_omp_reduction_global_to_list_copy_func13
1199 // CHECK1-SAME: (ptr noundef [[TMP0:%.*]], i32 noundef [[TMP1:%.*]], ptr noundef [[TMP2:%.*]]) #[[ATTR3]] {
1200 // CHECK1-NEXT: entry:
1201 // CHECK1-NEXT: [[DOTADDR:%.*]] = alloca ptr, align 8
1202 // CHECK1-NEXT: [[DOTADDR1:%.*]] = alloca i32, align 4
1203 // CHECK1-NEXT: [[DOTADDR2:%.*]] = alloca ptr, align 8
1204 // CHECK1-NEXT: store ptr [[TMP0]], ptr [[DOTADDR]], align 8
1205 // CHECK1-NEXT: store i32 [[TMP1]], ptr [[DOTADDR1]], align 4
1206 // CHECK1-NEXT: store ptr [[TMP2]], ptr [[DOTADDR2]], align 8
1207 // CHECK1-NEXT: [[TMP3:%.*]] = load ptr, ptr [[DOTADDR2]], align 8
1208 // CHECK1-NEXT: [[TMP4:%.*]] = load ptr, ptr [[DOTADDR]], align 8
1209 // CHECK1-NEXT: [[TMP5:%.*]] = load i32, ptr [[DOTADDR1]], align 4
1210 // CHECK1-NEXT: [[TMP6:%.*]] = getelementptr inbounds [2 x ptr], ptr [[TMP3]], i64 0, i64 0
1211 // CHECK1-NEXT: [[TMP7:%.*]] = load ptr, ptr [[TMP6]], align 8
1212 // CHECK1-NEXT: [[TMP8:%.*]] = getelementptr inbounds [[STRUCT__GLOBALIZED_LOCALS_TY_2:%.*]], ptr [[TMP4]], i32 [[TMP5]]
1213 // CHECK1-NEXT: [[A:%.*]] = getelementptr inbounds [[STRUCT__GLOBALIZED_LOCALS_TY_2]], ptr [[TMP8]], i32 0, i32 0
1214 // CHECK1-NEXT: [[TMP9:%.*]] = load i32, ptr [[A]], align 4
1215 // CHECK1-NEXT: store i32 [[TMP9]], ptr [[TMP7]], align 4
1216 // CHECK1-NEXT: [[TMP10:%.*]] = getelementptr inbounds [2 x ptr], ptr [[TMP3]], i64 0, i64 1
1217 // CHECK1-NEXT: [[TMP11:%.*]] = load ptr, ptr [[TMP10]], align 8
1218 // CHECK1-NEXT: [[TMP12:%.*]] = getelementptr inbounds [[STRUCT__GLOBALIZED_LOCALS_TY_2]], ptr [[TMP4]], i32 [[TMP5]]
1219 // CHECK1-NEXT: [[B:%.*]] = getelementptr inbounds [[STRUCT__GLOBALIZED_LOCALS_TY_2]], ptr [[TMP12]], i32 0, i32 1
1220 // CHECK1-NEXT: [[TMP13:%.*]] = load i16, ptr [[B]], align 2
1221 // CHECK1-NEXT: store i16 [[TMP13]], ptr [[TMP11]], align 2
1222 // CHECK1-NEXT: ret void
1225 // CHECK1-LABEL: define {{[^@]+}}@_omp_reduction_global_to_list_reduce_func14
1226 // CHECK1-SAME: (ptr noundef [[TMP0:%.*]], i32 noundef [[TMP1:%.*]], ptr noundef [[TMP2:%.*]]) #[[ATTR3]] {
1227 // CHECK1-NEXT: entry:
1228 // CHECK1-NEXT: [[DOTADDR:%.*]] = alloca ptr, align 8
1229 // CHECK1-NEXT: [[DOTADDR1:%.*]] = alloca i32, align 4
1230 // CHECK1-NEXT: [[DOTADDR2:%.*]] = alloca ptr, align 8
1231 // CHECK1-NEXT: [[DOTOMP_REDUCTION_RED_LIST:%.*]] = alloca [2 x ptr], align 8
1232 // CHECK1-NEXT: store ptr [[TMP0]], ptr [[DOTADDR]], align 8
1233 // CHECK1-NEXT: store i32 [[TMP1]], ptr [[DOTADDR1]], align 4
1234 // CHECK1-NEXT: store ptr [[TMP2]], ptr [[DOTADDR2]], align 8
1235 // CHECK1-NEXT: [[TMP3:%.*]] = load ptr, ptr [[DOTADDR]], align 8
1236 // CHECK1-NEXT: [[TMP4:%.*]] = load i32, ptr [[DOTADDR1]], align 4
1237 // CHECK1-NEXT: [[TMP5:%.*]] = getelementptr inbounds [2 x ptr], ptr [[DOTOMP_REDUCTION_RED_LIST]], i64 0, i64 0
1238 // CHECK1-NEXT: [[TMP6:%.*]] = getelementptr inbounds [[STRUCT__GLOBALIZED_LOCALS_TY_2:%.*]], ptr [[TMP3]], i32 [[TMP4]]
1239 // CHECK1-NEXT: [[A:%.*]] = getelementptr inbounds [[STRUCT__GLOBALIZED_LOCALS_TY_2]], ptr [[TMP6]], i32 0, i32 0
1240 // CHECK1-NEXT: store ptr [[A]], ptr [[TMP5]], align 8
1241 // CHECK1-NEXT: [[TMP7:%.*]] = getelementptr inbounds [2 x ptr], ptr [[DOTOMP_REDUCTION_RED_LIST]], i64 0, i64 1
1242 // CHECK1-NEXT: [[TMP8:%.*]] = getelementptr inbounds [[STRUCT__GLOBALIZED_LOCALS_TY_2]], ptr [[TMP3]], i32 [[TMP4]]
1243 // CHECK1-NEXT: [[B:%.*]] = getelementptr inbounds [[STRUCT__GLOBALIZED_LOCALS_TY_2]], ptr [[TMP8]], i32 0, i32 1
1244 // CHECK1-NEXT: store ptr [[B]], ptr [[TMP7]], align 8
1245 // CHECK1-NEXT: [[TMP9:%.*]] = load ptr, ptr [[DOTADDR2]], align 8
1246 // CHECK1-NEXT: call void @"{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z9ftemplateIcET_i_l33_omp_outlined_omp$reduction$reduction_func"(ptr [[TMP9]], ptr [[DOTOMP_REDUCTION_RED_LIST]]) #[[ATTR4]]
1247 // CHECK1-NEXT: ret void
1250 // CHECK2-LABEL: define {{[^@]+}}@{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z9ftemplateIcET_i_l20
1251 // CHECK2-SAME: (ptr noalias noundef [[DYN_PTR:%.*]], ptr noundef nonnull align 8 dereferenceable(8) [[E:%.*]]) #[[ATTR0:[0-9]+]] {
1252 // CHECK2-NEXT: entry:
1253 // CHECK2-NEXT: [[DYN_PTR_ADDR:%.*]] = alloca ptr, align 4
1254 // CHECK2-NEXT: [[E_ADDR:%.*]] = alloca ptr, align 4
1255 // CHECK2-NEXT: [[E1:%.*]] = alloca double, align 8
1256 // CHECK2-NEXT: [[DOTZERO_ADDR:%.*]] = alloca i32, align 4
1257 // CHECK2-NEXT: [[DOTTHREADID_TEMP_:%.*]] = alloca i32, align 4
1258 // CHECK2-NEXT: store ptr [[DYN_PTR]], ptr [[DYN_PTR_ADDR]], align 4
1259 // CHECK2-NEXT: store ptr [[E]], ptr [[E_ADDR]], align 4
1260 // CHECK2-NEXT: [[TMP0:%.*]] = load ptr, ptr [[E_ADDR]], align 4
1261 // CHECK2-NEXT: [[TMP1:%.*]] = call i32 @__kmpc_target_init(ptr @{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z9ftemplateIcET_i_l20_kernel_environment, ptr [[DYN_PTR]])
1262 // CHECK2-NEXT: [[EXEC_USER_CODE:%.*]] = icmp eq i32 [[TMP1]], -1
1263 // CHECK2-NEXT: br i1 [[EXEC_USER_CODE]], label [[USER_CODE_ENTRY:%.*]], label [[WORKER_EXIT:%.*]]
1264 // CHECK2: user_code.entry:
1265 // CHECK2-NEXT: [[TMP2:%.*]] = call i32 @__kmpc_global_thread_num(ptr @[[GLOB1:[0-9]+]])
1266 // CHECK2-NEXT: [[TMP3:%.*]] = load double, ptr [[TMP0]], align 8
1267 // CHECK2-NEXT: store double [[TMP3]], ptr [[E1]], align 8
1268 // CHECK2-NEXT: store i32 0, ptr [[DOTZERO_ADDR]], align 4
1269 // CHECK2-NEXT: store i32 [[TMP2]], ptr [[DOTTHREADID_TEMP_]], align 4
1270 // CHECK2-NEXT: call void @{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z9ftemplateIcET_i_l20_omp_outlined(ptr [[DOTTHREADID_TEMP_]], ptr [[DOTZERO_ADDR]], ptr [[E1]]) #[[ATTR4:[0-9]+]]
1271 // CHECK2-NEXT: call void @__kmpc_target_deinit()
1272 // CHECK2-NEXT: ret void
1273 // CHECK2: worker.exit:
1274 // CHECK2-NEXT: ret void
1277 // CHECK2-LABEL: define {{[^@]+}}@{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z9ftemplateIcET_i_l20_omp_outlined
1278 // CHECK2-SAME: (ptr noalias noundef [[DOTGLOBAL_TID_:%.*]], ptr noalias noundef [[DOTBOUND_TID_:%.*]], ptr noundef nonnull align 8 dereferenceable(8) [[E:%.*]]) #[[ATTR1:[0-9]+]] {
1279 // CHECK2-NEXT: entry:
1280 // CHECK2-NEXT: [[DOTGLOBAL_TID__ADDR:%.*]] = alloca ptr, align 4
1281 // CHECK2-NEXT: [[DOTBOUND_TID__ADDR:%.*]] = alloca ptr, align 4
1282 // CHECK2-NEXT: [[E_ADDR:%.*]] = alloca ptr, align 4
1283 // CHECK2-NEXT: [[DOTOMP_REDUCTION_RED_LIST:%.*]] = alloca [1 x ptr], align 4
1284 // CHECK2-NEXT: store ptr [[DOTGLOBAL_TID_]], ptr [[DOTGLOBAL_TID__ADDR]], align 4
1285 // CHECK2-NEXT: store ptr [[DOTBOUND_TID_]], ptr [[DOTBOUND_TID__ADDR]], align 4
1286 // CHECK2-NEXT: store ptr [[E]], ptr [[E_ADDR]], align 4
1287 // CHECK2-NEXT: [[TMP0:%.*]] = load ptr, ptr [[E_ADDR]], align 4
1288 // CHECK2-NEXT: [[E1:%.*]] = call align 8 ptr @__kmpc_alloc_shared(i32 8)
1289 // CHECK2-NEXT: store double 0.000000e+00, ptr [[E1]], align 8
1290 // CHECK2-NEXT: [[TMP1:%.*]] = load double, ptr [[E1]], align 8
1291 // CHECK2-NEXT: [[ADD:%.*]] = fadd double [[TMP1]], 5.000000e+00
1292 // CHECK2-NEXT: store double [[ADD]], ptr [[E1]], align 8
1293 // CHECK2-NEXT: [[TMP2:%.*]] = getelementptr inbounds [1 x ptr], ptr [[DOTOMP_REDUCTION_RED_LIST]], i32 0, i32 0
1294 // CHECK2-NEXT: store ptr [[E1]], ptr [[TMP2]], align 4
1295 // CHECK2-NEXT: %"_openmp_teams_reductions_buffer_$_$ptr" = call ptr @__kmpc_reduction_get_fixed_buffer()
1296 // CHECK2-NEXT: [[TMP3:%.*]] = call i32 @__kmpc_nvptx_teams_reduce_nowait_v2(ptr @[[GLOB1]], ptr %"_openmp_teams_reductions_buffer_$_$ptr", i32 1024, i64 8, ptr [[DOTOMP_REDUCTION_RED_LIST]], ptr @_omp_reduction_shuffle_and_reduce_func, ptr @_omp_reduction_inter_warp_copy_func, ptr @_omp_reduction_list_to_global_copy_func, ptr @_omp_reduction_list_to_global_reduce_func, ptr @_omp_reduction_global_to_list_copy_func, ptr @_omp_reduction_global_to_list_reduce_func)
1297 // CHECK2-NEXT: [[TMP4:%.*]] = icmp eq i32 [[TMP3]], 1
1298 // CHECK2-NEXT: br i1 [[TMP4]], label [[DOTOMP_REDUCTION_THEN:%.*]], label [[DOTOMP_REDUCTION_DONE:%.*]]
1299 // CHECK2: .omp.reduction.then:
1300 // CHECK2-NEXT: [[TMP5:%.*]] = load double, ptr [[TMP0]], align 8
1301 // CHECK2-NEXT: [[TMP6:%.*]] = load double, ptr [[E1]], align 8
1302 // CHECK2-NEXT: [[ADD2:%.*]] = fadd double [[TMP5]], [[TMP6]]
1303 // CHECK2-NEXT: store double [[ADD2]], ptr [[TMP0]], align 8
1304 // CHECK2-NEXT: br label [[DOTOMP_REDUCTION_DONE]]
1305 // CHECK2: .omp.reduction.done:
1306 // CHECK2-NEXT: call void @__kmpc_free_shared(ptr [[E1]], i32 8)
1307 // CHECK2-NEXT: ret void
1310 // CHECK2-LABEL: define {{[^@]+}}@_omp_reduction_shuffle_and_reduce_func
1311 // CHECK2-SAME: (ptr noundef [[TMP0:%.*]], i16 noundef signext [[TMP1:%.*]], i16 noundef signext [[TMP2:%.*]], i16 noundef signext [[TMP3:%.*]]) #[[ATTR3:[0-9]+]] {
1312 // CHECK2-NEXT: entry:
1313 // CHECK2-NEXT: [[DOTADDR:%.*]] = alloca ptr, align 4
1314 // CHECK2-NEXT: [[DOTADDR1:%.*]] = alloca i16, align 2
1315 // CHECK2-NEXT: [[DOTADDR2:%.*]] = alloca i16, align 2
1316 // CHECK2-NEXT: [[DOTADDR3:%.*]] = alloca i16, align 2
1317 // CHECK2-NEXT: [[DOTOMP_REDUCTION_REMOTE_REDUCE_LIST:%.*]] = alloca [1 x ptr], align 4
1318 // CHECK2-NEXT: [[DOTOMP_REDUCTION_ELEMENT:%.*]] = alloca double, align 8
1319 // CHECK2-NEXT: store ptr [[TMP0]], ptr [[DOTADDR]], align 4
1320 // CHECK2-NEXT: store i16 [[TMP1]], ptr [[DOTADDR1]], align 2
1321 // CHECK2-NEXT: store i16 [[TMP2]], ptr [[DOTADDR2]], align 2
1322 // CHECK2-NEXT: store i16 [[TMP3]], ptr [[DOTADDR3]], align 2
1323 // CHECK2-NEXT: [[TMP4:%.*]] = load ptr, ptr [[DOTADDR]], align 4
1324 // CHECK2-NEXT: [[TMP5:%.*]] = load i16, ptr [[DOTADDR1]], align 2
1325 // CHECK2-NEXT: [[TMP6:%.*]] = load i16, ptr [[DOTADDR2]], align 2
1326 // CHECK2-NEXT: [[TMP7:%.*]] = load i16, ptr [[DOTADDR3]], align 2
1327 // CHECK2-NEXT: [[TMP8:%.*]] = getelementptr inbounds [1 x ptr], ptr [[TMP4]], i32 0, i32 0
1328 // CHECK2-NEXT: [[TMP9:%.*]] = load ptr, ptr [[TMP8]], align 4
1329 // CHECK2-NEXT: [[TMP10:%.*]] = getelementptr inbounds [1 x ptr], ptr [[DOTOMP_REDUCTION_REMOTE_REDUCE_LIST]], i32 0, i32 0
1330 // CHECK2-NEXT: [[TMP11:%.*]] = getelementptr double, ptr [[TMP9]], i32 1
1331 // CHECK2-NEXT: [[TMP12:%.*]] = load i64, ptr [[TMP9]], align 8
1332 // CHECK2-NEXT: [[TMP13:%.*]] = call i32 @__kmpc_get_warp_size()
1333 // CHECK2-NEXT: [[TMP14:%.*]] = trunc i32 [[TMP13]] to i16
1334 // CHECK2-NEXT: [[TMP15:%.*]] = call i64 @__kmpc_shuffle_int64(i64 [[TMP12]], i16 [[TMP6]], i16 [[TMP14]])
1335 // CHECK2-NEXT: store i64 [[TMP15]], ptr [[DOTOMP_REDUCTION_ELEMENT]], align 8
1336 // CHECK2-NEXT: [[TMP16:%.*]] = getelementptr i64, ptr [[TMP9]], i32 1
1337 // CHECK2-NEXT: [[TMP17:%.*]] = getelementptr i64, ptr [[DOTOMP_REDUCTION_ELEMENT]], i32 1
1338 // CHECK2-NEXT: store ptr [[DOTOMP_REDUCTION_ELEMENT]], ptr [[TMP10]], align 4
1339 // CHECK2-NEXT: [[TMP18:%.*]] = icmp eq i16 [[TMP7]], 0
1340 // CHECK2-NEXT: [[TMP19:%.*]] = icmp eq i16 [[TMP7]], 1
1341 // CHECK2-NEXT: [[TMP20:%.*]] = icmp ult i16 [[TMP5]], [[TMP6]]
1342 // CHECK2-NEXT: [[TMP21:%.*]] = and i1 [[TMP19]], [[TMP20]]
1343 // CHECK2-NEXT: [[TMP22:%.*]] = icmp eq i16 [[TMP7]], 2
1344 // CHECK2-NEXT: [[TMP23:%.*]] = and i16 [[TMP5]], 1
1345 // CHECK2-NEXT: [[TMP24:%.*]] = icmp eq i16 [[TMP23]], 0
1346 // CHECK2-NEXT: [[TMP25:%.*]] = and i1 [[TMP22]], [[TMP24]]
1347 // CHECK2-NEXT: [[TMP26:%.*]] = icmp sgt i16 [[TMP6]], 0
1348 // CHECK2-NEXT: [[TMP27:%.*]] = and i1 [[TMP25]], [[TMP26]]
1349 // CHECK2-NEXT: [[TMP28:%.*]] = or i1 [[TMP18]], [[TMP21]]
1350 // CHECK2-NEXT: [[TMP29:%.*]] = or i1 [[TMP28]], [[TMP27]]
1351 // CHECK2-NEXT: br i1 [[TMP29]], label [[THEN:%.*]], label [[ELSE:%.*]]
1352 // CHECK2: then:
1353 // CHECK2-NEXT: call void @"{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z9ftemplateIcET_i_l20_omp_outlined_omp$reduction$reduction_func"(ptr [[TMP4]], ptr [[DOTOMP_REDUCTION_REMOTE_REDUCE_LIST]]) #[[ATTR4]]
1354 // CHECK2-NEXT: br label [[IFCONT:%.*]]
1355 // CHECK2: else:
1356 // CHECK2-NEXT: br label [[IFCONT]]
1357 // CHECK2: ifcont:
1358 // CHECK2-NEXT: [[TMP30:%.*]] = icmp eq i16 [[TMP7]], 1
1359 // CHECK2-NEXT: [[TMP31:%.*]] = icmp uge i16 [[TMP5]], [[TMP6]]
1360 // CHECK2-NEXT: [[TMP32:%.*]] = and i1 [[TMP30]], [[TMP31]]
1361 // CHECK2-NEXT: br i1 [[TMP32]], label [[THEN4:%.*]], label [[ELSE5:%.*]]
1362 // CHECK2: then4:
1363 // CHECK2-NEXT: [[TMP33:%.*]] = getelementptr inbounds [1 x ptr], ptr [[DOTOMP_REDUCTION_REMOTE_REDUCE_LIST]], i32 0, i32 0
1364 // CHECK2-NEXT: [[TMP34:%.*]] = load ptr, ptr [[TMP33]], align 4
1365 // CHECK2-NEXT: [[TMP35:%.*]] = getelementptr inbounds [1 x ptr], ptr [[TMP4]], i32 0, i32 0
1366 // CHECK2-NEXT: [[TMP36:%.*]] = load ptr, ptr [[TMP35]], align 4
1367 // CHECK2-NEXT: [[TMP37:%.*]] = load double, ptr [[TMP34]], align 8
1368 // CHECK2-NEXT: store double [[TMP37]], ptr [[TMP36]], align 8
1369 // CHECK2-NEXT: br label [[IFCONT6:%.*]]
1370 // CHECK2: else5:
1371 // CHECK2-NEXT: br label [[IFCONT6]]
1372 // CHECK2: ifcont6:
1373 // CHECK2-NEXT: ret void
1376 // CHECK2-LABEL: define {{[^@]+}}@_omp_reduction_inter_warp_copy_func
1377 // CHECK2-SAME: (ptr noundef [[TMP0:%.*]], i32 noundef [[TMP1:%.*]]) #[[ATTR3]] {
1378 // CHECK2-NEXT: entry:
1379 // CHECK2-NEXT: [[DOTADDR:%.*]] = alloca ptr, align 4
1380 // CHECK2-NEXT: [[DOTADDR1:%.*]] = alloca i32, align 4
1381 // CHECK2-NEXT: [[DOTCNT_ADDR:%.*]] = alloca i32, align 4
1382 // CHECK2-NEXT: store ptr [[TMP0]], ptr [[DOTADDR]], align 4
1383 // CHECK2-NEXT: store i32 [[TMP1]], ptr [[DOTADDR1]], align 4
1384 // CHECK2-NEXT: [[TMP3:%.*]] = call i32 @__kmpc_get_hardware_thread_id_in_block()
1385 // CHECK2-NEXT: [[TMP4:%.*]] = call i32 @__kmpc_get_hardware_thread_id_in_block()
1386 // CHECK2-NEXT: [[NVPTX_LANE_ID:%.*]] = and i32 [[TMP4]], 31
1387 // CHECK2-NEXT: [[TMP5:%.*]] = call i32 @__kmpc_get_hardware_thread_id_in_block()
1388 // CHECK2-NEXT: [[NVPTX_WARP_ID:%.*]] = ashr i32 [[TMP5]], 5
1389 // CHECK2-NEXT: [[TMP6:%.*]] = load ptr, ptr [[DOTADDR]], align 4
1390 // CHECK2-NEXT: store i32 0, ptr [[DOTCNT_ADDR]], align 4
1391 // CHECK2-NEXT: br label [[PRECOND:%.*]]
1392 // CHECK2: precond:
1393 // CHECK2-NEXT: [[TMP7:%.*]] = load i32, ptr [[DOTCNT_ADDR]], align 4
1394 // CHECK2-NEXT: [[TMP8:%.*]] = icmp ult i32 [[TMP7]], 2
1395 // CHECK2-NEXT: br i1 [[TMP8]], label [[BODY:%.*]], label [[EXIT:%.*]]
1396 // CHECK2: body:
1397 // CHECK2-NEXT: [[TMP2:%.*]] = call i32 @__kmpc_global_thread_num(ptr @[[GLOB1]])
1398 // CHECK2-NEXT: call void @__kmpc_barrier(ptr @[[GLOB2:[0-9]+]], i32 [[TMP2]])
1399 // CHECK2-NEXT: [[WARP_MASTER:%.*]] = icmp eq i32 [[NVPTX_LANE_ID]], 0
1400 // CHECK2-NEXT: br i1 [[WARP_MASTER]], label [[THEN:%.*]], label [[ELSE:%.*]]
1401 // CHECK2: then:
1402 // CHECK2-NEXT: [[TMP9:%.*]] = getelementptr inbounds [1 x ptr], ptr [[TMP6]], i32 0, i32 0
1403 // CHECK2-NEXT: [[TMP10:%.*]] = load ptr, ptr [[TMP9]], align 4
1404 // CHECK2-NEXT: [[TMP11:%.*]] = getelementptr i32, ptr [[TMP10]], i32 [[TMP7]]
1405 // CHECK2-NEXT: [[TMP12:%.*]] = getelementptr inbounds [32 x i32], ptr addrspace(3) @__openmp_nvptx_data_transfer_temporary_storage, i64 0, i32 [[NVPTX_WARP_ID]]
1406 // CHECK2-NEXT: [[TMP13:%.*]] = load i32, ptr [[TMP11]], align 4
1407 // CHECK2-NEXT: store volatile i32 [[TMP13]], ptr addrspace(3) [[TMP12]], align 4
1408 // CHECK2-NEXT: br label [[IFCONT:%.*]]
1409 // CHECK2: else:
1410 // CHECK2-NEXT: br label [[IFCONT]]
1411 // CHECK2: ifcont:
1412 // CHECK2-NEXT: [[TMP2:%.*]] = call i32 @__kmpc_global_thread_num(ptr @[[GLOB1]])
1413 // CHECK2-NEXT: call void @__kmpc_barrier(ptr @[[GLOB2]], i32 [[TMP2]])
1414 // CHECK2-NEXT: [[TMP14:%.*]] = load i32, ptr [[DOTADDR1]], align 4
1415 // CHECK2-NEXT: [[IS_ACTIVE_THREAD:%.*]] = icmp ult i32 [[TMP3]], [[TMP14]]
1416 // CHECK2-NEXT: br i1 [[IS_ACTIVE_THREAD]], label [[THEN2:%.*]], label [[ELSE3:%.*]]
1417 // CHECK2: then3:
1418 // CHECK2-NEXT: [[TMP15:%.*]] = getelementptr inbounds [32 x i32], ptr addrspace(3) @__openmp_nvptx_data_transfer_temporary_storage, i64 0, i32 [[TMP3]]
1419 // CHECK2-NEXT: [[TMP16:%.*]] = getelementptr inbounds [1 x ptr], ptr [[TMP6]], i32 0, i32 0
1420 // CHECK2-NEXT: [[TMP17:%.*]] = load ptr, ptr [[TMP16]], align 4
1421 // CHECK2-NEXT: [[TMP18:%.*]] = getelementptr i32, ptr [[TMP17]], i32 [[TMP7]]
1422 // CHECK2-NEXT: [[TMP19:%.*]] = load volatile i32, ptr addrspace(3) [[TMP15]], align 4
1423 // CHECK2-NEXT: store i32 [[TMP19]], ptr [[TMP18]], align 4
1424 // CHECK2-NEXT: br label [[IFCONT4:%.*]]
1425 // CHECK2: else4:
1426 // CHECK2-NEXT: br label [[IFCONT4]]
1427 // CHECK2: ifcont5:
1428 // CHECK2-NEXT: [[TMP20:%.*]] = add nsw i32 [[TMP7]], 1
1429 // CHECK2-NEXT: store i32 [[TMP20]], ptr [[DOTCNT_ADDR]], align 4
1430 // CHECK2-NEXT: br label [[PRECOND]]
1431 // CHECK2: exit:
1432 // CHECK2-NEXT: ret void
1435 // CHECK2-LABEL: define {{[^@]+}}@_omp_reduction_list_to_global_copy_func
1436 // CHECK2-SAME: (ptr noundef [[TMP0:%.*]], i32 noundef [[TMP1:%.*]], ptr noundef [[TMP2:%.*]]) #[[ATTR3]] {
1437 // CHECK2-NEXT: entry:
1438 // CHECK2-NEXT: [[DOTADDR:%.*]] = alloca ptr, align 4
1439 // CHECK2-NEXT: [[DOTADDR1:%.*]] = alloca i32, align 4
1440 // CHECK2-NEXT: [[DOTADDR2:%.*]] = alloca ptr, align 4
1441 // CHECK2-NEXT: store ptr [[TMP0]], ptr [[DOTADDR]], align 4
1442 // CHECK2-NEXT: store i32 [[TMP1]], ptr [[DOTADDR1]], align 4
1443 // CHECK2-NEXT: store ptr [[TMP2]], ptr [[DOTADDR2]], align 4
1444 // CHECK2-NEXT: [[TMP3:%.*]] = load ptr, ptr [[DOTADDR2]], align 4
1445 // CHECK2-NEXT: [[TMP4:%.*]] = load ptr, ptr [[DOTADDR]], align 4
1446 // CHECK2-NEXT: [[TMP5:%.*]] = load i32, ptr [[DOTADDR1]], align 4
1447 // CHECK2-NEXT: [[TMP6:%.*]] = getelementptr inbounds [1 x ptr], ptr [[TMP3]], i32 0, i32 0
1448 // CHECK2-NEXT: [[TMP7:%.*]] = load ptr, ptr [[TMP6]], align 4
1449 // CHECK2-NEXT: [[TMP8:%.*]] = getelementptr inbounds [[STRUCT__GLOBALIZED_LOCALS_TY:%.*]], ptr [[TMP4]], i32 [[TMP5]]
1450 // CHECK2-NEXT: [[E:%.*]] = getelementptr inbounds [[STRUCT__GLOBALIZED_LOCALS_TY]], ptr [[TMP8]], i32 0, i32 0
1451 // CHECK2-NEXT: [[TMP9:%.*]] = load double, ptr [[TMP7]], align 8
1452 // CHECK2-NEXT: store double [[TMP9]], ptr [[E]], align 8
1453 // CHECK2-NEXT: ret void
1456 // CHECK2-LABEL: define {{[^@]+}}@_omp_reduction_list_to_global_reduce_func
1457 // CHECK2-SAME: (ptr noundef [[TMP0:%.*]], i32 noundef [[TMP1:%.*]], ptr noundef [[TMP2:%.*]]) #[[ATTR3]] {
1458 // CHECK2-NEXT: entry:
1459 // CHECK2-NEXT: [[DOTADDR:%.*]] = alloca ptr, align 4
1460 // CHECK2-NEXT: [[DOTADDR1:%.*]] = alloca i32, align 4
1461 // CHECK2-NEXT: [[DOTADDR2:%.*]] = alloca ptr, align 4
1462 // CHECK2-NEXT: [[DOTOMP_REDUCTION_RED_LIST:%.*]] = alloca [1 x ptr], align 4
1463 // CHECK2-NEXT: store ptr [[TMP0]], ptr [[DOTADDR]], align 4
1464 // CHECK2-NEXT: store i32 [[TMP1]], ptr [[DOTADDR1]], align 4
1465 // CHECK2-NEXT: store ptr [[TMP2]], ptr [[DOTADDR2]], align 4
1466 // CHECK2-NEXT: [[TMP3:%.*]] = load ptr, ptr [[DOTADDR]], align 4
1467 // CHECK2-NEXT: [[TMP4:%.*]] = load i32, ptr [[DOTADDR1]], align 4
1468 // CHECK2-NEXT: [[TMP5:%.*]] = getelementptr inbounds [1 x ptr], ptr [[DOTOMP_REDUCTION_RED_LIST]], i32 0, i32 0
1469 // CHECK2-NEXT: [[TMP6:%.*]] = getelementptr inbounds [[STRUCT__GLOBALIZED_LOCALS_TY:%.*]], ptr [[TMP3]], i32 [[TMP4]]
1470 // CHECK2-NEXT: [[E:%.*]] = getelementptr inbounds [[STRUCT__GLOBALIZED_LOCALS_TY]], ptr [[TMP6]], i32 0, i32 0
1471 // CHECK2-NEXT: store ptr [[E]], ptr [[TMP5]], align 4
1472 // CHECK2-NEXT: [[TMP7:%.*]] = load ptr, ptr [[DOTADDR2]], align 4
1473 // CHECK2-NEXT: call void @"{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z9ftemplateIcET_i_l20_omp_outlined_omp$reduction$reduction_func"(ptr [[DOTOMP_REDUCTION_RED_LIST]], ptr [[TMP7]]) #[[ATTR4]]
1474 // CHECK2-NEXT: ret void
1477 // CHECK2-LABEL: define {{[^@]+}}@_omp_reduction_global_to_list_copy_func
1478 // CHECK2-SAME: (ptr noundef [[TMP0:%.*]], i32 noundef [[TMP1:%.*]], ptr noundef [[TMP2:%.*]]) #[[ATTR3]] {
1479 // CHECK2-NEXT: entry:
1480 // CHECK2-NEXT: [[DOTADDR:%.*]] = alloca ptr, align 4
1481 // CHECK2-NEXT: [[DOTADDR1:%.*]] = alloca i32, align 4
1482 // CHECK2-NEXT: [[DOTADDR2:%.*]] = alloca ptr, align 4
1483 // CHECK2-NEXT: store ptr [[TMP0]], ptr [[DOTADDR]], align 4
1484 // CHECK2-NEXT: store i32 [[TMP1]], ptr [[DOTADDR1]], align 4
1485 // CHECK2-NEXT: store ptr [[TMP2]], ptr [[DOTADDR2]], align 4
1486 // CHECK2-NEXT: [[TMP3:%.*]] = load ptr, ptr [[DOTADDR2]], align 4
1487 // CHECK2-NEXT: [[TMP4:%.*]] = load ptr, ptr [[DOTADDR]], align 4
1488 // CHECK2-NEXT: [[TMP5:%.*]] = load i32, ptr [[DOTADDR1]], align 4
1489 // CHECK2-NEXT: [[TMP6:%.*]] = getelementptr inbounds [1 x ptr], ptr [[TMP3]], i32 0, i32 0
1490 // CHECK2-NEXT: [[TMP7:%.*]] = load ptr, ptr [[TMP6]], align 4
1491 // CHECK2-NEXT: [[TMP8:%.*]] = getelementptr inbounds [[STRUCT__GLOBALIZED_LOCALS_TY:%.*]], ptr [[TMP4]], i32 [[TMP5]]
1492 // CHECK2-NEXT: [[E:%.*]] = getelementptr inbounds [[STRUCT__GLOBALIZED_LOCALS_TY]], ptr [[TMP8]], i32 0, i32 0
1493 // CHECK2-NEXT: [[TMP9:%.*]] = load double, ptr [[E]], align 8
1494 // CHECK2-NEXT: store double [[TMP9]], ptr [[TMP7]], align 8
1495 // CHECK2-NEXT: ret void
1498 // CHECK2-LABEL: define {{[^@]+}}@_omp_reduction_global_to_list_reduce_func
1499 // CHECK2-SAME: (ptr noundef [[TMP0:%.*]], i32 noundef [[TMP1:%.*]], ptr noundef [[TMP2:%.*]]) #[[ATTR3]] {
1500 // CHECK2-NEXT: entry:
1501 // CHECK2-NEXT: [[DOTADDR:%.*]] = alloca ptr, align 4
1502 // CHECK2-NEXT: [[DOTADDR1:%.*]] = alloca i32, align 4
1503 // CHECK2-NEXT: [[DOTADDR2:%.*]] = alloca ptr, align 4
1504 // CHECK2-NEXT: [[DOTOMP_REDUCTION_RED_LIST:%.*]] = alloca [1 x ptr], align 4
1505 // CHECK2-NEXT: store ptr [[TMP0]], ptr [[DOTADDR]], align 4
1506 // CHECK2-NEXT: store i32 [[TMP1]], ptr [[DOTADDR1]], align 4
1507 // CHECK2-NEXT: store ptr [[TMP2]], ptr [[DOTADDR2]], align 4
1508 // CHECK2-NEXT: [[TMP3:%.*]] = load ptr, ptr [[DOTADDR]], align 4
1509 // CHECK2-NEXT: [[TMP4:%.*]] = load i32, ptr [[DOTADDR1]], align 4
1510 // CHECK2-NEXT: [[TMP5:%.*]] = getelementptr inbounds [1 x ptr], ptr [[DOTOMP_REDUCTION_RED_LIST]], i32 0, i32 0
1511 // CHECK2-NEXT: [[TMP6:%.*]] = getelementptr inbounds [[STRUCT__GLOBALIZED_LOCALS_TY:%.*]], ptr [[TMP3]], i32 [[TMP4]]
1512 // CHECK2-NEXT: [[E:%.*]] = getelementptr inbounds [[STRUCT__GLOBALIZED_LOCALS_TY]], ptr [[TMP6]], i32 0, i32 0
1513 // CHECK2-NEXT: store ptr [[E]], ptr [[TMP5]], align 4
1514 // CHECK2-NEXT: [[TMP7:%.*]] = load ptr, ptr [[DOTADDR2]], align 4
1515 // CHECK2-NEXT: call void @"{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z9ftemplateIcET_i_l20_omp_outlined_omp$reduction$reduction_func"(ptr [[TMP7]], ptr [[DOTOMP_REDUCTION_RED_LIST]]) #[[ATTR4]]
1516 // CHECK2-NEXT: ret void
1519 // CHECK2-LABEL: define {{[^@]+}}@{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z9ftemplateIcET_i_l26
1520 // CHECK2-SAME: (ptr noalias noundef [[DYN_PTR:%.*]], i32 noundef [[C:%.*]], i32 noundef [[D:%.*]]) #[[ATTR0]] {
1521 // CHECK2-NEXT: entry:
1522 // CHECK2-NEXT: [[DYN_PTR_ADDR:%.*]] = alloca ptr, align 4
1523 // CHECK2-NEXT: [[C_ADDR:%.*]] = alloca i32, align 4
1524 // CHECK2-NEXT: [[D_ADDR:%.*]] = alloca i32, align 4
1525 // CHECK2-NEXT: [[DOTZERO_ADDR:%.*]] = alloca i32, align 4
1526 // CHECK2-NEXT: [[DOTTHREADID_TEMP_:%.*]] = alloca i32, align 4
1527 // CHECK2-NEXT: store ptr [[DYN_PTR]], ptr [[DYN_PTR_ADDR]], align 4
1528 // CHECK2-NEXT: store i32 [[C]], ptr [[C_ADDR]], align 4
1529 // CHECK2-NEXT: store i32 [[D]], ptr [[D_ADDR]], align 4
1530 // CHECK2-NEXT: [[TMP0:%.*]] = call i32 @__kmpc_target_init(ptr @{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z9ftemplateIcET_i_l26_kernel_environment, ptr [[DYN_PTR]])
1531 // CHECK2-NEXT: [[EXEC_USER_CODE:%.*]] = icmp eq i32 [[TMP0]], -1
1532 // CHECK2-NEXT: br i1 [[EXEC_USER_CODE]], label [[USER_CODE_ENTRY:%.*]], label [[WORKER_EXIT:%.*]]
1533 // CHECK2: user_code.entry:
1534 // CHECK2-NEXT: [[TMP1:%.*]] = load i8, ptr [[C_ADDR]], align 1
1535 // CHECK2-NEXT: [[C1:%.*]] = call align 8 ptr @__kmpc_alloc_shared(i32 1)
1536 // CHECK2-NEXT: store i8 [[TMP1]], ptr [[C1]], align 1
1537 // CHECK2-NEXT: [[TMP2:%.*]] = load float, ptr [[D_ADDR]], align 4
1538 // CHECK2-NEXT: [[D2:%.*]] = call align 8 ptr @__kmpc_alloc_shared(i32 4)
1539 // CHECK2-NEXT: store float [[TMP2]], ptr [[D2]], align 4
1540 // CHECK2-NEXT: [[TMP3:%.*]] = call i32 @__kmpc_global_thread_num(ptr @[[GLOB1]])
1541 // CHECK2-NEXT: store i32 0, ptr [[DOTZERO_ADDR]], align 4
1542 // CHECK2-NEXT: store i32 [[TMP3]], ptr [[DOTTHREADID_TEMP_]], align 4
1543 // CHECK2-NEXT: call void @{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z9ftemplateIcET_i_l26_omp_outlined(ptr [[DOTTHREADID_TEMP_]], ptr [[DOTZERO_ADDR]], ptr [[C1]], ptr [[D2]]) #[[ATTR4]]
1544 // CHECK2-NEXT: call void @__kmpc_free_shared(ptr [[D2]], i32 4)
1545 // CHECK2-NEXT: call void @__kmpc_free_shared(ptr [[C1]], i32 1)
1546 // CHECK2-NEXT: call void @__kmpc_target_deinit()
1547 // CHECK2-NEXT: ret void
1548 // CHECK2: worker.exit:
1549 // CHECK2-NEXT: ret void
1552 // CHECK2-LABEL: define {{[^@]+}}@{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z9ftemplateIcET_i_l26_omp_outlined
1553 // CHECK2-SAME: (ptr noalias noundef [[DOTGLOBAL_TID_:%.*]], ptr noalias noundef [[DOTBOUND_TID_:%.*]], ptr noundef nonnull align 1 dereferenceable(1) [[C:%.*]], ptr noundef nonnull align 4 dereferenceable(4) [[D:%.*]]) #[[ATTR1]] {
1554 // CHECK2-NEXT: entry:
1555 // CHECK2-NEXT: [[DOTGLOBAL_TID__ADDR:%.*]] = alloca ptr, align 4
1556 // CHECK2-NEXT: [[DOTBOUND_TID__ADDR:%.*]] = alloca ptr, align 4
1557 // CHECK2-NEXT: [[C_ADDR:%.*]] = alloca ptr, align 4
1558 // CHECK2-NEXT: [[D_ADDR:%.*]] = alloca ptr, align 4
1559 // CHECK2-NEXT: [[DOTOMP_REDUCTION_RED_LIST:%.*]] = alloca [2 x ptr], align 4
1560 // CHECK2-NEXT: store ptr [[DOTGLOBAL_TID_]], ptr [[DOTGLOBAL_TID__ADDR]], align 4
1561 // CHECK2-NEXT: store ptr [[DOTBOUND_TID_]], ptr [[DOTBOUND_TID__ADDR]], align 4
1562 // CHECK2-NEXT: store ptr [[C]], ptr [[C_ADDR]], align 4
1563 // CHECK2-NEXT: store ptr [[D]], ptr [[D_ADDR]], align 4
1564 // CHECK2-NEXT: [[TMP0:%.*]] = load ptr, ptr [[C_ADDR]], align 4
1565 // CHECK2-NEXT: [[TMP1:%.*]] = load ptr, ptr [[D_ADDR]], align 4
1566 // CHECK2-NEXT: [[C1:%.*]] = call align 8 ptr @__kmpc_alloc_shared(i32 1)
1567 // CHECK2-NEXT: [[D2:%.*]] = call align 8 ptr @__kmpc_alloc_shared(i32 4)
1568 // CHECK2-NEXT: store i8 0, ptr [[C1]], align 1
1569 // CHECK2-NEXT: store float 1.000000e+00, ptr [[D2]], align 4
1570 // CHECK2-NEXT: [[TMP2:%.*]] = load i8, ptr [[C1]], align 1
1571 // CHECK2-NEXT: [[CONV:%.*]] = sext i8 [[TMP2]] to i32
1572 // CHECK2-NEXT: [[XOR:%.*]] = xor i32 [[CONV]], 2
1573 // CHECK2-NEXT: [[CONV3:%.*]] = trunc i32 [[XOR]] to i8
1574 // CHECK2-NEXT: store i8 [[CONV3]], ptr [[C1]], align 1
1575 // CHECK2-NEXT: [[TMP3:%.*]] = load float, ptr [[D2]], align 4
1576 // CHECK2-NEXT: [[MUL:%.*]] = fmul float [[TMP3]], 3.300000e+01
1577 // CHECK2-NEXT: store float [[MUL]], ptr [[D2]], align 4
1578 // CHECK2-NEXT: [[TMP4:%.*]] = getelementptr inbounds [2 x ptr], ptr [[DOTOMP_REDUCTION_RED_LIST]], i32 0, i32 0
1579 // CHECK2-NEXT: store ptr [[C1]], ptr [[TMP4]], align 4
1580 // CHECK2-NEXT: [[TMP5:%.*]] = getelementptr inbounds [2 x ptr], ptr [[DOTOMP_REDUCTION_RED_LIST]], i32 0, i32 1
1581 // CHECK2-NEXT: store ptr [[D2]], ptr [[TMP5]], align 4
1582 // CHECK2-NEXT: %"_openmp_teams_reductions_buffer_$_$ptr" = call ptr @__kmpc_reduction_get_fixed_buffer()
1583 // CHECK2-NEXT: [[TMP6:%.*]] = call i32 @__kmpc_nvptx_teams_reduce_nowait_v2(ptr @[[GLOB1]], ptr %"_openmp_teams_reductions_buffer_$_$ptr", i32 1024, i64 8, ptr [[DOTOMP_REDUCTION_RED_LIST]], ptr @_omp_reduction_shuffle_and_reduce_func1, ptr @_omp_reduction_inter_warp_copy_func2, ptr @_omp_reduction_list_to_global_copy_func3, ptr @_omp_reduction_list_to_global_reduce_func4, ptr @_omp_reduction_global_to_list_copy_func5, ptr @_omp_reduction_global_to_list_reduce_func6)
1584 // CHECK2-NEXT: [[TMP7:%.*]] = icmp eq i32 [[TMP6]], 1
1585 // CHECK2-NEXT: br i1 [[TMP7]], label [[DOTOMP_REDUCTION_THEN:%.*]], label [[DOTOMP_REDUCTION_DONE:%.*]]
1586 // CHECK2: .omp.reduction.then:
1587 // CHECK2-NEXT: [[TMP8:%.*]] = load i8, ptr [[TMP0]], align 1
1588 // CHECK2-NEXT: [[CONV4:%.*]] = sext i8 [[TMP8]] to i32
1589 // CHECK2-NEXT: [[TMP9:%.*]] = load i8, ptr [[C1]], align 1
1590 // CHECK2-NEXT: [[CONV5:%.*]] = sext i8 [[TMP9]] to i32
1591 // CHECK2-NEXT: [[XOR6:%.*]] = xor i32 [[CONV4]], [[CONV5]]
1592 // CHECK2-NEXT: [[CONV7:%.*]] = trunc i32 [[XOR6]] to i8
1593 // CHECK2-NEXT: store i8 [[CONV7]], ptr [[TMP0]], align 1
1594 // CHECK2-NEXT: [[TMP10:%.*]] = load float, ptr [[TMP1]], align 4
1595 // CHECK2-NEXT: [[TMP11:%.*]] = load float, ptr [[D2]], align 4
1596 // CHECK2-NEXT: [[MUL8:%.*]] = fmul float [[TMP10]], [[TMP11]]
1597 // CHECK2-NEXT: store float [[MUL8]], ptr [[TMP1]], align 4
1598 // CHECK2-NEXT: br label [[DOTOMP_REDUCTION_DONE]]
1599 // CHECK2: .omp.reduction.done:
1600 // CHECK2-NEXT: call void @__kmpc_free_shared(ptr [[D2]], i32 4)
1601 // CHECK2-NEXT: call void @__kmpc_free_shared(ptr [[C1]], i32 1)
1602 // CHECK2-NEXT: ret void
1605 // CHECK2-LABEL: define {{[^@]+}}@_omp_reduction_shuffle_and_reduce_func1
1606 // CHECK2-SAME: (ptr noundef [[TMP0:%.*]], i16 noundef signext [[TMP1:%.*]], i16 noundef signext [[TMP2:%.*]], i16 noundef signext [[TMP3:%.*]]) #[[ATTR3]] {
1607 // CHECK2-NEXT: entry:
1608 // CHECK2-NEXT: [[DOTADDR:%.*]] = alloca ptr, align 4
1609 // CHECK2-NEXT: [[DOTADDR1:%.*]] = alloca i16, align 2
1610 // CHECK2-NEXT: [[DOTADDR2:%.*]] = alloca i16, align 2
1611 // CHECK2-NEXT: [[DOTADDR3:%.*]] = alloca i16, align 2
1612 // CHECK2-NEXT: [[DOTOMP_REDUCTION_REMOTE_REDUCE_LIST:%.*]] = alloca [2 x ptr], align 4
1613 // CHECK2-NEXT: [[DOTOMP_REDUCTION_ELEMENT:%.*]] = alloca i8, align 1
1614 // CHECK2-NEXT: [[DOTOMP_REDUCTION_ELEMENT4:%.*]] = alloca float, align 4
1615 // CHECK2-NEXT: store ptr [[TMP0]], ptr [[DOTADDR]], align 4
1616 // CHECK2-NEXT: store i16 [[TMP1]], ptr [[DOTADDR1]], align 2
1617 // CHECK2-NEXT: store i16 [[TMP2]], ptr [[DOTADDR2]], align 2
1618 // CHECK2-NEXT: store i16 [[TMP3]], ptr [[DOTADDR3]], align 2
1619 // CHECK2-NEXT: [[TMP4:%.*]] = load ptr, ptr [[DOTADDR]], align 4
1620 // CHECK2-NEXT: [[TMP5:%.*]] = load i16, ptr [[DOTADDR1]], align 2
1621 // CHECK2-NEXT: [[TMP6:%.*]] = load i16, ptr [[DOTADDR2]], align 2
1622 // CHECK2-NEXT: [[TMP7:%.*]] = load i16, ptr [[DOTADDR3]], align 2
1623 // CHECK2-NEXT: [[TMP8:%.*]] = getelementptr inbounds [2 x ptr], ptr [[TMP4]], i32 0, i32 0
1624 // CHECK2-NEXT: [[TMP9:%.*]] = load ptr, ptr [[TMP8]], align 4
1625 // CHECK2-NEXT: [[TMP10:%.*]] = getelementptr inbounds [2 x ptr], ptr [[DOTOMP_REDUCTION_REMOTE_REDUCE_LIST]], i32 0, i32 0
1626 // CHECK2-NEXT: [[TMP11:%.*]] = getelementptr i8, ptr [[TMP9]], i32 1
1627 // CHECK2-NEXT: [[TMP12:%.*]] = load i8, ptr [[TMP9]], align 1
1628 // CHECK2-NEXT: [[TMP13:%.*]] = sext i8 [[TMP12]] to i32
1629 // CHECK2-NEXT: [[TMP14:%.*]] = call i32 @__kmpc_get_warp_size()
1630 // CHECK2-NEXT: [[TMP15:%.*]] = trunc i32 [[TMP14]] to i16
1631 // CHECK2-NEXT: [[TMP16:%.*]] = call i32 @__kmpc_shuffle_int32(i32 [[TMP13]], i16 [[TMP6]], i16 [[TMP15]])
1632 // CHECK2-NEXT: [[TMP17:%.*]] = trunc i32 [[TMP16]] to i8
1633 // CHECK2-NEXT: store i8 [[TMP17]], ptr [[DOTOMP_REDUCTION_ELEMENT]], align 1
1634 // CHECK2-NEXT: [[TMP18:%.*]] = getelementptr i8, ptr [[TMP9]], i32 1
1635 // CHECK2-NEXT: [[TMP19:%.*]] = getelementptr i8, ptr [[DOTOMP_REDUCTION_ELEMENT]], i32 1
1636 // CHECK2-NEXT: store ptr [[DOTOMP_REDUCTION_ELEMENT]], ptr [[TMP10]], align 4
1637 // CHECK2-NEXT: [[TMP20:%.*]] = getelementptr inbounds [2 x ptr], ptr [[TMP4]], i32 0, i32 1
1638 // CHECK2-NEXT: [[TMP21:%.*]] = load ptr, ptr [[TMP20]], align 4
1639 // CHECK2-NEXT: [[TMP22:%.*]] = getelementptr inbounds [2 x ptr], ptr [[DOTOMP_REDUCTION_REMOTE_REDUCE_LIST]], i32 0, i32 1
1640 // CHECK2-NEXT: [[TMP23:%.*]] = getelementptr float, ptr [[TMP21]], i32 1
1641 // CHECK2-NEXT: [[TMP24:%.*]] = load i32, ptr [[TMP21]], align 4
1642 // CHECK2-NEXT: [[TMP25:%.*]] = call i32 @__kmpc_get_warp_size()
1643 // CHECK2-NEXT: [[TMP26:%.*]] = trunc i32 [[TMP25]] to i16
1644 // CHECK2-NEXT: [[TMP27:%.*]] = call i32 @__kmpc_shuffle_int32(i32 [[TMP24]], i16 [[TMP6]], i16 [[TMP26]])
1645 // CHECK2-NEXT: store i32 [[TMP27]], ptr [[DOTOMP_REDUCTION_ELEMENT4]], align 4
1646 // CHECK2-NEXT: [[TMP28:%.*]] = getelementptr i32, ptr [[TMP21]], i32 1
1647 // CHECK2-NEXT: [[TMP29:%.*]] = getelementptr i32, ptr [[DOTOMP_REDUCTION_ELEMENT4]], i32 1
1648 // CHECK2-NEXT: store ptr [[DOTOMP_REDUCTION_ELEMENT4]], ptr [[TMP22]], align 4
1649 // CHECK2-NEXT: [[TMP30:%.*]] = icmp eq i16 [[TMP7]], 0
1650 // CHECK2-NEXT: [[TMP31:%.*]] = icmp eq i16 [[TMP7]], 1
1651 // CHECK2-NEXT: [[TMP32:%.*]] = icmp ult i16 [[TMP5]], [[TMP6]]
1652 // CHECK2-NEXT: [[TMP33:%.*]] = and i1 [[TMP31]], [[TMP32]]
1653 // CHECK2-NEXT: [[TMP34:%.*]] = icmp eq i16 [[TMP7]], 2
1654 // CHECK2-NEXT: [[TMP35:%.*]] = and i16 [[TMP5]], 1
1655 // CHECK2-NEXT: [[TMP36:%.*]] = icmp eq i16 [[TMP35]], 0
1656 // CHECK2-NEXT: [[TMP37:%.*]] = and i1 [[TMP34]], [[TMP36]]
1657 // CHECK2-NEXT: [[TMP38:%.*]] = icmp sgt i16 [[TMP6]], 0
1658 // CHECK2-NEXT: [[TMP39:%.*]] = and i1 [[TMP37]], [[TMP38]]
1659 // CHECK2-NEXT: [[TMP40:%.*]] = or i1 [[TMP30]], [[TMP33]]
1660 // CHECK2-NEXT: [[TMP41:%.*]] = or i1 [[TMP40]], [[TMP39]]
1661 // CHECK2-NEXT: br i1 [[TMP41]], label [[THEN:%.*]], label [[ELSE:%.*]]
1662 // CHECK2: then:
1663 // CHECK2-NEXT: call void @"{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z9ftemplateIcET_i_l26_omp_outlined_omp$reduction$reduction_func"(ptr [[TMP4]], ptr [[DOTOMP_REDUCTION_REMOTE_REDUCE_LIST]]) #[[ATTR4]]
1664 // CHECK2-NEXT: br label [[IFCONT:%.*]]
1665 // CHECK2: else:
1666 // CHECK2-NEXT: br label [[IFCONT]]
1667 // CHECK2: ifcont:
1668 // CHECK2-NEXT: [[TMP42:%.*]] = icmp eq i16 [[TMP7]], 1
1669 // CHECK2-NEXT: [[TMP43:%.*]] = icmp uge i16 [[TMP5]], [[TMP6]]
1670 // CHECK2-NEXT: [[TMP44:%.*]] = and i1 [[TMP42]], [[TMP43]]
1671 // CHECK2-NEXT: br i1 [[TMP44]], label [[THEN5:%.*]], label [[ELSE6:%.*]]
1672 // CHECK2: then5:
1673 // CHECK2-NEXT: [[TMP45:%.*]] = getelementptr inbounds [2 x ptr], ptr [[DOTOMP_REDUCTION_REMOTE_REDUCE_LIST]], i32 0, i32 0
1674 // CHECK2-NEXT: [[TMP46:%.*]] = load ptr, ptr [[TMP45]], align 4
1675 // CHECK2-NEXT: [[TMP47:%.*]] = getelementptr inbounds [2 x ptr], ptr [[TMP4]], i32 0, i32 0
1676 // CHECK2-NEXT: [[TMP48:%.*]] = load ptr, ptr [[TMP47]], align 4
1677 // CHECK2-NEXT: [[TMP49:%.*]] = load i8, ptr [[TMP46]], align 1
1678 // CHECK2-NEXT: store i8 [[TMP49]], ptr [[TMP48]], align 1
1679 // CHECK2-NEXT: [[TMP50:%.*]] = getelementptr inbounds [2 x ptr], ptr [[DOTOMP_REDUCTION_REMOTE_REDUCE_LIST]], i32 0, i32 1
1680 // CHECK2-NEXT: [[TMP51:%.*]] = load ptr, ptr [[TMP50]], align 4
1681 // CHECK2-NEXT: [[TMP52:%.*]] = getelementptr inbounds [2 x ptr], ptr [[TMP4]], i32 0, i32 1
1682 // CHECK2-NEXT: [[TMP53:%.*]] = load ptr, ptr [[TMP52]], align 4
1683 // CHECK2-NEXT: [[TMP54:%.*]] = load float, ptr [[TMP51]], align 4
1684 // CHECK2-NEXT: store float [[TMP54]], ptr [[TMP53]], align 4
1685 // CHECK2-NEXT: br label [[IFCONT7:%.*]]
1686 // CHECK2: else6:
1687 // CHECK2-NEXT: br label [[IFCONT7]]
1688 // CHECK2: ifcont7:
1689 // CHECK2-NEXT: ret void
1692 // CHECK2-LABEL: define {{[^@]+}}@_omp_reduction_inter_warp_copy_func2
1693 // CHECK2-SAME: (ptr noundef [[TMP0:%.*]], i32 noundef [[TMP1:%.*]]) #[[ATTR3]] {
1694 // CHECK2-NEXT: entry:
1695 // CHECK2-NEXT: [[DOTADDR:%.*]] = alloca ptr, align 4
1696 // CHECK2-NEXT: [[DOTADDR1:%.*]] = alloca i32, align 4
1697 // CHECK2-NEXT: store ptr [[TMP0]], ptr [[DOTADDR]], align 4
1698 // CHECK2-NEXT: store i32 [[TMP1]], ptr [[DOTADDR1]], align 4
1699 // CHECK2-NEXT: [[TMP3:%.*]] = call i32 @__kmpc_get_hardware_thread_id_in_block()
1700 // CHECK2-NEXT: [[TMP4:%.*]] = call i32 @__kmpc_get_hardware_thread_id_in_block()
1701 // CHECK2-NEXT: [[NVPTX_LANE_ID:%.*]] = and i32 [[TMP4]], 31
1702 // CHECK2-NEXT: [[TMP5:%.*]] = call i32 @__kmpc_get_hardware_thread_id_in_block()
1703 // CHECK2-NEXT: [[NVPTX_WARP_ID:%.*]] = ashr i32 [[TMP5]], 5
1704 // CHECK2-NEXT: [[TMP6:%.*]] = load ptr, ptr [[DOTADDR]], align 4
1705 // CHECK2-NEXT: [[TMP2:%.*]] = call i32 @__kmpc_global_thread_num(ptr @[[GLOB1]])
1706 // CHECK2-NEXT: call void @__kmpc_barrier(ptr @[[GLOB2]], i32 [[TMP2]])
1707 // CHECK2-NEXT: [[WARP_MASTER:%.*]] = icmp eq i32 [[NVPTX_LANE_ID]], 0
1708 // CHECK2-NEXT: br i1 [[WARP_MASTER]], label [[THEN:%.*]], label [[ELSE:%.*]]
1709 // CHECK2: then:
1710 // CHECK2-NEXT: [[TMP7:%.*]] = getelementptr inbounds [2 x ptr], ptr [[TMP6]], i32 0, i32 0
1711 // CHECK2-NEXT: [[TMP8:%.*]] = load ptr, ptr [[TMP7]], align 4
1712 // CHECK2-NEXT: [[TMP9:%.*]] = getelementptr inbounds [32 x i32], ptr addrspace(3) @__openmp_nvptx_data_transfer_temporary_storage, i64 0, i32 [[NVPTX_WARP_ID]]
1713 // CHECK2-NEXT: [[TMP10:%.*]] = load i8, ptr [[TMP8]], align 1
1714 // CHECK2-NEXT: store volatile i8 [[TMP10]], ptr addrspace(3) [[TMP9]], align 1
1715 // CHECK2-NEXT: br label [[IFCONT:%.*]]
1716 // CHECK2: else:
1717 // CHECK2-NEXT: br label [[IFCONT]]
1718 // CHECK2: ifcont:
1719 // CHECK2-NEXT: [[TMP2:%.*]] = call i32 @__kmpc_global_thread_num(ptr @[[GLOB1]])
1720 // CHECK2-NEXT: call void @__kmpc_barrier(ptr @[[GLOB2]], i32 [[TMP2]])
1721 // CHECK2-NEXT: [[TMP11:%.*]] = load i32, ptr [[DOTADDR1]], align 4
1722 // CHECK2-NEXT: [[IS_ACTIVE_THREAD:%.*]] = icmp ult i32 [[TMP3]], [[TMP11]]
1723 // CHECK2-NEXT: br i1 [[IS_ACTIVE_THREAD]], label [[THEN2:%.*]], label [[ELSE3:%.*]]
1724 // CHECK2: then3:
1725 // CHECK2-NEXT: [[TMP12:%.*]] = getelementptr inbounds [32 x i32], ptr addrspace(3) @__openmp_nvptx_data_transfer_temporary_storage, i64 0, i32 [[TMP3]]
1726 // CHECK2-NEXT: [[TMP13:%.*]] = getelementptr inbounds [2 x ptr], ptr [[TMP6]], i32 0, i32 0
1727 // CHECK2-NEXT: [[TMP14:%.*]] = load ptr, ptr [[TMP13]], align 4
1728 // CHECK2-NEXT: [[TMP15:%.*]] = load volatile i8, ptr addrspace(3) [[TMP12]], align 1
1729 // CHECK2-NEXT: store i8 [[TMP15]], ptr [[TMP14]], align 1
1730 // CHECK2-NEXT: br label [[IFCONT4:%.*]]
1731 // CHECK2: else4:
1732 // CHECK2-NEXT: br label [[IFCONT4]]
1733 // CHECK2: ifcont5:
1734 // CHECK2-NEXT: [[TMP2:%.*]] = call i32 @__kmpc_global_thread_num(ptr @[[GLOB1]])
1735 // CHECK2-NEXT: call void @__kmpc_barrier(ptr @[[GLOB2]], i32 [[TMP2]])
1736 // CHECK2-NEXT: [[WARP_MASTER5:%.*]] = icmp eq i32 [[NVPTX_LANE_ID]], 0
1737 // CHECK2-NEXT: br i1 [[WARP_MASTER5]], label [[THEN6:%.*]], label [[ELSE7:%.*]]
1738 // CHECK2: then8:
1739 // CHECK2-NEXT: [[TMP16:%.*]] = getelementptr inbounds [2 x ptr], ptr [[TMP6]], i32 0, i32 1
1740 // CHECK2-NEXT: [[TMP17:%.*]] = load ptr, ptr [[TMP16]], align 4
1741 // CHECK2-NEXT: [[TMP18:%.*]] = getelementptr inbounds [32 x i32], ptr addrspace(3) @__openmp_nvptx_data_transfer_temporary_storage, i64 0, i32 [[NVPTX_WARP_ID]]
1742 // CHECK2-NEXT: [[TMP19:%.*]] = load i32, ptr [[TMP17]], align 4
1743 // CHECK2-NEXT: store volatile i32 [[TMP19]], ptr addrspace(3) [[TMP18]], align 4
1744 // CHECK2-NEXT: br label [[IFCONT8:%.*]]
1745 // CHECK2: else9:
1746 // CHECK2-NEXT: br label [[IFCONT8]]
1747 // CHECK2: ifcont10:
1748 // CHECK2-NEXT: [[TMP2:%.*]] = call i32 @__kmpc_global_thread_num(ptr @[[GLOB1]])
1749 // CHECK2-NEXT: call void @__kmpc_barrier(ptr @[[GLOB2]], i32 [[TMP2]])
1750 // CHECK2-NEXT: [[TMP20:%.*]] = load i32, ptr [[DOTADDR1]], align 4
1751 // CHECK2-NEXT: [[IS_ACTIVE_THREAD9:%.*]] = icmp ult i32 [[TMP3]], [[TMP20]]
1752 // CHECK2-NEXT: br i1 [[IS_ACTIVE_THREAD9]], label [[THEN10:%.*]], label [[ELSE11:%.*]]
1753 // CHECK2: then13:
1754 // CHECK2-NEXT: [[TMP21:%.*]] = getelementptr inbounds [32 x i32], ptr addrspace(3) @__openmp_nvptx_data_transfer_temporary_storage, i64 0, i32 [[TMP3]]
1755 // CHECK2-NEXT: [[TMP22:%.*]] = getelementptr inbounds [2 x ptr], ptr [[TMP6]], i32 0, i32 1
1756 // CHECK2-NEXT: [[TMP23:%.*]] = load ptr, ptr [[TMP22]], align 4
1757 // CHECK2-NEXT: [[TMP24:%.*]] = load volatile i32, ptr addrspace(3) [[TMP21]], align 4
1758 // CHECK2-NEXT: store i32 [[TMP24]], ptr [[TMP23]], align 4
1759 // CHECK2-NEXT: br label [[IFCONT12:%.*]]
1760 // CHECK2: else14:
1761 // CHECK2-NEXT: br label [[IFCONT12]]
1762 // CHECK2: ifcont15:
1763 // CHECK2-NEXT: ret void
1766 // CHECK2-LABEL: define {{[^@]+}}@_omp_reduction_list_to_global_copy_func3
1767 // CHECK2-SAME: (ptr noundef [[TMP0:%.*]], i32 noundef [[TMP1:%.*]], ptr noundef [[TMP2:%.*]]) #[[ATTR3]] {
1768 // CHECK2-NEXT: entry:
1769 // CHECK2-NEXT: [[DOTADDR:%.*]] = alloca ptr, align 4
1770 // CHECK2-NEXT: [[DOTADDR1:%.*]] = alloca i32, align 4
1771 // CHECK2-NEXT: [[DOTADDR2:%.*]] = alloca ptr, align 4
1772 // CHECK2-NEXT: store ptr [[TMP0]], ptr [[DOTADDR]], align 4
1773 // CHECK2-NEXT: store i32 [[TMP1]], ptr [[DOTADDR1]], align 4
1774 // CHECK2-NEXT: store ptr [[TMP2]], ptr [[DOTADDR2]], align 4
1775 // CHECK2-NEXT: [[TMP3:%.*]] = load ptr, ptr [[DOTADDR2]], align 4
1776 // CHECK2-NEXT: [[TMP4:%.*]] = load ptr, ptr [[DOTADDR]], align 4
1777 // CHECK2-NEXT: [[TMP5:%.*]] = load i32, ptr [[DOTADDR1]], align 4
1778 // CHECK2-NEXT: [[TMP6:%.*]] = getelementptr inbounds [2 x ptr], ptr [[TMP3]], i32 0, i32 0
1779 // CHECK2-NEXT: [[TMP7:%.*]] = load ptr, ptr [[TMP6]], align 4
1780 // CHECK2-NEXT: [[TMP8:%.*]] = getelementptr inbounds [[STRUCT__GLOBALIZED_LOCALS_TY_0:%.*]], ptr [[TMP4]], i32 [[TMP5]]
1781 // CHECK2-NEXT: [[C:%.*]] = getelementptr inbounds [[STRUCT__GLOBALIZED_LOCALS_TY_0]], ptr [[TMP8]], i32 0, i32 0
1782 // CHECK2-NEXT: [[TMP9:%.*]] = load i8, ptr [[TMP7]], align 1
1783 // CHECK2-NEXT: store i8 [[TMP9]], ptr [[C]], align 1
1784 // CHECK2-NEXT: [[TMP10:%.*]] = getelementptr inbounds [2 x ptr], ptr [[TMP3]], i32 0, i32 1
1785 // CHECK2-NEXT: [[TMP11:%.*]] = load ptr, ptr [[TMP10]], align 4
1786 // CHECK2-NEXT: [[TMP12:%.*]] = getelementptr inbounds [[STRUCT__GLOBALIZED_LOCALS_TY_0]], ptr [[TMP4]], i32 [[TMP5]]
1787 // CHECK2-NEXT: [[D:%.*]] = getelementptr inbounds [[STRUCT__GLOBALIZED_LOCALS_TY_0]], ptr [[TMP12]], i32 0, i32 1
1788 // CHECK2-NEXT: [[TMP13:%.*]] = load float, ptr [[TMP11]], align 4
1789 // CHECK2-NEXT: store float [[TMP13]], ptr [[D]], align 4
1790 // CHECK2-NEXT: ret void
1793 // CHECK2-LABEL: define {{[^@]+}}@_omp_reduction_list_to_global_reduce_func4
1794 // CHECK2-SAME: (ptr noundef [[TMP0:%.*]], i32 noundef [[TMP1:%.*]], ptr noundef [[TMP2:%.*]]) #[[ATTR3]] {
1795 // CHECK2-NEXT: entry:
1796 // CHECK2-NEXT: [[DOTADDR:%.*]] = alloca ptr, align 4
1797 // CHECK2-NEXT: [[DOTADDR1:%.*]] = alloca i32, align 4
1798 // CHECK2-NEXT: [[DOTADDR2:%.*]] = alloca ptr, align 4
1799 // CHECK2-NEXT: [[DOTOMP_REDUCTION_RED_LIST:%.*]] = alloca [2 x ptr], align 4
1800 // CHECK2-NEXT: store ptr [[TMP0]], ptr [[DOTADDR]], align 4
1801 // CHECK2-NEXT: store i32 [[TMP1]], ptr [[DOTADDR1]], align 4
1802 // CHECK2-NEXT: store ptr [[TMP2]], ptr [[DOTADDR2]], align 4
1803 // CHECK2-NEXT: [[TMP3:%.*]] = load ptr, ptr [[DOTADDR]], align 4
1804 // CHECK2-NEXT: [[TMP4:%.*]] = load i32, ptr [[DOTADDR1]], align 4
1805 // CHECK2-NEXT: [[TMP5:%.*]] = getelementptr inbounds [2 x ptr], ptr [[DOTOMP_REDUCTION_RED_LIST]], i32 0, i32 0
1806 // CHECK2-NEXT: [[TMP6:%.*]] = getelementptr inbounds [[STRUCT__GLOBALIZED_LOCALS_TY_0:%.*]], ptr [[TMP3]], i32 [[TMP4]]
1807 // CHECK2-NEXT: [[C:%.*]] = getelementptr inbounds [[STRUCT__GLOBALIZED_LOCALS_TY_0]], ptr [[TMP6]], i32 0, i32 0
1808 // CHECK2-NEXT: store ptr [[C]], ptr [[TMP5]], align 4
1809 // CHECK2-NEXT: [[TMP7:%.*]] = getelementptr inbounds [2 x ptr], ptr [[DOTOMP_REDUCTION_RED_LIST]], i32 0, i32 1
1810 // CHECK2-NEXT: [[TMP8:%.*]] = getelementptr inbounds [[STRUCT__GLOBALIZED_LOCALS_TY_0]], ptr [[TMP3]], i32 [[TMP4]]
1811 // CHECK2-NEXT: [[D:%.*]] = getelementptr inbounds [[STRUCT__GLOBALIZED_LOCALS_TY_0]], ptr [[TMP8]], i32 0, i32 1
1812 // CHECK2-NEXT: store ptr [[D]], ptr [[TMP7]], align 4
1813 // CHECK2-NEXT: [[TMP9:%.*]] = load ptr, ptr [[DOTADDR2]], align 4
1814 // CHECK2-NEXT: call void @"{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z9ftemplateIcET_i_l26_omp_outlined_omp$reduction$reduction_func"(ptr [[DOTOMP_REDUCTION_RED_LIST]], ptr [[TMP9]]) #[[ATTR4]]
1815 // CHECK2-NEXT: ret void
1818 // CHECK2-LABEL: define {{[^@]+}}@_omp_reduction_global_to_list_copy_func5
1819 // CHECK2-SAME: (ptr noundef [[TMP0:%.*]], i32 noundef [[TMP1:%.*]], ptr noundef [[TMP2:%.*]]) #[[ATTR3]] {
1820 // CHECK2-NEXT: entry:
1821 // CHECK2-NEXT: [[DOTADDR:%.*]] = alloca ptr, align 4
1822 // CHECK2-NEXT: [[DOTADDR1:%.*]] = alloca i32, align 4
1823 // CHECK2-NEXT: [[DOTADDR2:%.*]] = alloca ptr, align 4
1824 // CHECK2-NEXT: store ptr [[TMP0]], ptr [[DOTADDR]], align 4
1825 // CHECK2-NEXT: store i32 [[TMP1]], ptr [[DOTADDR1]], align 4
1826 // CHECK2-NEXT: store ptr [[TMP2]], ptr [[DOTADDR2]], align 4
1827 // CHECK2-NEXT: [[TMP3:%.*]] = load ptr, ptr [[DOTADDR2]], align 4
1828 // CHECK2-NEXT: [[TMP4:%.*]] = load ptr, ptr [[DOTADDR]], align 4
1829 // CHECK2-NEXT: [[TMP5:%.*]] = load i32, ptr [[DOTADDR1]], align 4
1830 // CHECK2-NEXT: [[TMP6:%.*]] = getelementptr inbounds [2 x ptr], ptr [[TMP3]], i32 0, i32 0
1831 // CHECK2-NEXT: [[TMP7:%.*]] = load ptr, ptr [[TMP6]], align 4
1832 // CHECK2-NEXT: [[TMP8:%.*]] = getelementptr inbounds [[STRUCT__GLOBALIZED_LOCALS_TY_0:%.*]], ptr [[TMP4]], i32 [[TMP5]]
1833 // CHECK2-NEXT: [[C:%.*]] = getelementptr inbounds [[STRUCT__GLOBALIZED_LOCALS_TY_0]], ptr [[TMP8]], i32 0, i32 0
1834 // CHECK2-NEXT: [[TMP9:%.*]] = load i8, ptr [[C]], align 1
1835 // CHECK2-NEXT: store i8 [[TMP9]], ptr [[TMP7]], align 1
1836 // CHECK2-NEXT: [[TMP10:%.*]] = getelementptr inbounds [2 x ptr], ptr [[TMP3]], i32 0, i32 1
1837 // CHECK2-NEXT: [[TMP11:%.*]] = load ptr, ptr [[TMP10]], align 4
1838 // CHECK2-NEXT: [[TMP12:%.*]] = getelementptr inbounds [[STRUCT__GLOBALIZED_LOCALS_TY_0]], ptr [[TMP4]], i32 [[TMP5]]
1839 // CHECK2-NEXT: [[D:%.*]] = getelementptr inbounds [[STRUCT__GLOBALIZED_LOCALS_TY_0]], ptr [[TMP12]], i32 0, i32 1
1840 // CHECK2-NEXT: [[TMP13:%.*]] = load float, ptr [[D]], align 4
1841 // CHECK2-NEXT: store float [[TMP13]], ptr [[TMP11]], align 4
1842 // CHECK2-NEXT: ret void
1845 // CHECK2-LABEL: define {{[^@]+}}@_omp_reduction_global_to_list_reduce_func6
1846 // CHECK2-SAME: (ptr noundef [[TMP0:%.*]], i32 noundef [[TMP1:%.*]], ptr noundef [[TMP2:%.*]]) #[[ATTR3]] {
1847 // CHECK2-NEXT: entry:
1848 // CHECK2-NEXT: [[DOTADDR:%.*]] = alloca ptr, align 4
1849 // CHECK2-NEXT: [[DOTADDR1:%.*]] = alloca i32, align 4
1850 // CHECK2-NEXT: [[DOTADDR2:%.*]] = alloca ptr, align 4
1851 // CHECK2-NEXT: [[DOTOMP_REDUCTION_RED_LIST:%.*]] = alloca [2 x ptr], align 4
1852 // CHECK2-NEXT: store ptr [[TMP0]], ptr [[DOTADDR]], align 4
1853 // CHECK2-NEXT: store i32 [[TMP1]], ptr [[DOTADDR1]], align 4
1854 // CHECK2-NEXT: store ptr [[TMP2]], ptr [[DOTADDR2]], align 4
1855 // CHECK2-NEXT: [[TMP3:%.*]] = load ptr, ptr [[DOTADDR]], align 4
1856 // CHECK2-NEXT: [[TMP4:%.*]] = load i32, ptr [[DOTADDR1]], align 4
1857 // CHECK2-NEXT: [[TMP5:%.*]] = getelementptr inbounds [2 x ptr], ptr [[DOTOMP_REDUCTION_RED_LIST]], i32 0, i32 0
1858 // CHECK2-NEXT: [[TMP6:%.*]] = getelementptr inbounds [[STRUCT__GLOBALIZED_LOCALS_TY_0:%.*]], ptr [[TMP3]], i32 [[TMP4]]
1859 // CHECK2-NEXT: [[C:%.*]] = getelementptr inbounds [[STRUCT__GLOBALIZED_LOCALS_TY_0]], ptr [[TMP6]], i32 0, i32 0
1860 // CHECK2-NEXT: store ptr [[C]], ptr [[TMP5]], align 4
1861 // CHECK2-NEXT: [[TMP7:%.*]] = getelementptr inbounds [2 x ptr], ptr [[DOTOMP_REDUCTION_RED_LIST]], i32 0, i32 1
1862 // CHECK2-NEXT: [[TMP8:%.*]] = getelementptr inbounds [[STRUCT__GLOBALIZED_LOCALS_TY_0]], ptr [[TMP3]], i32 [[TMP4]]
1863 // CHECK2-NEXT: [[D:%.*]] = getelementptr inbounds [[STRUCT__GLOBALIZED_LOCALS_TY_0]], ptr [[TMP8]], i32 0, i32 1
1864 // CHECK2-NEXT: store ptr [[D]], ptr [[TMP7]], align 4
1865 // CHECK2-NEXT: [[TMP9:%.*]] = load ptr, ptr [[DOTADDR2]], align 4
1866 // CHECK2-NEXT: call void @"{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z9ftemplateIcET_i_l26_omp_outlined_omp$reduction$reduction_func"(ptr [[TMP9]], ptr [[DOTOMP_REDUCTION_RED_LIST]]) #[[ATTR4]]
1867 // CHECK2-NEXT: ret void
1870 // CHECK2-LABEL: define {{[^@]+}}@{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z9ftemplateIcET_i_l33
1871 // CHECK2-SAME: (ptr noalias noundef [[DYN_PTR:%.*]], i32 noundef [[A:%.*]], i32 noundef [[B:%.*]]) #[[ATTR0]] {
1872 // CHECK2-NEXT: entry:
1873 // CHECK2-NEXT: [[DYN_PTR_ADDR:%.*]] = alloca ptr, align 4
1874 // CHECK2-NEXT: [[A_ADDR:%.*]] = alloca i32, align 4
1875 // CHECK2-NEXT: [[B_ADDR:%.*]] = alloca i32, align 4
1876 // CHECK2-NEXT: [[DOTZERO_ADDR:%.*]] = alloca i32, align 4
1877 // CHECK2-NEXT: [[DOTTHREADID_TEMP_:%.*]] = alloca i32, align 4
1878 // CHECK2-NEXT: store ptr [[DYN_PTR]], ptr [[DYN_PTR_ADDR]], align 4
1879 // CHECK2-NEXT: store i32 [[A]], ptr [[A_ADDR]], align 4
1880 // CHECK2-NEXT: store i32 [[B]], ptr [[B_ADDR]], align 4
1881 // CHECK2-NEXT: [[TMP0:%.*]] = call i32 @__kmpc_target_init(ptr @{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z9ftemplateIcET_i_l33_kernel_environment, ptr [[DYN_PTR]])
1882 // CHECK2-NEXT: [[EXEC_USER_CODE:%.*]] = icmp eq i32 [[TMP0]], -1
1883 // CHECK2-NEXT: br i1 [[EXEC_USER_CODE]], label [[USER_CODE_ENTRY:%.*]], label [[WORKER_EXIT:%.*]]
1884 // CHECK2: user_code.entry:
1885 // CHECK2-NEXT: [[TMP1:%.*]] = call i32 @__kmpc_global_thread_num(ptr @[[GLOB1]])
1886 // CHECK2-NEXT: store i32 0, ptr [[DOTZERO_ADDR]], align 4
1887 // CHECK2-NEXT: store i32 [[TMP1]], ptr [[DOTTHREADID_TEMP_]], align 4
1888 // CHECK2-NEXT: call void @{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z9ftemplateIcET_i_l33_omp_outlined(ptr [[DOTTHREADID_TEMP_]], ptr [[DOTZERO_ADDR]], ptr [[A_ADDR]], ptr [[B_ADDR]]) #[[ATTR4]]
1889 // CHECK2-NEXT: call void @__kmpc_target_deinit()
1890 // CHECK2-NEXT: ret void
1891 // CHECK2: worker.exit:
1892 // CHECK2-NEXT: ret void
1895 // CHECK2-LABEL: define {{[^@]+}}@{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z9ftemplateIcET_i_l33_omp_outlined
1896 // CHECK2-SAME: (ptr noalias noundef [[DOTGLOBAL_TID_:%.*]], ptr noalias noundef [[DOTBOUND_TID_:%.*]], ptr noundef nonnull align 4 dereferenceable(4) [[A:%.*]], ptr noundef nonnull align 2 dereferenceable(2) [[B:%.*]]) #[[ATTR1]] {
1897 // CHECK2-NEXT: entry:
1898 // CHECK2-NEXT: [[DOTGLOBAL_TID__ADDR:%.*]] = alloca ptr, align 4
1899 // CHECK2-NEXT: [[DOTBOUND_TID__ADDR:%.*]] = alloca ptr, align 4
1900 // CHECK2-NEXT: [[A_ADDR:%.*]] = alloca ptr, align 4
1901 // CHECK2-NEXT: [[B_ADDR:%.*]] = alloca ptr, align 4
1902 // CHECK2-NEXT: [[A1:%.*]] = alloca i32, align 4
1903 // CHECK2-NEXT: [[B2:%.*]] = alloca i16, align 2
1904 // CHECK2-NEXT: [[CAPTURED_VARS_ADDRS:%.*]] = alloca [2 x ptr], align 4
1905 // CHECK2-NEXT: [[DOTOMP_REDUCTION_RED_LIST:%.*]] = alloca [2 x ptr], align 4
1906 // CHECK2-NEXT: store ptr [[DOTGLOBAL_TID_]], ptr [[DOTGLOBAL_TID__ADDR]], align 4
1907 // CHECK2-NEXT: store ptr [[DOTBOUND_TID_]], ptr [[DOTBOUND_TID__ADDR]], align 4
1908 // CHECK2-NEXT: store ptr [[A]], ptr [[A_ADDR]], align 4
1909 // CHECK2-NEXT: store ptr [[B]], ptr [[B_ADDR]], align 4
1910 // CHECK2-NEXT: [[TMP0:%.*]] = load ptr, ptr [[A_ADDR]], align 4
1911 // CHECK2-NEXT: [[TMP1:%.*]] = load ptr, ptr [[B_ADDR]], align 4
1912 // CHECK2-NEXT: store i32 0, ptr [[A1]], align 4
1913 // CHECK2-NEXT: store i16 -32768, ptr [[B2]], align 2
1914 // CHECK2-NEXT: [[TMP2:%.*]] = getelementptr inbounds [2 x ptr], ptr [[CAPTURED_VARS_ADDRS]], i32 0, i32 0
1915 // CHECK2-NEXT: store ptr [[A1]], ptr [[TMP2]], align 4
1916 // CHECK2-NEXT: [[TMP3:%.*]] = getelementptr inbounds [2 x ptr], ptr [[CAPTURED_VARS_ADDRS]], i32 0, i32 1
1917 // CHECK2-NEXT: store ptr [[B2]], ptr [[TMP3]], align 4
1918 // CHECK2-NEXT: [[TMP4:%.*]] = load ptr, ptr [[DOTGLOBAL_TID__ADDR]], align 4
1919 // CHECK2-NEXT: [[TMP5:%.*]] = load i32, ptr [[TMP4]], align 4
1920 // CHECK2-NEXT: call void @__kmpc_parallel_51(ptr @[[GLOB1]], i32 [[TMP5]], i32 1, i32 -1, i32 -1, ptr @{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z9ftemplateIcET_i_l33_omp_outlined_omp_outlined, ptr null, ptr [[CAPTURED_VARS_ADDRS]], i32 2)
1921 // CHECK2-NEXT: [[TMP6:%.*]] = getelementptr inbounds [2 x ptr], ptr [[DOTOMP_REDUCTION_RED_LIST]], i32 0, i32 0
1922 // CHECK2-NEXT: store ptr [[A1]], ptr [[TMP6]], align 4
1923 // CHECK2-NEXT: [[TMP7:%.*]] = getelementptr inbounds [2 x ptr], ptr [[DOTOMP_REDUCTION_RED_LIST]], i32 0, i32 1
1924 // CHECK2-NEXT: store ptr [[B2]], ptr [[TMP7]], align 4
1925 // CHECK2-NEXT: %"_openmp_teams_reductions_buffer_$_$ptr" = call ptr @__kmpc_reduction_get_fixed_buffer()
1926 // CHECK2-NEXT: [[TMP8:%.*]] = call i32 @__kmpc_nvptx_teams_reduce_nowait_v2(ptr @[[GLOB1]], ptr %"_openmp_teams_reductions_buffer_$_$ptr", i32 1024, i64 8, ptr [[DOTOMP_REDUCTION_RED_LIST]], ptr @_omp_reduction_shuffle_and_reduce_func9, ptr @_omp_reduction_inter_warp_copy_func10, ptr @_omp_reduction_list_to_global_copy_func11, ptr @_omp_reduction_list_to_global_reduce_func12, ptr @_omp_reduction_global_to_list_copy_func13, ptr @_omp_reduction_global_to_list_reduce_func14)
1927 // CHECK2-NEXT: [[TMP9:%.*]] = icmp eq i32 [[TMP8]], 1
1928 // CHECK2-NEXT: br i1 [[TMP9]], label [[DOTOMP_REDUCTION_THEN:%.*]], label [[DOTOMP_REDUCTION_DONE:%.*]]
1929 // CHECK2: .omp.reduction.then:
1930 // CHECK2-NEXT: [[TMP10:%.*]] = load i32, ptr [[TMP0]], align 4
1931 // CHECK2-NEXT: [[TMP11:%.*]] = load i32, ptr [[A1]], align 4
1932 // CHECK2-NEXT: [[OR:%.*]] = or i32 [[TMP10]], [[TMP11]]
1933 // CHECK2-NEXT: store i32 [[OR]], ptr [[TMP0]], align 4
1934 // CHECK2-NEXT: [[TMP12:%.*]] = load i16, ptr [[TMP1]], align 2
1935 // CHECK2-NEXT: [[CONV:%.*]] = sext i16 [[TMP12]] to i32
1936 // CHECK2-NEXT: [[TMP13:%.*]] = load i16, ptr [[B2]], align 2
1937 // CHECK2-NEXT: [[CONV3:%.*]] = sext i16 [[TMP13]] to i32
1938 // CHECK2-NEXT: [[CMP:%.*]] = icmp sgt i32 [[CONV]], [[CONV3]]
1939 // CHECK2-NEXT: br i1 [[CMP]], label [[COND_TRUE:%.*]], label [[COND_FALSE:%.*]]
1940 // CHECK2: cond.true:
1941 // CHECK2-NEXT: [[TMP14:%.*]] = load i16, ptr [[TMP1]], align 2
1942 // CHECK2-NEXT: br label [[COND_END:%.*]]
1943 // CHECK2: cond.false:
1944 // CHECK2-NEXT: [[TMP15:%.*]] = load i16, ptr [[B2]], align 2
1945 // CHECK2-NEXT: br label [[COND_END]]
1946 // CHECK2: cond.end:
1947 // CHECK2-NEXT: [[COND:%.*]] = phi i16 [ [[TMP14]], [[COND_TRUE]] ], [ [[TMP15]], [[COND_FALSE]] ]
1948 // CHECK2-NEXT: store i16 [[COND]], ptr [[TMP1]], align 2
1949 // CHECK2-NEXT: br label [[DOTOMP_REDUCTION_DONE]]
1950 // CHECK2: .omp.reduction.done:
1951 // CHECK2-NEXT: ret void
1954 // CHECK2-LABEL: define {{[^@]+}}@{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z9ftemplateIcET_i_l33_omp_outlined_omp_outlined
1955 // CHECK2-SAME: (ptr noalias noundef [[DOTGLOBAL_TID_:%.*]], ptr noalias noundef [[DOTBOUND_TID_:%.*]], ptr noundef nonnull align 4 dereferenceable(4) [[A:%.*]], ptr noundef nonnull align 2 dereferenceable(2) [[B:%.*]]) #[[ATTR1]] {
1956 // CHECK2-NEXT: entry:
1957 // CHECK2-NEXT: [[DOTGLOBAL_TID__ADDR:%.*]] = alloca ptr, align 4
1958 // CHECK2-NEXT: [[DOTBOUND_TID__ADDR:%.*]] = alloca ptr, align 4
1959 // CHECK2-NEXT: [[A_ADDR:%.*]] = alloca ptr, align 4
1960 // CHECK2-NEXT: [[B_ADDR:%.*]] = alloca ptr, align 4
1961 // CHECK2-NEXT: [[A1:%.*]] = alloca i32, align 4
1962 // CHECK2-NEXT: [[B2:%.*]] = alloca i16, align 2
1963 // CHECK2-NEXT: [[DOTOMP_REDUCTION_RED_LIST:%.*]] = alloca [2 x ptr], align 4
1964 // CHECK2-NEXT: store ptr [[DOTGLOBAL_TID_]], ptr [[DOTGLOBAL_TID__ADDR]], align 4
1965 // CHECK2-NEXT: store ptr [[DOTBOUND_TID_]], ptr [[DOTBOUND_TID__ADDR]], align 4
1966 // CHECK2-NEXT: store ptr [[A]], ptr [[A_ADDR]], align 4
1967 // CHECK2-NEXT: store ptr [[B]], ptr [[B_ADDR]], align 4
1968 // CHECK2-NEXT: [[TMP0:%.*]] = load ptr, ptr [[A_ADDR]], align 4
1969 // CHECK2-NEXT: [[TMP1:%.*]] = load ptr, ptr [[B_ADDR]], align 4
1970 // CHECK2-NEXT: store i32 0, ptr [[A1]], align 4
1971 // CHECK2-NEXT: store i16 -32768, ptr [[B2]], align 2
1972 // CHECK2-NEXT: [[TMP2:%.*]] = load i32, ptr [[A1]], align 4
1973 // CHECK2-NEXT: [[OR:%.*]] = or i32 [[TMP2]], 1
1974 // CHECK2-NEXT: store i32 [[OR]], ptr [[A1]], align 4
1975 // CHECK2-NEXT: [[TMP3:%.*]] = load i16, ptr [[B2]], align 2
1976 // CHECK2-NEXT: [[CONV:%.*]] = sext i16 [[TMP3]] to i32
1977 // CHECK2-NEXT: [[CMP:%.*]] = icmp sgt i32 99, [[CONV]]
1978 // CHECK2-NEXT: br i1 [[CMP]], label [[COND_TRUE:%.*]], label [[COND_FALSE:%.*]]
1979 // CHECK2: cond.true:
1980 // CHECK2-NEXT: br label [[COND_END:%.*]]
1981 // CHECK2: cond.false:
1982 // CHECK2-NEXT: [[TMP4:%.*]] = load i16, ptr [[B2]], align 2
1983 // CHECK2-NEXT: [[CONV3:%.*]] = sext i16 [[TMP4]] to i32
1984 // CHECK2-NEXT: br label [[COND_END]]
1985 // CHECK2: cond.end:
1986 // CHECK2-NEXT: [[COND:%.*]] = phi i32 [ 99, [[COND_TRUE]] ], [ [[CONV3]], [[COND_FALSE]] ]
1987 // CHECK2-NEXT: [[CONV4:%.*]] = trunc i32 [[COND]] to i16
1988 // CHECK2-NEXT: store i16 [[CONV4]], ptr [[B2]], align 2
1989 // CHECK2-NEXT: [[TMP5:%.*]] = getelementptr inbounds [2 x ptr], ptr [[DOTOMP_REDUCTION_RED_LIST]], i32 0, i32 0
1990 // CHECK2-NEXT: store ptr [[A1]], ptr [[TMP5]], align 4
1991 // CHECK2-NEXT: [[TMP6:%.*]] = getelementptr inbounds [2 x ptr], ptr [[DOTOMP_REDUCTION_RED_LIST]], i32 0, i32 1
1992 // CHECK2-NEXT: store ptr [[B2]], ptr [[TMP6]], align 4
1993 // CHECK2-NEXT: [[TMP7:%.*]] = call i32 @__kmpc_nvptx_parallel_reduce_nowait_v2(ptr @[[GLOB1]], i64 8, ptr [[DOTOMP_REDUCTION_RED_LIST]], ptr @_omp_reduction_shuffle_and_reduce_func7, ptr @_omp_reduction_inter_warp_copy_func8)
1994 // CHECK2-NEXT: [[TMP8:%.*]] = icmp eq i32 [[TMP7]], 1
1995 // CHECK2-NEXT: br i1 [[TMP8]], label [[DOTOMP_REDUCTION_THEN:%.*]], label [[DOTOMP_REDUCTION_DONE:%.*]]
1996 // CHECK2: .omp.reduction.then:
1997 // CHECK2-NEXT: [[TMP9:%.*]] = load i32, ptr [[TMP0]], align 4
1998 // CHECK2-NEXT: [[TMP10:%.*]] = load i32, ptr [[A1]], align 4
1999 // CHECK2-NEXT: [[OR5:%.*]] = or i32 [[TMP9]], [[TMP10]]
2000 // CHECK2-NEXT: store i32 [[OR5]], ptr [[TMP0]], align 4
2001 // CHECK2-NEXT: [[TMP11:%.*]] = load i16, ptr [[TMP1]], align 2
2002 // CHECK2-NEXT: [[CONV6:%.*]] = sext i16 [[TMP11]] to i32
2003 // CHECK2-NEXT: [[TMP12:%.*]] = load i16, ptr [[B2]], align 2
2004 // CHECK2-NEXT: [[CONV7:%.*]] = sext i16 [[TMP12]] to i32
2005 // CHECK2-NEXT: [[CMP8:%.*]] = icmp sgt i32 [[CONV6]], [[CONV7]]
2006 // CHECK2-NEXT: br i1 [[CMP8]], label [[COND_TRUE9:%.*]], label [[COND_FALSE10:%.*]]
2007 // CHECK2: cond.true9:
2008 // CHECK2-NEXT: [[TMP13:%.*]] = load i16, ptr [[TMP1]], align 2
2009 // CHECK2-NEXT: br label [[COND_END11:%.*]]
2010 // CHECK2: cond.false10:
2011 // CHECK2-NEXT: [[TMP14:%.*]] = load i16, ptr [[B2]], align 2
2012 // CHECK2-NEXT: br label [[COND_END11]]
2013 // CHECK2: cond.end11:
2014 // CHECK2-NEXT: [[COND12:%.*]] = phi i16 [ [[TMP13]], [[COND_TRUE9]] ], [ [[TMP14]], [[COND_FALSE10]] ]
2015 // CHECK2-NEXT: store i16 [[COND12]], ptr [[TMP1]], align 2
2016 // CHECK2-NEXT: br label [[DOTOMP_REDUCTION_DONE]]
2017 // CHECK2: .omp.reduction.done:
2018 // CHECK2-NEXT: ret void
2021 // CHECK2-LABEL: define {{[^@]+}}@_omp_reduction_shuffle_and_reduce_func7
2022 // CHECK2-SAME: (ptr noundef [[TMP0:%.*]], i16 noundef signext [[TMP1:%.*]], i16 noundef signext [[TMP2:%.*]], i16 noundef signext [[TMP3:%.*]]) #[[ATTR3]] {
2023 // CHECK2-NEXT: entry:
2024 // CHECK2-NEXT: [[DOTADDR:%.*]] = alloca ptr, align 4
2025 // CHECK2-NEXT: [[DOTADDR1:%.*]] = alloca i16, align 2
2026 // CHECK2-NEXT: [[DOTADDR2:%.*]] = alloca i16, align 2
2027 // CHECK2-NEXT: [[DOTADDR3:%.*]] = alloca i16, align 2
2028 // CHECK2-NEXT: [[DOTOMP_REDUCTION_REMOTE_REDUCE_LIST:%.*]] = alloca [2 x ptr], align 4
2029 // CHECK2-NEXT: [[DOTOMP_REDUCTION_ELEMENT:%.*]] = alloca i32, align 4
2030 // CHECK2-NEXT: [[DOTOMP_REDUCTION_ELEMENT4:%.*]] = alloca i16, align 2
2031 // CHECK2-NEXT: store ptr [[TMP0]], ptr [[DOTADDR]], align 4
2032 // CHECK2-NEXT: store i16 [[TMP1]], ptr [[DOTADDR1]], align 2
2033 // CHECK2-NEXT: store i16 [[TMP2]], ptr [[DOTADDR2]], align 2
2034 // CHECK2-NEXT: store i16 [[TMP3]], ptr [[DOTADDR3]], align 2
2035 // CHECK2-NEXT: [[TMP4:%.*]] = load ptr, ptr [[DOTADDR]], align 4
2036 // CHECK2-NEXT: [[TMP5:%.*]] = load i16, ptr [[DOTADDR1]], align 2
2037 // CHECK2-NEXT: [[TMP6:%.*]] = load i16, ptr [[DOTADDR2]], align 2
2038 // CHECK2-NEXT: [[TMP7:%.*]] = load i16, ptr [[DOTADDR3]], align 2
2039 // CHECK2-NEXT: [[TMP8:%.*]] = getelementptr inbounds [2 x ptr], ptr [[TMP4]], i32 0, i32 0
2040 // CHECK2-NEXT: [[TMP9:%.*]] = load ptr, ptr [[TMP8]], align 4
2041 // CHECK2-NEXT: [[TMP10:%.*]] = getelementptr inbounds [2 x ptr], ptr [[DOTOMP_REDUCTION_REMOTE_REDUCE_LIST]], i32 0, i32 0
2042 // CHECK2-NEXT: [[TMP11:%.*]] = getelementptr i32, ptr [[TMP9]], i32 1
2043 // CHECK2-NEXT: [[TMP12:%.*]] = load i32, ptr [[TMP9]], align 4
2044 // CHECK2-NEXT: [[TMP13:%.*]] = call i32 @__kmpc_get_warp_size()
2045 // CHECK2-NEXT: [[TMP14:%.*]] = trunc i32 [[TMP13]] to i16
2046 // CHECK2-NEXT: [[TMP15:%.*]] = call i32 @__kmpc_shuffle_int32(i32 [[TMP12]], i16 [[TMP6]], i16 [[TMP14]])
2047 // CHECK2-NEXT: store i32 [[TMP15]], ptr [[DOTOMP_REDUCTION_ELEMENT]], align 4
2048 // CHECK2-NEXT: [[TMP16:%.*]] = getelementptr i32, ptr [[TMP9]], i32 1
2049 // CHECK2-NEXT: [[TMP17:%.*]] = getelementptr i32, ptr [[DOTOMP_REDUCTION_ELEMENT]], i32 1
2050 // CHECK2-NEXT: store ptr [[DOTOMP_REDUCTION_ELEMENT]], ptr [[TMP10]], align 4
2051 // CHECK2-NEXT: [[TMP18:%.*]] = getelementptr inbounds [2 x ptr], ptr [[TMP4]], i32 0, i32 1
2052 // CHECK2-NEXT: [[TMP19:%.*]] = load ptr, ptr [[TMP18]], align 4
2053 // CHECK2-NEXT: [[TMP20:%.*]] = getelementptr inbounds [2 x ptr], ptr [[DOTOMP_REDUCTION_REMOTE_REDUCE_LIST]], i32 0, i32 1
2054 // CHECK2-NEXT: [[TMP21:%.*]] = getelementptr i16, ptr [[TMP19]], i32 1
2055 // CHECK2-NEXT: [[TMP22:%.*]] = load i16, ptr [[TMP19]], align 2
2056 // CHECK2-NEXT: [[TMP23:%.*]] = sext i16 [[TMP22]] to i32
2057 // CHECK2-NEXT: [[TMP24:%.*]] = call i32 @__kmpc_get_warp_size()
2058 // CHECK2-NEXT: [[TMP25:%.*]] = trunc i32 [[TMP24]] to i16
2059 // CHECK2-NEXT: [[TMP26:%.*]] = call i32 @__kmpc_shuffle_int32(i32 [[TMP23]], i16 [[TMP6]], i16 [[TMP25]])
2060 // CHECK2-NEXT: [[TMP27:%.*]] = trunc i32 [[TMP26]] to i16
2061 // CHECK2-NEXT: store i16 [[TMP27]], ptr [[DOTOMP_REDUCTION_ELEMENT4]], align 2
2062 // CHECK2-NEXT: [[TMP28:%.*]] = getelementptr i16, ptr [[TMP19]], i32 1
2063 // CHECK2-NEXT: [[TMP29:%.*]] = getelementptr i16, ptr [[DOTOMP_REDUCTION_ELEMENT4]], i32 1
2064 // CHECK2-NEXT: store ptr [[DOTOMP_REDUCTION_ELEMENT4]], ptr [[TMP20]], align 4
2065 // CHECK2-NEXT: [[TMP30:%.*]] = icmp eq i16 [[TMP7]], 0
2066 // CHECK2-NEXT: [[TMP31:%.*]] = icmp eq i16 [[TMP7]], 1
2067 // CHECK2-NEXT: [[TMP32:%.*]] = icmp ult i16 [[TMP5]], [[TMP6]]
2068 // CHECK2-NEXT: [[TMP33:%.*]] = and i1 [[TMP31]], [[TMP32]]
2069 // CHECK2-NEXT: [[TMP34:%.*]] = icmp eq i16 [[TMP7]], 2
2070 // CHECK2-NEXT: [[TMP35:%.*]] = and i16 [[TMP5]], 1
2071 // CHECK2-NEXT: [[TMP36:%.*]] = icmp eq i16 [[TMP35]], 0
2072 // CHECK2-NEXT: [[TMP37:%.*]] = and i1 [[TMP34]], [[TMP36]]
2073 // CHECK2-NEXT: [[TMP38:%.*]] = icmp sgt i16 [[TMP6]], 0
2074 // CHECK2-NEXT: [[TMP39:%.*]] = and i1 [[TMP37]], [[TMP38]]
2075 // CHECK2-NEXT: [[TMP40:%.*]] = or i1 [[TMP30]], [[TMP33]]
2076 // CHECK2-NEXT: [[TMP41:%.*]] = or i1 [[TMP40]], [[TMP39]]
2077 // CHECK2-NEXT: br i1 [[TMP41]], label [[THEN:%.*]], label [[ELSE:%.*]]
2078 // CHECK2: then:
2079 // CHECK2-NEXT: call void @"{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z9ftemplateIcET_i_l33_omp_outlined_omp_outlined_omp$reduction$reduction_func"(ptr [[TMP4]], ptr [[DOTOMP_REDUCTION_REMOTE_REDUCE_LIST]]) #[[ATTR4]]
2080 // CHECK2-NEXT: br label [[IFCONT:%.*]]
2081 // CHECK2: else:
2082 // CHECK2-NEXT: br label [[IFCONT]]
2083 // CHECK2: ifcont:
2084 // CHECK2-NEXT: [[TMP42:%.*]] = icmp eq i16 [[TMP7]], 1
2085 // CHECK2-NEXT: [[TMP43:%.*]] = icmp uge i16 [[TMP5]], [[TMP6]]
2086 // CHECK2-NEXT: [[TMP44:%.*]] = and i1 [[TMP42]], [[TMP43]]
2087 // CHECK2-NEXT: br i1 [[TMP44]], label [[THEN5:%.*]], label [[ELSE6:%.*]]
2088 // CHECK2: then5:
2089 // CHECK2-NEXT: [[TMP45:%.*]] = getelementptr inbounds [2 x ptr], ptr [[DOTOMP_REDUCTION_REMOTE_REDUCE_LIST]], i32 0, i32 0
2090 // CHECK2-NEXT: [[TMP46:%.*]] = load ptr, ptr [[TMP45]], align 4
2091 // CHECK2-NEXT: [[TMP47:%.*]] = getelementptr inbounds [2 x ptr], ptr [[TMP4]], i32 0, i32 0
2092 // CHECK2-NEXT: [[TMP48:%.*]] = load ptr, ptr [[TMP47]], align 4
2093 // CHECK2-NEXT: [[TMP49:%.*]] = load i32, ptr [[TMP46]], align 4
2094 // CHECK2-NEXT: store i32 [[TMP49]], ptr [[TMP48]], align 4
2095 // CHECK2-NEXT: [[TMP50:%.*]] = getelementptr inbounds [2 x ptr], ptr [[DOTOMP_REDUCTION_REMOTE_REDUCE_LIST]], i32 0, i32 1
2096 // CHECK2-NEXT: [[TMP51:%.*]] = load ptr, ptr [[TMP50]], align 4
2097 // CHECK2-NEXT: [[TMP52:%.*]] = getelementptr inbounds [2 x ptr], ptr [[TMP4]], i32 0, i32 1
2098 // CHECK2-NEXT: [[TMP53:%.*]] = load ptr, ptr [[TMP52]], align 4
2099 // CHECK2-NEXT: [[TMP54:%.*]] = load i16, ptr [[TMP51]], align 2
2100 // CHECK2-NEXT: store i16 [[TMP54]], ptr [[TMP53]], align 2
2101 // CHECK2-NEXT: br label [[IFCONT7:%.*]]
2102 // CHECK2: else6:
2103 // CHECK2-NEXT: br label [[IFCONT7]]
2104 // CHECK2: ifcont7:
2105 // CHECK2-NEXT: ret void
2108 // CHECK2-LABEL: define {{[^@]+}}@_omp_reduction_inter_warp_copy_func8
2109 // CHECK2-SAME: (ptr noundef [[TMP0:%.*]], i32 noundef [[TMP1:%.*]]) #[[ATTR3]] {
2110 // CHECK2-NEXT: entry:
2111 // CHECK2-NEXT: [[DOTADDR:%.*]] = alloca ptr, align 4
2112 // CHECK2-NEXT: [[DOTADDR1:%.*]] = alloca i32, align 4
2113 // CHECK2-NEXT: store ptr [[TMP0]], ptr [[DOTADDR]], align 4
2114 // CHECK2-NEXT: store i32 [[TMP1]], ptr [[DOTADDR1]], align 4
2115 // CHECK2-NEXT: [[TMP3:%.*]] = call i32 @__kmpc_get_hardware_thread_id_in_block()
2116 // CHECK2-NEXT: [[TMP4:%.*]] = call i32 @__kmpc_get_hardware_thread_id_in_block()
2117 // CHECK2-NEXT: [[NVPTX_LANE_ID:%.*]] = and i32 [[TMP4]], 31
2118 // CHECK2-NEXT: [[TMP5:%.*]] = call i32 @__kmpc_get_hardware_thread_id_in_block()
2119 // CHECK2-NEXT: [[NVPTX_WARP_ID:%.*]] = ashr i32 [[TMP5]], 5
2120 // CHECK2-NEXT: [[TMP6:%.*]] = load ptr, ptr [[DOTADDR]], align 4
2121 // CHECK2-NEXT: [[TMP2:%.*]] = call i32 @__kmpc_global_thread_num(ptr @[[GLOB1]])
2122 // CHECK2-NEXT: call void @__kmpc_barrier(ptr @[[GLOB2]], i32 [[TMP2]])
2123 // CHECK2-NEXT: [[WARP_MASTER:%.*]] = icmp eq i32 [[NVPTX_LANE_ID]], 0
2124 // CHECK2-NEXT: br i1 [[WARP_MASTER]], label [[THEN:%.*]], label [[ELSE:%.*]]
2125 // CHECK2: then:
2126 // CHECK2-NEXT: [[TMP7:%.*]] = getelementptr inbounds [2 x ptr], ptr [[TMP6]], i32 0, i32 0
2127 // CHECK2-NEXT: [[TMP8:%.*]] = load ptr, ptr [[TMP7]], align 4
2128 // CHECK2-NEXT: [[TMP9:%.*]] = getelementptr inbounds [32 x i32], ptr addrspace(3) @__openmp_nvptx_data_transfer_temporary_storage, i64 0, i32 [[NVPTX_WARP_ID]]
2129 // CHECK2-NEXT: [[TMP10:%.*]] = load i32, ptr [[TMP8]], align 4
2130 // CHECK2-NEXT: store volatile i32 [[TMP10]], ptr addrspace(3) [[TMP9]], align 4
2131 // CHECK2-NEXT: br label [[IFCONT:%.*]]
2132 // CHECK2: else:
2133 // CHECK2-NEXT: br label [[IFCONT]]
2134 // CHECK2: ifcont:
2135 // CHECK2-NEXT: [[TMP2:%.*]] = call i32 @__kmpc_global_thread_num(ptr @[[GLOB1]])
2136 // CHECK2-NEXT: call void @__kmpc_barrier(ptr @[[GLOB2]], i32 [[TMP2]])
2137 // CHECK2-NEXT: [[TMP11:%.*]] = load i32, ptr [[DOTADDR1]], align 4
2138 // CHECK2-NEXT: [[IS_ACTIVE_THREAD:%.*]] = icmp ult i32 [[TMP3]], [[TMP11]]
2139 // CHECK2-NEXT: br i1 [[IS_ACTIVE_THREAD]], label [[THEN2:%.*]], label [[ELSE3:%.*]]
2140 // CHECK2: then3:
2141 // CHECK2-NEXT: [[TMP12:%.*]] = getelementptr inbounds [32 x i32], ptr addrspace(3) @__openmp_nvptx_data_transfer_temporary_storage, i64 0, i32 [[TMP3]]
2142 // CHECK2-NEXT: [[TMP13:%.*]] = getelementptr inbounds [2 x ptr], ptr [[TMP6]], i32 0, i32 0
2143 // CHECK2-NEXT: [[TMP14:%.*]] = load ptr, ptr [[TMP13]], align 4
2144 // CHECK2-NEXT: [[TMP15:%.*]] = load volatile i32, ptr addrspace(3) [[TMP12]], align 4
2145 // CHECK2-NEXT: store i32 [[TMP15]], ptr [[TMP14]], align 4
2146 // CHECK2-NEXT: br label [[IFCONT4:%.*]]
2147 // CHECK2: else4:
2148 // CHECK2-NEXT: br label [[IFCONT4]]
2149 // CHECK2: ifcont5:
2150 // CHECK2-NEXT: [[TMP2:%.*]] = call i32 @__kmpc_global_thread_num(ptr @[[GLOB1]])
2151 // CHECK2-NEXT: call void @__kmpc_barrier(ptr @[[GLOB2]], i32 [[TMP2]])
2152 // CHECK2-NEXT: [[WARP_MASTER5:%.*]] = icmp eq i32 [[NVPTX_LANE_ID]], 0
2153 // CHECK2-NEXT: br i1 [[WARP_MASTER5]], label [[THEN6:%.*]], label [[ELSE7:%.*]]
2154 // CHECK2: then8:
2155 // CHECK2-NEXT: [[TMP16:%.*]] = getelementptr inbounds [2 x ptr], ptr [[TMP6]], i32 0, i32 1
2156 // CHECK2-NEXT: [[TMP17:%.*]] = load ptr, ptr [[TMP16]], align 4
2157 // CHECK2-NEXT: [[TMP18:%.*]] = getelementptr inbounds [32 x i32], ptr addrspace(3) @__openmp_nvptx_data_transfer_temporary_storage, i64 0, i32 [[NVPTX_WARP_ID]]
2158 // CHECK2-NEXT: [[TMP19:%.*]] = load i16, ptr [[TMP17]], align 2
2159 // CHECK2-NEXT: store volatile i16 [[TMP19]], ptr addrspace(3) [[TMP18]], align 2
2160 // CHECK2-NEXT: br label [[IFCONT8:%.*]]
2161 // CHECK2: else9:
2162 // CHECK2-NEXT: br label [[IFCONT8]]
2163 // CHECK2: ifcont10:
2164 // CHECK2-NEXT: [[TMP2:%.*]] = call i32 @__kmpc_global_thread_num(ptr @[[GLOB1]])
2165 // CHECK2-NEXT: call void @__kmpc_barrier(ptr @[[GLOB2]], i32 [[TMP2]])
2166 // CHECK2-NEXT: [[TMP20:%.*]] = load i32, ptr [[DOTADDR1]], align 4
2167 // CHECK2-NEXT: [[IS_ACTIVE_THREAD9:%.*]] = icmp ult i32 [[TMP3]], [[TMP20]]
2168 // CHECK2-NEXT: br i1 [[IS_ACTIVE_THREAD9]], label [[THEN10:%.*]], label [[ELSE11:%.*]]
2169 // CHECK2: then13:
2170 // CHECK2-NEXT: [[TMP21:%.*]] = getelementptr inbounds [32 x i32], ptr addrspace(3) @__openmp_nvptx_data_transfer_temporary_storage, i64 0, i32 [[TMP3]]
2171 // CHECK2-NEXT: [[TMP22:%.*]] = getelementptr inbounds [2 x ptr], ptr [[TMP6]], i32 0, i32 1
2172 // CHECK2-NEXT: [[TMP23:%.*]] = load ptr, ptr [[TMP22]], align 4
2173 // CHECK2-NEXT: [[TMP24:%.*]] = load volatile i16, ptr addrspace(3) [[TMP21]], align 2
2174 // CHECK2-NEXT: store i16 [[TMP24]], ptr [[TMP23]], align 2
2175 // CHECK2-NEXT: br label [[IFCONT12:%.*]]
2176 // CHECK2: else14:
2177 // CHECK2-NEXT: br label [[IFCONT12]]
2178 // CHECK2: ifcont15:
2179 // CHECK2-NEXT: ret void
2182 // CHECK2-LABEL: define {{[^@]+}}@_omp_reduction_shuffle_and_reduce_func9
2183 // CHECK2-SAME: (ptr noundef [[TMP0:%.*]], i16 noundef signext [[TMP1:%.*]], i16 noundef signext [[TMP2:%.*]], i16 noundef signext [[TMP3:%.*]]) #[[ATTR3]] {
2184 // CHECK2-NEXT: entry:
2185 // CHECK2-NEXT: [[DOTADDR:%.*]] = alloca ptr, align 4
2186 // CHECK2-NEXT: [[DOTADDR1:%.*]] = alloca i16, align 2
2187 // CHECK2-NEXT: [[DOTADDR2:%.*]] = alloca i16, align 2
2188 // CHECK2-NEXT: [[DOTADDR3:%.*]] = alloca i16, align 2
2189 // CHECK2-NEXT: [[DOTOMP_REDUCTION_REMOTE_REDUCE_LIST:%.*]] = alloca [2 x ptr], align 4
2190 // CHECK2-NEXT: [[DOTOMP_REDUCTION_ELEMENT:%.*]] = alloca i32, align 4
2191 // CHECK2-NEXT: [[DOTOMP_REDUCTION_ELEMENT4:%.*]] = alloca i16, align 2
2192 // CHECK2-NEXT: store ptr [[TMP0]], ptr [[DOTADDR]], align 4
2193 // CHECK2-NEXT: store i16 [[TMP1]], ptr [[DOTADDR1]], align 2
2194 // CHECK2-NEXT: store i16 [[TMP2]], ptr [[DOTADDR2]], align 2
2195 // CHECK2-NEXT: store i16 [[TMP3]], ptr [[DOTADDR3]], align 2
2196 // CHECK2-NEXT: [[TMP4:%.*]] = load ptr, ptr [[DOTADDR]], align 4
2197 // CHECK2-NEXT: [[TMP5:%.*]] = load i16, ptr [[DOTADDR1]], align 2
2198 // CHECK2-NEXT: [[TMP6:%.*]] = load i16, ptr [[DOTADDR2]], align 2
2199 // CHECK2-NEXT: [[TMP7:%.*]] = load i16, ptr [[DOTADDR3]], align 2
2200 // CHECK2-NEXT: [[TMP8:%.*]] = getelementptr inbounds [2 x ptr], ptr [[TMP4]], i32 0, i32 0
2201 // CHECK2-NEXT: [[TMP9:%.*]] = load ptr, ptr [[TMP8]], align 4
2202 // CHECK2-NEXT: [[TMP10:%.*]] = getelementptr inbounds [2 x ptr], ptr [[DOTOMP_REDUCTION_REMOTE_REDUCE_LIST]], i32 0, i32 0
2203 // CHECK2-NEXT: [[TMP11:%.*]] = getelementptr i32, ptr [[TMP9]], i32 1
2204 // CHECK2-NEXT: [[TMP12:%.*]] = load i32, ptr [[TMP9]], align 4
2205 // CHECK2-NEXT: [[TMP13:%.*]] = call i32 @__kmpc_get_warp_size()
2206 // CHECK2-NEXT: [[TMP14:%.*]] = trunc i32 [[TMP13]] to i16
2207 // CHECK2-NEXT: [[TMP15:%.*]] = call i32 @__kmpc_shuffle_int32(i32 [[TMP12]], i16 [[TMP6]], i16 [[TMP14]])
2208 // CHECK2-NEXT: store i32 [[TMP15]], ptr [[DOTOMP_REDUCTION_ELEMENT]], align 4
2209 // CHECK2-NEXT: [[TMP16:%.*]] = getelementptr i32, ptr [[TMP9]], i32 1
2210 // CHECK2-NEXT: [[TMP17:%.*]] = getelementptr i32, ptr [[DOTOMP_REDUCTION_ELEMENT]], i32 1
2211 // CHECK2-NEXT: store ptr [[DOTOMP_REDUCTION_ELEMENT]], ptr [[TMP10]], align 4
2212 // CHECK2-NEXT: [[TMP18:%.*]] = getelementptr inbounds [2 x ptr], ptr [[TMP4]], i32 0, i32 1
2213 // CHECK2-NEXT: [[TMP19:%.*]] = load ptr, ptr [[TMP18]], align 4
2214 // CHECK2-NEXT: [[TMP20:%.*]] = getelementptr inbounds [2 x ptr], ptr [[DOTOMP_REDUCTION_REMOTE_REDUCE_LIST]], i32 0, i32 1
2215 // CHECK2-NEXT: [[TMP21:%.*]] = getelementptr i16, ptr [[TMP19]], i32 1
2216 // CHECK2-NEXT: [[TMP22:%.*]] = load i16, ptr [[TMP19]], align 2
2217 // CHECK2-NEXT: [[TMP23:%.*]] = sext i16 [[TMP22]] to i32
2218 // CHECK2-NEXT: [[TMP24:%.*]] = call i32 @__kmpc_get_warp_size()
2219 // CHECK2-NEXT: [[TMP25:%.*]] = trunc i32 [[TMP24]] to i16
2220 // CHECK2-NEXT: [[TMP26:%.*]] = call i32 @__kmpc_shuffle_int32(i32 [[TMP23]], i16 [[TMP6]], i16 [[TMP25]])
2221 // CHECK2-NEXT: [[TMP27:%.*]] = trunc i32 [[TMP26]] to i16
2222 // CHECK2-NEXT: store i16 [[TMP27]], ptr [[DOTOMP_REDUCTION_ELEMENT4]], align 2
2223 // CHECK2-NEXT: [[TMP28:%.*]] = getelementptr i16, ptr [[TMP19]], i32 1
2224 // CHECK2-NEXT: [[TMP29:%.*]] = getelementptr i16, ptr [[DOTOMP_REDUCTION_ELEMENT4]], i32 1
2225 // CHECK2-NEXT: store ptr [[DOTOMP_REDUCTION_ELEMENT4]], ptr [[TMP20]], align 4
2226 // CHECK2-NEXT: [[TMP30:%.*]] = icmp eq i16 [[TMP7]], 0
2227 // CHECK2-NEXT: [[TMP31:%.*]] = icmp eq i16 [[TMP7]], 1
2228 // CHECK2-NEXT: [[TMP32:%.*]] = icmp ult i16 [[TMP5]], [[TMP6]]
2229 // CHECK2-NEXT: [[TMP33:%.*]] = and i1 [[TMP31]], [[TMP32]]
2230 // CHECK2-NEXT: [[TMP34:%.*]] = icmp eq i16 [[TMP7]], 2
2231 // CHECK2-NEXT: [[TMP35:%.*]] = and i16 [[TMP5]], 1
2232 // CHECK2-NEXT: [[TMP36:%.*]] = icmp eq i16 [[TMP35]], 0
2233 // CHECK2-NEXT: [[TMP37:%.*]] = and i1 [[TMP34]], [[TMP36]]
2234 // CHECK2-NEXT: [[TMP38:%.*]] = icmp sgt i16 [[TMP6]], 0
2235 // CHECK2-NEXT: [[TMP39:%.*]] = and i1 [[TMP37]], [[TMP38]]
2236 // CHECK2-NEXT: [[TMP40:%.*]] = or i1 [[TMP30]], [[TMP33]]
2237 // CHECK2-NEXT: [[TMP41:%.*]] = or i1 [[TMP40]], [[TMP39]]
2238 // CHECK2-NEXT: br i1 [[TMP41]], label [[THEN:%.*]], label [[ELSE:%.*]]
2239 // CHECK2: then:
2240 // CHECK2-NEXT: call void @"{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z9ftemplateIcET_i_l33_omp_outlined_omp$reduction$reduction_func"(ptr [[TMP4]], ptr [[DOTOMP_REDUCTION_REMOTE_REDUCE_LIST]]) #[[ATTR4]]
2241 // CHECK2-NEXT: br label [[IFCONT:%.*]]
2242 // CHECK2: else:
2243 // CHECK2-NEXT: br label [[IFCONT]]
2244 // CHECK2: ifcont:
2245 // CHECK2-NEXT: [[TMP42:%.*]] = icmp eq i16 [[TMP7]], 1
2246 // CHECK2-NEXT: [[TMP43:%.*]] = icmp uge i16 [[TMP5]], [[TMP6]]
2247 // CHECK2-NEXT: [[TMP44:%.*]] = and i1 [[TMP42]], [[TMP43]]
2248 // CHECK2-NEXT: br i1 [[TMP44]], label [[THEN5:%.*]], label [[ELSE6:%.*]]
2249 // CHECK2: then5:
2250 // CHECK2-NEXT: [[TMP45:%.*]] = getelementptr inbounds [2 x ptr], ptr [[DOTOMP_REDUCTION_REMOTE_REDUCE_LIST]], i32 0, i32 0
2251 // CHECK2-NEXT: [[TMP46:%.*]] = load ptr, ptr [[TMP45]], align 4
2252 // CHECK2-NEXT: [[TMP47:%.*]] = getelementptr inbounds [2 x ptr], ptr [[TMP4]], i32 0, i32 0
2253 // CHECK2-NEXT: [[TMP48:%.*]] = load ptr, ptr [[TMP47]], align 4
2254 // CHECK2-NEXT: [[TMP49:%.*]] = load i32, ptr [[TMP46]], align 4
2255 // CHECK2-NEXT: store i32 [[TMP49]], ptr [[TMP48]], align 4
2256 // CHECK2-NEXT: [[TMP50:%.*]] = getelementptr inbounds [2 x ptr], ptr [[DOTOMP_REDUCTION_REMOTE_REDUCE_LIST]], i32 0, i32 1
2257 // CHECK2-NEXT: [[TMP51:%.*]] = load ptr, ptr [[TMP50]], align 4
2258 // CHECK2-NEXT: [[TMP52:%.*]] = getelementptr inbounds [2 x ptr], ptr [[TMP4]], i32 0, i32 1
2259 // CHECK2-NEXT: [[TMP53:%.*]] = load ptr, ptr [[TMP52]], align 4
2260 // CHECK2-NEXT: [[TMP54:%.*]] = load i16, ptr [[TMP51]], align 2
2261 // CHECK2-NEXT: store i16 [[TMP54]], ptr [[TMP53]], align 2
2262 // CHECK2-NEXT: br label [[IFCONT7:%.*]]
2263 // CHECK2: else6:
2264 // CHECK2-NEXT: br label [[IFCONT7]]
2265 // CHECK2: ifcont7:
2266 // CHECK2-NEXT: ret void
2269 // CHECK2-LABEL: define {{[^@]+}}@_omp_reduction_inter_warp_copy_func10
2270 // CHECK2-SAME: (ptr noundef [[TMP0:%.*]], i32 noundef [[TMP1:%.*]]) #[[ATTR3]] {
2271 // CHECK2-NEXT: entry:
2272 // CHECK2-NEXT: [[DOTADDR:%.*]] = alloca ptr, align 4
2273 // CHECK2-NEXT: [[DOTADDR1:%.*]] = alloca i32, align 4
2274 // CHECK2-NEXT: store ptr [[TMP0]], ptr [[DOTADDR]], align 4
2275 // CHECK2-NEXT: store i32 [[TMP1]], ptr [[DOTADDR1]], align 4
2276 // CHECK2-NEXT: [[TMP3:%.*]] = call i32 @__kmpc_get_hardware_thread_id_in_block()
2277 // CHECK2-NEXT: [[TMP4:%.*]] = call i32 @__kmpc_get_hardware_thread_id_in_block()
2278 // CHECK2-NEXT: [[NVPTX_LANE_ID:%.*]] = and i32 [[TMP4]], 31
2279 // CHECK2-NEXT: [[TMP5:%.*]] = call i32 @__kmpc_get_hardware_thread_id_in_block()
2280 // CHECK2-NEXT: [[NVPTX_WARP_ID:%.*]] = ashr i32 [[TMP5]], 5
2281 // CHECK2-NEXT: [[TMP6:%.*]] = load ptr, ptr [[DOTADDR]], align 4
2282 // CHECK2-NEXT: [[TMP2:%.*]] = call i32 @__kmpc_global_thread_num(ptr @[[GLOB1]])
2283 // CHECK2-NEXT: call void @__kmpc_barrier(ptr @[[GLOB2]], i32 [[TMP2]])
2284 // CHECK2-NEXT: [[WARP_MASTER:%.*]] = icmp eq i32 [[NVPTX_LANE_ID]], 0
2285 // CHECK2-NEXT: br i1 [[WARP_MASTER]], label [[THEN:%.*]], label [[ELSE:%.*]]
2286 // CHECK2: then:
2287 // CHECK2-NEXT: [[TMP7:%.*]] = getelementptr inbounds [2 x ptr], ptr [[TMP6]], i32 0, i32 0
2288 // CHECK2-NEXT: [[TMP8:%.*]] = load ptr, ptr [[TMP7]], align 4
2289 // CHECK2-NEXT: [[TMP9:%.*]] = getelementptr inbounds [32 x i32], ptr addrspace(3) @__openmp_nvptx_data_transfer_temporary_storage, i64 0, i32 [[NVPTX_WARP_ID]]
2290 // CHECK2-NEXT: [[TMP10:%.*]] = load i32, ptr [[TMP8]], align 4
2291 // CHECK2-NEXT: store volatile i32 [[TMP10]], ptr addrspace(3) [[TMP9]], align 4
2292 // CHECK2-NEXT: br label [[IFCONT:%.*]]
2293 // CHECK2: else:
2294 // CHECK2-NEXT: br label [[IFCONT]]
2295 // CHECK2: ifcont:
2296 // CHECK2-NEXT: [[TMP2:%.*]] = call i32 @__kmpc_global_thread_num(ptr @[[GLOB1]])
2297 // CHECK2-NEXT: call void @__kmpc_barrier(ptr @[[GLOB2]], i32 [[TMP2]])
2298 // CHECK2-NEXT: [[TMP11:%.*]] = load i32, ptr [[DOTADDR1]], align 4
2299 // CHECK2-NEXT: [[IS_ACTIVE_THREAD:%.*]] = icmp ult i32 [[TMP3]], [[TMP11]]
2300 // CHECK2-NEXT: br i1 [[IS_ACTIVE_THREAD]], label [[THEN2:%.*]], label [[ELSE3:%.*]]
2301 // CHECK2: then3:
2302 // CHECK2-NEXT: [[TMP12:%.*]] = getelementptr inbounds [32 x i32], ptr addrspace(3) @__openmp_nvptx_data_transfer_temporary_storage, i64 0, i32 [[TMP3]]
2303 // CHECK2-NEXT: [[TMP13:%.*]] = getelementptr inbounds [2 x ptr], ptr [[TMP6]], i32 0, i32 0
2304 // CHECK2-NEXT: [[TMP14:%.*]] = load ptr, ptr [[TMP13]], align 4
2305 // CHECK2-NEXT: [[TMP15:%.*]] = load volatile i32, ptr addrspace(3) [[TMP12]], align 4
2306 // CHECK2-NEXT: store i32 [[TMP15]], ptr [[TMP14]], align 4
2307 // CHECK2-NEXT: br label [[IFCONT4:%.*]]
2308 // CHECK2: else4:
2309 // CHECK2-NEXT: br label [[IFCONT4]]
2310 // CHECK2: ifcont5:
2311 // CHECK2-NEXT: [[TMP2:%.*]] = call i32 @__kmpc_global_thread_num(ptr @[[GLOB1]])
2312 // CHECK2-NEXT: call void @__kmpc_barrier(ptr @[[GLOB2]], i32 [[TMP2]])
2313 // CHECK2-NEXT: [[WARP_MASTER5:%.*]] = icmp eq i32 [[NVPTX_LANE_ID]], 0
2314 // CHECK2-NEXT: br i1 [[WARP_MASTER5]], label [[THEN6:%.*]], label [[ELSE7:%.*]]
2315 // CHECK2: then8:
2316 // CHECK2-NEXT: [[TMP16:%.*]] = getelementptr inbounds [2 x ptr], ptr [[TMP6]], i32 0, i32 1
2317 // CHECK2-NEXT: [[TMP17:%.*]] = load ptr, ptr [[TMP16]], align 4
2318 // CHECK2-NEXT: [[TMP18:%.*]] = getelementptr inbounds [32 x i32], ptr addrspace(3) @__openmp_nvptx_data_transfer_temporary_storage, i64 0, i32 [[NVPTX_WARP_ID]]
2319 // CHECK2-NEXT: [[TMP19:%.*]] = load i16, ptr [[TMP17]], align 2
2320 // CHECK2-NEXT: store volatile i16 [[TMP19]], ptr addrspace(3) [[TMP18]], align 2
2321 // CHECK2-NEXT: br label [[IFCONT8:%.*]]
2322 // CHECK2: else9:
2323 // CHECK2-NEXT: br label [[IFCONT8]]
2324 // CHECK2: ifcont10:
2325 // CHECK2-NEXT: [[TMP2:%.*]] = call i32 @__kmpc_global_thread_num(ptr @[[GLOB1]])
2326 // CHECK2-NEXT: call void @__kmpc_barrier(ptr @[[GLOB2]], i32 [[TMP2]])
2327 // CHECK2-NEXT: [[TMP20:%.*]] = load i32, ptr [[DOTADDR1]], align 4
2328 // CHECK2-NEXT: [[IS_ACTIVE_THREAD9:%.*]] = icmp ult i32 [[TMP3]], [[TMP20]]
2329 // CHECK2-NEXT: br i1 [[IS_ACTIVE_THREAD9]], label [[THEN10:%.*]], label [[ELSE11:%.*]]
2330 // CHECK2: then13:
2331 // CHECK2-NEXT: [[TMP21:%.*]] = getelementptr inbounds [32 x i32], ptr addrspace(3) @__openmp_nvptx_data_transfer_temporary_storage, i64 0, i32 [[TMP3]]
2332 // CHECK2-NEXT: [[TMP22:%.*]] = getelementptr inbounds [2 x ptr], ptr [[TMP6]], i32 0, i32 1
2333 // CHECK2-NEXT: [[TMP23:%.*]] = load ptr, ptr [[TMP22]], align 4
2334 // CHECK2-NEXT: [[TMP24:%.*]] = load volatile i16, ptr addrspace(3) [[TMP21]], align 2
2335 // CHECK2-NEXT: store i16 [[TMP24]], ptr [[TMP23]], align 2
2336 // CHECK2-NEXT: br label [[IFCONT12:%.*]]
2337 // CHECK2: else14:
2338 // CHECK2-NEXT: br label [[IFCONT12]]
2339 // CHECK2: ifcont15:
2340 // CHECK2-NEXT: ret void
2343 // CHECK2-LABEL: define {{[^@]+}}@_omp_reduction_list_to_global_copy_func11
2344 // CHECK2-SAME: (ptr noundef [[TMP0:%.*]], i32 noundef [[TMP1:%.*]], ptr noundef [[TMP2:%.*]]) #[[ATTR3]] {
2345 // CHECK2-NEXT: entry:
2346 // CHECK2-NEXT: [[DOTADDR:%.*]] = alloca ptr, align 4
2347 // CHECK2-NEXT: [[DOTADDR1:%.*]] = alloca i32, align 4
2348 // CHECK2-NEXT: [[DOTADDR2:%.*]] = alloca ptr, align 4
2349 // CHECK2-NEXT: store ptr [[TMP0]], ptr [[DOTADDR]], align 4
2350 // CHECK2-NEXT: store i32 [[TMP1]], ptr [[DOTADDR1]], align 4
2351 // CHECK2-NEXT: store ptr [[TMP2]], ptr [[DOTADDR2]], align 4
2352 // CHECK2-NEXT: [[TMP3:%.*]] = load ptr, ptr [[DOTADDR2]], align 4
2353 // CHECK2-NEXT: [[TMP4:%.*]] = load ptr, ptr [[DOTADDR]], align 4
2354 // CHECK2-NEXT: [[TMP5:%.*]] = load i32, ptr [[DOTADDR1]], align 4
2355 // CHECK2-NEXT: [[TMP6:%.*]] = getelementptr inbounds [2 x ptr], ptr [[TMP3]], i32 0, i32 0
2356 // CHECK2-NEXT: [[TMP7:%.*]] = load ptr, ptr [[TMP6]], align 4
2357 // CHECK2-NEXT: [[TMP8:%.*]] = getelementptr inbounds [[STRUCT__GLOBALIZED_LOCALS_TY_2:%.*]], ptr [[TMP4]], i32 [[TMP5]]
2358 // CHECK2-NEXT: [[A:%.*]] = getelementptr inbounds [[STRUCT__GLOBALIZED_LOCALS_TY_2]], ptr [[TMP8]], i32 0, i32 0
2359 // CHECK2-NEXT: [[TMP9:%.*]] = load i32, ptr [[TMP7]], align 4
2360 // CHECK2-NEXT: store i32 [[TMP9]], ptr [[A]], align 4
2361 // CHECK2-NEXT: [[TMP10:%.*]] = getelementptr inbounds [2 x ptr], ptr [[TMP3]], i32 0, i32 1
2362 // CHECK2-NEXT: [[TMP11:%.*]] = load ptr, ptr [[TMP10]], align 4
2363 // CHECK2-NEXT: [[TMP12:%.*]] = getelementptr inbounds [[STRUCT__GLOBALIZED_LOCALS_TY_2]], ptr [[TMP4]], i32 [[TMP5]]
2364 // CHECK2-NEXT: [[B:%.*]] = getelementptr inbounds [[STRUCT__GLOBALIZED_LOCALS_TY_2]], ptr [[TMP12]], i32 0, i32 1
2365 // CHECK2-NEXT: [[TMP13:%.*]] = load i16, ptr [[TMP11]], align 2
2366 // CHECK2-NEXT: store i16 [[TMP13]], ptr [[B]], align 2
2367 // CHECK2-NEXT: ret void
2370 // CHECK2-LABEL: define {{[^@]+}}@_omp_reduction_list_to_global_reduce_func12
2371 // CHECK2-SAME: (ptr noundef [[TMP0:%.*]], i32 noundef [[TMP1:%.*]], ptr noundef [[TMP2:%.*]]) #[[ATTR3]] {
2372 // CHECK2-NEXT: entry:
2373 // CHECK2-NEXT: [[DOTADDR:%.*]] = alloca ptr, align 4
2374 // CHECK2-NEXT: [[DOTADDR1:%.*]] = alloca i32, align 4
2375 // CHECK2-NEXT: [[DOTADDR2:%.*]] = alloca ptr, align 4
2376 // CHECK2-NEXT: [[DOTOMP_REDUCTION_RED_LIST:%.*]] = alloca [2 x ptr], align 4
2377 // CHECK2-NEXT: store ptr [[TMP0]], ptr [[DOTADDR]], align 4
2378 // CHECK2-NEXT: store i32 [[TMP1]], ptr [[DOTADDR1]], align 4
2379 // CHECK2-NEXT: store ptr [[TMP2]], ptr [[DOTADDR2]], align 4
2380 // CHECK2-NEXT: [[TMP3:%.*]] = load ptr, ptr [[DOTADDR]], align 4
2381 // CHECK2-NEXT: [[TMP4:%.*]] = load i32, ptr [[DOTADDR1]], align 4
2382 // CHECK2-NEXT: [[TMP5:%.*]] = getelementptr inbounds [2 x ptr], ptr [[DOTOMP_REDUCTION_RED_LIST]], i32 0, i32 0
2383 // CHECK2-NEXT: [[TMP6:%.*]] = getelementptr inbounds [[STRUCT__GLOBALIZED_LOCALS_TY_2:%.*]], ptr [[TMP3]], i32 [[TMP4]]
2384 // CHECK2-NEXT: [[A:%.*]] = getelementptr inbounds [[STRUCT__GLOBALIZED_LOCALS_TY_2]], ptr [[TMP6]], i32 0, i32 0
2385 // CHECK2-NEXT: store ptr [[A]], ptr [[TMP5]], align 4
2386 // CHECK2-NEXT: [[TMP7:%.*]] = getelementptr inbounds [2 x ptr], ptr [[DOTOMP_REDUCTION_RED_LIST]], i32 0, i32 1
2387 // CHECK2-NEXT: [[TMP8:%.*]] = getelementptr inbounds [[STRUCT__GLOBALIZED_LOCALS_TY_2]], ptr [[TMP3]], i32 [[TMP4]]
2388 // CHECK2-NEXT: [[B:%.*]] = getelementptr inbounds [[STRUCT__GLOBALIZED_LOCALS_TY_2]], ptr [[TMP8]], i32 0, i32 1
2389 // CHECK2-NEXT: store ptr [[B]], ptr [[TMP7]], align 4
2390 // CHECK2-NEXT: [[TMP9:%.*]] = load ptr, ptr [[DOTADDR2]], align 4
2391 // CHECK2-NEXT: call void @"{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z9ftemplateIcET_i_l33_omp_outlined_omp$reduction$reduction_func"(ptr [[DOTOMP_REDUCTION_RED_LIST]], ptr [[TMP9]]) #[[ATTR4]]
2392 // CHECK2-NEXT: ret void
2395 // CHECK2-LABEL: define {{[^@]+}}@_omp_reduction_global_to_list_copy_func13
2396 // CHECK2-SAME: (ptr noundef [[TMP0:%.*]], i32 noundef [[TMP1:%.*]], ptr noundef [[TMP2:%.*]]) #[[ATTR3]] {
2397 // CHECK2-NEXT: entry:
2398 // CHECK2-NEXT: [[DOTADDR:%.*]] = alloca ptr, align 4
2399 // CHECK2-NEXT: [[DOTADDR1:%.*]] = alloca i32, align 4
2400 // CHECK2-NEXT: [[DOTADDR2:%.*]] = alloca ptr, align 4
2401 // CHECK2-NEXT: store ptr [[TMP0]], ptr [[DOTADDR]], align 4
2402 // CHECK2-NEXT: store i32 [[TMP1]], ptr [[DOTADDR1]], align 4
2403 // CHECK2-NEXT: store ptr [[TMP2]], ptr [[DOTADDR2]], align 4
2404 // CHECK2-NEXT: [[TMP3:%.*]] = load ptr, ptr [[DOTADDR2]], align 4
2405 // CHECK2-NEXT: [[TMP4:%.*]] = load ptr, ptr [[DOTADDR]], align 4
2406 // CHECK2-NEXT: [[TMP5:%.*]] = load i32, ptr [[DOTADDR1]], align 4
2407 // CHECK2-NEXT: [[TMP6:%.*]] = getelementptr inbounds [2 x ptr], ptr [[TMP3]], i32 0, i32 0
2408 // CHECK2-NEXT: [[TMP7:%.*]] = load ptr, ptr [[TMP6]], align 4
2409 // CHECK2-NEXT: [[TMP8:%.*]] = getelementptr inbounds [[STRUCT__GLOBALIZED_LOCALS_TY_2:%.*]], ptr [[TMP4]], i32 [[TMP5]]
2410 // CHECK2-NEXT: [[A:%.*]] = getelementptr inbounds [[STRUCT__GLOBALIZED_LOCALS_TY_2]], ptr [[TMP8]], i32 0, i32 0
2411 // CHECK2-NEXT: [[TMP9:%.*]] = load i32, ptr [[A]], align 4
2412 // CHECK2-NEXT: store i32 [[TMP9]], ptr [[TMP7]], align 4
2413 // CHECK2-NEXT: [[TMP10:%.*]] = getelementptr inbounds [2 x ptr], ptr [[TMP3]], i32 0, i32 1
2414 // CHECK2-NEXT: [[TMP11:%.*]] = load ptr, ptr [[TMP10]], align 4
2415 // CHECK2-NEXT: [[TMP12:%.*]] = getelementptr inbounds [[STRUCT__GLOBALIZED_LOCALS_TY_2]], ptr [[TMP4]], i32 [[TMP5]]
2416 // CHECK2-NEXT: [[B:%.*]] = getelementptr inbounds [[STRUCT__GLOBALIZED_LOCALS_TY_2]], ptr [[TMP12]], i32 0, i32 1
2417 // CHECK2-NEXT: [[TMP13:%.*]] = load i16, ptr [[B]], align 2
2418 // CHECK2-NEXT: store i16 [[TMP13]], ptr [[TMP11]], align 2
2419 // CHECK2-NEXT: ret void
2422 // CHECK2-LABEL: define {{[^@]+}}@_omp_reduction_global_to_list_reduce_func14
2423 // CHECK2-SAME: (ptr noundef [[TMP0:%.*]], i32 noundef [[TMP1:%.*]], ptr noundef [[TMP2:%.*]]) #[[ATTR3]] {
2424 // CHECK2-NEXT: entry:
2425 // CHECK2-NEXT: [[DOTADDR:%.*]] = alloca ptr, align 4
2426 // CHECK2-NEXT: [[DOTADDR1:%.*]] = alloca i32, align 4
2427 // CHECK2-NEXT: [[DOTADDR2:%.*]] = alloca ptr, align 4
2428 // CHECK2-NEXT: [[DOTOMP_REDUCTION_RED_LIST:%.*]] = alloca [2 x ptr], align 4
2429 // CHECK2-NEXT: store ptr [[TMP0]], ptr [[DOTADDR]], align 4
2430 // CHECK2-NEXT: store i32 [[TMP1]], ptr [[DOTADDR1]], align 4
2431 // CHECK2-NEXT: store ptr [[TMP2]], ptr [[DOTADDR2]], align 4
2432 // CHECK2-NEXT: [[TMP3:%.*]] = load ptr, ptr [[DOTADDR]], align 4
2433 // CHECK2-NEXT: [[TMP4:%.*]] = load i32, ptr [[DOTADDR1]], align 4
2434 // CHECK2-NEXT: [[TMP5:%.*]] = getelementptr inbounds [2 x ptr], ptr [[DOTOMP_REDUCTION_RED_LIST]], i32 0, i32 0
2435 // CHECK2-NEXT: [[TMP6:%.*]] = getelementptr inbounds [[STRUCT__GLOBALIZED_LOCALS_TY_2:%.*]], ptr [[TMP3]], i32 [[TMP4]]
2436 // CHECK2-NEXT: [[A:%.*]] = getelementptr inbounds [[STRUCT__GLOBALIZED_LOCALS_TY_2]], ptr [[TMP6]], i32 0, i32 0
2437 // CHECK2-NEXT: store ptr [[A]], ptr [[TMP5]], align 4
2438 // CHECK2-NEXT: [[TMP7:%.*]] = getelementptr inbounds [2 x ptr], ptr [[DOTOMP_REDUCTION_RED_LIST]], i32 0, i32 1
2439 // CHECK2-NEXT: [[TMP8:%.*]] = getelementptr inbounds [[STRUCT__GLOBALIZED_LOCALS_TY_2]], ptr [[TMP3]], i32 [[TMP4]]
2440 // CHECK2-NEXT: [[B:%.*]] = getelementptr inbounds [[STRUCT__GLOBALIZED_LOCALS_TY_2]], ptr [[TMP8]], i32 0, i32 1
2441 // CHECK2-NEXT: store ptr [[B]], ptr [[TMP7]], align 4
2442 // CHECK2-NEXT: [[TMP9:%.*]] = load ptr, ptr [[DOTADDR2]], align 4
2443 // CHECK2-NEXT: call void @"{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z9ftemplateIcET_i_l33_omp_outlined_omp$reduction$reduction_func"(ptr [[TMP9]], ptr [[DOTOMP_REDUCTION_RED_LIST]]) #[[ATTR4]]
2444 // CHECK2-NEXT: ret void
2447 // CHECK3-LABEL: define {{[^@]+}}@{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z9ftemplateIcET_i_l20
2448 // CHECK3-SAME: (ptr noalias noundef [[DYN_PTR:%.*]], ptr noundef nonnull align 8 dereferenceable(8) [[E:%.*]]) #[[ATTR0:[0-9]+]] {
2449 // CHECK3-NEXT: entry:
2450 // CHECK3-NEXT: [[DYN_PTR_ADDR:%.*]] = alloca ptr, align 4
2451 // CHECK3-NEXT: [[E_ADDR:%.*]] = alloca ptr, align 4
2452 // CHECK3-NEXT: [[E1:%.*]] = alloca double, align 8
2453 // CHECK3-NEXT: [[DOTZERO_ADDR:%.*]] = alloca i32, align 4
2454 // CHECK3-NEXT: [[DOTTHREADID_TEMP_:%.*]] = alloca i32, align 4
2455 // CHECK3-NEXT: store ptr [[DYN_PTR]], ptr [[DYN_PTR_ADDR]], align 4
2456 // CHECK3-NEXT: store ptr [[E]], ptr [[E_ADDR]], align 4
2457 // CHECK3-NEXT: [[TMP0:%.*]] = load ptr, ptr [[E_ADDR]], align 4
2458 // CHECK3-NEXT: [[TMP1:%.*]] = call i32 @__kmpc_target_init(ptr @{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z9ftemplateIcET_i_l20_kernel_environment, ptr [[DYN_PTR]])
2459 // CHECK3-NEXT: [[EXEC_USER_CODE:%.*]] = icmp eq i32 [[TMP1]], -1
2460 // CHECK3-NEXT: br i1 [[EXEC_USER_CODE]], label [[USER_CODE_ENTRY:%.*]], label [[WORKER_EXIT:%.*]]
2461 // CHECK3: user_code.entry:
2462 // CHECK3-NEXT: [[TMP2:%.*]] = call i32 @__kmpc_global_thread_num(ptr @[[GLOB1:[0-9]+]])
2463 // CHECK3-NEXT: [[TMP3:%.*]] = load double, ptr [[TMP0]], align 8
2464 // CHECK3-NEXT: store double [[TMP3]], ptr [[E1]], align 8
2465 // CHECK3-NEXT: store i32 0, ptr [[DOTZERO_ADDR]], align 4
2466 // CHECK3-NEXT: store i32 [[TMP2]], ptr [[DOTTHREADID_TEMP_]], align 4
2467 // CHECK3-NEXT: call void @{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z9ftemplateIcET_i_l20_omp_outlined(ptr [[DOTTHREADID_TEMP_]], ptr [[DOTZERO_ADDR]], ptr [[E1]]) #[[ATTR4:[0-9]+]]
2468 // CHECK3-NEXT: call void @__kmpc_target_deinit()
2469 // CHECK3-NEXT: ret void
2470 // CHECK3: worker.exit:
2471 // CHECK3-NEXT: ret void
2474 // CHECK3-LABEL: define {{[^@]+}}@{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z9ftemplateIcET_i_l20_omp_outlined
2475 // CHECK3-SAME: (ptr noalias noundef [[DOTGLOBAL_TID_:%.*]], ptr noalias noundef [[DOTBOUND_TID_:%.*]], ptr noundef nonnull align 8 dereferenceable(8) [[E:%.*]]) #[[ATTR1:[0-9]+]] {
2476 // CHECK3-NEXT: entry:
2477 // CHECK3-NEXT: [[DOTGLOBAL_TID__ADDR:%.*]] = alloca ptr, align 4
2478 // CHECK3-NEXT: [[DOTBOUND_TID__ADDR:%.*]] = alloca ptr, align 4
2479 // CHECK3-NEXT: [[E_ADDR:%.*]] = alloca ptr, align 4
2480 // CHECK3-NEXT: [[DOTOMP_REDUCTION_RED_LIST:%.*]] = alloca [1 x ptr], align 4
2481 // CHECK3-NEXT: store ptr [[DOTGLOBAL_TID_]], ptr [[DOTGLOBAL_TID__ADDR]], align 4
2482 // CHECK3-NEXT: store ptr [[DOTBOUND_TID_]], ptr [[DOTBOUND_TID__ADDR]], align 4
2483 // CHECK3-NEXT: store ptr [[E]], ptr [[E_ADDR]], align 4
2484 // CHECK3-NEXT: [[TMP0:%.*]] = load ptr, ptr [[E_ADDR]], align 4
2485 // CHECK3-NEXT: [[E1:%.*]] = call align 8 ptr @__kmpc_alloc_shared(i32 8)
2486 // CHECK3-NEXT: store double 0.000000e+00, ptr [[E1]], align 8
2487 // CHECK3-NEXT: [[TMP1:%.*]] = load double, ptr [[E1]], align 8
2488 // CHECK3-NEXT: [[ADD:%.*]] = fadd double [[TMP1]], 5.000000e+00
2489 // CHECK3-NEXT: store double [[ADD]], ptr [[E1]], align 8
2490 // CHECK3-NEXT: [[TMP2:%.*]] = getelementptr inbounds [1 x ptr], ptr [[DOTOMP_REDUCTION_RED_LIST]], i32 0, i32 0
2491 // CHECK3-NEXT: store ptr [[E1]], ptr [[TMP2]], align 4
2492 // CHECK3-NEXT: %"_openmp_teams_reductions_buffer_$_$ptr" = call ptr @__kmpc_reduction_get_fixed_buffer()
2493 // CHECK3-NEXT: [[TMP3:%.*]] = call i32 @__kmpc_nvptx_teams_reduce_nowait_v2(ptr @[[GLOB1]], ptr %"_openmp_teams_reductions_buffer_$_$ptr", i32 2048, i64 8, ptr [[DOTOMP_REDUCTION_RED_LIST]], ptr @_omp_reduction_shuffle_and_reduce_func, ptr @_omp_reduction_inter_warp_copy_func, ptr @_omp_reduction_list_to_global_copy_func, ptr @_omp_reduction_list_to_global_reduce_func, ptr @_omp_reduction_global_to_list_copy_func, ptr @_omp_reduction_global_to_list_reduce_func)
2494 // CHECK3-NEXT: [[TMP4:%.*]] = icmp eq i32 [[TMP3]], 1
2495 // CHECK3-NEXT: br i1 [[TMP4]], label [[DOTOMP_REDUCTION_THEN:%.*]], label [[DOTOMP_REDUCTION_DONE:%.*]]
2496 // CHECK3: .omp.reduction.then:
2497 // CHECK3-NEXT: [[TMP5:%.*]] = load double, ptr [[TMP0]], align 8
2498 // CHECK3-NEXT: [[TMP6:%.*]] = load double, ptr [[E1]], align 8
2499 // CHECK3-NEXT: [[ADD2:%.*]] = fadd double [[TMP5]], [[TMP6]]
2500 // CHECK3-NEXT: store double [[ADD2]], ptr [[TMP0]], align 8
2501 // CHECK3-NEXT: br label [[DOTOMP_REDUCTION_DONE]]
2502 // CHECK3: .omp.reduction.done:
2503 // CHECK3-NEXT: call void @__kmpc_free_shared(ptr [[E1]], i32 8)
2504 // CHECK3-NEXT: ret void
2507 // CHECK3-LABEL: define {{[^@]+}}@_omp_reduction_shuffle_and_reduce_func
2508 // CHECK3-SAME: (ptr noundef [[TMP0:%.*]], i16 noundef signext [[TMP1:%.*]], i16 noundef signext [[TMP2:%.*]], i16 noundef signext [[TMP3:%.*]]) #[[ATTR3:[0-9]+]] {
2509 // CHECK3-NEXT: entry:
2510 // CHECK3-NEXT: [[DOTADDR:%.*]] = alloca ptr, align 4
2511 // CHECK3-NEXT: [[DOTADDR1:%.*]] = alloca i16, align 2
2512 // CHECK3-NEXT: [[DOTADDR2:%.*]] = alloca i16, align 2
2513 // CHECK3-NEXT: [[DOTADDR3:%.*]] = alloca i16, align 2
2514 // CHECK3-NEXT: [[DOTOMP_REDUCTION_REMOTE_REDUCE_LIST:%.*]] = alloca [1 x ptr], align 4
2515 // CHECK3-NEXT: [[DOTOMP_REDUCTION_ELEMENT:%.*]] = alloca double, align 8
2516 // CHECK3-NEXT: store ptr [[TMP0]], ptr [[DOTADDR]], align 4
2517 // CHECK3-NEXT: store i16 [[TMP1]], ptr [[DOTADDR1]], align 2
2518 // CHECK3-NEXT: store i16 [[TMP2]], ptr [[DOTADDR2]], align 2
2519 // CHECK3-NEXT: store i16 [[TMP3]], ptr [[DOTADDR3]], align 2
2520 // CHECK3-NEXT: [[TMP4:%.*]] = load ptr, ptr [[DOTADDR]], align 4
2521 // CHECK3-NEXT: [[TMP5:%.*]] = load i16, ptr [[DOTADDR1]], align 2
2522 // CHECK3-NEXT: [[TMP6:%.*]] = load i16, ptr [[DOTADDR2]], align 2
2523 // CHECK3-NEXT: [[TMP7:%.*]] = load i16, ptr [[DOTADDR3]], align 2
2524 // CHECK3-NEXT: [[TMP8:%.*]] = getelementptr inbounds [1 x ptr], ptr [[TMP4]], i32 0, i32 0
2525 // CHECK3-NEXT: [[TMP9:%.*]] = load ptr, ptr [[TMP8]], align 4
2526 // CHECK3-NEXT: [[TMP10:%.*]] = getelementptr inbounds [1 x ptr], ptr [[DOTOMP_REDUCTION_REMOTE_REDUCE_LIST]], i32 0, i32 0
2527 // CHECK3-NEXT: [[TMP11:%.*]] = getelementptr double, ptr [[TMP9]], i32 1
2528 // CHECK3-NEXT: [[TMP12:%.*]] = load i64, ptr [[TMP9]], align 8
2529 // CHECK3-NEXT: [[TMP13:%.*]] = call i32 @__kmpc_get_warp_size()
2530 // CHECK3-NEXT: [[TMP14:%.*]] = trunc i32 [[TMP13]] to i16
2531 // CHECK3-NEXT: [[TMP15:%.*]] = call i64 @__kmpc_shuffle_int64(i64 [[TMP12]], i16 [[TMP6]], i16 [[TMP14]])
2532 // CHECK3-NEXT: store i64 [[TMP15]], ptr [[DOTOMP_REDUCTION_ELEMENT]], align 8
2533 // CHECK3-NEXT: [[TMP16:%.*]] = getelementptr i64, ptr [[TMP9]], i32 1
2534 // CHECK3-NEXT: [[TMP17:%.*]] = getelementptr i64, ptr [[DOTOMP_REDUCTION_ELEMENT]], i32 1
2535 // CHECK3-NEXT: store ptr [[DOTOMP_REDUCTION_ELEMENT]], ptr [[TMP10]], align 4
2536 // CHECK3-NEXT: [[TMP18:%.*]] = icmp eq i16 [[TMP7]], 0
2537 // CHECK3-NEXT: [[TMP19:%.*]] = icmp eq i16 [[TMP7]], 1
2538 // CHECK3-NEXT: [[TMP20:%.*]] = icmp ult i16 [[TMP5]], [[TMP6]]
2539 // CHECK3-NEXT: [[TMP21:%.*]] = and i1 [[TMP19]], [[TMP20]]
2540 // CHECK3-NEXT: [[TMP22:%.*]] = icmp eq i16 [[TMP7]], 2
2541 // CHECK3-NEXT: [[TMP23:%.*]] = and i16 [[TMP5]], 1
2542 // CHECK3-NEXT: [[TMP24:%.*]] = icmp eq i16 [[TMP23]], 0
2543 // CHECK3-NEXT: [[TMP25:%.*]] = and i1 [[TMP22]], [[TMP24]]
2544 // CHECK3-NEXT: [[TMP26:%.*]] = icmp sgt i16 [[TMP6]], 0
2545 // CHECK3-NEXT: [[TMP27:%.*]] = and i1 [[TMP25]], [[TMP26]]
2546 // CHECK3-NEXT: [[TMP28:%.*]] = or i1 [[TMP18]], [[TMP21]]
2547 // CHECK3-NEXT: [[TMP29:%.*]] = or i1 [[TMP28]], [[TMP27]]
2548 // CHECK3-NEXT: br i1 [[TMP29]], label [[THEN:%.*]], label [[ELSE:%.*]]
2549 // CHECK3: then:
2550 // CHECK3-NEXT: call void @"{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z9ftemplateIcET_i_l20_omp_outlined_omp$reduction$reduction_func"(ptr [[TMP4]], ptr [[DOTOMP_REDUCTION_REMOTE_REDUCE_LIST]]) #[[ATTR4]]
2551 // CHECK3-NEXT: br label [[IFCONT:%.*]]
2552 // CHECK3: else:
2553 // CHECK3-NEXT: br label [[IFCONT]]
2554 // CHECK3: ifcont:
2555 // CHECK3-NEXT: [[TMP30:%.*]] = icmp eq i16 [[TMP7]], 1
2556 // CHECK3-NEXT: [[TMP31:%.*]] = icmp uge i16 [[TMP5]], [[TMP6]]
2557 // CHECK3-NEXT: [[TMP32:%.*]] = and i1 [[TMP30]], [[TMP31]]
2558 // CHECK3-NEXT: br i1 [[TMP32]], label [[THEN4:%.*]], label [[ELSE5:%.*]]
2559 // CHECK3: then4:
2560 // CHECK3-NEXT: [[TMP33:%.*]] = getelementptr inbounds [1 x ptr], ptr [[DOTOMP_REDUCTION_REMOTE_REDUCE_LIST]], i32 0, i32 0
2561 // CHECK3-NEXT: [[TMP34:%.*]] = load ptr, ptr [[TMP33]], align 4
2562 // CHECK3-NEXT: [[TMP35:%.*]] = getelementptr inbounds [1 x ptr], ptr [[TMP4]], i32 0, i32 0
2563 // CHECK3-NEXT: [[TMP36:%.*]] = load ptr, ptr [[TMP35]], align 4
2564 // CHECK3-NEXT: [[TMP37:%.*]] = load double, ptr [[TMP34]], align 8
2565 // CHECK3-NEXT: store double [[TMP37]], ptr [[TMP36]], align 8
2566 // CHECK3-NEXT: br label [[IFCONT6:%.*]]
2567 // CHECK3: else5:
2568 // CHECK3-NEXT: br label [[IFCONT6]]
2569 // CHECK3: ifcont6:
2570 // CHECK3-NEXT: ret void
2573 // CHECK3-LABEL: define {{[^@]+}}@_omp_reduction_inter_warp_copy_func
2574 // CHECK3-SAME: (ptr noundef [[TMP0:%.*]], i32 noundef [[TMP1:%.*]]) #[[ATTR3]] {
2575 // CHECK3-NEXT: entry:
2576 // CHECK3-NEXT: [[DOTADDR:%.*]] = alloca ptr, align 4
2577 // CHECK3-NEXT: [[DOTADDR1:%.*]] = alloca i32, align 4
2578 // CHECK3-NEXT: [[DOTCNT_ADDR:%.*]] = alloca i32, align 4
2579 // CHECK3-NEXT: store ptr [[TMP0]], ptr [[DOTADDR]], align 4
2580 // CHECK3-NEXT: store i32 [[TMP1]], ptr [[DOTADDR1]], align 4
2581 // CHECK3-NEXT: [[TMP3:%.*]] = call i32 @__kmpc_get_hardware_thread_id_in_block()
2582 // CHECK3-NEXT: [[TMP4:%.*]] = call i32 @__kmpc_get_hardware_thread_id_in_block()
2583 // CHECK3-NEXT: [[NVPTX_LANE_ID:%.*]] = and i32 [[TMP4]], 31
2584 // CHECK3-NEXT: [[TMP5:%.*]] = call i32 @__kmpc_get_hardware_thread_id_in_block()
2585 // CHECK3-NEXT: [[NVPTX_WARP_ID:%.*]] = ashr i32 [[TMP5]], 5
2586 // CHECK3-NEXT: [[TMP6:%.*]] = load ptr, ptr [[DOTADDR]], align 4
2587 // CHECK3-NEXT: store i32 0, ptr [[DOTCNT_ADDR]], align 4
2588 // CHECK3-NEXT: br label [[PRECOND:%.*]]
2589 // CHECK3: precond:
2590 // CHECK3-NEXT: [[TMP7:%.*]] = load i32, ptr [[DOTCNT_ADDR]], align 4
2591 // CHECK3-NEXT: [[TMP8:%.*]] = icmp ult i32 [[TMP7]], 2
2592 // CHECK3-NEXT: br i1 [[TMP8]], label [[BODY:%.*]], label [[EXIT:%.*]]
2593 // CHECK3: body:
2594 // CHECK3-NEXT: [[TMP2:%.*]] = call i32 @__kmpc_global_thread_num(ptr @[[GLOB1]])
2595 // CHECK3-NEXT: call void @__kmpc_barrier(ptr @[[GLOB2:[0-9]+]], i32 [[TMP2]])
2596 // CHECK3-NEXT: [[WARP_MASTER:%.*]] = icmp eq i32 [[NVPTX_LANE_ID]], 0
2597 // CHECK3-NEXT: br i1 [[WARP_MASTER]], label [[THEN:%.*]], label [[ELSE:%.*]]
2598 // CHECK3: then:
2599 // CHECK3-NEXT: [[TMP9:%.*]] = getelementptr inbounds [1 x ptr], ptr [[TMP6]], i32 0, i32 0
2600 // CHECK3-NEXT: [[TMP10:%.*]] = load ptr, ptr [[TMP9]], align 4
2601 // CHECK3-NEXT: [[TMP11:%.*]] = getelementptr i32, ptr [[TMP10]], i32 [[TMP7]]
2602 // CHECK3-NEXT: [[TMP12:%.*]] = getelementptr inbounds [32 x i32], ptr addrspace(3) @__openmp_nvptx_data_transfer_temporary_storage, i64 0, i32 [[NVPTX_WARP_ID]]
2603 // CHECK3-NEXT: [[TMP13:%.*]] = load i32, ptr [[TMP11]], align 4
2604 // CHECK3-NEXT: store volatile i32 [[TMP13]], ptr addrspace(3) [[TMP12]], align 4
2605 // CHECK3-NEXT: br label [[IFCONT:%.*]]
2606 // CHECK3: else:
2607 // CHECK3-NEXT: br label [[IFCONT]]
2608 // CHECK3: ifcont:
2609 // CHECK3-NEXT: [[TMP2:%.*]] = call i32 @__kmpc_global_thread_num(ptr @[[GLOB1]])
2610 // CHECK3-NEXT: call void @__kmpc_barrier(ptr @[[GLOB2]], i32 [[TMP2]])
2611 // CHECK3-NEXT: [[TMP14:%.*]] = load i32, ptr [[DOTADDR1]], align 4
2612 // CHECK3-NEXT: [[IS_ACTIVE_THREAD:%.*]] = icmp ult i32 [[TMP3]], [[TMP14]]
2613 // CHECK3-NEXT: br i1 [[IS_ACTIVE_THREAD]], label [[THEN2:%.*]], label [[ELSE3:%.*]]
2614 // CHECK3: then3:
2615 // CHECK3-NEXT: [[TMP15:%.*]] = getelementptr inbounds [32 x i32], ptr addrspace(3) @__openmp_nvptx_data_transfer_temporary_storage, i64 0, i32 [[TMP3]]
2616 // CHECK3-NEXT: [[TMP16:%.*]] = getelementptr inbounds [1 x ptr], ptr [[TMP6]], i32 0, i32 0
2617 // CHECK3-NEXT: [[TMP17:%.*]] = load ptr, ptr [[TMP16]], align 4
2618 // CHECK3-NEXT: [[TMP18:%.*]] = getelementptr i32, ptr [[TMP17]], i32 [[TMP7]]
2619 // CHECK3-NEXT: [[TMP19:%.*]] = load volatile i32, ptr addrspace(3) [[TMP15]], align 4
2620 // CHECK3-NEXT: store i32 [[TMP19]], ptr [[TMP18]], align 4
2621 // CHECK3-NEXT: br label [[IFCONT4:%.*]]
2622 // CHECK3: else4:
2623 // CHECK3-NEXT: br label [[IFCONT4]]
2624 // CHECK3: ifcont5:
2625 // CHECK3-NEXT: [[TMP20:%.*]] = add nsw i32 [[TMP7]], 1
2626 // CHECK3-NEXT: store i32 [[TMP20]], ptr [[DOTCNT_ADDR]], align 4
2627 // CHECK3-NEXT: br label [[PRECOND]]
2628 // CHECK3: exit:
2629 // CHECK3-NEXT: ret void
2632 // CHECK3-LABEL: define {{[^@]+}}@_omp_reduction_list_to_global_copy_func
2633 // CHECK3-SAME: (ptr noundef [[TMP0:%.*]], i32 noundef [[TMP1:%.*]], ptr noundef [[TMP2:%.*]]) #[[ATTR3]] {
2634 // CHECK3-NEXT: entry:
2635 // CHECK3-NEXT: [[DOTADDR:%.*]] = alloca ptr, align 4
2636 // CHECK3-NEXT: [[DOTADDR1:%.*]] = alloca i32, align 4
2637 // CHECK3-NEXT: [[DOTADDR2:%.*]] = alloca ptr, align 4
2638 // CHECK3-NEXT: store ptr [[TMP0]], ptr [[DOTADDR]], align 4
2639 // CHECK3-NEXT: store i32 [[TMP1]], ptr [[DOTADDR1]], align 4
2640 // CHECK3-NEXT: store ptr [[TMP2]], ptr [[DOTADDR2]], align 4
2641 // CHECK3-NEXT: [[TMP3:%.*]] = load ptr, ptr [[DOTADDR2]], align 4
2642 // CHECK3-NEXT: [[TMP4:%.*]] = load ptr, ptr [[DOTADDR]], align 4
2643 // CHECK3-NEXT: [[TMP5:%.*]] = load i32, ptr [[DOTADDR1]], align 4
2644 // CHECK3-NEXT: [[TMP6:%.*]] = getelementptr inbounds [1 x ptr], ptr [[TMP3]], i32 0, i32 0
2645 // CHECK3-NEXT: [[TMP7:%.*]] = load ptr, ptr [[TMP6]], align 4
2646 // CHECK3-NEXT: [[TMP8:%.*]] = getelementptr inbounds [[STRUCT__GLOBALIZED_LOCALS_TY:%.*]], ptr [[TMP4]], i32 [[TMP5]]
2647 // CHECK3-NEXT: [[E:%.*]] = getelementptr inbounds [[STRUCT__GLOBALIZED_LOCALS_TY]], ptr [[TMP8]], i32 0, i32 0
2648 // CHECK3-NEXT: [[TMP9:%.*]] = load double, ptr [[TMP7]], align 8
2649 // CHECK3-NEXT: store double [[TMP9]], ptr [[E]], align 8
2650 // CHECK3-NEXT: ret void
2653 // CHECK3-LABEL: define {{[^@]+}}@_omp_reduction_list_to_global_reduce_func
2654 // CHECK3-SAME: (ptr noundef [[TMP0:%.*]], i32 noundef [[TMP1:%.*]], ptr noundef [[TMP2:%.*]]) #[[ATTR3]] {
2655 // CHECK3-NEXT: entry:
2656 // CHECK3-NEXT: [[DOTADDR:%.*]] = alloca ptr, align 4
2657 // CHECK3-NEXT: [[DOTADDR1:%.*]] = alloca i32, align 4
2658 // CHECK3-NEXT: [[DOTADDR2:%.*]] = alloca ptr, align 4
2659 // CHECK3-NEXT: [[DOTOMP_REDUCTION_RED_LIST:%.*]] = alloca [1 x ptr], align 4
2660 // CHECK3-NEXT: store ptr [[TMP0]], ptr [[DOTADDR]], align 4
2661 // CHECK3-NEXT: store i32 [[TMP1]], ptr [[DOTADDR1]], align 4
2662 // CHECK3-NEXT: store ptr [[TMP2]], ptr [[DOTADDR2]], align 4
2663 // CHECK3-NEXT: [[TMP3:%.*]] = load ptr, ptr [[DOTADDR]], align 4
2664 // CHECK3-NEXT: [[TMP4:%.*]] = load i32, ptr [[DOTADDR1]], align 4
2665 // CHECK3-NEXT: [[TMP5:%.*]] = getelementptr inbounds [1 x ptr], ptr [[DOTOMP_REDUCTION_RED_LIST]], i32 0, i32 0
2666 // CHECK3-NEXT: [[TMP6:%.*]] = getelementptr inbounds [[STRUCT__GLOBALIZED_LOCALS_TY:%.*]], ptr [[TMP3]], i32 [[TMP4]]
2667 // CHECK3-NEXT: [[E:%.*]] = getelementptr inbounds [[STRUCT__GLOBALIZED_LOCALS_TY]], ptr [[TMP6]], i32 0, i32 0
2668 // CHECK3-NEXT: store ptr [[E]], ptr [[TMP5]], align 4
2669 // CHECK3-NEXT: [[TMP7:%.*]] = load ptr, ptr [[DOTADDR2]], align 4
2670 // CHECK3-NEXT: call void @"{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z9ftemplateIcET_i_l20_omp_outlined_omp$reduction$reduction_func"(ptr [[DOTOMP_REDUCTION_RED_LIST]], ptr [[TMP7]]) #[[ATTR4]]
2671 // CHECK3-NEXT: ret void
2674 // CHECK3-LABEL: define {{[^@]+}}@_omp_reduction_global_to_list_copy_func
2675 // CHECK3-SAME: (ptr noundef [[TMP0:%.*]], i32 noundef [[TMP1:%.*]], ptr noundef [[TMP2:%.*]]) #[[ATTR3]] {
2676 // CHECK3-NEXT: entry:
2677 // CHECK3-NEXT: [[DOTADDR:%.*]] = alloca ptr, align 4
2678 // CHECK3-NEXT: [[DOTADDR1:%.*]] = alloca i32, align 4
2679 // CHECK3-NEXT: [[DOTADDR2:%.*]] = alloca ptr, align 4
2680 // CHECK3-NEXT: store ptr [[TMP0]], ptr [[DOTADDR]], align 4
2681 // CHECK3-NEXT: store i32 [[TMP1]], ptr [[DOTADDR1]], align 4
2682 // CHECK3-NEXT: store ptr [[TMP2]], ptr [[DOTADDR2]], align 4
2683 // CHECK3-NEXT: [[TMP3:%.*]] = load ptr, ptr [[DOTADDR2]], align 4
2684 // CHECK3-NEXT: [[TMP4:%.*]] = load ptr, ptr [[DOTADDR]], align 4
2685 // CHECK3-NEXT: [[TMP5:%.*]] = load i32, ptr [[DOTADDR1]], align 4
2686 // CHECK3-NEXT: [[TMP6:%.*]] = getelementptr inbounds [1 x ptr], ptr [[TMP3]], i32 0, i32 0
2687 // CHECK3-NEXT: [[TMP7:%.*]] = load ptr, ptr [[TMP6]], align 4
2688 // CHECK3-NEXT: [[TMP8:%.*]] = getelementptr inbounds [[STRUCT__GLOBALIZED_LOCALS_TY:%.*]], ptr [[TMP4]], i32 [[TMP5]]
2689 // CHECK3-NEXT: [[E:%.*]] = getelementptr inbounds [[STRUCT__GLOBALIZED_LOCALS_TY]], ptr [[TMP8]], i32 0, i32 0
2690 // CHECK3-NEXT: [[TMP9:%.*]] = load double, ptr [[E]], align 8
2691 // CHECK3-NEXT: store double [[TMP9]], ptr [[TMP7]], align 8
2692 // CHECK3-NEXT: ret void
2695 // CHECK3-LABEL: define {{[^@]+}}@_omp_reduction_global_to_list_reduce_func
2696 // CHECK3-SAME: (ptr noundef [[TMP0:%.*]], i32 noundef [[TMP1:%.*]], ptr noundef [[TMP2:%.*]]) #[[ATTR3]] {
2697 // CHECK3-NEXT: entry:
2698 // CHECK3-NEXT: [[DOTADDR:%.*]] = alloca ptr, align 4
2699 // CHECK3-NEXT: [[DOTADDR1:%.*]] = alloca i32, align 4
2700 // CHECK3-NEXT: [[DOTADDR2:%.*]] = alloca ptr, align 4
2701 // CHECK3-NEXT: [[DOTOMP_REDUCTION_RED_LIST:%.*]] = alloca [1 x ptr], align 4
2702 // CHECK3-NEXT: store ptr [[TMP0]], ptr [[DOTADDR]], align 4
2703 // CHECK3-NEXT: store i32 [[TMP1]], ptr [[DOTADDR1]], align 4
2704 // CHECK3-NEXT: store ptr [[TMP2]], ptr [[DOTADDR2]], align 4
2705 // CHECK3-NEXT: [[TMP3:%.*]] = load ptr, ptr [[DOTADDR]], align 4
2706 // CHECK3-NEXT: [[TMP4:%.*]] = load i32, ptr [[DOTADDR1]], align 4
2707 // CHECK3-NEXT: [[TMP5:%.*]] = getelementptr inbounds [1 x ptr], ptr [[DOTOMP_REDUCTION_RED_LIST]], i32 0, i32 0
2708 // CHECK3-NEXT: [[TMP6:%.*]] = getelementptr inbounds [[STRUCT__GLOBALIZED_LOCALS_TY:%.*]], ptr [[TMP3]], i32 [[TMP4]]
2709 // CHECK3-NEXT: [[E:%.*]] = getelementptr inbounds [[STRUCT__GLOBALIZED_LOCALS_TY]], ptr [[TMP6]], i32 0, i32 0
2710 // CHECK3-NEXT: store ptr [[E]], ptr [[TMP5]], align 4
2711 // CHECK3-NEXT: [[TMP7:%.*]] = load ptr, ptr [[DOTADDR2]], align 4
2712 // CHECK3-NEXT: call void @"{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z9ftemplateIcET_i_l20_omp_outlined_omp$reduction$reduction_func"(ptr [[TMP7]], ptr [[DOTOMP_REDUCTION_RED_LIST]]) #[[ATTR4]]
2713 // CHECK3-NEXT: ret void
2716 // CHECK3-LABEL: define {{[^@]+}}@{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z9ftemplateIcET_i_l26
2717 // CHECK3-SAME: (ptr noalias noundef [[DYN_PTR:%.*]], i32 noundef [[C:%.*]], i32 noundef [[D:%.*]]) #[[ATTR0]] {
2718 // CHECK3-NEXT: entry:
2719 // CHECK3-NEXT: [[DYN_PTR_ADDR:%.*]] = alloca ptr, align 4
2720 // CHECK3-NEXT: [[C_ADDR:%.*]] = alloca i32, align 4
2721 // CHECK3-NEXT: [[D_ADDR:%.*]] = alloca i32, align 4
2722 // CHECK3-NEXT: [[DOTZERO_ADDR:%.*]] = alloca i32, align 4
2723 // CHECK3-NEXT: [[DOTTHREADID_TEMP_:%.*]] = alloca i32, align 4
2724 // CHECK3-NEXT: store ptr [[DYN_PTR]], ptr [[DYN_PTR_ADDR]], align 4
2725 // CHECK3-NEXT: store i32 [[C]], ptr [[C_ADDR]], align 4
2726 // CHECK3-NEXT: store i32 [[D]], ptr [[D_ADDR]], align 4
2727 // CHECK3-NEXT: [[TMP0:%.*]] = call i32 @__kmpc_target_init(ptr @{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z9ftemplateIcET_i_l26_kernel_environment, ptr [[DYN_PTR]])
2728 // CHECK3-NEXT: [[EXEC_USER_CODE:%.*]] = icmp eq i32 [[TMP0]], -1
2729 // CHECK3-NEXT: br i1 [[EXEC_USER_CODE]], label [[USER_CODE_ENTRY:%.*]], label [[WORKER_EXIT:%.*]]
2730 // CHECK3: user_code.entry:
2731 // CHECK3-NEXT: [[TMP1:%.*]] = load i8, ptr [[C_ADDR]], align 1
2732 // CHECK3-NEXT: [[C1:%.*]] = call align 8 ptr @__kmpc_alloc_shared(i32 1)
2733 // CHECK3-NEXT: store i8 [[TMP1]], ptr [[C1]], align 1
2734 // CHECK3-NEXT: [[TMP2:%.*]] = load float, ptr [[D_ADDR]], align 4
2735 // CHECK3-NEXT: [[D2:%.*]] = call align 8 ptr @__kmpc_alloc_shared(i32 4)
2736 // CHECK3-NEXT: store float [[TMP2]], ptr [[D2]], align 4
2737 // CHECK3-NEXT: [[TMP3:%.*]] = call i32 @__kmpc_global_thread_num(ptr @[[GLOB1]])
2738 // CHECK3-NEXT: store i32 0, ptr [[DOTZERO_ADDR]], align 4
2739 // CHECK3-NEXT: store i32 [[TMP3]], ptr [[DOTTHREADID_TEMP_]], align 4
2740 // CHECK3-NEXT: call void @{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z9ftemplateIcET_i_l26_omp_outlined(ptr [[DOTTHREADID_TEMP_]], ptr [[DOTZERO_ADDR]], ptr [[C1]], ptr [[D2]]) #[[ATTR4]]
2741 // CHECK3-NEXT: call void @__kmpc_free_shared(ptr [[D2]], i32 4)
2742 // CHECK3-NEXT: call void @__kmpc_free_shared(ptr [[C1]], i32 1)
2743 // CHECK3-NEXT: call void @__kmpc_target_deinit()
2744 // CHECK3-NEXT: ret void
2745 // CHECK3: worker.exit:
2746 // CHECK3-NEXT: ret void
2749 // CHECK3-LABEL: define {{[^@]+}}@{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z9ftemplateIcET_i_l26_omp_outlined
2750 // CHECK3-SAME: (ptr noalias noundef [[DOTGLOBAL_TID_:%.*]], ptr noalias noundef [[DOTBOUND_TID_:%.*]], ptr noundef nonnull align 1 dereferenceable(1) [[C:%.*]], ptr noundef nonnull align 4 dereferenceable(4) [[D:%.*]]) #[[ATTR1]] {
2751 // CHECK3-NEXT: entry:
2752 // CHECK3-NEXT: [[DOTGLOBAL_TID__ADDR:%.*]] = alloca ptr, align 4
2753 // CHECK3-NEXT: [[DOTBOUND_TID__ADDR:%.*]] = alloca ptr, align 4
2754 // CHECK3-NEXT: [[C_ADDR:%.*]] = alloca ptr, align 4
2755 // CHECK3-NEXT: [[D_ADDR:%.*]] = alloca ptr, align 4
2756 // CHECK3-NEXT: [[DOTOMP_REDUCTION_RED_LIST:%.*]] = alloca [2 x ptr], align 4
2757 // CHECK3-NEXT: store ptr [[DOTGLOBAL_TID_]], ptr [[DOTGLOBAL_TID__ADDR]], align 4
2758 // CHECK3-NEXT: store ptr [[DOTBOUND_TID_]], ptr [[DOTBOUND_TID__ADDR]], align 4
2759 // CHECK3-NEXT: store ptr [[C]], ptr [[C_ADDR]], align 4
2760 // CHECK3-NEXT: store ptr [[D]], ptr [[D_ADDR]], align 4
2761 // CHECK3-NEXT: [[TMP0:%.*]] = load ptr, ptr [[C_ADDR]], align 4
2762 // CHECK3-NEXT: [[TMP1:%.*]] = load ptr, ptr [[D_ADDR]], align 4
2763 // CHECK3-NEXT: [[C1:%.*]] = call align 8 ptr @__kmpc_alloc_shared(i32 1)
2764 // CHECK3-NEXT: [[D2:%.*]] = call align 8 ptr @__kmpc_alloc_shared(i32 4)
2765 // CHECK3-NEXT: store i8 0, ptr [[C1]], align 1
2766 // CHECK3-NEXT: store float 1.000000e+00, ptr [[D2]], align 4
2767 // CHECK3-NEXT: [[TMP2:%.*]] = load i8, ptr [[C1]], align 1
2768 // CHECK3-NEXT: [[CONV:%.*]] = sext i8 [[TMP2]] to i32
2769 // CHECK3-NEXT: [[XOR:%.*]] = xor i32 [[CONV]], 2
2770 // CHECK3-NEXT: [[CONV3:%.*]] = trunc i32 [[XOR]] to i8
2771 // CHECK3-NEXT: store i8 [[CONV3]], ptr [[C1]], align 1
2772 // CHECK3-NEXT: [[TMP3:%.*]] = load float, ptr [[D2]], align 4
2773 // CHECK3-NEXT: [[MUL:%.*]] = fmul float [[TMP3]], 3.300000e+01
2774 // CHECK3-NEXT: store float [[MUL]], ptr [[D2]], align 4
2775 // CHECK3-NEXT: [[TMP4:%.*]] = getelementptr inbounds [2 x ptr], ptr [[DOTOMP_REDUCTION_RED_LIST]], i32 0, i32 0
2776 // CHECK3-NEXT: store ptr [[C1]], ptr [[TMP4]], align 4
2777 // CHECK3-NEXT: [[TMP5:%.*]] = getelementptr inbounds [2 x ptr], ptr [[DOTOMP_REDUCTION_RED_LIST]], i32 0, i32 1
2778 // CHECK3-NEXT: store ptr [[D2]], ptr [[TMP5]], align 4
2779 // CHECK3-NEXT: %"_openmp_teams_reductions_buffer_$_$ptr" = call ptr @__kmpc_reduction_get_fixed_buffer()
2780 // CHECK3-NEXT: [[TMP6:%.*]] = call i32 @__kmpc_nvptx_teams_reduce_nowait_v2(ptr @[[GLOB1]], ptr %"_openmp_teams_reductions_buffer_$_$ptr", i32 2048, i64 8, ptr [[DOTOMP_REDUCTION_RED_LIST]], ptr @_omp_reduction_shuffle_and_reduce_func1, ptr @_omp_reduction_inter_warp_copy_func2, ptr @_omp_reduction_list_to_global_copy_func3, ptr @_omp_reduction_list_to_global_reduce_func4, ptr @_omp_reduction_global_to_list_copy_func5, ptr @_omp_reduction_global_to_list_reduce_func6)
2781 // CHECK3-NEXT: [[TMP7:%.*]] = icmp eq i32 [[TMP6]], 1
2782 // CHECK3-NEXT: br i1 [[TMP7]], label [[DOTOMP_REDUCTION_THEN:%.*]], label [[DOTOMP_REDUCTION_DONE:%.*]]
2783 // CHECK3: .omp.reduction.then:
2784 // CHECK3-NEXT: [[TMP8:%.*]] = load i8, ptr [[TMP0]], align 1
2785 // CHECK3-NEXT: [[CONV4:%.*]] = sext i8 [[TMP8]] to i32
2786 // CHECK3-NEXT: [[TMP9:%.*]] = load i8, ptr [[C1]], align 1
2787 // CHECK3-NEXT: [[CONV5:%.*]] = sext i8 [[TMP9]] to i32
2788 // CHECK3-NEXT: [[XOR6:%.*]] = xor i32 [[CONV4]], [[CONV5]]
2789 // CHECK3-NEXT: [[CONV7:%.*]] = trunc i32 [[XOR6]] to i8
2790 // CHECK3-NEXT: store i8 [[CONV7]], ptr [[TMP0]], align 1
2791 // CHECK3-NEXT: [[TMP10:%.*]] = load float, ptr [[TMP1]], align 4
2792 // CHECK3-NEXT: [[TMP11:%.*]] = load float, ptr [[D2]], align 4
2793 // CHECK3-NEXT: [[MUL8:%.*]] = fmul float [[TMP10]], [[TMP11]]
2794 // CHECK3-NEXT: store float [[MUL8]], ptr [[TMP1]], align 4
2795 // CHECK3-NEXT: br label [[DOTOMP_REDUCTION_DONE]]
2796 // CHECK3: .omp.reduction.done:
2797 // CHECK3-NEXT: call void @__kmpc_free_shared(ptr [[D2]], i32 4)
2798 // CHECK3-NEXT: call void @__kmpc_free_shared(ptr [[C1]], i32 1)
2799 // CHECK3-NEXT: ret void
2802 // CHECK3-LABEL: define {{[^@]+}}@_omp_reduction_shuffle_and_reduce_func1
2803 // CHECK3-SAME: (ptr noundef [[TMP0:%.*]], i16 noundef signext [[TMP1:%.*]], i16 noundef signext [[TMP2:%.*]], i16 noundef signext [[TMP3:%.*]]) #[[ATTR3]] {
2804 // CHECK3-NEXT: entry:
2805 // CHECK3-NEXT: [[DOTADDR:%.*]] = alloca ptr, align 4
2806 // CHECK3-NEXT: [[DOTADDR1:%.*]] = alloca i16, align 2
2807 // CHECK3-NEXT: [[DOTADDR2:%.*]] = alloca i16, align 2
2808 // CHECK3-NEXT: [[DOTADDR3:%.*]] = alloca i16, align 2
2809 // CHECK3-NEXT: [[DOTOMP_REDUCTION_REMOTE_REDUCE_LIST:%.*]] = alloca [2 x ptr], align 4
2810 // CHECK3-NEXT: [[DOTOMP_REDUCTION_ELEMENT:%.*]] = alloca i8, align 1
2811 // CHECK3-NEXT: [[DOTOMP_REDUCTION_ELEMENT4:%.*]] = alloca float, align 4
2812 // CHECK3-NEXT: store ptr [[TMP0]], ptr [[DOTADDR]], align 4
2813 // CHECK3-NEXT: store i16 [[TMP1]], ptr [[DOTADDR1]], align 2
2814 // CHECK3-NEXT: store i16 [[TMP2]], ptr [[DOTADDR2]], align 2
2815 // CHECK3-NEXT: store i16 [[TMP3]], ptr [[DOTADDR3]], align 2
2816 // CHECK3-NEXT: [[TMP4:%.*]] = load ptr, ptr [[DOTADDR]], align 4
2817 // CHECK3-NEXT: [[TMP5:%.*]] = load i16, ptr [[DOTADDR1]], align 2
2818 // CHECK3-NEXT: [[TMP6:%.*]] = load i16, ptr [[DOTADDR2]], align 2
2819 // CHECK3-NEXT: [[TMP7:%.*]] = load i16, ptr [[DOTADDR3]], align 2
2820 // CHECK3-NEXT: [[TMP8:%.*]] = getelementptr inbounds [2 x ptr], ptr [[TMP4]], i32 0, i32 0
2821 // CHECK3-NEXT: [[TMP9:%.*]] = load ptr, ptr [[TMP8]], align 4
2822 // CHECK3-NEXT: [[TMP10:%.*]] = getelementptr inbounds [2 x ptr], ptr [[DOTOMP_REDUCTION_REMOTE_REDUCE_LIST]], i32 0, i32 0
2823 // CHECK3-NEXT: [[TMP11:%.*]] = getelementptr i8, ptr [[TMP9]], i32 1
2824 // CHECK3-NEXT: [[TMP12:%.*]] = load i8, ptr [[TMP9]], align 1
2825 // CHECK3-NEXT: [[TMP13:%.*]] = sext i8 [[TMP12]] to i32
2826 // CHECK3-NEXT: [[TMP14:%.*]] = call i32 @__kmpc_get_warp_size()
2827 // CHECK3-NEXT: [[TMP15:%.*]] = trunc i32 [[TMP14]] to i16
2828 // CHECK3-NEXT: [[TMP16:%.*]] = call i32 @__kmpc_shuffle_int32(i32 [[TMP13]], i16 [[TMP6]], i16 [[TMP15]])
2829 // CHECK3-NEXT: [[TMP17:%.*]] = trunc i32 [[TMP16]] to i8
2830 // CHECK3-NEXT: store i8 [[TMP17]], ptr [[DOTOMP_REDUCTION_ELEMENT]], align 1
2831 // CHECK3-NEXT: [[TMP18:%.*]] = getelementptr i8, ptr [[TMP9]], i32 1
2832 // CHECK3-NEXT: [[TMP19:%.*]] = getelementptr i8, ptr [[DOTOMP_REDUCTION_ELEMENT]], i32 1
2833 // CHECK3-NEXT: store ptr [[DOTOMP_REDUCTION_ELEMENT]], ptr [[TMP10]], align 4
2834 // CHECK3-NEXT: [[TMP20:%.*]] = getelementptr inbounds [2 x ptr], ptr [[TMP4]], i32 0, i32 1
2835 // CHECK3-NEXT: [[TMP21:%.*]] = load ptr, ptr [[TMP20]], align 4
2836 // CHECK3-NEXT: [[TMP22:%.*]] = getelementptr inbounds [2 x ptr], ptr [[DOTOMP_REDUCTION_REMOTE_REDUCE_LIST]], i32 0, i32 1
2837 // CHECK3-NEXT: [[TMP23:%.*]] = getelementptr float, ptr [[TMP21]], i32 1
2838 // CHECK3-NEXT: [[TMP24:%.*]] = load i32, ptr [[TMP21]], align 4
2839 // CHECK3-NEXT: [[TMP25:%.*]] = call i32 @__kmpc_get_warp_size()
2840 // CHECK3-NEXT: [[TMP26:%.*]] = trunc i32 [[TMP25]] to i16
2841 // CHECK3-NEXT: [[TMP27:%.*]] = call i32 @__kmpc_shuffle_int32(i32 [[TMP24]], i16 [[TMP6]], i16 [[TMP26]])
2842 // CHECK3-NEXT: store i32 [[TMP27]], ptr [[DOTOMP_REDUCTION_ELEMENT4]], align 4
2843 // CHECK3-NEXT: [[TMP28:%.*]] = getelementptr i32, ptr [[TMP21]], i32 1
2844 // CHECK3-NEXT: [[TMP29:%.*]] = getelementptr i32, ptr [[DOTOMP_REDUCTION_ELEMENT4]], i32 1
2845 // CHECK3-NEXT: store ptr [[DOTOMP_REDUCTION_ELEMENT4]], ptr [[TMP22]], align 4
2846 // CHECK3-NEXT: [[TMP30:%.*]] = icmp eq i16 [[TMP7]], 0
2847 // CHECK3-NEXT: [[TMP31:%.*]] = icmp eq i16 [[TMP7]], 1
2848 // CHECK3-NEXT: [[TMP32:%.*]] = icmp ult i16 [[TMP5]], [[TMP6]]
2849 // CHECK3-NEXT: [[TMP33:%.*]] = and i1 [[TMP31]], [[TMP32]]
2850 // CHECK3-NEXT: [[TMP34:%.*]] = icmp eq i16 [[TMP7]], 2
2851 // CHECK3-NEXT: [[TMP35:%.*]] = and i16 [[TMP5]], 1
2852 // CHECK3-NEXT: [[TMP36:%.*]] = icmp eq i16 [[TMP35]], 0
2853 // CHECK3-NEXT: [[TMP37:%.*]] = and i1 [[TMP34]], [[TMP36]]
2854 // CHECK3-NEXT: [[TMP38:%.*]] = icmp sgt i16 [[TMP6]], 0
2855 // CHECK3-NEXT: [[TMP39:%.*]] = and i1 [[TMP37]], [[TMP38]]
2856 // CHECK3-NEXT: [[TMP40:%.*]] = or i1 [[TMP30]], [[TMP33]]
2857 // CHECK3-NEXT: [[TMP41:%.*]] = or i1 [[TMP40]], [[TMP39]]
2858 // CHECK3-NEXT: br i1 [[TMP41]], label [[THEN:%.*]], label [[ELSE:%.*]]
2859 // CHECK3: then:
2860 // CHECK3-NEXT: call void @"{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z9ftemplateIcET_i_l26_omp_outlined_omp$reduction$reduction_func"(ptr [[TMP4]], ptr [[DOTOMP_REDUCTION_REMOTE_REDUCE_LIST]]) #[[ATTR4]]
2861 // CHECK3-NEXT: br label [[IFCONT:%.*]]
2862 // CHECK3: else:
2863 // CHECK3-NEXT: br label [[IFCONT]]
2864 // CHECK3: ifcont:
2865 // CHECK3-NEXT: [[TMP42:%.*]] = icmp eq i16 [[TMP7]], 1
2866 // CHECK3-NEXT: [[TMP43:%.*]] = icmp uge i16 [[TMP5]], [[TMP6]]
2867 // CHECK3-NEXT: [[TMP44:%.*]] = and i1 [[TMP42]], [[TMP43]]
2868 // CHECK3-NEXT: br i1 [[TMP44]], label [[THEN5:%.*]], label [[ELSE6:%.*]]
2869 // CHECK3: then5:
2870 // CHECK3-NEXT: [[TMP45:%.*]] = getelementptr inbounds [2 x ptr], ptr [[DOTOMP_REDUCTION_REMOTE_REDUCE_LIST]], i32 0, i32 0
2871 // CHECK3-NEXT: [[TMP46:%.*]] = load ptr, ptr [[TMP45]], align 4
2872 // CHECK3-NEXT: [[TMP47:%.*]] = getelementptr inbounds [2 x ptr], ptr [[TMP4]], i32 0, i32 0
2873 // CHECK3-NEXT: [[TMP48:%.*]] = load ptr, ptr [[TMP47]], align 4
2874 // CHECK3-NEXT: [[TMP49:%.*]] = load i8, ptr [[TMP46]], align 1
2875 // CHECK3-NEXT: store i8 [[TMP49]], ptr [[TMP48]], align 1
2876 // CHECK3-NEXT: [[TMP50:%.*]] = getelementptr inbounds [2 x ptr], ptr [[DOTOMP_REDUCTION_REMOTE_REDUCE_LIST]], i32 0, i32 1
2877 // CHECK3-NEXT: [[TMP51:%.*]] = load ptr, ptr [[TMP50]], align 4
2878 // CHECK3-NEXT: [[TMP52:%.*]] = getelementptr inbounds [2 x ptr], ptr [[TMP4]], i32 0, i32 1
2879 // CHECK3-NEXT: [[TMP53:%.*]] = load ptr, ptr [[TMP52]], align 4
2880 // CHECK3-NEXT: [[TMP54:%.*]] = load float, ptr [[TMP51]], align 4
2881 // CHECK3-NEXT: store float [[TMP54]], ptr [[TMP53]], align 4
2882 // CHECK3-NEXT: br label [[IFCONT7:%.*]]
2883 // CHECK3: else6:
2884 // CHECK3-NEXT: br label [[IFCONT7]]
2885 // CHECK3: ifcont7:
2886 // CHECK3-NEXT: ret void
2889 // CHECK3-LABEL: define {{[^@]+}}@_omp_reduction_inter_warp_copy_func2
2890 // CHECK3-SAME: (ptr noundef [[TMP0:%.*]], i32 noundef [[TMP1:%.*]]) #[[ATTR3]] {
2891 // CHECK3-NEXT: entry:
2892 // CHECK3-NEXT: [[DOTADDR:%.*]] = alloca ptr, align 4
2893 // CHECK3-NEXT: [[DOTADDR1:%.*]] = alloca i32, align 4
2894 // CHECK3-NEXT: store ptr [[TMP0]], ptr [[DOTADDR]], align 4
2895 // CHECK3-NEXT: store i32 [[TMP1]], ptr [[DOTADDR1]], align 4
2896 // CHECK3-NEXT: [[TMP3:%.*]] = call i32 @__kmpc_get_hardware_thread_id_in_block()
2897 // CHECK3-NEXT: [[TMP4:%.*]] = call i32 @__kmpc_get_hardware_thread_id_in_block()
2898 // CHECK3-NEXT: [[NVPTX_LANE_ID:%.*]] = and i32 [[TMP4]], 31
2899 // CHECK3-NEXT: [[TMP5:%.*]] = call i32 @__kmpc_get_hardware_thread_id_in_block()
2900 // CHECK3-NEXT: [[NVPTX_WARP_ID:%.*]] = ashr i32 [[TMP5]], 5
2901 // CHECK3-NEXT: [[TMP6:%.*]] = load ptr, ptr [[DOTADDR]], align 4
2902 // CHECK3-NEXT: [[TMP2:%.*]] = call i32 @__kmpc_global_thread_num(ptr @[[GLOB1]])
2903 // CHECK3-NEXT: call void @__kmpc_barrier(ptr @[[GLOB2]], i32 [[TMP2]])
2904 // CHECK3-NEXT: [[WARP_MASTER:%.*]] = icmp eq i32 [[NVPTX_LANE_ID]], 0
2905 // CHECK3-NEXT: br i1 [[WARP_MASTER]], label [[THEN:%.*]], label [[ELSE:%.*]]
2906 // CHECK3: then:
2907 // CHECK3-NEXT: [[TMP7:%.*]] = getelementptr inbounds [2 x ptr], ptr [[TMP6]], i32 0, i32 0
2908 // CHECK3-NEXT: [[TMP8:%.*]] = load ptr, ptr [[TMP7]], align 4
2909 // CHECK3-NEXT: [[TMP9:%.*]] = getelementptr inbounds [32 x i32], ptr addrspace(3) @__openmp_nvptx_data_transfer_temporary_storage, i64 0, i32 [[NVPTX_WARP_ID]]
2910 // CHECK3-NEXT: [[TMP10:%.*]] = load i8, ptr [[TMP8]], align 1
2911 // CHECK3-NEXT: store volatile i8 [[TMP10]], ptr addrspace(3) [[TMP9]], align 1
2912 // CHECK3-NEXT: br label [[IFCONT:%.*]]
2913 // CHECK3: else:
2914 // CHECK3-NEXT: br label [[IFCONT]]
2915 // CHECK3: ifcont:
2916 // CHECK3-NEXT: [[TMP2:%.*]] = call i32 @__kmpc_global_thread_num(ptr @[[GLOB1]])
2917 // CHECK3-NEXT: call void @__kmpc_barrier(ptr @[[GLOB2]], i32 [[TMP2]])
2918 // CHECK3-NEXT: [[TMP11:%.*]] = load i32, ptr [[DOTADDR1]], align 4
2919 // CHECK3-NEXT: [[IS_ACTIVE_THREAD:%.*]] = icmp ult i32 [[TMP3]], [[TMP11]]
2920 // CHECK3-NEXT: br i1 [[IS_ACTIVE_THREAD]], label [[THEN2:%.*]], label [[ELSE3:%.*]]
2921 // CHECK3: then3:
2922 // CHECK3-NEXT: [[TMP12:%.*]] = getelementptr inbounds [32 x i32], ptr addrspace(3) @__openmp_nvptx_data_transfer_temporary_storage, i64 0, i32 [[TMP3]]
2923 // CHECK3-NEXT: [[TMP13:%.*]] = getelementptr inbounds [2 x ptr], ptr [[TMP6]], i32 0, i32 0
2924 // CHECK3-NEXT: [[TMP14:%.*]] = load ptr, ptr [[TMP13]], align 4
2925 // CHECK3-NEXT: [[TMP15:%.*]] = load volatile i8, ptr addrspace(3) [[TMP12]], align 1
2926 // CHECK3-NEXT: store i8 [[TMP15]], ptr [[TMP14]], align 1
2927 // CHECK3-NEXT: br label [[IFCONT4:%.*]]
2928 // CHECK3: else4:
2929 // CHECK3-NEXT: br label [[IFCONT4]]
2930 // CHECK3: ifcont5:
2931 // CHECK3-NEXT: [[TMP2:%.*]] = call i32 @__kmpc_global_thread_num(ptr @[[GLOB1]])
2932 // CHECK3-NEXT: call void @__kmpc_barrier(ptr @[[GLOB2]], i32 [[TMP2]])
2933 // CHECK3-NEXT: [[WARP_MASTER5:%.*]] = icmp eq i32 [[NVPTX_LANE_ID]], 0
2934 // CHECK3-NEXT: br i1 [[WARP_MASTER5]], label [[THEN6:%.*]], label [[ELSE7:%.*]]
2935 // CHECK3: then8:
2936 // CHECK3-NEXT: [[TMP16:%.*]] = getelementptr inbounds [2 x ptr], ptr [[TMP6]], i32 0, i32 1
2937 // CHECK3-NEXT: [[TMP17:%.*]] = load ptr, ptr [[TMP16]], align 4
2938 // CHECK3-NEXT: [[TMP18:%.*]] = getelementptr inbounds [32 x i32], ptr addrspace(3) @__openmp_nvptx_data_transfer_temporary_storage, i64 0, i32 [[NVPTX_WARP_ID]]
2939 // CHECK3-NEXT: [[TMP19:%.*]] = load i32, ptr [[TMP17]], align 4
2940 // CHECK3-NEXT: store volatile i32 [[TMP19]], ptr addrspace(3) [[TMP18]], align 4
2941 // CHECK3-NEXT: br label [[IFCONT8:%.*]]
2942 // CHECK3: else9:
2943 // CHECK3-NEXT: br label [[IFCONT8]]
2944 // CHECK3: ifcont10:
2945 // CHECK3-NEXT: [[TMP2:%.*]] = call i32 @__kmpc_global_thread_num(ptr @[[GLOB1]])
2946 // CHECK3-NEXT: call void @__kmpc_barrier(ptr @[[GLOB2]], i32 [[TMP2]])
2947 // CHECK3-NEXT: [[TMP20:%.*]] = load i32, ptr [[DOTADDR1]], align 4
2948 // CHECK3-NEXT: [[IS_ACTIVE_THREAD9:%.*]] = icmp ult i32 [[TMP3]], [[TMP20]]
2949 // CHECK3-NEXT: br i1 [[IS_ACTIVE_THREAD9]], label [[THEN10:%.*]], label [[ELSE11:%.*]]
2950 // CHECK3: then13:
2951 // CHECK3-NEXT: [[TMP21:%.*]] = getelementptr inbounds [32 x i32], ptr addrspace(3) @__openmp_nvptx_data_transfer_temporary_storage, i64 0, i32 [[TMP3]]
2952 // CHECK3-NEXT: [[TMP22:%.*]] = getelementptr inbounds [2 x ptr], ptr [[TMP6]], i32 0, i32 1
2953 // CHECK3-NEXT: [[TMP23:%.*]] = load ptr, ptr [[TMP22]], align 4
2954 // CHECK3-NEXT: [[TMP24:%.*]] = load volatile i32, ptr addrspace(3) [[TMP21]], align 4
2955 // CHECK3-NEXT: store i32 [[TMP24]], ptr [[TMP23]], align 4
2956 // CHECK3-NEXT: br label [[IFCONT12:%.*]]
2957 // CHECK3: else14:
2958 // CHECK3-NEXT: br label [[IFCONT12]]
2959 // CHECK3: ifcont15:
2960 // CHECK3-NEXT: ret void
2963 // CHECK3-LABEL: define {{[^@]+}}@_omp_reduction_list_to_global_copy_func3
2964 // CHECK3-SAME: (ptr noundef [[TMP0:%.*]], i32 noundef [[TMP1:%.*]], ptr noundef [[TMP2:%.*]]) #[[ATTR3]] {
2965 // CHECK3-NEXT: entry:
2966 // CHECK3-NEXT: [[DOTADDR:%.*]] = alloca ptr, align 4
2967 // CHECK3-NEXT: [[DOTADDR1:%.*]] = alloca i32, align 4
2968 // CHECK3-NEXT: [[DOTADDR2:%.*]] = alloca ptr, align 4
2969 // CHECK3-NEXT: store ptr [[TMP0]], ptr [[DOTADDR]], align 4
2970 // CHECK3-NEXT: store i32 [[TMP1]], ptr [[DOTADDR1]], align 4
2971 // CHECK3-NEXT: store ptr [[TMP2]], ptr [[DOTADDR2]], align 4
2972 // CHECK3-NEXT: [[TMP3:%.*]] = load ptr, ptr [[DOTADDR2]], align 4
2973 // CHECK3-NEXT: [[TMP4:%.*]] = load ptr, ptr [[DOTADDR]], align 4
2974 // CHECK3-NEXT: [[TMP5:%.*]] = load i32, ptr [[DOTADDR1]], align 4
2975 // CHECK3-NEXT: [[TMP6:%.*]] = getelementptr inbounds [2 x ptr], ptr [[TMP3]], i32 0, i32 0
2976 // CHECK3-NEXT: [[TMP7:%.*]] = load ptr, ptr [[TMP6]], align 4
2977 // CHECK3-NEXT: [[TMP8:%.*]] = getelementptr inbounds [[STRUCT__GLOBALIZED_LOCALS_TY_0:%.*]], ptr [[TMP4]], i32 [[TMP5]]
2978 // CHECK3-NEXT: [[C:%.*]] = getelementptr inbounds [[STRUCT__GLOBALIZED_LOCALS_TY_0]], ptr [[TMP8]], i32 0, i32 0
2979 // CHECK3-NEXT: [[TMP9:%.*]] = load i8, ptr [[TMP7]], align 1
2980 // CHECK3-NEXT: store i8 [[TMP9]], ptr [[C]], align 1
2981 // CHECK3-NEXT: [[TMP10:%.*]] = getelementptr inbounds [2 x ptr], ptr [[TMP3]], i32 0, i32 1
2982 // CHECK3-NEXT: [[TMP11:%.*]] = load ptr, ptr [[TMP10]], align 4
2983 // CHECK3-NEXT: [[TMP12:%.*]] = getelementptr inbounds [[STRUCT__GLOBALIZED_LOCALS_TY_0]], ptr [[TMP4]], i32 [[TMP5]]
2984 // CHECK3-NEXT: [[D:%.*]] = getelementptr inbounds [[STRUCT__GLOBALIZED_LOCALS_TY_0]], ptr [[TMP12]], i32 0, i32 1
2985 // CHECK3-NEXT: [[TMP13:%.*]] = load float, ptr [[TMP11]], align 4
2986 // CHECK3-NEXT: store float [[TMP13]], ptr [[D]], align 4
2987 // CHECK3-NEXT: ret void
2990 // CHECK3-LABEL: define {{[^@]+}}@_omp_reduction_list_to_global_reduce_func4
2991 // CHECK3-SAME: (ptr noundef [[TMP0:%.*]], i32 noundef [[TMP1:%.*]], ptr noundef [[TMP2:%.*]]) #[[ATTR3]] {
2992 // CHECK3-NEXT: entry:
2993 // CHECK3-NEXT: [[DOTADDR:%.*]] = alloca ptr, align 4
2994 // CHECK3-NEXT: [[DOTADDR1:%.*]] = alloca i32, align 4
2995 // CHECK3-NEXT: [[DOTADDR2:%.*]] = alloca ptr, align 4
2996 // CHECK3-NEXT: [[DOTOMP_REDUCTION_RED_LIST:%.*]] = alloca [2 x ptr], align 4
2997 // CHECK3-NEXT: store ptr [[TMP0]], ptr [[DOTADDR]], align 4
2998 // CHECK3-NEXT: store i32 [[TMP1]], ptr [[DOTADDR1]], align 4
2999 // CHECK3-NEXT: store ptr [[TMP2]], ptr [[DOTADDR2]], align 4
3000 // CHECK3-NEXT: [[TMP3:%.*]] = load ptr, ptr [[DOTADDR]], align 4
3001 // CHECK3-NEXT: [[TMP4:%.*]] = load i32, ptr [[DOTADDR1]], align 4
3002 // CHECK3-NEXT: [[TMP5:%.*]] = getelementptr inbounds [2 x ptr], ptr [[DOTOMP_REDUCTION_RED_LIST]], i32 0, i32 0
3003 // CHECK3-NEXT: [[TMP6:%.*]] = getelementptr inbounds [[STRUCT__GLOBALIZED_LOCALS_TY_0:%.*]], ptr [[TMP3]], i32 [[TMP4]]
3004 // CHECK3-NEXT: [[C:%.*]] = getelementptr inbounds [[STRUCT__GLOBALIZED_LOCALS_TY_0]], ptr [[TMP6]], i32 0, i32 0
3005 // CHECK3-NEXT: store ptr [[C]], ptr [[TMP5]], align 4
3006 // CHECK3-NEXT: [[TMP7:%.*]] = getelementptr inbounds [2 x ptr], ptr [[DOTOMP_REDUCTION_RED_LIST]], i32 0, i32 1
3007 // CHECK3-NEXT: [[TMP8:%.*]] = getelementptr inbounds [[STRUCT__GLOBALIZED_LOCALS_TY_0]], ptr [[TMP3]], i32 [[TMP4]]
3008 // CHECK3-NEXT: [[D:%.*]] = getelementptr inbounds [[STRUCT__GLOBALIZED_LOCALS_TY_0]], ptr [[TMP8]], i32 0, i32 1
3009 // CHECK3-NEXT: store ptr [[D]], ptr [[TMP7]], align 4
3010 // CHECK3-NEXT: [[TMP9:%.*]] = load ptr, ptr [[DOTADDR2]], align 4
3011 // CHECK3-NEXT: call void @"{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z9ftemplateIcET_i_l26_omp_outlined_omp$reduction$reduction_func"(ptr [[DOTOMP_REDUCTION_RED_LIST]], ptr [[TMP9]]) #[[ATTR4]]
3012 // CHECK3-NEXT: ret void
3015 // CHECK3-LABEL: define {{[^@]+}}@_omp_reduction_global_to_list_copy_func5
3016 // CHECK3-SAME: (ptr noundef [[TMP0:%.*]], i32 noundef [[TMP1:%.*]], ptr noundef [[TMP2:%.*]]) #[[ATTR3]] {
3017 // CHECK3-NEXT: entry:
3018 // CHECK3-NEXT: [[DOTADDR:%.*]] = alloca ptr, align 4
3019 // CHECK3-NEXT: [[DOTADDR1:%.*]] = alloca i32, align 4
3020 // CHECK3-NEXT: [[DOTADDR2:%.*]] = alloca ptr, align 4
3021 // CHECK3-NEXT: store ptr [[TMP0]], ptr [[DOTADDR]], align 4
3022 // CHECK3-NEXT: store i32 [[TMP1]], ptr [[DOTADDR1]], align 4
3023 // CHECK3-NEXT: store ptr [[TMP2]], ptr [[DOTADDR2]], align 4
3024 // CHECK3-NEXT: [[TMP3:%.*]] = load ptr, ptr [[DOTADDR2]], align 4
3025 // CHECK3-NEXT: [[TMP4:%.*]] = load ptr, ptr [[DOTADDR]], align 4
3026 // CHECK3-NEXT: [[TMP5:%.*]] = load i32, ptr [[DOTADDR1]], align 4
3027 // CHECK3-NEXT: [[TMP6:%.*]] = getelementptr inbounds [2 x ptr], ptr [[TMP3]], i32 0, i32 0
3028 // CHECK3-NEXT: [[TMP7:%.*]] = load ptr, ptr [[TMP6]], align 4
3029 // CHECK3-NEXT: [[TMP8:%.*]] = getelementptr inbounds [[STRUCT__GLOBALIZED_LOCALS_TY_0:%.*]], ptr [[TMP4]], i32 [[TMP5]]
3030 // CHECK3-NEXT: [[C:%.*]] = getelementptr inbounds [[STRUCT__GLOBALIZED_LOCALS_TY_0]], ptr [[TMP8]], i32 0, i32 0
3031 // CHECK3-NEXT: [[TMP9:%.*]] = load i8, ptr [[C]], align 1
3032 // CHECK3-NEXT: store i8 [[TMP9]], ptr [[TMP7]], align 1
3033 // CHECK3-NEXT: [[TMP10:%.*]] = getelementptr inbounds [2 x ptr], ptr [[TMP3]], i32 0, i32 1
3034 // CHECK3-NEXT: [[TMP11:%.*]] = load ptr, ptr [[TMP10]], align 4
3035 // CHECK3-NEXT: [[TMP12:%.*]] = getelementptr inbounds [[STRUCT__GLOBALIZED_LOCALS_TY_0]], ptr [[TMP4]], i32 [[TMP5]]
3036 // CHECK3-NEXT: [[D:%.*]] = getelementptr inbounds [[STRUCT__GLOBALIZED_LOCALS_TY_0]], ptr [[TMP12]], i32 0, i32 1
3037 // CHECK3-NEXT: [[TMP13:%.*]] = load float, ptr [[D]], align 4
3038 // CHECK3-NEXT: store float [[TMP13]], ptr [[TMP11]], align 4
3039 // CHECK3-NEXT: ret void
3042 // CHECK3-LABEL: define {{[^@]+}}@_omp_reduction_global_to_list_reduce_func6
3043 // CHECK3-SAME: (ptr noundef [[TMP0:%.*]], i32 noundef [[TMP1:%.*]], ptr noundef [[TMP2:%.*]]) #[[ATTR3]] {
3044 // CHECK3-NEXT: entry:
3045 // CHECK3-NEXT: [[DOTADDR:%.*]] = alloca ptr, align 4
3046 // CHECK3-NEXT: [[DOTADDR1:%.*]] = alloca i32, align 4
3047 // CHECK3-NEXT: [[DOTADDR2:%.*]] = alloca ptr, align 4
3048 // CHECK3-NEXT: [[DOTOMP_REDUCTION_RED_LIST:%.*]] = alloca [2 x ptr], align 4
3049 // CHECK3-NEXT: store ptr [[TMP0]], ptr [[DOTADDR]], align 4
3050 // CHECK3-NEXT: store i32 [[TMP1]], ptr [[DOTADDR1]], align 4
3051 // CHECK3-NEXT: store ptr [[TMP2]], ptr [[DOTADDR2]], align 4
3052 // CHECK3-NEXT: [[TMP3:%.*]] = load ptr, ptr [[DOTADDR]], align 4
3053 // CHECK3-NEXT: [[TMP4:%.*]] = load i32, ptr [[DOTADDR1]], align 4
3054 // CHECK3-NEXT: [[TMP5:%.*]] = getelementptr inbounds [2 x ptr], ptr [[DOTOMP_REDUCTION_RED_LIST]], i32 0, i32 0
3055 // CHECK3-NEXT: [[TMP6:%.*]] = getelementptr inbounds [[STRUCT__GLOBALIZED_LOCALS_TY_0:%.*]], ptr [[TMP3]], i32 [[TMP4]]
3056 // CHECK3-NEXT: [[C:%.*]] = getelementptr inbounds [[STRUCT__GLOBALIZED_LOCALS_TY_0]], ptr [[TMP6]], i32 0, i32 0
3057 // CHECK3-NEXT: store ptr [[C]], ptr [[TMP5]], align 4
3058 // CHECK3-NEXT: [[TMP7:%.*]] = getelementptr inbounds [2 x ptr], ptr [[DOTOMP_REDUCTION_RED_LIST]], i32 0, i32 1
3059 // CHECK3-NEXT: [[TMP8:%.*]] = getelementptr inbounds [[STRUCT__GLOBALIZED_LOCALS_TY_0]], ptr [[TMP3]], i32 [[TMP4]]
3060 // CHECK3-NEXT: [[D:%.*]] = getelementptr inbounds [[STRUCT__GLOBALIZED_LOCALS_TY_0]], ptr [[TMP8]], i32 0, i32 1
3061 // CHECK3-NEXT: store ptr [[D]], ptr [[TMP7]], align 4
3062 // CHECK3-NEXT: [[TMP9:%.*]] = load ptr, ptr [[DOTADDR2]], align 4
3063 // CHECK3-NEXT: call void @"{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z9ftemplateIcET_i_l26_omp_outlined_omp$reduction$reduction_func"(ptr [[TMP9]], ptr [[DOTOMP_REDUCTION_RED_LIST]]) #[[ATTR4]]
3064 // CHECK3-NEXT: ret void
3067 // CHECK3-LABEL: define {{[^@]+}}@{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z9ftemplateIcET_i_l33
3068 // CHECK3-SAME: (ptr noalias noundef [[DYN_PTR:%.*]], i32 noundef [[A:%.*]], i32 noundef [[B:%.*]]) #[[ATTR0]] {
3069 // CHECK3-NEXT: entry:
3070 // CHECK3-NEXT: [[DYN_PTR_ADDR:%.*]] = alloca ptr, align 4
3071 // CHECK3-NEXT: [[A_ADDR:%.*]] = alloca i32, align 4
3072 // CHECK3-NEXT: [[B_ADDR:%.*]] = alloca i32, align 4
3073 // CHECK3-NEXT: [[DOTZERO_ADDR:%.*]] = alloca i32, align 4
3074 // CHECK3-NEXT: [[DOTTHREADID_TEMP_:%.*]] = alloca i32, align 4
3075 // CHECK3-NEXT: store ptr [[DYN_PTR]], ptr [[DYN_PTR_ADDR]], align 4
3076 // CHECK3-NEXT: store i32 [[A]], ptr [[A_ADDR]], align 4
3077 // CHECK3-NEXT: store i32 [[B]], ptr [[B_ADDR]], align 4
3078 // CHECK3-NEXT: [[TMP0:%.*]] = call i32 @__kmpc_target_init(ptr @{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z9ftemplateIcET_i_l33_kernel_environment, ptr [[DYN_PTR]])
3079 // CHECK3-NEXT: [[EXEC_USER_CODE:%.*]] = icmp eq i32 [[TMP0]], -1
3080 // CHECK3-NEXT: br i1 [[EXEC_USER_CODE]], label [[USER_CODE_ENTRY:%.*]], label [[WORKER_EXIT:%.*]]
3081 // CHECK3: user_code.entry:
3082 // CHECK3-NEXT: [[TMP1:%.*]] = call i32 @__kmpc_global_thread_num(ptr @[[GLOB1]])
3083 // CHECK3-NEXT: store i32 0, ptr [[DOTZERO_ADDR]], align 4
3084 // CHECK3-NEXT: store i32 [[TMP1]], ptr [[DOTTHREADID_TEMP_]], align 4
3085 // CHECK3-NEXT: call void @{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z9ftemplateIcET_i_l33_omp_outlined(ptr [[DOTTHREADID_TEMP_]], ptr [[DOTZERO_ADDR]], ptr [[A_ADDR]], ptr [[B_ADDR]]) #[[ATTR4]]
3086 // CHECK3-NEXT: call void @__kmpc_target_deinit()
3087 // CHECK3-NEXT: ret void
3088 // CHECK3: worker.exit:
3089 // CHECK3-NEXT: ret void
3092 // CHECK3-LABEL: define {{[^@]+}}@{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z9ftemplateIcET_i_l33_omp_outlined
3093 // CHECK3-SAME: (ptr noalias noundef [[DOTGLOBAL_TID_:%.*]], ptr noalias noundef [[DOTBOUND_TID_:%.*]], ptr noundef nonnull align 4 dereferenceable(4) [[A:%.*]], ptr noundef nonnull align 2 dereferenceable(2) [[B:%.*]]) #[[ATTR1]] {
3094 // CHECK3-NEXT: entry:
3095 // CHECK3-NEXT: [[DOTGLOBAL_TID__ADDR:%.*]] = alloca ptr, align 4
3096 // CHECK3-NEXT: [[DOTBOUND_TID__ADDR:%.*]] = alloca ptr, align 4
3097 // CHECK3-NEXT: [[A_ADDR:%.*]] = alloca ptr, align 4
3098 // CHECK3-NEXT: [[B_ADDR:%.*]] = alloca ptr, align 4
3099 // CHECK3-NEXT: [[A1:%.*]] = alloca i32, align 4
3100 // CHECK3-NEXT: [[B2:%.*]] = alloca i16, align 2
3101 // CHECK3-NEXT: [[CAPTURED_VARS_ADDRS:%.*]] = alloca [2 x ptr], align 4
3102 // CHECK3-NEXT: [[DOTOMP_REDUCTION_RED_LIST:%.*]] = alloca [2 x ptr], align 4
3103 // CHECK3-NEXT: store ptr [[DOTGLOBAL_TID_]], ptr [[DOTGLOBAL_TID__ADDR]], align 4
3104 // CHECK3-NEXT: store ptr [[DOTBOUND_TID_]], ptr [[DOTBOUND_TID__ADDR]], align 4
3105 // CHECK3-NEXT: store ptr [[A]], ptr [[A_ADDR]], align 4
3106 // CHECK3-NEXT: store ptr [[B]], ptr [[B_ADDR]], align 4
3107 // CHECK3-NEXT: [[TMP0:%.*]] = load ptr, ptr [[A_ADDR]], align 4
3108 // CHECK3-NEXT: [[TMP1:%.*]] = load ptr, ptr [[B_ADDR]], align 4
3109 // CHECK3-NEXT: store i32 0, ptr [[A1]], align 4
3110 // CHECK3-NEXT: store i16 -32768, ptr [[B2]], align 2
3111 // CHECK3-NEXT: [[TMP2:%.*]] = getelementptr inbounds [2 x ptr], ptr [[CAPTURED_VARS_ADDRS]], i32 0, i32 0
3112 // CHECK3-NEXT: store ptr [[A1]], ptr [[TMP2]], align 4
3113 // CHECK3-NEXT: [[TMP3:%.*]] = getelementptr inbounds [2 x ptr], ptr [[CAPTURED_VARS_ADDRS]], i32 0, i32 1
3114 // CHECK3-NEXT: store ptr [[B2]], ptr [[TMP3]], align 4
3115 // CHECK3-NEXT: [[TMP4:%.*]] = load ptr, ptr [[DOTGLOBAL_TID__ADDR]], align 4
3116 // CHECK3-NEXT: [[TMP5:%.*]] = load i32, ptr [[TMP4]], align 4
3117 // CHECK3-NEXT: call void @__kmpc_parallel_51(ptr @[[GLOB1]], i32 [[TMP5]], i32 1, i32 -1, i32 -1, ptr @{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z9ftemplateIcET_i_l33_omp_outlined_omp_outlined, ptr null, ptr [[CAPTURED_VARS_ADDRS]], i32 2)
3118 // CHECK3-NEXT: [[TMP6:%.*]] = getelementptr inbounds [2 x ptr], ptr [[DOTOMP_REDUCTION_RED_LIST]], i32 0, i32 0
3119 // CHECK3-NEXT: store ptr [[A1]], ptr [[TMP6]], align 4
3120 // CHECK3-NEXT: [[TMP7:%.*]] = getelementptr inbounds [2 x ptr], ptr [[DOTOMP_REDUCTION_RED_LIST]], i32 0, i32 1
3121 // CHECK3-NEXT: store ptr [[B2]], ptr [[TMP7]], align 4
3122 // CHECK3-NEXT: %"_openmp_teams_reductions_buffer_$_$ptr" = call ptr @__kmpc_reduction_get_fixed_buffer()
3123 // CHECK3-NEXT: [[TMP8:%.*]] = call i32 @__kmpc_nvptx_teams_reduce_nowait_v2(ptr @[[GLOB1]], ptr %"_openmp_teams_reductions_buffer_$_$ptr", i32 2048, i64 8, ptr [[DOTOMP_REDUCTION_RED_LIST]], ptr @_omp_reduction_shuffle_and_reduce_func9, ptr @_omp_reduction_inter_warp_copy_func10, ptr @_omp_reduction_list_to_global_copy_func11, ptr @_omp_reduction_list_to_global_reduce_func12, ptr @_omp_reduction_global_to_list_copy_func13, ptr @_omp_reduction_global_to_list_reduce_func14)
3124 // CHECK3-NEXT: [[TMP9:%.*]] = icmp eq i32 [[TMP8]], 1
3125 // CHECK3-NEXT: br i1 [[TMP9]], label [[DOTOMP_REDUCTION_THEN:%.*]], label [[DOTOMP_REDUCTION_DONE:%.*]]
3126 // CHECK3: .omp.reduction.then:
3127 // CHECK3-NEXT: [[TMP10:%.*]] = load i32, ptr [[TMP0]], align 4
3128 // CHECK3-NEXT: [[TMP11:%.*]] = load i32, ptr [[A1]], align 4
3129 // CHECK3-NEXT: [[OR:%.*]] = or i32 [[TMP10]], [[TMP11]]
3130 // CHECK3-NEXT: store i32 [[OR]], ptr [[TMP0]], align 4
3131 // CHECK3-NEXT: [[TMP12:%.*]] = load i16, ptr [[TMP1]], align 2
3132 // CHECK3-NEXT: [[CONV:%.*]] = sext i16 [[TMP12]] to i32
3133 // CHECK3-NEXT: [[TMP13:%.*]] = load i16, ptr [[B2]], align 2
3134 // CHECK3-NEXT: [[CONV3:%.*]] = sext i16 [[TMP13]] to i32
3135 // CHECK3-NEXT: [[CMP:%.*]] = icmp sgt i32 [[CONV]], [[CONV3]]
3136 // CHECK3-NEXT: br i1 [[CMP]], label [[COND_TRUE:%.*]], label [[COND_FALSE:%.*]]
3137 // CHECK3: cond.true:
3138 // CHECK3-NEXT: [[TMP14:%.*]] = load i16, ptr [[TMP1]], align 2
3139 // CHECK3-NEXT: br label [[COND_END:%.*]]
3140 // CHECK3: cond.false:
3141 // CHECK3-NEXT: [[TMP15:%.*]] = load i16, ptr [[B2]], align 2
3142 // CHECK3-NEXT: br label [[COND_END]]
3143 // CHECK3: cond.end:
3144 // CHECK3-NEXT: [[COND:%.*]] = phi i16 [ [[TMP14]], [[COND_TRUE]] ], [ [[TMP15]], [[COND_FALSE]] ]
3145 // CHECK3-NEXT: store i16 [[COND]], ptr [[TMP1]], align 2
3146 // CHECK3-NEXT: br label [[DOTOMP_REDUCTION_DONE]]
3147 // CHECK3: .omp.reduction.done:
3148 // CHECK3-NEXT: ret void
3151 // CHECK3-LABEL: define {{[^@]+}}@{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z9ftemplateIcET_i_l33_omp_outlined_omp_outlined
3152 // CHECK3-SAME: (ptr noalias noundef [[DOTGLOBAL_TID_:%.*]], ptr noalias noundef [[DOTBOUND_TID_:%.*]], ptr noundef nonnull align 4 dereferenceable(4) [[A:%.*]], ptr noundef nonnull align 2 dereferenceable(2) [[B:%.*]]) #[[ATTR1]] {
3153 // CHECK3-NEXT: entry:
3154 // CHECK3-NEXT: [[DOTGLOBAL_TID__ADDR:%.*]] = alloca ptr, align 4
3155 // CHECK3-NEXT: [[DOTBOUND_TID__ADDR:%.*]] = alloca ptr, align 4
3156 // CHECK3-NEXT: [[A_ADDR:%.*]] = alloca ptr, align 4
3157 // CHECK3-NEXT: [[B_ADDR:%.*]] = alloca ptr, align 4
3158 // CHECK3-NEXT: [[A1:%.*]] = alloca i32, align 4
3159 // CHECK3-NEXT: [[B2:%.*]] = alloca i16, align 2
3160 // CHECK3-NEXT: [[DOTOMP_REDUCTION_RED_LIST:%.*]] = alloca [2 x ptr], align 4
3161 // CHECK3-NEXT: store ptr [[DOTGLOBAL_TID_]], ptr [[DOTGLOBAL_TID__ADDR]], align 4
3162 // CHECK3-NEXT: store ptr [[DOTBOUND_TID_]], ptr [[DOTBOUND_TID__ADDR]], align 4
3163 // CHECK3-NEXT: store ptr [[A]], ptr [[A_ADDR]], align 4
3164 // CHECK3-NEXT: store ptr [[B]], ptr [[B_ADDR]], align 4
3165 // CHECK3-NEXT: [[TMP0:%.*]] = load ptr, ptr [[A_ADDR]], align 4
3166 // CHECK3-NEXT: [[TMP1:%.*]] = load ptr, ptr [[B_ADDR]], align 4
3167 // CHECK3-NEXT: store i32 0, ptr [[A1]], align 4
3168 // CHECK3-NEXT: store i16 -32768, ptr [[B2]], align 2
3169 // CHECK3-NEXT: [[TMP2:%.*]] = load i32, ptr [[A1]], align 4
3170 // CHECK3-NEXT: [[OR:%.*]] = or i32 [[TMP2]], 1
3171 // CHECK3-NEXT: store i32 [[OR]], ptr [[A1]], align 4
3172 // CHECK3-NEXT: [[TMP3:%.*]] = load i16, ptr [[B2]], align 2
3173 // CHECK3-NEXT: [[CONV:%.*]] = sext i16 [[TMP3]] to i32
3174 // CHECK3-NEXT: [[CMP:%.*]] = icmp sgt i32 99, [[CONV]]
3175 // CHECK3-NEXT: br i1 [[CMP]], label [[COND_TRUE:%.*]], label [[COND_FALSE:%.*]]
3176 // CHECK3: cond.true:
3177 // CHECK3-NEXT: br label [[COND_END:%.*]]
3178 // CHECK3: cond.false:
3179 // CHECK3-NEXT: [[TMP4:%.*]] = load i16, ptr [[B2]], align 2
3180 // CHECK3-NEXT: [[CONV3:%.*]] = sext i16 [[TMP4]] to i32
3181 // CHECK3-NEXT: br label [[COND_END]]
3182 // CHECK3: cond.end:
3183 // CHECK3-NEXT: [[COND:%.*]] = phi i32 [ 99, [[COND_TRUE]] ], [ [[CONV3]], [[COND_FALSE]] ]
3184 // CHECK3-NEXT: [[CONV4:%.*]] = trunc i32 [[COND]] to i16
3185 // CHECK3-NEXT: store i16 [[CONV4]], ptr [[B2]], align 2
3186 // CHECK3-NEXT: [[TMP5:%.*]] = getelementptr inbounds [2 x ptr], ptr [[DOTOMP_REDUCTION_RED_LIST]], i32 0, i32 0
3187 // CHECK3-NEXT: store ptr [[A1]], ptr [[TMP5]], align 4
3188 // CHECK3-NEXT: [[TMP6:%.*]] = getelementptr inbounds [2 x ptr], ptr [[DOTOMP_REDUCTION_RED_LIST]], i32 0, i32 1
3189 // CHECK3-NEXT: store ptr [[B2]], ptr [[TMP6]], align 4
3190 // CHECK3-NEXT: [[TMP7:%.*]] = call i32 @__kmpc_nvptx_parallel_reduce_nowait_v2(ptr @[[GLOB1]], i64 8, ptr [[DOTOMP_REDUCTION_RED_LIST]], ptr @_omp_reduction_shuffle_and_reduce_func7, ptr @_omp_reduction_inter_warp_copy_func8)
3191 // CHECK3-NEXT: [[TMP8:%.*]] = icmp eq i32 [[TMP7]], 1
3192 // CHECK3-NEXT: br i1 [[TMP8]], label [[DOTOMP_REDUCTION_THEN:%.*]], label [[DOTOMP_REDUCTION_DONE:%.*]]
3193 // CHECK3: .omp.reduction.then:
3194 // CHECK3-NEXT: [[TMP9:%.*]] = load i32, ptr [[TMP0]], align 4
3195 // CHECK3-NEXT: [[TMP10:%.*]] = load i32, ptr [[A1]], align 4
3196 // CHECK3-NEXT: [[OR5:%.*]] = or i32 [[TMP9]], [[TMP10]]
3197 // CHECK3-NEXT: store i32 [[OR5]], ptr [[TMP0]], align 4
3198 // CHECK3-NEXT: [[TMP11:%.*]] = load i16, ptr [[TMP1]], align 2
3199 // CHECK3-NEXT: [[CONV6:%.*]] = sext i16 [[TMP11]] to i32
3200 // CHECK3-NEXT: [[TMP12:%.*]] = load i16, ptr [[B2]], align 2
3201 // CHECK3-NEXT: [[CONV7:%.*]] = sext i16 [[TMP12]] to i32
3202 // CHECK3-NEXT: [[CMP8:%.*]] = icmp sgt i32 [[CONV6]], [[CONV7]]
3203 // CHECK3-NEXT: br i1 [[CMP8]], label [[COND_TRUE9:%.*]], label [[COND_FALSE10:%.*]]
3204 // CHECK3: cond.true9:
3205 // CHECK3-NEXT: [[TMP13:%.*]] = load i16, ptr [[TMP1]], align 2
3206 // CHECK3-NEXT: br label [[COND_END11:%.*]]
3207 // CHECK3: cond.false10:
3208 // CHECK3-NEXT: [[TMP14:%.*]] = load i16, ptr [[B2]], align 2
3209 // CHECK3-NEXT: br label [[COND_END11]]
3210 // CHECK3: cond.end11:
3211 // CHECK3-NEXT: [[COND12:%.*]] = phi i16 [ [[TMP13]], [[COND_TRUE9]] ], [ [[TMP14]], [[COND_FALSE10]] ]
3212 // CHECK3-NEXT: store i16 [[COND12]], ptr [[TMP1]], align 2
3213 // CHECK3-NEXT: br label [[DOTOMP_REDUCTION_DONE]]
3214 // CHECK3: .omp.reduction.done:
3215 // CHECK3-NEXT: ret void
3218 // CHECK3-LABEL: define {{[^@]+}}@_omp_reduction_shuffle_and_reduce_func7
3219 // CHECK3-SAME: (ptr noundef [[TMP0:%.*]], i16 noundef signext [[TMP1:%.*]], i16 noundef signext [[TMP2:%.*]], i16 noundef signext [[TMP3:%.*]]) #[[ATTR3]] {
3220 // CHECK3-NEXT: entry:
3221 // CHECK3-NEXT: [[DOTADDR:%.*]] = alloca ptr, align 4
3222 // CHECK3-NEXT: [[DOTADDR1:%.*]] = alloca i16, align 2
3223 // CHECK3-NEXT: [[DOTADDR2:%.*]] = alloca i16, align 2
3224 // CHECK3-NEXT: [[DOTADDR3:%.*]] = alloca i16, align 2
3225 // CHECK3-NEXT: [[DOTOMP_REDUCTION_REMOTE_REDUCE_LIST:%.*]] = alloca [2 x ptr], align 4
3226 // CHECK3-NEXT: [[DOTOMP_REDUCTION_ELEMENT:%.*]] = alloca i32, align 4
3227 // CHECK3-NEXT: [[DOTOMP_REDUCTION_ELEMENT4:%.*]] = alloca i16, align 2
3228 // CHECK3-NEXT: store ptr [[TMP0]], ptr [[DOTADDR]], align 4
3229 // CHECK3-NEXT: store i16 [[TMP1]], ptr [[DOTADDR1]], align 2
3230 // CHECK3-NEXT: store i16 [[TMP2]], ptr [[DOTADDR2]], align 2
3231 // CHECK3-NEXT: store i16 [[TMP3]], ptr [[DOTADDR3]], align 2
3232 // CHECK3-NEXT: [[TMP4:%.*]] = load ptr, ptr [[DOTADDR]], align 4
3233 // CHECK3-NEXT: [[TMP5:%.*]] = load i16, ptr [[DOTADDR1]], align 2
3234 // CHECK3-NEXT: [[TMP6:%.*]] = load i16, ptr [[DOTADDR2]], align 2
3235 // CHECK3-NEXT: [[TMP7:%.*]] = load i16, ptr [[DOTADDR3]], align 2
3236 // CHECK3-NEXT: [[TMP8:%.*]] = getelementptr inbounds [2 x ptr], ptr [[TMP4]], i32 0, i32 0
3237 // CHECK3-NEXT: [[TMP9:%.*]] = load ptr, ptr [[TMP8]], align 4
3238 // CHECK3-NEXT: [[TMP10:%.*]] = getelementptr inbounds [2 x ptr], ptr [[DOTOMP_REDUCTION_REMOTE_REDUCE_LIST]], i32 0, i32 0
3239 // CHECK3-NEXT: [[TMP11:%.*]] = getelementptr i32, ptr [[TMP9]], i32 1
3240 // CHECK3-NEXT: [[TMP12:%.*]] = load i32, ptr [[TMP9]], align 4
3241 // CHECK3-NEXT: [[TMP13:%.*]] = call i32 @__kmpc_get_warp_size()
3242 // CHECK3-NEXT: [[TMP14:%.*]] = trunc i32 [[TMP13]] to i16
3243 // CHECK3-NEXT: [[TMP15:%.*]] = call i32 @__kmpc_shuffle_int32(i32 [[TMP12]], i16 [[TMP6]], i16 [[TMP14]])
3244 // CHECK3-NEXT: store i32 [[TMP15]], ptr [[DOTOMP_REDUCTION_ELEMENT]], align 4
3245 // CHECK3-NEXT: [[TMP16:%.*]] = getelementptr i32, ptr [[TMP9]], i32 1
3246 // CHECK3-NEXT: [[TMP17:%.*]] = getelementptr i32, ptr [[DOTOMP_REDUCTION_ELEMENT]], i32 1
3247 // CHECK3-NEXT: store ptr [[DOTOMP_REDUCTION_ELEMENT]], ptr [[TMP10]], align 4
3248 // CHECK3-NEXT: [[TMP18:%.*]] = getelementptr inbounds [2 x ptr], ptr [[TMP4]], i32 0, i32 1
3249 // CHECK3-NEXT: [[TMP19:%.*]] = load ptr, ptr [[TMP18]], align 4
3250 // CHECK3-NEXT: [[TMP20:%.*]] = getelementptr inbounds [2 x ptr], ptr [[DOTOMP_REDUCTION_REMOTE_REDUCE_LIST]], i32 0, i32 1
3251 // CHECK3-NEXT: [[TMP21:%.*]] = getelementptr i16, ptr [[TMP19]], i32 1
3252 // CHECK3-NEXT: [[TMP22:%.*]] = load i16, ptr [[TMP19]], align 2
3253 // CHECK3-NEXT: [[TMP23:%.*]] = sext i16 [[TMP22]] to i32
3254 // CHECK3-NEXT: [[TMP24:%.*]] = call i32 @__kmpc_get_warp_size()
3255 // CHECK3-NEXT: [[TMP25:%.*]] = trunc i32 [[TMP24]] to i16
3256 // CHECK3-NEXT: [[TMP26:%.*]] = call i32 @__kmpc_shuffle_int32(i32 [[TMP23]], i16 [[TMP6]], i16 [[TMP25]])
3257 // CHECK3-NEXT: [[TMP27:%.*]] = trunc i32 [[TMP26]] to i16
3258 // CHECK3-NEXT: store i16 [[TMP27]], ptr [[DOTOMP_REDUCTION_ELEMENT4]], align 2
3259 // CHECK3-NEXT: [[TMP28:%.*]] = getelementptr i16, ptr [[TMP19]], i32 1
3260 // CHECK3-NEXT: [[TMP29:%.*]] = getelementptr i16, ptr [[DOTOMP_REDUCTION_ELEMENT4]], i32 1
3261 // CHECK3-NEXT: store ptr [[DOTOMP_REDUCTION_ELEMENT4]], ptr [[TMP20]], align 4
3262 // CHECK3-NEXT: [[TMP30:%.*]] = icmp eq i16 [[TMP7]], 0
3263 // CHECK3-NEXT: [[TMP31:%.*]] = icmp eq i16 [[TMP7]], 1
3264 // CHECK3-NEXT: [[TMP32:%.*]] = icmp ult i16 [[TMP5]], [[TMP6]]
3265 // CHECK3-NEXT: [[TMP33:%.*]] = and i1 [[TMP31]], [[TMP32]]
3266 // CHECK3-NEXT: [[TMP34:%.*]] = icmp eq i16 [[TMP7]], 2
3267 // CHECK3-NEXT: [[TMP35:%.*]] = and i16 [[TMP5]], 1
3268 // CHECK3-NEXT: [[TMP36:%.*]] = icmp eq i16 [[TMP35]], 0
3269 // CHECK3-NEXT: [[TMP37:%.*]] = and i1 [[TMP34]], [[TMP36]]
3270 // CHECK3-NEXT: [[TMP38:%.*]] = icmp sgt i16 [[TMP6]], 0
3271 // CHECK3-NEXT: [[TMP39:%.*]] = and i1 [[TMP37]], [[TMP38]]
3272 // CHECK3-NEXT: [[TMP40:%.*]] = or i1 [[TMP30]], [[TMP33]]
3273 // CHECK3-NEXT: [[TMP41:%.*]] = or i1 [[TMP40]], [[TMP39]]
3274 // CHECK3-NEXT: br i1 [[TMP41]], label [[THEN:%.*]], label [[ELSE:%.*]]
3275 // CHECK3: then:
3276 // CHECK3-NEXT: call void @"{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z9ftemplateIcET_i_l33_omp_outlined_omp_outlined_omp$reduction$reduction_func"(ptr [[TMP4]], ptr [[DOTOMP_REDUCTION_REMOTE_REDUCE_LIST]]) #[[ATTR4]]
3277 // CHECK3-NEXT: br label [[IFCONT:%.*]]
3278 // CHECK3: else:
3279 // CHECK3-NEXT: br label [[IFCONT]]
3280 // CHECK3: ifcont:
3281 // CHECK3-NEXT: [[TMP42:%.*]] = icmp eq i16 [[TMP7]], 1
3282 // CHECK3-NEXT: [[TMP43:%.*]] = icmp uge i16 [[TMP5]], [[TMP6]]
3283 // CHECK3-NEXT: [[TMP44:%.*]] = and i1 [[TMP42]], [[TMP43]]
3284 // CHECK3-NEXT: br i1 [[TMP44]], label [[THEN5:%.*]], label [[ELSE6:%.*]]
3285 // CHECK3: then5:
3286 // CHECK3-NEXT: [[TMP45:%.*]] = getelementptr inbounds [2 x ptr], ptr [[DOTOMP_REDUCTION_REMOTE_REDUCE_LIST]], i32 0, i32 0
3287 // CHECK3-NEXT: [[TMP46:%.*]] = load ptr, ptr [[TMP45]], align 4
3288 // CHECK3-NEXT: [[TMP47:%.*]] = getelementptr inbounds [2 x ptr], ptr [[TMP4]], i32 0, i32 0
3289 // CHECK3-NEXT: [[TMP48:%.*]] = load ptr, ptr [[TMP47]], align 4
3290 // CHECK3-NEXT: [[TMP49:%.*]] = load i32, ptr [[TMP46]], align 4
3291 // CHECK3-NEXT: store i32 [[TMP49]], ptr [[TMP48]], align 4
3292 // CHECK3-NEXT: [[TMP50:%.*]] = getelementptr inbounds [2 x ptr], ptr [[DOTOMP_REDUCTION_REMOTE_REDUCE_LIST]], i32 0, i32 1
3293 // CHECK3-NEXT: [[TMP51:%.*]] = load ptr, ptr [[TMP50]], align 4
3294 // CHECK3-NEXT: [[TMP52:%.*]] = getelementptr inbounds [2 x ptr], ptr [[TMP4]], i32 0, i32 1
3295 // CHECK3-NEXT: [[TMP53:%.*]] = load ptr, ptr [[TMP52]], align 4
3296 // CHECK3-NEXT: [[TMP54:%.*]] = load i16, ptr [[TMP51]], align 2
3297 // CHECK3-NEXT: store i16 [[TMP54]], ptr [[TMP53]], align 2
3298 // CHECK3-NEXT: br label [[IFCONT7:%.*]]
3299 // CHECK3: else6:
3300 // CHECK3-NEXT: br label [[IFCONT7]]
3301 // CHECK3: ifcont7:
3302 // CHECK3-NEXT: ret void
3305 // CHECK3-LABEL: define {{[^@]+}}@_omp_reduction_inter_warp_copy_func8
3306 // CHECK3-SAME: (ptr noundef [[TMP0:%.*]], i32 noundef [[TMP1:%.*]]) #[[ATTR3]] {
3307 // CHECK3-NEXT: entry:
3308 // CHECK3-NEXT: [[DOTADDR:%.*]] = alloca ptr, align 4
3309 // CHECK3-NEXT: [[DOTADDR1:%.*]] = alloca i32, align 4
3310 // CHECK3-NEXT: store ptr [[TMP0]], ptr [[DOTADDR]], align 4
3311 // CHECK3-NEXT: store i32 [[TMP1]], ptr [[DOTADDR1]], align 4
3312 // CHECK3-NEXT: [[TMP3:%.*]] = call i32 @__kmpc_get_hardware_thread_id_in_block()
3313 // CHECK3-NEXT: [[TMP4:%.*]] = call i32 @__kmpc_get_hardware_thread_id_in_block()
3314 // CHECK3-NEXT: [[NVPTX_LANE_ID:%.*]] = and i32 [[TMP4]], 31
3315 // CHECK3-NEXT: [[TMP5:%.*]] = call i32 @__kmpc_get_hardware_thread_id_in_block()
3316 // CHECK3-NEXT: [[NVPTX_WARP_ID:%.*]] = ashr i32 [[TMP5]], 5
3317 // CHECK3-NEXT: [[TMP6:%.*]] = load ptr, ptr [[DOTADDR]], align 4
3318 // CHECK3-NEXT: [[TMP2:%.*]] = call i32 @__kmpc_global_thread_num(ptr @[[GLOB1]])
3319 // CHECK3-NEXT: call void @__kmpc_barrier(ptr @[[GLOB2]], i32 [[TMP2]])
3320 // CHECK3-NEXT: [[WARP_MASTER:%.*]] = icmp eq i32 [[NVPTX_LANE_ID]], 0
3321 // CHECK3-NEXT: br i1 [[WARP_MASTER]], label [[THEN:%.*]], label [[ELSE:%.*]]
3322 // CHECK3: then:
3323 // CHECK3-NEXT: [[TMP7:%.*]] = getelementptr inbounds [2 x ptr], ptr [[TMP6]], i32 0, i32 0
3324 // CHECK3-NEXT: [[TMP8:%.*]] = load ptr, ptr [[TMP7]], align 4
3325 // CHECK3-NEXT: [[TMP9:%.*]] = getelementptr inbounds [32 x i32], ptr addrspace(3) @__openmp_nvptx_data_transfer_temporary_storage, i64 0, i32 [[NVPTX_WARP_ID]]
3326 // CHECK3-NEXT: [[TMP10:%.*]] = load i32, ptr [[TMP8]], align 4
3327 // CHECK3-NEXT: store volatile i32 [[TMP10]], ptr addrspace(3) [[TMP9]], align 4
3328 // CHECK3-NEXT: br label [[IFCONT:%.*]]
3329 // CHECK3: else:
3330 // CHECK3-NEXT: br label [[IFCONT]]
3331 // CHECK3: ifcont:
3332 // CHECK3-NEXT: [[TMP2:%.*]] = call i32 @__kmpc_global_thread_num(ptr @[[GLOB1]])
3333 // CHECK3-NEXT: call void @__kmpc_barrier(ptr @[[GLOB2]], i32 [[TMP2]])
3334 // CHECK3-NEXT: [[TMP11:%.*]] = load i32, ptr [[DOTADDR1]], align 4
3335 // CHECK3-NEXT: [[IS_ACTIVE_THREAD:%.*]] = icmp ult i32 [[TMP3]], [[TMP11]]
3336 // CHECK3-NEXT: br i1 [[IS_ACTIVE_THREAD]], label [[THEN2:%.*]], label [[ELSE3:%.*]]
3337 // CHECK3: then3:
3338 // CHECK3-NEXT: [[TMP12:%.*]] = getelementptr inbounds [32 x i32], ptr addrspace(3) @__openmp_nvptx_data_transfer_temporary_storage, i64 0, i32 [[TMP3]]
3339 // CHECK3-NEXT: [[TMP13:%.*]] = getelementptr inbounds [2 x ptr], ptr [[TMP6]], i32 0, i32 0
3340 // CHECK3-NEXT: [[TMP14:%.*]] = load ptr, ptr [[TMP13]], align 4
3341 // CHECK3-NEXT: [[TMP15:%.*]] = load volatile i32, ptr addrspace(3) [[TMP12]], align 4
3342 // CHECK3-NEXT: store i32 [[TMP15]], ptr [[TMP14]], align 4
3343 // CHECK3-NEXT: br label [[IFCONT4:%.*]]
3344 // CHECK3: else4:
3345 // CHECK3-NEXT: br label [[IFCONT4]]
3346 // CHECK3: ifcont5:
3347 // CHECK3-NEXT: [[TMP2:%.*]] = call i32 @__kmpc_global_thread_num(ptr @[[GLOB1]])
3348 // CHECK3-NEXT: call void @__kmpc_barrier(ptr @[[GLOB2]], i32 [[TMP2]])
3349 // CHECK3-NEXT: [[WARP_MASTER5:%.*]] = icmp eq i32 [[NVPTX_LANE_ID]], 0
3350 // CHECK3-NEXT: br i1 [[WARP_MASTER5]], label [[THEN6:%.*]], label [[ELSE7:%.*]]
3351 // CHECK3: then8:
3352 // CHECK3-NEXT: [[TMP16:%.*]] = getelementptr inbounds [2 x ptr], ptr [[TMP6]], i32 0, i32 1
3353 // CHECK3-NEXT: [[TMP17:%.*]] = load ptr, ptr [[TMP16]], align 4
3354 // CHECK3-NEXT: [[TMP18:%.*]] = getelementptr inbounds [32 x i32], ptr addrspace(3) @__openmp_nvptx_data_transfer_temporary_storage, i64 0, i32 [[NVPTX_WARP_ID]]
3355 // CHECK3-NEXT: [[TMP19:%.*]] = load i16, ptr [[TMP17]], align 2
3356 // CHECK3-NEXT: store volatile i16 [[TMP19]], ptr addrspace(3) [[TMP18]], align 2
3357 // CHECK3-NEXT: br label [[IFCONT8:%.*]]
3358 // CHECK3: else9:
3359 // CHECK3-NEXT: br label [[IFCONT8]]
3360 // CHECK3: ifcont10:
3361 // CHECK3-NEXT: [[TMP2:%.*]] = call i32 @__kmpc_global_thread_num(ptr @[[GLOB1]])
3362 // CHECK3-NEXT: call void @__kmpc_barrier(ptr @[[GLOB2]], i32 [[TMP2]])
3363 // CHECK3-NEXT: [[TMP20:%.*]] = load i32, ptr [[DOTADDR1]], align 4
3364 // CHECK3-NEXT: [[IS_ACTIVE_THREAD9:%.*]] = icmp ult i32 [[TMP3]], [[TMP20]]
3365 // CHECK3-NEXT: br i1 [[IS_ACTIVE_THREAD9]], label [[THEN10:%.*]], label [[ELSE11:%.*]]
3366 // CHECK3: then13:
3367 // CHECK3-NEXT: [[TMP21:%.*]] = getelementptr inbounds [32 x i32], ptr addrspace(3) @__openmp_nvptx_data_transfer_temporary_storage, i64 0, i32 [[TMP3]]
3368 // CHECK3-NEXT: [[TMP22:%.*]] = getelementptr inbounds [2 x ptr], ptr [[TMP6]], i32 0, i32 1
3369 // CHECK3-NEXT: [[TMP23:%.*]] = load ptr, ptr [[TMP22]], align 4
3370 // CHECK3-NEXT: [[TMP24:%.*]] = load volatile i16, ptr addrspace(3) [[TMP21]], align 2
3371 // CHECK3-NEXT: store i16 [[TMP24]], ptr [[TMP23]], align 2
3372 // CHECK3-NEXT: br label [[IFCONT12:%.*]]
3373 // CHECK3: else14:
3374 // CHECK3-NEXT: br label [[IFCONT12]]
3375 // CHECK3: ifcont15:
3376 // CHECK3-NEXT: ret void
3379 // CHECK3-LABEL: define {{[^@]+}}@_omp_reduction_shuffle_and_reduce_func9
3380 // CHECK3-SAME: (ptr noundef [[TMP0:%.*]], i16 noundef signext [[TMP1:%.*]], i16 noundef signext [[TMP2:%.*]], i16 noundef signext [[TMP3:%.*]]) #[[ATTR3]] {
3381 // CHECK3-NEXT: entry:
3382 // CHECK3-NEXT: [[DOTADDR:%.*]] = alloca ptr, align 4
3383 // CHECK3-NEXT: [[DOTADDR1:%.*]] = alloca i16, align 2
3384 // CHECK3-NEXT: [[DOTADDR2:%.*]] = alloca i16, align 2
3385 // CHECK3-NEXT: [[DOTADDR3:%.*]] = alloca i16, align 2
3386 // CHECK3-NEXT: [[DOTOMP_REDUCTION_REMOTE_REDUCE_LIST:%.*]] = alloca [2 x ptr], align 4
3387 // CHECK3-NEXT: [[DOTOMP_REDUCTION_ELEMENT:%.*]] = alloca i32, align 4
3388 // CHECK3-NEXT: [[DOTOMP_REDUCTION_ELEMENT4:%.*]] = alloca i16, align 2
3389 // CHECK3-NEXT: store ptr [[TMP0]], ptr [[DOTADDR]], align 4
3390 // CHECK3-NEXT: store i16 [[TMP1]], ptr [[DOTADDR1]], align 2
3391 // CHECK3-NEXT: store i16 [[TMP2]], ptr [[DOTADDR2]], align 2
3392 // CHECK3-NEXT: store i16 [[TMP3]], ptr [[DOTADDR3]], align 2
3393 // CHECK3-NEXT: [[TMP4:%.*]] = load ptr, ptr [[DOTADDR]], align 4
3394 // CHECK3-NEXT: [[TMP5:%.*]] = load i16, ptr [[DOTADDR1]], align 2
3395 // CHECK3-NEXT: [[TMP6:%.*]] = load i16, ptr [[DOTADDR2]], align 2
3396 // CHECK3-NEXT: [[TMP7:%.*]] = load i16, ptr [[DOTADDR3]], align 2
3397 // CHECK3-NEXT: [[TMP8:%.*]] = getelementptr inbounds [2 x ptr], ptr [[TMP4]], i32 0, i32 0
3398 // CHECK3-NEXT: [[TMP9:%.*]] = load ptr, ptr [[TMP8]], align 4
3399 // CHECK3-NEXT: [[TMP10:%.*]] = getelementptr inbounds [2 x ptr], ptr [[DOTOMP_REDUCTION_REMOTE_REDUCE_LIST]], i32 0, i32 0
3400 // CHECK3-NEXT: [[TMP11:%.*]] = getelementptr i32, ptr [[TMP9]], i32 1
3401 // CHECK3-NEXT: [[TMP12:%.*]] = load i32, ptr [[TMP9]], align 4
3402 // CHECK3-NEXT: [[TMP13:%.*]] = call i32 @__kmpc_get_warp_size()
3403 // CHECK3-NEXT: [[TMP14:%.*]] = trunc i32 [[TMP13]] to i16
3404 // CHECK3-NEXT: [[TMP15:%.*]] = call i32 @__kmpc_shuffle_int32(i32 [[TMP12]], i16 [[TMP6]], i16 [[TMP14]])
3405 // CHECK3-NEXT: store i32 [[TMP15]], ptr [[DOTOMP_REDUCTION_ELEMENT]], align 4
3406 // CHECK3-NEXT: [[TMP16:%.*]] = getelementptr i32, ptr [[TMP9]], i32 1
3407 // CHECK3-NEXT: [[TMP17:%.*]] = getelementptr i32, ptr [[DOTOMP_REDUCTION_ELEMENT]], i32 1
3408 // CHECK3-NEXT: store ptr [[DOTOMP_REDUCTION_ELEMENT]], ptr [[TMP10]], align 4
3409 // CHECK3-NEXT: [[TMP18:%.*]] = getelementptr inbounds [2 x ptr], ptr [[TMP4]], i32 0, i32 1
3410 // CHECK3-NEXT: [[TMP19:%.*]] = load ptr, ptr [[TMP18]], align 4
3411 // CHECK3-NEXT: [[TMP20:%.*]] = getelementptr inbounds [2 x ptr], ptr [[DOTOMP_REDUCTION_REMOTE_REDUCE_LIST]], i32 0, i32 1
3412 // CHECK3-NEXT: [[TMP21:%.*]] = getelementptr i16, ptr [[TMP19]], i32 1
3413 // CHECK3-NEXT: [[TMP22:%.*]] = load i16, ptr [[TMP19]], align 2
3414 // CHECK3-NEXT: [[TMP23:%.*]] = sext i16 [[TMP22]] to i32
3415 // CHECK3-NEXT: [[TMP24:%.*]] = call i32 @__kmpc_get_warp_size()
3416 // CHECK3-NEXT: [[TMP25:%.*]] = trunc i32 [[TMP24]] to i16
3417 // CHECK3-NEXT: [[TMP26:%.*]] = call i32 @__kmpc_shuffle_int32(i32 [[TMP23]], i16 [[TMP6]], i16 [[TMP25]])
3418 // CHECK3-NEXT: [[TMP27:%.*]] = trunc i32 [[TMP26]] to i16
3419 // CHECK3-NEXT: store i16 [[TMP27]], ptr [[DOTOMP_REDUCTION_ELEMENT4]], align 2
3420 // CHECK3-NEXT: [[TMP28:%.*]] = getelementptr i16, ptr [[TMP19]], i32 1
3421 // CHECK3-NEXT: [[TMP29:%.*]] = getelementptr i16, ptr [[DOTOMP_REDUCTION_ELEMENT4]], i32 1
3422 // CHECK3-NEXT: store ptr [[DOTOMP_REDUCTION_ELEMENT4]], ptr [[TMP20]], align 4
3423 // CHECK3-NEXT: [[TMP30:%.*]] = icmp eq i16 [[TMP7]], 0
3424 // CHECK3-NEXT: [[TMP31:%.*]] = icmp eq i16 [[TMP7]], 1
3425 // CHECK3-NEXT: [[TMP32:%.*]] = icmp ult i16 [[TMP5]], [[TMP6]]
3426 // CHECK3-NEXT: [[TMP33:%.*]] = and i1 [[TMP31]], [[TMP32]]
3427 // CHECK3-NEXT: [[TMP34:%.*]] = icmp eq i16 [[TMP7]], 2
3428 // CHECK3-NEXT: [[TMP35:%.*]] = and i16 [[TMP5]], 1
3429 // CHECK3-NEXT: [[TMP36:%.*]] = icmp eq i16 [[TMP35]], 0
3430 // CHECK3-NEXT: [[TMP37:%.*]] = and i1 [[TMP34]], [[TMP36]]
3431 // CHECK3-NEXT: [[TMP38:%.*]] = icmp sgt i16 [[TMP6]], 0
3432 // CHECK3-NEXT: [[TMP39:%.*]] = and i1 [[TMP37]], [[TMP38]]
3433 // CHECK3-NEXT: [[TMP40:%.*]] = or i1 [[TMP30]], [[TMP33]]
3434 // CHECK3-NEXT: [[TMP41:%.*]] = or i1 [[TMP40]], [[TMP39]]
3435 // CHECK3-NEXT: br i1 [[TMP41]], label [[THEN:%.*]], label [[ELSE:%.*]]
3436 // CHECK3: then:
3437 // CHECK3-NEXT: call void @"{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z9ftemplateIcET_i_l33_omp_outlined_omp$reduction$reduction_func"(ptr [[TMP4]], ptr [[DOTOMP_REDUCTION_REMOTE_REDUCE_LIST]]) #[[ATTR4]]
3438 // CHECK3-NEXT: br label [[IFCONT:%.*]]
3439 // CHECK3: else:
3440 // CHECK3-NEXT: br label [[IFCONT]]
3441 // CHECK3: ifcont:
3442 // CHECK3-NEXT: [[TMP42:%.*]] = icmp eq i16 [[TMP7]], 1
3443 // CHECK3-NEXT: [[TMP43:%.*]] = icmp uge i16 [[TMP5]], [[TMP6]]
3444 // CHECK3-NEXT: [[TMP44:%.*]] = and i1 [[TMP42]], [[TMP43]]
3445 // CHECK3-NEXT: br i1 [[TMP44]], label [[THEN5:%.*]], label [[ELSE6:%.*]]
3446 // CHECK3: then5:
3447 // CHECK3-NEXT: [[TMP45:%.*]] = getelementptr inbounds [2 x ptr], ptr [[DOTOMP_REDUCTION_REMOTE_REDUCE_LIST]], i32 0, i32 0
3448 // CHECK3-NEXT: [[TMP46:%.*]] = load ptr, ptr [[TMP45]], align 4
3449 // CHECK3-NEXT: [[TMP47:%.*]] = getelementptr inbounds [2 x ptr], ptr [[TMP4]], i32 0, i32 0
3450 // CHECK3-NEXT: [[TMP48:%.*]] = load ptr, ptr [[TMP47]], align 4
3451 // CHECK3-NEXT: [[TMP49:%.*]] = load i32, ptr [[TMP46]], align 4
3452 // CHECK3-NEXT: store i32 [[TMP49]], ptr [[TMP48]], align 4
3453 // CHECK3-NEXT: [[TMP50:%.*]] = getelementptr inbounds [2 x ptr], ptr [[DOTOMP_REDUCTION_REMOTE_REDUCE_LIST]], i32 0, i32 1
3454 // CHECK3-NEXT: [[TMP51:%.*]] = load ptr, ptr [[TMP50]], align 4
3455 // CHECK3-NEXT: [[TMP52:%.*]] = getelementptr inbounds [2 x ptr], ptr [[TMP4]], i32 0, i32 1
3456 // CHECK3-NEXT: [[TMP53:%.*]] = load ptr, ptr [[TMP52]], align 4
3457 // CHECK3-NEXT: [[TMP54:%.*]] = load i16, ptr [[TMP51]], align 2
3458 // CHECK3-NEXT: store i16 [[TMP54]], ptr [[TMP53]], align 2
3459 // CHECK3-NEXT: br label [[IFCONT7:%.*]]
3460 // CHECK3: else6:
3461 // CHECK3-NEXT: br label [[IFCONT7]]
3462 // CHECK3: ifcont7:
3463 // CHECK3-NEXT: ret void
3466 // CHECK3-LABEL: define {{[^@]+}}@_omp_reduction_inter_warp_copy_func10
3467 // CHECK3-SAME: (ptr noundef [[TMP0:%.*]], i32 noundef [[TMP1:%.*]]) #[[ATTR3]] {
3468 // CHECK3-NEXT: entry:
3469 // CHECK3-NEXT: [[DOTADDR:%.*]] = alloca ptr, align 4
3470 // CHECK3-NEXT: [[DOTADDR1:%.*]] = alloca i32, align 4
3471 // CHECK3-NEXT: store ptr [[TMP0]], ptr [[DOTADDR]], align 4
3472 // CHECK3-NEXT: store i32 [[TMP1]], ptr [[DOTADDR1]], align 4
3473 // CHECK3-NEXT: [[TMP3:%.*]] = call i32 @__kmpc_get_hardware_thread_id_in_block()
3474 // CHECK3-NEXT: [[TMP4:%.*]] = call i32 @__kmpc_get_hardware_thread_id_in_block()
3475 // CHECK3-NEXT: [[NVPTX_LANE_ID:%.*]] = and i32 [[TMP4]], 31
3476 // CHECK3-NEXT: [[TMP5:%.*]] = call i32 @__kmpc_get_hardware_thread_id_in_block()
3477 // CHECK3-NEXT: [[NVPTX_WARP_ID:%.*]] = ashr i32 [[TMP5]], 5
3478 // CHECK3-NEXT: [[TMP6:%.*]] = load ptr, ptr [[DOTADDR]], align 4
3479 // CHECK3-NEXT: [[TMP2:%.*]] = call i32 @__kmpc_global_thread_num(ptr @[[GLOB1]])
3480 // CHECK3-NEXT: call void @__kmpc_barrier(ptr @[[GLOB2]], i32 [[TMP2]])
3481 // CHECK3-NEXT: [[WARP_MASTER:%.*]] = icmp eq i32 [[NVPTX_LANE_ID]], 0
3482 // CHECK3-NEXT: br i1 [[WARP_MASTER]], label [[THEN:%.*]], label [[ELSE:%.*]]
3483 // CHECK3: then:
3484 // CHECK3-NEXT: [[TMP7:%.*]] = getelementptr inbounds [2 x ptr], ptr [[TMP6]], i32 0, i32 0
3485 // CHECK3-NEXT: [[TMP8:%.*]] = load ptr, ptr [[TMP7]], align 4
3486 // CHECK3-NEXT: [[TMP9:%.*]] = getelementptr inbounds [32 x i32], ptr addrspace(3) @__openmp_nvptx_data_transfer_temporary_storage, i64 0, i32 [[NVPTX_WARP_ID]]
3487 // CHECK3-NEXT: [[TMP10:%.*]] = load i32, ptr [[TMP8]], align 4
3488 // CHECK3-NEXT: store volatile i32 [[TMP10]], ptr addrspace(3) [[TMP9]], align 4
3489 // CHECK3-NEXT: br label [[IFCONT:%.*]]
3490 // CHECK3: else:
3491 // CHECK3-NEXT: br label [[IFCONT]]
3492 // CHECK3: ifcont:
3493 // CHECK3-NEXT: [[TMP2:%.*]] = call i32 @__kmpc_global_thread_num(ptr @[[GLOB1]])
3494 // CHECK3-NEXT: call void @__kmpc_barrier(ptr @[[GLOB2]], i32 [[TMP2]])
3495 // CHECK3-NEXT: [[TMP11:%.*]] = load i32, ptr [[DOTADDR1]], align 4
3496 // CHECK3-NEXT: [[IS_ACTIVE_THREAD:%.*]] = icmp ult i32 [[TMP3]], [[TMP11]]
3497 // CHECK3-NEXT: br i1 [[IS_ACTIVE_THREAD]], label [[THEN2:%.*]], label [[ELSE3:%.*]]
3498 // CHECK3: then3:
3499 // CHECK3-NEXT: [[TMP12:%.*]] = getelementptr inbounds [32 x i32], ptr addrspace(3) @__openmp_nvptx_data_transfer_temporary_storage, i64 0, i32 [[TMP3]]
3500 // CHECK3-NEXT: [[TMP13:%.*]] = getelementptr inbounds [2 x ptr], ptr [[TMP6]], i32 0, i32 0
3501 // CHECK3-NEXT: [[TMP14:%.*]] = load ptr, ptr [[TMP13]], align 4
3502 // CHECK3-NEXT: [[TMP15:%.*]] = load volatile i32, ptr addrspace(3) [[TMP12]], align 4
3503 // CHECK3-NEXT: store i32 [[TMP15]], ptr [[TMP14]], align 4
3504 // CHECK3-NEXT: br label [[IFCONT4:%.*]]
3505 // CHECK3: else4:
3506 // CHECK3-NEXT: br label [[IFCONT4]]
3507 // CHECK3: ifcont5:
3508 // CHECK3-NEXT: [[TMP2:%.*]] = call i32 @__kmpc_global_thread_num(ptr @[[GLOB1]])
3509 // CHECK3-NEXT: call void @__kmpc_barrier(ptr @[[GLOB2]], i32 [[TMP2]])
3510 // CHECK3-NEXT: [[WARP_MASTER5:%.*]] = icmp eq i32 [[NVPTX_LANE_ID]], 0
3511 // CHECK3-NEXT: br i1 [[WARP_MASTER5]], label [[THEN6:%.*]], label [[ELSE7:%.*]]
3512 // CHECK3: then8:
3513 // CHECK3-NEXT: [[TMP16:%.*]] = getelementptr inbounds [2 x ptr], ptr [[TMP6]], i32 0, i32 1
3514 // CHECK3-NEXT: [[TMP17:%.*]] = load ptr, ptr [[TMP16]], align 4
3515 // CHECK3-NEXT: [[TMP18:%.*]] = getelementptr inbounds [32 x i32], ptr addrspace(3) @__openmp_nvptx_data_transfer_temporary_storage, i64 0, i32 [[NVPTX_WARP_ID]]
3516 // CHECK3-NEXT: [[TMP19:%.*]] = load i16, ptr [[TMP17]], align 2
3517 // CHECK3-NEXT: store volatile i16 [[TMP19]], ptr addrspace(3) [[TMP18]], align 2
3518 // CHECK3-NEXT: br label [[IFCONT8:%.*]]
3519 // CHECK3: else9:
3520 // CHECK3-NEXT: br label [[IFCONT8]]
3521 // CHECK3: ifcont10:
3522 // CHECK3-NEXT: [[TMP2:%.*]] = call i32 @__kmpc_global_thread_num(ptr @[[GLOB1]])
3523 // CHECK3-NEXT: call void @__kmpc_barrier(ptr @[[GLOB2]], i32 [[TMP2]])
3524 // CHECK3-NEXT: [[TMP20:%.*]] = load i32, ptr [[DOTADDR1]], align 4
3525 // CHECK3-NEXT: [[IS_ACTIVE_THREAD9:%.*]] = icmp ult i32 [[TMP3]], [[TMP20]]
3526 // CHECK3-NEXT: br i1 [[IS_ACTIVE_THREAD9]], label [[THEN10:%.*]], label [[ELSE11:%.*]]
3527 // CHECK3: then13:
3528 // CHECK3-NEXT: [[TMP21:%.*]] = getelementptr inbounds [32 x i32], ptr addrspace(3) @__openmp_nvptx_data_transfer_temporary_storage, i64 0, i32 [[TMP3]]
3529 // CHECK3-NEXT: [[TMP22:%.*]] = getelementptr inbounds [2 x ptr], ptr [[TMP6]], i32 0, i32 1
3530 // CHECK3-NEXT: [[TMP23:%.*]] = load ptr, ptr [[TMP22]], align 4
3531 // CHECK3-NEXT: [[TMP24:%.*]] = load volatile i16, ptr addrspace(3) [[TMP21]], align 2
3532 // CHECK3-NEXT: store i16 [[TMP24]], ptr [[TMP23]], align 2
3533 // CHECK3-NEXT: br label [[IFCONT12:%.*]]
3534 // CHECK3: else14:
3535 // CHECK3-NEXT: br label [[IFCONT12]]
3536 // CHECK3: ifcont15:
3537 // CHECK3-NEXT: ret void
3540 // CHECK3-LABEL: define {{[^@]+}}@_omp_reduction_list_to_global_copy_func11
3541 // CHECK3-SAME: (ptr noundef [[TMP0:%.*]], i32 noundef [[TMP1:%.*]], ptr noundef [[TMP2:%.*]]) #[[ATTR3]] {
3542 // CHECK3-NEXT: entry:
3543 // CHECK3-NEXT: [[DOTADDR:%.*]] = alloca ptr, align 4
3544 // CHECK3-NEXT: [[DOTADDR1:%.*]] = alloca i32, align 4
3545 // CHECK3-NEXT: [[DOTADDR2:%.*]] = alloca ptr, align 4
3546 // CHECK3-NEXT: store ptr [[TMP0]], ptr [[DOTADDR]], align 4
3547 // CHECK3-NEXT: store i32 [[TMP1]], ptr [[DOTADDR1]], align 4
3548 // CHECK3-NEXT: store ptr [[TMP2]], ptr [[DOTADDR2]], align 4
3549 // CHECK3-NEXT: [[TMP3:%.*]] = load ptr, ptr [[DOTADDR2]], align 4
3550 // CHECK3-NEXT: [[TMP4:%.*]] = load ptr, ptr [[DOTADDR]], align 4
3551 // CHECK3-NEXT: [[TMP5:%.*]] = load i32, ptr [[DOTADDR1]], align 4
3552 // CHECK3-NEXT: [[TMP6:%.*]] = getelementptr inbounds [2 x ptr], ptr [[TMP3]], i32 0, i32 0
3553 // CHECK3-NEXT: [[TMP7:%.*]] = load ptr, ptr [[TMP6]], align 4
3554 // CHECK3-NEXT: [[TMP8:%.*]] = getelementptr inbounds [[STRUCT__GLOBALIZED_LOCALS_TY_2:%.*]], ptr [[TMP4]], i32 [[TMP5]]
3555 // CHECK3-NEXT: [[A:%.*]] = getelementptr inbounds [[STRUCT__GLOBALIZED_LOCALS_TY_2]], ptr [[TMP8]], i32 0, i32 0
3556 // CHECK3-NEXT: [[TMP9:%.*]] = load i32, ptr [[TMP7]], align 4
3557 // CHECK3-NEXT: store i32 [[TMP9]], ptr [[A]], align 4
3558 // CHECK3-NEXT: [[TMP10:%.*]] = getelementptr inbounds [2 x ptr], ptr [[TMP3]], i32 0, i32 1
3559 // CHECK3-NEXT: [[TMP11:%.*]] = load ptr, ptr [[TMP10]], align 4
3560 // CHECK3-NEXT: [[TMP12:%.*]] = getelementptr inbounds [[STRUCT__GLOBALIZED_LOCALS_TY_2]], ptr [[TMP4]], i32 [[TMP5]]
3561 // CHECK3-NEXT: [[B:%.*]] = getelementptr inbounds [[STRUCT__GLOBALIZED_LOCALS_TY_2]], ptr [[TMP12]], i32 0, i32 1
3562 // CHECK3-NEXT: [[TMP13:%.*]] = load i16, ptr [[TMP11]], align 2
3563 // CHECK3-NEXT: store i16 [[TMP13]], ptr [[B]], align 2
3564 // CHECK3-NEXT: ret void
3567 // CHECK3-LABEL: define {{[^@]+}}@_omp_reduction_list_to_global_reduce_func12
3568 // CHECK3-SAME: (ptr noundef [[TMP0:%.*]], i32 noundef [[TMP1:%.*]], ptr noundef [[TMP2:%.*]]) #[[ATTR3]] {
3569 // CHECK3-NEXT: entry:
3570 // CHECK3-NEXT: [[DOTADDR:%.*]] = alloca ptr, align 4
3571 // CHECK3-NEXT: [[DOTADDR1:%.*]] = alloca i32, align 4
3572 // CHECK3-NEXT: [[DOTADDR2:%.*]] = alloca ptr, align 4
3573 // CHECK3-NEXT: [[DOTOMP_REDUCTION_RED_LIST:%.*]] = alloca [2 x ptr], align 4
3574 // CHECK3-NEXT: store ptr [[TMP0]], ptr [[DOTADDR]], align 4
3575 // CHECK3-NEXT: store i32 [[TMP1]], ptr [[DOTADDR1]], align 4
3576 // CHECK3-NEXT: store ptr [[TMP2]], ptr [[DOTADDR2]], align 4
3577 // CHECK3-NEXT: [[TMP3:%.*]] = load ptr, ptr [[DOTADDR]], align 4
3578 // CHECK3-NEXT: [[TMP4:%.*]] = load i32, ptr [[DOTADDR1]], align 4
3579 // CHECK3-NEXT: [[TMP5:%.*]] = getelementptr inbounds [2 x ptr], ptr [[DOTOMP_REDUCTION_RED_LIST]], i32 0, i32 0
3580 // CHECK3-NEXT: [[TMP6:%.*]] = getelementptr inbounds [[STRUCT__GLOBALIZED_LOCALS_TY_2:%.*]], ptr [[TMP3]], i32 [[TMP4]]
3581 // CHECK3-NEXT: [[A:%.*]] = getelementptr inbounds [[STRUCT__GLOBALIZED_LOCALS_TY_2]], ptr [[TMP6]], i32 0, i32 0
3582 // CHECK3-NEXT: store ptr [[A]], ptr [[TMP5]], align 4
3583 // CHECK3-NEXT: [[TMP7:%.*]] = getelementptr inbounds [2 x ptr], ptr [[DOTOMP_REDUCTION_RED_LIST]], i32 0, i32 1
3584 // CHECK3-NEXT: [[TMP8:%.*]] = getelementptr inbounds [[STRUCT__GLOBALIZED_LOCALS_TY_2]], ptr [[TMP3]], i32 [[TMP4]]
3585 // CHECK3-NEXT: [[B:%.*]] = getelementptr inbounds [[STRUCT__GLOBALIZED_LOCALS_TY_2]], ptr [[TMP8]], i32 0, i32 1
3586 // CHECK3-NEXT: store ptr [[B]], ptr [[TMP7]], align 4
3587 // CHECK3-NEXT: [[TMP9:%.*]] = load ptr, ptr [[DOTADDR2]], align 4
3588 // CHECK3-NEXT: call void @"{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z9ftemplateIcET_i_l33_omp_outlined_omp$reduction$reduction_func"(ptr [[DOTOMP_REDUCTION_RED_LIST]], ptr [[TMP9]]) #[[ATTR4]]
3589 // CHECK3-NEXT: ret void
3592 // CHECK3-LABEL: define {{[^@]+}}@_omp_reduction_global_to_list_copy_func13
3593 // CHECK3-SAME: (ptr noundef [[TMP0:%.*]], i32 noundef [[TMP1:%.*]], ptr noundef [[TMP2:%.*]]) #[[ATTR3]] {
3594 // CHECK3-NEXT: entry:
3595 // CHECK3-NEXT: [[DOTADDR:%.*]] = alloca ptr, align 4
3596 // CHECK3-NEXT: [[DOTADDR1:%.*]] = alloca i32, align 4
3597 // CHECK3-NEXT: [[DOTADDR2:%.*]] = alloca ptr, align 4
3598 // CHECK3-NEXT: store ptr [[TMP0]], ptr [[DOTADDR]], align 4
3599 // CHECK3-NEXT: store i32 [[TMP1]], ptr [[DOTADDR1]], align 4
3600 // CHECK3-NEXT: store ptr [[TMP2]], ptr [[DOTADDR2]], align 4
3601 // CHECK3-NEXT: [[TMP3:%.*]] = load ptr, ptr [[DOTADDR2]], align 4
3602 // CHECK3-NEXT: [[TMP4:%.*]] = load ptr, ptr [[DOTADDR]], align 4
3603 // CHECK3-NEXT: [[TMP5:%.*]] = load i32, ptr [[DOTADDR1]], align 4
3604 // CHECK3-NEXT: [[TMP6:%.*]] = getelementptr inbounds [2 x ptr], ptr [[TMP3]], i32 0, i32 0
3605 // CHECK3-NEXT: [[TMP7:%.*]] = load ptr, ptr [[TMP6]], align 4
3606 // CHECK3-NEXT: [[TMP8:%.*]] = getelementptr inbounds [[STRUCT__GLOBALIZED_LOCALS_TY_2:%.*]], ptr [[TMP4]], i32 [[TMP5]]
3607 // CHECK3-NEXT: [[A:%.*]] = getelementptr inbounds [[STRUCT__GLOBALIZED_LOCALS_TY_2]], ptr [[TMP8]], i32 0, i32 0
3608 // CHECK3-NEXT: [[TMP9:%.*]] = load i32, ptr [[A]], align 4
3609 // CHECK3-NEXT: store i32 [[TMP9]], ptr [[TMP7]], align 4
3610 // CHECK3-NEXT: [[TMP10:%.*]] = getelementptr inbounds [2 x ptr], ptr [[TMP3]], i32 0, i32 1
3611 // CHECK3-NEXT: [[TMP11:%.*]] = load ptr, ptr [[TMP10]], align 4
3612 // CHECK3-NEXT: [[TMP12:%.*]] = getelementptr inbounds [[STRUCT__GLOBALIZED_LOCALS_TY_2]], ptr [[TMP4]], i32 [[TMP5]]
3613 // CHECK3-NEXT: [[B:%.*]] = getelementptr inbounds [[STRUCT__GLOBALIZED_LOCALS_TY_2]], ptr [[TMP12]], i32 0, i32 1
3614 // CHECK3-NEXT: [[TMP13:%.*]] = load i16, ptr [[B]], align 2
3615 // CHECK3-NEXT: store i16 [[TMP13]], ptr [[TMP11]], align 2
3616 // CHECK3-NEXT: ret void
3619 // CHECK3-LABEL: define {{[^@]+}}@_omp_reduction_global_to_list_reduce_func14
3620 // CHECK3-SAME: (ptr noundef [[TMP0:%.*]], i32 noundef [[TMP1:%.*]], ptr noundef [[TMP2:%.*]]) #[[ATTR3]] {
3621 // CHECK3-NEXT: entry:
3622 // CHECK3-NEXT: [[DOTADDR:%.*]] = alloca ptr, align 4
3623 // CHECK3-NEXT: [[DOTADDR1:%.*]] = alloca i32, align 4
3624 // CHECK3-NEXT: [[DOTADDR2:%.*]] = alloca ptr, align 4
3625 // CHECK3-NEXT: [[DOTOMP_REDUCTION_RED_LIST:%.*]] = alloca [2 x ptr], align 4
3626 // CHECK3-NEXT: store ptr [[TMP0]], ptr [[DOTADDR]], align 4
3627 // CHECK3-NEXT: store i32 [[TMP1]], ptr [[DOTADDR1]], align 4
3628 // CHECK3-NEXT: store ptr [[TMP2]], ptr [[DOTADDR2]], align 4
3629 // CHECK3-NEXT: [[TMP3:%.*]] = load ptr, ptr [[DOTADDR]], align 4
3630 // CHECK3-NEXT: [[TMP4:%.*]] = load i32, ptr [[DOTADDR1]], align 4
3631 // CHECK3-NEXT: [[TMP5:%.*]] = getelementptr inbounds [2 x ptr], ptr [[DOTOMP_REDUCTION_RED_LIST]], i32 0, i32 0
3632 // CHECK3-NEXT: [[TMP6:%.*]] = getelementptr inbounds [[STRUCT__GLOBALIZED_LOCALS_TY_2:%.*]], ptr [[TMP3]], i32 [[TMP4]]
3633 // CHECK3-NEXT: [[A:%.*]] = getelementptr inbounds [[STRUCT__GLOBALIZED_LOCALS_TY_2]], ptr [[TMP6]], i32 0, i32 0
3634 // CHECK3-NEXT: store ptr [[A]], ptr [[TMP5]], align 4
3635 // CHECK3-NEXT: [[TMP7:%.*]] = getelementptr inbounds [2 x ptr], ptr [[DOTOMP_REDUCTION_RED_LIST]], i32 0, i32 1
3636 // CHECK3-NEXT: [[TMP8:%.*]] = getelementptr inbounds [[STRUCT__GLOBALIZED_LOCALS_TY_2]], ptr [[TMP3]], i32 [[TMP4]]
3637 // CHECK3-NEXT: [[B:%.*]] = getelementptr inbounds [[STRUCT__GLOBALIZED_LOCALS_TY_2]], ptr [[TMP8]], i32 0, i32 1
3638 // CHECK3-NEXT: store ptr [[B]], ptr [[TMP7]], align 4
3639 // CHECK3-NEXT: [[TMP9:%.*]] = load ptr, ptr [[DOTADDR2]], align 4
3640 // CHECK3-NEXT: call void @"{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z9ftemplateIcET_i_l33_omp_outlined_omp$reduction$reduction_func"(ptr [[TMP9]], ptr [[DOTOMP_REDUCTION_RED_LIST]]) #[[ATTR4]]
3641 // CHECK3-NEXT: ret void