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 // expected-no-diagnostics
6 // RUN: %clang_cc1 -DCK1 -verify -Wno-vla -fopenmp -x c++ -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -emit-llvm %s -o - | FileCheck %s --check-prefix=CHECK1
7 // RUN: %clang_cc1 -DCK1 -fopenmp -x c++ -std=c++11 -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -emit-pch -o %t %s
8 // RUN: %clang_cc1 -DCK1 -fopenmp -x c++ -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -std=c++11 -include-pch %t -verify -Wno-vla %s -emit-llvm -o - | FileCheck %s --check-prefix=CHECK1
9 // RUN: %clang_cc1 -DCK1 -verify -Wno-vla -fopenmp -x c++ -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -emit-llvm %s -o - | FileCheck %s --check-prefix=CHECK3
10 // RUN: %clang_cc1 -DCK1 -fopenmp -x c++ -std=c++11 -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -emit-pch -o %t %s
11 // RUN: %clang_cc1 -DCK1 -fopenmp -x c++ -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -std=c++11 -include-pch %t -verify -Wno-vla %s -emit-llvm -o - | FileCheck %s --check-prefix=CHECK3
13 // RUN: %clang_cc1 -DCK1 -verify -Wno-vla -fopenmp-simd -x c++ -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -emit-llvm %s -o - | FileCheck %s --implicit-check-not="{{__kmpc|__tgt}}"
14 // RUN: %clang_cc1 -DCK1 -fopenmp-simd -x c++ -std=c++11 -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -emit-pch -o %t %s
15 // RUN: %clang_cc1 -DCK1 -fopenmp-simd -x c++ -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -std=c++11 -include-pch %t -verify -Wno-vla %s -emit-llvm -o - | FileCheck %s --implicit-check-not="{{__kmpc|__tgt}}"
16 // RUN: %clang_cc1 -DCK1 -verify -Wno-vla -fopenmp-simd -x c++ -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -emit-llvm %s -o - | FileCheck %s --implicit-check-not="{{__kmpc|__tgt}}"
17 // RUN: %clang_cc1 -DCK1 -fopenmp-simd -x c++ -std=c++11 -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -emit-pch -o %t %s
18 // RUN: %clang_cc1 -DCK1 -fopenmp-simd -x c++ -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -std=c++11 -include-pch %t -verify -Wno-vla %s -emit-llvm -o - | FileCheck %s --implicit-check-not="{{__kmpc|__tgt}}"
23 int teams_argument_global(int n
){
29 #pragma omp teams loop num_teams(te), thread_limit(th)
30 for(int i
= 0; i
< n
; i
++) {
36 #pragma omp teams loop
37 for(int i
= 0; i
< n
; i
++) {
42 // outlined target regions
53 // RUN: %clang_cc1 -DCK2 -verify -Wno-vla -fopenmp -x c++ -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -emit-llvm %s -o - | FileCheck %s --check-prefix=CHECK9
54 // RUN: %clang_cc1 -DCK2 -fopenmp -x c++ -std=c++11 -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -emit-pch -o %t %s
55 // RUN: %clang_cc1 -DCK2 -fopenmp -x c++ -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -std=c++11 -include-pch %t -verify -Wno-vla %s -emit-llvm -o - | FileCheck %s --check-prefix=CHECK9
56 // RUN: %clang_cc1 -DCK2 -verify -Wno-vla -fopenmp -x c++ -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -emit-llvm %s -o - | FileCheck %s --check-prefix=CHECK11
57 // RUN: %clang_cc1 -DCK2 -fopenmp -x c++ -std=c++11 -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -emit-pch -o %t %s
58 // RUN: %clang_cc1 -DCK2 -fopenmp -x c++ -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -std=c++11 -include-pch %t -verify -Wno-vla %s -emit-llvm -o - | FileCheck %s --check-prefix=CHECK11
60 // RUN: %clang_cc1 -DCK2 -verify -Wno-vla -fopenmp-simd -x c++ -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -emit-llvm %s -o - | FileCheck %s --implicit-check-not="{{__kmpc|__tgt}}"
61 // RUN: %clang_cc1 -DCK2 -fopenmp-simd -x c++ -std=c++11 -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -emit-pch -o %t %s
62 // RUN: %clang_cc1 -DCK2 -fopenmp-simd -x c++ -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -std=c++11 -include-pch %t -verify -Wno-vla %s -emit-llvm -o - | FileCheck %s --implicit-check-not="{{__kmpc|__tgt}}"
63 // RUN: %clang_cc1 -DCK2 -verify -Wno-vla -fopenmp-simd -x c++ -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -emit-llvm %s -o - | FileCheck %s --implicit-check-not="{{__kmpc|__tgt}}"
64 // RUN: %clang_cc1 -DCK2 -fopenmp-simd -x c++ -std=c++11 -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -emit-pch -o %t %s
65 // RUN: %clang_cc1 -DCK2 -fopenmp-simd -x c++ -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -std=c++11 -include-pch %t -verify -Wno-vla %s -emit-llvm -o - | FileCheck %s --implicit-check-not="{{__kmpc|__tgt}}"
68 int teams_local_arg(void) {
73 #pragma omp teams loop
74 for(int i
= 0; i
< n
; i
++) {
78 // outlined target region
86 // RUN: %clang_cc1 -DCK3 -verify -Wno-vla -fopenmp -x c++ -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -emit-llvm %s -o - | FileCheck %s --check-prefix=CHECK17
87 // RUN: %clang_cc1 -DCK3 -fopenmp -x c++ -std=c++11 -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -emit-pch -o %t %s
88 // RUN: %clang_cc1 -DCK3 -fopenmp -x c++ -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -std=c++11 -include-pch %t -verify -Wno-vla %s -emit-llvm -o - | FileCheck %s --check-prefix=CHECK17
89 // RUN: %clang_cc1 -DCK3 -verify -Wno-vla -fopenmp -x c++ -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -emit-llvm %s -o - | FileCheck %s --check-prefix=CHECK19
90 // RUN: %clang_cc1 -DCK3 -fopenmp -x c++ -std=c++11 -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -emit-pch -o %t %s
91 // RUN: %clang_cc1 -DCK3 -fopenmp -x c++ -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -std=c++11 -include-pch %t -verify -Wno-vla %s -emit-llvm -o - | FileCheck %s --check-prefix=CHECK19
93 // RUN: %clang_cc1 -DCK3 -verify -Wno-vla -fopenmp-simd -x c++ -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -emit-llvm %s -o - | FileCheck %s --implicit-check-not="{{__kmpc|__tgt}}"
94 // RUN: %clang_cc1 -DCK3 -fopenmp-simd -x c++ -std=c++11 -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -emit-pch -o %t %s
95 // RUN: %clang_cc1 -DCK3 -fopenmp-simd -x c++ -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -std=c++11 -include-pch %t -verify -Wno-vla %s -emit-llvm -o - | FileCheck %s --implicit-check-not="{{__kmpc|__tgt}}"
96 // RUN: %clang_cc1 -DCK3 -verify -Wno-vla -fopenmp-simd -x c++ -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -emit-llvm %s -o - | FileCheck %s --implicit-check-not="{{__kmpc|__tgt}}"
97 // RUN: %clang_cc1 -DCK3 -fopenmp-simd -x c++ -std=c++11 -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -emit-pch -o %t %s
98 // RUN: %clang_cc1 -DCK3 -fopenmp-simd -x c++ -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -std=c++11 -include-pch %t -verify -Wno-vla %s -emit-llvm -o - | FileCheck %s --implicit-check-not="{{__kmpc|__tgt}}"
102 template <typename T
, int X
, long long Y
>
109 #pragma omp teams loop
110 for(int i
= 0; i
< X
; i
++) {
114 // outlined target region
121 int teams_template_struct(void) {
128 // Test host codegen.
129 // RUN: %clang_cc1 -DCK4 -verify -Wno-vla -fopenmp -x c++ -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -emit-llvm %s -o - | FileCheck %s --check-prefix=CHECK25
130 // RUN: %clang_cc1 -DCK4 -fopenmp -x c++ -std=c++11 -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -emit-pch -o %t %s
131 // RUN: %clang_cc1 -DCK4 -fopenmp -x c++ -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -std=c++11 -include-pch %t -verify -Wno-vla %s -emit-llvm -o - | FileCheck %s --check-prefix=CHECK25
132 // RUN: %clang_cc1 -DCK4 -verify -Wno-vla -fopenmp -x c++ -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -emit-llvm %s -o - | FileCheck %s --check-prefix=CHECK27
133 // RUN: %clang_cc1 -DCK4 -fopenmp -x c++ -std=c++11 -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -emit-pch -o %t %s
134 // RUN: %clang_cc1 -DCK4 -fopenmp -x c++ -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -std=c++11 -include-pch %t -verify -Wno-vla %s -emit-llvm -o - | FileCheck %s --check-prefix=CHECK27
136 // RUN: %clang_cc1 -DCK4 -verify -Wno-vla -fopenmp-simd -x c++ -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -emit-llvm %s -o - | FileCheck %s --implicit-check-not="{{__kmpc|__tgt}}"
137 // RUN: %clang_cc1 -DCK4 -fopenmp-simd -x c++ -std=c++11 -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -emit-pch -o %t %s
138 // RUN: %clang_cc1 -DCK4 -fopenmp-simd -x c++ -triple powerpc64le-unknown-unknown -fopenmp-targets=powerpc64le-ibm-linux-gnu -std=c++11 -include-pch %t -verify -Wno-vla %s -emit-llvm -o - | FileCheck %s --implicit-check-not="{{__kmpc|__tgt}}"
139 // RUN: %clang_cc1 -DCK4 -verify -Wno-vla -fopenmp-simd -x c++ -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -emit-llvm %s -o - | FileCheck %s --implicit-check-not="{{__kmpc|__tgt}}"
140 // RUN: %clang_cc1 -DCK4 -fopenmp-simd -x c++ -std=c++11 -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -emit-pch -o %t %s
141 // RUN: %clang_cc1 -DCK4 -fopenmp-simd -x c++ -triple i386-unknown-unknown -fopenmp-targets=i386-pc-linux-gnu -std=c++11 -include-pch %t -verify -Wno-vla %s -emit-llvm -o - | FileCheck %s --implicit-check-not="{{__kmpc|__tgt}}"
145 template <typename T
, int n
>
151 #pragma omp teams loop num_teams(te) thread_limit(th)
152 for(int i
= 0; i
< n
; i
++) {
158 int main (int argc
, char **argv
) {
162 #pragma omp teams loop
163 for(int i
= 0; i
< n
; i
++) {
166 return tmain
<int, 10>(argc
);
177 // CHECK1-LABEL: define {{[^@]+}}@_Z21teams_argument_globali
178 // CHECK1-SAME: (i32 noundef signext [[N:%.*]]) #[[ATTR0:[0-9]+]] {
179 // CHECK1-NEXT: entry:
180 // CHECK1-NEXT: [[N_ADDR:%.*]] = alloca i32, align 4
181 // CHECK1-NEXT: [[TE:%.*]] = alloca i32, align 4
182 // CHECK1-NEXT: [[TH:%.*]] = alloca i32, align 4
183 // CHECK1-NEXT: [[TE_CASTED:%.*]] = alloca i64, align 8
184 // CHECK1-NEXT: [[TH_CASTED:%.*]] = alloca i64, align 8
185 // CHECK1-NEXT: [[N_CASTED:%.*]] = alloca i64, align 8
186 // CHECK1-NEXT: [[DOTOFFLOAD_BASEPTRS:%.*]] = alloca [4 x ptr], align 8
187 // CHECK1-NEXT: [[DOTOFFLOAD_PTRS:%.*]] = alloca [4 x ptr], align 8
188 // CHECK1-NEXT: [[DOTOFFLOAD_MAPPERS:%.*]] = alloca [4 x ptr], align 8
189 // CHECK1-NEXT: [[TMP:%.*]] = alloca i32, align 4
190 // CHECK1-NEXT: [[DOTCAPTURE_EXPR_:%.*]] = alloca i32, align 4
191 // CHECK1-NEXT: [[DOTCAPTURE_EXPR_1:%.*]] = alloca i32, align 4
192 // CHECK1-NEXT: [[KERNEL_ARGS:%.*]] = alloca [[STRUCT___TGT_KERNEL_ARGUMENTS:%.*]], align 8
193 // CHECK1-NEXT: [[N_CASTED4:%.*]] = alloca i64, align 8
194 // CHECK1-NEXT: [[DOTOFFLOAD_BASEPTRS5:%.*]] = alloca [2 x ptr], align 8
195 // CHECK1-NEXT: [[DOTOFFLOAD_PTRS6:%.*]] = alloca [2 x ptr], align 8
196 // CHECK1-NEXT: [[DOTOFFLOAD_MAPPERS7:%.*]] = alloca [2 x ptr], align 8
197 // CHECK1-NEXT: [[_TMP8:%.*]] = alloca i32, align 4
198 // CHECK1-NEXT: [[DOTCAPTURE_EXPR_9:%.*]] = alloca i32, align 4
199 // CHECK1-NEXT: [[DOTCAPTURE_EXPR_10:%.*]] = alloca i32, align 4
200 // CHECK1-NEXT: [[KERNEL_ARGS15:%.*]] = alloca [[STRUCT___TGT_KERNEL_ARGUMENTS]], align 8
201 // CHECK1-NEXT: store i32 [[N]], ptr [[N_ADDR]], align 4
202 // CHECK1-NEXT: [[TMP0:%.*]] = load i32, ptr [[N_ADDR]], align 4
203 // CHECK1-NEXT: [[DIV:%.*]] = sdiv i32 [[TMP0]], 128
204 // CHECK1-NEXT: store i32 [[DIV]], ptr [[TE]], align 4
205 // CHECK1-NEXT: store i32 128, ptr [[TH]], align 4
206 // CHECK1-NEXT: [[TMP1:%.*]] = load i32, ptr [[TE]], align 4
207 // CHECK1-NEXT: store i32 [[TMP1]], ptr [[TE_CASTED]], align 4
208 // CHECK1-NEXT: [[TMP2:%.*]] = load i64, ptr [[TE_CASTED]], align 8
209 // CHECK1-NEXT: [[TMP3:%.*]] = load i32, ptr [[TH]], align 4
210 // CHECK1-NEXT: store i32 [[TMP3]], ptr [[TH_CASTED]], align 4
211 // CHECK1-NEXT: [[TMP4:%.*]] = load i64, ptr [[TH_CASTED]], align 8
212 // CHECK1-NEXT: [[TMP5:%.*]] = load i32, ptr [[N_ADDR]], align 4
213 // CHECK1-NEXT: store i32 [[TMP5]], ptr [[N_CASTED]], align 4
214 // CHECK1-NEXT: [[TMP6:%.*]] = load i64, ptr [[N_CASTED]], align 8
215 // CHECK1-NEXT: [[TMP7:%.*]] = getelementptr inbounds [4 x ptr], ptr [[DOTOFFLOAD_BASEPTRS]], i32 0, i32 0
216 // CHECK1-NEXT: store i64 [[TMP2]], ptr [[TMP7]], align 8
217 // CHECK1-NEXT: [[TMP8:%.*]] = getelementptr inbounds [4 x ptr], ptr [[DOTOFFLOAD_PTRS]], i32 0, i32 0
218 // CHECK1-NEXT: store i64 [[TMP2]], ptr [[TMP8]], align 8
219 // CHECK1-NEXT: [[TMP9:%.*]] = getelementptr inbounds [4 x ptr], ptr [[DOTOFFLOAD_MAPPERS]], i64 0, i64 0
220 // CHECK1-NEXT: store ptr null, ptr [[TMP9]], align 8
221 // CHECK1-NEXT: [[TMP10:%.*]] = getelementptr inbounds [4 x ptr], ptr [[DOTOFFLOAD_BASEPTRS]], i32 0, i32 1
222 // CHECK1-NEXT: store i64 [[TMP4]], ptr [[TMP10]], align 8
223 // CHECK1-NEXT: [[TMP11:%.*]] = getelementptr inbounds [4 x ptr], ptr [[DOTOFFLOAD_PTRS]], i32 0, i32 1
224 // CHECK1-NEXT: store i64 [[TMP4]], ptr [[TMP11]], align 8
225 // CHECK1-NEXT: [[TMP12:%.*]] = getelementptr inbounds [4 x ptr], ptr [[DOTOFFLOAD_MAPPERS]], i64 0, i64 1
226 // CHECK1-NEXT: store ptr null, ptr [[TMP12]], align 8
227 // CHECK1-NEXT: [[TMP13:%.*]] = getelementptr inbounds [4 x ptr], ptr [[DOTOFFLOAD_BASEPTRS]], i32 0, i32 2
228 // CHECK1-NEXT: store i64 [[TMP6]], ptr [[TMP13]], align 8
229 // CHECK1-NEXT: [[TMP14:%.*]] = getelementptr inbounds [4 x ptr], ptr [[DOTOFFLOAD_PTRS]], i32 0, i32 2
230 // CHECK1-NEXT: store i64 [[TMP6]], ptr [[TMP14]], align 8
231 // CHECK1-NEXT: [[TMP15:%.*]] = getelementptr inbounds [4 x ptr], ptr [[DOTOFFLOAD_MAPPERS]], i64 0, i64 2
232 // CHECK1-NEXT: store ptr null, ptr [[TMP15]], align 8
233 // CHECK1-NEXT: [[TMP16:%.*]] = getelementptr inbounds [4 x ptr], ptr [[DOTOFFLOAD_BASEPTRS]], i32 0, i32 3
234 // CHECK1-NEXT: store ptr @a, ptr [[TMP16]], align 8
235 // CHECK1-NEXT: [[TMP17:%.*]] = getelementptr inbounds [4 x ptr], ptr [[DOTOFFLOAD_PTRS]], i32 0, i32 3
236 // CHECK1-NEXT: store ptr @a, ptr [[TMP17]], align 8
237 // CHECK1-NEXT: [[TMP18:%.*]] = getelementptr inbounds [4 x ptr], ptr [[DOTOFFLOAD_MAPPERS]], i64 0, i64 3
238 // CHECK1-NEXT: store ptr null, ptr [[TMP18]], align 8
239 // CHECK1-NEXT: [[TMP19:%.*]] = getelementptr inbounds [4 x ptr], ptr [[DOTOFFLOAD_BASEPTRS]], i32 0, i32 0
240 // CHECK1-NEXT: [[TMP20:%.*]] = getelementptr inbounds [4 x ptr], ptr [[DOTOFFLOAD_PTRS]], i32 0, i32 0
241 // CHECK1-NEXT: [[TMP21:%.*]] = load i32, ptr [[TE]], align 4
242 // CHECK1-NEXT: [[TMP22:%.*]] = load i32, ptr [[TH]], align 4
243 // CHECK1-NEXT: [[TMP23:%.*]] = load i32, ptr [[N_ADDR]], align 4
244 // CHECK1-NEXT: store i32 [[TMP23]], ptr [[DOTCAPTURE_EXPR_]], align 4
245 // CHECK1-NEXT: [[TMP24:%.*]] = load i32, ptr [[DOTCAPTURE_EXPR_]], align 4
246 // CHECK1-NEXT: [[SUB:%.*]] = sub nsw i32 [[TMP24]], 0
247 // CHECK1-NEXT: [[DIV2:%.*]] = sdiv i32 [[SUB]], 1
248 // CHECK1-NEXT: [[SUB3:%.*]] = sub nsw i32 [[DIV2]], 1
249 // CHECK1-NEXT: store i32 [[SUB3]], ptr [[DOTCAPTURE_EXPR_1]], align 4
250 // CHECK1-NEXT: [[TMP25:%.*]] = load i32, ptr [[DOTCAPTURE_EXPR_1]], align 4
251 // CHECK1-NEXT: [[ADD:%.*]] = add nsw i32 [[TMP25]], 1
252 // CHECK1-NEXT: [[TMP26:%.*]] = zext i32 [[ADD]] to i64
253 // CHECK1-NEXT: [[TMP27:%.*]] = insertvalue [3 x i32] zeroinitializer, i32 [[TMP21]], 0
254 // CHECK1-NEXT: [[TMP28:%.*]] = insertvalue [3 x i32] zeroinitializer, i32 [[TMP22]], 0
255 // CHECK1-NEXT: [[TMP29:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 0
256 // CHECK1-NEXT: store i32 2, ptr [[TMP29]], align 4
257 // CHECK1-NEXT: [[TMP30:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 1
258 // CHECK1-NEXT: store i32 4, ptr [[TMP30]], align 4
259 // CHECK1-NEXT: [[TMP31:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 2
260 // CHECK1-NEXT: store ptr [[TMP19]], ptr [[TMP31]], align 8
261 // CHECK1-NEXT: [[TMP32:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 3
262 // CHECK1-NEXT: store ptr [[TMP20]], ptr [[TMP32]], align 8
263 // CHECK1-NEXT: [[TMP33:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 4
264 // CHECK1-NEXT: store ptr @.offload_sizes, ptr [[TMP33]], align 8
265 // CHECK1-NEXT: [[TMP34:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 5
266 // CHECK1-NEXT: store ptr @.offload_maptypes, ptr [[TMP34]], align 8
267 // CHECK1-NEXT: [[TMP35:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 6
268 // CHECK1-NEXT: store ptr null, ptr [[TMP35]], align 8
269 // CHECK1-NEXT: [[TMP36:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 7
270 // CHECK1-NEXT: store ptr null, ptr [[TMP36]], align 8
271 // CHECK1-NEXT: [[TMP37:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 8
272 // CHECK1-NEXT: store i64 [[TMP26]], ptr [[TMP37]], align 8
273 // CHECK1-NEXT: [[TMP38:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 9
274 // CHECK1-NEXT: store i64 0, ptr [[TMP38]], align 8
275 // CHECK1-NEXT: [[TMP39:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 10
276 // CHECK1-NEXT: store [3 x i32] [[TMP27]], ptr [[TMP39]], align 4
277 // CHECK1-NEXT: [[TMP40:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 11
278 // CHECK1-NEXT: store [3 x i32] [[TMP28]], ptr [[TMP40]], align 4
279 // CHECK1-NEXT: [[TMP41:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 12
280 // CHECK1-NEXT: store i32 0, ptr [[TMP41]], align 4
281 // CHECK1-NEXT: [[TMP42:%.*]] = call i32 @__tgt_target_kernel(ptr @[[GLOB3:[0-9]+]], i64 -1, i32 [[TMP21]], i32 [[TMP22]], ptr @.{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z21teams_argument_globali_l28.region_id, ptr [[KERNEL_ARGS]])
282 // CHECK1-NEXT: [[TMP43:%.*]] = icmp ne i32 [[TMP42]], 0
283 // CHECK1-NEXT: br i1 [[TMP43]], label [[OMP_OFFLOAD_FAILED:%.*]], label [[OMP_OFFLOAD_CONT:%.*]]
284 // CHECK1: omp_offload.failed:
285 // CHECK1-NEXT: call void @{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z21teams_argument_globali_l28(i64 [[TMP2]], i64 [[TMP4]], i64 [[TMP6]], ptr @a) #[[ATTR2:[0-9]+]]
286 // CHECK1-NEXT: br label [[OMP_OFFLOAD_CONT]]
287 // CHECK1: omp_offload.cont:
288 // CHECK1-NEXT: [[TMP44:%.*]] = load i32, ptr [[N_ADDR]], align 4
289 // CHECK1-NEXT: store i32 [[TMP44]], ptr [[N_CASTED4]], align 4
290 // CHECK1-NEXT: [[TMP45:%.*]] = load i64, ptr [[N_CASTED4]], align 8
291 // CHECK1-NEXT: [[TMP46:%.*]] = getelementptr inbounds [2 x ptr], ptr [[DOTOFFLOAD_BASEPTRS5]], i32 0, i32 0
292 // CHECK1-NEXT: store i64 [[TMP45]], ptr [[TMP46]], align 8
293 // CHECK1-NEXT: [[TMP47:%.*]] = getelementptr inbounds [2 x ptr], ptr [[DOTOFFLOAD_PTRS6]], i32 0, i32 0
294 // CHECK1-NEXT: store i64 [[TMP45]], ptr [[TMP47]], align 8
295 // CHECK1-NEXT: [[TMP48:%.*]] = getelementptr inbounds [2 x ptr], ptr [[DOTOFFLOAD_MAPPERS7]], i64 0, i64 0
296 // CHECK1-NEXT: store ptr null, ptr [[TMP48]], align 8
297 // CHECK1-NEXT: [[TMP49:%.*]] = getelementptr inbounds [2 x ptr], ptr [[DOTOFFLOAD_BASEPTRS5]], i32 0, i32 1
298 // CHECK1-NEXT: store ptr @a, ptr [[TMP49]], align 8
299 // CHECK1-NEXT: [[TMP50:%.*]] = getelementptr inbounds [2 x ptr], ptr [[DOTOFFLOAD_PTRS6]], i32 0, i32 1
300 // CHECK1-NEXT: store ptr @a, ptr [[TMP50]], align 8
301 // CHECK1-NEXT: [[TMP51:%.*]] = getelementptr inbounds [2 x ptr], ptr [[DOTOFFLOAD_MAPPERS7]], i64 0, i64 1
302 // CHECK1-NEXT: store ptr null, ptr [[TMP51]], align 8
303 // CHECK1-NEXT: [[TMP52:%.*]] = getelementptr inbounds [2 x ptr], ptr [[DOTOFFLOAD_BASEPTRS5]], i32 0, i32 0
304 // CHECK1-NEXT: [[TMP53:%.*]] = getelementptr inbounds [2 x ptr], ptr [[DOTOFFLOAD_PTRS6]], i32 0, i32 0
305 // CHECK1-NEXT: [[TMP54:%.*]] = load i32, ptr [[N_ADDR]], align 4
306 // CHECK1-NEXT: store i32 [[TMP54]], ptr [[DOTCAPTURE_EXPR_9]], align 4
307 // CHECK1-NEXT: [[TMP55:%.*]] = load i32, ptr [[DOTCAPTURE_EXPR_9]], align 4
308 // CHECK1-NEXT: [[SUB11:%.*]] = sub nsw i32 [[TMP55]], 0
309 // CHECK1-NEXT: [[DIV12:%.*]] = sdiv i32 [[SUB11]], 1
310 // CHECK1-NEXT: [[SUB13:%.*]] = sub nsw i32 [[DIV12]], 1
311 // CHECK1-NEXT: store i32 [[SUB13]], ptr [[DOTCAPTURE_EXPR_10]], align 4
312 // CHECK1-NEXT: [[TMP56:%.*]] = load i32, ptr [[DOTCAPTURE_EXPR_10]], align 4
313 // CHECK1-NEXT: [[ADD14:%.*]] = add nsw i32 [[TMP56]], 1
314 // CHECK1-NEXT: [[TMP57:%.*]] = zext i32 [[ADD14]] to i64
315 // CHECK1-NEXT: [[TMP58:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS15]], i32 0, i32 0
316 // CHECK1-NEXT: store i32 2, ptr [[TMP58]], align 4
317 // CHECK1-NEXT: [[TMP59:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS15]], i32 0, i32 1
318 // CHECK1-NEXT: store i32 2, ptr [[TMP59]], align 4
319 // CHECK1-NEXT: [[TMP60:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS15]], i32 0, i32 2
320 // CHECK1-NEXT: store ptr [[TMP52]], ptr [[TMP60]], align 8
321 // CHECK1-NEXT: [[TMP61:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS15]], i32 0, i32 3
322 // CHECK1-NEXT: store ptr [[TMP53]], ptr [[TMP61]], align 8
323 // CHECK1-NEXT: [[TMP62:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS15]], i32 0, i32 4
324 // CHECK1-NEXT: store ptr @.offload_sizes.1, ptr [[TMP62]], align 8
325 // CHECK1-NEXT: [[TMP63:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS15]], i32 0, i32 5
326 // CHECK1-NEXT: store ptr @.offload_maptypes.2, ptr [[TMP63]], align 8
327 // CHECK1-NEXT: [[TMP64:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS15]], i32 0, i32 6
328 // CHECK1-NEXT: store ptr null, ptr [[TMP64]], align 8
329 // CHECK1-NEXT: [[TMP65:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS15]], i32 0, i32 7
330 // CHECK1-NEXT: store ptr null, ptr [[TMP65]], align 8
331 // CHECK1-NEXT: [[TMP66:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS15]], i32 0, i32 8
332 // CHECK1-NEXT: store i64 [[TMP57]], ptr [[TMP66]], align 8
333 // CHECK1-NEXT: [[TMP67:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS15]], i32 0, i32 9
334 // CHECK1-NEXT: store i64 0, ptr [[TMP67]], align 8
335 // CHECK1-NEXT: [[TMP68:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS15]], i32 0, i32 10
336 // CHECK1-NEXT: store [3 x i32] zeroinitializer, ptr [[TMP68]], align 4
337 // CHECK1-NEXT: [[TMP69:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS15]], i32 0, i32 11
338 // CHECK1-NEXT: store [3 x i32] zeroinitializer, ptr [[TMP69]], align 4
339 // CHECK1-NEXT: [[TMP70:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS15]], i32 0, i32 12
340 // CHECK1-NEXT: store i32 0, ptr [[TMP70]], align 4
341 // CHECK1-NEXT: [[TMP71:%.*]] = call i32 @__tgt_target_kernel(ptr @[[GLOB3]], i64 -1, i32 0, i32 0, ptr @.{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z21teams_argument_globali_l34.region_id, ptr [[KERNEL_ARGS15]])
342 // CHECK1-NEXT: [[TMP72:%.*]] = icmp ne i32 [[TMP71]], 0
343 // CHECK1-NEXT: br i1 [[TMP72]], label [[OMP_OFFLOAD_FAILED16:%.*]], label [[OMP_OFFLOAD_CONT17:%.*]]
344 // CHECK1: omp_offload.failed16:
345 // CHECK1-NEXT: call void @{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z21teams_argument_globali_l34(i64 [[TMP45]], ptr @a) #[[ATTR2]]
346 // CHECK1-NEXT: br label [[OMP_OFFLOAD_CONT17]]
347 // CHECK1: omp_offload.cont17:
348 // CHECK1-NEXT: [[TMP73:%.*]] = load i32, ptr @a, align 4
349 // CHECK1-NEXT: ret i32 [[TMP73]]
352 // CHECK1-LABEL: define {{[^@]+}}@{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z21teams_argument_globali_l28
353 // CHECK1-SAME: (i64 noundef [[TE:%.*]], i64 noundef [[TH:%.*]], i64 noundef [[N:%.*]], ptr noundef nonnull align 4 dereferenceable(400) [[A:%.*]]) #[[ATTR1:[0-9]+]] {
354 // CHECK1-NEXT: entry:
355 // CHECK1-NEXT: [[TE_ADDR:%.*]] = alloca i64, align 8
356 // CHECK1-NEXT: [[TH_ADDR:%.*]] = alloca i64, align 8
357 // CHECK1-NEXT: [[N_ADDR:%.*]] = alloca i64, align 8
358 // CHECK1-NEXT: [[A_ADDR:%.*]] = alloca ptr, align 8
359 // CHECK1-NEXT: [[TMP0:%.*]] = call i32 @__kmpc_global_thread_num(ptr @[[GLOB3]])
360 // CHECK1-NEXT: store i64 [[TE]], ptr [[TE_ADDR]], align 8
361 // CHECK1-NEXT: store i64 [[TH]], ptr [[TH_ADDR]], align 8
362 // CHECK1-NEXT: store i64 [[N]], ptr [[N_ADDR]], align 8
363 // CHECK1-NEXT: store ptr [[A]], ptr [[A_ADDR]], align 8
364 // CHECK1-NEXT: [[TMP1:%.*]] = load ptr, ptr [[A_ADDR]], align 8
365 // CHECK1-NEXT: [[TMP2:%.*]] = load i32, ptr [[TE_ADDR]], align 4
366 // CHECK1-NEXT: [[TMP3:%.*]] = load i32, ptr [[TH_ADDR]], align 4
367 // CHECK1-NEXT: call void @__kmpc_push_num_teams(ptr @[[GLOB3]], i32 [[TMP0]], i32 [[TMP2]], i32 [[TMP3]])
368 // CHECK1-NEXT: call void (ptr, i32, ptr, ...) @__kmpc_fork_teams(ptr @[[GLOB3]], i32 2, ptr @{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z21teams_argument_globali_l28.omp_outlined, ptr [[N_ADDR]], ptr [[TMP1]])
369 // CHECK1-NEXT: ret void
372 // CHECK1-LABEL: define {{[^@]+}}@{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z21teams_argument_globali_l28.omp_outlined
373 // CHECK1-SAME: (ptr noalias noundef [[DOTGLOBAL_TID_:%.*]], ptr noalias noundef [[DOTBOUND_TID_:%.*]], ptr noundef nonnull align 4 dereferenceable(4) [[N:%.*]], ptr noundef nonnull align 4 dereferenceable(400) [[A:%.*]]) #[[ATTR1]] {
374 // CHECK1-NEXT: entry:
375 // CHECK1-NEXT: [[DOTGLOBAL_TID__ADDR:%.*]] = alloca ptr, align 8
376 // CHECK1-NEXT: [[DOTBOUND_TID__ADDR:%.*]] = alloca ptr, align 8
377 // CHECK1-NEXT: [[N_ADDR:%.*]] = alloca ptr, align 8
378 // CHECK1-NEXT: [[A_ADDR:%.*]] = alloca ptr, align 8
379 // CHECK1-NEXT: [[DOTOMP_IV:%.*]] = alloca i32, align 4
380 // CHECK1-NEXT: [[TMP:%.*]] = alloca i32, align 4
381 // CHECK1-NEXT: [[DOTCAPTURE_EXPR_:%.*]] = alloca i32, align 4
382 // CHECK1-NEXT: [[DOTCAPTURE_EXPR_1:%.*]] = alloca i32, align 4
383 // CHECK1-NEXT: [[I:%.*]] = alloca i32, align 4
384 // CHECK1-NEXT: [[DOTOMP_COMB_LB:%.*]] = alloca i32, align 4
385 // CHECK1-NEXT: [[DOTOMP_COMB_UB:%.*]] = alloca i32, align 4
386 // CHECK1-NEXT: [[DOTOMP_STRIDE:%.*]] = alloca i32, align 4
387 // CHECK1-NEXT: [[DOTOMP_IS_LAST:%.*]] = alloca i32, align 4
388 // CHECK1-NEXT: [[I3:%.*]] = alloca i32, align 4
389 // CHECK1-NEXT: store ptr [[DOTGLOBAL_TID_]], ptr [[DOTGLOBAL_TID__ADDR]], align 8
390 // CHECK1-NEXT: store ptr [[DOTBOUND_TID_]], ptr [[DOTBOUND_TID__ADDR]], align 8
391 // CHECK1-NEXT: store ptr [[N]], ptr [[N_ADDR]], align 8
392 // CHECK1-NEXT: store ptr [[A]], ptr [[A_ADDR]], align 8
393 // CHECK1-NEXT: [[TMP0:%.*]] = load ptr, ptr [[N_ADDR]], align 8
394 // CHECK1-NEXT: [[TMP1:%.*]] = load ptr, ptr [[A_ADDR]], align 8
395 // CHECK1-NEXT: [[TMP2:%.*]] = load i32, ptr [[TMP0]], align 4
396 // CHECK1-NEXT: store i32 [[TMP2]], ptr [[DOTCAPTURE_EXPR_]], align 4
397 // CHECK1-NEXT: [[TMP3:%.*]] = load i32, ptr [[DOTCAPTURE_EXPR_]], align 4
398 // CHECK1-NEXT: [[SUB:%.*]] = sub nsw i32 [[TMP3]], 0
399 // CHECK1-NEXT: [[DIV:%.*]] = sdiv i32 [[SUB]], 1
400 // CHECK1-NEXT: [[SUB2:%.*]] = sub nsw i32 [[DIV]], 1
401 // CHECK1-NEXT: store i32 [[SUB2]], ptr [[DOTCAPTURE_EXPR_1]], align 4
402 // CHECK1-NEXT: store i32 0, ptr [[I]], align 4
403 // CHECK1-NEXT: [[TMP4:%.*]] = load i32, ptr [[DOTCAPTURE_EXPR_]], align 4
404 // CHECK1-NEXT: [[CMP:%.*]] = icmp slt i32 0, [[TMP4]]
405 // CHECK1-NEXT: br i1 [[CMP]], label [[OMP_PRECOND_THEN:%.*]], label [[OMP_PRECOND_END:%.*]]
406 // CHECK1: omp.precond.then:
407 // CHECK1-NEXT: store i32 0, ptr [[DOTOMP_COMB_LB]], align 4
408 // CHECK1-NEXT: [[TMP5:%.*]] = load i32, ptr [[DOTCAPTURE_EXPR_1]], align 4
409 // CHECK1-NEXT: store i32 [[TMP5]], ptr [[DOTOMP_COMB_UB]], align 4
410 // CHECK1-NEXT: store i32 1, ptr [[DOTOMP_STRIDE]], align 4
411 // CHECK1-NEXT: store i32 0, ptr [[DOTOMP_IS_LAST]], align 4
412 // CHECK1-NEXT: [[TMP6:%.*]] = load ptr, ptr [[DOTGLOBAL_TID__ADDR]], align 8
413 // CHECK1-NEXT: [[TMP7:%.*]] = load i32, ptr [[TMP6]], align 4
414 // CHECK1-NEXT: call void @__kmpc_for_static_init_4(ptr @[[GLOB1:[0-9]+]], i32 [[TMP7]], i32 92, ptr [[DOTOMP_IS_LAST]], ptr [[DOTOMP_COMB_LB]], ptr [[DOTOMP_COMB_UB]], ptr [[DOTOMP_STRIDE]], i32 1, i32 1)
415 // CHECK1-NEXT: [[TMP8:%.*]] = load i32, ptr [[DOTOMP_COMB_UB]], align 4
416 // CHECK1-NEXT: [[TMP9:%.*]] = load i32, ptr [[DOTCAPTURE_EXPR_1]], align 4
417 // CHECK1-NEXT: [[CMP4:%.*]] = icmp sgt i32 [[TMP8]], [[TMP9]]
418 // CHECK1-NEXT: br i1 [[CMP4]], label [[COND_TRUE:%.*]], label [[COND_FALSE:%.*]]
419 // CHECK1: cond.true:
420 // CHECK1-NEXT: [[TMP10:%.*]] = load i32, ptr [[DOTCAPTURE_EXPR_1]], align 4
421 // CHECK1-NEXT: br label [[COND_END:%.*]]
422 // CHECK1: cond.false:
423 // CHECK1-NEXT: [[TMP11:%.*]] = load i32, ptr [[DOTOMP_COMB_UB]], align 4
424 // CHECK1-NEXT: br label [[COND_END]]
426 // CHECK1-NEXT: [[COND:%.*]] = phi i32 [ [[TMP10]], [[COND_TRUE]] ], [ [[TMP11]], [[COND_FALSE]] ]
427 // CHECK1-NEXT: store i32 [[COND]], ptr [[DOTOMP_COMB_UB]], align 4
428 // CHECK1-NEXT: [[TMP12:%.*]] = load i32, ptr [[DOTOMP_COMB_LB]], align 4
429 // CHECK1-NEXT: store i32 [[TMP12]], ptr [[DOTOMP_IV]], align 4
430 // CHECK1-NEXT: br label [[OMP_INNER_FOR_COND:%.*]]
431 // CHECK1: omp.inner.for.cond:
432 // CHECK1-NEXT: [[TMP13:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4
433 // CHECK1-NEXT: [[TMP14:%.*]] = load i32, ptr [[DOTOMP_COMB_UB]], align 4
434 // CHECK1-NEXT: [[CMP5:%.*]] = icmp sle i32 [[TMP13]], [[TMP14]]
435 // CHECK1-NEXT: br i1 [[CMP5]], label [[OMP_INNER_FOR_BODY:%.*]], label [[OMP_INNER_FOR_END:%.*]]
436 // CHECK1: omp.inner.for.body:
437 // CHECK1-NEXT: [[TMP15:%.*]] = load i32, ptr [[DOTOMP_COMB_LB]], align 4
438 // CHECK1-NEXT: [[TMP16:%.*]] = zext i32 [[TMP15]] to i64
439 // CHECK1-NEXT: [[TMP17:%.*]] = load i32, ptr [[DOTOMP_COMB_UB]], align 4
440 // CHECK1-NEXT: [[TMP18:%.*]] = zext i32 [[TMP17]] to i64
441 // CHECK1-NEXT: call void (ptr, i32, ptr, ...) @__kmpc_fork_call(ptr @[[GLOB3]], i32 4, ptr @{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z21teams_argument_globali_l28.omp_outlined.omp_outlined, i64 [[TMP16]], i64 [[TMP18]], ptr [[TMP0]], ptr [[TMP1]])
442 // CHECK1-NEXT: br label [[OMP_INNER_FOR_INC:%.*]]
443 // CHECK1: omp.inner.for.inc:
444 // CHECK1-NEXT: [[TMP19:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4
445 // CHECK1-NEXT: [[TMP20:%.*]] = load i32, ptr [[DOTOMP_STRIDE]], align 4
446 // CHECK1-NEXT: [[ADD:%.*]] = add nsw i32 [[TMP19]], [[TMP20]]
447 // CHECK1-NEXT: store i32 [[ADD]], ptr [[DOTOMP_IV]], align 4
448 // CHECK1-NEXT: br label [[OMP_INNER_FOR_COND]]
449 // CHECK1: omp.inner.for.end:
450 // CHECK1-NEXT: br label [[OMP_LOOP_EXIT:%.*]]
451 // CHECK1: omp.loop.exit:
452 // CHECK1-NEXT: [[TMP21:%.*]] = load ptr, ptr [[DOTGLOBAL_TID__ADDR]], align 8
453 // CHECK1-NEXT: [[TMP22:%.*]] = load i32, ptr [[TMP21]], align 4
454 // CHECK1-NEXT: call void @__kmpc_for_static_fini(ptr @[[GLOB2:[0-9]+]], i32 [[TMP22]])
455 // CHECK1-NEXT: br label [[OMP_PRECOND_END]]
456 // CHECK1: omp.precond.end:
457 // CHECK1-NEXT: ret void
460 // CHECK1-LABEL: define {{[^@]+}}@{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z21teams_argument_globali_l28.omp_outlined.omp_outlined
461 // CHECK1-SAME: (ptr noalias noundef [[DOTGLOBAL_TID_:%.*]], ptr noalias noundef [[DOTBOUND_TID_:%.*]], i64 noundef [[DOTPREVIOUS_LB_:%.*]], i64 noundef [[DOTPREVIOUS_UB_:%.*]], ptr noundef nonnull align 4 dereferenceable(4) [[N:%.*]], ptr noundef nonnull align 4 dereferenceable(400) [[A:%.*]]) #[[ATTR1]] {
462 // CHECK1-NEXT: entry:
463 // CHECK1-NEXT: [[DOTGLOBAL_TID__ADDR:%.*]] = alloca ptr, align 8
464 // CHECK1-NEXT: [[DOTBOUND_TID__ADDR:%.*]] = alloca ptr, align 8
465 // CHECK1-NEXT: [[DOTPREVIOUS_LB__ADDR:%.*]] = alloca i64, align 8
466 // CHECK1-NEXT: [[DOTPREVIOUS_UB__ADDR:%.*]] = alloca i64, align 8
467 // CHECK1-NEXT: [[N_ADDR:%.*]] = alloca ptr, align 8
468 // CHECK1-NEXT: [[A_ADDR:%.*]] = alloca ptr, align 8
469 // CHECK1-NEXT: [[DOTOMP_IV:%.*]] = alloca i32, align 4
470 // CHECK1-NEXT: [[TMP:%.*]] = alloca i32, align 4
471 // CHECK1-NEXT: [[DOTCAPTURE_EXPR_:%.*]] = alloca i32, align 4
472 // CHECK1-NEXT: [[DOTCAPTURE_EXPR_1:%.*]] = alloca i32, align 4
473 // CHECK1-NEXT: [[I:%.*]] = alloca i32, align 4
474 // CHECK1-NEXT: [[DOTOMP_LB:%.*]] = alloca i32, align 4
475 // CHECK1-NEXT: [[DOTOMP_UB:%.*]] = alloca i32, align 4
476 // CHECK1-NEXT: [[DOTOMP_STRIDE:%.*]] = alloca i32, align 4
477 // CHECK1-NEXT: [[DOTOMP_IS_LAST:%.*]] = alloca i32, align 4
478 // CHECK1-NEXT: [[I4:%.*]] = alloca i32, align 4
479 // CHECK1-NEXT: store ptr [[DOTGLOBAL_TID_]], ptr [[DOTGLOBAL_TID__ADDR]], align 8
480 // CHECK1-NEXT: store ptr [[DOTBOUND_TID_]], ptr [[DOTBOUND_TID__ADDR]], align 8
481 // CHECK1-NEXT: store i64 [[DOTPREVIOUS_LB_]], ptr [[DOTPREVIOUS_LB__ADDR]], align 8
482 // CHECK1-NEXT: store i64 [[DOTPREVIOUS_UB_]], ptr [[DOTPREVIOUS_UB__ADDR]], align 8
483 // CHECK1-NEXT: store ptr [[N]], ptr [[N_ADDR]], align 8
484 // CHECK1-NEXT: store ptr [[A]], ptr [[A_ADDR]], align 8
485 // CHECK1-NEXT: [[TMP0:%.*]] = load ptr, ptr [[N_ADDR]], align 8
486 // CHECK1-NEXT: [[TMP1:%.*]] = load ptr, ptr [[A_ADDR]], align 8
487 // CHECK1-NEXT: [[TMP2:%.*]] = load i32, ptr [[TMP0]], align 4
488 // CHECK1-NEXT: store i32 [[TMP2]], ptr [[DOTCAPTURE_EXPR_]], align 4
489 // CHECK1-NEXT: [[TMP3:%.*]] = load i32, ptr [[DOTCAPTURE_EXPR_]], align 4
490 // CHECK1-NEXT: [[SUB:%.*]] = sub nsw i32 [[TMP3]], 0
491 // CHECK1-NEXT: [[DIV:%.*]] = sdiv i32 [[SUB]], 1
492 // CHECK1-NEXT: [[SUB2:%.*]] = sub nsw i32 [[DIV]], 1
493 // CHECK1-NEXT: store i32 [[SUB2]], ptr [[DOTCAPTURE_EXPR_1]], align 4
494 // CHECK1-NEXT: store i32 0, ptr [[I]], align 4
495 // CHECK1-NEXT: [[TMP4:%.*]] = load i32, ptr [[DOTCAPTURE_EXPR_]], align 4
496 // CHECK1-NEXT: [[CMP:%.*]] = icmp slt i32 0, [[TMP4]]
497 // CHECK1-NEXT: br i1 [[CMP]], label [[OMP_PRECOND_THEN:%.*]], label [[OMP_PRECOND_END:%.*]]
498 // CHECK1: omp.precond.then:
499 // CHECK1-NEXT: store i32 0, ptr [[DOTOMP_LB]], align 4
500 // CHECK1-NEXT: [[TMP5:%.*]] = load i32, ptr [[DOTCAPTURE_EXPR_1]], align 4
501 // CHECK1-NEXT: store i32 [[TMP5]], ptr [[DOTOMP_UB]], align 4
502 // CHECK1-NEXT: [[TMP6:%.*]] = load i64, ptr [[DOTPREVIOUS_LB__ADDR]], align 8
503 // CHECK1-NEXT: [[CONV:%.*]] = trunc i64 [[TMP6]] to i32
504 // CHECK1-NEXT: [[TMP7:%.*]] = load i64, ptr [[DOTPREVIOUS_UB__ADDR]], align 8
505 // CHECK1-NEXT: [[CONV3:%.*]] = trunc i64 [[TMP7]] to i32
506 // CHECK1-NEXT: store i32 [[CONV]], ptr [[DOTOMP_LB]], align 4
507 // CHECK1-NEXT: store i32 [[CONV3]], ptr [[DOTOMP_UB]], align 4
508 // CHECK1-NEXT: store i32 1, ptr [[DOTOMP_STRIDE]], align 4
509 // CHECK1-NEXT: store i32 0, ptr [[DOTOMP_IS_LAST]], align 4
510 // CHECK1-NEXT: [[TMP8:%.*]] = load ptr, ptr [[DOTGLOBAL_TID__ADDR]], align 8
511 // CHECK1-NEXT: [[TMP9:%.*]] = load i32, ptr [[TMP8]], align 4
512 // CHECK1-NEXT: call void @__kmpc_for_static_init_4(ptr @[[GLOB2]], i32 [[TMP9]], i32 34, ptr [[DOTOMP_IS_LAST]], ptr [[DOTOMP_LB]], ptr [[DOTOMP_UB]], ptr [[DOTOMP_STRIDE]], i32 1, i32 1)
513 // CHECK1-NEXT: [[TMP10:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4
514 // CHECK1-NEXT: [[TMP11:%.*]] = load i32, ptr [[DOTCAPTURE_EXPR_1]], align 4
515 // CHECK1-NEXT: [[CMP5:%.*]] = icmp sgt i32 [[TMP10]], [[TMP11]]
516 // CHECK1-NEXT: br i1 [[CMP5]], label [[COND_TRUE:%.*]], label [[COND_FALSE:%.*]]
517 // CHECK1: cond.true:
518 // CHECK1-NEXT: [[TMP12:%.*]] = load i32, ptr [[DOTCAPTURE_EXPR_1]], align 4
519 // CHECK1-NEXT: br label [[COND_END:%.*]]
520 // CHECK1: cond.false:
521 // CHECK1-NEXT: [[TMP13:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4
522 // CHECK1-NEXT: br label [[COND_END]]
524 // CHECK1-NEXT: [[COND:%.*]] = phi i32 [ [[TMP12]], [[COND_TRUE]] ], [ [[TMP13]], [[COND_FALSE]] ]
525 // CHECK1-NEXT: store i32 [[COND]], ptr [[DOTOMP_UB]], align 4
526 // CHECK1-NEXT: [[TMP14:%.*]] = load i32, ptr [[DOTOMP_LB]], align 4
527 // CHECK1-NEXT: store i32 [[TMP14]], ptr [[DOTOMP_IV]], align 4
528 // CHECK1-NEXT: br label [[OMP_INNER_FOR_COND:%.*]]
529 // CHECK1: omp.inner.for.cond:
530 // CHECK1-NEXT: [[TMP15:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4
531 // CHECK1-NEXT: [[TMP16:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4
532 // CHECK1-NEXT: [[CMP6:%.*]] = icmp sle i32 [[TMP15]], [[TMP16]]
533 // CHECK1-NEXT: br i1 [[CMP6]], label [[OMP_INNER_FOR_BODY:%.*]], label [[OMP_INNER_FOR_END:%.*]]
534 // CHECK1: omp.inner.for.body:
535 // CHECK1-NEXT: [[TMP17:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4
536 // CHECK1-NEXT: [[MUL:%.*]] = mul nsw i32 [[TMP17]], 1
537 // CHECK1-NEXT: [[ADD:%.*]] = add nsw i32 0, [[MUL]]
538 // CHECK1-NEXT: store i32 [[ADD]], ptr [[I4]], align 4
539 // CHECK1-NEXT: [[TMP18:%.*]] = load i32, ptr [[I4]], align 4
540 // CHECK1-NEXT: [[IDXPROM:%.*]] = sext i32 [[TMP18]] to i64
541 // CHECK1-NEXT: [[ARRAYIDX:%.*]] = getelementptr inbounds [100 x i32], ptr [[TMP1]], i64 0, i64 [[IDXPROM]]
542 // CHECK1-NEXT: store i32 0, ptr [[ARRAYIDX]], align 4
543 // CHECK1-NEXT: br label [[OMP_BODY_CONTINUE:%.*]]
544 // CHECK1: omp.body.continue:
545 // CHECK1-NEXT: br label [[OMP_INNER_FOR_INC:%.*]]
546 // CHECK1: omp.inner.for.inc:
547 // CHECK1-NEXT: [[TMP19:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4
548 // CHECK1-NEXT: [[ADD7:%.*]] = add nsw i32 [[TMP19]], 1
549 // CHECK1-NEXT: store i32 [[ADD7]], ptr [[DOTOMP_IV]], align 4
550 // CHECK1-NEXT: br label [[OMP_INNER_FOR_COND]]
551 // CHECK1: omp.inner.for.end:
552 // CHECK1-NEXT: br label [[OMP_LOOP_EXIT:%.*]]
553 // CHECK1: omp.loop.exit:
554 // CHECK1-NEXT: [[TMP20:%.*]] = load ptr, ptr [[DOTGLOBAL_TID__ADDR]], align 8
555 // CHECK1-NEXT: [[TMP21:%.*]] = load i32, ptr [[TMP20]], align 4
556 // CHECK1-NEXT: call void @__kmpc_for_static_fini(ptr @[[GLOB2]], i32 [[TMP21]])
557 // CHECK1-NEXT: br label [[OMP_PRECOND_END]]
558 // CHECK1: omp.precond.end:
559 // CHECK1-NEXT: ret void
562 // CHECK1-LABEL: define {{[^@]+}}@{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z21teams_argument_globali_l34
563 // CHECK1-SAME: (i64 noundef [[N:%.*]], ptr noundef nonnull align 4 dereferenceable(400) [[A:%.*]]) #[[ATTR3:[0-9]+]] {
564 // CHECK1-NEXT: entry:
565 // CHECK1-NEXT: [[N_ADDR:%.*]] = alloca i64, align 8
566 // CHECK1-NEXT: [[A_ADDR:%.*]] = alloca ptr, align 8
567 // CHECK1-NEXT: store i64 [[N]], ptr [[N_ADDR]], align 8
568 // CHECK1-NEXT: store ptr [[A]], ptr [[A_ADDR]], align 8
569 // CHECK1-NEXT: [[TMP0:%.*]] = load ptr, ptr [[A_ADDR]], align 8
570 // CHECK1-NEXT: call void (ptr, i32, ptr, ...) @__kmpc_fork_teams(ptr @[[GLOB3]], i32 2, ptr @{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z21teams_argument_globali_l34.omp_outlined, ptr [[N_ADDR]], ptr [[TMP0]])
571 // CHECK1-NEXT: ret void
574 // CHECK1-LABEL: define {{[^@]+}}@{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z21teams_argument_globali_l34.omp_outlined
575 // CHECK1-SAME: (ptr noalias noundef [[DOTGLOBAL_TID_:%.*]], ptr noalias noundef [[DOTBOUND_TID_:%.*]], ptr noundef nonnull align 4 dereferenceable(4) [[N:%.*]], ptr noundef nonnull align 4 dereferenceable(400) [[A:%.*]]) #[[ATTR1]] {
576 // CHECK1-NEXT: entry:
577 // CHECK1-NEXT: [[DOTGLOBAL_TID__ADDR:%.*]] = alloca ptr, align 8
578 // CHECK1-NEXT: [[DOTBOUND_TID__ADDR:%.*]] = alloca ptr, align 8
579 // CHECK1-NEXT: [[N_ADDR:%.*]] = alloca ptr, align 8
580 // CHECK1-NEXT: [[A_ADDR:%.*]] = alloca ptr, align 8
581 // CHECK1-NEXT: [[DOTOMP_IV:%.*]] = alloca i32, align 4
582 // CHECK1-NEXT: [[TMP:%.*]] = alloca i32, align 4
583 // CHECK1-NEXT: [[DOTCAPTURE_EXPR_:%.*]] = alloca i32, align 4
584 // CHECK1-NEXT: [[DOTCAPTURE_EXPR_1:%.*]] = alloca i32, align 4
585 // CHECK1-NEXT: [[I:%.*]] = alloca i32, align 4
586 // CHECK1-NEXT: [[DOTOMP_COMB_LB:%.*]] = alloca i32, align 4
587 // CHECK1-NEXT: [[DOTOMP_COMB_UB:%.*]] = alloca i32, align 4
588 // CHECK1-NEXT: [[DOTOMP_STRIDE:%.*]] = alloca i32, align 4
589 // CHECK1-NEXT: [[DOTOMP_IS_LAST:%.*]] = alloca i32, align 4
590 // CHECK1-NEXT: [[I3:%.*]] = alloca i32, align 4
591 // CHECK1-NEXT: store ptr [[DOTGLOBAL_TID_]], ptr [[DOTGLOBAL_TID__ADDR]], align 8
592 // CHECK1-NEXT: store ptr [[DOTBOUND_TID_]], ptr [[DOTBOUND_TID__ADDR]], align 8
593 // CHECK1-NEXT: store ptr [[N]], ptr [[N_ADDR]], align 8
594 // CHECK1-NEXT: store ptr [[A]], ptr [[A_ADDR]], align 8
595 // CHECK1-NEXT: [[TMP0:%.*]] = load ptr, ptr [[N_ADDR]], align 8
596 // CHECK1-NEXT: [[TMP1:%.*]] = load ptr, ptr [[A_ADDR]], align 8
597 // CHECK1-NEXT: [[TMP2:%.*]] = load i32, ptr [[TMP0]], align 4
598 // CHECK1-NEXT: store i32 [[TMP2]], ptr [[DOTCAPTURE_EXPR_]], align 4
599 // CHECK1-NEXT: [[TMP3:%.*]] = load i32, ptr [[DOTCAPTURE_EXPR_]], align 4
600 // CHECK1-NEXT: [[SUB:%.*]] = sub nsw i32 [[TMP3]], 0
601 // CHECK1-NEXT: [[DIV:%.*]] = sdiv i32 [[SUB]], 1
602 // CHECK1-NEXT: [[SUB2:%.*]] = sub nsw i32 [[DIV]], 1
603 // CHECK1-NEXT: store i32 [[SUB2]], ptr [[DOTCAPTURE_EXPR_1]], align 4
604 // CHECK1-NEXT: store i32 0, ptr [[I]], align 4
605 // CHECK1-NEXT: [[TMP4:%.*]] = load i32, ptr [[DOTCAPTURE_EXPR_]], align 4
606 // CHECK1-NEXT: [[CMP:%.*]] = icmp slt i32 0, [[TMP4]]
607 // CHECK1-NEXT: br i1 [[CMP]], label [[OMP_PRECOND_THEN:%.*]], label [[OMP_PRECOND_END:%.*]]
608 // CHECK1: omp.precond.then:
609 // CHECK1-NEXT: store i32 0, ptr [[DOTOMP_COMB_LB]], align 4
610 // CHECK1-NEXT: [[TMP5:%.*]] = load i32, ptr [[DOTCAPTURE_EXPR_1]], align 4
611 // CHECK1-NEXT: store i32 [[TMP5]], ptr [[DOTOMP_COMB_UB]], align 4
612 // CHECK1-NEXT: store i32 1, ptr [[DOTOMP_STRIDE]], align 4
613 // CHECK1-NEXT: store i32 0, ptr [[DOTOMP_IS_LAST]], align 4
614 // CHECK1-NEXT: [[TMP6:%.*]] = load ptr, ptr [[DOTGLOBAL_TID__ADDR]], align 8
615 // CHECK1-NEXT: [[TMP7:%.*]] = load i32, ptr [[TMP6]], align 4
616 // CHECK1-NEXT: call void @__kmpc_for_static_init_4(ptr @[[GLOB1]], i32 [[TMP7]], i32 92, ptr [[DOTOMP_IS_LAST]], ptr [[DOTOMP_COMB_LB]], ptr [[DOTOMP_COMB_UB]], ptr [[DOTOMP_STRIDE]], i32 1, i32 1)
617 // CHECK1-NEXT: [[TMP8:%.*]] = load i32, ptr [[DOTOMP_COMB_UB]], align 4
618 // CHECK1-NEXT: [[TMP9:%.*]] = load i32, ptr [[DOTCAPTURE_EXPR_1]], align 4
619 // CHECK1-NEXT: [[CMP4:%.*]] = icmp sgt i32 [[TMP8]], [[TMP9]]
620 // CHECK1-NEXT: br i1 [[CMP4]], label [[COND_TRUE:%.*]], label [[COND_FALSE:%.*]]
621 // CHECK1: cond.true:
622 // CHECK1-NEXT: [[TMP10:%.*]] = load i32, ptr [[DOTCAPTURE_EXPR_1]], align 4
623 // CHECK1-NEXT: br label [[COND_END:%.*]]
624 // CHECK1: cond.false:
625 // CHECK1-NEXT: [[TMP11:%.*]] = load i32, ptr [[DOTOMP_COMB_UB]], align 4
626 // CHECK1-NEXT: br label [[COND_END]]
628 // CHECK1-NEXT: [[COND:%.*]] = phi i32 [ [[TMP10]], [[COND_TRUE]] ], [ [[TMP11]], [[COND_FALSE]] ]
629 // CHECK1-NEXT: store i32 [[COND]], ptr [[DOTOMP_COMB_UB]], align 4
630 // CHECK1-NEXT: [[TMP12:%.*]] = load i32, ptr [[DOTOMP_COMB_LB]], align 4
631 // CHECK1-NEXT: store i32 [[TMP12]], ptr [[DOTOMP_IV]], align 4
632 // CHECK1-NEXT: br label [[OMP_INNER_FOR_COND:%.*]]
633 // CHECK1: omp.inner.for.cond:
634 // CHECK1-NEXT: [[TMP13:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4
635 // CHECK1-NEXT: [[TMP14:%.*]] = load i32, ptr [[DOTOMP_COMB_UB]], align 4
636 // CHECK1-NEXT: [[CMP5:%.*]] = icmp sle i32 [[TMP13]], [[TMP14]]
637 // CHECK1-NEXT: br i1 [[CMP5]], label [[OMP_INNER_FOR_BODY:%.*]], label [[OMP_INNER_FOR_END:%.*]]
638 // CHECK1: omp.inner.for.body:
639 // CHECK1-NEXT: [[TMP15:%.*]] = load i32, ptr [[DOTOMP_COMB_LB]], align 4
640 // CHECK1-NEXT: [[TMP16:%.*]] = zext i32 [[TMP15]] to i64
641 // CHECK1-NEXT: [[TMP17:%.*]] = load i32, ptr [[DOTOMP_COMB_UB]], align 4
642 // CHECK1-NEXT: [[TMP18:%.*]] = zext i32 [[TMP17]] to i64
643 // CHECK1-NEXT: call void (ptr, i32, ptr, ...) @__kmpc_fork_call(ptr @[[GLOB3]], i32 4, ptr @{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z21teams_argument_globali_l34.omp_outlined.omp_outlined, i64 [[TMP16]], i64 [[TMP18]], ptr [[TMP0]], ptr [[TMP1]])
644 // CHECK1-NEXT: br label [[OMP_INNER_FOR_INC:%.*]]
645 // CHECK1: omp.inner.for.inc:
646 // CHECK1-NEXT: [[TMP19:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4
647 // CHECK1-NEXT: [[TMP20:%.*]] = load i32, ptr [[DOTOMP_STRIDE]], align 4
648 // CHECK1-NEXT: [[ADD:%.*]] = add nsw i32 [[TMP19]], [[TMP20]]
649 // CHECK1-NEXT: store i32 [[ADD]], ptr [[DOTOMP_IV]], align 4
650 // CHECK1-NEXT: br label [[OMP_INNER_FOR_COND]]
651 // CHECK1: omp.inner.for.end:
652 // CHECK1-NEXT: br label [[OMP_LOOP_EXIT:%.*]]
653 // CHECK1: omp.loop.exit:
654 // CHECK1-NEXT: [[TMP21:%.*]] = load ptr, ptr [[DOTGLOBAL_TID__ADDR]], align 8
655 // CHECK1-NEXT: [[TMP22:%.*]] = load i32, ptr [[TMP21]], align 4
656 // CHECK1-NEXT: call void @__kmpc_for_static_fini(ptr @[[GLOB2]], i32 [[TMP22]])
657 // CHECK1-NEXT: br label [[OMP_PRECOND_END]]
658 // CHECK1: omp.precond.end:
659 // CHECK1-NEXT: ret void
662 // CHECK1-LABEL: define {{[^@]+}}@{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z21teams_argument_globali_l34.omp_outlined.omp_outlined
663 // CHECK1-SAME: (ptr noalias noundef [[DOTGLOBAL_TID_:%.*]], ptr noalias noundef [[DOTBOUND_TID_:%.*]], i64 noundef [[DOTPREVIOUS_LB_:%.*]], i64 noundef [[DOTPREVIOUS_UB_:%.*]], ptr noundef nonnull align 4 dereferenceable(4) [[N:%.*]], ptr noundef nonnull align 4 dereferenceable(400) [[A:%.*]]) #[[ATTR1]] {
664 // CHECK1-NEXT: entry:
665 // CHECK1-NEXT: [[DOTGLOBAL_TID__ADDR:%.*]] = alloca ptr, align 8
666 // CHECK1-NEXT: [[DOTBOUND_TID__ADDR:%.*]] = alloca ptr, align 8
667 // CHECK1-NEXT: [[DOTPREVIOUS_LB__ADDR:%.*]] = alloca i64, align 8
668 // CHECK1-NEXT: [[DOTPREVIOUS_UB__ADDR:%.*]] = alloca i64, align 8
669 // CHECK1-NEXT: [[N_ADDR:%.*]] = alloca ptr, align 8
670 // CHECK1-NEXT: [[A_ADDR:%.*]] = alloca ptr, align 8
671 // CHECK1-NEXT: [[DOTOMP_IV:%.*]] = alloca i32, align 4
672 // CHECK1-NEXT: [[TMP:%.*]] = alloca i32, align 4
673 // CHECK1-NEXT: [[DOTCAPTURE_EXPR_:%.*]] = alloca i32, align 4
674 // CHECK1-NEXT: [[DOTCAPTURE_EXPR_1:%.*]] = alloca i32, align 4
675 // CHECK1-NEXT: [[I:%.*]] = alloca i32, align 4
676 // CHECK1-NEXT: [[DOTOMP_LB:%.*]] = alloca i32, align 4
677 // CHECK1-NEXT: [[DOTOMP_UB:%.*]] = alloca i32, align 4
678 // CHECK1-NEXT: [[DOTOMP_STRIDE:%.*]] = alloca i32, align 4
679 // CHECK1-NEXT: [[DOTOMP_IS_LAST:%.*]] = alloca i32, align 4
680 // CHECK1-NEXT: [[I4:%.*]] = alloca i32, align 4
681 // CHECK1-NEXT: store ptr [[DOTGLOBAL_TID_]], ptr [[DOTGLOBAL_TID__ADDR]], align 8
682 // CHECK1-NEXT: store ptr [[DOTBOUND_TID_]], ptr [[DOTBOUND_TID__ADDR]], align 8
683 // CHECK1-NEXT: store i64 [[DOTPREVIOUS_LB_]], ptr [[DOTPREVIOUS_LB__ADDR]], align 8
684 // CHECK1-NEXT: store i64 [[DOTPREVIOUS_UB_]], ptr [[DOTPREVIOUS_UB__ADDR]], align 8
685 // CHECK1-NEXT: store ptr [[N]], ptr [[N_ADDR]], align 8
686 // CHECK1-NEXT: store ptr [[A]], ptr [[A_ADDR]], align 8
687 // CHECK1-NEXT: [[TMP0:%.*]] = load ptr, ptr [[N_ADDR]], align 8
688 // CHECK1-NEXT: [[TMP1:%.*]] = load ptr, ptr [[A_ADDR]], align 8
689 // CHECK1-NEXT: [[TMP2:%.*]] = load i32, ptr [[TMP0]], align 4
690 // CHECK1-NEXT: store i32 [[TMP2]], ptr [[DOTCAPTURE_EXPR_]], align 4
691 // CHECK1-NEXT: [[TMP3:%.*]] = load i32, ptr [[DOTCAPTURE_EXPR_]], align 4
692 // CHECK1-NEXT: [[SUB:%.*]] = sub nsw i32 [[TMP3]], 0
693 // CHECK1-NEXT: [[DIV:%.*]] = sdiv i32 [[SUB]], 1
694 // CHECK1-NEXT: [[SUB2:%.*]] = sub nsw i32 [[DIV]], 1
695 // CHECK1-NEXT: store i32 [[SUB2]], ptr [[DOTCAPTURE_EXPR_1]], align 4
696 // CHECK1-NEXT: store i32 0, ptr [[I]], align 4
697 // CHECK1-NEXT: [[TMP4:%.*]] = load i32, ptr [[DOTCAPTURE_EXPR_]], align 4
698 // CHECK1-NEXT: [[CMP:%.*]] = icmp slt i32 0, [[TMP4]]
699 // CHECK1-NEXT: br i1 [[CMP]], label [[OMP_PRECOND_THEN:%.*]], label [[OMP_PRECOND_END:%.*]]
700 // CHECK1: omp.precond.then:
701 // CHECK1-NEXT: store i32 0, ptr [[DOTOMP_LB]], align 4
702 // CHECK1-NEXT: [[TMP5:%.*]] = load i32, ptr [[DOTCAPTURE_EXPR_1]], align 4
703 // CHECK1-NEXT: store i32 [[TMP5]], ptr [[DOTOMP_UB]], align 4
704 // CHECK1-NEXT: [[TMP6:%.*]] = load i64, ptr [[DOTPREVIOUS_LB__ADDR]], align 8
705 // CHECK1-NEXT: [[CONV:%.*]] = trunc i64 [[TMP6]] to i32
706 // CHECK1-NEXT: [[TMP7:%.*]] = load i64, ptr [[DOTPREVIOUS_UB__ADDR]], align 8
707 // CHECK1-NEXT: [[CONV3:%.*]] = trunc i64 [[TMP7]] to i32
708 // CHECK1-NEXT: store i32 [[CONV]], ptr [[DOTOMP_LB]], align 4
709 // CHECK1-NEXT: store i32 [[CONV3]], ptr [[DOTOMP_UB]], align 4
710 // CHECK1-NEXT: store i32 1, ptr [[DOTOMP_STRIDE]], align 4
711 // CHECK1-NEXT: store i32 0, ptr [[DOTOMP_IS_LAST]], align 4
712 // CHECK1-NEXT: [[TMP8:%.*]] = load ptr, ptr [[DOTGLOBAL_TID__ADDR]], align 8
713 // CHECK1-NEXT: [[TMP9:%.*]] = load i32, ptr [[TMP8]], align 4
714 // CHECK1-NEXT: call void @__kmpc_for_static_init_4(ptr @[[GLOB2]], i32 [[TMP9]], i32 34, ptr [[DOTOMP_IS_LAST]], ptr [[DOTOMP_LB]], ptr [[DOTOMP_UB]], ptr [[DOTOMP_STRIDE]], i32 1, i32 1)
715 // CHECK1-NEXT: [[TMP10:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4
716 // CHECK1-NEXT: [[TMP11:%.*]] = load i32, ptr [[DOTCAPTURE_EXPR_1]], align 4
717 // CHECK1-NEXT: [[CMP5:%.*]] = icmp sgt i32 [[TMP10]], [[TMP11]]
718 // CHECK1-NEXT: br i1 [[CMP5]], label [[COND_TRUE:%.*]], label [[COND_FALSE:%.*]]
719 // CHECK1: cond.true:
720 // CHECK1-NEXT: [[TMP12:%.*]] = load i32, ptr [[DOTCAPTURE_EXPR_1]], align 4
721 // CHECK1-NEXT: br label [[COND_END:%.*]]
722 // CHECK1: cond.false:
723 // CHECK1-NEXT: [[TMP13:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4
724 // CHECK1-NEXT: br label [[COND_END]]
726 // CHECK1-NEXT: [[COND:%.*]] = phi i32 [ [[TMP12]], [[COND_TRUE]] ], [ [[TMP13]], [[COND_FALSE]] ]
727 // CHECK1-NEXT: store i32 [[COND]], ptr [[DOTOMP_UB]], align 4
728 // CHECK1-NEXT: [[TMP14:%.*]] = load i32, ptr [[DOTOMP_LB]], align 4
729 // CHECK1-NEXT: store i32 [[TMP14]], ptr [[DOTOMP_IV]], align 4
730 // CHECK1-NEXT: br label [[OMP_INNER_FOR_COND:%.*]]
731 // CHECK1: omp.inner.for.cond:
732 // CHECK1-NEXT: [[TMP15:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4
733 // CHECK1-NEXT: [[TMP16:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4
734 // CHECK1-NEXT: [[CMP6:%.*]] = icmp sle i32 [[TMP15]], [[TMP16]]
735 // CHECK1-NEXT: br i1 [[CMP6]], label [[OMP_INNER_FOR_BODY:%.*]], label [[OMP_INNER_FOR_END:%.*]]
736 // CHECK1: omp.inner.for.body:
737 // CHECK1-NEXT: [[TMP17:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4
738 // CHECK1-NEXT: [[MUL:%.*]] = mul nsw i32 [[TMP17]], 1
739 // CHECK1-NEXT: [[ADD:%.*]] = add nsw i32 0, [[MUL]]
740 // CHECK1-NEXT: store i32 [[ADD]], ptr [[I4]], align 4
741 // CHECK1-NEXT: [[TMP18:%.*]] = load i32, ptr [[I4]], align 4
742 // CHECK1-NEXT: [[IDXPROM:%.*]] = sext i32 [[TMP18]] to i64
743 // CHECK1-NEXT: [[ARRAYIDX:%.*]] = getelementptr inbounds [100 x i32], ptr [[TMP1]], i64 0, i64 [[IDXPROM]]
744 // CHECK1-NEXT: store i32 0, ptr [[ARRAYIDX]], align 4
745 // CHECK1-NEXT: br label [[OMP_BODY_CONTINUE:%.*]]
746 // CHECK1: omp.body.continue:
747 // CHECK1-NEXT: br label [[OMP_INNER_FOR_INC:%.*]]
748 // CHECK1: omp.inner.for.inc:
749 // CHECK1-NEXT: [[TMP19:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4
750 // CHECK1-NEXT: [[ADD7:%.*]] = add nsw i32 [[TMP19]], 1
751 // CHECK1-NEXT: store i32 [[ADD7]], ptr [[DOTOMP_IV]], align 4
752 // CHECK1-NEXT: br label [[OMP_INNER_FOR_COND]]
753 // CHECK1: omp.inner.for.end:
754 // CHECK1-NEXT: br label [[OMP_LOOP_EXIT:%.*]]
755 // CHECK1: omp.loop.exit:
756 // CHECK1-NEXT: [[TMP20:%.*]] = load ptr, ptr [[DOTGLOBAL_TID__ADDR]], align 8
757 // CHECK1-NEXT: [[TMP21:%.*]] = load i32, ptr [[TMP20]], align 4
758 // CHECK1-NEXT: call void @__kmpc_for_static_fini(ptr @[[GLOB2]], i32 [[TMP21]])
759 // CHECK1-NEXT: br label [[OMP_PRECOND_END]]
760 // CHECK1: omp.precond.end:
761 // CHECK1-NEXT: ret void
764 // CHECK1-LABEL: define {{[^@]+}}@.omp_offloading.requires_reg
765 // CHECK1-SAME: () #[[ATTR4:[0-9]+]] {
766 // CHECK1-NEXT: entry:
767 // CHECK1-NEXT: call void @__tgt_register_requires(i64 1)
768 // CHECK1-NEXT: ret void
771 // CHECK3-LABEL: define {{[^@]+}}@_Z21teams_argument_globali
772 // CHECK3-SAME: (i32 noundef [[N:%.*]]) #[[ATTR0:[0-9]+]] {
773 // CHECK3-NEXT: entry:
774 // CHECK3-NEXT: [[N_ADDR:%.*]] = alloca i32, align 4
775 // CHECK3-NEXT: [[TE:%.*]] = alloca i32, align 4
776 // CHECK3-NEXT: [[TH:%.*]] = alloca i32, align 4
777 // CHECK3-NEXT: [[TE_CASTED:%.*]] = alloca i32, align 4
778 // CHECK3-NEXT: [[TH_CASTED:%.*]] = alloca i32, align 4
779 // CHECK3-NEXT: [[N_CASTED:%.*]] = alloca i32, align 4
780 // CHECK3-NEXT: [[DOTOFFLOAD_BASEPTRS:%.*]] = alloca [4 x ptr], align 4
781 // CHECK3-NEXT: [[DOTOFFLOAD_PTRS:%.*]] = alloca [4 x ptr], align 4
782 // CHECK3-NEXT: [[DOTOFFLOAD_MAPPERS:%.*]] = alloca [4 x ptr], align 4
783 // CHECK3-NEXT: [[TMP:%.*]] = alloca i32, align 4
784 // CHECK3-NEXT: [[DOTCAPTURE_EXPR_:%.*]] = alloca i32, align 4
785 // CHECK3-NEXT: [[DOTCAPTURE_EXPR_1:%.*]] = alloca i32, align 4
786 // CHECK3-NEXT: [[KERNEL_ARGS:%.*]] = alloca [[STRUCT___TGT_KERNEL_ARGUMENTS:%.*]], align 8
787 // CHECK3-NEXT: [[N_CASTED4:%.*]] = alloca i32, align 4
788 // CHECK3-NEXT: [[DOTOFFLOAD_BASEPTRS5:%.*]] = alloca [2 x ptr], align 4
789 // CHECK3-NEXT: [[DOTOFFLOAD_PTRS6:%.*]] = alloca [2 x ptr], align 4
790 // CHECK3-NEXT: [[DOTOFFLOAD_MAPPERS7:%.*]] = alloca [2 x ptr], align 4
791 // CHECK3-NEXT: [[_TMP8:%.*]] = alloca i32, align 4
792 // CHECK3-NEXT: [[DOTCAPTURE_EXPR_9:%.*]] = alloca i32, align 4
793 // CHECK3-NEXT: [[DOTCAPTURE_EXPR_10:%.*]] = alloca i32, align 4
794 // CHECK3-NEXT: [[KERNEL_ARGS15:%.*]] = alloca [[STRUCT___TGT_KERNEL_ARGUMENTS]], align 8
795 // CHECK3-NEXT: store i32 [[N]], ptr [[N_ADDR]], align 4
796 // CHECK3-NEXT: [[TMP0:%.*]] = load i32, ptr [[N_ADDR]], align 4
797 // CHECK3-NEXT: [[DIV:%.*]] = sdiv i32 [[TMP0]], 128
798 // CHECK3-NEXT: store i32 [[DIV]], ptr [[TE]], align 4
799 // CHECK3-NEXT: store i32 128, ptr [[TH]], align 4
800 // CHECK3-NEXT: [[TMP1:%.*]] = load i32, ptr [[TE]], align 4
801 // CHECK3-NEXT: store i32 [[TMP1]], ptr [[TE_CASTED]], align 4
802 // CHECK3-NEXT: [[TMP2:%.*]] = load i32, ptr [[TE_CASTED]], align 4
803 // CHECK3-NEXT: [[TMP3:%.*]] = load i32, ptr [[TH]], align 4
804 // CHECK3-NEXT: store i32 [[TMP3]], ptr [[TH_CASTED]], align 4
805 // CHECK3-NEXT: [[TMP4:%.*]] = load i32, ptr [[TH_CASTED]], align 4
806 // CHECK3-NEXT: [[TMP5:%.*]] = load i32, ptr [[N_ADDR]], align 4
807 // CHECK3-NEXT: store i32 [[TMP5]], ptr [[N_CASTED]], align 4
808 // CHECK3-NEXT: [[TMP6:%.*]] = load i32, ptr [[N_CASTED]], align 4
809 // CHECK3-NEXT: [[TMP7:%.*]] = getelementptr inbounds [4 x ptr], ptr [[DOTOFFLOAD_BASEPTRS]], i32 0, i32 0
810 // CHECK3-NEXT: store i32 [[TMP2]], ptr [[TMP7]], align 4
811 // CHECK3-NEXT: [[TMP8:%.*]] = getelementptr inbounds [4 x ptr], ptr [[DOTOFFLOAD_PTRS]], i32 0, i32 0
812 // CHECK3-NEXT: store i32 [[TMP2]], ptr [[TMP8]], align 4
813 // CHECK3-NEXT: [[TMP9:%.*]] = getelementptr inbounds [4 x ptr], ptr [[DOTOFFLOAD_MAPPERS]], i32 0, i32 0
814 // CHECK3-NEXT: store ptr null, ptr [[TMP9]], align 4
815 // CHECK3-NEXT: [[TMP10:%.*]] = getelementptr inbounds [4 x ptr], ptr [[DOTOFFLOAD_BASEPTRS]], i32 0, i32 1
816 // CHECK3-NEXT: store i32 [[TMP4]], ptr [[TMP10]], align 4
817 // CHECK3-NEXT: [[TMP11:%.*]] = getelementptr inbounds [4 x ptr], ptr [[DOTOFFLOAD_PTRS]], i32 0, i32 1
818 // CHECK3-NEXT: store i32 [[TMP4]], ptr [[TMP11]], align 4
819 // CHECK3-NEXT: [[TMP12:%.*]] = getelementptr inbounds [4 x ptr], ptr [[DOTOFFLOAD_MAPPERS]], i32 0, i32 1
820 // CHECK3-NEXT: store ptr null, ptr [[TMP12]], align 4
821 // CHECK3-NEXT: [[TMP13:%.*]] = getelementptr inbounds [4 x ptr], ptr [[DOTOFFLOAD_BASEPTRS]], i32 0, i32 2
822 // CHECK3-NEXT: store i32 [[TMP6]], ptr [[TMP13]], align 4
823 // CHECK3-NEXT: [[TMP14:%.*]] = getelementptr inbounds [4 x ptr], ptr [[DOTOFFLOAD_PTRS]], i32 0, i32 2
824 // CHECK3-NEXT: store i32 [[TMP6]], ptr [[TMP14]], align 4
825 // CHECK3-NEXT: [[TMP15:%.*]] = getelementptr inbounds [4 x ptr], ptr [[DOTOFFLOAD_MAPPERS]], i32 0, i32 2
826 // CHECK3-NEXT: store ptr null, ptr [[TMP15]], align 4
827 // CHECK3-NEXT: [[TMP16:%.*]] = getelementptr inbounds [4 x ptr], ptr [[DOTOFFLOAD_BASEPTRS]], i32 0, i32 3
828 // CHECK3-NEXT: store ptr @a, ptr [[TMP16]], align 4
829 // CHECK3-NEXT: [[TMP17:%.*]] = getelementptr inbounds [4 x ptr], ptr [[DOTOFFLOAD_PTRS]], i32 0, i32 3
830 // CHECK3-NEXT: store ptr @a, ptr [[TMP17]], align 4
831 // CHECK3-NEXT: [[TMP18:%.*]] = getelementptr inbounds [4 x ptr], ptr [[DOTOFFLOAD_MAPPERS]], i32 0, i32 3
832 // CHECK3-NEXT: store ptr null, ptr [[TMP18]], align 4
833 // CHECK3-NEXT: [[TMP19:%.*]] = getelementptr inbounds [4 x ptr], ptr [[DOTOFFLOAD_BASEPTRS]], i32 0, i32 0
834 // CHECK3-NEXT: [[TMP20:%.*]] = getelementptr inbounds [4 x ptr], ptr [[DOTOFFLOAD_PTRS]], i32 0, i32 0
835 // CHECK3-NEXT: [[TMP21:%.*]] = load i32, ptr [[TE]], align 4
836 // CHECK3-NEXT: [[TMP22:%.*]] = load i32, ptr [[TH]], align 4
837 // CHECK3-NEXT: [[TMP23:%.*]] = load i32, ptr [[N_ADDR]], align 4
838 // CHECK3-NEXT: store i32 [[TMP23]], ptr [[DOTCAPTURE_EXPR_]], align 4
839 // CHECK3-NEXT: [[TMP24:%.*]] = load i32, ptr [[DOTCAPTURE_EXPR_]], align 4
840 // CHECK3-NEXT: [[SUB:%.*]] = sub nsw i32 [[TMP24]], 0
841 // CHECK3-NEXT: [[DIV2:%.*]] = sdiv i32 [[SUB]], 1
842 // CHECK3-NEXT: [[SUB3:%.*]] = sub nsw i32 [[DIV2]], 1
843 // CHECK3-NEXT: store i32 [[SUB3]], ptr [[DOTCAPTURE_EXPR_1]], align 4
844 // CHECK3-NEXT: [[TMP25:%.*]] = load i32, ptr [[DOTCAPTURE_EXPR_1]], align 4
845 // CHECK3-NEXT: [[ADD:%.*]] = add nsw i32 [[TMP25]], 1
846 // CHECK3-NEXT: [[TMP26:%.*]] = zext i32 [[ADD]] to i64
847 // CHECK3-NEXT: [[TMP27:%.*]] = insertvalue [3 x i32] zeroinitializer, i32 [[TMP21]], 0
848 // CHECK3-NEXT: [[TMP28:%.*]] = insertvalue [3 x i32] zeroinitializer, i32 [[TMP22]], 0
849 // CHECK3-NEXT: [[TMP29:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 0
850 // CHECK3-NEXT: store i32 2, ptr [[TMP29]], align 4
851 // CHECK3-NEXT: [[TMP30:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 1
852 // CHECK3-NEXT: store i32 4, ptr [[TMP30]], align 4
853 // CHECK3-NEXT: [[TMP31:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 2
854 // CHECK3-NEXT: store ptr [[TMP19]], ptr [[TMP31]], align 4
855 // CHECK3-NEXT: [[TMP32:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 3
856 // CHECK3-NEXT: store ptr [[TMP20]], ptr [[TMP32]], align 4
857 // CHECK3-NEXT: [[TMP33:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 4
858 // CHECK3-NEXT: store ptr @.offload_sizes, ptr [[TMP33]], align 4
859 // CHECK3-NEXT: [[TMP34:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 5
860 // CHECK3-NEXT: store ptr @.offload_maptypes, ptr [[TMP34]], align 4
861 // CHECK3-NEXT: [[TMP35:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 6
862 // CHECK3-NEXT: store ptr null, ptr [[TMP35]], align 4
863 // CHECK3-NEXT: [[TMP36:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 7
864 // CHECK3-NEXT: store ptr null, ptr [[TMP36]], align 4
865 // CHECK3-NEXT: [[TMP37:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 8
866 // CHECK3-NEXT: store i64 [[TMP26]], ptr [[TMP37]], align 8
867 // CHECK3-NEXT: [[TMP38:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 9
868 // CHECK3-NEXT: store i64 0, ptr [[TMP38]], align 8
869 // CHECK3-NEXT: [[TMP39:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 10
870 // CHECK3-NEXT: store [3 x i32] [[TMP27]], ptr [[TMP39]], align 4
871 // CHECK3-NEXT: [[TMP40:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 11
872 // CHECK3-NEXT: store [3 x i32] [[TMP28]], ptr [[TMP40]], align 4
873 // CHECK3-NEXT: [[TMP41:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 12
874 // CHECK3-NEXT: store i32 0, ptr [[TMP41]], align 4
875 // CHECK3-NEXT: [[TMP42:%.*]] = call i32 @__tgt_target_kernel(ptr @[[GLOB3:[0-9]+]], i64 -1, i32 [[TMP21]], i32 [[TMP22]], ptr @.{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z21teams_argument_globali_l28.region_id, ptr [[KERNEL_ARGS]])
876 // CHECK3-NEXT: [[TMP43:%.*]] = icmp ne i32 [[TMP42]], 0
877 // CHECK3-NEXT: br i1 [[TMP43]], label [[OMP_OFFLOAD_FAILED:%.*]], label [[OMP_OFFLOAD_CONT:%.*]]
878 // CHECK3: omp_offload.failed:
879 // CHECK3-NEXT: call void @{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z21teams_argument_globali_l28(i32 [[TMP2]], i32 [[TMP4]], i32 [[TMP6]], ptr @a) #[[ATTR2:[0-9]+]]
880 // CHECK3-NEXT: br label [[OMP_OFFLOAD_CONT]]
881 // CHECK3: omp_offload.cont:
882 // CHECK3-NEXT: [[TMP44:%.*]] = load i32, ptr [[N_ADDR]], align 4
883 // CHECK3-NEXT: store i32 [[TMP44]], ptr [[N_CASTED4]], align 4
884 // CHECK3-NEXT: [[TMP45:%.*]] = load i32, ptr [[N_CASTED4]], align 4
885 // CHECK3-NEXT: [[TMP46:%.*]] = getelementptr inbounds [2 x ptr], ptr [[DOTOFFLOAD_BASEPTRS5]], i32 0, i32 0
886 // CHECK3-NEXT: store i32 [[TMP45]], ptr [[TMP46]], align 4
887 // CHECK3-NEXT: [[TMP47:%.*]] = getelementptr inbounds [2 x ptr], ptr [[DOTOFFLOAD_PTRS6]], i32 0, i32 0
888 // CHECK3-NEXT: store i32 [[TMP45]], ptr [[TMP47]], align 4
889 // CHECK3-NEXT: [[TMP48:%.*]] = getelementptr inbounds [2 x ptr], ptr [[DOTOFFLOAD_MAPPERS7]], i32 0, i32 0
890 // CHECK3-NEXT: store ptr null, ptr [[TMP48]], align 4
891 // CHECK3-NEXT: [[TMP49:%.*]] = getelementptr inbounds [2 x ptr], ptr [[DOTOFFLOAD_BASEPTRS5]], i32 0, i32 1
892 // CHECK3-NEXT: store ptr @a, ptr [[TMP49]], align 4
893 // CHECK3-NEXT: [[TMP50:%.*]] = getelementptr inbounds [2 x ptr], ptr [[DOTOFFLOAD_PTRS6]], i32 0, i32 1
894 // CHECK3-NEXT: store ptr @a, ptr [[TMP50]], align 4
895 // CHECK3-NEXT: [[TMP51:%.*]] = getelementptr inbounds [2 x ptr], ptr [[DOTOFFLOAD_MAPPERS7]], i32 0, i32 1
896 // CHECK3-NEXT: store ptr null, ptr [[TMP51]], align 4
897 // CHECK3-NEXT: [[TMP52:%.*]] = getelementptr inbounds [2 x ptr], ptr [[DOTOFFLOAD_BASEPTRS5]], i32 0, i32 0
898 // CHECK3-NEXT: [[TMP53:%.*]] = getelementptr inbounds [2 x ptr], ptr [[DOTOFFLOAD_PTRS6]], i32 0, i32 0
899 // CHECK3-NEXT: [[TMP54:%.*]] = load i32, ptr [[N_ADDR]], align 4
900 // CHECK3-NEXT: store i32 [[TMP54]], ptr [[DOTCAPTURE_EXPR_9]], align 4
901 // CHECK3-NEXT: [[TMP55:%.*]] = load i32, ptr [[DOTCAPTURE_EXPR_9]], align 4
902 // CHECK3-NEXT: [[SUB11:%.*]] = sub nsw i32 [[TMP55]], 0
903 // CHECK3-NEXT: [[DIV12:%.*]] = sdiv i32 [[SUB11]], 1
904 // CHECK3-NEXT: [[SUB13:%.*]] = sub nsw i32 [[DIV12]], 1
905 // CHECK3-NEXT: store i32 [[SUB13]], ptr [[DOTCAPTURE_EXPR_10]], align 4
906 // CHECK3-NEXT: [[TMP56:%.*]] = load i32, ptr [[DOTCAPTURE_EXPR_10]], align 4
907 // CHECK3-NEXT: [[ADD14:%.*]] = add nsw i32 [[TMP56]], 1
908 // CHECK3-NEXT: [[TMP57:%.*]] = zext i32 [[ADD14]] to i64
909 // CHECK3-NEXT: [[TMP58:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS15]], i32 0, i32 0
910 // CHECK3-NEXT: store i32 2, ptr [[TMP58]], align 4
911 // CHECK3-NEXT: [[TMP59:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS15]], i32 0, i32 1
912 // CHECK3-NEXT: store i32 2, ptr [[TMP59]], align 4
913 // CHECK3-NEXT: [[TMP60:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS15]], i32 0, i32 2
914 // CHECK3-NEXT: store ptr [[TMP52]], ptr [[TMP60]], align 4
915 // CHECK3-NEXT: [[TMP61:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS15]], i32 0, i32 3
916 // CHECK3-NEXT: store ptr [[TMP53]], ptr [[TMP61]], align 4
917 // CHECK3-NEXT: [[TMP62:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS15]], i32 0, i32 4
918 // CHECK3-NEXT: store ptr @.offload_sizes.1, ptr [[TMP62]], align 4
919 // CHECK3-NEXT: [[TMP63:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS15]], i32 0, i32 5
920 // CHECK3-NEXT: store ptr @.offload_maptypes.2, ptr [[TMP63]], align 4
921 // CHECK3-NEXT: [[TMP64:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS15]], i32 0, i32 6
922 // CHECK3-NEXT: store ptr null, ptr [[TMP64]], align 4
923 // CHECK3-NEXT: [[TMP65:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS15]], i32 0, i32 7
924 // CHECK3-NEXT: store ptr null, ptr [[TMP65]], align 4
925 // CHECK3-NEXT: [[TMP66:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS15]], i32 0, i32 8
926 // CHECK3-NEXT: store i64 [[TMP57]], ptr [[TMP66]], align 8
927 // CHECK3-NEXT: [[TMP67:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS15]], i32 0, i32 9
928 // CHECK3-NEXT: store i64 0, ptr [[TMP67]], align 8
929 // CHECK3-NEXT: [[TMP68:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS15]], i32 0, i32 10
930 // CHECK3-NEXT: store [3 x i32] zeroinitializer, ptr [[TMP68]], align 4
931 // CHECK3-NEXT: [[TMP69:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS15]], i32 0, i32 11
932 // CHECK3-NEXT: store [3 x i32] zeroinitializer, ptr [[TMP69]], align 4
933 // CHECK3-NEXT: [[TMP70:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS15]], i32 0, i32 12
934 // CHECK3-NEXT: store i32 0, ptr [[TMP70]], align 4
935 // CHECK3-NEXT: [[TMP71:%.*]] = call i32 @__tgt_target_kernel(ptr @[[GLOB3]], i64 -1, i32 0, i32 0, ptr @.{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z21teams_argument_globali_l34.region_id, ptr [[KERNEL_ARGS15]])
936 // CHECK3-NEXT: [[TMP72:%.*]] = icmp ne i32 [[TMP71]], 0
937 // CHECK3-NEXT: br i1 [[TMP72]], label [[OMP_OFFLOAD_FAILED16:%.*]], label [[OMP_OFFLOAD_CONT17:%.*]]
938 // CHECK3: omp_offload.failed16:
939 // CHECK3-NEXT: call void @{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z21teams_argument_globali_l34(i32 [[TMP45]], ptr @a) #[[ATTR2]]
940 // CHECK3-NEXT: br label [[OMP_OFFLOAD_CONT17]]
941 // CHECK3: omp_offload.cont17:
942 // CHECK3-NEXT: [[TMP73:%.*]] = load i32, ptr @a, align 4
943 // CHECK3-NEXT: ret i32 [[TMP73]]
946 // CHECK3-LABEL: define {{[^@]+}}@{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z21teams_argument_globali_l28
947 // CHECK3-SAME: (i32 noundef [[TE:%.*]], i32 noundef [[TH:%.*]], i32 noundef [[N:%.*]], ptr noundef nonnull align 4 dereferenceable(400) [[A:%.*]]) #[[ATTR1:[0-9]+]] {
948 // CHECK3-NEXT: entry:
949 // CHECK3-NEXT: [[TE_ADDR:%.*]] = alloca i32, align 4
950 // CHECK3-NEXT: [[TH_ADDR:%.*]] = alloca i32, align 4
951 // CHECK3-NEXT: [[N_ADDR:%.*]] = alloca i32, align 4
952 // CHECK3-NEXT: [[A_ADDR:%.*]] = alloca ptr, align 4
953 // CHECK3-NEXT: [[TMP0:%.*]] = call i32 @__kmpc_global_thread_num(ptr @[[GLOB3]])
954 // CHECK3-NEXT: store i32 [[TE]], ptr [[TE_ADDR]], align 4
955 // CHECK3-NEXT: store i32 [[TH]], ptr [[TH_ADDR]], align 4
956 // CHECK3-NEXT: store i32 [[N]], ptr [[N_ADDR]], align 4
957 // CHECK3-NEXT: store ptr [[A]], ptr [[A_ADDR]], align 4
958 // CHECK3-NEXT: [[TMP1:%.*]] = load ptr, ptr [[A_ADDR]], align 4
959 // CHECK3-NEXT: [[TMP2:%.*]] = load i32, ptr [[TE_ADDR]], align 4
960 // CHECK3-NEXT: [[TMP3:%.*]] = load i32, ptr [[TH_ADDR]], align 4
961 // CHECK3-NEXT: call void @__kmpc_push_num_teams(ptr @[[GLOB3]], i32 [[TMP0]], i32 [[TMP2]], i32 [[TMP3]])
962 // CHECK3-NEXT: call void (ptr, i32, ptr, ...) @__kmpc_fork_teams(ptr @[[GLOB3]], i32 2, ptr @{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z21teams_argument_globali_l28.omp_outlined, ptr [[N_ADDR]], ptr [[TMP1]])
963 // CHECK3-NEXT: ret void
966 // CHECK3-LABEL: define {{[^@]+}}@{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z21teams_argument_globali_l28.omp_outlined
967 // CHECK3-SAME: (ptr noalias noundef [[DOTGLOBAL_TID_:%.*]], ptr noalias noundef [[DOTBOUND_TID_:%.*]], ptr noundef nonnull align 4 dereferenceable(4) [[N:%.*]], ptr noundef nonnull align 4 dereferenceable(400) [[A:%.*]]) #[[ATTR1]] {
968 // CHECK3-NEXT: entry:
969 // CHECK3-NEXT: [[DOTGLOBAL_TID__ADDR:%.*]] = alloca ptr, align 4
970 // CHECK3-NEXT: [[DOTBOUND_TID__ADDR:%.*]] = alloca ptr, align 4
971 // CHECK3-NEXT: [[N_ADDR:%.*]] = alloca ptr, align 4
972 // CHECK3-NEXT: [[A_ADDR:%.*]] = alloca ptr, align 4
973 // CHECK3-NEXT: [[DOTOMP_IV:%.*]] = alloca i32, align 4
974 // CHECK3-NEXT: [[TMP:%.*]] = alloca i32, align 4
975 // CHECK3-NEXT: [[DOTCAPTURE_EXPR_:%.*]] = alloca i32, align 4
976 // CHECK3-NEXT: [[DOTCAPTURE_EXPR_1:%.*]] = alloca i32, align 4
977 // CHECK3-NEXT: [[I:%.*]] = alloca i32, align 4
978 // CHECK3-NEXT: [[DOTOMP_COMB_LB:%.*]] = alloca i32, align 4
979 // CHECK3-NEXT: [[DOTOMP_COMB_UB:%.*]] = alloca i32, align 4
980 // CHECK3-NEXT: [[DOTOMP_STRIDE:%.*]] = alloca i32, align 4
981 // CHECK3-NEXT: [[DOTOMP_IS_LAST:%.*]] = alloca i32, align 4
982 // CHECK3-NEXT: [[I3:%.*]] = alloca i32, align 4
983 // CHECK3-NEXT: store ptr [[DOTGLOBAL_TID_]], ptr [[DOTGLOBAL_TID__ADDR]], align 4
984 // CHECK3-NEXT: store ptr [[DOTBOUND_TID_]], ptr [[DOTBOUND_TID__ADDR]], align 4
985 // CHECK3-NEXT: store ptr [[N]], ptr [[N_ADDR]], align 4
986 // CHECK3-NEXT: store ptr [[A]], ptr [[A_ADDR]], align 4
987 // CHECK3-NEXT: [[TMP0:%.*]] = load ptr, ptr [[N_ADDR]], align 4
988 // CHECK3-NEXT: [[TMP1:%.*]] = load ptr, ptr [[A_ADDR]], align 4
989 // CHECK3-NEXT: [[TMP2:%.*]] = load i32, ptr [[TMP0]], align 4
990 // CHECK3-NEXT: store i32 [[TMP2]], ptr [[DOTCAPTURE_EXPR_]], align 4
991 // CHECK3-NEXT: [[TMP3:%.*]] = load i32, ptr [[DOTCAPTURE_EXPR_]], align 4
992 // CHECK3-NEXT: [[SUB:%.*]] = sub nsw i32 [[TMP3]], 0
993 // CHECK3-NEXT: [[DIV:%.*]] = sdiv i32 [[SUB]], 1
994 // CHECK3-NEXT: [[SUB2:%.*]] = sub nsw i32 [[DIV]], 1
995 // CHECK3-NEXT: store i32 [[SUB2]], ptr [[DOTCAPTURE_EXPR_1]], align 4
996 // CHECK3-NEXT: store i32 0, ptr [[I]], align 4
997 // CHECK3-NEXT: [[TMP4:%.*]] = load i32, ptr [[DOTCAPTURE_EXPR_]], align 4
998 // CHECK3-NEXT: [[CMP:%.*]] = icmp slt i32 0, [[TMP4]]
999 // CHECK3-NEXT: br i1 [[CMP]], label [[OMP_PRECOND_THEN:%.*]], label [[OMP_PRECOND_END:%.*]]
1000 // CHECK3: omp.precond.then:
1001 // CHECK3-NEXT: store i32 0, ptr [[DOTOMP_COMB_LB]], align 4
1002 // CHECK3-NEXT: [[TMP5:%.*]] = load i32, ptr [[DOTCAPTURE_EXPR_1]], align 4
1003 // CHECK3-NEXT: store i32 [[TMP5]], ptr [[DOTOMP_COMB_UB]], align 4
1004 // CHECK3-NEXT: store i32 1, ptr [[DOTOMP_STRIDE]], align 4
1005 // CHECK3-NEXT: store i32 0, ptr [[DOTOMP_IS_LAST]], align 4
1006 // CHECK3-NEXT: [[TMP6:%.*]] = load ptr, ptr [[DOTGLOBAL_TID__ADDR]], align 4
1007 // CHECK3-NEXT: [[TMP7:%.*]] = load i32, ptr [[TMP6]], align 4
1008 // CHECK3-NEXT: call void @__kmpc_for_static_init_4(ptr @[[GLOB1:[0-9]+]], i32 [[TMP7]], i32 92, ptr [[DOTOMP_IS_LAST]], ptr [[DOTOMP_COMB_LB]], ptr [[DOTOMP_COMB_UB]], ptr [[DOTOMP_STRIDE]], i32 1, i32 1)
1009 // CHECK3-NEXT: [[TMP8:%.*]] = load i32, ptr [[DOTOMP_COMB_UB]], align 4
1010 // CHECK3-NEXT: [[TMP9:%.*]] = load i32, ptr [[DOTCAPTURE_EXPR_1]], align 4
1011 // CHECK3-NEXT: [[CMP4:%.*]] = icmp sgt i32 [[TMP8]], [[TMP9]]
1012 // CHECK3-NEXT: br i1 [[CMP4]], label [[COND_TRUE:%.*]], label [[COND_FALSE:%.*]]
1013 // CHECK3: cond.true:
1014 // CHECK3-NEXT: [[TMP10:%.*]] = load i32, ptr [[DOTCAPTURE_EXPR_1]], align 4
1015 // CHECK3-NEXT: br label [[COND_END:%.*]]
1016 // CHECK3: cond.false:
1017 // CHECK3-NEXT: [[TMP11:%.*]] = load i32, ptr [[DOTOMP_COMB_UB]], align 4
1018 // CHECK3-NEXT: br label [[COND_END]]
1019 // CHECK3: cond.end:
1020 // CHECK3-NEXT: [[COND:%.*]] = phi i32 [ [[TMP10]], [[COND_TRUE]] ], [ [[TMP11]], [[COND_FALSE]] ]
1021 // CHECK3-NEXT: store i32 [[COND]], ptr [[DOTOMP_COMB_UB]], align 4
1022 // CHECK3-NEXT: [[TMP12:%.*]] = load i32, ptr [[DOTOMP_COMB_LB]], align 4
1023 // CHECK3-NEXT: store i32 [[TMP12]], ptr [[DOTOMP_IV]], align 4
1024 // CHECK3-NEXT: br label [[OMP_INNER_FOR_COND:%.*]]
1025 // CHECK3: omp.inner.for.cond:
1026 // CHECK3-NEXT: [[TMP13:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4
1027 // CHECK3-NEXT: [[TMP14:%.*]] = load i32, ptr [[DOTOMP_COMB_UB]], align 4
1028 // CHECK3-NEXT: [[CMP5:%.*]] = icmp sle i32 [[TMP13]], [[TMP14]]
1029 // CHECK3-NEXT: br i1 [[CMP5]], label [[OMP_INNER_FOR_BODY:%.*]], label [[OMP_INNER_FOR_END:%.*]]
1030 // CHECK3: omp.inner.for.body:
1031 // CHECK3-NEXT: [[TMP15:%.*]] = load i32, ptr [[DOTOMP_COMB_LB]], align 4
1032 // CHECK3-NEXT: [[TMP16:%.*]] = load i32, ptr [[DOTOMP_COMB_UB]], align 4
1033 // CHECK3-NEXT: call void (ptr, i32, ptr, ...) @__kmpc_fork_call(ptr @[[GLOB3]], i32 4, ptr @{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z21teams_argument_globali_l28.omp_outlined.omp_outlined, i32 [[TMP15]], i32 [[TMP16]], ptr [[TMP0]], ptr [[TMP1]])
1034 // CHECK3-NEXT: br label [[OMP_INNER_FOR_INC:%.*]]
1035 // CHECK3: omp.inner.for.inc:
1036 // CHECK3-NEXT: [[TMP17:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4
1037 // CHECK3-NEXT: [[TMP18:%.*]] = load i32, ptr [[DOTOMP_STRIDE]], align 4
1038 // CHECK3-NEXT: [[ADD:%.*]] = add nsw i32 [[TMP17]], [[TMP18]]
1039 // CHECK3-NEXT: store i32 [[ADD]], ptr [[DOTOMP_IV]], align 4
1040 // CHECK3-NEXT: br label [[OMP_INNER_FOR_COND]]
1041 // CHECK3: omp.inner.for.end:
1042 // CHECK3-NEXT: br label [[OMP_LOOP_EXIT:%.*]]
1043 // CHECK3: omp.loop.exit:
1044 // CHECK3-NEXT: [[TMP19:%.*]] = load ptr, ptr [[DOTGLOBAL_TID__ADDR]], align 4
1045 // CHECK3-NEXT: [[TMP20:%.*]] = load i32, ptr [[TMP19]], align 4
1046 // CHECK3-NEXT: call void @__kmpc_for_static_fini(ptr @[[GLOB2:[0-9]+]], i32 [[TMP20]])
1047 // CHECK3-NEXT: br label [[OMP_PRECOND_END]]
1048 // CHECK3: omp.precond.end:
1049 // CHECK3-NEXT: ret void
1052 // CHECK3-LABEL: define {{[^@]+}}@{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z21teams_argument_globali_l28.omp_outlined.omp_outlined
1053 // CHECK3-SAME: (ptr noalias noundef [[DOTGLOBAL_TID_:%.*]], ptr noalias noundef [[DOTBOUND_TID_:%.*]], i32 noundef [[DOTPREVIOUS_LB_:%.*]], i32 noundef [[DOTPREVIOUS_UB_:%.*]], ptr noundef nonnull align 4 dereferenceable(4) [[N:%.*]], ptr noundef nonnull align 4 dereferenceable(400) [[A:%.*]]) #[[ATTR1]] {
1054 // CHECK3-NEXT: entry:
1055 // CHECK3-NEXT: [[DOTGLOBAL_TID__ADDR:%.*]] = alloca ptr, align 4
1056 // CHECK3-NEXT: [[DOTBOUND_TID__ADDR:%.*]] = alloca ptr, align 4
1057 // CHECK3-NEXT: [[DOTPREVIOUS_LB__ADDR:%.*]] = alloca i32, align 4
1058 // CHECK3-NEXT: [[DOTPREVIOUS_UB__ADDR:%.*]] = alloca i32, align 4
1059 // CHECK3-NEXT: [[N_ADDR:%.*]] = alloca ptr, align 4
1060 // CHECK3-NEXT: [[A_ADDR:%.*]] = alloca ptr, align 4
1061 // CHECK3-NEXT: [[DOTOMP_IV:%.*]] = alloca i32, align 4
1062 // CHECK3-NEXT: [[TMP:%.*]] = alloca i32, align 4
1063 // CHECK3-NEXT: [[DOTCAPTURE_EXPR_:%.*]] = alloca i32, align 4
1064 // CHECK3-NEXT: [[DOTCAPTURE_EXPR_1:%.*]] = alloca i32, align 4
1065 // CHECK3-NEXT: [[I:%.*]] = alloca i32, align 4
1066 // CHECK3-NEXT: [[DOTOMP_LB:%.*]] = alloca i32, align 4
1067 // CHECK3-NEXT: [[DOTOMP_UB:%.*]] = alloca i32, align 4
1068 // CHECK3-NEXT: [[DOTOMP_STRIDE:%.*]] = alloca i32, align 4
1069 // CHECK3-NEXT: [[DOTOMP_IS_LAST:%.*]] = alloca i32, align 4
1070 // CHECK3-NEXT: [[I3:%.*]] = alloca i32, align 4
1071 // CHECK3-NEXT: store ptr [[DOTGLOBAL_TID_]], ptr [[DOTGLOBAL_TID__ADDR]], align 4
1072 // CHECK3-NEXT: store ptr [[DOTBOUND_TID_]], ptr [[DOTBOUND_TID__ADDR]], align 4
1073 // CHECK3-NEXT: store i32 [[DOTPREVIOUS_LB_]], ptr [[DOTPREVIOUS_LB__ADDR]], align 4
1074 // CHECK3-NEXT: store i32 [[DOTPREVIOUS_UB_]], ptr [[DOTPREVIOUS_UB__ADDR]], align 4
1075 // CHECK3-NEXT: store ptr [[N]], ptr [[N_ADDR]], align 4
1076 // CHECK3-NEXT: store ptr [[A]], ptr [[A_ADDR]], align 4
1077 // CHECK3-NEXT: [[TMP0:%.*]] = load ptr, ptr [[N_ADDR]], align 4
1078 // CHECK3-NEXT: [[TMP1:%.*]] = load ptr, ptr [[A_ADDR]], align 4
1079 // CHECK3-NEXT: [[TMP2:%.*]] = load i32, ptr [[TMP0]], align 4
1080 // CHECK3-NEXT: store i32 [[TMP2]], ptr [[DOTCAPTURE_EXPR_]], align 4
1081 // CHECK3-NEXT: [[TMP3:%.*]] = load i32, ptr [[DOTCAPTURE_EXPR_]], align 4
1082 // CHECK3-NEXT: [[SUB:%.*]] = sub nsw i32 [[TMP3]], 0
1083 // CHECK3-NEXT: [[DIV:%.*]] = sdiv i32 [[SUB]], 1
1084 // CHECK3-NEXT: [[SUB2:%.*]] = sub nsw i32 [[DIV]], 1
1085 // CHECK3-NEXT: store i32 [[SUB2]], ptr [[DOTCAPTURE_EXPR_1]], align 4
1086 // CHECK3-NEXT: store i32 0, ptr [[I]], align 4
1087 // CHECK3-NEXT: [[TMP4:%.*]] = load i32, ptr [[DOTCAPTURE_EXPR_]], align 4
1088 // CHECK3-NEXT: [[CMP:%.*]] = icmp slt i32 0, [[TMP4]]
1089 // CHECK3-NEXT: br i1 [[CMP]], label [[OMP_PRECOND_THEN:%.*]], label [[OMP_PRECOND_END:%.*]]
1090 // CHECK3: omp.precond.then:
1091 // CHECK3-NEXT: store i32 0, ptr [[DOTOMP_LB]], align 4
1092 // CHECK3-NEXT: [[TMP5:%.*]] = load i32, ptr [[DOTCAPTURE_EXPR_1]], align 4
1093 // CHECK3-NEXT: store i32 [[TMP5]], ptr [[DOTOMP_UB]], align 4
1094 // CHECK3-NEXT: [[TMP6:%.*]] = load i32, ptr [[DOTPREVIOUS_LB__ADDR]], align 4
1095 // CHECK3-NEXT: [[TMP7:%.*]] = load i32, ptr [[DOTPREVIOUS_UB__ADDR]], align 4
1096 // CHECK3-NEXT: store i32 [[TMP6]], ptr [[DOTOMP_LB]], align 4
1097 // CHECK3-NEXT: store i32 [[TMP7]], ptr [[DOTOMP_UB]], align 4
1098 // CHECK3-NEXT: store i32 1, ptr [[DOTOMP_STRIDE]], align 4
1099 // CHECK3-NEXT: store i32 0, ptr [[DOTOMP_IS_LAST]], align 4
1100 // CHECK3-NEXT: [[TMP8:%.*]] = load ptr, ptr [[DOTGLOBAL_TID__ADDR]], align 4
1101 // CHECK3-NEXT: [[TMP9:%.*]] = load i32, ptr [[TMP8]], align 4
1102 // CHECK3-NEXT: call void @__kmpc_for_static_init_4(ptr @[[GLOB2]], i32 [[TMP9]], i32 34, ptr [[DOTOMP_IS_LAST]], ptr [[DOTOMP_LB]], ptr [[DOTOMP_UB]], ptr [[DOTOMP_STRIDE]], i32 1, i32 1)
1103 // CHECK3-NEXT: [[TMP10:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4
1104 // CHECK3-NEXT: [[TMP11:%.*]] = load i32, ptr [[DOTCAPTURE_EXPR_1]], align 4
1105 // CHECK3-NEXT: [[CMP4:%.*]] = icmp sgt i32 [[TMP10]], [[TMP11]]
1106 // CHECK3-NEXT: br i1 [[CMP4]], label [[COND_TRUE:%.*]], label [[COND_FALSE:%.*]]
1107 // CHECK3: cond.true:
1108 // CHECK3-NEXT: [[TMP12:%.*]] = load i32, ptr [[DOTCAPTURE_EXPR_1]], align 4
1109 // CHECK3-NEXT: br label [[COND_END:%.*]]
1110 // CHECK3: cond.false:
1111 // CHECK3-NEXT: [[TMP13:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4
1112 // CHECK3-NEXT: br label [[COND_END]]
1113 // CHECK3: cond.end:
1114 // CHECK3-NEXT: [[COND:%.*]] = phi i32 [ [[TMP12]], [[COND_TRUE]] ], [ [[TMP13]], [[COND_FALSE]] ]
1115 // CHECK3-NEXT: store i32 [[COND]], ptr [[DOTOMP_UB]], align 4
1116 // CHECK3-NEXT: [[TMP14:%.*]] = load i32, ptr [[DOTOMP_LB]], align 4
1117 // CHECK3-NEXT: store i32 [[TMP14]], ptr [[DOTOMP_IV]], align 4
1118 // CHECK3-NEXT: br label [[OMP_INNER_FOR_COND:%.*]]
1119 // CHECK3: omp.inner.for.cond:
1120 // CHECK3-NEXT: [[TMP15:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4
1121 // CHECK3-NEXT: [[TMP16:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4
1122 // CHECK3-NEXT: [[CMP5:%.*]] = icmp sle i32 [[TMP15]], [[TMP16]]
1123 // CHECK3-NEXT: br i1 [[CMP5]], label [[OMP_INNER_FOR_BODY:%.*]], label [[OMP_INNER_FOR_END:%.*]]
1124 // CHECK3: omp.inner.for.body:
1125 // CHECK3-NEXT: [[TMP17:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4
1126 // CHECK3-NEXT: [[MUL:%.*]] = mul nsw i32 [[TMP17]], 1
1127 // CHECK3-NEXT: [[ADD:%.*]] = add nsw i32 0, [[MUL]]
1128 // CHECK3-NEXT: store i32 [[ADD]], ptr [[I3]], align 4
1129 // CHECK3-NEXT: [[TMP18:%.*]] = load i32, ptr [[I3]], align 4
1130 // CHECK3-NEXT: [[ARRAYIDX:%.*]] = getelementptr inbounds [100 x i32], ptr [[TMP1]], i32 0, i32 [[TMP18]]
1131 // CHECK3-NEXT: store i32 0, ptr [[ARRAYIDX]], align 4
1132 // CHECK3-NEXT: br label [[OMP_BODY_CONTINUE:%.*]]
1133 // CHECK3: omp.body.continue:
1134 // CHECK3-NEXT: br label [[OMP_INNER_FOR_INC:%.*]]
1135 // CHECK3: omp.inner.for.inc:
1136 // CHECK3-NEXT: [[TMP19:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4
1137 // CHECK3-NEXT: [[ADD6:%.*]] = add nsw i32 [[TMP19]], 1
1138 // CHECK3-NEXT: store i32 [[ADD6]], ptr [[DOTOMP_IV]], align 4
1139 // CHECK3-NEXT: br label [[OMP_INNER_FOR_COND]]
1140 // CHECK3: omp.inner.for.end:
1141 // CHECK3-NEXT: br label [[OMP_LOOP_EXIT:%.*]]
1142 // CHECK3: omp.loop.exit:
1143 // CHECK3-NEXT: [[TMP20:%.*]] = load ptr, ptr [[DOTGLOBAL_TID__ADDR]], align 4
1144 // CHECK3-NEXT: [[TMP21:%.*]] = load i32, ptr [[TMP20]], align 4
1145 // CHECK3-NEXT: call void @__kmpc_for_static_fini(ptr @[[GLOB2]], i32 [[TMP21]])
1146 // CHECK3-NEXT: br label [[OMP_PRECOND_END]]
1147 // CHECK3: omp.precond.end:
1148 // CHECK3-NEXT: ret void
1151 // CHECK3-LABEL: define {{[^@]+}}@{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z21teams_argument_globali_l34
1152 // CHECK3-SAME: (i32 noundef [[N:%.*]], ptr noundef nonnull align 4 dereferenceable(400) [[A:%.*]]) #[[ATTR3:[0-9]+]] {
1153 // CHECK3-NEXT: entry:
1154 // CHECK3-NEXT: [[N_ADDR:%.*]] = alloca i32, align 4
1155 // CHECK3-NEXT: [[A_ADDR:%.*]] = alloca ptr, align 4
1156 // CHECK3-NEXT: store i32 [[N]], ptr [[N_ADDR]], align 4
1157 // CHECK3-NEXT: store ptr [[A]], ptr [[A_ADDR]], align 4
1158 // CHECK3-NEXT: [[TMP0:%.*]] = load ptr, ptr [[A_ADDR]], align 4
1159 // CHECK3-NEXT: call void (ptr, i32, ptr, ...) @__kmpc_fork_teams(ptr @[[GLOB3]], i32 2, ptr @{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z21teams_argument_globali_l34.omp_outlined, ptr [[N_ADDR]], ptr [[TMP0]])
1160 // CHECK3-NEXT: ret void
1163 // CHECK3-LABEL: define {{[^@]+}}@{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z21teams_argument_globali_l34.omp_outlined
1164 // CHECK3-SAME: (ptr noalias noundef [[DOTGLOBAL_TID_:%.*]], ptr noalias noundef [[DOTBOUND_TID_:%.*]], ptr noundef nonnull align 4 dereferenceable(4) [[N:%.*]], ptr noundef nonnull align 4 dereferenceable(400) [[A:%.*]]) #[[ATTR1]] {
1165 // CHECK3-NEXT: entry:
1166 // CHECK3-NEXT: [[DOTGLOBAL_TID__ADDR:%.*]] = alloca ptr, align 4
1167 // CHECK3-NEXT: [[DOTBOUND_TID__ADDR:%.*]] = alloca ptr, align 4
1168 // CHECK3-NEXT: [[N_ADDR:%.*]] = alloca ptr, align 4
1169 // CHECK3-NEXT: [[A_ADDR:%.*]] = alloca ptr, align 4
1170 // CHECK3-NEXT: [[DOTOMP_IV:%.*]] = alloca i32, align 4
1171 // CHECK3-NEXT: [[TMP:%.*]] = alloca i32, align 4
1172 // CHECK3-NEXT: [[DOTCAPTURE_EXPR_:%.*]] = alloca i32, align 4
1173 // CHECK3-NEXT: [[DOTCAPTURE_EXPR_1:%.*]] = alloca i32, align 4
1174 // CHECK3-NEXT: [[I:%.*]] = alloca i32, align 4
1175 // CHECK3-NEXT: [[DOTOMP_COMB_LB:%.*]] = alloca i32, align 4
1176 // CHECK3-NEXT: [[DOTOMP_COMB_UB:%.*]] = alloca i32, align 4
1177 // CHECK3-NEXT: [[DOTOMP_STRIDE:%.*]] = alloca i32, align 4
1178 // CHECK3-NEXT: [[DOTOMP_IS_LAST:%.*]] = alloca i32, align 4
1179 // CHECK3-NEXT: [[I3:%.*]] = alloca i32, align 4
1180 // CHECK3-NEXT: store ptr [[DOTGLOBAL_TID_]], ptr [[DOTGLOBAL_TID__ADDR]], align 4
1181 // CHECK3-NEXT: store ptr [[DOTBOUND_TID_]], ptr [[DOTBOUND_TID__ADDR]], align 4
1182 // CHECK3-NEXT: store ptr [[N]], ptr [[N_ADDR]], align 4
1183 // CHECK3-NEXT: store ptr [[A]], ptr [[A_ADDR]], align 4
1184 // CHECK3-NEXT: [[TMP0:%.*]] = load ptr, ptr [[N_ADDR]], align 4
1185 // CHECK3-NEXT: [[TMP1:%.*]] = load ptr, ptr [[A_ADDR]], align 4
1186 // CHECK3-NEXT: [[TMP2:%.*]] = load i32, ptr [[TMP0]], align 4
1187 // CHECK3-NEXT: store i32 [[TMP2]], ptr [[DOTCAPTURE_EXPR_]], align 4
1188 // CHECK3-NEXT: [[TMP3:%.*]] = load i32, ptr [[DOTCAPTURE_EXPR_]], align 4
1189 // CHECK3-NEXT: [[SUB:%.*]] = sub nsw i32 [[TMP3]], 0
1190 // CHECK3-NEXT: [[DIV:%.*]] = sdiv i32 [[SUB]], 1
1191 // CHECK3-NEXT: [[SUB2:%.*]] = sub nsw i32 [[DIV]], 1
1192 // CHECK3-NEXT: store i32 [[SUB2]], ptr [[DOTCAPTURE_EXPR_1]], align 4
1193 // CHECK3-NEXT: store i32 0, ptr [[I]], align 4
1194 // CHECK3-NEXT: [[TMP4:%.*]] = load i32, ptr [[DOTCAPTURE_EXPR_]], align 4
1195 // CHECK3-NEXT: [[CMP:%.*]] = icmp slt i32 0, [[TMP4]]
1196 // CHECK3-NEXT: br i1 [[CMP]], label [[OMP_PRECOND_THEN:%.*]], label [[OMP_PRECOND_END:%.*]]
1197 // CHECK3: omp.precond.then:
1198 // CHECK3-NEXT: store i32 0, ptr [[DOTOMP_COMB_LB]], align 4
1199 // CHECK3-NEXT: [[TMP5:%.*]] = load i32, ptr [[DOTCAPTURE_EXPR_1]], align 4
1200 // CHECK3-NEXT: store i32 [[TMP5]], ptr [[DOTOMP_COMB_UB]], align 4
1201 // CHECK3-NEXT: store i32 1, ptr [[DOTOMP_STRIDE]], align 4
1202 // CHECK3-NEXT: store i32 0, ptr [[DOTOMP_IS_LAST]], align 4
1203 // CHECK3-NEXT: [[TMP6:%.*]] = load ptr, ptr [[DOTGLOBAL_TID__ADDR]], align 4
1204 // CHECK3-NEXT: [[TMP7:%.*]] = load i32, ptr [[TMP6]], align 4
1205 // CHECK3-NEXT: call void @__kmpc_for_static_init_4(ptr @[[GLOB1]], i32 [[TMP7]], i32 92, ptr [[DOTOMP_IS_LAST]], ptr [[DOTOMP_COMB_LB]], ptr [[DOTOMP_COMB_UB]], ptr [[DOTOMP_STRIDE]], i32 1, i32 1)
1206 // CHECK3-NEXT: [[TMP8:%.*]] = load i32, ptr [[DOTOMP_COMB_UB]], align 4
1207 // CHECK3-NEXT: [[TMP9:%.*]] = load i32, ptr [[DOTCAPTURE_EXPR_1]], align 4
1208 // CHECK3-NEXT: [[CMP4:%.*]] = icmp sgt i32 [[TMP8]], [[TMP9]]
1209 // CHECK3-NEXT: br i1 [[CMP4]], label [[COND_TRUE:%.*]], label [[COND_FALSE:%.*]]
1210 // CHECK3: cond.true:
1211 // CHECK3-NEXT: [[TMP10:%.*]] = load i32, ptr [[DOTCAPTURE_EXPR_1]], align 4
1212 // CHECK3-NEXT: br label [[COND_END:%.*]]
1213 // CHECK3: cond.false:
1214 // CHECK3-NEXT: [[TMP11:%.*]] = load i32, ptr [[DOTOMP_COMB_UB]], align 4
1215 // CHECK3-NEXT: br label [[COND_END]]
1216 // CHECK3: cond.end:
1217 // CHECK3-NEXT: [[COND:%.*]] = phi i32 [ [[TMP10]], [[COND_TRUE]] ], [ [[TMP11]], [[COND_FALSE]] ]
1218 // CHECK3-NEXT: store i32 [[COND]], ptr [[DOTOMP_COMB_UB]], align 4
1219 // CHECK3-NEXT: [[TMP12:%.*]] = load i32, ptr [[DOTOMP_COMB_LB]], align 4
1220 // CHECK3-NEXT: store i32 [[TMP12]], ptr [[DOTOMP_IV]], align 4
1221 // CHECK3-NEXT: br label [[OMP_INNER_FOR_COND:%.*]]
1222 // CHECK3: omp.inner.for.cond:
1223 // CHECK3-NEXT: [[TMP13:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4
1224 // CHECK3-NEXT: [[TMP14:%.*]] = load i32, ptr [[DOTOMP_COMB_UB]], align 4
1225 // CHECK3-NEXT: [[CMP5:%.*]] = icmp sle i32 [[TMP13]], [[TMP14]]
1226 // CHECK3-NEXT: br i1 [[CMP5]], label [[OMP_INNER_FOR_BODY:%.*]], label [[OMP_INNER_FOR_END:%.*]]
1227 // CHECK3: omp.inner.for.body:
1228 // CHECK3-NEXT: [[TMP15:%.*]] = load i32, ptr [[DOTOMP_COMB_LB]], align 4
1229 // CHECK3-NEXT: [[TMP16:%.*]] = load i32, ptr [[DOTOMP_COMB_UB]], align 4
1230 // CHECK3-NEXT: call void (ptr, i32, ptr, ...) @__kmpc_fork_call(ptr @[[GLOB3]], i32 4, ptr @{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z21teams_argument_globali_l34.omp_outlined.omp_outlined, i32 [[TMP15]], i32 [[TMP16]], ptr [[TMP0]], ptr [[TMP1]])
1231 // CHECK3-NEXT: br label [[OMP_INNER_FOR_INC:%.*]]
1232 // CHECK3: omp.inner.for.inc:
1233 // CHECK3-NEXT: [[TMP17:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4
1234 // CHECK3-NEXT: [[TMP18:%.*]] = load i32, ptr [[DOTOMP_STRIDE]], align 4
1235 // CHECK3-NEXT: [[ADD:%.*]] = add nsw i32 [[TMP17]], [[TMP18]]
1236 // CHECK3-NEXT: store i32 [[ADD]], ptr [[DOTOMP_IV]], align 4
1237 // CHECK3-NEXT: br label [[OMP_INNER_FOR_COND]]
1238 // CHECK3: omp.inner.for.end:
1239 // CHECK3-NEXT: br label [[OMP_LOOP_EXIT:%.*]]
1240 // CHECK3: omp.loop.exit:
1241 // CHECK3-NEXT: [[TMP19:%.*]] = load ptr, ptr [[DOTGLOBAL_TID__ADDR]], align 4
1242 // CHECK3-NEXT: [[TMP20:%.*]] = load i32, ptr [[TMP19]], align 4
1243 // CHECK3-NEXT: call void @__kmpc_for_static_fini(ptr @[[GLOB2]], i32 [[TMP20]])
1244 // CHECK3-NEXT: br label [[OMP_PRECOND_END]]
1245 // CHECK3: omp.precond.end:
1246 // CHECK3-NEXT: ret void
1249 // CHECK3-LABEL: define {{[^@]+}}@{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z21teams_argument_globali_l34.omp_outlined.omp_outlined
1250 // CHECK3-SAME: (ptr noalias noundef [[DOTGLOBAL_TID_:%.*]], ptr noalias noundef [[DOTBOUND_TID_:%.*]], i32 noundef [[DOTPREVIOUS_LB_:%.*]], i32 noundef [[DOTPREVIOUS_UB_:%.*]], ptr noundef nonnull align 4 dereferenceable(4) [[N:%.*]], ptr noundef nonnull align 4 dereferenceable(400) [[A:%.*]]) #[[ATTR1]] {
1251 // CHECK3-NEXT: entry:
1252 // CHECK3-NEXT: [[DOTGLOBAL_TID__ADDR:%.*]] = alloca ptr, align 4
1253 // CHECK3-NEXT: [[DOTBOUND_TID__ADDR:%.*]] = alloca ptr, align 4
1254 // CHECK3-NEXT: [[DOTPREVIOUS_LB__ADDR:%.*]] = alloca i32, align 4
1255 // CHECK3-NEXT: [[DOTPREVIOUS_UB__ADDR:%.*]] = alloca i32, align 4
1256 // CHECK3-NEXT: [[N_ADDR:%.*]] = alloca ptr, align 4
1257 // CHECK3-NEXT: [[A_ADDR:%.*]] = alloca ptr, align 4
1258 // CHECK3-NEXT: [[DOTOMP_IV:%.*]] = alloca i32, align 4
1259 // CHECK3-NEXT: [[TMP:%.*]] = alloca i32, align 4
1260 // CHECK3-NEXT: [[DOTCAPTURE_EXPR_:%.*]] = alloca i32, align 4
1261 // CHECK3-NEXT: [[DOTCAPTURE_EXPR_1:%.*]] = alloca i32, align 4
1262 // CHECK3-NEXT: [[I:%.*]] = alloca i32, align 4
1263 // CHECK3-NEXT: [[DOTOMP_LB:%.*]] = alloca i32, align 4
1264 // CHECK3-NEXT: [[DOTOMP_UB:%.*]] = alloca i32, align 4
1265 // CHECK3-NEXT: [[DOTOMP_STRIDE:%.*]] = alloca i32, align 4
1266 // CHECK3-NEXT: [[DOTOMP_IS_LAST:%.*]] = alloca i32, align 4
1267 // CHECK3-NEXT: [[I3:%.*]] = alloca i32, align 4
1268 // CHECK3-NEXT: store ptr [[DOTGLOBAL_TID_]], ptr [[DOTGLOBAL_TID__ADDR]], align 4
1269 // CHECK3-NEXT: store ptr [[DOTBOUND_TID_]], ptr [[DOTBOUND_TID__ADDR]], align 4
1270 // CHECK3-NEXT: store i32 [[DOTPREVIOUS_LB_]], ptr [[DOTPREVIOUS_LB__ADDR]], align 4
1271 // CHECK3-NEXT: store i32 [[DOTPREVIOUS_UB_]], ptr [[DOTPREVIOUS_UB__ADDR]], align 4
1272 // CHECK3-NEXT: store ptr [[N]], ptr [[N_ADDR]], align 4
1273 // CHECK3-NEXT: store ptr [[A]], ptr [[A_ADDR]], align 4
1274 // CHECK3-NEXT: [[TMP0:%.*]] = load ptr, ptr [[N_ADDR]], align 4
1275 // CHECK3-NEXT: [[TMP1:%.*]] = load ptr, ptr [[A_ADDR]], align 4
1276 // CHECK3-NEXT: [[TMP2:%.*]] = load i32, ptr [[TMP0]], align 4
1277 // CHECK3-NEXT: store i32 [[TMP2]], ptr [[DOTCAPTURE_EXPR_]], align 4
1278 // CHECK3-NEXT: [[TMP3:%.*]] = load i32, ptr [[DOTCAPTURE_EXPR_]], align 4
1279 // CHECK3-NEXT: [[SUB:%.*]] = sub nsw i32 [[TMP3]], 0
1280 // CHECK3-NEXT: [[DIV:%.*]] = sdiv i32 [[SUB]], 1
1281 // CHECK3-NEXT: [[SUB2:%.*]] = sub nsw i32 [[DIV]], 1
1282 // CHECK3-NEXT: store i32 [[SUB2]], ptr [[DOTCAPTURE_EXPR_1]], align 4
1283 // CHECK3-NEXT: store i32 0, ptr [[I]], align 4
1284 // CHECK3-NEXT: [[TMP4:%.*]] = load i32, ptr [[DOTCAPTURE_EXPR_]], align 4
1285 // CHECK3-NEXT: [[CMP:%.*]] = icmp slt i32 0, [[TMP4]]
1286 // CHECK3-NEXT: br i1 [[CMP]], label [[OMP_PRECOND_THEN:%.*]], label [[OMP_PRECOND_END:%.*]]
1287 // CHECK3: omp.precond.then:
1288 // CHECK3-NEXT: store i32 0, ptr [[DOTOMP_LB]], align 4
1289 // CHECK3-NEXT: [[TMP5:%.*]] = load i32, ptr [[DOTCAPTURE_EXPR_1]], align 4
1290 // CHECK3-NEXT: store i32 [[TMP5]], ptr [[DOTOMP_UB]], align 4
1291 // CHECK3-NEXT: [[TMP6:%.*]] = load i32, ptr [[DOTPREVIOUS_LB__ADDR]], align 4
1292 // CHECK3-NEXT: [[TMP7:%.*]] = load i32, ptr [[DOTPREVIOUS_UB__ADDR]], align 4
1293 // CHECK3-NEXT: store i32 [[TMP6]], ptr [[DOTOMP_LB]], align 4
1294 // CHECK3-NEXT: store i32 [[TMP7]], ptr [[DOTOMP_UB]], align 4
1295 // CHECK3-NEXT: store i32 1, ptr [[DOTOMP_STRIDE]], align 4
1296 // CHECK3-NEXT: store i32 0, ptr [[DOTOMP_IS_LAST]], align 4
1297 // CHECK3-NEXT: [[TMP8:%.*]] = load ptr, ptr [[DOTGLOBAL_TID__ADDR]], align 4
1298 // CHECK3-NEXT: [[TMP9:%.*]] = load i32, ptr [[TMP8]], align 4
1299 // CHECK3-NEXT: call void @__kmpc_for_static_init_4(ptr @[[GLOB2]], i32 [[TMP9]], i32 34, ptr [[DOTOMP_IS_LAST]], ptr [[DOTOMP_LB]], ptr [[DOTOMP_UB]], ptr [[DOTOMP_STRIDE]], i32 1, i32 1)
1300 // CHECK3-NEXT: [[TMP10:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4
1301 // CHECK3-NEXT: [[TMP11:%.*]] = load i32, ptr [[DOTCAPTURE_EXPR_1]], align 4
1302 // CHECK3-NEXT: [[CMP4:%.*]] = icmp sgt i32 [[TMP10]], [[TMP11]]
1303 // CHECK3-NEXT: br i1 [[CMP4]], label [[COND_TRUE:%.*]], label [[COND_FALSE:%.*]]
1304 // CHECK3: cond.true:
1305 // CHECK3-NEXT: [[TMP12:%.*]] = load i32, ptr [[DOTCAPTURE_EXPR_1]], align 4
1306 // CHECK3-NEXT: br label [[COND_END:%.*]]
1307 // CHECK3: cond.false:
1308 // CHECK3-NEXT: [[TMP13:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4
1309 // CHECK3-NEXT: br label [[COND_END]]
1310 // CHECK3: cond.end:
1311 // CHECK3-NEXT: [[COND:%.*]] = phi i32 [ [[TMP12]], [[COND_TRUE]] ], [ [[TMP13]], [[COND_FALSE]] ]
1312 // CHECK3-NEXT: store i32 [[COND]], ptr [[DOTOMP_UB]], align 4
1313 // CHECK3-NEXT: [[TMP14:%.*]] = load i32, ptr [[DOTOMP_LB]], align 4
1314 // CHECK3-NEXT: store i32 [[TMP14]], ptr [[DOTOMP_IV]], align 4
1315 // CHECK3-NEXT: br label [[OMP_INNER_FOR_COND:%.*]]
1316 // CHECK3: omp.inner.for.cond:
1317 // CHECK3-NEXT: [[TMP15:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4
1318 // CHECK3-NEXT: [[TMP16:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4
1319 // CHECK3-NEXT: [[CMP5:%.*]] = icmp sle i32 [[TMP15]], [[TMP16]]
1320 // CHECK3-NEXT: br i1 [[CMP5]], label [[OMP_INNER_FOR_BODY:%.*]], label [[OMP_INNER_FOR_END:%.*]]
1321 // CHECK3: omp.inner.for.body:
1322 // CHECK3-NEXT: [[TMP17:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4
1323 // CHECK3-NEXT: [[MUL:%.*]] = mul nsw i32 [[TMP17]], 1
1324 // CHECK3-NEXT: [[ADD:%.*]] = add nsw i32 0, [[MUL]]
1325 // CHECK3-NEXT: store i32 [[ADD]], ptr [[I3]], align 4
1326 // CHECK3-NEXT: [[TMP18:%.*]] = load i32, ptr [[I3]], align 4
1327 // CHECK3-NEXT: [[ARRAYIDX:%.*]] = getelementptr inbounds [100 x i32], ptr [[TMP1]], i32 0, i32 [[TMP18]]
1328 // CHECK3-NEXT: store i32 0, ptr [[ARRAYIDX]], align 4
1329 // CHECK3-NEXT: br label [[OMP_BODY_CONTINUE:%.*]]
1330 // CHECK3: omp.body.continue:
1331 // CHECK3-NEXT: br label [[OMP_INNER_FOR_INC:%.*]]
1332 // CHECK3: omp.inner.for.inc:
1333 // CHECK3-NEXT: [[TMP19:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4
1334 // CHECK3-NEXT: [[ADD6:%.*]] = add nsw i32 [[TMP19]], 1
1335 // CHECK3-NEXT: store i32 [[ADD6]], ptr [[DOTOMP_IV]], align 4
1336 // CHECK3-NEXT: br label [[OMP_INNER_FOR_COND]]
1337 // CHECK3: omp.inner.for.end:
1338 // CHECK3-NEXT: br label [[OMP_LOOP_EXIT:%.*]]
1339 // CHECK3: omp.loop.exit:
1340 // CHECK3-NEXT: [[TMP20:%.*]] = load ptr, ptr [[DOTGLOBAL_TID__ADDR]], align 4
1341 // CHECK3-NEXT: [[TMP21:%.*]] = load i32, ptr [[TMP20]], align 4
1342 // CHECK3-NEXT: call void @__kmpc_for_static_fini(ptr @[[GLOB2]], i32 [[TMP21]])
1343 // CHECK3-NEXT: br label [[OMP_PRECOND_END]]
1344 // CHECK3: omp.precond.end:
1345 // CHECK3-NEXT: ret void
1348 // CHECK3-LABEL: define {{[^@]+}}@.omp_offloading.requires_reg
1349 // CHECK3-SAME: () #[[ATTR4:[0-9]+]] {
1350 // CHECK3-NEXT: entry:
1351 // CHECK3-NEXT: call void @__tgt_register_requires(i64 1)
1352 // CHECK3-NEXT: ret void
1355 // CHECK9-LABEL: define {{[^@]+}}@_Z15teams_local_argv
1356 // CHECK9-SAME: () #[[ATTR0:[0-9]+]] {
1357 // CHECK9-NEXT: entry:
1358 // CHECK9-NEXT: [[N:%.*]] = alloca i32, align 4
1359 // CHECK9-NEXT: [[SAVED_STACK:%.*]] = alloca ptr, align 8
1360 // CHECK9-NEXT: [[__VLA_EXPR0:%.*]] = alloca i64, align 8
1361 // CHECK9-NEXT: [[N_CASTED:%.*]] = alloca i64, align 8
1362 // CHECK9-NEXT: [[DOTOFFLOAD_BASEPTRS:%.*]] = alloca [3 x ptr], align 8
1363 // CHECK9-NEXT: [[DOTOFFLOAD_PTRS:%.*]] = alloca [3 x ptr], align 8
1364 // CHECK9-NEXT: [[DOTOFFLOAD_MAPPERS:%.*]] = alloca [3 x ptr], align 8
1365 // CHECK9-NEXT: [[DOTOFFLOAD_SIZES:%.*]] = alloca [3 x i64], align 8
1366 // CHECK9-NEXT: [[TMP:%.*]] = alloca i32, align 4
1367 // CHECK9-NEXT: [[DOTCAPTURE_EXPR_:%.*]] = alloca i32, align 4
1368 // CHECK9-NEXT: [[DOTCAPTURE_EXPR_1:%.*]] = alloca i32, align 4
1369 // CHECK9-NEXT: [[KERNEL_ARGS:%.*]] = alloca [[STRUCT___TGT_KERNEL_ARGUMENTS:%.*]], align 8
1370 // CHECK9-NEXT: store i32 100, ptr [[N]], align 4
1371 // CHECK9-NEXT: [[TMP0:%.*]] = load i32, ptr [[N]], align 4
1372 // CHECK9-NEXT: [[TMP1:%.*]] = zext i32 [[TMP0]] to i64
1373 // CHECK9-NEXT: [[TMP2:%.*]] = call ptr @llvm.stacksave.p0()
1374 // CHECK9-NEXT: store ptr [[TMP2]], ptr [[SAVED_STACK]], align 8
1375 // CHECK9-NEXT: [[VLA:%.*]] = alloca i32, i64 [[TMP1]], align 4
1376 // CHECK9-NEXT: store i64 [[TMP1]], ptr [[__VLA_EXPR0]], align 8
1377 // CHECK9-NEXT: [[TMP3:%.*]] = load i32, ptr [[N]], align 4
1378 // CHECK9-NEXT: store i32 [[TMP3]], ptr [[N_CASTED]], align 4
1379 // CHECK9-NEXT: [[TMP4:%.*]] = load i64, ptr [[N_CASTED]], align 8
1380 // CHECK9-NEXT: [[TMP5:%.*]] = mul nuw i64 [[TMP1]], 4
1381 // CHECK9-NEXT: call void @llvm.memcpy.p0.p0.i64(ptr align 8 [[DOTOFFLOAD_SIZES]], ptr align 8 @.offload_sizes, i64 24, i1 false)
1382 // CHECK9-NEXT: [[TMP6:%.*]] = getelementptr inbounds [3 x ptr], ptr [[DOTOFFLOAD_BASEPTRS]], i32 0, i32 0
1383 // CHECK9-NEXT: store i64 [[TMP4]], ptr [[TMP6]], align 8
1384 // CHECK9-NEXT: [[TMP7:%.*]] = getelementptr inbounds [3 x ptr], ptr [[DOTOFFLOAD_PTRS]], i32 0, i32 0
1385 // CHECK9-NEXT: store i64 [[TMP4]], ptr [[TMP7]], align 8
1386 // CHECK9-NEXT: [[TMP8:%.*]] = getelementptr inbounds [3 x ptr], ptr [[DOTOFFLOAD_MAPPERS]], i64 0, i64 0
1387 // CHECK9-NEXT: store ptr null, ptr [[TMP8]], align 8
1388 // CHECK9-NEXT: [[TMP9:%.*]] = getelementptr inbounds [3 x ptr], ptr [[DOTOFFLOAD_BASEPTRS]], i32 0, i32 1
1389 // CHECK9-NEXT: store i64 [[TMP1]], ptr [[TMP9]], align 8
1390 // CHECK9-NEXT: [[TMP10:%.*]] = getelementptr inbounds [3 x ptr], ptr [[DOTOFFLOAD_PTRS]], i32 0, i32 1
1391 // CHECK9-NEXT: store i64 [[TMP1]], ptr [[TMP10]], align 8
1392 // CHECK9-NEXT: [[TMP11:%.*]] = getelementptr inbounds [3 x ptr], ptr [[DOTOFFLOAD_MAPPERS]], i64 0, i64 1
1393 // CHECK9-NEXT: store ptr null, ptr [[TMP11]], align 8
1394 // CHECK9-NEXT: [[TMP12:%.*]] = getelementptr inbounds [3 x ptr], ptr [[DOTOFFLOAD_BASEPTRS]], i32 0, i32 2
1395 // CHECK9-NEXT: store ptr [[VLA]], ptr [[TMP12]], align 8
1396 // CHECK9-NEXT: [[TMP13:%.*]] = getelementptr inbounds [3 x ptr], ptr [[DOTOFFLOAD_PTRS]], i32 0, i32 2
1397 // CHECK9-NEXT: store ptr [[VLA]], ptr [[TMP13]], align 8
1398 // CHECK9-NEXT: [[TMP14:%.*]] = getelementptr inbounds [3 x i64], ptr [[DOTOFFLOAD_SIZES]], i32 0, i32 2
1399 // CHECK9-NEXT: store i64 [[TMP5]], ptr [[TMP14]], align 8
1400 // CHECK9-NEXT: [[TMP15:%.*]] = getelementptr inbounds [3 x ptr], ptr [[DOTOFFLOAD_MAPPERS]], i64 0, i64 2
1401 // CHECK9-NEXT: store ptr null, ptr [[TMP15]], align 8
1402 // CHECK9-NEXT: [[TMP16:%.*]] = getelementptr inbounds [3 x ptr], ptr [[DOTOFFLOAD_BASEPTRS]], i32 0, i32 0
1403 // CHECK9-NEXT: [[TMP17:%.*]] = getelementptr inbounds [3 x ptr], ptr [[DOTOFFLOAD_PTRS]], i32 0, i32 0
1404 // CHECK9-NEXT: [[TMP18:%.*]] = getelementptr inbounds [3 x i64], ptr [[DOTOFFLOAD_SIZES]], i32 0, i32 0
1405 // CHECK9-NEXT: [[TMP19:%.*]] = load i32, ptr [[N]], align 4
1406 // CHECK9-NEXT: store i32 [[TMP19]], ptr [[DOTCAPTURE_EXPR_]], align 4
1407 // CHECK9-NEXT: [[TMP20:%.*]] = load i32, ptr [[DOTCAPTURE_EXPR_]], align 4
1408 // CHECK9-NEXT: [[SUB:%.*]] = sub nsw i32 [[TMP20]], 0
1409 // CHECK9-NEXT: [[DIV:%.*]] = sdiv i32 [[SUB]], 1
1410 // CHECK9-NEXT: [[SUB2:%.*]] = sub nsw i32 [[DIV]], 1
1411 // CHECK9-NEXT: store i32 [[SUB2]], ptr [[DOTCAPTURE_EXPR_1]], align 4
1412 // CHECK9-NEXT: [[TMP21:%.*]] = load i32, ptr [[DOTCAPTURE_EXPR_1]], align 4
1413 // CHECK9-NEXT: [[ADD:%.*]] = add nsw i32 [[TMP21]], 1
1414 // CHECK9-NEXT: [[TMP22:%.*]] = zext i32 [[ADD]] to i64
1415 // CHECK9-NEXT: [[TMP23:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 0
1416 // CHECK9-NEXT: store i32 2, ptr [[TMP23]], align 4
1417 // CHECK9-NEXT: [[TMP24:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 1
1418 // CHECK9-NEXT: store i32 3, ptr [[TMP24]], align 4
1419 // CHECK9-NEXT: [[TMP25:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 2
1420 // CHECK9-NEXT: store ptr [[TMP16]], ptr [[TMP25]], align 8
1421 // CHECK9-NEXT: [[TMP26:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 3
1422 // CHECK9-NEXT: store ptr [[TMP17]], ptr [[TMP26]], align 8
1423 // CHECK9-NEXT: [[TMP27:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 4
1424 // CHECK9-NEXT: store ptr [[TMP18]], ptr [[TMP27]], align 8
1425 // CHECK9-NEXT: [[TMP28:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 5
1426 // CHECK9-NEXT: store ptr @.offload_maptypes, ptr [[TMP28]], align 8
1427 // CHECK9-NEXT: [[TMP29:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 6
1428 // CHECK9-NEXT: store ptr null, ptr [[TMP29]], align 8
1429 // CHECK9-NEXT: [[TMP30:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 7
1430 // CHECK9-NEXT: store ptr null, ptr [[TMP30]], align 8
1431 // CHECK9-NEXT: [[TMP31:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 8
1432 // CHECK9-NEXT: store i64 [[TMP22]], ptr [[TMP31]], align 8
1433 // CHECK9-NEXT: [[TMP32:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 9
1434 // CHECK9-NEXT: store i64 0, ptr [[TMP32]], align 8
1435 // CHECK9-NEXT: [[TMP33:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 10
1436 // CHECK9-NEXT: store [3 x i32] zeroinitializer, ptr [[TMP33]], align 4
1437 // CHECK9-NEXT: [[TMP34:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 11
1438 // CHECK9-NEXT: store [3 x i32] zeroinitializer, ptr [[TMP34]], align 4
1439 // CHECK9-NEXT: [[TMP35:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 12
1440 // CHECK9-NEXT: store i32 0, ptr [[TMP35]], align 4
1441 // CHECK9-NEXT: [[TMP36:%.*]] = call i32 @__tgt_target_kernel(ptr @[[GLOB3:[0-9]+]], i64 -1, i32 0, i32 0, ptr @.{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z15teams_local_argv_l72.region_id, ptr [[KERNEL_ARGS]])
1442 // CHECK9-NEXT: [[TMP37:%.*]] = icmp ne i32 [[TMP36]], 0
1443 // CHECK9-NEXT: br i1 [[TMP37]], label [[OMP_OFFLOAD_FAILED:%.*]], label [[OMP_OFFLOAD_CONT:%.*]]
1444 // CHECK9: omp_offload.failed:
1445 // CHECK9-NEXT: call void @{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z15teams_local_argv_l72(i64 [[TMP4]], i64 [[TMP1]], ptr [[VLA]]) #[[ATTR4:[0-9]+]]
1446 // CHECK9-NEXT: br label [[OMP_OFFLOAD_CONT]]
1447 // CHECK9: omp_offload.cont:
1448 // CHECK9-NEXT: [[ARRAYIDX:%.*]] = getelementptr inbounds i32, ptr [[VLA]], i64 0
1449 // CHECK9-NEXT: [[TMP38:%.*]] = load i32, ptr [[ARRAYIDX]], align 4
1450 // CHECK9-NEXT: [[TMP39:%.*]] = load ptr, ptr [[SAVED_STACK]], align 8
1451 // CHECK9-NEXT: call void @llvm.stackrestore.p0(ptr [[TMP39]])
1452 // CHECK9-NEXT: ret i32 [[TMP38]]
1455 // CHECK9-LABEL: define {{[^@]+}}@{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z15teams_local_argv_l72
1456 // CHECK9-SAME: (i64 noundef [[N:%.*]], i64 noundef [[VLA:%.*]], ptr noundef nonnull align 4 dereferenceable(4) [[A:%.*]]) #[[ATTR2:[0-9]+]] {
1457 // CHECK9-NEXT: entry:
1458 // CHECK9-NEXT: [[N_ADDR:%.*]] = alloca i64, align 8
1459 // CHECK9-NEXT: [[VLA_ADDR:%.*]] = alloca i64, align 8
1460 // CHECK9-NEXT: [[A_ADDR:%.*]] = alloca ptr, align 8
1461 // CHECK9-NEXT: store i64 [[N]], ptr [[N_ADDR]], align 8
1462 // CHECK9-NEXT: store i64 [[VLA]], ptr [[VLA_ADDR]], align 8
1463 // CHECK9-NEXT: store ptr [[A]], ptr [[A_ADDR]], align 8
1464 // CHECK9-NEXT: [[TMP0:%.*]] = load i64, ptr [[VLA_ADDR]], align 8
1465 // CHECK9-NEXT: [[TMP1:%.*]] = load ptr, ptr [[A_ADDR]], align 8
1466 // CHECK9-NEXT: call void (ptr, i32, ptr, ...) @__kmpc_fork_teams(ptr @[[GLOB3]], i32 3, ptr @{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z15teams_local_argv_l72.omp_outlined, ptr [[N_ADDR]], i64 [[TMP0]], ptr [[TMP1]])
1467 // CHECK9-NEXT: ret void
1470 // CHECK9-LABEL: define {{[^@]+}}@{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z15teams_local_argv_l72.omp_outlined
1471 // CHECK9-SAME: (ptr noalias noundef [[DOTGLOBAL_TID_:%.*]], ptr noalias noundef [[DOTBOUND_TID_:%.*]], ptr noundef nonnull align 4 dereferenceable(4) [[N:%.*]], i64 noundef [[VLA:%.*]], ptr noundef nonnull align 4 dereferenceable(4) [[A:%.*]]) #[[ATTR3:[0-9]+]] {
1472 // CHECK9-NEXT: entry:
1473 // CHECK9-NEXT: [[DOTGLOBAL_TID__ADDR:%.*]] = alloca ptr, align 8
1474 // CHECK9-NEXT: [[DOTBOUND_TID__ADDR:%.*]] = alloca ptr, align 8
1475 // CHECK9-NEXT: [[N_ADDR:%.*]] = alloca ptr, align 8
1476 // CHECK9-NEXT: [[VLA_ADDR:%.*]] = alloca i64, align 8
1477 // CHECK9-NEXT: [[A_ADDR:%.*]] = alloca ptr, align 8
1478 // CHECK9-NEXT: [[DOTOMP_IV:%.*]] = alloca i32, align 4
1479 // CHECK9-NEXT: [[TMP:%.*]] = alloca i32, align 4
1480 // CHECK9-NEXT: [[DOTCAPTURE_EXPR_:%.*]] = alloca i32, align 4
1481 // CHECK9-NEXT: [[DOTCAPTURE_EXPR_1:%.*]] = alloca i32, align 4
1482 // CHECK9-NEXT: [[I:%.*]] = alloca i32, align 4
1483 // CHECK9-NEXT: [[DOTOMP_COMB_LB:%.*]] = alloca i32, align 4
1484 // CHECK9-NEXT: [[DOTOMP_COMB_UB:%.*]] = alloca i32, align 4
1485 // CHECK9-NEXT: [[DOTOMP_STRIDE:%.*]] = alloca i32, align 4
1486 // CHECK9-NEXT: [[DOTOMP_IS_LAST:%.*]] = alloca i32, align 4
1487 // CHECK9-NEXT: [[I3:%.*]] = alloca i32, align 4
1488 // CHECK9-NEXT: store ptr [[DOTGLOBAL_TID_]], ptr [[DOTGLOBAL_TID__ADDR]], align 8
1489 // CHECK9-NEXT: store ptr [[DOTBOUND_TID_]], ptr [[DOTBOUND_TID__ADDR]], align 8
1490 // CHECK9-NEXT: store ptr [[N]], ptr [[N_ADDR]], align 8
1491 // CHECK9-NEXT: store i64 [[VLA]], ptr [[VLA_ADDR]], align 8
1492 // CHECK9-NEXT: store ptr [[A]], ptr [[A_ADDR]], align 8
1493 // CHECK9-NEXT: [[TMP0:%.*]] = load ptr, ptr [[N_ADDR]], align 8
1494 // CHECK9-NEXT: [[TMP1:%.*]] = load i64, ptr [[VLA_ADDR]], align 8
1495 // CHECK9-NEXT: [[TMP2:%.*]] = load ptr, ptr [[A_ADDR]], align 8
1496 // CHECK9-NEXT: [[TMP3:%.*]] = load i32, ptr [[TMP0]], align 4
1497 // CHECK9-NEXT: store i32 [[TMP3]], ptr [[DOTCAPTURE_EXPR_]], align 4
1498 // CHECK9-NEXT: [[TMP4:%.*]] = load i32, ptr [[DOTCAPTURE_EXPR_]], align 4
1499 // CHECK9-NEXT: [[SUB:%.*]] = sub nsw i32 [[TMP4]], 0
1500 // CHECK9-NEXT: [[DIV:%.*]] = sdiv i32 [[SUB]], 1
1501 // CHECK9-NEXT: [[SUB2:%.*]] = sub nsw i32 [[DIV]], 1
1502 // CHECK9-NEXT: store i32 [[SUB2]], ptr [[DOTCAPTURE_EXPR_1]], align 4
1503 // CHECK9-NEXT: store i32 0, ptr [[I]], align 4
1504 // CHECK9-NEXT: [[TMP5:%.*]] = load i32, ptr [[DOTCAPTURE_EXPR_]], align 4
1505 // CHECK9-NEXT: [[CMP:%.*]] = icmp slt i32 0, [[TMP5]]
1506 // CHECK9-NEXT: br i1 [[CMP]], label [[OMP_PRECOND_THEN:%.*]], label [[OMP_PRECOND_END:%.*]]
1507 // CHECK9: omp.precond.then:
1508 // CHECK9-NEXT: store i32 0, ptr [[DOTOMP_COMB_LB]], align 4
1509 // CHECK9-NEXT: [[TMP6:%.*]] = load i32, ptr [[DOTCAPTURE_EXPR_1]], align 4
1510 // CHECK9-NEXT: store i32 [[TMP6]], ptr [[DOTOMP_COMB_UB]], align 4
1511 // CHECK9-NEXT: store i32 1, ptr [[DOTOMP_STRIDE]], align 4
1512 // CHECK9-NEXT: store i32 0, ptr [[DOTOMP_IS_LAST]], align 4
1513 // CHECK9-NEXT: [[TMP7:%.*]] = load ptr, ptr [[DOTGLOBAL_TID__ADDR]], align 8
1514 // CHECK9-NEXT: [[TMP8:%.*]] = load i32, ptr [[TMP7]], align 4
1515 // CHECK9-NEXT: call void @__kmpc_for_static_init_4(ptr @[[GLOB1:[0-9]+]], i32 [[TMP8]], i32 92, ptr [[DOTOMP_IS_LAST]], ptr [[DOTOMP_COMB_LB]], ptr [[DOTOMP_COMB_UB]], ptr [[DOTOMP_STRIDE]], i32 1, i32 1)
1516 // CHECK9-NEXT: [[TMP9:%.*]] = load i32, ptr [[DOTOMP_COMB_UB]], align 4
1517 // CHECK9-NEXT: [[TMP10:%.*]] = load i32, ptr [[DOTCAPTURE_EXPR_1]], align 4
1518 // CHECK9-NEXT: [[CMP4:%.*]] = icmp sgt i32 [[TMP9]], [[TMP10]]
1519 // CHECK9-NEXT: br i1 [[CMP4]], label [[COND_TRUE:%.*]], label [[COND_FALSE:%.*]]
1520 // CHECK9: cond.true:
1521 // CHECK9-NEXT: [[TMP11:%.*]] = load i32, ptr [[DOTCAPTURE_EXPR_1]], align 4
1522 // CHECK9-NEXT: br label [[COND_END:%.*]]
1523 // CHECK9: cond.false:
1524 // CHECK9-NEXT: [[TMP12:%.*]] = load i32, ptr [[DOTOMP_COMB_UB]], align 4
1525 // CHECK9-NEXT: br label [[COND_END]]
1526 // CHECK9: cond.end:
1527 // CHECK9-NEXT: [[COND:%.*]] = phi i32 [ [[TMP11]], [[COND_TRUE]] ], [ [[TMP12]], [[COND_FALSE]] ]
1528 // CHECK9-NEXT: store i32 [[COND]], ptr [[DOTOMP_COMB_UB]], align 4
1529 // CHECK9-NEXT: [[TMP13:%.*]] = load i32, ptr [[DOTOMP_COMB_LB]], align 4
1530 // CHECK9-NEXT: store i32 [[TMP13]], ptr [[DOTOMP_IV]], align 4
1531 // CHECK9-NEXT: br label [[OMP_INNER_FOR_COND:%.*]]
1532 // CHECK9: omp.inner.for.cond:
1533 // CHECK9-NEXT: [[TMP14:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4
1534 // CHECK9-NEXT: [[TMP15:%.*]] = load i32, ptr [[DOTOMP_COMB_UB]], align 4
1535 // CHECK9-NEXT: [[CMP5:%.*]] = icmp sle i32 [[TMP14]], [[TMP15]]
1536 // CHECK9-NEXT: br i1 [[CMP5]], label [[OMP_INNER_FOR_BODY:%.*]], label [[OMP_INNER_FOR_END:%.*]]
1537 // CHECK9: omp.inner.for.body:
1538 // CHECK9-NEXT: [[TMP16:%.*]] = load i32, ptr [[DOTOMP_COMB_LB]], align 4
1539 // CHECK9-NEXT: [[TMP17:%.*]] = zext i32 [[TMP16]] to i64
1540 // CHECK9-NEXT: [[TMP18:%.*]] = load i32, ptr [[DOTOMP_COMB_UB]], align 4
1541 // CHECK9-NEXT: [[TMP19:%.*]] = zext i32 [[TMP18]] to i64
1542 // CHECK9-NEXT: call void (ptr, i32, ptr, ...) @__kmpc_fork_call(ptr @[[GLOB3]], i32 5, ptr @{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z15teams_local_argv_l72.omp_outlined.omp_outlined, i64 [[TMP17]], i64 [[TMP19]], ptr [[TMP0]], i64 [[TMP1]], ptr [[TMP2]])
1543 // CHECK9-NEXT: br label [[OMP_INNER_FOR_INC:%.*]]
1544 // CHECK9: omp.inner.for.inc:
1545 // CHECK9-NEXT: [[TMP20:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4
1546 // CHECK9-NEXT: [[TMP21:%.*]] = load i32, ptr [[DOTOMP_STRIDE]], align 4
1547 // CHECK9-NEXT: [[ADD:%.*]] = add nsw i32 [[TMP20]], [[TMP21]]
1548 // CHECK9-NEXT: store i32 [[ADD]], ptr [[DOTOMP_IV]], align 4
1549 // CHECK9-NEXT: br label [[OMP_INNER_FOR_COND]]
1550 // CHECK9: omp.inner.for.end:
1551 // CHECK9-NEXT: br label [[OMP_LOOP_EXIT:%.*]]
1552 // CHECK9: omp.loop.exit:
1553 // CHECK9-NEXT: [[TMP22:%.*]] = load ptr, ptr [[DOTGLOBAL_TID__ADDR]], align 8
1554 // CHECK9-NEXT: [[TMP23:%.*]] = load i32, ptr [[TMP22]], align 4
1555 // CHECK9-NEXT: call void @__kmpc_for_static_fini(ptr @[[GLOB2:[0-9]+]], i32 [[TMP23]])
1556 // CHECK9-NEXT: br label [[OMP_PRECOND_END]]
1557 // CHECK9: omp.precond.end:
1558 // CHECK9-NEXT: ret void
1561 // CHECK9-LABEL: define {{[^@]+}}@{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z15teams_local_argv_l72.omp_outlined.omp_outlined
1562 // CHECK9-SAME: (ptr noalias noundef [[DOTGLOBAL_TID_:%.*]], ptr noalias noundef [[DOTBOUND_TID_:%.*]], i64 noundef [[DOTPREVIOUS_LB_:%.*]], i64 noundef [[DOTPREVIOUS_UB_:%.*]], ptr noundef nonnull align 4 dereferenceable(4) [[N:%.*]], i64 noundef [[VLA:%.*]], ptr noundef nonnull align 4 dereferenceable(4) [[A:%.*]]) #[[ATTR3]] {
1563 // CHECK9-NEXT: entry:
1564 // CHECK9-NEXT: [[DOTGLOBAL_TID__ADDR:%.*]] = alloca ptr, align 8
1565 // CHECK9-NEXT: [[DOTBOUND_TID__ADDR:%.*]] = alloca ptr, align 8
1566 // CHECK9-NEXT: [[DOTPREVIOUS_LB__ADDR:%.*]] = alloca i64, align 8
1567 // CHECK9-NEXT: [[DOTPREVIOUS_UB__ADDR:%.*]] = alloca i64, align 8
1568 // CHECK9-NEXT: [[N_ADDR:%.*]] = alloca ptr, align 8
1569 // CHECK9-NEXT: [[VLA_ADDR:%.*]] = alloca i64, align 8
1570 // CHECK9-NEXT: [[A_ADDR:%.*]] = alloca ptr, align 8
1571 // CHECK9-NEXT: [[DOTOMP_IV:%.*]] = alloca i32, align 4
1572 // CHECK9-NEXT: [[TMP:%.*]] = alloca i32, align 4
1573 // CHECK9-NEXT: [[DOTCAPTURE_EXPR_:%.*]] = alloca i32, align 4
1574 // CHECK9-NEXT: [[DOTCAPTURE_EXPR_1:%.*]] = alloca i32, align 4
1575 // CHECK9-NEXT: [[I:%.*]] = alloca i32, align 4
1576 // CHECK9-NEXT: [[DOTOMP_LB:%.*]] = alloca i32, align 4
1577 // CHECK9-NEXT: [[DOTOMP_UB:%.*]] = alloca i32, align 4
1578 // CHECK9-NEXT: [[DOTOMP_STRIDE:%.*]] = alloca i32, align 4
1579 // CHECK9-NEXT: [[DOTOMP_IS_LAST:%.*]] = alloca i32, align 4
1580 // CHECK9-NEXT: [[I4:%.*]] = alloca i32, align 4
1581 // CHECK9-NEXT: store ptr [[DOTGLOBAL_TID_]], ptr [[DOTGLOBAL_TID__ADDR]], align 8
1582 // CHECK9-NEXT: store ptr [[DOTBOUND_TID_]], ptr [[DOTBOUND_TID__ADDR]], align 8
1583 // CHECK9-NEXT: store i64 [[DOTPREVIOUS_LB_]], ptr [[DOTPREVIOUS_LB__ADDR]], align 8
1584 // CHECK9-NEXT: store i64 [[DOTPREVIOUS_UB_]], ptr [[DOTPREVIOUS_UB__ADDR]], align 8
1585 // CHECK9-NEXT: store ptr [[N]], ptr [[N_ADDR]], align 8
1586 // CHECK9-NEXT: store i64 [[VLA]], ptr [[VLA_ADDR]], align 8
1587 // CHECK9-NEXT: store ptr [[A]], ptr [[A_ADDR]], align 8
1588 // CHECK9-NEXT: [[TMP0:%.*]] = load ptr, ptr [[N_ADDR]], align 8
1589 // CHECK9-NEXT: [[TMP1:%.*]] = load i64, ptr [[VLA_ADDR]], align 8
1590 // CHECK9-NEXT: [[TMP2:%.*]] = load ptr, ptr [[A_ADDR]], align 8
1591 // CHECK9-NEXT: [[TMP3:%.*]] = load i32, ptr [[TMP0]], align 4
1592 // CHECK9-NEXT: store i32 [[TMP3]], ptr [[DOTCAPTURE_EXPR_]], align 4
1593 // CHECK9-NEXT: [[TMP4:%.*]] = load i32, ptr [[DOTCAPTURE_EXPR_]], align 4
1594 // CHECK9-NEXT: [[SUB:%.*]] = sub nsw i32 [[TMP4]], 0
1595 // CHECK9-NEXT: [[DIV:%.*]] = sdiv i32 [[SUB]], 1
1596 // CHECK9-NEXT: [[SUB2:%.*]] = sub nsw i32 [[DIV]], 1
1597 // CHECK9-NEXT: store i32 [[SUB2]], ptr [[DOTCAPTURE_EXPR_1]], align 4
1598 // CHECK9-NEXT: store i32 0, ptr [[I]], align 4
1599 // CHECK9-NEXT: [[TMP5:%.*]] = load i32, ptr [[DOTCAPTURE_EXPR_]], align 4
1600 // CHECK9-NEXT: [[CMP:%.*]] = icmp slt i32 0, [[TMP5]]
1601 // CHECK9-NEXT: br i1 [[CMP]], label [[OMP_PRECOND_THEN:%.*]], label [[OMP_PRECOND_END:%.*]]
1602 // CHECK9: omp.precond.then:
1603 // CHECK9-NEXT: store i32 0, ptr [[DOTOMP_LB]], align 4
1604 // CHECK9-NEXT: [[TMP6:%.*]] = load i32, ptr [[DOTCAPTURE_EXPR_1]], align 4
1605 // CHECK9-NEXT: store i32 [[TMP6]], ptr [[DOTOMP_UB]], align 4
1606 // CHECK9-NEXT: [[TMP7:%.*]] = load i64, ptr [[DOTPREVIOUS_LB__ADDR]], align 8
1607 // CHECK9-NEXT: [[CONV:%.*]] = trunc i64 [[TMP7]] to i32
1608 // CHECK9-NEXT: [[TMP8:%.*]] = load i64, ptr [[DOTPREVIOUS_UB__ADDR]], align 8
1609 // CHECK9-NEXT: [[CONV3:%.*]] = trunc i64 [[TMP8]] to i32
1610 // CHECK9-NEXT: store i32 [[CONV]], ptr [[DOTOMP_LB]], align 4
1611 // CHECK9-NEXT: store i32 [[CONV3]], ptr [[DOTOMP_UB]], align 4
1612 // CHECK9-NEXT: store i32 1, ptr [[DOTOMP_STRIDE]], align 4
1613 // CHECK9-NEXT: store i32 0, ptr [[DOTOMP_IS_LAST]], align 4
1614 // CHECK9-NEXT: [[TMP9:%.*]] = load ptr, ptr [[DOTGLOBAL_TID__ADDR]], align 8
1615 // CHECK9-NEXT: [[TMP10:%.*]] = load i32, ptr [[TMP9]], align 4
1616 // CHECK9-NEXT: call void @__kmpc_for_static_init_4(ptr @[[GLOB2]], i32 [[TMP10]], i32 34, ptr [[DOTOMP_IS_LAST]], ptr [[DOTOMP_LB]], ptr [[DOTOMP_UB]], ptr [[DOTOMP_STRIDE]], i32 1, i32 1)
1617 // CHECK9-NEXT: [[TMP11:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4
1618 // CHECK9-NEXT: [[TMP12:%.*]] = load i32, ptr [[DOTCAPTURE_EXPR_1]], align 4
1619 // CHECK9-NEXT: [[CMP5:%.*]] = icmp sgt i32 [[TMP11]], [[TMP12]]
1620 // CHECK9-NEXT: br i1 [[CMP5]], label [[COND_TRUE:%.*]], label [[COND_FALSE:%.*]]
1621 // CHECK9: cond.true:
1622 // CHECK9-NEXT: [[TMP13:%.*]] = load i32, ptr [[DOTCAPTURE_EXPR_1]], align 4
1623 // CHECK9-NEXT: br label [[COND_END:%.*]]
1624 // CHECK9: cond.false:
1625 // CHECK9-NEXT: [[TMP14:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4
1626 // CHECK9-NEXT: br label [[COND_END]]
1627 // CHECK9: cond.end:
1628 // CHECK9-NEXT: [[COND:%.*]] = phi i32 [ [[TMP13]], [[COND_TRUE]] ], [ [[TMP14]], [[COND_FALSE]] ]
1629 // CHECK9-NEXT: store i32 [[COND]], ptr [[DOTOMP_UB]], align 4
1630 // CHECK9-NEXT: [[TMP15:%.*]] = load i32, ptr [[DOTOMP_LB]], align 4
1631 // CHECK9-NEXT: store i32 [[TMP15]], ptr [[DOTOMP_IV]], align 4
1632 // CHECK9-NEXT: br label [[OMP_INNER_FOR_COND:%.*]]
1633 // CHECK9: omp.inner.for.cond:
1634 // CHECK9-NEXT: [[TMP16:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4
1635 // CHECK9-NEXT: [[TMP17:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4
1636 // CHECK9-NEXT: [[CMP6:%.*]] = icmp sle i32 [[TMP16]], [[TMP17]]
1637 // CHECK9-NEXT: br i1 [[CMP6]], label [[OMP_INNER_FOR_BODY:%.*]], label [[OMP_INNER_FOR_END:%.*]]
1638 // CHECK9: omp.inner.for.body:
1639 // CHECK9-NEXT: [[TMP18:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4
1640 // CHECK9-NEXT: [[MUL:%.*]] = mul nsw i32 [[TMP18]], 1
1641 // CHECK9-NEXT: [[ADD:%.*]] = add nsw i32 0, [[MUL]]
1642 // CHECK9-NEXT: store i32 [[ADD]], ptr [[I4]], align 4
1643 // CHECK9-NEXT: [[TMP19:%.*]] = load i32, ptr [[I4]], align 4
1644 // CHECK9-NEXT: [[IDXPROM:%.*]] = sext i32 [[TMP19]] to i64
1645 // CHECK9-NEXT: [[ARRAYIDX:%.*]] = getelementptr inbounds i32, ptr [[TMP2]], i64 [[IDXPROM]]
1646 // CHECK9-NEXT: store i32 0, ptr [[ARRAYIDX]], align 4
1647 // CHECK9-NEXT: br label [[OMP_BODY_CONTINUE:%.*]]
1648 // CHECK9: omp.body.continue:
1649 // CHECK9-NEXT: br label [[OMP_INNER_FOR_INC:%.*]]
1650 // CHECK9: omp.inner.for.inc:
1651 // CHECK9-NEXT: [[TMP20:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4
1652 // CHECK9-NEXT: [[ADD7:%.*]] = add nsw i32 [[TMP20]], 1
1653 // CHECK9-NEXT: store i32 [[ADD7]], ptr [[DOTOMP_IV]], align 4
1654 // CHECK9-NEXT: br label [[OMP_INNER_FOR_COND]]
1655 // CHECK9: omp.inner.for.end:
1656 // CHECK9-NEXT: br label [[OMP_LOOP_EXIT:%.*]]
1657 // CHECK9: omp.loop.exit:
1658 // CHECK9-NEXT: [[TMP21:%.*]] = load ptr, ptr [[DOTGLOBAL_TID__ADDR]], align 8
1659 // CHECK9-NEXT: [[TMP22:%.*]] = load i32, ptr [[TMP21]], align 4
1660 // CHECK9-NEXT: call void @__kmpc_for_static_fini(ptr @[[GLOB2]], i32 [[TMP22]])
1661 // CHECK9-NEXT: br label [[OMP_PRECOND_END]]
1662 // CHECK9: omp.precond.end:
1663 // CHECK9-NEXT: ret void
1666 // CHECK9-LABEL: define {{[^@]+}}@.omp_offloading.requires_reg
1667 // CHECK9-SAME: () #[[ATTR6:[0-9]+]] {
1668 // CHECK9-NEXT: entry:
1669 // CHECK9-NEXT: call void @__tgt_register_requires(i64 1)
1670 // CHECK9-NEXT: ret void
1673 // CHECK11-LABEL: define {{[^@]+}}@_Z15teams_local_argv
1674 // CHECK11-SAME: () #[[ATTR0:[0-9]+]] {
1675 // CHECK11-NEXT: entry:
1676 // CHECK11-NEXT: [[N:%.*]] = alloca i32, align 4
1677 // CHECK11-NEXT: [[SAVED_STACK:%.*]] = alloca ptr, align 4
1678 // CHECK11-NEXT: [[__VLA_EXPR0:%.*]] = alloca i32, align 4
1679 // CHECK11-NEXT: [[N_CASTED:%.*]] = alloca i32, align 4
1680 // CHECK11-NEXT: [[DOTOFFLOAD_BASEPTRS:%.*]] = alloca [3 x ptr], align 4
1681 // CHECK11-NEXT: [[DOTOFFLOAD_PTRS:%.*]] = alloca [3 x ptr], align 4
1682 // CHECK11-NEXT: [[DOTOFFLOAD_MAPPERS:%.*]] = alloca [3 x ptr], align 4
1683 // CHECK11-NEXT: [[DOTOFFLOAD_SIZES:%.*]] = alloca [3 x i64], align 4
1684 // CHECK11-NEXT: [[TMP:%.*]] = alloca i32, align 4
1685 // CHECK11-NEXT: [[DOTCAPTURE_EXPR_:%.*]] = alloca i32, align 4
1686 // CHECK11-NEXT: [[DOTCAPTURE_EXPR_1:%.*]] = alloca i32, align 4
1687 // CHECK11-NEXT: [[KERNEL_ARGS:%.*]] = alloca [[STRUCT___TGT_KERNEL_ARGUMENTS:%.*]], align 8
1688 // CHECK11-NEXT: store i32 100, ptr [[N]], align 4
1689 // CHECK11-NEXT: [[TMP0:%.*]] = load i32, ptr [[N]], align 4
1690 // CHECK11-NEXT: [[TMP1:%.*]] = call ptr @llvm.stacksave.p0()
1691 // CHECK11-NEXT: store ptr [[TMP1]], ptr [[SAVED_STACK]], align 4
1692 // CHECK11-NEXT: [[VLA:%.*]] = alloca i32, i32 [[TMP0]], align 4
1693 // CHECK11-NEXT: store i32 [[TMP0]], ptr [[__VLA_EXPR0]], align 4
1694 // CHECK11-NEXT: [[TMP2:%.*]] = load i32, ptr [[N]], align 4
1695 // CHECK11-NEXT: store i32 [[TMP2]], ptr [[N_CASTED]], align 4
1696 // CHECK11-NEXT: [[TMP3:%.*]] = load i32, ptr [[N_CASTED]], align 4
1697 // CHECK11-NEXT: [[TMP4:%.*]] = mul nuw i32 [[TMP0]], 4
1698 // CHECK11-NEXT: [[TMP5:%.*]] = sext i32 [[TMP4]] to i64
1699 // CHECK11-NEXT: call void @llvm.memcpy.p0.p0.i32(ptr align 4 [[DOTOFFLOAD_SIZES]], ptr align 4 @.offload_sizes, i32 24, i1 false)
1700 // CHECK11-NEXT: [[TMP6:%.*]] = getelementptr inbounds [3 x ptr], ptr [[DOTOFFLOAD_BASEPTRS]], i32 0, i32 0
1701 // CHECK11-NEXT: store i32 [[TMP3]], ptr [[TMP6]], align 4
1702 // CHECK11-NEXT: [[TMP7:%.*]] = getelementptr inbounds [3 x ptr], ptr [[DOTOFFLOAD_PTRS]], i32 0, i32 0
1703 // CHECK11-NEXT: store i32 [[TMP3]], ptr [[TMP7]], align 4
1704 // CHECK11-NEXT: [[TMP8:%.*]] = getelementptr inbounds [3 x ptr], ptr [[DOTOFFLOAD_MAPPERS]], i32 0, i32 0
1705 // CHECK11-NEXT: store ptr null, ptr [[TMP8]], align 4
1706 // CHECK11-NEXT: [[TMP9:%.*]] = getelementptr inbounds [3 x ptr], ptr [[DOTOFFLOAD_BASEPTRS]], i32 0, i32 1
1707 // CHECK11-NEXT: store i32 [[TMP0]], ptr [[TMP9]], align 4
1708 // CHECK11-NEXT: [[TMP10:%.*]] = getelementptr inbounds [3 x ptr], ptr [[DOTOFFLOAD_PTRS]], i32 0, i32 1
1709 // CHECK11-NEXT: store i32 [[TMP0]], ptr [[TMP10]], align 4
1710 // CHECK11-NEXT: [[TMP11:%.*]] = getelementptr inbounds [3 x ptr], ptr [[DOTOFFLOAD_MAPPERS]], i32 0, i32 1
1711 // CHECK11-NEXT: store ptr null, ptr [[TMP11]], align 4
1712 // CHECK11-NEXT: [[TMP12:%.*]] = getelementptr inbounds [3 x ptr], ptr [[DOTOFFLOAD_BASEPTRS]], i32 0, i32 2
1713 // CHECK11-NEXT: store ptr [[VLA]], ptr [[TMP12]], align 4
1714 // CHECK11-NEXT: [[TMP13:%.*]] = getelementptr inbounds [3 x ptr], ptr [[DOTOFFLOAD_PTRS]], i32 0, i32 2
1715 // CHECK11-NEXT: store ptr [[VLA]], ptr [[TMP13]], align 4
1716 // CHECK11-NEXT: [[TMP14:%.*]] = getelementptr inbounds [3 x i64], ptr [[DOTOFFLOAD_SIZES]], i32 0, i32 2
1717 // CHECK11-NEXT: store i64 [[TMP5]], ptr [[TMP14]], align 4
1718 // CHECK11-NEXT: [[TMP15:%.*]] = getelementptr inbounds [3 x ptr], ptr [[DOTOFFLOAD_MAPPERS]], i32 0, i32 2
1719 // CHECK11-NEXT: store ptr null, ptr [[TMP15]], align 4
1720 // CHECK11-NEXT: [[TMP16:%.*]] = getelementptr inbounds [3 x ptr], ptr [[DOTOFFLOAD_BASEPTRS]], i32 0, i32 0
1721 // CHECK11-NEXT: [[TMP17:%.*]] = getelementptr inbounds [3 x ptr], ptr [[DOTOFFLOAD_PTRS]], i32 0, i32 0
1722 // CHECK11-NEXT: [[TMP18:%.*]] = getelementptr inbounds [3 x i64], ptr [[DOTOFFLOAD_SIZES]], i32 0, i32 0
1723 // CHECK11-NEXT: [[TMP19:%.*]] = load i32, ptr [[N]], align 4
1724 // CHECK11-NEXT: store i32 [[TMP19]], ptr [[DOTCAPTURE_EXPR_]], align 4
1725 // CHECK11-NEXT: [[TMP20:%.*]] = load i32, ptr [[DOTCAPTURE_EXPR_]], align 4
1726 // CHECK11-NEXT: [[SUB:%.*]] = sub nsw i32 [[TMP20]], 0
1727 // CHECK11-NEXT: [[DIV:%.*]] = sdiv i32 [[SUB]], 1
1728 // CHECK11-NEXT: [[SUB2:%.*]] = sub nsw i32 [[DIV]], 1
1729 // CHECK11-NEXT: store i32 [[SUB2]], ptr [[DOTCAPTURE_EXPR_1]], align 4
1730 // CHECK11-NEXT: [[TMP21:%.*]] = load i32, ptr [[DOTCAPTURE_EXPR_1]], align 4
1731 // CHECK11-NEXT: [[ADD:%.*]] = add nsw i32 [[TMP21]], 1
1732 // CHECK11-NEXT: [[TMP22:%.*]] = zext i32 [[ADD]] to i64
1733 // CHECK11-NEXT: [[TMP23:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 0
1734 // CHECK11-NEXT: store i32 2, ptr [[TMP23]], align 4
1735 // CHECK11-NEXT: [[TMP24:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 1
1736 // CHECK11-NEXT: store i32 3, ptr [[TMP24]], align 4
1737 // CHECK11-NEXT: [[TMP25:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 2
1738 // CHECK11-NEXT: store ptr [[TMP16]], ptr [[TMP25]], align 4
1739 // CHECK11-NEXT: [[TMP26:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 3
1740 // CHECK11-NEXT: store ptr [[TMP17]], ptr [[TMP26]], align 4
1741 // CHECK11-NEXT: [[TMP27:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 4
1742 // CHECK11-NEXT: store ptr [[TMP18]], ptr [[TMP27]], align 4
1743 // CHECK11-NEXT: [[TMP28:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 5
1744 // CHECK11-NEXT: store ptr @.offload_maptypes, ptr [[TMP28]], align 4
1745 // CHECK11-NEXT: [[TMP29:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 6
1746 // CHECK11-NEXT: store ptr null, ptr [[TMP29]], align 4
1747 // CHECK11-NEXT: [[TMP30:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 7
1748 // CHECK11-NEXT: store ptr null, ptr [[TMP30]], align 4
1749 // CHECK11-NEXT: [[TMP31:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 8
1750 // CHECK11-NEXT: store i64 [[TMP22]], ptr [[TMP31]], align 8
1751 // CHECK11-NEXT: [[TMP32:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 9
1752 // CHECK11-NEXT: store i64 0, ptr [[TMP32]], align 8
1753 // CHECK11-NEXT: [[TMP33:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 10
1754 // CHECK11-NEXT: store [3 x i32] zeroinitializer, ptr [[TMP33]], align 4
1755 // CHECK11-NEXT: [[TMP34:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 11
1756 // CHECK11-NEXT: store [3 x i32] zeroinitializer, ptr [[TMP34]], align 4
1757 // CHECK11-NEXT: [[TMP35:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 12
1758 // CHECK11-NEXT: store i32 0, ptr [[TMP35]], align 4
1759 // CHECK11-NEXT: [[TMP36:%.*]] = call i32 @__tgt_target_kernel(ptr @[[GLOB3:[0-9]+]], i64 -1, i32 0, i32 0, ptr @.{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z15teams_local_argv_l72.region_id, ptr [[KERNEL_ARGS]])
1760 // CHECK11-NEXT: [[TMP37:%.*]] = icmp ne i32 [[TMP36]], 0
1761 // CHECK11-NEXT: br i1 [[TMP37]], label [[OMP_OFFLOAD_FAILED:%.*]], label [[OMP_OFFLOAD_CONT:%.*]]
1762 // CHECK11: omp_offload.failed:
1763 // CHECK11-NEXT: call void @{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z15teams_local_argv_l72(i32 [[TMP3]], i32 [[TMP0]], ptr [[VLA]]) #[[ATTR4:[0-9]+]]
1764 // CHECK11-NEXT: br label [[OMP_OFFLOAD_CONT]]
1765 // CHECK11: omp_offload.cont:
1766 // CHECK11-NEXT: [[ARRAYIDX:%.*]] = getelementptr inbounds i32, ptr [[VLA]], i32 0
1767 // CHECK11-NEXT: [[TMP38:%.*]] = load i32, ptr [[ARRAYIDX]], align 4
1768 // CHECK11-NEXT: [[TMP39:%.*]] = load ptr, ptr [[SAVED_STACK]], align 4
1769 // CHECK11-NEXT: call void @llvm.stackrestore.p0(ptr [[TMP39]])
1770 // CHECK11-NEXT: ret i32 [[TMP38]]
1773 // CHECK11-LABEL: define {{[^@]+}}@{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z15teams_local_argv_l72
1774 // CHECK11-SAME: (i32 noundef [[N:%.*]], i32 noundef [[VLA:%.*]], ptr noundef nonnull align 4 dereferenceable(4) [[A:%.*]]) #[[ATTR2:[0-9]+]] {
1775 // CHECK11-NEXT: entry:
1776 // CHECK11-NEXT: [[N_ADDR:%.*]] = alloca i32, align 4
1777 // CHECK11-NEXT: [[VLA_ADDR:%.*]] = alloca i32, align 4
1778 // CHECK11-NEXT: [[A_ADDR:%.*]] = alloca ptr, align 4
1779 // CHECK11-NEXT: store i32 [[N]], ptr [[N_ADDR]], align 4
1780 // CHECK11-NEXT: store i32 [[VLA]], ptr [[VLA_ADDR]], align 4
1781 // CHECK11-NEXT: store ptr [[A]], ptr [[A_ADDR]], align 4
1782 // CHECK11-NEXT: [[TMP0:%.*]] = load i32, ptr [[VLA_ADDR]], align 4
1783 // CHECK11-NEXT: [[TMP1:%.*]] = load ptr, ptr [[A_ADDR]], align 4
1784 // CHECK11-NEXT: call void (ptr, i32, ptr, ...) @__kmpc_fork_teams(ptr @[[GLOB3]], i32 3, ptr @{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z15teams_local_argv_l72.omp_outlined, ptr [[N_ADDR]], i32 [[TMP0]], ptr [[TMP1]])
1785 // CHECK11-NEXT: ret void
1788 // CHECK11-LABEL: define {{[^@]+}}@{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z15teams_local_argv_l72.omp_outlined
1789 // CHECK11-SAME: (ptr noalias noundef [[DOTGLOBAL_TID_:%.*]], ptr noalias noundef [[DOTBOUND_TID_:%.*]], ptr noundef nonnull align 4 dereferenceable(4) [[N:%.*]], i32 noundef [[VLA:%.*]], ptr noundef nonnull align 4 dereferenceable(4) [[A:%.*]]) #[[ATTR3:[0-9]+]] {
1790 // CHECK11-NEXT: entry:
1791 // CHECK11-NEXT: [[DOTGLOBAL_TID__ADDR:%.*]] = alloca ptr, align 4
1792 // CHECK11-NEXT: [[DOTBOUND_TID__ADDR:%.*]] = alloca ptr, align 4
1793 // CHECK11-NEXT: [[N_ADDR:%.*]] = alloca ptr, align 4
1794 // CHECK11-NEXT: [[VLA_ADDR:%.*]] = alloca i32, align 4
1795 // CHECK11-NEXT: [[A_ADDR:%.*]] = alloca ptr, align 4
1796 // CHECK11-NEXT: [[DOTOMP_IV:%.*]] = alloca i32, align 4
1797 // CHECK11-NEXT: [[TMP:%.*]] = alloca i32, align 4
1798 // CHECK11-NEXT: [[DOTCAPTURE_EXPR_:%.*]] = alloca i32, align 4
1799 // CHECK11-NEXT: [[DOTCAPTURE_EXPR_1:%.*]] = alloca i32, align 4
1800 // CHECK11-NEXT: [[I:%.*]] = alloca i32, align 4
1801 // CHECK11-NEXT: [[DOTOMP_COMB_LB:%.*]] = alloca i32, align 4
1802 // CHECK11-NEXT: [[DOTOMP_COMB_UB:%.*]] = alloca i32, align 4
1803 // CHECK11-NEXT: [[DOTOMP_STRIDE:%.*]] = alloca i32, align 4
1804 // CHECK11-NEXT: [[DOTOMP_IS_LAST:%.*]] = alloca i32, align 4
1805 // CHECK11-NEXT: [[I3:%.*]] = alloca i32, align 4
1806 // CHECK11-NEXT: store ptr [[DOTGLOBAL_TID_]], ptr [[DOTGLOBAL_TID__ADDR]], align 4
1807 // CHECK11-NEXT: store ptr [[DOTBOUND_TID_]], ptr [[DOTBOUND_TID__ADDR]], align 4
1808 // CHECK11-NEXT: store ptr [[N]], ptr [[N_ADDR]], align 4
1809 // CHECK11-NEXT: store i32 [[VLA]], ptr [[VLA_ADDR]], align 4
1810 // CHECK11-NEXT: store ptr [[A]], ptr [[A_ADDR]], align 4
1811 // CHECK11-NEXT: [[TMP0:%.*]] = load ptr, ptr [[N_ADDR]], align 4
1812 // CHECK11-NEXT: [[TMP1:%.*]] = load i32, ptr [[VLA_ADDR]], align 4
1813 // CHECK11-NEXT: [[TMP2:%.*]] = load ptr, ptr [[A_ADDR]], align 4
1814 // CHECK11-NEXT: [[TMP3:%.*]] = load i32, ptr [[TMP0]], align 4
1815 // CHECK11-NEXT: store i32 [[TMP3]], ptr [[DOTCAPTURE_EXPR_]], align 4
1816 // CHECK11-NEXT: [[TMP4:%.*]] = load i32, ptr [[DOTCAPTURE_EXPR_]], align 4
1817 // CHECK11-NEXT: [[SUB:%.*]] = sub nsw i32 [[TMP4]], 0
1818 // CHECK11-NEXT: [[DIV:%.*]] = sdiv i32 [[SUB]], 1
1819 // CHECK11-NEXT: [[SUB2:%.*]] = sub nsw i32 [[DIV]], 1
1820 // CHECK11-NEXT: store i32 [[SUB2]], ptr [[DOTCAPTURE_EXPR_1]], align 4
1821 // CHECK11-NEXT: store i32 0, ptr [[I]], align 4
1822 // CHECK11-NEXT: [[TMP5:%.*]] = load i32, ptr [[DOTCAPTURE_EXPR_]], align 4
1823 // CHECK11-NEXT: [[CMP:%.*]] = icmp slt i32 0, [[TMP5]]
1824 // CHECK11-NEXT: br i1 [[CMP]], label [[OMP_PRECOND_THEN:%.*]], label [[OMP_PRECOND_END:%.*]]
1825 // CHECK11: omp.precond.then:
1826 // CHECK11-NEXT: store i32 0, ptr [[DOTOMP_COMB_LB]], align 4
1827 // CHECK11-NEXT: [[TMP6:%.*]] = load i32, ptr [[DOTCAPTURE_EXPR_1]], align 4
1828 // CHECK11-NEXT: store i32 [[TMP6]], ptr [[DOTOMP_COMB_UB]], align 4
1829 // CHECK11-NEXT: store i32 1, ptr [[DOTOMP_STRIDE]], align 4
1830 // CHECK11-NEXT: store i32 0, ptr [[DOTOMP_IS_LAST]], align 4
1831 // CHECK11-NEXT: [[TMP7:%.*]] = load ptr, ptr [[DOTGLOBAL_TID__ADDR]], align 4
1832 // CHECK11-NEXT: [[TMP8:%.*]] = load i32, ptr [[TMP7]], align 4
1833 // CHECK11-NEXT: call void @__kmpc_for_static_init_4(ptr @[[GLOB1:[0-9]+]], i32 [[TMP8]], i32 92, ptr [[DOTOMP_IS_LAST]], ptr [[DOTOMP_COMB_LB]], ptr [[DOTOMP_COMB_UB]], ptr [[DOTOMP_STRIDE]], i32 1, i32 1)
1834 // CHECK11-NEXT: [[TMP9:%.*]] = load i32, ptr [[DOTOMP_COMB_UB]], align 4
1835 // CHECK11-NEXT: [[TMP10:%.*]] = load i32, ptr [[DOTCAPTURE_EXPR_1]], align 4
1836 // CHECK11-NEXT: [[CMP4:%.*]] = icmp sgt i32 [[TMP9]], [[TMP10]]
1837 // CHECK11-NEXT: br i1 [[CMP4]], label [[COND_TRUE:%.*]], label [[COND_FALSE:%.*]]
1838 // CHECK11: cond.true:
1839 // CHECK11-NEXT: [[TMP11:%.*]] = load i32, ptr [[DOTCAPTURE_EXPR_1]], align 4
1840 // CHECK11-NEXT: br label [[COND_END:%.*]]
1841 // CHECK11: cond.false:
1842 // CHECK11-NEXT: [[TMP12:%.*]] = load i32, ptr [[DOTOMP_COMB_UB]], align 4
1843 // CHECK11-NEXT: br label [[COND_END]]
1844 // CHECK11: cond.end:
1845 // CHECK11-NEXT: [[COND:%.*]] = phi i32 [ [[TMP11]], [[COND_TRUE]] ], [ [[TMP12]], [[COND_FALSE]] ]
1846 // CHECK11-NEXT: store i32 [[COND]], ptr [[DOTOMP_COMB_UB]], align 4
1847 // CHECK11-NEXT: [[TMP13:%.*]] = load i32, ptr [[DOTOMP_COMB_LB]], align 4
1848 // CHECK11-NEXT: store i32 [[TMP13]], ptr [[DOTOMP_IV]], align 4
1849 // CHECK11-NEXT: br label [[OMP_INNER_FOR_COND:%.*]]
1850 // CHECK11: omp.inner.for.cond:
1851 // CHECK11-NEXT: [[TMP14:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4
1852 // CHECK11-NEXT: [[TMP15:%.*]] = load i32, ptr [[DOTOMP_COMB_UB]], align 4
1853 // CHECK11-NEXT: [[CMP5:%.*]] = icmp sle i32 [[TMP14]], [[TMP15]]
1854 // CHECK11-NEXT: br i1 [[CMP5]], label [[OMP_INNER_FOR_BODY:%.*]], label [[OMP_INNER_FOR_END:%.*]]
1855 // CHECK11: omp.inner.for.body:
1856 // CHECK11-NEXT: [[TMP16:%.*]] = load i32, ptr [[DOTOMP_COMB_LB]], align 4
1857 // CHECK11-NEXT: [[TMP17:%.*]] = load i32, ptr [[DOTOMP_COMB_UB]], align 4
1858 // CHECK11-NEXT: call void (ptr, i32, ptr, ...) @__kmpc_fork_call(ptr @[[GLOB3]], i32 5, ptr @{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z15teams_local_argv_l72.omp_outlined.omp_outlined, i32 [[TMP16]], i32 [[TMP17]], ptr [[TMP0]], i32 [[TMP1]], ptr [[TMP2]])
1859 // CHECK11-NEXT: br label [[OMP_INNER_FOR_INC:%.*]]
1860 // CHECK11: omp.inner.for.inc:
1861 // CHECK11-NEXT: [[TMP18:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4
1862 // CHECK11-NEXT: [[TMP19:%.*]] = load i32, ptr [[DOTOMP_STRIDE]], align 4
1863 // CHECK11-NEXT: [[ADD:%.*]] = add nsw i32 [[TMP18]], [[TMP19]]
1864 // CHECK11-NEXT: store i32 [[ADD]], ptr [[DOTOMP_IV]], align 4
1865 // CHECK11-NEXT: br label [[OMP_INNER_FOR_COND]]
1866 // CHECK11: omp.inner.for.end:
1867 // CHECK11-NEXT: br label [[OMP_LOOP_EXIT:%.*]]
1868 // CHECK11: omp.loop.exit:
1869 // CHECK11-NEXT: [[TMP20:%.*]] = load ptr, ptr [[DOTGLOBAL_TID__ADDR]], align 4
1870 // CHECK11-NEXT: [[TMP21:%.*]] = load i32, ptr [[TMP20]], align 4
1871 // CHECK11-NEXT: call void @__kmpc_for_static_fini(ptr @[[GLOB2:[0-9]+]], i32 [[TMP21]])
1872 // CHECK11-NEXT: br label [[OMP_PRECOND_END]]
1873 // CHECK11: omp.precond.end:
1874 // CHECK11-NEXT: ret void
1877 // CHECK11-LABEL: define {{[^@]+}}@{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z15teams_local_argv_l72.omp_outlined.omp_outlined
1878 // CHECK11-SAME: (ptr noalias noundef [[DOTGLOBAL_TID_:%.*]], ptr noalias noundef [[DOTBOUND_TID_:%.*]], i32 noundef [[DOTPREVIOUS_LB_:%.*]], i32 noundef [[DOTPREVIOUS_UB_:%.*]], ptr noundef nonnull align 4 dereferenceable(4) [[N:%.*]], i32 noundef [[VLA:%.*]], ptr noundef nonnull align 4 dereferenceable(4) [[A:%.*]]) #[[ATTR3]] {
1879 // CHECK11-NEXT: entry:
1880 // CHECK11-NEXT: [[DOTGLOBAL_TID__ADDR:%.*]] = alloca ptr, align 4
1881 // CHECK11-NEXT: [[DOTBOUND_TID__ADDR:%.*]] = alloca ptr, align 4
1882 // CHECK11-NEXT: [[DOTPREVIOUS_LB__ADDR:%.*]] = alloca i32, align 4
1883 // CHECK11-NEXT: [[DOTPREVIOUS_UB__ADDR:%.*]] = alloca i32, align 4
1884 // CHECK11-NEXT: [[N_ADDR:%.*]] = alloca ptr, align 4
1885 // CHECK11-NEXT: [[VLA_ADDR:%.*]] = alloca i32, align 4
1886 // CHECK11-NEXT: [[A_ADDR:%.*]] = alloca ptr, align 4
1887 // CHECK11-NEXT: [[DOTOMP_IV:%.*]] = alloca i32, align 4
1888 // CHECK11-NEXT: [[TMP:%.*]] = alloca i32, align 4
1889 // CHECK11-NEXT: [[DOTCAPTURE_EXPR_:%.*]] = alloca i32, align 4
1890 // CHECK11-NEXT: [[DOTCAPTURE_EXPR_1:%.*]] = alloca i32, align 4
1891 // CHECK11-NEXT: [[I:%.*]] = alloca i32, align 4
1892 // CHECK11-NEXT: [[DOTOMP_LB:%.*]] = alloca i32, align 4
1893 // CHECK11-NEXT: [[DOTOMP_UB:%.*]] = alloca i32, align 4
1894 // CHECK11-NEXT: [[DOTOMP_STRIDE:%.*]] = alloca i32, align 4
1895 // CHECK11-NEXT: [[DOTOMP_IS_LAST:%.*]] = alloca i32, align 4
1896 // CHECK11-NEXT: [[I3:%.*]] = alloca i32, align 4
1897 // CHECK11-NEXT: store ptr [[DOTGLOBAL_TID_]], ptr [[DOTGLOBAL_TID__ADDR]], align 4
1898 // CHECK11-NEXT: store ptr [[DOTBOUND_TID_]], ptr [[DOTBOUND_TID__ADDR]], align 4
1899 // CHECK11-NEXT: store i32 [[DOTPREVIOUS_LB_]], ptr [[DOTPREVIOUS_LB__ADDR]], align 4
1900 // CHECK11-NEXT: store i32 [[DOTPREVIOUS_UB_]], ptr [[DOTPREVIOUS_UB__ADDR]], align 4
1901 // CHECK11-NEXT: store ptr [[N]], ptr [[N_ADDR]], align 4
1902 // CHECK11-NEXT: store i32 [[VLA]], ptr [[VLA_ADDR]], align 4
1903 // CHECK11-NEXT: store ptr [[A]], ptr [[A_ADDR]], align 4
1904 // CHECK11-NEXT: [[TMP0:%.*]] = load ptr, ptr [[N_ADDR]], align 4
1905 // CHECK11-NEXT: [[TMP1:%.*]] = load i32, ptr [[VLA_ADDR]], align 4
1906 // CHECK11-NEXT: [[TMP2:%.*]] = load ptr, ptr [[A_ADDR]], align 4
1907 // CHECK11-NEXT: [[TMP3:%.*]] = load i32, ptr [[TMP0]], align 4
1908 // CHECK11-NEXT: store i32 [[TMP3]], ptr [[DOTCAPTURE_EXPR_]], align 4
1909 // CHECK11-NEXT: [[TMP4:%.*]] = load i32, ptr [[DOTCAPTURE_EXPR_]], align 4
1910 // CHECK11-NEXT: [[SUB:%.*]] = sub nsw i32 [[TMP4]], 0
1911 // CHECK11-NEXT: [[DIV:%.*]] = sdiv i32 [[SUB]], 1
1912 // CHECK11-NEXT: [[SUB2:%.*]] = sub nsw i32 [[DIV]], 1
1913 // CHECK11-NEXT: store i32 [[SUB2]], ptr [[DOTCAPTURE_EXPR_1]], align 4
1914 // CHECK11-NEXT: store i32 0, ptr [[I]], align 4
1915 // CHECK11-NEXT: [[TMP5:%.*]] = load i32, ptr [[DOTCAPTURE_EXPR_]], align 4
1916 // CHECK11-NEXT: [[CMP:%.*]] = icmp slt i32 0, [[TMP5]]
1917 // CHECK11-NEXT: br i1 [[CMP]], label [[OMP_PRECOND_THEN:%.*]], label [[OMP_PRECOND_END:%.*]]
1918 // CHECK11: omp.precond.then:
1919 // CHECK11-NEXT: store i32 0, ptr [[DOTOMP_LB]], align 4
1920 // CHECK11-NEXT: [[TMP6:%.*]] = load i32, ptr [[DOTCAPTURE_EXPR_1]], align 4
1921 // CHECK11-NEXT: store i32 [[TMP6]], ptr [[DOTOMP_UB]], align 4
1922 // CHECK11-NEXT: [[TMP7:%.*]] = load i32, ptr [[DOTPREVIOUS_LB__ADDR]], align 4
1923 // CHECK11-NEXT: [[TMP8:%.*]] = load i32, ptr [[DOTPREVIOUS_UB__ADDR]], align 4
1924 // CHECK11-NEXT: store i32 [[TMP7]], ptr [[DOTOMP_LB]], align 4
1925 // CHECK11-NEXT: store i32 [[TMP8]], ptr [[DOTOMP_UB]], align 4
1926 // CHECK11-NEXT: store i32 1, ptr [[DOTOMP_STRIDE]], align 4
1927 // CHECK11-NEXT: store i32 0, ptr [[DOTOMP_IS_LAST]], align 4
1928 // CHECK11-NEXT: [[TMP9:%.*]] = load ptr, ptr [[DOTGLOBAL_TID__ADDR]], align 4
1929 // CHECK11-NEXT: [[TMP10:%.*]] = load i32, ptr [[TMP9]], align 4
1930 // CHECK11-NEXT: call void @__kmpc_for_static_init_4(ptr @[[GLOB2]], i32 [[TMP10]], i32 34, ptr [[DOTOMP_IS_LAST]], ptr [[DOTOMP_LB]], ptr [[DOTOMP_UB]], ptr [[DOTOMP_STRIDE]], i32 1, i32 1)
1931 // CHECK11-NEXT: [[TMP11:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4
1932 // CHECK11-NEXT: [[TMP12:%.*]] = load i32, ptr [[DOTCAPTURE_EXPR_1]], align 4
1933 // CHECK11-NEXT: [[CMP4:%.*]] = icmp sgt i32 [[TMP11]], [[TMP12]]
1934 // CHECK11-NEXT: br i1 [[CMP4]], label [[COND_TRUE:%.*]], label [[COND_FALSE:%.*]]
1935 // CHECK11: cond.true:
1936 // CHECK11-NEXT: [[TMP13:%.*]] = load i32, ptr [[DOTCAPTURE_EXPR_1]], align 4
1937 // CHECK11-NEXT: br label [[COND_END:%.*]]
1938 // CHECK11: cond.false:
1939 // CHECK11-NEXT: [[TMP14:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4
1940 // CHECK11-NEXT: br label [[COND_END]]
1941 // CHECK11: cond.end:
1942 // CHECK11-NEXT: [[COND:%.*]] = phi i32 [ [[TMP13]], [[COND_TRUE]] ], [ [[TMP14]], [[COND_FALSE]] ]
1943 // CHECK11-NEXT: store i32 [[COND]], ptr [[DOTOMP_UB]], align 4
1944 // CHECK11-NEXT: [[TMP15:%.*]] = load i32, ptr [[DOTOMP_LB]], align 4
1945 // CHECK11-NEXT: store i32 [[TMP15]], ptr [[DOTOMP_IV]], align 4
1946 // CHECK11-NEXT: br label [[OMP_INNER_FOR_COND:%.*]]
1947 // CHECK11: omp.inner.for.cond:
1948 // CHECK11-NEXT: [[TMP16:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4
1949 // CHECK11-NEXT: [[TMP17:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4
1950 // CHECK11-NEXT: [[CMP5:%.*]] = icmp sle i32 [[TMP16]], [[TMP17]]
1951 // CHECK11-NEXT: br i1 [[CMP5]], label [[OMP_INNER_FOR_BODY:%.*]], label [[OMP_INNER_FOR_END:%.*]]
1952 // CHECK11: omp.inner.for.body:
1953 // CHECK11-NEXT: [[TMP18:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4
1954 // CHECK11-NEXT: [[MUL:%.*]] = mul nsw i32 [[TMP18]], 1
1955 // CHECK11-NEXT: [[ADD:%.*]] = add nsw i32 0, [[MUL]]
1956 // CHECK11-NEXT: store i32 [[ADD]], ptr [[I3]], align 4
1957 // CHECK11-NEXT: [[TMP19:%.*]] = load i32, ptr [[I3]], align 4
1958 // CHECK11-NEXT: [[ARRAYIDX:%.*]] = getelementptr inbounds i32, ptr [[TMP2]], i32 [[TMP19]]
1959 // CHECK11-NEXT: store i32 0, ptr [[ARRAYIDX]], align 4
1960 // CHECK11-NEXT: br label [[OMP_BODY_CONTINUE:%.*]]
1961 // CHECK11: omp.body.continue:
1962 // CHECK11-NEXT: br label [[OMP_INNER_FOR_INC:%.*]]
1963 // CHECK11: omp.inner.for.inc:
1964 // CHECK11-NEXT: [[TMP20:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4
1965 // CHECK11-NEXT: [[ADD6:%.*]] = add nsw i32 [[TMP20]], 1
1966 // CHECK11-NEXT: store i32 [[ADD6]], ptr [[DOTOMP_IV]], align 4
1967 // CHECK11-NEXT: br label [[OMP_INNER_FOR_COND]]
1968 // CHECK11: omp.inner.for.end:
1969 // CHECK11-NEXT: br label [[OMP_LOOP_EXIT:%.*]]
1970 // CHECK11: omp.loop.exit:
1971 // CHECK11-NEXT: [[TMP21:%.*]] = load ptr, ptr [[DOTGLOBAL_TID__ADDR]], align 4
1972 // CHECK11-NEXT: [[TMP22:%.*]] = load i32, ptr [[TMP21]], align 4
1973 // CHECK11-NEXT: call void @__kmpc_for_static_fini(ptr @[[GLOB2]], i32 [[TMP22]])
1974 // CHECK11-NEXT: br label [[OMP_PRECOND_END]]
1975 // CHECK11: omp.precond.end:
1976 // CHECK11-NEXT: ret void
1979 // CHECK11-LABEL: define {{[^@]+}}@.omp_offloading.requires_reg
1980 // CHECK11-SAME: () #[[ATTR6:[0-9]+]] {
1981 // CHECK11-NEXT: entry:
1982 // CHECK11-NEXT: call void @__tgt_register_requires(i64 1)
1983 // CHECK11-NEXT: ret void
1986 // CHECK17-LABEL: define {{[^@]+}}@_Z21teams_template_structv
1987 // CHECK17-SAME: () #[[ATTR0:[0-9]+]] {
1988 // CHECK17-NEXT: entry:
1989 // CHECK17-NEXT: [[V:%.*]] = alloca [[STRUCT_SS:%.*]], align 4
1990 // CHECK17-NEXT: [[CALL:%.*]] = call noundef signext i32 @_ZN2SSIiLi123ELx456EE3fooEv(ptr noundef nonnull align 4 dereferenceable(496) [[V]])
1991 // CHECK17-NEXT: ret i32 [[CALL]]
1994 // CHECK17-LABEL: define {{[^@]+}}@_ZN2SSIiLi123ELx456EE3fooEv
1995 // CHECK17-SAME: (ptr noundef nonnull align 4 dereferenceable(496) [[THIS:%.*]]) #[[ATTR0]] comdat {
1996 // CHECK17-NEXT: entry:
1997 // CHECK17-NEXT: [[THIS_ADDR:%.*]] = alloca ptr, align 8
1998 // CHECK17-NEXT: [[DOTOFFLOAD_BASEPTRS:%.*]] = alloca [1 x ptr], align 8
1999 // CHECK17-NEXT: [[DOTOFFLOAD_PTRS:%.*]] = alloca [1 x ptr], align 8
2000 // CHECK17-NEXT: [[DOTOFFLOAD_MAPPERS:%.*]] = alloca [1 x ptr], align 8
2001 // CHECK17-NEXT: [[TMP:%.*]] = alloca i32, align 4
2002 // CHECK17-NEXT: [[KERNEL_ARGS:%.*]] = alloca [[STRUCT___TGT_KERNEL_ARGUMENTS:%.*]], align 8
2003 // CHECK17-NEXT: store ptr [[THIS]], ptr [[THIS_ADDR]], align 8
2004 // CHECK17-NEXT: [[THIS1:%.*]] = load ptr, ptr [[THIS_ADDR]], align 8
2005 // CHECK17-NEXT: [[A:%.*]] = getelementptr inbounds [[STRUCT_SS:%.*]], ptr [[THIS1]], i32 0, i32 0
2006 // CHECK17-NEXT: [[TMP0:%.*]] = getelementptr inbounds [1 x ptr], ptr [[DOTOFFLOAD_BASEPTRS]], i32 0, i32 0
2007 // CHECK17-NEXT: store ptr [[THIS1]], ptr [[TMP0]], align 8
2008 // CHECK17-NEXT: [[TMP1:%.*]] = getelementptr inbounds [1 x ptr], ptr [[DOTOFFLOAD_PTRS]], i32 0, i32 0
2009 // CHECK17-NEXT: store ptr [[A]], ptr [[TMP1]], align 8
2010 // CHECK17-NEXT: [[TMP2:%.*]] = getelementptr inbounds [1 x ptr], ptr [[DOTOFFLOAD_MAPPERS]], i64 0, i64 0
2011 // CHECK17-NEXT: store ptr null, ptr [[TMP2]], align 8
2012 // CHECK17-NEXT: [[TMP3:%.*]] = getelementptr inbounds [1 x ptr], ptr [[DOTOFFLOAD_BASEPTRS]], i32 0, i32 0
2013 // CHECK17-NEXT: [[TMP4:%.*]] = getelementptr inbounds [1 x ptr], ptr [[DOTOFFLOAD_PTRS]], i32 0, i32 0
2014 // CHECK17-NEXT: [[TMP5:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 0
2015 // CHECK17-NEXT: store i32 2, ptr [[TMP5]], align 4
2016 // CHECK17-NEXT: [[TMP6:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 1
2017 // CHECK17-NEXT: store i32 1, ptr [[TMP6]], align 4
2018 // CHECK17-NEXT: [[TMP7:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 2
2019 // CHECK17-NEXT: store ptr [[TMP3]], ptr [[TMP7]], align 8
2020 // CHECK17-NEXT: [[TMP8:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 3
2021 // CHECK17-NEXT: store ptr [[TMP4]], ptr [[TMP8]], align 8
2022 // CHECK17-NEXT: [[TMP9:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 4
2023 // CHECK17-NEXT: store ptr @.offload_sizes, ptr [[TMP9]], align 8
2024 // CHECK17-NEXT: [[TMP10:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 5
2025 // CHECK17-NEXT: store ptr @.offload_maptypes, ptr [[TMP10]], align 8
2026 // CHECK17-NEXT: [[TMP11:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 6
2027 // CHECK17-NEXT: store ptr null, ptr [[TMP11]], align 8
2028 // CHECK17-NEXT: [[TMP12:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 7
2029 // CHECK17-NEXT: store ptr null, ptr [[TMP12]], align 8
2030 // CHECK17-NEXT: [[TMP13:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 8
2031 // CHECK17-NEXT: store i64 123, ptr [[TMP13]], align 8
2032 // CHECK17-NEXT: [[TMP14:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 9
2033 // CHECK17-NEXT: store i64 0, ptr [[TMP14]], align 8
2034 // CHECK17-NEXT: [[TMP15:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 10
2035 // CHECK17-NEXT: store [3 x i32] zeroinitializer, ptr [[TMP15]], align 4
2036 // CHECK17-NEXT: [[TMP16:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 11
2037 // CHECK17-NEXT: store [3 x i32] zeroinitializer, ptr [[TMP16]], align 4
2038 // CHECK17-NEXT: [[TMP17:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 12
2039 // CHECK17-NEXT: store i32 0, ptr [[TMP17]], align 4
2040 // CHECK17-NEXT: [[TMP18:%.*]] = call i32 @__tgt_target_kernel(ptr @[[GLOB3:[0-9]+]], i64 -1, i32 0, i32 0, ptr @.{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__ZN2SSIiLi123ELx456EE3fooEv_l108.region_id, ptr [[KERNEL_ARGS]])
2041 // CHECK17-NEXT: [[TMP19:%.*]] = icmp ne i32 [[TMP18]], 0
2042 // CHECK17-NEXT: br i1 [[TMP19]], label [[OMP_OFFLOAD_FAILED:%.*]], label [[OMP_OFFLOAD_CONT:%.*]]
2043 // CHECK17: omp_offload.failed:
2044 // CHECK17-NEXT: call void @{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__ZN2SSIiLi123ELx456EE3fooEv_l108(ptr [[THIS1]]) #[[ATTR3:[0-9]+]]
2045 // CHECK17-NEXT: br label [[OMP_OFFLOAD_CONT]]
2046 // CHECK17: omp_offload.cont:
2047 // CHECK17-NEXT: [[A2:%.*]] = getelementptr inbounds [[STRUCT_SS]], ptr [[THIS1]], i32 0, i32 0
2048 // CHECK17-NEXT: [[ARRAYIDX:%.*]] = getelementptr inbounds [123 x i32], ptr [[A2]], i64 0, i64 0
2049 // CHECK17-NEXT: [[TMP20:%.*]] = load i32, ptr [[ARRAYIDX]], align 4
2050 // CHECK17-NEXT: ret i32 [[TMP20]]
2053 // CHECK17-LABEL: define {{[^@]+}}@{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__ZN2SSIiLi123ELx456EE3fooEv_l108
2054 // CHECK17-SAME: (ptr noundef [[THIS:%.*]]) #[[ATTR1:[0-9]+]] {
2055 // CHECK17-NEXT: entry:
2056 // CHECK17-NEXT: [[THIS_ADDR:%.*]] = alloca ptr, align 8
2057 // CHECK17-NEXT: store ptr [[THIS]], ptr [[THIS_ADDR]], align 8
2058 // CHECK17-NEXT: [[TMP0:%.*]] = load ptr, ptr [[THIS_ADDR]], align 8
2059 // CHECK17-NEXT: call void (ptr, i32, ptr, ...) @__kmpc_fork_teams(ptr @[[GLOB3]], i32 1, ptr @{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__ZN2SSIiLi123ELx456EE3fooEv_l108.omp_outlined, ptr [[TMP0]])
2060 // CHECK17-NEXT: ret void
2063 // CHECK17-LABEL: define {{[^@]+}}@{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__ZN2SSIiLi123ELx456EE3fooEv_l108.omp_outlined
2064 // CHECK17-SAME: (ptr noalias noundef [[DOTGLOBAL_TID_:%.*]], ptr noalias noundef [[DOTBOUND_TID_:%.*]], ptr noundef [[THIS:%.*]]) #[[ATTR2:[0-9]+]] {
2065 // CHECK17-NEXT: entry:
2066 // CHECK17-NEXT: [[DOTGLOBAL_TID__ADDR:%.*]] = alloca ptr, align 8
2067 // CHECK17-NEXT: [[DOTBOUND_TID__ADDR:%.*]] = alloca ptr, align 8
2068 // CHECK17-NEXT: [[THIS_ADDR:%.*]] = alloca ptr, align 8
2069 // CHECK17-NEXT: [[DOTOMP_IV:%.*]] = alloca i32, align 4
2070 // CHECK17-NEXT: [[TMP:%.*]] = alloca i32, align 4
2071 // CHECK17-NEXT: [[DOTOMP_COMB_LB:%.*]] = alloca i32, align 4
2072 // CHECK17-NEXT: [[DOTOMP_COMB_UB:%.*]] = alloca i32, align 4
2073 // CHECK17-NEXT: [[DOTOMP_STRIDE:%.*]] = alloca i32, align 4
2074 // CHECK17-NEXT: [[DOTOMP_IS_LAST:%.*]] = alloca i32, align 4
2075 // CHECK17-NEXT: [[I:%.*]] = alloca i32, align 4
2076 // CHECK17-NEXT: store ptr [[DOTGLOBAL_TID_]], ptr [[DOTGLOBAL_TID__ADDR]], align 8
2077 // CHECK17-NEXT: store ptr [[DOTBOUND_TID_]], ptr [[DOTBOUND_TID__ADDR]], align 8
2078 // CHECK17-NEXT: store ptr [[THIS]], ptr [[THIS_ADDR]], align 8
2079 // CHECK17-NEXT: [[TMP0:%.*]] = load ptr, ptr [[THIS_ADDR]], align 8
2080 // CHECK17-NEXT: store i32 0, ptr [[DOTOMP_COMB_LB]], align 4
2081 // CHECK17-NEXT: store i32 122, ptr [[DOTOMP_COMB_UB]], align 4
2082 // CHECK17-NEXT: store i32 1, ptr [[DOTOMP_STRIDE]], align 4
2083 // CHECK17-NEXT: store i32 0, ptr [[DOTOMP_IS_LAST]], align 4
2084 // CHECK17-NEXT: [[TMP1:%.*]] = load ptr, ptr [[DOTGLOBAL_TID__ADDR]], align 8
2085 // CHECK17-NEXT: [[TMP2:%.*]] = load i32, ptr [[TMP1]], align 4
2086 // CHECK17-NEXT: call void @__kmpc_for_static_init_4(ptr @[[GLOB1:[0-9]+]], i32 [[TMP2]], i32 92, ptr [[DOTOMP_IS_LAST]], ptr [[DOTOMP_COMB_LB]], ptr [[DOTOMP_COMB_UB]], ptr [[DOTOMP_STRIDE]], i32 1, i32 1)
2087 // CHECK17-NEXT: [[TMP3:%.*]] = load i32, ptr [[DOTOMP_COMB_UB]], align 4
2088 // CHECK17-NEXT: [[CMP:%.*]] = icmp sgt i32 [[TMP3]], 122
2089 // CHECK17-NEXT: br i1 [[CMP]], label [[COND_TRUE:%.*]], label [[COND_FALSE:%.*]]
2090 // CHECK17: cond.true:
2091 // CHECK17-NEXT: br label [[COND_END:%.*]]
2092 // CHECK17: cond.false:
2093 // CHECK17-NEXT: [[TMP4:%.*]] = load i32, ptr [[DOTOMP_COMB_UB]], align 4
2094 // CHECK17-NEXT: br label [[COND_END]]
2095 // CHECK17: cond.end:
2096 // CHECK17-NEXT: [[COND:%.*]] = phi i32 [ 122, [[COND_TRUE]] ], [ [[TMP4]], [[COND_FALSE]] ]
2097 // CHECK17-NEXT: store i32 [[COND]], ptr [[DOTOMP_COMB_UB]], align 4
2098 // CHECK17-NEXT: [[TMP5:%.*]] = load i32, ptr [[DOTOMP_COMB_LB]], align 4
2099 // CHECK17-NEXT: store i32 [[TMP5]], ptr [[DOTOMP_IV]], align 4
2100 // CHECK17-NEXT: br label [[OMP_INNER_FOR_COND:%.*]]
2101 // CHECK17: omp.inner.for.cond:
2102 // CHECK17-NEXT: [[TMP6:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4
2103 // CHECK17-NEXT: [[TMP7:%.*]] = load i32, ptr [[DOTOMP_COMB_UB]], align 4
2104 // CHECK17-NEXT: [[CMP1:%.*]] = icmp sle i32 [[TMP6]], [[TMP7]]
2105 // CHECK17-NEXT: br i1 [[CMP1]], label [[OMP_INNER_FOR_BODY:%.*]], label [[OMP_INNER_FOR_END:%.*]]
2106 // CHECK17: omp.inner.for.body:
2107 // CHECK17-NEXT: [[TMP8:%.*]] = load i32, ptr [[DOTOMP_COMB_LB]], align 4
2108 // CHECK17-NEXT: [[TMP9:%.*]] = zext i32 [[TMP8]] to i64
2109 // CHECK17-NEXT: [[TMP10:%.*]] = load i32, ptr [[DOTOMP_COMB_UB]], align 4
2110 // CHECK17-NEXT: [[TMP11:%.*]] = zext i32 [[TMP10]] to i64
2111 // CHECK17-NEXT: call void (ptr, i32, ptr, ...) @__kmpc_fork_call(ptr @[[GLOB3]], i32 3, ptr @{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__ZN2SSIiLi123ELx456EE3fooEv_l108.omp_outlined.omp_outlined, i64 [[TMP9]], i64 [[TMP11]], ptr [[TMP0]])
2112 // CHECK17-NEXT: br label [[OMP_INNER_FOR_INC:%.*]]
2113 // CHECK17: omp.inner.for.inc:
2114 // CHECK17-NEXT: [[TMP12:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4
2115 // CHECK17-NEXT: [[TMP13:%.*]] = load i32, ptr [[DOTOMP_STRIDE]], align 4
2116 // CHECK17-NEXT: [[ADD:%.*]] = add nsw i32 [[TMP12]], [[TMP13]]
2117 // CHECK17-NEXT: store i32 [[ADD]], ptr [[DOTOMP_IV]], align 4
2118 // CHECK17-NEXT: br label [[OMP_INNER_FOR_COND]]
2119 // CHECK17: omp.inner.for.end:
2120 // CHECK17-NEXT: br label [[OMP_LOOP_EXIT:%.*]]
2121 // CHECK17: omp.loop.exit:
2122 // CHECK17-NEXT: call void @__kmpc_for_static_fini(ptr @[[GLOB2:[0-9]+]], i32 [[TMP2]])
2123 // CHECK17-NEXT: ret void
2126 // CHECK17-LABEL: define {{[^@]+}}@{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__ZN2SSIiLi123ELx456EE3fooEv_l108.omp_outlined.omp_outlined
2127 // CHECK17-SAME: (ptr noalias noundef [[DOTGLOBAL_TID_:%.*]], ptr noalias noundef [[DOTBOUND_TID_:%.*]], i64 noundef [[DOTPREVIOUS_LB_:%.*]], i64 noundef [[DOTPREVIOUS_UB_:%.*]], ptr noundef [[THIS:%.*]]) #[[ATTR2]] {
2128 // CHECK17-NEXT: entry:
2129 // CHECK17-NEXT: [[DOTGLOBAL_TID__ADDR:%.*]] = alloca ptr, align 8
2130 // CHECK17-NEXT: [[DOTBOUND_TID__ADDR:%.*]] = alloca ptr, align 8
2131 // CHECK17-NEXT: [[DOTPREVIOUS_LB__ADDR:%.*]] = alloca i64, align 8
2132 // CHECK17-NEXT: [[DOTPREVIOUS_UB__ADDR:%.*]] = alloca i64, align 8
2133 // CHECK17-NEXT: [[THIS_ADDR:%.*]] = alloca ptr, align 8
2134 // CHECK17-NEXT: [[DOTOMP_IV:%.*]] = alloca i32, align 4
2135 // CHECK17-NEXT: [[TMP:%.*]] = alloca i32, align 4
2136 // CHECK17-NEXT: [[DOTOMP_LB:%.*]] = alloca i32, align 4
2137 // CHECK17-NEXT: [[DOTOMP_UB:%.*]] = alloca i32, align 4
2138 // CHECK17-NEXT: [[DOTOMP_STRIDE:%.*]] = alloca i32, align 4
2139 // CHECK17-NEXT: [[DOTOMP_IS_LAST:%.*]] = alloca i32, align 4
2140 // CHECK17-NEXT: [[I:%.*]] = alloca i32, align 4
2141 // CHECK17-NEXT: store ptr [[DOTGLOBAL_TID_]], ptr [[DOTGLOBAL_TID__ADDR]], align 8
2142 // CHECK17-NEXT: store ptr [[DOTBOUND_TID_]], ptr [[DOTBOUND_TID__ADDR]], align 8
2143 // CHECK17-NEXT: store i64 [[DOTPREVIOUS_LB_]], ptr [[DOTPREVIOUS_LB__ADDR]], align 8
2144 // CHECK17-NEXT: store i64 [[DOTPREVIOUS_UB_]], ptr [[DOTPREVIOUS_UB__ADDR]], align 8
2145 // CHECK17-NEXT: store ptr [[THIS]], ptr [[THIS_ADDR]], align 8
2146 // CHECK17-NEXT: [[TMP0:%.*]] = load ptr, ptr [[THIS_ADDR]], align 8
2147 // CHECK17-NEXT: store i32 0, ptr [[DOTOMP_LB]], align 4
2148 // CHECK17-NEXT: store i32 122, ptr [[DOTOMP_UB]], align 4
2149 // CHECK17-NEXT: [[TMP1:%.*]] = load i64, ptr [[DOTPREVIOUS_LB__ADDR]], align 8
2150 // CHECK17-NEXT: [[CONV:%.*]] = trunc i64 [[TMP1]] to i32
2151 // CHECK17-NEXT: [[TMP2:%.*]] = load i64, ptr [[DOTPREVIOUS_UB__ADDR]], align 8
2152 // CHECK17-NEXT: [[CONV1:%.*]] = trunc i64 [[TMP2]] to i32
2153 // CHECK17-NEXT: store i32 [[CONV]], ptr [[DOTOMP_LB]], align 4
2154 // CHECK17-NEXT: store i32 [[CONV1]], ptr [[DOTOMP_UB]], align 4
2155 // CHECK17-NEXT: store i32 1, ptr [[DOTOMP_STRIDE]], align 4
2156 // CHECK17-NEXT: store i32 0, ptr [[DOTOMP_IS_LAST]], align 4
2157 // CHECK17-NEXT: [[TMP3:%.*]] = load ptr, ptr [[DOTGLOBAL_TID__ADDR]], align 8
2158 // CHECK17-NEXT: [[TMP4:%.*]] = load i32, ptr [[TMP3]], align 4
2159 // CHECK17-NEXT: call void @__kmpc_for_static_init_4(ptr @[[GLOB2]], i32 [[TMP4]], i32 34, ptr [[DOTOMP_IS_LAST]], ptr [[DOTOMP_LB]], ptr [[DOTOMP_UB]], ptr [[DOTOMP_STRIDE]], i32 1, i32 1)
2160 // CHECK17-NEXT: [[TMP5:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4
2161 // CHECK17-NEXT: [[CMP:%.*]] = icmp sgt i32 [[TMP5]], 122
2162 // CHECK17-NEXT: br i1 [[CMP]], label [[COND_TRUE:%.*]], label [[COND_FALSE:%.*]]
2163 // CHECK17: cond.true:
2164 // CHECK17-NEXT: br label [[COND_END:%.*]]
2165 // CHECK17: cond.false:
2166 // CHECK17-NEXT: [[TMP6:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4
2167 // CHECK17-NEXT: br label [[COND_END]]
2168 // CHECK17: cond.end:
2169 // CHECK17-NEXT: [[COND:%.*]] = phi i32 [ 122, [[COND_TRUE]] ], [ [[TMP6]], [[COND_FALSE]] ]
2170 // CHECK17-NEXT: store i32 [[COND]], ptr [[DOTOMP_UB]], align 4
2171 // CHECK17-NEXT: [[TMP7:%.*]] = load i32, ptr [[DOTOMP_LB]], align 4
2172 // CHECK17-NEXT: store i32 [[TMP7]], ptr [[DOTOMP_IV]], align 4
2173 // CHECK17-NEXT: br label [[OMP_INNER_FOR_COND:%.*]]
2174 // CHECK17: omp.inner.for.cond:
2175 // CHECK17-NEXT: [[TMP8:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4
2176 // CHECK17-NEXT: [[TMP9:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4
2177 // CHECK17-NEXT: [[CMP2:%.*]] = icmp sle i32 [[TMP8]], [[TMP9]]
2178 // CHECK17-NEXT: br i1 [[CMP2]], label [[OMP_INNER_FOR_BODY:%.*]], label [[OMP_INNER_FOR_END:%.*]]
2179 // CHECK17: omp.inner.for.body:
2180 // CHECK17-NEXT: [[TMP10:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4
2181 // CHECK17-NEXT: [[MUL:%.*]] = mul nsw i32 [[TMP10]], 1
2182 // CHECK17-NEXT: [[ADD:%.*]] = add nsw i32 0, [[MUL]]
2183 // CHECK17-NEXT: store i32 [[ADD]], ptr [[I]], align 4
2184 // CHECK17-NEXT: [[A:%.*]] = getelementptr inbounds [[STRUCT_SS:%.*]], ptr [[TMP0]], i32 0, i32 0
2185 // CHECK17-NEXT: [[TMP11:%.*]] = load i32, ptr [[I]], align 4
2186 // CHECK17-NEXT: [[IDXPROM:%.*]] = sext i32 [[TMP11]] to i64
2187 // CHECK17-NEXT: [[ARRAYIDX:%.*]] = getelementptr inbounds [123 x i32], ptr [[A]], i64 0, i64 [[IDXPROM]]
2188 // CHECK17-NEXT: store i32 0, ptr [[ARRAYIDX]], align 4
2189 // CHECK17-NEXT: br label [[OMP_BODY_CONTINUE:%.*]]
2190 // CHECK17: omp.body.continue:
2191 // CHECK17-NEXT: br label [[OMP_INNER_FOR_INC:%.*]]
2192 // CHECK17: omp.inner.for.inc:
2193 // CHECK17-NEXT: [[TMP12:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4
2194 // CHECK17-NEXT: [[ADD3:%.*]] = add nsw i32 [[TMP12]], 1
2195 // CHECK17-NEXT: store i32 [[ADD3]], ptr [[DOTOMP_IV]], align 4
2196 // CHECK17-NEXT: br label [[OMP_INNER_FOR_COND]]
2197 // CHECK17: omp.inner.for.end:
2198 // CHECK17-NEXT: br label [[OMP_LOOP_EXIT:%.*]]
2199 // CHECK17: omp.loop.exit:
2200 // CHECK17-NEXT: call void @__kmpc_for_static_fini(ptr @[[GLOB2]], i32 [[TMP4]])
2201 // CHECK17-NEXT: ret void
2204 // CHECK17-LABEL: define {{[^@]+}}@.omp_offloading.requires_reg
2205 // CHECK17-SAME: () #[[ATTR4:[0-9]+]] {
2206 // CHECK17-NEXT: entry:
2207 // CHECK17-NEXT: call void @__tgt_register_requires(i64 1)
2208 // CHECK17-NEXT: ret void
2211 // CHECK19-LABEL: define {{[^@]+}}@_Z21teams_template_structv
2212 // CHECK19-SAME: () #[[ATTR0:[0-9]+]] {
2213 // CHECK19-NEXT: entry:
2214 // CHECK19-NEXT: [[V:%.*]] = alloca [[STRUCT_SS:%.*]], align 4
2215 // CHECK19-NEXT: [[CALL:%.*]] = call noundef i32 @_ZN2SSIiLi123ELx456EE3fooEv(ptr noundef nonnull align 4 dereferenceable(496) [[V]])
2216 // CHECK19-NEXT: ret i32 [[CALL]]
2219 // CHECK19-LABEL: define {{[^@]+}}@_ZN2SSIiLi123ELx456EE3fooEv
2220 // CHECK19-SAME: (ptr noundef nonnull align 4 dereferenceable(496) [[THIS:%.*]]) #[[ATTR0]] comdat align 2 {
2221 // CHECK19-NEXT: entry:
2222 // CHECK19-NEXT: [[THIS_ADDR:%.*]] = alloca ptr, align 4
2223 // CHECK19-NEXT: [[DOTOFFLOAD_BASEPTRS:%.*]] = alloca [1 x ptr], align 4
2224 // CHECK19-NEXT: [[DOTOFFLOAD_PTRS:%.*]] = alloca [1 x ptr], align 4
2225 // CHECK19-NEXT: [[DOTOFFLOAD_MAPPERS:%.*]] = alloca [1 x ptr], align 4
2226 // CHECK19-NEXT: [[TMP:%.*]] = alloca i32, align 4
2227 // CHECK19-NEXT: [[KERNEL_ARGS:%.*]] = alloca [[STRUCT___TGT_KERNEL_ARGUMENTS:%.*]], align 8
2228 // CHECK19-NEXT: store ptr [[THIS]], ptr [[THIS_ADDR]], align 4
2229 // CHECK19-NEXT: [[THIS1:%.*]] = load ptr, ptr [[THIS_ADDR]], align 4
2230 // CHECK19-NEXT: [[A:%.*]] = getelementptr inbounds [[STRUCT_SS:%.*]], ptr [[THIS1]], i32 0, i32 0
2231 // CHECK19-NEXT: [[TMP0:%.*]] = getelementptr inbounds [1 x ptr], ptr [[DOTOFFLOAD_BASEPTRS]], i32 0, i32 0
2232 // CHECK19-NEXT: store ptr [[THIS1]], ptr [[TMP0]], align 4
2233 // CHECK19-NEXT: [[TMP1:%.*]] = getelementptr inbounds [1 x ptr], ptr [[DOTOFFLOAD_PTRS]], i32 0, i32 0
2234 // CHECK19-NEXT: store ptr [[A]], ptr [[TMP1]], align 4
2235 // CHECK19-NEXT: [[TMP2:%.*]] = getelementptr inbounds [1 x ptr], ptr [[DOTOFFLOAD_MAPPERS]], i32 0, i32 0
2236 // CHECK19-NEXT: store ptr null, ptr [[TMP2]], align 4
2237 // CHECK19-NEXT: [[TMP3:%.*]] = getelementptr inbounds [1 x ptr], ptr [[DOTOFFLOAD_BASEPTRS]], i32 0, i32 0
2238 // CHECK19-NEXT: [[TMP4:%.*]] = getelementptr inbounds [1 x ptr], ptr [[DOTOFFLOAD_PTRS]], i32 0, i32 0
2239 // CHECK19-NEXT: [[TMP5:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 0
2240 // CHECK19-NEXT: store i32 2, ptr [[TMP5]], align 4
2241 // CHECK19-NEXT: [[TMP6:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 1
2242 // CHECK19-NEXT: store i32 1, ptr [[TMP6]], align 4
2243 // CHECK19-NEXT: [[TMP7:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 2
2244 // CHECK19-NEXT: store ptr [[TMP3]], ptr [[TMP7]], align 4
2245 // CHECK19-NEXT: [[TMP8:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 3
2246 // CHECK19-NEXT: store ptr [[TMP4]], ptr [[TMP8]], align 4
2247 // CHECK19-NEXT: [[TMP9:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 4
2248 // CHECK19-NEXT: store ptr @.offload_sizes, ptr [[TMP9]], align 4
2249 // CHECK19-NEXT: [[TMP10:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 5
2250 // CHECK19-NEXT: store ptr @.offload_maptypes, ptr [[TMP10]], align 4
2251 // CHECK19-NEXT: [[TMP11:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 6
2252 // CHECK19-NEXT: store ptr null, ptr [[TMP11]], align 4
2253 // CHECK19-NEXT: [[TMP12:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 7
2254 // CHECK19-NEXT: store ptr null, ptr [[TMP12]], align 4
2255 // CHECK19-NEXT: [[TMP13:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 8
2256 // CHECK19-NEXT: store i64 123, ptr [[TMP13]], align 8
2257 // CHECK19-NEXT: [[TMP14:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 9
2258 // CHECK19-NEXT: store i64 0, ptr [[TMP14]], align 8
2259 // CHECK19-NEXT: [[TMP15:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 10
2260 // CHECK19-NEXT: store [3 x i32] zeroinitializer, ptr [[TMP15]], align 4
2261 // CHECK19-NEXT: [[TMP16:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 11
2262 // CHECK19-NEXT: store [3 x i32] zeroinitializer, ptr [[TMP16]], align 4
2263 // CHECK19-NEXT: [[TMP17:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 12
2264 // CHECK19-NEXT: store i32 0, ptr [[TMP17]], align 4
2265 // CHECK19-NEXT: [[TMP18:%.*]] = call i32 @__tgt_target_kernel(ptr @[[GLOB3:[0-9]+]], i64 -1, i32 0, i32 0, ptr @.{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__ZN2SSIiLi123ELx456EE3fooEv_l108.region_id, ptr [[KERNEL_ARGS]])
2266 // CHECK19-NEXT: [[TMP19:%.*]] = icmp ne i32 [[TMP18]], 0
2267 // CHECK19-NEXT: br i1 [[TMP19]], label [[OMP_OFFLOAD_FAILED:%.*]], label [[OMP_OFFLOAD_CONT:%.*]]
2268 // CHECK19: omp_offload.failed:
2269 // CHECK19-NEXT: call void @{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__ZN2SSIiLi123ELx456EE3fooEv_l108(ptr [[THIS1]]) #[[ATTR3:[0-9]+]]
2270 // CHECK19-NEXT: br label [[OMP_OFFLOAD_CONT]]
2271 // CHECK19: omp_offload.cont:
2272 // CHECK19-NEXT: [[A2:%.*]] = getelementptr inbounds [[STRUCT_SS]], ptr [[THIS1]], i32 0, i32 0
2273 // CHECK19-NEXT: [[ARRAYIDX:%.*]] = getelementptr inbounds [123 x i32], ptr [[A2]], i32 0, i32 0
2274 // CHECK19-NEXT: [[TMP20:%.*]] = load i32, ptr [[ARRAYIDX]], align 4
2275 // CHECK19-NEXT: ret i32 [[TMP20]]
2278 // CHECK19-LABEL: define {{[^@]+}}@{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__ZN2SSIiLi123ELx456EE3fooEv_l108
2279 // CHECK19-SAME: (ptr noundef [[THIS:%.*]]) #[[ATTR1:[0-9]+]] {
2280 // CHECK19-NEXT: entry:
2281 // CHECK19-NEXT: [[THIS_ADDR:%.*]] = alloca ptr, align 4
2282 // CHECK19-NEXT: store ptr [[THIS]], ptr [[THIS_ADDR]], align 4
2283 // CHECK19-NEXT: [[TMP0:%.*]] = load ptr, ptr [[THIS_ADDR]], align 4
2284 // CHECK19-NEXT: call void (ptr, i32, ptr, ...) @__kmpc_fork_teams(ptr @[[GLOB3]], i32 1, ptr @{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__ZN2SSIiLi123ELx456EE3fooEv_l108.omp_outlined, ptr [[TMP0]])
2285 // CHECK19-NEXT: ret void
2288 // CHECK19-LABEL: define {{[^@]+}}@{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__ZN2SSIiLi123ELx456EE3fooEv_l108.omp_outlined
2289 // CHECK19-SAME: (ptr noalias noundef [[DOTGLOBAL_TID_:%.*]], ptr noalias noundef [[DOTBOUND_TID_:%.*]], ptr noundef [[THIS:%.*]]) #[[ATTR2:[0-9]+]] {
2290 // CHECK19-NEXT: entry:
2291 // CHECK19-NEXT: [[DOTGLOBAL_TID__ADDR:%.*]] = alloca ptr, align 4
2292 // CHECK19-NEXT: [[DOTBOUND_TID__ADDR:%.*]] = alloca ptr, align 4
2293 // CHECK19-NEXT: [[THIS_ADDR:%.*]] = alloca ptr, align 4
2294 // CHECK19-NEXT: [[DOTOMP_IV:%.*]] = alloca i32, align 4
2295 // CHECK19-NEXT: [[TMP:%.*]] = alloca i32, align 4
2296 // CHECK19-NEXT: [[DOTOMP_COMB_LB:%.*]] = alloca i32, align 4
2297 // CHECK19-NEXT: [[DOTOMP_COMB_UB:%.*]] = alloca i32, align 4
2298 // CHECK19-NEXT: [[DOTOMP_STRIDE:%.*]] = alloca i32, align 4
2299 // CHECK19-NEXT: [[DOTOMP_IS_LAST:%.*]] = alloca i32, align 4
2300 // CHECK19-NEXT: [[I:%.*]] = alloca i32, align 4
2301 // CHECK19-NEXT: store ptr [[DOTGLOBAL_TID_]], ptr [[DOTGLOBAL_TID__ADDR]], align 4
2302 // CHECK19-NEXT: store ptr [[DOTBOUND_TID_]], ptr [[DOTBOUND_TID__ADDR]], align 4
2303 // CHECK19-NEXT: store ptr [[THIS]], ptr [[THIS_ADDR]], align 4
2304 // CHECK19-NEXT: [[TMP0:%.*]] = load ptr, ptr [[THIS_ADDR]], align 4
2305 // CHECK19-NEXT: store i32 0, ptr [[DOTOMP_COMB_LB]], align 4
2306 // CHECK19-NEXT: store i32 122, ptr [[DOTOMP_COMB_UB]], align 4
2307 // CHECK19-NEXT: store i32 1, ptr [[DOTOMP_STRIDE]], align 4
2308 // CHECK19-NEXT: store i32 0, ptr [[DOTOMP_IS_LAST]], align 4
2309 // CHECK19-NEXT: [[TMP1:%.*]] = load ptr, ptr [[DOTGLOBAL_TID__ADDR]], align 4
2310 // CHECK19-NEXT: [[TMP2:%.*]] = load i32, ptr [[TMP1]], align 4
2311 // CHECK19-NEXT: call void @__kmpc_for_static_init_4(ptr @[[GLOB1:[0-9]+]], i32 [[TMP2]], i32 92, ptr [[DOTOMP_IS_LAST]], ptr [[DOTOMP_COMB_LB]], ptr [[DOTOMP_COMB_UB]], ptr [[DOTOMP_STRIDE]], i32 1, i32 1)
2312 // CHECK19-NEXT: [[TMP3:%.*]] = load i32, ptr [[DOTOMP_COMB_UB]], align 4
2313 // CHECK19-NEXT: [[CMP:%.*]] = icmp sgt i32 [[TMP3]], 122
2314 // CHECK19-NEXT: br i1 [[CMP]], label [[COND_TRUE:%.*]], label [[COND_FALSE:%.*]]
2315 // CHECK19: cond.true:
2316 // CHECK19-NEXT: br label [[COND_END:%.*]]
2317 // CHECK19: cond.false:
2318 // CHECK19-NEXT: [[TMP4:%.*]] = load i32, ptr [[DOTOMP_COMB_UB]], align 4
2319 // CHECK19-NEXT: br label [[COND_END]]
2320 // CHECK19: cond.end:
2321 // CHECK19-NEXT: [[COND:%.*]] = phi i32 [ 122, [[COND_TRUE]] ], [ [[TMP4]], [[COND_FALSE]] ]
2322 // CHECK19-NEXT: store i32 [[COND]], ptr [[DOTOMP_COMB_UB]], align 4
2323 // CHECK19-NEXT: [[TMP5:%.*]] = load i32, ptr [[DOTOMP_COMB_LB]], align 4
2324 // CHECK19-NEXT: store i32 [[TMP5]], ptr [[DOTOMP_IV]], align 4
2325 // CHECK19-NEXT: br label [[OMP_INNER_FOR_COND:%.*]]
2326 // CHECK19: omp.inner.for.cond:
2327 // CHECK19-NEXT: [[TMP6:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4
2328 // CHECK19-NEXT: [[TMP7:%.*]] = load i32, ptr [[DOTOMP_COMB_UB]], align 4
2329 // CHECK19-NEXT: [[CMP1:%.*]] = icmp sle i32 [[TMP6]], [[TMP7]]
2330 // CHECK19-NEXT: br i1 [[CMP1]], label [[OMP_INNER_FOR_BODY:%.*]], label [[OMP_INNER_FOR_END:%.*]]
2331 // CHECK19: omp.inner.for.body:
2332 // CHECK19-NEXT: [[TMP8:%.*]] = load i32, ptr [[DOTOMP_COMB_LB]], align 4
2333 // CHECK19-NEXT: [[TMP9:%.*]] = load i32, ptr [[DOTOMP_COMB_UB]], align 4
2334 // CHECK19-NEXT: call void (ptr, i32, ptr, ...) @__kmpc_fork_call(ptr @[[GLOB3]], i32 3, ptr @{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__ZN2SSIiLi123ELx456EE3fooEv_l108.omp_outlined.omp_outlined, i32 [[TMP8]], i32 [[TMP9]], ptr [[TMP0]])
2335 // CHECK19-NEXT: br label [[OMP_INNER_FOR_INC:%.*]]
2336 // CHECK19: omp.inner.for.inc:
2337 // CHECK19-NEXT: [[TMP10:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4
2338 // CHECK19-NEXT: [[TMP11:%.*]] = load i32, ptr [[DOTOMP_STRIDE]], align 4
2339 // CHECK19-NEXT: [[ADD:%.*]] = add nsw i32 [[TMP10]], [[TMP11]]
2340 // CHECK19-NEXT: store i32 [[ADD]], ptr [[DOTOMP_IV]], align 4
2341 // CHECK19-NEXT: br label [[OMP_INNER_FOR_COND]]
2342 // CHECK19: omp.inner.for.end:
2343 // CHECK19-NEXT: br label [[OMP_LOOP_EXIT:%.*]]
2344 // CHECK19: omp.loop.exit:
2345 // CHECK19-NEXT: call void @__kmpc_for_static_fini(ptr @[[GLOB2:[0-9]+]], i32 [[TMP2]])
2346 // CHECK19-NEXT: ret void
2349 // CHECK19-LABEL: define {{[^@]+}}@{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__ZN2SSIiLi123ELx456EE3fooEv_l108.omp_outlined.omp_outlined
2350 // CHECK19-SAME: (ptr noalias noundef [[DOTGLOBAL_TID_:%.*]], ptr noalias noundef [[DOTBOUND_TID_:%.*]], i32 noundef [[DOTPREVIOUS_LB_:%.*]], i32 noundef [[DOTPREVIOUS_UB_:%.*]], ptr noundef [[THIS:%.*]]) #[[ATTR2]] {
2351 // CHECK19-NEXT: entry:
2352 // CHECK19-NEXT: [[DOTGLOBAL_TID__ADDR:%.*]] = alloca ptr, align 4
2353 // CHECK19-NEXT: [[DOTBOUND_TID__ADDR:%.*]] = alloca ptr, align 4
2354 // CHECK19-NEXT: [[DOTPREVIOUS_LB__ADDR:%.*]] = alloca i32, align 4
2355 // CHECK19-NEXT: [[DOTPREVIOUS_UB__ADDR:%.*]] = alloca i32, align 4
2356 // CHECK19-NEXT: [[THIS_ADDR:%.*]] = alloca ptr, align 4
2357 // CHECK19-NEXT: [[DOTOMP_IV:%.*]] = alloca i32, align 4
2358 // CHECK19-NEXT: [[TMP:%.*]] = alloca i32, align 4
2359 // CHECK19-NEXT: [[DOTOMP_LB:%.*]] = alloca i32, align 4
2360 // CHECK19-NEXT: [[DOTOMP_UB:%.*]] = alloca i32, align 4
2361 // CHECK19-NEXT: [[DOTOMP_STRIDE:%.*]] = alloca i32, align 4
2362 // CHECK19-NEXT: [[DOTOMP_IS_LAST:%.*]] = alloca i32, align 4
2363 // CHECK19-NEXT: [[I:%.*]] = alloca i32, align 4
2364 // CHECK19-NEXT: store ptr [[DOTGLOBAL_TID_]], ptr [[DOTGLOBAL_TID__ADDR]], align 4
2365 // CHECK19-NEXT: store ptr [[DOTBOUND_TID_]], ptr [[DOTBOUND_TID__ADDR]], align 4
2366 // CHECK19-NEXT: store i32 [[DOTPREVIOUS_LB_]], ptr [[DOTPREVIOUS_LB__ADDR]], align 4
2367 // CHECK19-NEXT: store i32 [[DOTPREVIOUS_UB_]], ptr [[DOTPREVIOUS_UB__ADDR]], align 4
2368 // CHECK19-NEXT: store ptr [[THIS]], ptr [[THIS_ADDR]], align 4
2369 // CHECK19-NEXT: [[TMP0:%.*]] = load ptr, ptr [[THIS_ADDR]], align 4
2370 // CHECK19-NEXT: store i32 0, ptr [[DOTOMP_LB]], align 4
2371 // CHECK19-NEXT: store i32 122, ptr [[DOTOMP_UB]], align 4
2372 // CHECK19-NEXT: [[TMP1:%.*]] = load i32, ptr [[DOTPREVIOUS_LB__ADDR]], align 4
2373 // CHECK19-NEXT: [[TMP2:%.*]] = load i32, ptr [[DOTPREVIOUS_UB__ADDR]], align 4
2374 // CHECK19-NEXT: store i32 [[TMP1]], ptr [[DOTOMP_LB]], align 4
2375 // CHECK19-NEXT: store i32 [[TMP2]], ptr [[DOTOMP_UB]], align 4
2376 // CHECK19-NEXT: store i32 1, ptr [[DOTOMP_STRIDE]], align 4
2377 // CHECK19-NEXT: store i32 0, ptr [[DOTOMP_IS_LAST]], align 4
2378 // CHECK19-NEXT: [[TMP3:%.*]] = load ptr, ptr [[DOTGLOBAL_TID__ADDR]], align 4
2379 // CHECK19-NEXT: [[TMP4:%.*]] = load i32, ptr [[TMP3]], align 4
2380 // CHECK19-NEXT: call void @__kmpc_for_static_init_4(ptr @[[GLOB2]], i32 [[TMP4]], i32 34, ptr [[DOTOMP_IS_LAST]], ptr [[DOTOMP_LB]], ptr [[DOTOMP_UB]], ptr [[DOTOMP_STRIDE]], i32 1, i32 1)
2381 // CHECK19-NEXT: [[TMP5:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4
2382 // CHECK19-NEXT: [[CMP:%.*]] = icmp sgt i32 [[TMP5]], 122
2383 // CHECK19-NEXT: br i1 [[CMP]], label [[COND_TRUE:%.*]], label [[COND_FALSE:%.*]]
2384 // CHECK19: cond.true:
2385 // CHECK19-NEXT: br label [[COND_END:%.*]]
2386 // CHECK19: cond.false:
2387 // CHECK19-NEXT: [[TMP6:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4
2388 // CHECK19-NEXT: br label [[COND_END]]
2389 // CHECK19: cond.end:
2390 // CHECK19-NEXT: [[COND:%.*]] = phi i32 [ 122, [[COND_TRUE]] ], [ [[TMP6]], [[COND_FALSE]] ]
2391 // CHECK19-NEXT: store i32 [[COND]], ptr [[DOTOMP_UB]], align 4
2392 // CHECK19-NEXT: [[TMP7:%.*]] = load i32, ptr [[DOTOMP_LB]], align 4
2393 // CHECK19-NEXT: store i32 [[TMP7]], ptr [[DOTOMP_IV]], align 4
2394 // CHECK19-NEXT: br label [[OMP_INNER_FOR_COND:%.*]]
2395 // CHECK19: omp.inner.for.cond:
2396 // CHECK19-NEXT: [[TMP8:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4
2397 // CHECK19-NEXT: [[TMP9:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4
2398 // CHECK19-NEXT: [[CMP1:%.*]] = icmp sle i32 [[TMP8]], [[TMP9]]
2399 // CHECK19-NEXT: br i1 [[CMP1]], label [[OMP_INNER_FOR_BODY:%.*]], label [[OMP_INNER_FOR_END:%.*]]
2400 // CHECK19: omp.inner.for.body:
2401 // CHECK19-NEXT: [[TMP10:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4
2402 // CHECK19-NEXT: [[MUL:%.*]] = mul nsw i32 [[TMP10]], 1
2403 // CHECK19-NEXT: [[ADD:%.*]] = add nsw i32 0, [[MUL]]
2404 // CHECK19-NEXT: store i32 [[ADD]], ptr [[I]], align 4
2405 // CHECK19-NEXT: [[A:%.*]] = getelementptr inbounds [[STRUCT_SS:%.*]], ptr [[TMP0]], i32 0, i32 0
2406 // CHECK19-NEXT: [[TMP11:%.*]] = load i32, ptr [[I]], align 4
2407 // CHECK19-NEXT: [[ARRAYIDX:%.*]] = getelementptr inbounds [123 x i32], ptr [[A]], i32 0, i32 [[TMP11]]
2408 // CHECK19-NEXT: store i32 0, ptr [[ARRAYIDX]], align 4
2409 // CHECK19-NEXT: br label [[OMP_BODY_CONTINUE:%.*]]
2410 // CHECK19: omp.body.continue:
2411 // CHECK19-NEXT: br label [[OMP_INNER_FOR_INC:%.*]]
2412 // CHECK19: omp.inner.for.inc:
2413 // CHECK19-NEXT: [[TMP12:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4
2414 // CHECK19-NEXT: [[ADD2:%.*]] = add nsw i32 [[TMP12]], 1
2415 // CHECK19-NEXT: store i32 [[ADD2]], ptr [[DOTOMP_IV]], align 4
2416 // CHECK19-NEXT: br label [[OMP_INNER_FOR_COND]]
2417 // CHECK19: omp.inner.for.end:
2418 // CHECK19-NEXT: br label [[OMP_LOOP_EXIT:%.*]]
2419 // CHECK19: omp.loop.exit:
2420 // CHECK19-NEXT: call void @__kmpc_for_static_fini(ptr @[[GLOB2]], i32 [[TMP4]])
2421 // CHECK19-NEXT: ret void
2424 // CHECK19-LABEL: define {{[^@]+}}@.omp_offloading.requires_reg
2425 // CHECK19-SAME: () #[[ATTR4:[0-9]+]] {
2426 // CHECK19-NEXT: entry:
2427 // CHECK19-NEXT: call void @__tgt_register_requires(i64 1)
2428 // CHECK19-NEXT: ret void
2431 // CHECK25-LABEL: define {{[^@]+}}@main
2432 // CHECK25-SAME: (i32 noundef signext [[ARGC:%.*]], ptr noundef [[ARGV:%.*]]) #[[ATTR0:[0-9]+]] {
2433 // CHECK25-NEXT: entry:
2434 // CHECK25-NEXT: [[RETVAL:%.*]] = alloca i32, align 4
2435 // CHECK25-NEXT: [[ARGC_ADDR:%.*]] = alloca i32, align 4
2436 // CHECK25-NEXT: [[ARGV_ADDR:%.*]] = alloca ptr, align 8
2437 // CHECK25-NEXT: [[N:%.*]] = alloca i32, align 4
2438 // CHECK25-NEXT: [[SAVED_STACK:%.*]] = alloca ptr, align 8
2439 // CHECK25-NEXT: [[__VLA_EXPR0:%.*]] = alloca i64, align 8
2440 // CHECK25-NEXT: [[N_CASTED:%.*]] = alloca i64, align 8
2441 // CHECK25-NEXT: [[DOTOFFLOAD_BASEPTRS:%.*]] = alloca [3 x ptr], align 8
2442 // CHECK25-NEXT: [[DOTOFFLOAD_PTRS:%.*]] = alloca [3 x ptr], align 8
2443 // CHECK25-NEXT: [[DOTOFFLOAD_MAPPERS:%.*]] = alloca [3 x ptr], align 8
2444 // CHECK25-NEXT: [[DOTOFFLOAD_SIZES:%.*]] = alloca [3 x i64], align 8
2445 // CHECK25-NEXT: [[TMP:%.*]] = alloca i32, align 4
2446 // CHECK25-NEXT: [[DOTCAPTURE_EXPR_:%.*]] = alloca i32, align 4
2447 // CHECK25-NEXT: [[DOTCAPTURE_EXPR_1:%.*]] = alloca i32, align 4
2448 // CHECK25-NEXT: [[KERNEL_ARGS:%.*]] = alloca [[STRUCT___TGT_KERNEL_ARGUMENTS:%.*]], align 8
2449 // CHECK25-NEXT: store i32 0, ptr [[RETVAL]], align 4
2450 // CHECK25-NEXT: store i32 [[ARGC]], ptr [[ARGC_ADDR]], align 4
2451 // CHECK25-NEXT: store ptr [[ARGV]], ptr [[ARGV_ADDR]], align 8
2452 // CHECK25-NEXT: store i32 100, ptr [[N]], align 4
2453 // CHECK25-NEXT: [[TMP0:%.*]] = load i32, ptr [[N]], align 4
2454 // CHECK25-NEXT: [[TMP1:%.*]] = zext i32 [[TMP0]] to i64
2455 // CHECK25-NEXT: [[TMP2:%.*]] = call ptr @llvm.stacksave.p0()
2456 // CHECK25-NEXT: store ptr [[TMP2]], ptr [[SAVED_STACK]], align 8
2457 // CHECK25-NEXT: [[VLA:%.*]] = alloca i32, i64 [[TMP1]], align 4
2458 // CHECK25-NEXT: store i64 [[TMP1]], ptr [[__VLA_EXPR0]], align 8
2459 // CHECK25-NEXT: [[TMP3:%.*]] = load i32, ptr [[N]], align 4
2460 // CHECK25-NEXT: store i32 [[TMP3]], ptr [[N_CASTED]], align 4
2461 // CHECK25-NEXT: [[TMP4:%.*]] = load i64, ptr [[N_CASTED]], align 8
2462 // CHECK25-NEXT: [[TMP5:%.*]] = mul nuw i64 [[TMP1]], 4
2463 // CHECK25-NEXT: call void @llvm.memcpy.p0.p0.i64(ptr align 8 [[DOTOFFLOAD_SIZES]], ptr align 8 @.offload_sizes, i64 24, i1 false)
2464 // CHECK25-NEXT: [[TMP6:%.*]] = getelementptr inbounds [3 x ptr], ptr [[DOTOFFLOAD_BASEPTRS]], i32 0, i32 0
2465 // CHECK25-NEXT: store i64 [[TMP4]], ptr [[TMP6]], align 8
2466 // CHECK25-NEXT: [[TMP7:%.*]] = getelementptr inbounds [3 x ptr], ptr [[DOTOFFLOAD_PTRS]], i32 0, i32 0
2467 // CHECK25-NEXT: store i64 [[TMP4]], ptr [[TMP7]], align 8
2468 // CHECK25-NEXT: [[TMP8:%.*]] = getelementptr inbounds [3 x ptr], ptr [[DOTOFFLOAD_MAPPERS]], i64 0, i64 0
2469 // CHECK25-NEXT: store ptr null, ptr [[TMP8]], align 8
2470 // CHECK25-NEXT: [[TMP9:%.*]] = getelementptr inbounds [3 x ptr], ptr [[DOTOFFLOAD_BASEPTRS]], i32 0, i32 1
2471 // CHECK25-NEXT: store i64 [[TMP1]], ptr [[TMP9]], align 8
2472 // CHECK25-NEXT: [[TMP10:%.*]] = getelementptr inbounds [3 x ptr], ptr [[DOTOFFLOAD_PTRS]], i32 0, i32 1
2473 // CHECK25-NEXT: store i64 [[TMP1]], ptr [[TMP10]], align 8
2474 // CHECK25-NEXT: [[TMP11:%.*]] = getelementptr inbounds [3 x ptr], ptr [[DOTOFFLOAD_MAPPERS]], i64 0, i64 1
2475 // CHECK25-NEXT: store ptr null, ptr [[TMP11]], align 8
2476 // CHECK25-NEXT: [[TMP12:%.*]] = getelementptr inbounds [3 x ptr], ptr [[DOTOFFLOAD_BASEPTRS]], i32 0, i32 2
2477 // CHECK25-NEXT: store ptr [[VLA]], ptr [[TMP12]], align 8
2478 // CHECK25-NEXT: [[TMP13:%.*]] = getelementptr inbounds [3 x ptr], ptr [[DOTOFFLOAD_PTRS]], i32 0, i32 2
2479 // CHECK25-NEXT: store ptr [[VLA]], ptr [[TMP13]], align 8
2480 // CHECK25-NEXT: [[TMP14:%.*]] = getelementptr inbounds [3 x i64], ptr [[DOTOFFLOAD_SIZES]], i32 0, i32 2
2481 // CHECK25-NEXT: store i64 [[TMP5]], ptr [[TMP14]], align 8
2482 // CHECK25-NEXT: [[TMP15:%.*]] = getelementptr inbounds [3 x ptr], ptr [[DOTOFFLOAD_MAPPERS]], i64 0, i64 2
2483 // CHECK25-NEXT: store ptr null, ptr [[TMP15]], align 8
2484 // CHECK25-NEXT: [[TMP16:%.*]] = getelementptr inbounds [3 x ptr], ptr [[DOTOFFLOAD_BASEPTRS]], i32 0, i32 0
2485 // CHECK25-NEXT: [[TMP17:%.*]] = getelementptr inbounds [3 x ptr], ptr [[DOTOFFLOAD_PTRS]], i32 0, i32 0
2486 // CHECK25-NEXT: [[TMP18:%.*]] = getelementptr inbounds [3 x i64], ptr [[DOTOFFLOAD_SIZES]], i32 0, i32 0
2487 // CHECK25-NEXT: [[TMP19:%.*]] = load i32, ptr [[N]], align 4
2488 // CHECK25-NEXT: store i32 [[TMP19]], ptr [[DOTCAPTURE_EXPR_]], align 4
2489 // CHECK25-NEXT: [[TMP20:%.*]] = load i32, ptr [[DOTCAPTURE_EXPR_]], align 4
2490 // CHECK25-NEXT: [[SUB:%.*]] = sub nsw i32 [[TMP20]], 0
2491 // CHECK25-NEXT: [[DIV:%.*]] = sdiv i32 [[SUB]], 1
2492 // CHECK25-NEXT: [[SUB2:%.*]] = sub nsw i32 [[DIV]], 1
2493 // CHECK25-NEXT: store i32 [[SUB2]], ptr [[DOTCAPTURE_EXPR_1]], align 4
2494 // CHECK25-NEXT: [[TMP21:%.*]] = load i32, ptr [[DOTCAPTURE_EXPR_1]], align 4
2495 // CHECK25-NEXT: [[ADD:%.*]] = add nsw i32 [[TMP21]], 1
2496 // CHECK25-NEXT: [[TMP22:%.*]] = zext i32 [[ADD]] to i64
2497 // CHECK25-NEXT: [[TMP23:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 0
2498 // CHECK25-NEXT: store i32 2, ptr [[TMP23]], align 4
2499 // CHECK25-NEXT: [[TMP24:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 1
2500 // CHECK25-NEXT: store i32 3, ptr [[TMP24]], align 4
2501 // CHECK25-NEXT: [[TMP25:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 2
2502 // CHECK25-NEXT: store ptr [[TMP16]], ptr [[TMP25]], align 8
2503 // CHECK25-NEXT: [[TMP26:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 3
2504 // CHECK25-NEXT: store ptr [[TMP17]], ptr [[TMP26]], align 8
2505 // CHECK25-NEXT: [[TMP27:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 4
2506 // CHECK25-NEXT: store ptr [[TMP18]], ptr [[TMP27]], align 8
2507 // CHECK25-NEXT: [[TMP28:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 5
2508 // CHECK25-NEXT: store ptr @.offload_maptypes, ptr [[TMP28]], align 8
2509 // CHECK25-NEXT: [[TMP29:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 6
2510 // CHECK25-NEXT: store ptr null, ptr [[TMP29]], align 8
2511 // CHECK25-NEXT: [[TMP30:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 7
2512 // CHECK25-NEXT: store ptr null, ptr [[TMP30]], align 8
2513 // CHECK25-NEXT: [[TMP31:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 8
2514 // CHECK25-NEXT: store i64 [[TMP22]], ptr [[TMP31]], align 8
2515 // CHECK25-NEXT: [[TMP32:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 9
2516 // CHECK25-NEXT: store i64 0, ptr [[TMP32]], align 8
2517 // CHECK25-NEXT: [[TMP33:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 10
2518 // CHECK25-NEXT: store [3 x i32] zeroinitializer, ptr [[TMP33]], align 4
2519 // CHECK25-NEXT: [[TMP34:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 11
2520 // CHECK25-NEXT: store [3 x i32] zeroinitializer, ptr [[TMP34]], align 4
2521 // CHECK25-NEXT: [[TMP35:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 12
2522 // CHECK25-NEXT: store i32 0, ptr [[TMP35]], align 4
2523 // CHECK25-NEXT: [[TMP36:%.*]] = call i32 @__tgt_target_kernel(ptr @[[GLOB3:[0-9]+]], i64 -1, i32 0, i32 0, ptr @.{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}_main_l161.region_id, ptr [[KERNEL_ARGS]])
2524 // CHECK25-NEXT: [[TMP37:%.*]] = icmp ne i32 [[TMP36]], 0
2525 // CHECK25-NEXT: br i1 [[TMP37]], label [[OMP_OFFLOAD_FAILED:%.*]], label [[OMP_OFFLOAD_CONT:%.*]]
2526 // CHECK25: omp_offload.failed:
2527 // CHECK25-NEXT: call void @{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}_main_l161(i64 [[TMP4]], i64 [[TMP1]], ptr [[VLA]]) #[[ATTR4:[0-9]+]]
2528 // CHECK25-NEXT: br label [[OMP_OFFLOAD_CONT]]
2529 // CHECK25: omp_offload.cont:
2530 // CHECK25-NEXT: [[TMP38:%.*]] = load i32, ptr [[ARGC_ADDR]], align 4
2531 // CHECK25-NEXT: [[CALL:%.*]] = call noundef signext i32 @_Z5tmainIiLi10EEiT_(i32 noundef signext [[TMP38]])
2532 // CHECK25-NEXT: store i32 [[CALL]], ptr [[RETVAL]], align 4
2533 // CHECK25-NEXT: [[TMP39:%.*]] = load ptr, ptr [[SAVED_STACK]], align 8
2534 // CHECK25-NEXT: call void @llvm.stackrestore.p0(ptr [[TMP39]])
2535 // CHECK25-NEXT: [[TMP40:%.*]] = load i32, ptr [[RETVAL]], align 4
2536 // CHECK25-NEXT: ret i32 [[TMP40]]
2539 // CHECK25-LABEL: define {{[^@]+}}@{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}_main_l161
2540 // CHECK25-SAME: (i64 noundef [[N:%.*]], i64 noundef [[VLA:%.*]], ptr noundef nonnull align 4 dereferenceable(4) [[A:%.*]]) #[[ATTR2:[0-9]+]] {
2541 // CHECK25-NEXT: entry:
2542 // CHECK25-NEXT: [[N_ADDR:%.*]] = alloca i64, align 8
2543 // CHECK25-NEXT: [[VLA_ADDR:%.*]] = alloca i64, align 8
2544 // CHECK25-NEXT: [[A_ADDR:%.*]] = alloca ptr, align 8
2545 // CHECK25-NEXT: store i64 [[N]], ptr [[N_ADDR]], align 8
2546 // CHECK25-NEXT: store i64 [[VLA]], ptr [[VLA_ADDR]], align 8
2547 // CHECK25-NEXT: store ptr [[A]], ptr [[A_ADDR]], align 8
2548 // CHECK25-NEXT: [[TMP0:%.*]] = load i64, ptr [[VLA_ADDR]], align 8
2549 // CHECK25-NEXT: [[TMP1:%.*]] = load ptr, ptr [[A_ADDR]], align 8
2550 // CHECK25-NEXT: call void (ptr, i32, ptr, ...) @__kmpc_fork_teams(ptr @[[GLOB3]], i32 3, ptr @{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}_main_l161.omp_outlined, ptr [[N_ADDR]], i64 [[TMP0]], ptr [[TMP1]])
2551 // CHECK25-NEXT: ret void
2554 // CHECK25-LABEL: define {{[^@]+}}@{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}_main_l161.omp_outlined
2555 // CHECK25-SAME: (ptr noalias noundef [[DOTGLOBAL_TID_:%.*]], ptr noalias noundef [[DOTBOUND_TID_:%.*]], ptr noundef nonnull align 4 dereferenceable(4) [[N:%.*]], i64 noundef [[VLA:%.*]], ptr noundef nonnull align 4 dereferenceable(4) [[A:%.*]]) #[[ATTR3:[0-9]+]] {
2556 // CHECK25-NEXT: entry:
2557 // CHECK25-NEXT: [[DOTGLOBAL_TID__ADDR:%.*]] = alloca ptr, align 8
2558 // CHECK25-NEXT: [[DOTBOUND_TID__ADDR:%.*]] = alloca ptr, align 8
2559 // CHECK25-NEXT: [[N_ADDR:%.*]] = alloca ptr, align 8
2560 // CHECK25-NEXT: [[VLA_ADDR:%.*]] = alloca i64, align 8
2561 // CHECK25-NEXT: [[A_ADDR:%.*]] = alloca ptr, align 8
2562 // CHECK25-NEXT: [[DOTOMP_IV:%.*]] = alloca i32, align 4
2563 // CHECK25-NEXT: [[TMP:%.*]] = alloca i32, align 4
2564 // CHECK25-NEXT: [[DOTCAPTURE_EXPR_:%.*]] = alloca i32, align 4
2565 // CHECK25-NEXT: [[DOTCAPTURE_EXPR_1:%.*]] = alloca i32, align 4
2566 // CHECK25-NEXT: [[I:%.*]] = alloca i32, align 4
2567 // CHECK25-NEXT: [[DOTOMP_COMB_LB:%.*]] = alloca i32, align 4
2568 // CHECK25-NEXT: [[DOTOMP_COMB_UB:%.*]] = alloca i32, align 4
2569 // CHECK25-NEXT: [[DOTOMP_STRIDE:%.*]] = alloca i32, align 4
2570 // CHECK25-NEXT: [[DOTOMP_IS_LAST:%.*]] = alloca i32, align 4
2571 // CHECK25-NEXT: [[I3:%.*]] = alloca i32, align 4
2572 // CHECK25-NEXT: store ptr [[DOTGLOBAL_TID_]], ptr [[DOTGLOBAL_TID__ADDR]], align 8
2573 // CHECK25-NEXT: store ptr [[DOTBOUND_TID_]], ptr [[DOTBOUND_TID__ADDR]], align 8
2574 // CHECK25-NEXT: store ptr [[N]], ptr [[N_ADDR]], align 8
2575 // CHECK25-NEXT: store i64 [[VLA]], ptr [[VLA_ADDR]], align 8
2576 // CHECK25-NEXT: store ptr [[A]], ptr [[A_ADDR]], align 8
2577 // CHECK25-NEXT: [[TMP0:%.*]] = load ptr, ptr [[N_ADDR]], align 8
2578 // CHECK25-NEXT: [[TMP1:%.*]] = load i64, ptr [[VLA_ADDR]], align 8
2579 // CHECK25-NEXT: [[TMP2:%.*]] = load ptr, ptr [[A_ADDR]], align 8
2580 // CHECK25-NEXT: [[TMP3:%.*]] = load i32, ptr [[TMP0]], align 4
2581 // CHECK25-NEXT: store i32 [[TMP3]], ptr [[DOTCAPTURE_EXPR_]], align 4
2582 // CHECK25-NEXT: [[TMP4:%.*]] = load i32, ptr [[DOTCAPTURE_EXPR_]], align 4
2583 // CHECK25-NEXT: [[SUB:%.*]] = sub nsw i32 [[TMP4]], 0
2584 // CHECK25-NEXT: [[DIV:%.*]] = sdiv i32 [[SUB]], 1
2585 // CHECK25-NEXT: [[SUB2:%.*]] = sub nsw i32 [[DIV]], 1
2586 // CHECK25-NEXT: store i32 [[SUB2]], ptr [[DOTCAPTURE_EXPR_1]], align 4
2587 // CHECK25-NEXT: store i32 0, ptr [[I]], align 4
2588 // CHECK25-NEXT: [[TMP5:%.*]] = load i32, ptr [[DOTCAPTURE_EXPR_]], align 4
2589 // CHECK25-NEXT: [[CMP:%.*]] = icmp slt i32 0, [[TMP5]]
2590 // CHECK25-NEXT: br i1 [[CMP]], label [[OMP_PRECOND_THEN:%.*]], label [[OMP_PRECOND_END:%.*]]
2591 // CHECK25: omp.precond.then:
2592 // CHECK25-NEXT: store i32 0, ptr [[DOTOMP_COMB_LB]], align 4
2593 // CHECK25-NEXT: [[TMP6:%.*]] = load i32, ptr [[DOTCAPTURE_EXPR_1]], align 4
2594 // CHECK25-NEXT: store i32 [[TMP6]], ptr [[DOTOMP_COMB_UB]], align 4
2595 // CHECK25-NEXT: store i32 1, ptr [[DOTOMP_STRIDE]], align 4
2596 // CHECK25-NEXT: store i32 0, ptr [[DOTOMP_IS_LAST]], align 4
2597 // CHECK25-NEXT: [[TMP7:%.*]] = load ptr, ptr [[DOTGLOBAL_TID__ADDR]], align 8
2598 // CHECK25-NEXT: [[TMP8:%.*]] = load i32, ptr [[TMP7]], align 4
2599 // CHECK25-NEXT: call void @__kmpc_for_static_init_4(ptr @[[GLOB1:[0-9]+]], i32 [[TMP8]], i32 92, ptr [[DOTOMP_IS_LAST]], ptr [[DOTOMP_COMB_LB]], ptr [[DOTOMP_COMB_UB]], ptr [[DOTOMP_STRIDE]], i32 1, i32 1)
2600 // CHECK25-NEXT: [[TMP9:%.*]] = load i32, ptr [[DOTOMP_COMB_UB]], align 4
2601 // CHECK25-NEXT: [[TMP10:%.*]] = load i32, ptr [[DOTCAPTURE_EXPR_1]], align 4
2602 // CHECK25-NEXT: [[CMP4:%.*]] = icmp sgt i32 [[TMP9]], [[TMP10]]
2603 // CHECK25-NEXT: br i1 [[CMP4]], label [[COND_TRUE:%.*]], label [[COND_FALSE:%.*]]
2604 // CHECK25: cond.true:
2605 // CHECK25-NEXT: [[TMP11:%.*]] = load i32, ptr [[DOTCAPTURE_EXPR_1]], align 4
2606 // CHECK25-NEXT: br label [[COND_END:%.*]]
2607 // CHECK25: cond.false:
2608 // CHECK25-NEXT: [[TMP12:%.*]] = load i32, ptr [[DOTOMP_COMB_UB]], align 4
2609 // CHECK25-NEXT: br label [[COND_END]]
2610 // CHECK25: cond.end:
2611 // CHECK25-NEXT: [[COND:%.*]] = phi i32 [ [[TMP11]], [[COND_TRUE]] ], [ [[TMP12]], [[COND_FALSE]] ]
2612 // CHECK25-NEXT: store i32 [[COND]], ptr [[DOTOMP_COMB_UB]], align 4
2613 // CHECK25-NEXT: [[TMP13:%.*]] = load i32, ptr [[DOTOMP_COMB_LB]], align 4
2614 // CHECK25-NEXT: store i32 [[TMP13]], ptr [[DOTOMP_IV]], align 4
2615 // CHECK25-NEXT: br label [[OMP_INNER_FOR_COND:%.*]]
2616 // CHECK25: omp.inner.for.cond:
2617 // CHECK25-NEXT: [[TMP14:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4
2618 // CHECK25-NEXT: [[TMP15:%.*]] = load i32, ptr [[DOTOMP_COMB_UB]], align 4
2619 // CHECK25-NEXT: [[CMP5:%.*]] = icmp sle i32 [[TMP14]], [[TMP15]]
2620 // CHECK25-NEXT: br i1 [[CMP5]], label [[OMP_INNER_FOR_BODY:%.*]], label [[OMP_INNER_FOR_END:%.*]]
2621 // CHECK25: omp.inner.for.body:
2622 // CHECK25-NEXT: [[TMP16:%.*]] = load i32, ptr [[DOTOMP_COMB_LB]], align 4
2623 // CHECK25-NEXT: [[TMP17:%.*]] = zext i32 [[TMP16]] to i64
2624 // CHECK25-NEXT: [[TMP18:%.*]] = load i32, ptr [[DOTOMP_COMB_UB]], align 4
2625 // CHECK25-NEXT: [[TMP19:%.*]] = zext i32 [[TMP18]] to i64
2626 // CHECK25-NEXT: call void (ptr, i32, ptr, ...) @__kmpc_fork_call(ptr @[[GLOB3]], i32 5, ptr @{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}_main_l161.omp_outlined.omp_outlined, i64 [[TMP17]], i64 [[TMP19]], ptr [[TMP0]], i64 [[TMP1]], ptr [[TMP2]])
2627 // CHECK25-NEXT: br label [[OMP_INNER_FOR_INC:%.*]]
2628 // CHECK25: omp.inner.for.inc:
2629 // CHECK25-NEXT: [[TMP20:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4
2630 // CHECK25-NEXT: [[TMP21:%.*]] = load i32, ptr [[DOTOMP_STRIDE]], align 4
2631 // CHECK25-NEXT: [[ADD:%.*]] = add nsw i32 [[TMP20]], [[TMP21]]
2632 // CHECK25-NEXT: store i32 [[ADD]], ptr [[DOTOMP_IV]], align 4
2633 // CHECK25-NEXT: br label [[OMP_INNER_FOR_COND]]
2634 // CHECK25: omp.inner.for.end:
2635 // CHECK25-NEXT: br label [[OMP_LOOP_EXIT:%.*]]
2636 // CHECK25: omp.loop.exit:
2637 // CHECK25-NEXT: [[TMP22:%.*]] = load ptr, ptr [[DOTGLOBAL_TID__ADDR]], align 8
2638 // CHECK25-NEXT: [[TMP23:%.*]] = load i32, ptr [[TMP22]], align 4
2639 // CHECK25-NEXT: call void @__kmpc_for_static_fini(ptr @[[GLOB2:[0-9]+]], i32 [[TMP23]])
2640 // CHECK25-NEXT: br label [[OMP_PRECOND_END]]
2641 // CHECK25: omp.precond.end:
2642 // CHECK25-NEXT: ret void
2645 // CHECK25-LABEL: define {{[^@]+}}@{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}_main_l161.omp_outlined.omp_outlined
2646 // CHECK25-SAME: (ptr noalias noundef [[DOTGLOBAL_TID_:%.*]], ptr noalias noundef [[DOTBOUND_TID_:%.*]], i64 noundef [[DOTPREVIOUS_LB_:%.*]], i64 noundef [[DOTPREVIOUS_UB_:%.*]], ptr noundef nonnull align 4 dereferenceable(4) [[N:%.*]], i64 noundef [[VLA:%.*]], ptr noundef nonnull align 4 dereferenceable(4) [[A:%.*]]) #[[ATTR3]] {
2647 // CHECK25-NEXT: entry:
2648 // CHECK25-NEXT: [[DOTGLOBAL_TID__ADDR:%.*]] = alloca ptr, align 8
2649 // CHECK25-NEXT: [[DOTBOUND_TID__ADDR:%.*]] = alloca ptr, align 8
2650 // CHECK25-NEXT: [[DOTPREVIOUS_LB__ADDR:%.*]] = alloca i64, align 8
2651 // CHECK25-NEXT: [[DOTPREVIOUS_UB__ADDR:%.*]] = alloca i64, align 8
2652 // CHECK25-NEXT: [[N_ADDR:%.*]] = alloca ptr, align 8
2653 // CHECK25-NEXT: [[VLA_ADDR:%.*]] = alloca i64, align 8
2654 // CHECK25-NEXT: [[A_ADDR:%.*]] = alloca ptr, align 8
2655 // CHECK25-NEXT: [[DOTOMP_IV:%.*]] = alloca i32, align 4
2656 // CHECK25-NEXT: [[TMP:%.*]] = alloca i32, align 4
2657 // CHECK25-NEXT: [[DOTCAPTURE_EXPR_:%.*]] = alloca i32, align 4
2658 // CHECK25-NEXT: [[DOTCAPTURE_EXPR_1:%.*]] = alloca i32, align 4
2659 // CHECK25-NEXT: [[I:%.*]] = alloca i32, align 4
2660 // CHECK25-NEXT: [[DOTOMP_LB:%.*]] = alloca i32, align 4
2661 // CHECK25-NEXT: [[DOTOMP_UB:%.*]] = alloca i32, align 4
2662 // CHECK25-NEXT: [[DOTOMP_STRIDE:%.*]] = alloca i32, align 4
2663 // CHECK25-NEXT: [[DOTOMP_IS_LAST:%.*]] = alloca i32, align 4
2664 // CHECK25-NEXT: [[I4:%.*]] = alloca i32, align 4
2665 // CHECK25-NEXT: store ptr [[DOTGLOBAL_TID_]], ptr [[DOTGLOBAL_TID__ADDR]], align 8
2666 // CHECK25-NEXT: store ptr [[DOTBOUND_TID_]], ptr [[DOTBOUND_TID__ADDR]], align 8
2667 // CHECK25-NEXT: store i64 [[DOTPREVIOUS_LB_]], ptr [[DOTPREVIOUS_LB__ADDR]], align 8
2668 // CHECK25-NEXT: store i64 [[DOTPREVIOUS_UB_]], ptr [[DOTPREVIOUS_UB__ADDR]], align 8
2669 // CHECK25-NEXT: store ptr [[N]], ptr [[N_ADDR]], align 8
2670 // CHECK25-NEXT: store i64 [[VLA]], ptr [[VLA_ADDR]], align 8
2671 // CHECK25-NEXT: store ptr [[A]], ptr [[A_ADDR]], align 8
2672 // CHECK25-NEXT: [[TMP0:%.*]] = load ptr, ptr [[N_ADDR]], align 8
2673 // CHECK25-NEXT: [[TMP1:%.*]] = load i64, ptr [[VLA_ADDR]], align 8
2674 // CHECK25-NEXT: [[TMP2:%.*]] = load ptr, ptr [[A_ADDR]], align 8
2675 // CHECK25-NEXT: [[TMP3:%.*]] = load i32, ptr [[TMP0]], align 4
2676 // CHECK25-NEXT: store i32 [[TMP3]], ptr [[DOTCAPTURE_EXPR_]], align 4
2677 // CHECK25-NEXT: [[TMP4:%.*]] = load i32, ptr [[DOTCAPTURE_EXPR_]], align 4
2678 // CHECK25-NEXT: [[SUB:%.*]] = sub nsw i32 [[TMP4]], 0
2679 // CHECK25-NEXT: [[DIV:%.*]] = sdiv i32 [[SUB]], 1
2680 // CHECK25-NEXT: [[SUB2:%.*]] = sub nsw i32 [[DIV]], 1
2681 // CHECK25-NEXT: store i32 [[SUB2]], ptr [[DOTCAPTURE_EXPR_1]], align 4
2682 // CHECK25-NEXT: store i32 0, ptr [[I]], align 4
2683 // CHECK25-NEXT: [[TMP5:%.*]] = load i32, ptr [[DOTCAPTURE_EXPR_]], align 4
2684 // CHECK25-NEXT: [[CMP:%.*]] = icmp slt i32 0, [[TMP5]]
2685 // CHECK25-NEXT: br i1 [[CMP]], label [[OMP_PRECOND_THEN:%.*]], label [[OMP_PRECOND_END:%.*]]
2686 // CHECK25: omp.precond.then:
2687 // CHECK25-NEXT: store i32 0, ptr [[DOTOMP_LB]], align 4
2688 // CHECK25-NEXT: [[TMP6:%.*]] = load i32, ptr [[DOTCAPTURE_EXPR_1]], align 4
2689 // CHECK25-NEXT: store i32 [[TMP6]], ptr [[DOTOMP_UB]], align 4
2690 // CHECK25-NEXT: [[TMP7:%.*]] = load i64, ptr [[DOTPREVIOUS_LB__ADDR]], align 8
2691 // CHECK25-NEXT: [[CONV:%.*]] = trunc i64 [[TMP7]] to i32
2692 // CHECK25-NEXT: [[TMP8:%.*]] = load i64, ptr [[DOTPREVIOUS_UB__ADDR]], align 8
2693 // CHECK25-NEXT: [[CONV3:%.*]] = trunc i64 [[TMP8]] to i32
2694 // CHECK25-NEXT: store i32 [[CONV]], ptr [[DOTOMP_LB]], align 4
2695 // CHECK25-NEXT: store i32 [[CONV3]], ptr [[DOTOMP_UB]], align 4
2696 // CHECK25-NEXT: store i32 1, ptr [[DOTOMP_STRIDE]], align 4
2697 // CHECK25-NEXT: store i32 0, ptr [[DOTOMP_IS_LAST]], align 4
2698 // CHECK25-NEXT: [[TMP9:%.*]] = load ptr, ptr [[DOTGLOBAL_TID__ADDR]], align 8
2699 // CHECK25-NEXT: [[TMP10:%.*]] = load i32, ptr [[TMP9]], align 4
2700 // CHECK25-NEXT: call void @__kmpc_for_static_init_4(ptr @[[GLOB2]], i32 [[TMP10]], i32 34, ptr [[DOTOMP_IS_LAST]], ptr [[DOTOMP_LB]], ptr [[DOTOMP_UB]], ptr [[DOTOMP_STRIDE]], i32 1, i32 1)
2701 // CHECK25-NEXT: [[TMP11:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4
2702 // CHECK25-NEXT: [[TMP12:%.*]] = load i32, ptr [[DOTCAPTURE_EXPR_1]], align 4
2703 // CHECK25-NEXT: [[CMP5:%.*]] = icmp sgt i32 [[TMP11]], [[TMP12]]
2704 // CHECK25-NEXT: br i1 [[CMP5]], label [[COND_TRUE:%.*]], label [[COND_FALSE:%.*]]
2705 // CHECK25: cond.true:
2706 // CHECK25-NEXT: [[TMP13:%.*]] = load i32, ptr [[DOTCAPTURE_EXPR_1]], align 4
2707 // CHECK25-NEXT: br label [[COND_END:%.*]]
2708 // CHECK25: cond.false:
2709 // CHECK25-NEXT: [[TMP14:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4
2710 // CHECK25-NEXT: br label [[COND_END]]
2711 // CHECK25: cond.end:
2712 // CHECK25-NEXT: [[COND:%.*]] = phi i32 [ [[TMP13]], [[COND_TRUE]] ], [ [[TMP14]], [[COND_FALSE]] ]
2713 // CHECK25-NEXT: store i32 [[COND]], ptr [[DOTOMP_UB]], align 4
2714 // CHECK25-NEXT: [[TMP15:%.*]] = load i32, ptr [[DOTOMP_LB]], align 4
2715 // CHECK25-NEXT: store i32 [[TMP15]], ptr [[DOTOMP_IV]], align 4
2716 // CHECK25-NEXT: br label [[OMP_INNER_FOR_COND:%.*]]
2717 // CHECK25: omp.inner.for.cond:
2718 // CHECK25-NEXT: [[TMP16:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4
2719 // CHECK25-NEXT: [[TMP17:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4
2720 // CHECK25-NEXT: [[CMP6:%.*]] = icmp sle i32 [[TMP16]], [[TMP17]]
2721 // CHECK25-NEXT: br i1 [[CMP6]], label [[OMP_INNER_FOR_BODY:%.*]], label [[OMP_INNER_FOR_END:%.*]]
2722 // CHECK25: omp.inner.for.body:
2723 // CHECK25-NEXT: [[TMP18:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4
2724 // CHECK25-NEXT: [[MUL:%.*]] = mul nsw i32 [[TMP18]], 1
2725 // CHECK25-NEXT: [[ADD:%.*]] = add nsw i32 0, [[MUL]]
2726 // CHECK25-NEXT: store i32 [[ADD]], ptr [[I4]], align 4
2727 // CHECK25-NEXT: [[TMP19:%.*]] = load i32, ptr [[I4]], align 4
2728 // CHECK25-NEXT: [[IDXPROM:%.*]] = sext i32 [[TMP19]] to i64
2729 // CHECK25-NEXT: [[ARRAYIDX:%.*]] = getelementptr inbounds i32, ptr [[TMP2]], i64 [[IDXPROM]]
2730 // CHECK25-NEXT: store i32 0, ptr [[ARRAYIDX]], align 4
2731 // CHECK25-NEXT: br label [[OMP_BODY_CONTINUE:%.*]]
2732 // CHECK25: omp.body.continue:
2733 // CHECK25-NEXT: br label [[OMP_INNER_FOR_INC:%.*]]
2734 // CHECK25: omp.inner.for.inc:
2735 // CHECK25-NEXT: [[TMP20:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4
2736 // CHECK25-NEXT: [[ADD7:%.*]] = add nsw i32 [[TMP20]], 1
2737 // CHECK25-NEXT: store i32 [[ADD7]], ptr [[DOTOMP_IV]], align 4
2738 // CHECK25-NEXT: br label [[OMP_INNER_FOR_COND]]
2739 // CHECK25: omp.inner.for.end:
2740 // CHECK25-NEXT: br label [[OMP_LOOP_EXIT:%.*]]
2741 // CHECK25: omp.loop.exit:
2742 // CHECK25-NEXT: [[TMP21:%.*]] = load ptr, ptr [[DOTGLOBAL_TID__ADDR]], align 8
2743 // CHECK25-NEXT: [[TMP22:%.*]] = load i32, ptr [[TMP21]], align 4
2744 // CHECK25-NEXT: call void @__kmpc_for_static_fini(ptr @[[GLOB2]], i32 [[TMP22]])
2745 // CHECK25-NEXT: br label [[OMP_PRECOND_END]]
2746 // CHECK25: omp.precond.end:
2747 // CHECK25-NEXT: ret void
2750 // CHECK25-LABEL: define {{[^@]+}}@_Z5tmainIiLi10EEiT_
2751 // CHECK25-SAME: (i32 noundef signext [[ARGC:%.*]]) #[[ATTR6:[0-9]+]] comdat {
2752 // CHECK25-NEXT: entry:
2753 // CHECK25-NEXT: [[ARGC_ADDR:%.*]] = alloca i32, align 4
2754 // CHECK25-NEXT: [[A:%.*]] = alloca [10 x i32], align 4
2755 // CHECK25-NEXT: [[TE:%.*]] = alloca i32, align 4
2756 // CHECK25-NEXT: [[TH:%.*]] = alloca i32, align 4
2757 // CHECK25-NEXT: [[TE_CASTED:%.*]] = alloca i64, align 8
2758 // CHECK25-NEXT: [[TH_CASTED:%.*]] = alloca i64, align 8
2759 // CHECK25-NEXT: [[DOTOFFLOAD_BASEPTRS:%.*]] = alloca [3 x ptr], align 8
2760 // CHECK25-NEXT: [[DOTOFFLOAD_PTRS:%.*]] = alloca [3 x ptr], align 8
2761 // CHECK25-NEXT: [[DOTOFFLOAD_MAPPERS:%.*]] = alloca [3 x ptr], align 8
2762 // CHECK25-NEXT: [[TMP:%.*]] = alloca i32, align 4
2763 // CHECK25-NEXT: [[KERNEL_ARGS:%.*]] = alloca [[STRUCT___TGT_KERNEL_ARGUMENTS:%.*]], align 8
2764 // CHECK25-NEXT: store i32 [[ARGC]], ptr [[ARGC_ADDR]], align 4
2765 // CHECK25-NEXT: store i32 0, ptr [[TE]], align 4
2766 // CHECK25-NEXT: store i32 128, ptr [[TH]], align 4
2767 // CHECK25-NEXT: [[TMP0:%.*]] = load i32, ptr [[TE]], align 4
2768 // CHECK25-NEXT: store i32 [[TMP0]], ptr [[TE_CASTED]], align 4
2769 // CHECK25-NEXT: [[TMP1:%.*]] = load i64, ptr [[TE_CASTED]], align 8
2770 // CHECK25-NEXT: [[TMP2:%.*]] = load i32, ptr [[TH]], align 4
2771 // CHECK25-NEXT: store i32 [[TMP2]], ptr [[TH_CASTED]], align 4
2772 // CHECK25-NEXT: [[TMP3:%.*]] = load i64, ptr [[TH_CASTED]], align 8
2773 // CHECK25-NEXT: [[TMP4:%.*]] = getelementptr inbounds [3 x ptr], ptr [[DOTOFFLOAD_BASEPTRS]], i32 0, i32 0
2774 // CHECK25-NEXT: store i64 [[TMP1]], ptr [[TMP4]], align 8
2775 // CHECK25-NEXT: [[TMP5:%.*]] = getelementptr inbounds [3 x ptr], ptr [[DOTOFFLOAD_PTRS]], i32 0, i32 0
2776 // CHECK25-NEXT: store i64 [[TMP1]], ptr [[TMP5]], align 8
2777 // CHECK25-NEXT: [[TMP6:%.*]] = getelementptr inbounds [3 x ptr], ptr [[DOTOFFLOAD_MAPPERS]], i64 0, i64 0
2778 // CHECK25-NEXT: store ptr null, ptr [[TMP6]], align 8
2779 // CHECK25-NEXT: [[TMP7:%.*]] = getelementptr inbounds [3 x ptr], ptr [[DOTOFFLOAD_BASEPTRS]], i32 0, i32 1
2780 // CHECK25-NEXT: store i64 [[TMP3]], ptr [[TMP7]], align 8
2781 // CHECK25-NEXT: [[TMP8:%.*]] = getelementptr inbounds [3 x ptr], ptr [[DOTOFFLOAD_PTRS]], i32 0, i32 1
2782 // CHECK25-NEXT: store i64 [[TMP3]], ptr [[TMP8]], align 8
2783 // CHECK25-NEXT: [[TMP9:%.*]] = getelementptr inbounds [3 x ptr], ptr [[DOTOFFLOAD_MAPPERS]], i64 0, i64 1
2784 // CHECK25-NEXT: store ptr null, ptr [[TMP9]], align 8
2785 // CHECK25-NEXT: [[TMP10:%.*]] = getelementptr inbounds [3 x ptr], ptr [[DOTOFFLOAD_BASEPTRS]], i32 0, i32 2
2786 // CHECK25-NEXT: store ptr [[A]], ptr [[TMP10]], align 8
2787 // CHECK25-NEXT: [[TMP11:%.*]] = getelementptr inbounds [3 x ptr], ptr [[DOTOFFLOAD_PTRS]], i32 0, i32 2
2788 // CHECK25-NEXT: store ptr [[A]], ptr [[TMP11]], align 8
2789 // CHECK25-NEXT: [[TMP12:%.*]] = getelementptr inbounds [3 x ptr], ptr [[DOTOFFLOAD_MAPPERS]], i64 0, i64 2
2790 // CHECK25-NEXT: store ptr null, ptr [[TMP12]], align 8
2791 // CHECK25-NEXT: [[TMP13:%.*]] = getelementptr inbounds [3 x ptr], ptr [[DOTOFFLOAD_BASEPTRS]], i32 0, i32 0
2792 // CHECK25-NEXT: [[TMP14:%.*]] = getelementptr inbounds [3 x ptr], ptr [[DOTOFFLOAD_PTRS]], i32 0, i32 0
2793 // CHECK25-NEXT: [[TMP15:%.*]] = load i32, ptr [[TE]], align 4
2794 // CHECK25-NEXT: [[TMP16:%.*]] = load i32, ptr [[TH]], align 4
2795 // CHECK25-NEXT: [[TMP17:%.*]] = insertvalue [3 x i32] zeroinitializer, i32 [[TMP15]], 0
2796 // CHECK25-NEXT: [[TMP18:%.*]] = insertvalue [3 x i32] zeroinitializer, i32 [[TMP16]], 0
2797 // CHECK25-NEXT: [[TMP19:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 0
2798 // CHECK25-NEXT: store i32 2, ptr [[TMP19]], align 4
2799 // CHECK25-NEXT: [[TMP20:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 1
2800 // CHECK25-NEXT: store i32 3, ptr [[TMP20]], align 4
2801 // CHECK25-NEXT: [[TMP21:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 2
2802 // CHECK25-NEXT: store ptr [[TMP13]], ptr [[TMP21]], align 8
2803 // CHECK25-NEXT: [[TMP22:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 3
2804 // CHECK25-NEXT: store ptr [[TMP14]], ptr [[TMP22]], align 8
2805 // CHECK25-NEXT: [[TMP23:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 4
2806 // CHECK25-NEXT: store ptr @.offload_sizes.1, ptr [[TMP23]], align 8
2807 // CHECK25-NEXT: [[TMP24:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 5
2808 // CHECK25-NEXT: store ptr @.offload_maptypes.2, ptr [[TMP24]], align 8
2809 // CHECK25-NEXT: [[TMP25:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 6
2810 // CHECK25-NEXT: store ptr null, ptr [[TMP25]], align 8
2811 // CHECK25-NEXT: [[TMP26:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 7
2812 // CHECK25-NEXT: store ptr null, ptr [[TMP26]], align 8
2813 // CHECK25-NEXT: [[TMP27:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 8
2814 // CHECK25-NEXT: store i64 10, ptr [[TMP27]], align 8
2815 // CHECK25-NEXT: [[TMP28:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 9
2816 // CHECK25-NEXT: store i64 0, ptr [[TMP28]], align 8
2817 // CHECK25-NEXT: [[TMP29:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 10
2818 // CHECK25-NEXT: store [3 x i32] [[TMP17]], ptr [[TMP29]], align 4
2819 // CHECK25-NEXT: [[TMP30:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 11
2820 // CHECK25-NEXT: store [3 x i32] [[TMP18]], ptr [[TMP30]], align 4
2821 // CHECK25-NEXT: [[TMP31:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 12
2822 // CHECK25-NEXT: store i32 0, ptr [[TMP31]], align 4
2823 // CHECK25-NEXT: [[TMP32:%.*]] = call i32 @__tgt_target_kernel(ptr @[[GLOB3]], i64 -1, i32 [[TMP15]], i32 [[TMP16]], ptr @.{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z5tmainIiLi10EEiT__l150.region_id, ptr [[KERNEL_ARGS]])
2824 // CHECK25-NEXT: [[TMP33:%.*]] = icmp ne i32 [[TMP32]], 0
2825 // CHECK25-NEXT: br i1 [[TMP33]], label [[OMP_OFFLOAD_FAILED:%.*]], label [[OMP_OFFLOAD_CONT:%.*]]
2826 // CHECK25: omp_offload.failed:
2827 // CHECK25-NEXT: call void @{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z5tmainIiLi10EEiT__l150(i64 [[TMP1]], i64 [[TMP3]], ptr [[A]]) #[[ATTR4]]
2828 // CHECK25-NEXT: br label [[OMP_OFFLOAD_CONT]]
2829 // CHECK25: omp_offload.cont:
2830 // CHECK25-NEXT: ret i32 0
2833 // CHECK25-LABEL: define {{[^@]+}}@{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z5tmainIiLi10EEiT__l150
2834 // CHECK25-SAME: (i64 noundef [[TE:%.*]], i64 noundef [[TH:%.*]], ptr noundef nonnull align 4 dereferenceable(40) [[A:%.*]]) #[[ATTR3]] {
2835 // CHECK25-NEXT: entry:
2836 // CHECK25-NEXT: [[TE_ADDR:%.*]] = alloca i64, align 8
2837 // CHECK25-NEXT: [[TH_ADDR:%.*]] = alloca i64, align 8
2838 // CHECK25-NEXT: [[A_ADDR:%.*]] = alloca ptr, align 8
2839 // CHECK25-NEXT: [[TMP0:%.*]] = call i32 @__kmpc_global_thread_num(ptr @[[GLOB3]])
2840 // CHECK25-NEXT: store i64 [[TE]], ptr [[TE_ADDR]], align 8
2841 // CHECK25-NEXT: store i64 [[TH]], ptr [[TH_ADDR]], align 8
2842 // CHECK25-NEXT: store ptr [[A]], ptr [[A_ADDR]], align 8
2843 // CHECK25-NEXT: [[TMP1:%.*]] = load ptr, ptr [[A_ADDR]], align 8
2844 // CHECK25-NEXT: [[TMP2:%.*]] = load i32, ptr [[TE_ADDR]], align 4
2845 // CHECK25-NEXT: [[TMP3:%.*]] = load i32, ptr [[TH_ADDR]], align 4
2846 // CHECK25-NEXT: call void @__kmpc_push_num_teams(ptr @[[GLOB3]], i32 [[TMP0]], i32 [[TMP2]], i32 [[TMP3]])
2847 // CHECK25-NEXT: call void (ptr, i32, ptr, ...) @__kmpc_fork_teams(ptr @[[GLOB3]], i32 1, ptr @{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z5tmainIiLi10EEiT__l150.omp_outlined, ptr [[TMP1]])
2848 // CHECK25-NEXT: ret void
2851 // CHECK25-LABEL: define {{[^@]+}}@{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z5tmainIiLi10EEiT__l150.omp_outlined
2852 // CHECK25-SAME: (ptr noalias noundef [[DOTGLOBAL_TID_:%.*]], ptr noalias noundef [[DOTBOUND_TID_:%.*]], ptr noundef nonnull align 4 dereferenceable(40) [[A:%.*]]) #[[ATTR3]] {
2853 // CHECK25-NEXT: entry:
2854 // CHECK25-NEXT: [[DOTGLOBAL_TID__ADDR:%.*]] = alloca ptr, align 8
2855 // CHECK25-NEXT: [[DOTBOUND_TID__ADDR:%.*]] = alloca ptr, align 8
2856 // CHECK25-NEXT: [[A_ADDR:%.*]] = alloca ptr, align 8
2857 // CHECK25-NEXT: [[DOTOMP_IV:%.*]] = alloca i32, align 4
2858 // CHECK25-NEXT: [[TMP:%.*]] = alloca i32, align 4
2859 // CHECK25-NEXT: [[DOTOMP_COMB_LB:%.*]] = alloca i32, align 4
2860 // CHECK25-NEXT: [[DOTOMP_COMB_UB:%.*]] = alloca i32, align 4
2861 // CHECK25-NEXT: [[DOTOMP_STRIDE:%.*]] = alloca i32, align 4
2862 // CHECK25-NEXT: [[DOTOMP_IS_LAST:%.*]] = alloca i32, align 4
2863 // CHECK25-NEXT: [[I:%.*]] = alloca i32, align 4
2864 // CHECK25-NEXT: store ptr [[DOTGLOBAL_TID_]], ptr [[DOTGLOBAL_TID__ADDR]], align 8
2865 // CHECK25-NEXT: store ptr [[DOTBOUND_TID_]], ptr [[DOTBOUND_TID__ADDR]], align 8
2866 // CHECK25-NEXT: store ptr [[A]], ptr [[A_ADDR]], align 8
2867 // CHECK25-NEXT: [[TMP0:%.*]] = load ptr, ptr [[A_ADDR]], align 8
2868 // CHECK25-NEXT: store i32 0, ptr [[DOTOMP_COMB_LB]], align 4
2869 // CHECK25-NEXT: store i32 9, ptr [[DOTOMP_COMB_UB]], align 4
2870 // CHECK25-NEXT: store i32 1, ptr [[DOTOMP_STRIDE]], align 4
2871 // CHECK25-NEXT: store i32 0, ptr [[DOTOMP_IS_LAST]], align 4
2872 // CHECK25-NEXT: [[TMP1:%.*]] = load ptr, ptr [[DOTGLOBAL_TID__ADDR]], align 8
2873 // CHECK25-NEXT: [[TMP2:%.*]] = load i32, ptr [[TMP1]], align 4
2874 // CHECK25-NEXT: call void @__kmpc_for_static_init_4(ptr @[[GLOB1]], i32 [[TMP2]], i32 92, ptr [[DOTOMP_IS_LAST]], ptr [[DOTOMP_COMB_LB]], ptr [[DOTOMP_COMB_UB]], ptr [[DOTOMP_STRIDE]], i32 1, i32 1)
2875 // CHECK25-NEXT: [[TMP3:%.*]] = load i32, ptr [[DOTOMP_COMB_UB]], align 4
2876 // CHECK25-NEXT: [[CMP:%.*]] = icmp sgt i32 [[TMP3]], 9
2877 // CHECK25-NEXT: br i1 [[CMP]], label [[COND_TRUE:%.*]], label [[COND_FALSE:%.*]]
2878 // CHECK25: cond.true:
2879 // CHECK25-NEXT: br label [[COND_END:%.*]]
2880 // CHECK25: cond.false:
2881 // CHECK25-NEXT: [[TMP4:%.*]] = load i32, ptr [[DOTOMP_COMB_UB]], align 4
2882 // CHECK25-NEXT: br label [[COND_END]]
2883 // CHECK25: cond.end:
2884 // CHECK25-NEXT: [[COND:%.*]] = phi i32 [ 9, [[COND_TRUE]] ], [ [[TMP4]], [[COND_FALSE]] ]
2885 // CHECK25-NEXT: store i32 [[COND]], ptr [[DOTOMP_COMB_UB]], align 4
2886 // CHECK25-NEXT: [[TMP5:%.*]] = load i32, ptr [[DOTOMP_COMB_LB]], align 4
2887 // CHECK25-NEXT: store i32 [[TMP5]], ptr [[DOTOMP_IV]], align 4
2888 // CHECK25-NEXT: br label [[OMP_INNER_FOR_COND:%.*]]
2889 // CHECK25: omp.inner.for.cond:
2890 // CHECK25-NEXT: [[TMP6:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4
2891 // CHECK25-NEXT: [[TMP7:%.*]] = load i32, ptr [[DOTOMP_COMB_UB]], align 4
2892 // CHECK25-NEXT: [[CMP1:%.*]] = icmp sle i32 [[TMP6]], [[TMP7]]
2893 // CHECK25-NEXT: br i1 [[CMP1]], label [[OMP_INNER_FOR_BODY:%.*]], label [[OMP_INNER_FOR_END:%.*]]
2894 // CHECK25: omp.inner.for.body:
2895 // CHECK25-NEXT: [[TMP8:%.*]] = load i32, ptr [[DOTOMP_COMB_LB]], align 4
2896 // CHECK25-NEXT: [[TMP9:%.*]] = zext i32 [[TMP8]] to i64
2897 // CHECK25-NEXT: [[TMP10:%.*]] = load i32, ptr [[DOTOMP_COMB_UB]], align 4
2898 // CHECK25-NEXT: [[TMP11:%.*]] = zext i32 [[TMP10]] to i64
2899 // CHECK25-NEXT: call void (ptr, i32, ptr, ...) @__kmpc_fork_call(ptr @[[GLOB3]], i32 3, ptr @{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z5tmainIiLi10EEiT__l150.omp_outlined.omp_outlined, i64 [[TMP9]], i64 [[TMP11]], ptr [[TMP0]])
2900 // CHECK25-NEXT: br label [[OMP_INNER_FOR_INC:%.*]]
2901 // CHECK25: omp.inner.for.inc:
2902 // CHECK25-NEXT: [[TMP12:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4
2903 // CHECK25-NEXT: [[TMP13:%.*]] = load i32, ptr [[DOTOMP_STRIDE]], align 4
2904 // CHECK25-NEXT: [[ADD:%.*]] = add nsw i32 [[TMP12]], [[TMP13]]
2905 // CHECK25-NEXT: store i32 [[ADD]], ptr [[DOTOMP_IV]], align 4
2906 // CHECK25-NEXT: br label [[OMP_INNER_FOR_COND]]
2907 // CHECK25: omp.inner.for.end:
2908 // CHECK25-NEXT: br label [[OMP_LOOP_EXIT:%.*]]
2909 // CHECK25: omp.loop.exit:
2910 // CHECK25-NEXT: call void @__kmpc_for_static_fini(ptr @[[GLOB2]], i32 [[TMP2]])
2911 // CHECK25-NEXT: ret void
2914 // CHECK25-LABEL: define {{[^@]+}}@{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z5tmainIiLi10EEiT__l150.omp_outlined.omp_outlined
2915 // CHECK25-SAME: (ptr noalias noundef [[DOTGLOBAL_TID_:%.*]], ptr noalias noundef [[DOTBOUND_TID_:%.*]], i64 noundef [[DOTPREVIOUS_LB_:%.*]], i64 noundef [[DOTPREVIOUS_UB_:%.*]], ptr noundef nonnull align 4 dereferenceable(40) [[A:%.*]]) #[[ATTR3]] {
2916 // CHECK25-NEXT: entry:
2917 // CHECK25-NEXT: [[DOTGLOBAL_TID__ADDR:%.*]] = alloca ptr, align 8
2918 // CHECK25-NEXT: [[DOTBOUND_TID__ADDR:%.*]] = alloca ptr, align 8
2919 // CHECK25-NEXT: [[DOTPREVIOUS_LB__ADDR:%.*]] = alloca i64, align 8
2920 // CHECK25-NEXT: [[DOTPREVIOUS_UB__ADDR:%.*]] = alloca i64, align 8
2921 // CHECK25-NEXT: [[A_ADDR:%.*]] = alloca ptr, align 8
2922 // CHECK25-NEXT: [[DOTOMP_IV:%.*]] = alloca i32, align 4
2923 // CHECK25-NEXT: [[TMP:%.*]] = alloca i32, align 4
2924 // CHECK25-NEXT: [[DOTOMP_LB:%.*]] = alloca i32, align 4
2925 // CHECK25-NEXT: [[DOTOMP_UB:%.*]] = alloca i32, align 4
2926 // CHECK25-NEXT: [[DOTOMP_STRIDE:%.*]] = alloca i32, align 4
2927 // CHECK25-NEXT: [[DOTOMP_IS_LAST:%.*]] = alloca i32, align 4
2928 // CHECK25-NEXT: [[I:%.*]] = alloca i32, align 4
2929 // CHECK25-NEXT: store ptr [[DOTGLOBAL_TID_]], ptr [[DOTGLOBAL_TID__ADDR]], align 8
2930 // CHECK25-NEXT: store ptr [[DOTBOUND_TID_]], ptr [[DOTBOUND_TID__ADDR]], align 8
2931 // CHECK25-NEXT: store i64 [[DOTPREVIOUS_LB_]], ptr [[DOTPREVIOUS_LB__ADDR]], align 8
2932 // CHECK25-NEXT: store i64 [[DOTPREVIOUS_UB_]], ptr [[DOTPREVIOUS_UB__ADDR]], align 8
2933 // CHECK25-NEXT: store ptr [[A]], ptr [[A_ADDR]], align 8
2934 // CHECK25-NEXT: [[TMP0:%.*]] = load ptr, ptr [[A_ADDR]], align 8
2935 // CHECK25-NEXT: store i32 0, ptr [[DOTOMP_LB]], align 4
2936 // CHECK25-NEXT: store i32 9, ptr [[DOTOMP_UB]], align 4
2937 // CHECK25-NEXT: [[TMP1:%.*]] = load i64, ptr [[DOTPREVIOUS_LB__ADDR]], align 8
2938 // CHECK25-NEXT: [[CONV:%.*]] = trunc i64 [[TMP1]] to i32
2939 // CHECK25-NEXT: [[TMP2:%.*]] = load i64, ptr [[DOTPREVIOUS_UB__ADDR]], align 8
2940 // CHECK25-NEXT: [[CONV1:%.*]] = trunc i64 [[TMP2]] to i32
2941 // CHECK25-NEXT: store i32 [[CONV]], ptr [[DOTOMP_LB]], align 4
2942 // CHECK25-NEXT: store i32 [[CONV1]], ptr [[DOTOMP_UB]], align 4
2943 // CHECK25-NEXT: store i32 1, ptr [[DOTOMP_STRIDE]], align 4
2944 // CHECK25-NEXT: store i32 0, ptr [[DOTOMP_IS_LAST]], align 4
2945 // CHECK25-NEXT: [[TMP3:%.*]] = load ptr, ptr [[DOTGLOBAL_TID__ADDR]], align 8
2946 // CHECK25-NEXT: [[TMP4:%.*]] = load i32, ptr [[TMP3]], align 4
2947 // CHECK25-NEXT: call void @__kmpc_for_static_init_4(ptr @[[GLOB2]], i32 [[TMP4]], i32 34, ptr [[DOTOMP_IS_LAST]], ptr [[DOTOMP_LB]], ptr [[DOTOMP_UB]], ptr [[DOTOMP_STRIDE]], i32 1, i32 1)
2948 // CHECK25-NEXT: [[TMP5:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4
2949 // CHECK25-NEXT: [[CMP:%.*]] = icmp sgt i32 [[TMP5]], 9
2950 // CHECK25-NEXT: br i1 [[CMP]], label [[COND_TRUE:%.*]], label [[COND_FALSE:%.*]]
2951 // CHECK25: cond.true:
2952 // CHECK25-NEXT: br label [[COND_END:%.*]]
2953 // CHECK25: cond.false:
2954 // CHECK25-NEXT: [[TMP6:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4
2955 // CHECK25-NEXT: br label [[COND_END]]
2956 // CHECK25: cond.end:
2957 // CHECK25-NEXT: [[COND:%.*]] = phi i32 [ 9, [[COND_TRUE]] ], [ [[TMP6]], [[COND_FALSE]] ]
2958 // CHECK25-NEXT: store i32 [[COND]], ptr [[DOTOMP_UB]], align 4
2959 // CHECK25-NEXT: [[TMP7:%.*]] = load i32, ptr [[DOTOMP_LB]], align 4
2960 // CHECK25-NEXT: store i32 [[TMP7]], ptr [[DOTOMP_IV]], align 4
2961 // CHECK25-NEXT: br label [[OMP_INNER_FOR_COND:%.*]]
2962 // CHECK25: omp.inner.for.cond:
2963 // CHECK25-NEXT: [[TMP8:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4
2964 // CHECK25-NEXT: [[TMP9:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4
2965 // CHECK25-NEXT: [[CMP2:%.*]] = icmp sle i32 [[TMP8]], [[TMP9]]
2966 // CHECK25-NEXT: br i1 [[CMP2]], label [[OMP_INNER_FOR_BODY:%.*]], label [[OMP_INNER_FOR_END:%.*]]
2967 // CHECK25: omp.inner.for.body:
2968 // CHECK25-NEXT: [[TMP10:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4
2969 // CHECK25-NEXT: [[MUL:%.*]] = mul nsw i32 [[TMP10]], 1
2970 // CHECK25-NEXT: [[ADD:%.*]] = add nsw i32 0, [[MUL]]
2971 // CHECK25-NEXT: store i32 [[ADD]], ptr [[I]], align 4
2972 // CHECK25-NEXT: [[TMP11:%.*]] = load i32, ptr [[I]], align 4
2973 // CHECK25-NEXT: [[IDXPROM:%.*]] = sext i32 [[TMP11]] to i64
2974 // CHECK25-NEXT: [[ARRAYIDX:%.*]] = getelementptr inbounds [10 x i32], ptr [[TMP0]], i64 0, i64 [[IDXPROM]]
2975 // CHECK25-NEXT: store i32 0, ptr [[ARRAYIDX]], align 4
2976 // CHECK25-NEXT: br label [[OMP_BODY_CONTINUE:%.*]]
2977 // CHECK25: omp.body.continue:
2978 // CHECK25-NEXT: br label [[OMP_INNER_FOR_INC:%.*]]
2979 // CHECK25: omp.inner.for.inc:
2980 // CHECK25-NEXT: [[TMP12:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4
2981 // CHECK25-NEXT: [[ADD3:%.*]] = add nsw i32 [[TMP12]], 1
2982 // CHECK25-NEXT: store i32 [[ADD3]], ptr [[DOTOMP_IV]], align 4
2983 // CHECK25-NEXT: br label [[OMP_INNER_FOR_COND]]
2984 // CHECK25: omp.inner.for.end:
2985 // CHECK25-NEXT: br label [[OMP_LOOP_EXIT:%.*]]
2986 // CHECK25: omp.loop.exit:
2987 // CHECK25-NEXT: call void @__kmpc_for_static_fini(ptr @[[GLOB2]], i32 [[TMP4]])
2988 // CHECK25-NEXT: ret void
2991 // CHECK25-LABEL: define {{[^@]+}}@.omp_offloading.requires_reg
2992 // CHECK25-SAME: () #[[ATTR7:[0-9]+]] {
2993 // CHECK25-NEXT: entry:
2994 // CHECK25-NEXT: call void @__tgt_register_requires(i64 1)
2995 // CHECK25-NEXT: ret void
2998 // CHECK27-LABEL: define {{[^@]+}}@main
2999 // CHECK27-SAME: (i32 noundef [[ARGC:%.*]], ptr noundef [[ARGV:%.*]]) #[[ATTR0:[0-9]+]] {
3000 // CHECK27-NEXT: entry:
3001 // CHECK27-NEXT: [[RETVAL:%.*]] = alloca i32, align 4
3002 // CHECK27-NEXT: [[ARGC_ADDR:%.*]] = alloca i32, align 4
3003 // CHECK27-NEXT: [[ARGV_ADDR:%.*]] = alloca ptr, align 4
3004 // CHECK27-NEXT: [[N:%.*]] = alloca i32, align 4
3005 // CHECK27-NEXT: [[SAVED_STACK:%.*]] = alloca ptr, align 4
3006 // CHECK27-NEXT: [[__VLA_EXPR0:%.*]] = alloca i32, align 4
3007 // CHECK27-NEXT: [[N_CASTED:%.*]] = alloca i32, align 4
3008 // CHECK27-NEXT: [[DOTOFFLOAD_BASEPTRS:%.*]] = alloca [3 x ptr], align 4
3009 // CHECK27-NEXT: [[DOTOFFLOAD_PTRS:%.*]] = alloca [3 x ptr], align 4
3010 // CHECK27-NEXT: [[DOTOFFLOAD_MAPPERS:%.*]] = alloca [3 x ptr], align 4
3011 // CHECK27-NEXT: [[DOTOFFLOAD_SIZES:%.*]] = alloca [3 x i64], align 4
3012 // CHECK27-NEXT: [[TMP:%.*]] = alloca i32, align 4
3013 // CHECK27-NEXT: [[DOTCAPTURE_EXPR_:%.*]] = alloca i32, align 4
3014 // CHECK27-NEXT: [[DOTCAPTURE_EXPR_1:%.*]] = alloca i32, align 4
3015 // CHECK27-NEXT: [[KERNEL_ARGS:%.*]] = alloca [[STRUCT___TGT_KERNEL_ARGUMENTS:%.*]], align 8
3016 // CHECK27-NEXT: store i32 0, ptr [[RETVAL]], align 4
3017 // CHECK27-NEXT: store i32 [[ARGC]], ptr [[ARGC_ADDR]], align 4
3018 // CHECK27-NEXT: store ptr [[ARGV]], ptr [[ARGV_ADDR]], align 4
3019 // CHECK27-NEXT: store i32 100, ptr [[N]], align 4
3020 // CHECK27-NEXT: [[TMP0:%.*]] = load i32, ptr [[N]], align 4
3021 // CHECK27-NEXT: [[TMP1:%.*]] = call ptr @llvm.stacksave.p0()
3022 // CHECK27-NEXT: store ptr [[TMP1]], ptr [[SAVED_STACK]], align 4
3023 // CHECK27-NEXT: [[VLA:%.*]] = alloca i32, i32 [[TMP0]], align 4
3024 // CHECK27-NEXT: store i32 [[TMP0]], ptr [[__VLA_EXPR0]], align 4
3025 // CHECK27-NEXT: [[TMP2:%.*]] = load i32, ptr [[N]], align 4
3026 // CHECK27-NEXT: store i32 [[TMP2]], ptr [[N_CASTED]], align 4
3027 // CHECK27-NEXT: [[TMP3:%.*]] = load i32, ptr [[N_CASTED]], align 4
3028 // CHECK27-NEXT: [[TMP4:%.*]] = mul nuw i32 [[TMP0]], 4
3029 // CHECK27-NEXT: [[TMP5:%.*]] = sext i32 [[TMP4]] to i64
3030 // CHECK27-NEXT: call void @llvm.memcpy.p0.p0.i32(ptr align 4 [[DOTOFFLOAD_SIZES]], ptr align 4 @.offload_sizes, i32 24, i1 false)
3031 // CHECK27-NEXT: [[TMP6:%.*]] = getelementptr inbounds [3 x ptr], ptr [[DOTOFFLOAD_BASEPTRS]], i32 0, i32 0
3032 // CHECK27-NEXT: store i32 [[TMP3]], ptr [[TMP6]], align 4
3033 // CHECK27-NEXT: [[TMP7:%.*]] = getelementptr inbounds [3 x ptr], ptr [[DOTOFFLOAD_PTRS]], i32 0, i32 0
3034 // CHECK27-NEXT: store i32 [[TMP3]], ptr [[TMP7]], align 4
3035 // CHECK27-NEXT: [[TMP8:%.*]] = getelementptr inbounds [3 x ptr], ptr [[DOTOFFLOAD_MAPPERS]], i32 0, i32 0
3036 // CHECK27-NEXT: store ptr null, ptr [[TMP8]], align 4
3037 // CHECK27-NEXT: [[TMP9:%.*]] = getelementptr inbounds [3 x ptr], ptr [[DOTOFFLOAD_BASEPTRS]], i32 0, i32 1
3038 // CHECK27-NEXT: store i32 [[TMP0]], ptr [[TMP9]], align 4
3039 // CHECK27-NEXT: [[TMP10:%.*]] = getelementptr inbounds [3 x ptr], ptr [[DOTOFFLOAD_PTRS]], i32 0, i32 1
3040 // CHECK27-NEXT: store i32 [[TMP0]], ptr [[TMP10]], align 4
3041 // CHECK27-NEXT: [[TMP11:%.*]] = getelementptr inbounds [3 x ptr], ptr [[DOTOFFLOAD_MAPPERS]], i32 0, i32 1
3042 // CHECK27-NEXT: store ptr null, ptr [[TMP11]], align 4
3043 // CHECK27-NEXT: [[TMP12:%.*]] = getelementptr inbounds [3 x ptr], ptr [[DOTOFFLOAD_BASEPTRS]], i32 0, i32 2
3044 // CHECK27-NEXT: store ptr [[VLA]], ptr [[TMP12]], align 4
3045 // CHECK27-NEXT: [[TMP13:%.*]] = getelementptr inbounds [3 x ptr], ptr [[DOTOFFLOAD_PTRS]], i32 0, i32 2
3046 // CHECK27-NEXT: store ptr [[VLA]], ptr [[TMP13]], align 4
3047 // CHECK27-NEXT: [[TMP14:%.*]] = getelementptr inbounds [3 x i64], ptr [[DOTOFFLOAD_SIZES]], i32 0, i32 2
3048 // CHECK27-NEXT: store i64 [[TMP5]], ptr [[TMP14]], align 4
3049 // CHECK27-NEXT: [[TMP15:%.*]] = getelementptr inbounds [3 x ptr], ptr [[DOTOFFLOAD_MAPPERS]], i32 0, i32 2
3050 // CHECK27-NEXT: store ptr null, ptr [[TMP15]], align 4
3051 // CHECK27-NEXT: [[TMP16:%.*]] = getelementptr inbounds [3 x ptr], ptr [[DOTOFFLOAD_BASEPTRS]], i32 0, i32 0
3052 // CHECK27-NEXT: [[TMP17:%.*]] = getelementptr inbounds [3 x ptr], ptr [[DOTOFFLOAD_PTRS]], i32 0, i32 0
3053 // CHECK27-NEXT: [[TMP18:%.*]] = getelementptr inbounds [3 x i64], ptr [[DOTOFFLOAD_SIZES]], i32 0, i32 0
3054 // CHECK27-NEXT: [[TMP19:%.*]] = load i32, ptr [[N]], align 4
3055 // CHECK27-NEXT: store i32 [[TMP19]], ptr [[DOTCAPTURE_EXPR_]], align 4
3056 // CHECK27-NEXT: [[TMP20:%.*]] = load i32, ptr [[DOTCAPTURE_EXPR_]], align 4
3057 // CHECK27-NEXT: [[SUB:%.*]] = sub nsw i32 [[TMP20]], 0
3058 // CHECK27-NEXT: [[DIV:%.*]] = sdiv i32 [[SUB]], 1
3059 // CHECK27-NEXT: [[SUB2:%.*]] = sub nsw i32 [[DIV]], 1
3060 // CHECK27-NEXT: store i32 [[SUB2]], ptr [[DOTCAPTURE_EXPR_1]], align 4
3061 // CHECK27-NEXT: [[TMP21:%.*]] = load i32, ptr [[DOTCAPTURE_EXPR_1]], align 4
3062 // CHECK27-NEXT: [[ADD:%.*]] = add nsw i32 [[TMP21]], 1
3063 // CHECK27-NEXT: [[TMP22:%.*]] = zext i32 [[ADD]] to i64
3064 // CHECK27-NEXT: [[TMP23:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 0
3065 // CHECK27-NEXT: store i32 2, ptr [[TMP23]], align 4
3066 // CHECK27-NEXT: [[TMP24:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 1
3067 // CHECK27-NEXT: store i32 3, ptr [[TMP24]], align 4
3068 // CHECK27-NEXT: [[TMP25:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 2
3069 // CHECK27-NEXT: store ptr [[TMP16]], ptr [[TMP25]], align 4
3070 // CHECK27-NEXT: [[TMP26:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 3
3071 // CHECK27-NEXT: store ptr [[TMP17]], ptr [[TMP26]], align 4
3072 // CHECK27-NEXT: [[TMP27:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 4
3073 // CHECK27-NEXT: store ptr [[TMP18]], ptr [[TMP27]], align 4
3074 // CHECK27-NEXT: [[TMP28:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 5
3075 // CHECK27-NEXT: store ptr @.offload_maptypes, ptr [[TMP28]], align 4
3076 // CHECK27-NEXT: [[TMP29:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 6
3077 // CHECK27-NEXT: store ptr null, ptr [[TMP29]], align 4
3078 // CHECK27-NEXT: [[TMP30:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 7
3079 // CHECK27-NEXT: store ptr null, ptr [[TMP30]], align 4
3080 // CHECK27-NEXT: [[TMP31:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 8
3081 // CHECK27-NEXT: store i64 [[TMP22]], ptr [[TMP31]], align 8
3082 // CHECK27-NEXT: [[TMP32:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 9
3083 // CHECK27-NEXT: store i64 0, ptr [[TMP32]], align 8
3084 // CHECK27-NEXT: [[TMP33:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 10
3085 // CHECK27-NEXT: store [3 x i32] zeroinitializer, ptr [[TMP33]], align 4
3086 // CHECK27-NEXT: [[TMP34:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 11
3087 // CHECK27-NEXT: store [3 x i32] zeroinitializer, ptr [[TMP34]], align 4
3088 // CHECK27-NEXT: [[TMP35:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 12
3089 // CHECK27-NEXT: store i32 0, ptr [[TMP35]], align 4
3090 // CHECK27-NEXT: [[TMP36:%.*]] = call i32 @__tgt_target_kernel(ptr @[[GLOB3:[0-9]+]], i64 -1, i32 0, i32 0, ptr @.{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}_main_l161.region_id, ptr [[KERNEL_ARGS]])
3091 // CHECK27-NEXT: [[TMP37:%.*]] = icmp ne i32 [[TMP36]], 0
3092 // CHECK27-NEXT: br i1 [[TMP37]], label [[OMP_OFFLOAD_FAILED:%.*]], label [[OMP_OFFLOAD_CONT:%.*]]
3093 // CHECK27: omp_offload.failed:
3094 // CHECK27-NEXT: call void @{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}_main_l161(i32 [[TMP3]], i32 [[TMP0]], ptr [[VLA]]) #[[ATTR4:[0-9]+]]
3095 // CHECK27-NEXT: br label [[OMP_OFFLOAD_CONT]]
3096 // CHECK27: omp_offload.cont:
3097 // CHECK27-NEXT: [[TMP38:%.*]] = load i32, ptr [[ARGC_ADDR]], align 4
3098 // CHECK27-NEXT: [[CALL:%.*]] = call noundef i32 @_Z5tmainIiLi10EEiT_(i32 noundef [[TMP38]])
3099 // CHECK27-NEXT: store i32 [[CALL]], ptr [[RETVAL]], align 4
3100 // CHECK27-NEXT: [[TMP39:%.*]] = load ptr, ptr [[SAVED_STACK]], align 4
3101 // CHECK27-NEXT: call void @llvm.stackrestore.p0(ptr [[TMP39]])
3102 // CHECK27-NEXT: [[TMP40:%.*]] = load i32, ptr [[RETVAL]], align 4
3103 // CHECK27-NEXT: ret i32 [[TMP40]]
3106 // CHECK27-LABEL: define {{[^@]+}}@{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}_main_l161
3107 // CHECK27-SAME: (i32 noundef [[N:%.*]], i32 noundef [[VLA:%.*]], ptr noundef nonnull align 4 dereferenceable(4) [[A:%.*]]) #[[ATTR2:[0-9]+]] {
3108 // CHECK27-NEXT: entry:
3109 // CHECK27-NEXT: [[N_ADDR:%.*]] = alloca i32, align 4
3110 // CHECK27-NEXT: [[VLA_ADDR:%.*]] = alloca i32, align 4
3111 // CHECK27-NEXT: [[A_ADDR:%.*]] = alloca ptr, align 4
3112 // CHECK27-NEXT: store i32 [[N]], ptr [[N_ADDR]], align 4
3113 // CHECK27-NEXT: store i32 [[VLA]], ptr [[VLA_ADDR]], align 4
3114 // CHECK27-NEXT: store ptr [[A]], ptr [[A_ADDR]], align 4
3115 // CHECK27-NEXT: [[TMP0:%.*]] = load i32, ptr [[VLA_ADDR]], align 4
3116 // CHECK27-NEXT: [[TMP1:%.*]] = load ptr, ptr [[A_ADDR]], align 4
3117 // CHECK27-NEXT: call void (ptr, i32, ptr, ...) @__kmpc_fork_teams(ptr @[[GLOB3]], i32 3, ptr @{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}_main_l161.omp_outlined, ptr [[N_ADDR]], i32 [[TMP0]], ptr [[TMP1]])
3118 // CHECK27-NEXT: ret void
3121 // CHECK27-LABEL: define {{[^@]+}}@{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}_main_l161.omp_outlined
3122 // CHECK27-SAME: (ptr noalias noundef [[DOTGLOBAL_TID_:%.*]], ptr noalias noundef [[DOTBOUND_TID_:%.*]], ptr noundef nonnull align 4 dereferenceable(4) [[N:%.*]], i32 noundef [[VLA:%.*]], ptr noundef nonnull align 4 dereferenceable(4) [[A:%.*]]) #[[ATTR3:[0-9]+]] {
3123 // CHECK27-NEXT: entry:
3124 // CHECK27-NEXT: [[DOTGLOBAL_TID__ADDR:%.*]] = alloca ptr, align 4
3125 // CHECK27-NEXT: [[DOTBOUND_TID__ADDR:%.*]] = alloca ptr, align 4
3126 // CHECK27-NEXT: [[N_ADDR:%.*]] = alloca ptr, align 4
3127 // CHECK27-NEXT: [[VLA_ADDR:%.*]] = alloca i32, align 4
3128 // CHECK27-NEXT: [[A_ADDR:%.*]] = alloca ptr, align 4
3129 // CHECK27-NEXT: [[DOTOMP_IV:%.*]] = alloca i32, align 4
3130 // CHECK27-NEXT: [[TMP:%.*]] = alloca i32, align 4
3131 // CHECK27-NEXT: [[DOTCAPTURE_EXPR_:%.*]] = alloca i32, align 4
3132 // CHECK27-NEXT: [[DOTCAPTURE_EXPR_1:%.*]] = alloca i32, align 4
3133 // CHECK27-NEXT: [[I:%.*]] = alloca i32, align 4
3134 // CHECK27-NEXT: [[DOTOMP_COMB_LB:%.*]] = alloca i32, align 4
3135 // CHECK27-NEXT: [[DOTOMP_COMB_UB:%.*]] = alloca i32, align 4
3136 // CHECK27-NEXT: [[DOTOMP_STRIDE:%.*]] = alloca i32, align 4
3137 // CHECK27-NEXT: [[DOTOMP_IS_LAST:%.*]] = alloca i32, align 4
3138 // CHECK27-NEXT: [[I3:%.*]] = alloca i32, align 4
3139 // CHECK27-NEXT: store ptr [[DOTGLOBAL_TID_]], ptr [[DOTGLOBAL_TID__ADDR]], align 4
3140 // CHECK27-NEXT: store ptr [[DOTBOUND_TID_]], ptr [[DOTBOUND_TID__ADDR]], align 4
3141 // CHECK27-NEXT: store ptr [[N]], ptr [[N_ADDR]], align 4
3142 // CHECK27-NEXT: store i32 [[VLA]], ptr [[VLA_ADDR]], align 4
3143 // CHECK27-NEXT: store ptr [[A]], ptr [[A_ADDR]], align 4
3144 // CHECK27-NEXT: [[TMP0:%.*]] = load ptr, ptr [[N_ADDR]], align 4
3145 // CHECK27-NEXT: [[TMP1:%.*]] = load i32, ptr [[VLA_ADDR]], align 4
3146 // CHECK27-NEXT: [[TMP2:%.*]] = load ptr, ptr [[A_ADDR]], align 4
3147 // CHECK27-NEXT: [[TMP3:%.*]] = load i32, ptr [[TMP0]], align 4
3148 // CHECK27-NEXT: store i32 [[TMP3]], ptr [[DOTCAPTURE_EXPR_]], align 4
3149 // CHECK27-NEXT: [[TMP4:%.*]] = load i32, ptr [[DOTCAPTURE_EXPR_]], align 4
3150 // CHECK27-NEXT: [[SUB:%.*]] = sub nsw i32 [[TMP4]], 0
3151 // CHECK27-NEXT: [[DIV:%.*]] = sdiv i32 [[SUB]], 1
3152 // CHECK27-NEXT: [[SUB2:%.*]] = sub nsw i32 [[DIV]], 1
3153 // CHECK27-NEXT: store i32 [[SUB2]], ptr [[DOTCAPTURE_EXPR_1]], align 4
3154 // CHECK27-NEXT: store i32 0, ptr [[I]], align 4
3155 // CHECK27-NEXT: [[TMP5:%.*]] = load i32, ptr [[DOTCAPTURE_EXPR_]], align 4
3156 // CHECK27-NEXT: [[CMP:%.*]] = icmp slt i32 0, [[TMP5]]
3157 // CHECK27-NEXT: br i1 [[CMP]], label [[OMP_PRECOND_THEN:%.*]], label [[OMP_PRECOND_END:%.*]]
3158 // CHECK27: omp.precond.then:
3159 // CHECK27-NEXT: store i32 0, ptr [[DOTOMP_COMB_LB]], align 4
3160 // CHECK27-NEXT: [[TMP6:%.*]] = load i32, ptr [[DOTCAPTURE_EXPR_1]], align 4
3161 // CHECK27-NEXT: store i32 [[TMP6]], ptr [[DOTOMP_COMB_UB]], align 4
3162 // CHECK27-NEXT: store i32 1, ptr [[DOTOMP_STRIDE]], align 4
3163 // CHECK27-NEXT: store i32 0, ptr [[DOTOMP_IS_LAST]], align 4
3164 // CHECK27-NEXT: [[TMP7:%.*]] = load ptr, ptr [[DOTGLOBAL_TID__ADDR]], align 4
3165 // CHECK27-NEXT: [[TMP8:%.*]] = load i32, ptr [[TMP7]], align 4
3166 // CHECK27-NEXT: call void @__kmpc_for_static_init_4(ptr @[[GLOB1:[0-9]+]], i32 [[TMP8]], i32 92, ptr [[DOTOMP_IS_LAST]], ptr [[DOTOMP_COMB_LB]], ptr [[DOTOMP_COMB_UB]], ptr [[DOTOMP_STRIDE]], i32 1, i32 1)
3167 // CHECK27-NEXT: [[TMP9:%.*]] = load i32, ptr [[DOTOMP_COMB_UB]], align 4
3168 // CHECK27-NEXT: [[TMP10:%.*]] = load i32, ptr [[DOTCAPTURE_EXPR_1]], align 4
3169 // CHECK27-NEXT: [[CMP4:%.*]] = icmp sgt i32 [[TMP9]], [[TMP10]]
3170 // CHECK27-NEXT: br i1 [[CMP4]], label [[COND_TRUE:%.*]], label [[COND_FALSE:%.*]]
3171 // CHECK27: cond.true:
3172 // CHECK27-NEXT: [[TMP11:%.*]] = load i32, ptr [[DOTCAPTURE_EXPR_1]], align 4
3173 // CHECK27-NEXT: br label [[COND_END:%.*]]
3174 // CHECK27: cond.false:
3175 // CHECK27-NEXT: [[TMP12:%.*]] = load i32, ptr [[DOTOMP_COMB_UB]], align 4
3176 // CHECK27-NEXT: br label [[COND_END]]
3177 // CHECK27: cond.end:
3178 // CHECK27-NEXT: [[COND:%.*]] = phi i32 [ [[TMP11]], [[COND_TRUE]] ], [ [[TMP12]], [[COND_FALSE]] ]
3179 // CHECK27-NEXT: store i32 [[COND]], ptr [[DOTOMP_COMB_UB]], align 4
3180 // CHECK27-NEXT: [[TMP13:%.*]] = load i32, ptr [[DOTOMP_COMB_LB]], align 4
3181 // CHECK27-NEXT: store i32 [[TMP13]], ptr [[DOTOMP_IV]], align 4
3182 // CHECK27-NEXT: br label [[OMP_INNER_FOR_COND:%.*]]
3183 // CHECK27: omp.inner.for.cond:
3184 // CHECK27-NEXT: [[TMP14:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4
3185 // CHECK27-NEXT: [[TMP15:%.*]] = load i32, ptr [[DOTOMP_COMB_UB]], align 4
3186 // CHECK27-NEXT: [[CMP5:%.*]] = icmp sle i32 [[TMP14]], [[TMP15]]
3187 // CHECK27-NEXT: br i1 [[CMP5]], label [[OMP_INNER_FOR_BODY:%.*]], label [[OMP_INNER_FOR_END:%.*]]
3188 // CHECK27: omp.inner.for.body:
3189 // CHECK27-NEXT: [[TMP16:%.*]] = load i32, ptr [[DOTOMP_COMB_LB]], align 4
3190 // CHECK27-NEXT: [[TMP17:%.*]] = load i32, ptr [[DOTOMP_COMB_UB]], align 4
3191 // CHECK27-NEXT: call void (ptr, i32, ptr, ...) @__kmpc_fork_call(ptr @[[GLOB3]], i32 5, ptr @{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}_main_l161.omp_outlined.omp_outlined, i32 [[TMP16]], i32 [[TMP17]], ptr [[TMP0]], i32 [[TMP1]], ptr [[TMP2]])
3192 // CHECK27-NEXT: br label [[OMP_INNER_FOR_INC:%.*]]
3193 // CHECK27: omp.inner.for.inc:
3194 // CHECK27-NEXT: [[TMP18:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4
3195 // CHECK27-NEXT: [[TMP19:%.*]] = load i32, ptr [[DOTOMP_STRIDE]], align 4
3196 // CHECK27-NEXT: [[ADD:%.*]] = add nsw i32 [[TMP18]], [[TMP19]]
3197 // CHECK27-NEXT: store i32 [[ADD]], ptr [[DOTOMP_IV]], align 4
3198 // CHECK27-NEXT: br label [[OMP_INNER_FOR_COND]]
3199 // CHECK27: omp.inner.for.end:
3200 // CHECK27-NEXT: br label [[OMP_LOOP_EXIT:%.*]]
3201 // CHECK27: omp.loop.exit:
3202 // CHECK27-NEXT: [[TMP20:%.*]] = load ptr, ptr [[DOTGLOBAL_TID__ADDR]], align 4
3203 // CHECK27-NEXT: [[TMP21:%.*]] = load i32, ptr [[TMP20]], align 4
3204 // CHECK27-NEXT: call void @__kmpc_for_static_fini(ptr @[[GLOB2:[0-9]+]], i32 [[TMP21]])
3205 // CHECK27-NEXT: br label [[OMP_PRECOND_END]]
3206 // CHECK27: omp.precond.end:
3207 // CHECK27-NEXT: ret void
3210 // CHECK27-LABEL: define {{[^@]+}}@{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}_main_l161.omp_outlined.omp_outlined
3211 // CHECK27-SAME: (ptr noalias noundef [[DOTGLOBAL_TID_:%.*]], ptr noalias noundef [[DOTBOUND_TID_:%.*]], i32 noundef [[DOTPREVIOUS_LB_:%.*]], i32 noundef [[DOTPREVIOUS_UB_:%.*]], ptr noundef nonnull align 4 dereferenceable(4) [[N:%.*]], i32 noundef [[VLA:%.*]], ptr noundef nonnull align 4 dereferenceable(4) [[A:%.*]]) #[[ATTR3]] {
3212 // CHECK27-NEXT: entry:
3213 // CHECK27-NEXT: [[DOTGLOBAL_TID__ADDR:%.*]] = alloca ptr, align 4
3214 // CHECK27-NEXT: [[DOTBOUND_TID__ADDR:%.*]] = alloca ptr, align 4
3215 // CHECK27-NEXT: [[DOTPREVIOUS_LB__ADDR:%.*]] = alloca i32, align 4
3216 // CHECK27-NEXT: [[DOTPREVIOUS_UB__ADDR:%.*]] = alloca i32, align 4
3217 // CHECK27-NEXT: [[N_ADDR:%.*]] = alloca ptr, align 4
3218 // CHECK27-NEXT: [[VLA_ADDR:%.*]] = alloca i32, align 4
3219 // CHECK27-NEXT: [[A_ADDR:%.*]] = alloca ptr, align 4
3220 // CHECK27-NEXT: [[DOTOMP_IV:%.*]] = alloca i32, align 4
3221 // CHECK27-NEXT: [[TMP:%.*]] = alloca i32, align 4
3222 // CHECK27-NEXT: [[DOTCAPTURE_EXPR_:%.*]] = alloca i32, align 4
3223 // CHECK27-NEXT: [[DOTCAPTURE_EXPR_1:%.*]] = alloca i32, align 4
3224 // CHECK27-NEXT: [[I:%.*]] = alloca i32, align 4
3225 // CHECK27-NEXT: [[DOTOMP_LB:%.*]] = alloca i32, align 4
3226 // CHECK27-NEXT: [[DOTOMP_UB:%.*]] = alloca i32, align 4
3227 // CHECK27-NEXT: [[DOTOMP_STRIDE:%.*]] = alloca i32, align 4
3228 // CHECK27-NEXT: [[DOTOMP_IS_LAST:%.*]] = alloca i32, align 4
3229 // CHECK27-NEXT: [[I3:%.*]] = alloca i32, align 4
3230 // CHECK27-NEXT: store ptr [[DOTGLOBAL_TID_]], ptr [[DOTGLOBAL_TID__ADDR]], align 4
3231 // CHECK27-NEXT: store ptr [[DOTBOUND_TID_]], ptr [[DOTBOUND_TID__ADDR]], align 4
3232 // CHECK27-NEXT: store i32 [[DOTPREVIOUS_LB_]], ptr [[DOTPREVIOUS_LB__ADDR]], align 4
3233 // CHECK27-NEXT: store i32 [[DOTPREVIOUS_UB_]], ptr [[DOTPREVIOUS_UB__ADDR]], align 4
3234 // CHECK27-NEXT: store ptr [[N]], ptr [[N_ADDR]], align 4
3235 // CHECK27-NEXT: store i32 [[VLA]], ptr [[VLA_ADDR]], align 4
3236 // CHECK27-NEXT: store ptr [[A]], ptr [[A_ADDR]], align 4
3237 // CHECK27-NEXT: [[TMP0:%.*]] = load ptr, ptr [[N_ADDR]], align 4
3238 // CHECK27-NEXT: [[TMP1:%.*]] = load i32, ptr [[VLA_ADDR]], align 4
3239 // CHECK27-NEXT: [[TMP2:%.*]] = load ptr, ptr [[A_ADDR]], align 4
3240 // CHECK27-NEXT: [[TMP3:%.*]] = load i32, ptr [[TMP0]], align 4
3241 // CHECK27-NEXT: store i32 [[TMP3]], ptr [[DOTCAPTURE_EXPR_]], align 4
3242 // CHECK27-NEXT: [[TMP4:%.*]] = load i32, ptr [[DOTCAPTURE_EXPR_]], align 4
3243 // CHECK27-NEXT: [[SUB:%.*]] = sub nsw i32 [[TMP4]], 0
3244 // CHECK27-NEXT: [[DIV:%.*]] = sdiv i32 [[SUB]], 1
3245 // CHECK27-NEXT: [[SUB2:%.*]] = sub nsw i32 [[DIV]], 1
3246 // CHECK27-NEXT: store i32 [[SUB2]], ptr [[DOTCAPTURE_EXPR_1]], align 4
3247 // CHECK27-NEXT: store i32 0, ptr [[I]], align 4
3248 // CHECK27-NEXT: [[TMP5:%.*]] = load i32, ptr [[DOTCAPTURE_EXPR_]], align 4
3249 // CHECK27-NEXT: [[CMP:%.*]] = icmp slt i32 0, [[TMP5]]
3250 // CHECK27-NEXT: br i1 [[CMP]], label [[OMP_PRECOND_THEN:%.*]], label [[OMP_PRECOND_END:%.*]]
3251 // CHECK27: omp.precond.then:
3252 // CHECK27-NEXT: store i32 0, ptr [[DOTOMP_LB]], align 4
3253 // CHECK27-NEXT: [[TMP6:%.*]] = load i32, ptr [[DOTCAPTURE_EXPR_1]], align 4
3254 // CHECK27-NEXT: store i32 [[TMP6]], ptr [[DOTOMP_UB]], align 4
3255 // CHECK27-NEXT: [[TMP7:%.*]] = load i32, ptr [[DOTPREVIOUS_LB__ADDR]], align 4
3256 // CHECK27-NEXT: [[TMP8:%.*]] = load i32, ptr [[DOTPREVIOUS_UB__ADDR]], align 4
3257 // CHECK27-NEXT: store i32 [[TMP7]], ptr [[DOTOMP_LB]], align 4
3258 // CHECK27-NEXT: store i32 [[TMP8]], ptr [[DOTOMP_UB]], align 4
3259 // CHECK27-NEXT: store i32 1, ptr [[DOTOMP_STRIDE]], align 4
3260 // CHECK27-NEXT: store i32 0, ptr [[DOTOMP_IS_LAST]], align 4
3261 // CHECK27-NEXT: [[TMP9:%.*]] = load ptr, ptr [[DOTGLOBAL_TID__ADDR]], align 4
3262 // CHECK27-NEXT: [[TMP10:%.*]] = load i32, ptr [[TMP9]], align 4
3263 // CHECK27-NEXT: call void @__kmpc_for_static_init_4(ptr @[[GLOB2]], i32 [[TMP10]], i32 34, ptr [[DOTOMP_IS_LAST]], ptr [[DOTOMP_LB]], ptr [[DOTOMP_UB]], ptr [[DOTOMP_STRIDE]], i32 1, i32 1)
3264 // CHECK27-NEXT: [[TMP11:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4
3265 // CHECK27-NEXT: [[TMP12:%.*]] = load i32, ptr [[DOTCAPTURE_EXPR_1]], align 4
3266 // CHECK27-NEXT: [[CMP4:%.*]] = icmp sgt i32 [[TMP11]], [[TMP12]]
3267 // CHECK27-NEXT: br i1 [[CMP4]], label [[COND_TRUE:%.*]], label [[COND_FALSE:%.*]]
3268 // CHECK27: cond.true:
3269 // CHECK27-NEXT: [[TMP13:%.*]] = load i32, ptr [[DOTCAPTURE_EXPR_1]], align 4
3270 // CHECK27-NEXT: br label [[COND_END:%.*]]
3271 // CHECK27: cond.false:
3272 // CHECK27-NEXT: [[TMP14:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4
3273 // CHECK27-NEXT: br label [[COND_END]]
3274 // CHECK27: cond.end:
3275 // CHECK27-NEXT: [[COND:%.*]] = phi i32 [ [[TMP13]], [[COND_TRUE]] ], [ [[TMP14]], [[COND_FALSE]] ]
3276 // CHECK27-NEXT: store i32 [[COND]], ptr [[DOTOMP_UB]], align 4
3277 // CHECK27-NEXT: [[TMP15:%.*]] = load i32, ptr [[DOTOMP_LB]], align 4
3278 // CHECK27-NEXT: store i32 [[TMP15]], ptr [[DOTOMP_IV]], align 4
3279 // CHECK27-NEXT: br label [[OMP_INNER_FOR_COND:%.*]]
3280 // CHECK27: omp.inner.for.cond:
3281 // CHECK27-NEXT: [[TMP16:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4
3282 // CHECK27-NEXT: [[TMP17:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4
3283 // CHECK27-NEXT: [[CMP5:%.*]] = icmp sle i32 [[TMP16]], [[TMP17]]
3284 // CHECK27-NEXT: br i1 [[CMP5]], label [[OMP_INNER_FOR_BODY:%.*]], label [[OMP_INNER_FOR_END:%.*]]
3285 // CHECK27: omp.inner.for.body:
3286 // CHECK27-NEXT: [[TMP18:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4
3287 // CHECK27-NEXT: [[MUL:%.*]] = mul nsw i32 [[TMP18]], 1
3288 // CHECK27-NEXT: [[ADD:%.*]] = add nsw i32 0, [[MUL]]
3289 // CHECK27-NEXT: store i32 [[ADD]], ptr [[I3]], align 4
3290 // CHECK27-NEXT: [[TMP19:%.*]] = load i32, ptr [[I3]], align 4
3291 // CHECK27-NEXT: [[ARRAYIDX:%.*]] = getelementptr inbounds i32, ptr [[TMP2]], i32 [[TMP19]]
3292 // CHECK27-NEXT: store i32 0, ptr [[ARRAYIDX]], align 4
3293 // CHECK27-NEXT: br label [[OMP_BODY_CONTINUE:%.*]]
3294 // CHECK27: omp.body.continue:
3295 // CHECK27-NEXT: br label [[OMP_INNER_FOR_INC:%.*]]
3296 // CHECK27: omp.inner.for.inc:
3297 // CHECK27-NEXT: [[TMP20:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4
3298 // CHECK27-NEXT: [[ADD6:%.*]] = add nsw i32 [[TMP20]], 1
3299 // CHECK27-NEXT: store i32 [[ADD6]], ptr [[DOTOMP_IV]], align 4
3300 // CHECK27-NEXT: br label [[OMP_INNER_FOR_COND]]
3301 // CHECK27: omp.inner.for.end:
3302 // CHECK27-NEXT: br label [[OMP_LOOP_EXIT:%.*]]
3303 // CHECK27: omp.loop.exit:
3304 // CHECK27-NEXT: [[TMP21:%.*]] = load ptr, ptr [[DOTGLOBAL_TID__ADDR]], align 4
3305 // CHECK27-NEXT: [[TMP22:%.*]] = load i32, ptr [[TMP21]], align 4
3306 // CHECK27-NEXT: call void @__kmpc_for_static_fini(ptr @[[GLOB2]], i32 [[TMP22]])
3307 // CHECK27-NEXT: br label [[OMP_PRECOND_END]]
3308 // CHECK27: omp.precond.end:
3309 // CHECK27-NEXT: ret void
3312 // CHECK27-LABEL: define {{[^@]+}}@_Z5tmainIiLi10EEiT_
3313 // CHECK27-SAME: (i32 noundef [[ARGC:%.*]]) #[[ATTR6:[0-9]+]] comdat {
3314 // CHECK27-NEXT: entry:
3315 // CHECK27-NEXT: [[ARGC_ADDR:%.*]] = alloca i32, align 4
3316 // CHECK27-NEXT: [[A:%.*]] = alloca [10 x i32], align 4
3317 // CHECK27-NEXT: [[TE:%.*]] = alloca i32, align 4
3318 // CHECK27-NEXT: [[TH:%.*]] = alloca i32, align 4
3319 // CHECK27-NEXT: [[TE_CASTED:%.*]] = alloca i32, align 4
3320 // CHECK27-NEXT: [[TH_CASTED:%.*]] = alloca i32, align 4
3321 // CHECK27-NEXT: [[DOTOFFLOAD_BASEPTRS:%.*]] = alloca [3 x ptr], align 4
3322 // CHECK27-NEXT: [[DOTOFFLOAD_PTRS:%.*]] = alloca [3 x ptr], align 4
3323 // CHECK27-NEXT: [[DOTOFFLOAD_MAPPERS:%.*]] = alloca [3 x ptr], align 4
3324 // CHECK27-NEXT: [[TMP:%.*]] = alloca i32, align 4
3325 // CHECK27-NEXT: [[KERNEL_ARGS:%.*]] = alloca [[STRUCT___TGT_KERNEL_ARGUMENTS:%.*]], align 8
3326 // CHECK27-NEXT: store i32 [[ARGC]], ptr [[ARGC_ADDR]], align 4
3327 // CHECK27-NEXT: store i32 0, ptr [[TE]], align 4
3328 // CHECK27-NEXT: store i32 128, ptr [[TH]], align 4
3329 // CHECK27-NEXT: [[TMP0:%.*]] = load i32, ptr [[TE]], align 4
3330 // CHECK27-NEXT: store i32 [[TMP0]], ptr [[TE_CASTED]], align 4
3331 // CHECK27-NEXT: [[TMP1:%.*]] = load i32, ptr [[TE_CASTED]], align 4
3332 // CHECK27-NEXT: [[TMP2:%.*]] = load i32, ptr [[TH]], align 4
3333 // CHECK27-NEXT: store i32 [[TMP2]], ptr [[TH_CASTED]], align 4
3334 // CHECK27-NEXT: [[TMP3:%.*]] = load i32, ptr [[TH_CASTED]], align 4
3335 // CHECK27-NEXT: [[TMP4:%.*]] = getelementptr inbounds [3 x ptr], ptr [[DOTOFFLOAD_BASEPTRS]], i32 0, i32 0
3336 // CHECK27-NEXT: store i32 [[TMP1]], ptr [[TMP4]], align 4
3337 // CHECK27-NEXT: [[TMP5:%.*]] = getelementptr inbounds [3 x ptr], ptr [[DOTOFFLOAD_PTRS]], i32 0, i32 0
3338 // CHECK27-NEXT: store i32 [[TMP1]], ptr [[TMP5]], align 4
3339 // CHECK27-NEXT: [[TMP6:%.*]] = getelementptr inbounds [3 x ptr], ptr [[DOTOFFLOAD_MAPPERS]], i32 0, i32 0
3340 // CHECK27-NEXT: store ptr null, ptr [[TMP6]], align 4
3341 // CHECK27-NEXT: [[TMP7:%.*]] = getelementptr inbounds [3 x ptr], ptr [[DOTOFFLOAD_BASEPTRS]], i32 0, i32 1
3342 // CHECK27-NEXT: store i32 [[TMP3]], ptr [[TMP7]], align 4
3343 // CHECK27-NEXT: [[TMP8:%.*]] = getelementptr inbounds [3 x ptr], ptr [[DOTOFFLOAD_PTRS]], i32 0, i32 1
3344 // CHECK27-NEXT: store i32 [[TMP3]], ptr [[TMP8]], align 4
3345 // CHECK27-NEXT: [[TMP9:%.*]] = getelementptr inbounds [3 x ptr], ptr [[DOTOFFLOAD_MAPPERS]], i32 0, i32 1
3346 // CHECK27-NEXT: store ptr null, ptr [[TMP9]], align 4
3347 // CHECK27-NEXT: [[TMP10:%.*]] = getelementptr inbounds [3 x ptr], ptr [[DOTOFFLOAD_BASEPTRS]], i32 0, i32 2
3348 // CHECK27-NEXT: store ptr [[A]], ptr [[TMP10]], align 4
3349 // CHECK27-NEXT: [[TMP11:%.*]] = getelementptr inbounds [3 x ptr], ptr [[DOTOFFLOAD_PTRS]], i32 0, i32 2
3350 // CHECK27-NEXT: store ptr [[A]], ptr [[TMP11]], align 4
3351 // CHECK27-NEXT: [[TMP12:%.*]] = getelementptr inbounds [3 x ptr], ptr [[DOTOFFLOAD_MAPPERS]], i32 0, i32 2
3352 // CHECK27-NEXT: store ptr null, ptr [[TMP12]], align 4
3353 // CHECK27-NEXT: [[TMP13:%.*]] = getelementptr inbounds [3 x ptr], ptr [[DOTOFFLOAD_BASEPTRS]], i32 0, i32 0
3354 // CHECK27-NEXT: [[TMP14:%.*]] = getelementptr inbounds [3 x ptr], ptr [[DOTOFFLOAD_PTRS]], i32 0, i32 0
3355 // CHECK27-NEXT: [[TMP15:%.*]] = load i32, ptr [[TE]], align 4
3356 // CHECK27-NEXT: [[TMP16:%.*]] = load i32, ptr [[TH]], align 4
3357 // CHECK27-NEXT: [[TMP17:%.*]] = insertvalue [3 x i32] zeroinitializer, i32 [[TMP15]], 0
3358 // CHECK27-NEXT: [[TMP18:%.*]] = insertvalue [3 x i32] zeroinitializer, i32 [[TMP16]], 0
3359 // CHECK27-NEXT: [[TMP19:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 0
3360 // CHECK27-NEXT: store i32 2, ptr [[TMP19]], align 4
3361 // CHECK27-NEXT: [[TMP20:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 1
3362 // CHECK27-NEXT: store i32 3, ptr [[TMP20]], align 4
3363 // CHECK27-NEXT: [[TMP21:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 2
3364 // CHECK27-NEXT: store ptr [[TMP13]], ptr [[TMP21]], align 4
3365 // CHECK27-NEXT: [[TMP22:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 3
3366 // CHECK27-NEXT: store ptr [[TMP14]], ptr [[TMP22]], align 4
3367 // CHECK27-NEXT: [[TMP23:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 4
3368 // CHECK27-NEXT: store ptr @.offload_sizes.1, ptr [[TMP23]], align 4
3369 // CHECK27-NEXT: [[TMP24:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 5
3370 // CHECK27-NEXT: store ptr @.offload_maptypes.2, ptr [[TMP24]], align 4
3371 // CHECK27-NEXT: [[TMP25:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 6
3372 // CHECK27-NEXT: store ptr null, ptr [[TMP25]], align 4
3373 // CHECK27-NEXT: [[TMP26:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 7
3374 // CHECK27-NEXT: store ptr null, ptr [[TMP26]], align 4
3375 // CHECK27-NEXT: [[TMP27:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 8
3376 // CHECK27-NEXT: store i64 10, ptr [[TMP27]], align 8
3377 // CHECK27-NEXT: [[TMP28:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 9
3378 // CHECK27-NEXT: store i64 0, ptr [[TMP28]], align 8
3379 // CHECK27-NEXT: [[TMP29:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 10
3380 // CHECK27-NEXT: store [3 x i32] [[TMP17]], ptr [[TMP29]], align 4
3381 // CHECK27-NEXT: [[TMP30:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 11
3382 // CHECK27-NEXT: store [3 x i32] [[TMP18]], ptr [[TMP30]], align 4
3383 // CHECK27-NEXT: [[TMP31:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 12
3384 // CHECK27-NEXT: store i32 0, ptr [[TMP31]], align 4
3385 // CHECK27-NEXT: [[TMP32:%.*]] = call i32 @__tgt_target_kernel(ptr @[[GLOB3]], i64 -1, i32 [[TMP15]], i32 [[TMP16]], ptr @.{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z5tmainIiLi10EEiT__l150.region_id, ptr [[KERNEL_ARGS]])
3386 // CHECK27-NEXT: [[TMP33:%.*]] = icmp ne i32 [[TMP32]], 0
3387 // CHECK27-NEXT: br i1 [[TMP33]], label [[OMP_OFFLOAD_FAILED:%.*]], label [[OMP_OFFLOAD_CONT:%.*]]
3388 // CHECK27: omp_offload.failed:
3389 // CHECK27-NEXT: call void @{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z5tmainIiLi10EEiT__l150(i32 [[TMP1]], i32 [[TMP3]], ptr [[A]]) #[[ATTR4]]
3390 // CHECK27-NEXT: br label [[OMP_OFFLOAD_CONT]]
3391 // CHECK27: omp_offload.cont:
3392 // CHECK27-NEXT: ret i32 0
3395 // CHECK27-LABEL: define {{[^@]+}}@{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z5tmainIiLi10EEiT__l150
3396 // CHECK27-SAME: (i32 noundef [[TE:%.*]], i32 noundef [[TH:%.*]], ptr noundef nonnull align 4 dereferenceable(40) [[A:%.*]]) #[[ATTR3]] {
3397 // CHECK27-NEXT: entry:
3398 // CHECK27-NEXT: [[TE_ADDR:%.*]] = alloca i32, align 4
3399 // CHECK27-NEXT: [[TH_ADDR:%.*]] = alloca i32, align 4
3400 // CHECK27-NEXT: [[A_ADDR:%.*]] = alloca ptr, align 4
3401 // CHECK27-NEXT: [[TMP0:%.*]] = call i32 @__kmpc_global_thread_num(ptr @[[GLOB3]])
3402 // CHECK27-NEXT: store i32 [[TE]], ptr [[TE_ADDR]], align 4
3403 // CHECK27-NEXT: store i32 [[TH]], ptr [[TH_ADDR]], align 4
3404 // CHECK27-NEXT: store ptr [[A]], ptr [[A_ADDR]], align 4
3405 // CHECK27-NEXT: [[TMP1:%.*]] = load ptr, ptr [[A_ADDR]], align 4
3406 // CHECK27-NEXT: [[TMP2:%.*]] = load i32, ptr [[TE_ADDR]], align 4
3407 // CHECK27-NEXT: [[TMP3:%.*]] = load i32, ptr [[TH_ADDR]], align 4
3408 // CHECK27-NEXT: call void @__kmpc_push_num_teams(ptr @[[GLOB3]], i32 [[TMP0]], i32 [[TMP2]], i32 [[TMP3]])
3409 // CHECK27-NEXT: call void (ptr, i32, ptr, ...) @__kmpc_fork_teams(ptr @[[GLOB3]], i32 1, ptr @{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z5tmainIiLi10EEiT__l150.omp_outlined, ptr [[TMP1]])
3410 // CHECK27-NEXT: ret void
3413 // CHECK27-LABEL: define {{[^@]+}}@{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z5tmainIiLi10EEiT__l150.omp_outlined
3414 // CHECK27-SAME: (ptr noalias noundef [[DOTGLOBAL_TID_:%.*]], ptr noalias noundef [[DOTBOUND_TID_:%.*]], ptr noundef nonnull align 4 dereferenceable(40) [[A:%.*]]) #[[ATTR3]] {
3415 // CHECK27-NEXT: entry:
3416 // CHECK27-NEXT: [[DOTGLOBAL_TID__ADDR:%.*]] = alloca ptr, align 4
3417 // CHECK27-NEXT: [[DOTBOUND_TID__ADDR:%.*]] = alloca ptr, align 4
3418 // CHECK27-NEXT: [[A_ADDR:%.*]] = alloca ptr, align 4
3419 // CHECK27-NEXT: [[DOTOMP_IV:%.*]] = alloca i32, align 4
3420 // CHECK27-NEXT: [[TMP:%.*]] = alloca i32, align 4
3421 // CHECK27-NEXT: [[DOTOMP_COMB_LB:%.*]] = alloca i32, align 4
3422 // CHECK27-NEXT: [[DOTOMP_COMB_UB:%.*]] = alloca i32, align 4
3423 // CHECK27-NEXT: [[DOTOMP_STRIDE:%.*]] = alloca i32, align 4
3424 // CHECK27-NEXT: [[DOTOMP_IS_LAST:%.*]] = alloca i32, align 4
3425 // CHECK27-NEXT: [[I:%.*]] = alloca i32, align 4
3426 // CHECK27-NEXT: store ptr [[DOTGLOBAL_TID_]], ptr [[DOTGLOBAL_TID__ADDR]], align 4
3427 // CHECK27-NEXT: store ptr [[DOTBOUND_TID_]], ptr [[DOTBOUND_TID__ADDR]], align 4
3428 // CHECK27-NEXT: store ptr [[A]], ptr [[A_ADDR]], align 4
3429 // CHECK27-NEXT: [[TMP0:%.*]] = load ptr, ptr [[A_ADDR]], align 4
3430 // CHECK27-NEXT: store i32 0, ptr [[DOTOMP_COMB_LB]], align 4
3431 // CHECK27-NEXT: store i32 9, ptr [[DOTOMP_COMB_UB]], align 4
3432 // CHECK27-NEXT: store i32 1, ptr [[DOTOMP_STRIDE]], align 4
3433 // CHECK27-NEXT: store i32 0, ptr [[DOTOMP_IS_LAST]], align 4
3434 // CHECK27-NEXT: [[TMP1:%.*]] = load ptr, ptr [[DOTGLOBAL_TID__ADDR]], align 4
3435 // CHECK27-NEXT: [[TMP2:%.*]] = load i32, ptr [[TMP1]], align 4
3436 // CHECK27-NEXT: call void @__kmpc_for_static_init_4(ptr @[[GLOB1]], i32 [[TMP2]], i32 92, ptr [[DOTOMP_IS_LAST]], ptr [[DOTOMP_COMB_LB]], ptr [[DOTOMP_COMB_UB]], ptr [[DOTOMP_STRIDE]], i32 1, i32 1)
3437 // CHECK27-NEXT: [[TMP3:%.*]] = load i32, ptr [[DOTOMP_COMB_UB]], align 4
3438 // CHECK27-NEXT: [[CMP:%.*]] = icmp sgt i32 [[TMP3]], 9
3439 // CHECK27-NEXT: br i1 [[CMP]], label [[COND_TRUE:%.*]], label [[COND_FALSE:%.*]]
3440 // CHECK27: cond.true:
3441 // CHECK27-NEXT: br label [[COND_END:%.*]]
3442 // CHECK27: cond.false:
3443 // CHECK27-NEXT: [[TMP4:%.*]] = load i32, ptr [[DOTOMP_COMB_UB]], align 4
3444 // CHECK27-NEXT: br label [[COND_END]]
3445 // CHECK27: cond.end:
3446 // CHECK27-NEXT: [[COND:%.*]] = phi i32 [ 9, [[COND_TRUE]] ], [ [[TMP4]], [[COND_FALSE]] ]
3447 // CHECK27-NEXT: store i32 [[COND]], ptr [[DOTOMP_COMB_UB]], align 4
3448 // CHECK27-NEXT: [[TMP5:%.*]] = load i32, ptr [[DOTOMP_COMB_LB]], align 4
3449 // CHECK27-NEXT: store i32 [[TMP5]], ptr [[DOTOMP_IV]], align 4
3450 // CHECK27-NEXT: br label [[OMP_INNER_FOR_COND:%.*]]
3451 // CHECK27: omp.inner.for.cond:
3452 // CHECK27-NEXT: [[TMP6:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4
3453 // CHECK27-NEXT: [[TMP7:%.*]] = load i32, ptr [[DOTOMP_COMB_UB]], align 4
3454 // CHECK27-NEXT: [[CMP1:%.*]] = icmp sle i32 [[TMP6]], [[TMP7]]
3455 // CHECK27-NEXT: br i1 [[CMP1]], label [[OMP_INNER_FOR_BODY:%.*]], label [[OMP_INNER_FOR_END:%.*]]
3456 // CHECK27: omp.inner.for.body:
3457 // CHECK27-NEXT: [[TMP8:%.*]] = load i32, ptr [[DOTOMP_COMB_LB]], align 4
3458 // CHECK27-NEXT: [[TMP9:%.*]] = load i32, ptr [[DOTOMP_COMB_UB]], align 4
3459 // CHECK27-NEXT: call void (ptr, i32, ptr, ...) @__kmpc_fork_call(ptr @[[GLOB3]], i32 3, ptr @{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z5tmainIiLi10EEiT__l150.omp_outlined.omp_outlined, i32 [[TMP8]], i32 [[TMP9]], ptr [[TMP0]])
3460 // CHECK27-NEXT: br label [[OMP_INNER_FOR_INC:%.*]]
3461 // CHECK27: omp.inner.for.inc:
3462 // CHECK27-NEXT: [[TMP10:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4
3463 // CHECK27-NEXT: [[TMP11:%.*]] = load i32, ptr [[DOTOMP_STRIDE]], align 4
3464 // CHECK27-NEXT: [[ADD:%.*]] = add nsw i32 [[TMP10]], [[TMP11]]
3465 // CHECK27-NEXT: store i32 [[ADD]], ptr [[DOTOMP_IV]], align 4
3466 // CHECK27-NEXT: br label [[OMP_INNER_FOR_COND]]
3467 // CHECK27: omp.inner.for.end:
3468 // CHECK27-NEXT: br label [[OMP_LOOP_EXIT:%.*]]
3469 // CHECK27: omp.loop.exit:
3470 // CHECK27-NEXT: call void @__kmpc_for_static_fini(ptr @[[GLOB2]], i32 [[TMP2]])
3471 // CHECK27-NEXT: ret void
3474 // CHECK27-LABEL: define {{[^@]+}}@{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z5tmainIiLi10EEiT__l150.omp_outlined.omp_outlined
3475 // CHECK27-SAME: (ptr noalias noundef [[DOTGLOBAL_TID_:%.*]], ptr noalias noundef [[DOTBOUND_TID_:%.*]], i32 noundef [[DOTPREVIOUS_LB_:%.*]], i32 noundef [[DOTPREVIOUS_UB_:%.*]], ptr noundef nonnull align 4 dereferenceable(40) [[A:%.*]]) #[[ATTR3]] {
3476 // CHECK27-NEXT: entry:
3477 // CHECK27-NEXT: [[DOTGLOBAL_TID__ADDR:%.*]] = alloca ptr, align 4
3478 // CHECK27-NEXT: [[DOTBOUND_TID__ADDR:%.*]] = alloca ptr, align 4
3479 // CHECK27-NEXT: [[DOTPREVIOUS_LB__ADDR:%.*]] = alloca i32, align 4
3480 // CHECK27-NEXT: [[DOTPREVIOUS_UB__ADDR:%.*]] = alloca i32, align 4
3481 // CHECK27-NEXT: [[A_ADDR:%.*]] = alloca ptr, align 4
3482 // CHECK27-NEXT: [[DOTOMP_IV:%.*]] = alloca i32, align 4
3483 // CHECK27-NEXT: [[TMP:%.*]] = alloca i32, align 4
3484 // CHECK27-NEXT: [[DOTOMP_LB:%.*]] = alloca i32, align 4
3485 // CHECK27-NEXT: [[DOTOMP_UB:%.*]] = alloca i32, align 4
3486 // CHECK27-NEXT: [[DOTOMP_STRIDE:%.*]] = alloca i32, align 4
3487 // CHECK27-NEXT: [[DOTOMP_IS_LAST:%.*]] = alloca i32, align 4
3488 // CHECK27-NEXT: [[I:%.*]] = alloca i32, align 4
3489 // CHECK27-NEXT: store ptr [[DOTGLOBAL_TID_]], ptr [[DOTGLOBAL_TID__ADDR]], align 4
3490 // CHECK27-NEXT: store ptr [[DOTBOUND_TID_]], ptr [[DOTBOUND_TID__ADDR]], align 4
3491 // CHECK27-NEXT: store i32 [[DOTPREVIOUS_LB_]], ptr [[DOTPREVIOUS_LB__ADDR]], align 4
3492 // CHECK27-NEXT: store i32 [[DOTPREVIOUS_UB_]], ptr [[DOTPREVIOUS_UB__ADDR]], align 4
3493 // CHECK27-NEXT: store ptr [[A]], ptr [[A_ADDR]], align 4
3494 // CHECK27-NEXT: [[TMP0:%.*]] = load ptr, ptr [[A_ADDR]], align 4
3495 // CHECK27-NEXT: store i32 0, ptr [[DOTOMP_LB]], align 4
3496 // CHECK27-NEXT: store i32 9, ptr [[DOTOMP_UB]], align 4
3497 // CHECK27-NEXT: [[TMP1:%.*]] = load i32, ptr [[DOTPREVIOUS_LB__ADDR]], align 4
3498 // CHECK27-NEXT: [[TMP2:%.*]] = load i32, ptr [[DOTPREVIOUS_UB__ADDR]], align 4
3499 // CHECK27-NEXT: store i32 [[TMP1]], ptr [[DOTOMP_LB]], align 4
3500 // CHECK27-NEXT: store i32 [[TMP2]], ptr [[DOTOMP_UB]], align 4
3501 // CHECK27-NEXT: store i32 1, ptr [[DOTOMP_STRIDE]], align 4
3502 // CHECK27-NEXT: store i32 0, ptr [[DOTOMP_IS_LAST]], align 4
3503 // CHECK27-NEXT: [[TMP3:%.*]] = load ptr, ptr [[DOTGLOBAL_TID__ADDR]], align 4
3504 // CHECK27-NEXT: [[TMP4:%.*]] = load i32, ptr [[TMP3]], align 4
3505 // CHECK27-NEXT: call void @__kmpc_for_static_init_4(ptr @[[GLOB2]], i32 [[TMP4]], i32 34, ptr [[DOTOMP_IS_LAST]], ptr [[DOTOMP_LB]], ptr [[DOTOMP_UB]], ptr [[DOTOMP_STRIDE]], i32 1, i32 1)
3506 // CHECK27-NEXT: [[TMP5:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4
3507 // CHECK27-NEXT: [[CMP:%.*]] = icmp sgt i32 [[TMP5]], 9
3508 // CHECK27-NEXT: br i1 [[CMP]], label [[COND_TRUE:%.*]], label [[COND_FALSE:%.*]]
3509 // CHECK27: cond.true:
3510 // CHECK27-NEXT: br label [[COND_END:%.*]]
3511 // CHECK27: cond.false:
3512 // CHECK27-NEXT: [[TMP6:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4
3513 // CHECK27-NEXT: br label [[COND_END]]
3514 // CHECK27: cond.end:
3515 // CHECK27-NEXT: [[COND:%.*]] = phi i32 [ 9, [[COND_TRUE]] ], [ [[TMP6]], [[COND_FALSE]] ]
3516 // CHECK27-NEXT: store i32 [[COND]], ptr [[DOTOMP_UB]], align 4
3517 // CHECK27-NEXT: [[TMP7:%.*]] = load i32, ptr [[DOTOMP_LB]], align 4
3518 // CHECK27-NEXT: store i32 [[TMP7]], ptr [[DOTOMP_IV]], align 4
3519 // CHECK27-NEXT: br label [[OMP_INNER_FOR_COND:%.*]]
3520 // CHECK27: omp.inner.for.cond:
3521 // CHECK27-NEXT: [[TMP8:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4
3522 // CHECK27-NEXT: [[TMP9:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4
3523 // CHECK27-NEXT: [[CMP1:%.*]] = icmp sle i32 [[TMP8]], [[TMP9]]
3524 // CHECK27-NEXT: br i1 [[CMP1]], label [[OMP_INNER_FOR_BODY:%.*]], label [[OMP_INNER_FOR_END:%.*]]
3525 // CHECK27: omp.inner.for.body:
3526 // CHECK27-NEXT: [[TMP10:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4
3527 // CHECK27-NEXT: [[MUL:%.*]] = mul nsw i32 [[TMP10]], 1
3528 // CHECK27-NEXT: [[ADD:%.*]] = add nsw i32 0, [[MUL]]
3529 // CHECK27-NEXT: store i32 [[ADD]], ptr [[I]], align 4
3530 // CHECK27-NEXT: [[TMP11:%.*]] = load i32, ptr [[I]], align 4
3531 // CHECK27-NEXT: [[ARRAYIDX:%.*]] = getelementptr inbounds [10 x i32], ptr [[TMP0]], i32 0, i32 [[TMP11]]
3532 // CHECK27-NEXT: store i32 0, ptr [[ARRAYIDX]], align 4
3533 // CHECK27-NEXT: br label [[OMP_BODY_CONTINUE:%.*]]
3534 // CHECK27: omp.body.continue:
3535 // CHECK27-NEXT: br label [[OMP_INNER_FOR_INC:%.*]]
3536 // CHECK27: omp.inner.for.inc:
3537 // CHECK27-NEXT: [[TMP12:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4
3538 // CHECK27-NEXT: [[ADD2:%.*]] = add nsw i32 [[TMP12]], 1
3539 // CHECK27-NEXT: store i32 [[ADD2]], ptr [[DOTOMP_IV]], align 4
3540 // CHECK27-NEXT: br label [[OMP_INNER_FOR_COND]]
3541 // CHECK27: omp.inner.for.end:
3542 // CHECK27-NEXT: br label [[OMP_LOOP_EXIT:%.*]]
3543 // CHECK27: omp.loop.exit:
3544 // CHECK27-NEXT: call void @__kmpc_for_static_fini(ptr @[[GLOB2]], i32 [[TMP4]])
3545 // CHECK27-NEXT: ret void
3548 // CHECK27-LABEL: define {{[^@]+}}@.omp_offloading.requires_reg
3549 // CHECK27-SAME: () #[[ATTR7:[0-9]+]] {
3550 // CHECK27-NEXT: entry:
3551 // CHECK27-NEXT: call void @__tgt_register_requires(i64 1)
3552 // CHECK27-NEXT: ret void