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