Run DCE after a LoopFlatten test to reduce spurious output [nfc]
[llvm-project.git] / clang / test / OpenMP / teams_distribute_dist_schedule_codegen.cpp
blob40b03586adf9bb2ac7fc05c4aba2f574a3cd3daf
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
6 // Test host codegen.
7 // 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
8 // 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
9 // 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
10 // 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
11 // 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
12 // 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
14 // 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}}"
15 // 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
16 // 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}}"
17 // 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}}"
18 // 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
19 // 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}}"
20 #ifdef CK1
22 template <typename T, int X, long long Y>
23 struct SS{
24 T a[X];
25 float b;
26 int foo(void) {
28 #pragma omp target
29 #pragma omp teams distribute
30 for(int i = 0; i < X; i++) {
31 a[i] = (T)0;
33 #pragma omp target
34 #pragma omp teams distribute dist_schedule(static)
35 for(int i = 0; i < X; i++) {
36 a[i] = (T)0;
38 #pragma omp target
39 #pragma omp teams distribute dist_schedule(static, X/2)
40 for(int i = 0; i < X; i++) {
41 a[i] = (T)0;
49 return a[0];
53 int teams_template_struct(void) {
54 SS<int, 123, 456> V;
55 return V.foo();
58 #endif // CK1
60 // Test host codegen.
61 // 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
62 // 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
63 // 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
64 // 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
65 // 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
66 // 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
68 // 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}}"
69 // 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
70 // 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}}"
71 // 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}}"
72 // 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
73 // 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}}"
74 #ifdef CK2
76 template <typename T, int n>
77 int tmain(T argc) {
78 T a[n];
79 #pragma omp target
80 #pragma omp teams distribute
81 for(int i = 0; i < n; i++) {
82 a[i] = (T)0;
84 #pragma omp target
85 #pragma omp teams distribute dist_schedule(static)
86 for(int i = 0; i < n; i++) {
87 a[i] = (T)0;
89 #pragma omp target
90 #pragma omp teams distribute dist_schedule(static, n)
91 for(int i = 0; i < n; i++) {
92 a[i] = (T)0;
94 return 0;
97 int main (int argc, char **argv) {
98 int n = 100;
99 int a[n];
100 #pragma omp target
101 #pragma omp teams distribute
102 for(int i = 0; i < n; i++) {
103 a[i] = 0;
105 #pragma omp target
106 #pragma omp teams distribute dist_schedule(static)
107 for(int i = 0; i < n; i++) {
108 a[i] = 0;
110 #pragma omp target
111 #pragma omp teams distribute dist_schedule(static, n)
112 for(int i = 0; i < n; i++) {
113 a[i] = 0;
115 return tmain<int, 10>(argc);
132 #endif // CK2
133 #endif // #ifndef HEADER
134 // CHECK1-LABEL: define {{[^@]+}}@_Z21teams_template_structv
135 // CHECK1-SAME: () #[[ATTR0:[0-9]+]] {
136 // CHECK1-NEXT: entry:
137 // CHECK1-NEXT: [[V:%.*]] = alloca [[STRUCT_SS:%.*]], align 4
138 // CHECK1-NEXT: [[CALL:%.*]] = call noundef signext i32 @_ZN2SSIiLi123ELx456EE3fooEv(ptr noundef nonnull align 4 dereferenceable(496) [[V]])
139 // CHECK1-NEXT: ret i32 [[CALL]]
142 // CHECK1-LABEL: define {{[^@]+}}@_ZN2SSIiLi123ELx456EE3fooEv
143 // CHECK1-SAME: (ptr noundef nonnull align 4 dereferenceable(496) [[THIS:%.*]]) #[[ATTR0]] comdat {
144 // CHECK1-NEXT: entry:
145 // CHECK1-NEXT: [[THIS_ADDR:%.*]] = alloca ptr, align 8
146 // CHECK1-NEXT: [[DOTOFFLOAD_BASEPTRS:%.*]] = alloca [1 x ptr], align 8
147 // CHECK1-NEXT: [[DOTOFFLOAD_PTRS:%.*]] = alloca [1 x ptr], align 8
148 // CHECK1-NEXT: [[DOTOFFLOAD_MAPPERS:%.*]] = alloca [1 x ptr], align 8
149 // CHECK1-NEXT: [[TMP:%.*]] = alloca i32, align 4
150 // CHECK1-NEXT: [[KERNEL_ARGS:%.*]] = alloca [[STRUCT___TGT_KERNEL_ARGUMENTS:%.*]], align 8
151 // CHECK1-NEXT: [[DOTOFFLOAD_BASEPTRS3:%.*]] = alloca [1 x ptr], align 8
152 // CHECK1-NEXT: [[DOTOFFLOAD_PTRS4:%.*]] = alloca [1 x ptr], align 8
153 // CHECK1-NEXT: [[DOTOFFLOAD_MAPPERS5:%.*]] = alloca [1 x ptr], align 8
154 // CHECK1-NEXT: [[_TMP6:%.*]] = alloca i32, align 4
155 // CHECK1-NEXT: [[KERNEL_ARGS7:%.*]] = alloca [[STRUCT___TGT_KERNEL_ARGUMENTS]], align 8
156 // CHECK1-NEXT: [[DOTOFFLOAD_BASEPTRS11:%.*]] = alloca [1 x ptr], align 8
157 // CHECK1-NEXT: [[DOTOFFLOAD_PTRS12:%.*]] = alloca [1 x ptr], align 8
158 // CHECK1-NEXT: [[DOTOFFLOAD_MAPPERS13:%.*]] = alloca [1 x ptr], align 8
159 // CHECK1-NEXT: [[_TMP14:%.*]] = alloca i32, align 4
160 // CHECK1-NEXT: [[KERNEL_ARGS15:%.*]] = alloca [[STRUCT___TGT_KERNEL_ARGUMENTS]], align 8
161 // CHECK1-NEXT: store ptr [[THIS]], ptr [[THIS_ADDR]], align 8
162 // CHECK1-NEXT: [[THIS1:%.*]] = load ptr, ptr [[THIS_ADDR]], align 8
163 // CHECK1-NEXT: [[A:%.*]] = getelementptr inbounds [[STRUCT_SS:%.*]], ptr [[THIS1]], i32 0, i32 0
164 // CHECK1-NEXT: [[TMP0:%.*]] = getelementptr inbounds [1 x ptr], ptr [[DOTOFFLOAD_BASEPTRS]], i32 0, i32 0
165 // CHECK1-NEXT: store ptr [[THIS1]], ptr [[TMP0]], align 8
166 // CHECK1-NEXT: [[TMP1:%.*]] = getelementptr inbounds [1 x ptr], ptr [[DOTOFFLOAD_PTRS]], i32 0, i32 0
167 // CHECK1-NEXT: store ptr [[A]], ptr [[TMP1]], align 8
168 // CHECK1-NEXT: [[TMP2:%.*]] = getelementptr inbounds [1 x ptr], ptr [[DOTOFFLOAD_MAPPERS]], i64 0, i64 0
169 // CHECK1-NEXT: store ptr null, ptr [[TMP2]], align 8
170 // CHECK1-NEXT: [[TMP3:%.*]] = getelementptr inbounds [1 x ptr], ptr [[DOTOFFLOAD_BASEPTRS]], i32 0, i32 0
171 // CHECK1-NEXT: [[TMP4:%.*]] = getelementptr inbounds [1 x ptr], ptr [[DOTOFFLOAD_PTRS]], i32 0, i32 0
172 // CHECK1-NEXT: [[TMP5:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 0
173 // CHECK1-NEXT: store i32 2, ptr [[TMP5]], align 4
174 // CHECK1-NEXT: [[TMP6:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 1
175 // CHECK1-NEXT: store i32 1, ptr [[TMP6]], align 4
176 // CHECK1-NEXT: [[TMP7:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 2
177 // CHECK1-NEXT: store ptr [[TMP3]], ptr [[TMP7]], align 8
178 // CHECK1-NEXT: [[TMP8:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 3
179 // CHECK1-NEXT: store ptr [[TMP4]], ptr [[TMP8]], align 8
180 // CHECK1-NEXT: [[TMP9:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 4
181 // CHECK1-NEXT: store ptr @.offload_sizes, ptr [[TMP9]], align 8
182 // CHECK1-NEXT: [[TMP10:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 5
183 // CHECK1-NEXT: store ptr @.offload_maptypes, ptr [[TMP10]], align 8
184 // CHECK1-NEXT: [[TMP11:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 6
185 // CHECK1-NEXT: store ptr null, ptr [[TMP11]], align 8
186 // CHECK1-NEXT: [[TMP12:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 7
187 // CHECK1-NEXT: store ptr null, ptr [[TMP12]], align 8
188 // CHECK1-NEXT: [[TMP13:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 8
189 // CHECK1-NEXT: store i64 123, ptr [[TMP13]], align 8
190 // CHECK1-NEXT: [[TMP14:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 9
191 // CHECK1-NEXT: store i64 0, ptr [[TMP14]], align 8
192 // CHECK1-NEXT: [[TMP15:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 10
193 // CHECK1-NEXT: store [3 x i32] zeroinitializer, ptr [[TMP15]], align 4
194 // CHECK1-NEXT: [[TMP16:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 11
195 // CHECK1-NEXT: store [3 x i32] zeroinitializer, ptr [[TMP16]], align 4
196 // CHECK1-NEXT: [[TMP17:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 12
197 // CHECK1-NEXT: store i32 0, ptr [[TMP17]], align 4
198 // CHECK1-NEXT: [[TMP18:%.*]] = call i32 @__tgt_target_kernel(ptr @[[GLOB2:[0-9]+]], i64 -1, i32 0, i32 0, ptr @.{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__ZN2SSIiLi123ELx456EE3fooEv_l28.region_id, ptr [[KERNEL_ARGS]])
199 // CHECK1-NEXT: [[TMP19:%.*]] = icmp ne i32 [[TMP18]], 0
200 // CHECK1-NEXT: br i1 [[TMP19]], label [[OMP_OFFLOAD_FAILED:%.*]], label [[OMP_OFFLOAD_CONT:%.*]]
201 // CHECK1: omp_offload.failed:
202 // CHECK1-NEXT: call void @{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__ZN2SSIiLi123ELx456EE3fooEv_l28(ptr [[THIS1]]) #[[ATTR3:[0-9]+]]
203 // CHECK1-NEXT: br label [[OMP_OFFLOAD_CONT]]
204 // CHECK1: omp_offload.cont:
205 // CHECK1-NEXT: [[A2:%.*]] = getelementptr inbounds [[STRUCT_SS]], ptr [[THIS1]], i32 0, i32 0
206 // CHECK1-NEXT: [[TMP20:%.*]] = getelementptr inbounds [1 x ptr], ptr [[DOTOFFLOAD_BASEPTRS3]], i32 0, i32 0
207 // CHECK1-NEXT: store ptr [[THIS1]], ptr [[TMP20]], align 8
208 // CHECK1-NEXT: [[TMP21:%.*]] = getelementptr inbounds [1 x ptr], ptr [[DOTOFFLOAD_PTRS4]], i32 0, i32 0
209 // CHECK1-NEXT: store ptr [[A2]], ptr [[TMP21]], align 8
210 // CHECK1-NEXT: [[TMP22:%.*]] = getelementptr inbounds [1 x ptr], ptr [[DOTOFFLOAD_MAPPERS5]], i64 0, i64 0
211 // CHECK1-NEXT: store ptr null, ptr [[TMP22]], align 8
212 // CHECK1-NEXT: [[TMP23:%.*]] = getelementptr inbounds [1 x ptr], ptr [[DOTOFFLOAD_BASEPTRS3]], i32 0, i32 0
213 // CHECK1-NEXT: [[TMP24:%.*]] = getelementptr inbounds [1 x ptr], ptr [[DOTOFFLOAD_PTRS4]], i32 0, i32 0
214 // CHECK1-NEXT: [[TMP25:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS7]], i32 0, i32 0
215 // CHECK1-NEXT: store i32 2, ptr [[TMP25]], align 4
216 // CHECK1-NEXT: [[TMP26:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS7]], i32 0, i32 1
217 // CHECK1-NEXT: store i32 1, ptr [[TMP26]], align 4
218 // CHECK1-NEXT: [[TMP27:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS7]], i32 0, i32 2
219 // CHECK1-NEXT: store ptr [[TMP23]], ptr [[TMP27]], align 8
220 // CHECK1-NEXT: [[TMP28:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS7]], i32 0, i32 3
221 // CHECK1-NEXT: store ptr [[TMP24]], ptr [[TMP28]], align 8
222 // CHECK1-NEXT: [[TMP29:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS7]], i32 0, i32 4
223 // CHECK1-NEXT: store ptr @.offload_sizes.1, ptr [[TMP29]], align 8
224 // CHECK1-NEXT: [[TMP30:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS7]], i32 0, i32 5
225 // CHECK1-NEXT: store ptr @.offload_maptypes.2, ptr [[TMP30]], align 8
226 // CHECK1-NEXT: [[TMP31:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS7]], i32 0, i32 6
227 // CHECK1-NEXT: store ptr null, ptr [[TMP31]], align 8
228 // CHECK1-NEXT: [[TMP32:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS7]], i32 0, i32 7
229 // CHECK1-NEXT: store ptr null, ptr [[TMP32]], align 8
230 // CHECK1-NEXT: [[TMP33:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS7]], i32 0, i32 8
231 // CHECK1-NEXT: store i64 123, ptr [[TMP33]], align 8
232 // CHECK1-NEXT: [[TMP34:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS7]], i32 0, i32 9
233 // CHECK1-NEXT: store i64 0, ptr [[TMP34]], align 8
234 // CHECK1-NEXT: [[TMP35:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS7]], i32 0, i32 10
235 // CHECK1-NEXT: store [3 x i32] zeroinitializer, ptr [[TMP35]], align 4
236 // CHECK1-NEXT: [[TMP36:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS7]], i32 0, i32 11
237 // CHECK1-NEXT: store [3 x i32] zeroinitializer, ptr [[TMP36]], align 4
238 // CHECK1-NEXT: [[TMP37:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS7]], i32 0, i32 12
239 // CHECK1-NEXT: store i32 0, ptr [[TMP37]], align 4
240 // CHECK1-NEXT: [[TMP38:%.*]] = call i32 @__tgt_target_kernel(ptr @[[GLOB2]], i64 -1, i32 0, i32 0, ptr @.{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__ZN2SSIiLi123ELx456EE3fooEv_l33.region_id, ptr [[KERNEL_ARGS7]])
241 // CHECK1-NEXT: [[TMP39:%.*]] = icmp ne i32 [[TMP38]], 0
242 // CHECK1-NEXT: br i1 [[TMP39]], label [[OMP_OFFLOAD_FAILED8:%.*]], label [[OMP_OFFLOAD_CONT9:%.*]]
243 // CHECK1: omp_offload.failed8:
244 // CHECK1-NEXT: call void @{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__ZN2SSIiLi123ELx456EE3fooEv_l33(ptr [[THIS1]]) #[[ATTR3]]
245 // CHECK1-NEXT: br label [[OMP_OFFLOAD_CONT9]]
246 // CHECK1: omp_offload.cont9:
247 // CHECK1-NEXT: [[A10:%.*]] = getelementptr inbounds [[STRUCT_SS]], ptr [[THIS1]], i32 0, i32 0
248 // CHECK1-NEXT: [[TMP40:%.*]] = getelementptr inbounds [1 x ptr], ptr [[DOTOFFLOAD_BASEPTRS11]], i32 0, i32 0
249 // CHECK1-NEXT: store ptr [[THIS1]], ptr [[TMP40]], align 8
250 // CHECK1-NEXT: [[TMP41:%.*]] = getelementptr inbounds [1 x ptr], ptr [[DOTOFFLOAD_PTRS12]], i32 0, i32 0
251 // CHECK1-NEXT: store ptr [[A10]], ptr [[TMP41]], align 8
252 // CHECK1-NEXT: [[TMP42:%.*]] = getelementptr inbounds [1 x ptr], ptr [[DOTOFFLOAD_MAPPERS13]], i64 0, i64 0
253 // CHECK1-NEXT: store ptr null, ptr [[TMP42]], align 8
254 // CHECK1-NEXT: [[TMP43:%.*]] = getelementptr inbounds [1 x ptr], ptr [[DOTOFFLOAD_BASEPTRS11]], i32 0, i32 0
255 // CHECK1-NEXT: [[TMP44:%.*]] = getelementptr inbounds [1 x ptr], ptr [[DOTOFFLOAD_PTRS12]], i32 0, i32 0
256 // CHECK1-NEXT: [[TMP45:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS15]], i32 0, i32 0
257 // CHECK1-NEXT: store i32 2, ptr [[TMP45]], align 4
258 // CHECK1-NEXT: [[TMP46:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS15]], i32 0, i32 1
259 // CHECK1-NEXT: store i32 1, ptr [[TMP46]], align 4
260 // CHECK1-NEXT: [[TMP47:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS15]], i32 0, i32 2
261 // CHECK1-NEXT: store ptr [[TMP43]], ptr [[TMP47]], align 8
262 // CHECK1-NEXT: [[TMP48:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS15]], i32 0, i32 3
263 // CHECK1-NEXT: store ptr [[TMP44]], ptr [[TMP48]], align 8
264 // CHECK1-NEXT: [[TMP49:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS15]], i32 0, i32 4
265 // CHECK1-NEXT: store ptr @.offload_sizes.3, ptr [[TMP49]], align 8
266 // CHECK1-NEXT: [[TMP50:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS15]], i32 0, i32 5
267 // CHECK1-NEXT: store ptr @.offload_maptypes.4, ptr [[TMP50]], align 8
268 // CHECK1-NEXT: [[TMP51:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS15]], i32 0, i32 6
269 // CHECK1-NEXT: store ptr null, ptr [[TMP51]], align 8
270 // CHECK1-NEXT: [[TMP52:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS15]], i32 0, i32 7
271 // CHECK1-NEXT: store ptr null, ptr [[TMP52]], align 8
272 // CHECK1-NEXT: [[TMP53:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS15]], i32 0, i32 8
273 // CHECK1-NEXT: store i64 123, ptr [[TMP53]], align 8
274 // CHECK1-NEXT: [[TMP54:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS15]], i32 0, i32 9
275 // CHECK1-NEXT: store i64 0, ptr [[TMP54]], align 8
276 // CHECK1-NEXT: [[TMP55:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS15]], i32 0, i32 10
277 // CHECK1-NEXT: store [3 x i32] zeroinitializer, ptr [[TMP55]], align 4
278 // CHECK1-NEXT: [[TMP56:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS15]], i32 0, i32 11
279 // CHECK1-NEXT: store [3 x i32] zeroinitializer, ptr [[TMP56]], align 4
280 // CHECK1-NEXT: [[TMP57:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS15]], i32 0, i32 12
281 // CHECK1-NEXT: store i32 0, ptr [[TMP57]], align 4
282 // CHECK1-NEXT: [[TMP58:%.*]] = call i32 @__tgt_target_kernel(ptr @[[GLOB2]], i64 -1, i32 0, i32 0, ptr @.{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__ZN2SSIiLi123ELx456EE3fooEv_l38.region_id, ptr [[KERNEL_ARGS15]])
283 // CHECK1-NEXT: [[TMP59:%.*]] = icmp ne i32 [[TMP58]], 0
284 // CHECK1-NEXT: br i1 [[TMP59]], label [[OMP_OFFLOAD_FAILED16:%.*]], label [[OMP_OFFLOAD_CONT17:%.*]]
285 // CHECK1: omp_offload.failed16:
286 // CHECK1-NEXT: call void @{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__ZN2SSIiLi123ELx456EE3fooEv_l38(ptr [[THIS1]]) #[[ATTR3]]
287 // CHECK1-NEXT: br label [[OMP_OFFLOAD_CONT17]]
288 // CHECK1: omp_offload.cont17:
289 // CHECK1-NEXT: [[A18:%.*]] = getelementptr inbounds [[STRUCT_SS]], ptr [[THIS1]], i32 0, i32 0
290 // CHECK1-NEXT: [[ARRAYIDX:%.*]] = getelementptr inbounds [123 x i32], ptr [[A18]], i64 0, i64 0
291 // CHECK1-NEXT: [[TMP60:%.*]] = load i32, ptr [[ARRAYIDX]], align 4
292 // CHECK1-NEXT: ret i32 [[TMP60]]
295 // CHECK1-LABEL: define {{[^@]+}}@{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__ZN2SSIiLi123ELx456EE3fooEv_l28
296 // CHECK1-SAME: (ptr noundef [[THIS:%.*]]) #[[ATTR1:[0-9]+]] {
297 // CHECK1-NEXT: entry:
298 // CHECK1-NEXT: [[THIS_ADDR:%.*]] = alloca ptr, align 8
299 // CHECK1-NEXT: store ptr [[THIS]], ptr [[THIS_ADDR]], align 8
300 // CHECK1-NEXT: [[TMP0:%.*]] = load ptr, ptr [[THIS_ADDR]], align 8
301 // CHECK1-NEXT: call void (ptr, i32, ptr, ...) @__kmpc_fork_teams(ptr @[[GLOB2]], i32 1, ptr @{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__ZN2SSIiLi123ELx456EE3fooEv_l28.omp_outlined, ptr [[TMP0]])
302 // CHECK1-NEXT: ret void
305 // CHECK1-LABEL: define {{[^@]+}}@{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__ZN2SSIiLi123ELx456EE3fooEv_l28.omp_outlined
306 // CHECK1-SAME: (ptr noalias noundef [[DOTGLOBAL_TID_:%.*]], ptr noalias noundef [[DOTBOUND_TID_:%.*]], ptr noundef [[THIS:%.*]]) #[[ATTR2:[0-9]+]] {
307 // CHECK1-NEXT: entry:
308 // CHECK1-NEXT: [[DOTGLOBAL_TID__ADDR:%.*]] = alloca ptr, align 8
309 // CHECK1-NEXT: [[DOTBOUND_TID__ADDR:%.*]] = alloca ptr, align 8
310 // CHECK1-NEXT: [[THIS_ADDR:%.*]] = alloca ptr, align 8
311 // CHECK1-NEXT: [[DOTOMP_IV:%.*]] = alloca i32, align 4
312 // CHECK1-NEXT: [[TMP:%.*]] = alloca i32, align 4
313 // CHECK1-NEXT: [[DOTOMP_LB:%.*]] = alloca i32, align 4
314 // CHECK1-NEXT: [[DOTOMP_UB:%.*]] = alloca i32, align 4
315 // CHECK1-NEXT: [[DOTOMP_STRIDE:%.*]] = alloca i32, align 4
316 // CHECK1-NEXT: [[DOTOMP_IS_LAST:%.*]] = alloca i32, align 4
317 // CHECK1-NEXT: [[I:%.*]] = alloca i32, align 4
318 // CHECK1-NEXT: store ptr [[DOTGLOBAL_TID_]], ptr [[DOTGLOBAL_TID__ADDR]], align 8
319 // CHECK1-NEXT: store ptr [[DOTBOUND_TID_]], ptr [[DOTBOUND_TID__ADDR]], align 8
320 // CHECK1-NEXT: store ptr [[THIS]], ptr [[THIS_ADDR]], align 8
321 // CHECK1-NEXT: [[TMP0:%.*]] = load ptr, ptr [[THIS_ADDR]], align 8
322 // CHECK1-NEXT: store i32 0, ptr [[DOTOMP_LB]], align 4
323 // CHECK1-NEXT: store i32 122, ptr [[DOTOMP_UB]], align 4
324 // CHECK1-NEXT: store i32 1, ptr [[DOTOMP_STRIDE]], align 4
325 // CHECK1-NEXT: store i32 0, ptr [[DOTOMP_IS_LAST]], align 4
326 // CHECK1-NEXT: [[TMP1:%.*]] = load ptr, ptr [[DOTGLOBAL_TID__ADDR]], align 8
327 // CHECK1-NEXT: [[TMP2:%.*]] = load i32, ptr [[TMP1]], align 4
328 // CHECK1-NEXT: call void @__kmpc_for_static_init_4(ptr @[[GLOB1:[0-9]+]], i32 [[TMP2]], i32 92, ptr [[DOTOMP_IS_LAST]], ptr [[DOTOMP_LB]], ptr [[DOTOMP_UB]], ptr [[DOTOMP_STRIDE]], i32 1, i32 1)
329 // CHECK1-NEXT: [[TMP3:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4
330 // CHECK1-NEXT: [[CMP:%.*]] = icmp sgt i32 [[TMP3]], 122
331 // CHECK1-NEXT: br i1 [[CMP]], label [[COND_TRUE:%.*]], label [[COND_FALSE:%.*]]
332 // CHECK1: cond.true:
333 // CHECK1-NEXT: br label [[COND_END:%.*]]
334 // CHECK1: cond.false:
335 // CHECK1-NEXT: [[TMP4:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4
336 // CHECK1-NEXT: br label [[COND_END]]
337 // CHECK1: cond.end:
338 // CHECK1-NEXT: [[COND:%.*]] = phi i32 [ 122, [[COND_TRUE]] ], [ [[TMP4]], [[COND_FALSE]] ]
339 // CHECK1-NEXT: store i32 [[COND]], ptr [[DOTOMP_UB]], align 4
340 // CHECK1-NEXT: [[TMP5:%.*]] = load i32, ptr [[DOTOMP_LB]], align 4
341 // CHECK1-NEXT: store i32 [[TMP5]], ptr [[DOTOMP_IV]], align 4
342 // CHECK1-NEXT: br label [[OMP_INNER_FOR_COND:%.*]]
343 // CHECK1: omp.inner.for.cond:
344 // CHECK1-NEXT: [[TMP6:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4
345 // CHECK1-NEXT: [[TMP7:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4
346 // CHECK1-NEXT: [[CMP1:%.*]] = icmp sle i32 [[TMP6]], [[TMP7]]
347 // CHECK1-NEXT: br i1 [[CMP1]], label [[OMP_INNER_FOR_BODY:%.*]], label [[OMP_INNER_FOR_END:%.*]]
348 // CHECK1: omp.inner.for.body:
349 // CHECK1-NEXT: [[TMP8:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4
350 // CHECK1-NEXT: [[MUL:%.*]] = mul nsw i32 [[TMP8]], 1
351 // CHECK1-NEXT: [[ADD:%.*]] = add nsw i32 0, [[MUL]]
352 // CHECK1-NEXT: store i32 [[ADD]], ptr [[I]], align 4
353 // CHECK1-NEXT: [[A:%.*]] = getelementptr inbounds [[STRUCT_SS:%.*]], ptr [[TMP0]], i32 0, i32 0
354 // CHECK1-NEXT: [[TMP9:%.*]] = load i32, ptr [[I]], align 4
355 // CHECK1-NEXT: [[IDXPROM:%.*]] = sext i32 [[TMP9]] to i64
356 // CHECK1-NEXT: [[ARRAYIDX:%.*]] = getelementptr inbounds [123 x i32], ptr [[A]], i64 0, i64 [[IDXPROM]]
357 // CHECK1-NEXT: store i32 0, ptr [[ARRAYIDX]], align 4
358 // CHECK1-NEXT: br label [[OMP_BODY_CONTINUE:%.*]]
359 // CHECK1: omp.body.continue:
360 // CHECK1-NEXT: br label [[OMP_INNER_FOR_INC:%.*]]
361 // CHECK1: omp.inner.for.inc:
362 // CHECK1-NEXT: [[TMP10:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4
363 // CHECK1-NEXT: [[ADD2:%.*]] = add nsw i32 [[TMP10]], 1
364 // CHECK1-NEXT: store i32 [[ADD2]], ptr [[DOTOMP_IV]], align 4
365 // CHECK1-NEXT: br label [[OMP_INNER_FOR_COND]]
366 // CHECK1: omp.inner.for.end:
367 // CHECK1-NEXT: br label [[OMP_LOOP_EXIT:%.*]]
368 // CHECK1: omp.loop.exit:
369 // CHECK1-NEXT: call void @__kmpc_for_static_fini(ptr @[[GLOB1]], i32 [[TMP2]])
370 // CHECK1-NEXT: ret void
373 // CHECK1-LABEL: define {{[^@]+}}@{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__ZN2SSIiLi123ELx456EE3fooEv_l33
374 // CHECK1-SAME: (ptr noundef [[THIS:%.*]]) #[[ATTR1]] {
375 // CHECK1-NEXT: entry:
376 // CHECK1-NEXT: [[THIS_ADDR:%.*]] = alloca ptr, align 8
377 // CHECK1-NEXT: store ptr [[THIS]], ptr [[THIS_ADDR]], align 8
378 // CHECK1-NEXT: [[TMP0:%.*]] = load ptr, ptr [[THIS_ADDR]], align 8
379 // CHECK1-NEXT: call void (ptr, i32, ptr, ...) @__kmpc_fork_teams(ptr @[[GLOB2]], i32 1, ptr @{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__ZN2SSIiLi123ELx456EE3fooEv_l33.omp_outlined, ptr [[TMP0]])
380 // CHECK1-NEXT: ret void
383 // CHECK1-LABEL: define {{[^@]+}}@{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__ZN2SSIiLi123ELx456EE3fooEv_l33.omp_outlined
384 // CHECK1-SAME: (ptr noalias noundef [[DOTGLOBAL_TID_:%.*]], ptr noalias noundef [[DOTBOUND_TID_:%.*]], ptr noundef [[THIS:%.*]]) #[[ATTR2]] {
385 // CHECK1-NEXT: entry:
386 // CHECK1-NEXT: [[DOTGLOBAL_TID__ADDR:%.*]] = alloca ptr, align 8
387 // CHECK1-NEXT: [[DOTBOUND_TID__ADDR:%.*]] = alloca ptr, align 8
388 // CHECK1-NEXT: [[THIS_ADDR:%.*]] = alloca ptr, align 8
389 // CHECK1-NEXT: [[DOTOMP_IV:%.*]] = alloca i32, align 4
390 // CHECK1-NEXT: [[TMP:%.*]] = alloca i32, align 4
391 // CHECK1-NEXT: [[DOTOMP_LB:%.*]] = alloca i32, align 4
392 // CHECK1-NEXT: [[DOTOMP_UB:%.*]] = alloca i32, align 4
393 // CHECK1-NEXT: [[DOTOMP_STRIDE:%.*]] = alloca i32, align 4
394 // CHECK1-NEXT: [[DOTOMP_IS_LAST:%.*]] = alloca i32, align 4
395 // CHECK1-NEXT: [[I:%.*]] = alloca i32, align 4
396 // CHECK1-NEXT: store ptr [[DOTGLOBAL_TID_]], ptr [[DOTGLOBAL_TID__ADDR]], align 8
397 // CHECK1-NEXT: store ptr [[DOTBOUND_TID_]], ptr [[DOTBOUND_TID__ADDR]], align 8
398 // CHECK1-NEXT: store ptr [[THIS]], ptr [[THIS_ADDR]], align 8
399 // CHECK1-NEXT: [[TMP0:%.*]] = load ptr, ptr [[THIS_ADDR]], align 8
400 // CHECK1-NEXT: store i32 0, ptr [[DOTOMP_LB]], align 4
401 // CHECK1-NEXT: store i32 122, ptr [[DOTOMP_UB]], align 4
402 // CHECK1-NEXT: store i32 1, ptr [[DOTOMP_STRIDE]], align 4
403 // CHECK1-NEXT: store i32 0, ptr [[DOTOMP_IS_LAST]], align 4
404 // CHECK1-NEXT: [[TMP1:%.*]] = load ptr, ptr [[DOTGLOBAL_TID__ADDR]], align 8
405 // CHECK1-NEXT: [[TMP2:%.*]] = load i32, ptr [[TMP1]], align 4
406 // CHECK1-NEXT: call void @__kmpc_for_static_init_4(ptr @[[GLOB1]], i32 [[TMP2]], i32 92, ptr [[DOTOMP_IS_LAST]], ptr [[DOTOMP_LB]], ptr [[DOTOMP_UB]], ptr [[DOTOMP_STRIDE]], i32 1, i32 1)
407 // CHECK1-NEXT: [[TMP3:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4
408 // CHECK1-NEXT: [[CMP:%.*]] = icmp sgt i32 [[TMP3]], 122
409 // CHECK1-NEXT: br i1 [[CMP]], label [[COND_TRUE:%.*]], label [[COND_FALSE:%.*]]
410 // CHECK1: cond.true:
411 // CHECK1-NEXT: br label [[COND_END:%.*]]
412 // CHECK1: cond.false:
413 // CHECK1-NEXT: [[TMP4:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4
414 // CHECK1-NEXT: br label [[COND_END]]
415 // CHECK1: cond.end:
416 // CHECK1-NEXT: [[COND:%.*]] = phi i32 [ 122, [[COND_TRUE]] ], [ [[TMP4]], [[COND_FALSE]] ]
417 // CHECK1-NEXT: store i32 [[COND]], ptr [[DOTOMP_UB]], align 4
418 // CHECK1-NEXT: [[TMP5:%.*]] = load i32, ptr [[DOTOMP_LB]], align 4
419 // CHECK1-NEXT: store i32 [[TMP5]], ptr [[DOTOMP_IV]], align 4
420 // CHECK1-NEXT: br label [[OMP_INNER_FOR_COND:%.*]]
421 // CHECK1: omp.inner.for.cond:
422 // CHECK1-NEXT: [[TMP6:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4
423 // CHECK1-NEXT: [[TMP7:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4
424 // CHECK1-NEXT: [[CMP1:%.*]] = icmp sle i32 [[TMP6]], [[TMP7]]
425 // CHECK1-NEXT: br i1 [[CMP1]], label [[OMP_INNER_FOR_BODY:%.*]], label [[OMP_INNER_FOR_END:%.*]]
426 // CHECK1: omp.inner.for.body:
427 // CHECK1-NEXT: [[TMP8:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4
428 // CHECK1-NEXT: [[MUL:%.*]] = mul nsw i32 [[TMP8]], 1
429 // CHECK1-NEXT: [[ADD:%.*]] = add nsw i32 0, [[MUL]]
430 // CHECK1-NEXT: store i32 [[ADD]], ptr [[I]], align 4
431 // CHECK1-NEXT: [[A:%.*]] = getelementptr inbounds [[STRUCT_SS:%.*]], ptr [[TMP0]], i32 0, i32 0
432 // CHECK1-NEXT: [[TMP9:%.*]] = load i32, ptr [[I]], align 4
433 // CHECK1-NEXT: [[IDXPROM:%.*]] = sext i32 [[TMP9]] to i64
434 // CHECK1-NEXT: [[ARRAYIDX:%.*]] = getelementptr inbounds [123 x i32], ptr [[A]], i64 0, i64 [[IDXPROM]]
435 // CHECK1-NEXT: store i32 0, ptr [[ARRAYIDX]], align 4
436 // CHECK1-NEXT: br label [[OMP_BODY_CONTINUE:%.*]]
437 // CHECK1: omp.body.continue:
438 // CHECK1-NEXT: br label [[OMP_INNER_FOR_INC:%.*]]
439 // CHECK1: omp.inner.for.inc:
440 // CHECK1-NEXT: [[TMP10:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4
441 // CHECK1-NEXT: [[ADD2:%.*]] = add nsw i32 [[TMP10]], 1
442 // CHECK1-NEXT: store i32 [[ADD2]], ptr [[DOTOMP_IV]], align 4
443 // CHECK1-NEXT: br label [[OMP_INNER_FOR_COND]]
444 // CHECK1: omp.inner.for.end:
445 // CHECK1-NEXT: br label [[OMP_LOOP_EXIT:%.*]]
446 // CHECK1: omp.loop.exit:
447 // CHECK1-NEXT: call void @__kmpc_for_static_fini(ptr @[[GLOB1]], i32 [[TMP2]])
448 // CHECK1-NEXT: ret void
451 // CHECK1-LABEL: define {{[^@]+}}@{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__ZN2SSIiLi123ELx456EE3fooEv_l38
452 // CHECK1-SAME: (ptr noundef [[THIS:%.*]]) #[[ATTR1]] {
453 // CHECK1-NEXT: entry:
454 // CHECK1-NEXT: [[THIS_ADDR:%.*]] = alloca ptr, align 8
455 // CHECK1-NEXT: store ptr [[THIS]], ptr [[THIS_ADDR]], align 8
456 // CHECK1-NEXT: [[TMP0:%.*]] = load ptr, ptr [[THIS_ADDR]], align 8
457 // CHECK1-NEXT: call void (ptr, i32, ptr, ...) @__kmpc_fork_teams(ptr @[[GLOB2]], i32 1, ptr @{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__ZN2SSIiLi123ELx456EE3fooEv_l38.omp_outlined, ptr [[TMP0]])
458 // CHECK1-NEXT: ret void
461 // CHECK1-LABEL: define {{[^@]+}}@{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__ZN2SSIiLi123ELx456EE3fooEv_l38.omp_outlined
462 // CHECK1-SAME: (ptr noalias noundef [[DOTGLOBAL_TID_:%.*]], ptr noalias noundef [[DOTBOUND_TID_:%.*]], ptr noundef [[THIS:%.*]]) #[[ATTR2]] {
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: [[THIS_ADDR:%.*]] = alloca ptr, align 8
467 // CHECK1-NEXT: [[DOTOMP_IV:%.*]] = alloca i32, align 4
468 // CHECK1-NEXT: [[TMP:%.*]] = alloca i32, align 4
469 // CHECK1-NEXT: [[DOTOMP_LB:%.*]] = alloca i32, align 4
470 // CHECK1-NEXT: [[DOTOMP_UB:%.*]] = alloca i32, align 4
471 // CHECK1-NEXT: [[DOTOMP_STRIDE:%.*]] = alloca i32, align 4
472 // CHECK1-NEXT: [[DOTOMP_IS_LAST:%.*]] = alloca i32, align 4
473 // CHECK1-NEXT: [[I:%.*]] = alloca i32, align 4
474 // CHECK1-NEXT: store ptr [[DOTGLOBAL_TID_]], ptr [[DOTGLOBAL_TID__ADDR]], align 8
475 // CHECK1-NEXT: store ptr [[DOTBOUND_TID_]], ptr [[DOTBOUND_TID__ADDR]], align 8
476 // CHECK1-NEXT: store ptr [[THIS]], ptr [[THIS_ADDR]], align 8
477 // CHECK1-NEXT: [[TMP0:%.*]] = load ptr, ptr [[THIS_ADDR]], align 8
478 // CHECK1-NEXT: store i32 0, ptr [[DOTOMP_LB]], align 4
479 // CHECK1-NEXT: store i32 122, ptr [[DOTOMP_UB]], align 4
480 // CHECK1-NEXT: store i32 1, ptr [[DOTOMP_STRIDE]], align 4
481 // CHECK1-NEXT: store i32 0, ptr [[DOTOMP_IS_LAST]], align 4
482 // CHECK1-NEXT: [[TMP1:%.*]] = load ptr, ptr [[DOTGLOBAL_TID__ADDR]], align 8
483 // CHECK1-NEXT: [[TMP2:%.*]] = load i32, ptr [[TMP1]], align 4
484 // CHECK1-NEXT: call void @__kmpc_for_static_init_4(ptr @[[GLOB1]], i32 [[TMP2]], i32 91, ptr [[DOTOMP_IS_LAST]], ptr [[DOTOMP_LB]], ptr [[DOTOMP_UB]], ptr [[DOTOMP_STRIDE]], i32 1, i32 61)
485 // CHECK1-NEXT: br label [[OMP_DISPATCH_COND:%.*]]
486 // CHECK1: omp.dispatch.cond:
487 // CHECK1-NEXT: [[TMP3:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4
488 // CHECK1-NEXT: [[CMP:%.*]] = icmp sgt i32 [[TMP3]], 122
489 // CHECK1-NEXT: br i1 [[CMP]], label [[COND_TRUE:%.*]], label [[COND_FALSE:%.*]]
490 // CHECK1: cond.true:
491 // CHECK1-NEXT: br label [[COND_END:%.*]]
492 // CHECK1: cond.false:
493 // CHECK1-NEXT: [[TMP4:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4
494 // CHECK1-NEXT: br label [[COND_END]]
495 // CHECK1: cond.end:
496 // CHECK1-NEXT: [[COND:%.*]] = phi i32 [ 122, [[COND_TRUE]] ], [ [[TMP4]], [[COND_FALSE]] ]
497 // CHECK1-NEXT: store i32 [[COND]], ptr [[DOTOMP_UB]], align 4
498 // CHECK1-NEXT: [[TMP5:%.*]] = load i32, ptr [[DOTOMP_LB]], align 4
499 // CHECK1-NEXT: store i32 [[TMP5]], ptr [[DOTOMP_IV]], align 4
500 // CHECK1-NEXT: [[TMP6:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4
501 // CHECK1-NEXT: [[TMP7:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4
502 // CHECK1-NEXT: [[CMP1:%.*]] = icmp sle i32 [[TMP6]], [[TMP7]]
503 // CHECK1-NEXT: br i1 [[CMP1]], label [[OMP_DISPATCH_BODY:%.*]], label [[OMP_DISPATCH_END:%.*]]
504 // CHECK1: omp.dispatch.body:
505 // CHECK1-NEXT: br label [[OMP_INNER_FOR_COND:%.*]]
506 // CHECK1: omp.inner.for.cond:
507 // CHECK1-NEXT: [[TMP8:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP8:![0-9]+]]
508 // CHECK1-NEXT: [[TMP9:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4, !llvm.access.group [[ACC_GRP8]]
509 // CHECK1-NEXT: [[CMP2:%.*]] = icmp sle i32 [[TMP8]], [[TMP9]]
510 // CHECK1-NEXT: br i1 [[CMP2]], label [[OMP_INNER_FOR_BODY:%.*]], label [[OMP_INNER_FOR_END:%.*]]
511 // CHECK1: omp.inner.for.body:
512 // CHECK1-NEXT: [[TMP10:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP8]]
513 // CHECK1-NEXT: [[MUL:%.*]] = mul nsw i32 [[TMP10]], 1
514 // CHECK1-NEXT: [[ADD:%.*]] = add nsw i32 0, [[MUL]]
515 // CHECK1-NEXT: store i32 [[ADD]], ptr [[I]], align 4, !llvm.access.group [[ACC_GRP8]]
516 // CHECK1-NEXT: [[A:%.*]] = getelementptr inbounds [[STRUCT_SS:%.*]], ptr [[TMP0]], i32 0, i32 0
517 // CHECK1-NEXT: [[TMP11:%.*]] = load i32, ptr [[I]], align 4, !llvm.access.group [[ACC_GRP8]]
518 // CHECK1-NEXT: [[IDXPROM:%.*]] = sext i32 [[TMP11]] to i64
519 // CHECK1-NEXT: [[ARRAYIDX:%.*]] = getelementptr inbounds [123 x i32], ptr [[A]], i64 0, i64 [[IDXPROM]]
520 // CHECK1-NEXT: store i32 0, ptr [[ARRAYIDX]], align 4, !llvm.access.group [[ACC_GRP8]]
521 // CHECK1-NEXT: br label [[OMP_BODY_CONTINUE:%.*]]
522 // CHECK1: omp.body.continue:
523 // CHECK1-NEXT: br label [[OMP_INNER_FOR_INC:%.*]]
524 // CHECK1: omp.inner.for.inc:
525 // CHECK1-NEXT: [[TMP12:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP8]]
526 // CHECK1-NEXT: [[ADD3:%.*]] = add nsw i32 [[TMP12]], 1
527 // CHECK1-NEXT: store i32 [[ADD3]], ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP8]]
528 // CHECK1-NEXT: br label [[OMP_INNER_FOR_COND]], !llvm.loop [[LOOP9:![0-9]+]]
529 // CHECK1: omp.inner.for.end:
530 // CHECK1-NEXT: br label [[OMP_DISPATCH_INC:%.*]]
531 // CHECK1: omp.dispatch.inc:
532 // CHECK1-NEXT: [[TMP13:%.*]] = load i32, ptr [[DOTOMP_LB]], align 4
533 // CHECK1-NEXT: [[TMP14:%.*]] = load i32, ptr [[DOTOMP_STRIDE]], align 4
534 // CHECK1-NEXT: [[ADD4:%.*]] = add nsw i32 [[TMP13]], [[TMP14]]
535 // CHECK1-NEXT: store i32 [[ADD4]], ptr [[DOTOMP_LB]], align 4
536 // CHECK1-NEXT: [[TMP15:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4
537 // CHECK1-NEXT: [[TMP16:%.*]] = load i32, ptr [[DOTOMP_STRIDE]], align 4
538 // CHECK1-NEXT: [[ADD5:%.*]] = add nsw i32 [[TMP15]], [[TMP16]]
539 // CHECK1-NEXT: store i32 [[ADD5]], ptr [[DOTOMP_UB]], align 4
540 // CHECK1-NEXT: br label [[OMP_DISPATCH_COND]]
541 // CHECK1: omp.dispatch.end:
542 // CHECK1-NEXT: call void @__kmpc_for_static_fini(ptr @[[GLOB1]], i32 [[TMP2]])
543 // CHECK1-NEXT: ret void
546 // CHECK1-LABEL: define {{[^@]+}}@.omp_offloading.requires_reg
547 // CHECK1-SAME: () #[[ATTR4:[0-9]+]] {
548 // CHECK1-NEXT: entry:
549 // CHECK1-NEXT: call void @__tgt_register_requires(i64 1)
550 // CHECK1-NEXT: ret void
553 // CHECK3-LABEL: define {{[^@]+}}@_Z21teams_template_structv
554 // CHECK3-SAME: () #[[ATTR0:[0-9]+]] {
555 // CHECK3-NEXT: entry:
556 // CHECK3-NEXT: [[V:%.*]] = alloca [[STRUCT_SS:%.*]], align 4
557 // CHECK3-NEXT: [[CALL:%.*]] = call noundef i32 @_ZN2SSIiLi123ELx456EE3fooEv(ptr noundef nonnull align 4 dereferenceable(496) [[V]])
558 // CHECK3-NEXT: ret i32 [[CALL]]
561 // CHECK3-LABEL: define {{[^@]+}}@_ZN2SSIiLi123ELx456EE3fooEv
562 // CHECK3-SAME: (ptr noundef nonnull align 4 dereferenceable(496) [[THIS:%.*]]) #[[ATTR0]] comdat align 2 {
563 // CHECK3-NEXT: entry:
564 // CHECK3-NEXT: [[THIS_ADDR:%.*]] = alloca ptr, align 4
565 // CHECK3-NEXT: [[DOTOFFLOAD_BASEPTRS:%.*]] = alloca [1 x ptr], align 4
566 // CHECK3-NEXT: [[DOTOFFLOAD_PTRS:%.*]] = alloca [1 x ptr], align 4
567 // CHECK3-NEXT: [[DOTOFFLOAD_MAPPERS:%.*]] = alloca [1 x ptr], align 4
568 // CHECK3-NEXT: [[TMP:%.*]] = alloca i32, align 4
569 // CHECK3-NEXT: [[KERNEL_ARGS:%.*]] = alloca [[STRUCT___TGT_KERNEL_ARGUMENTS:%.*]], align 8
570 // CHECK3-NEXT: [[DOTOFFLOAD_BASEPTRS3:%.*]] = alloca [1 x ptr], align 4
571 // CHECK3-NEXT: [[DOTOFFLOAD_PTRS4:%.*]] = alloca [1 x ptr], align 4
572 // CHECK3-NEXT: [[DOTOFFLOAD_MAPPERS5:%.*]] = alloca [1 x ptr], align 4
573 // CHECK3-NEXT: [[_TMP6:%.*]] = alloca i32, align 4
574 // CHECK3-NEXT: [[KERNEL_ARGS7:%.*]] = alloca [[STRUCT___TGT_KERNEL_ARGUMENTS]], align 8
575 // CHECK3-NEXT: [[DOTOFFLOAD_BASEPTRS11:%.*]] = alloca [1 x ptr], align 4
576 // CHECK3-NEXT: [[DOTOFFLOAD_PTRS12:%.*]] = alloca [1 x ptr], align 4
577 // CHECK3-NEXT: [[DOTOFFLOAD_MAPPERS13:%.*]] = alloca [1 x ptr], align 4
578 // CHECK3-NEXT: [[_TMP14:%.*]] = alloca i32, align 4
579 // CHECK3-NEXT: [[KERNEL_ARGS15:%.*]] = alloca [[STRUCT___TGT_KERNEL_ARGUMENTS]], align 8
580 // CHECK3-NEXT: store ptr [[THIS]], ptr [[THIS_ADDR]], align 4
581 // CHECK3-NEXT: [[THIS1:%.*]] = load ptr, ptr [[THIS_ADDR]], align 4
582 // CHECK3-NEXT: [[A:%.*]] = getelementptr inbounds [[STRUCT_SS:%.*]], ptr [[THIS1]], i32 0, i32 0
583 // CHECK3-NEXT: [[TMP0:%.*]] = getelementptr inbounds [1 x ptr], ptr [[DOTOFFLOAD_BASEPTRS]], i32 0, i32 0
584 // CHECK3-NEXT: store ptr [[THIS1]], ptr [[TMP0]], align 4
585 // CHECK3-NEXT: [[TMP1:%.*]] = getelementptr inbounds [1 x ptr], ptr [[DOTOFFLOAD_PTRS]], i32 0, i32 0
586 // CHECK3-NEXT: store ptr [[A]], ptr [[TMP1]], align 4
587 // CHECK3-NEXT: [[TMP2:%.*]] = getelementptr inbounds [1 x ptr], ptr [[DOTOFFLOAD_MAPPERS]], i32 0, i32 0
588 // CHECK3-NEXT: store ptr null, ptr [[TMP2]], align 4
589 // CHECK3-NEXT: [[TMP3:%.*]] = getelementptr inbounds [1 x ptr], ptr [[DOTOFFLOAD_BASEPTRS]], i32 0, i32 0
590 // CHECK3-NEXT: [[TMP4:%.*]] = getelementptr inbounds [1 x ptr], ptr [[DOTOFFLOAD_PTRS]], i32 0, i32 0
591 // CHECK3-NEXT: [[TMP5:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 0
592 // CHECK3-NEXT: store i32 2, ptr [[TMP5]], align 4
593 // CHECK3-NEXT: [[TMP6:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 1
594 // CHECK3-NEXT: store i32 1, ptr [[TMP6]], align 4
595 // CHECK3-NEXT: [[TMP7:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 2
596 // CHECK3-NEXT: store ptr [[TMP3]], ptr [[TMP7]], align 4
597 // CHECK3-NEXT: [[TMP8:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 3
598 // CHECK3-NEXT: store ptr [[TMP4]], ptr [[TMP8]], align 4
599 // CHECK3-NEXT: [[TMP9:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 4
600 // CHECK3-NEXT: store ptr @.offload_sizes, ptr [[TMP9]], align 4
601 // CHECK3-NEXT: [[TMP10:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 5
602 // CHECK3-NEXT: store ptr @.offload_maptypes, ptr [[TMP10]], align 4
603 // CHECK3-NEXT: [[TMP11:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 6
604 // CHECK3-NEXT: store ptr null, ptr [[TMP11]], align 4
605 // CHECK3-NEXT: [[TMP12:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 7
606 // CHECK3-NEXT: store ptr null, ptr [[TMP12]], align 4
607 // CHECK3-NEXT: [[TMP13:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 8
608 // CHECK3-NEXT: store i64 123, ptr [[TMP13]], align 8
609 // CHECK3-NEXT: [[TMP14:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 9
610 // CHECK3-NEXT: store i64 0, ptr [[TMP14]], align 8
611 // CHECK3-NEXT: [[TMP15:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 10
612 // CHECK3-NEXT: store [3 x i32] zeroinitializer, ptr [[TMP15]], align 4
613 // CHECK3-NEXT: [[TMP16:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 11
614 // CHECK3-NEXT: store [3 x i32] zeroinitializer, ptr [[TMP16]], align 4
615 // CHECK3-NEXT: [[TMP17:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 12
616 // CHECK3-NEXT: store i32 0, ptr [[TMP17]], align 4
617 // CHECK3-NEXT: [[TMP18:%.*]] = call i32 @__tgt_target_kernel(ptr @[[GLOB2:[0-9]+]], i64 -1, i32 0, i32 0, ptr @.{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__ZN2SSIiLi123ELx456EE3fooEv_l28.region_id, ptr [[KERNEL_ARGS]])
618 // CHECK3-NEXT: [[TMP19:%.*]] = icmp ne i32 [[TMP18]], 0
619 // CHECK3-NEXT: br i1 [[TMP19]], label [[OMP_OFFLOAD_FAILED:%.*]], label [[OMP_OFFLOAD_CONT:%.*]]
620 // CHECK3: omp_offload.failed:
621 // CHECK3-NEXT: call void @{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__ZN2SSIiLi123ELx456EE3fooEv_l28(ptr [[THIS1]]) #[[ATTR3:[0-9]+]]
622 // CHECK3-NEXT: br label [[OMP_OFFLOAD_CONT]]
623 // CHECK3: omp_offload.cont:
624 // CHECK3-NEXT: [[A2:%.*]] = getelementptr inbounds [[STRUCT_SS]], ptr [[THIS1]], i32 0, i32 0
625 // CHECK3-NEXT: [[TMP20:%.*]] = getelementptr inbounds [1 x ptr], ptr [[DOTOFFLOAD_BASEPTRS3]], i32 0, i32 0
626 // CHECK3-NEXT: store ptr [[THIS1]], ptr [[TMP20]], align 4
627 // CHECK3-NEXT: [[TMP21:%.*]] = getelementptr inbounds [1 x ptr], ptr [[DOTOFFLOAD_PTRS4]], i32 0, i32 0
628 // CHECK3-NEXT: store ptr [[A2]], ptr [[TMP21]], align 4
629 // CHECK3-NEXT: [[TMP22:%.*]] = getelementptr inbounds [1 x ptr], ptr [[DOTOFFLOAD_MAPPERS5]], i32 0, i32 0
630 // CHECK3-NEXT: store ptr null, ptr [[TMP22]], align 4
631 // CHECK3-NEXT: [[TMP23:%.*]] = getelementptr inbounds [1 x ptr], ptr [[DOTOFFLOAD_BASEPTRS3]], i32 0, i32 0
632 // CHECK3-NEXT: [[TMP24:%.*]] = getelementptr inbounds [1 x ptr], ptr [[DOTOFFLOAD_PTRS4]], i32 0, i32 0
633 // CHECK3-NEXT: [[TMP25:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS7]], i32 0, i32 0
634 // CHECK3-NEXT: store i32 2, ptr [[TMP25]], align 4
635 // CHECK3-NEXT: [[TMP26:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS7]], i32 0, i32 1
636 // CHECK3-NEXT: store i32 1, ptr [[TMP26]], align 4
637 // CHECK3-NEXT: [[TMP27:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS7]], i32 0, i32 2
638 // CHECK3-NEXT: store ptr [[TMP23]], ptr [[TMP27]], align 4
639 // CHECK3-NEXT: [[TMP28:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS7]], i32 0, i32 3
640 // CHECK3-NEXT: store ptr [[TMP24]], ptr [[TMP28]], align 4
641 // CHECK3-NEXT: [[TMP29:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS7]], i32 0, i32 4
642 // CHECK3-NEXT: store ptr @.offload_sizes.1, ptr [[TMP29]], align 4
643 // CHECK3-NEXT: [[TMP30:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS7]], i32 0, i32 5
644 // CHECK3-NEXT: store ptr @.offload_maptypes.2, ptr [[TMP30]], align 4
645 // CHECK3-NEXT: [[TMP31:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS7]], i32 0, i32 6
646 // CHECK3-NEXT: store ptr null, ptr [[TMP31]], align 4
647 // CHECK3-NEXT: [[TMP32:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS7]], i32 0, i32 7
648 // CHECK3-NEXT: store ptr null, ptr [[TMP32]], align 4
649 // CHECK3-NEXT: [[TMP33:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS7]], i32 0, i32 8
650 // CHECK3-NEXT: store i64 123, ptr [[TMP33]], align 8
651 // CHECK3-NEXT: [[TMP34:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS7]], i32 0, i32 9
652 // CHECK3-NEXT: store i64 0, ptr [[TMP34]], align 8
653 // CHECK3-NEXT: [[TMP35:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS7]], i32 0, i32 10
654 // CHECK3-NEXT: store [3 x i32] zeroinitializer, ptr [[TMP35]], align 4
655 // CHECK3-NEXT: [[TMP36:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS7]], i32 0, i32 11
656 // CHECK3-NEXT: store [3 x i32] zeroinitializer, ptr [[TMP36]], align 4
657 // CHECK3-NEXT: [[TMP37:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS7]], i32 0, i32 12
658 // CHECK3-NEXT: store i32 0, ptr [[TMP37]], align 4
659 // CHECK3-NEXT: [[TMP38:%.*]] = call i32 @__tgt_target_kernel(ptr @[[GLOB2]], i64 -1, i32 0, i32 0, ptr @.{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__ZN2SSIiLi123ELx456EE3fooEv_l33.region_id, ptr [[KERNEL_ARGS7]])
660 // CHECK3-NEXT: [[TMP39:%.*]] = icmp ne i32 [[TMP38]], 0
661 // CHECK3-NEXT: br i1 [[TMP39]], label [[OMP_OFFLOAD_FAILED8:%.*]], label [[OMP_OFFLOAD_CONT9:%.*]]
662 // CHECK3: omp_offload.failed8:
663 // CHECK3-NEXT: call void @{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__ZN2SSIiLi123ELx456EE3fooEv_l33(ptr [[THIS1]]) #[[ATTR3]]
664 // CHECK3-NEXT: br label [[OMP_OFFLOAD_CONT9]]
665 // CHECK3: omp_offload.cont9:
666 // CHECK3-NEXT: [[A10:%.*]] = getelementptr inbounds [[STRUCT_SS]], ptr [[THIS1]], i32 0, i32 0
667 // CHECK3-NEXT: [[TMP40:%.*]] = getelementptr inbounds [1 x ptr], ptr [[DOTOFFLOAD_BASEPTRS11]], i32 0, i32 0
668 // CHECK3-NEXT: store ptr [[THIS1]], ptr [[TMP40]], align 4
669 // CHECK3-NEXT: [[TMP41:%.*]] = getelementptr inbounds [1 x ptr], ptr [[DOTOFFLOAD_PTRS12]], i32 0, i32 0
670 // CHECK3-NEXT: store ptr [[A10]], ptr [[TMP41]], align 4
671 // CHECK3-NEXT: [[TMP42:%.*]] = getelementptr inbounds [1 x ptr], ptr [[DOTOFFLOAD_MAPPERS13]], i32 0, i32 0
672 // CHECK3-NEXT: store ptr null, ptr [[TMP42]], align 4
673 // CHECK3-NEXT: [[TMP43:%.*]] = getelementptr inbounds [1 x ptr], ptr [[DOTOFFLOAD_BASEPTRS11]], i32 0, i32 0
674 // CHECK3-NEXT: [[TMP44:%.*]] = getelementptr inbounds [1 x ptr], ptr [[DOTOFFLOAD_PTRS12]], i32 0, i32 0
675 // CHECK3-NEXT: [[TMP45:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS15]], i32 0, i32 0
676 // CHECK3-NEXT: store i32 2, ptr [[TMP45]], align 4
677 // CHECK3-NEXT: [[TMP46:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS15]], i32 0, i32 1
678 // CHECK3-NEXT: store i32 1, ptr [[TMP46]], align 4
679 // CHECK3-NEXT: [[TMP47:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS15]], i32 0, i32 2
680 // CHECK3-NEXT: store ptr [[TMP43]], ptr [[TMP47]], align 4
681 // CHECK3-NEXT: [[TMP48:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS15]], i32 0, i32 3
682 // CHECK3-NEXT: store ptr [[TMP44]], ptr [[TMP48]], align 4
683 // CHECK3-NEXT: [[TMP49:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS15]], i32 0, i32 4
684 // CHECK3-NEXT: store ptr @.offload_sizes.3, ptr [[TMP49]], align 4
685 // CHECK3-NEXT: [[TMP50:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS15]], i32 0, i32 5
686 // CHECK3-NEXT: store ptr @.offload_maptypes.4, ptr [[TMP50]], align 4
687 // CHECK3-NEXT: [[TMP51:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS15]], i32 0, i32 6
688 // CHECK3-NEXT: store ptr null, ptr [[TMP51]], align 4
689 // CHECK3-NEXT: [[TMP52:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS15]], i32 0, i32 7
690 // CHECK3-NEXT: store ptr null, ptr [[TMP52]], align 4
691 // CHECK3-NEXT: [[TMP53:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS15]], i32 0, i32 8
692 // CHECK3-NEXT: store i64 123, ptr [[TMP53]], align 8
693 // CHECK3-NEXT: [[TMP54:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS15]], i32 0, i32 9
694 // CHECK3-NEXT: store i64 0, ptr [[TMP54]], align 8
695 // CHECK3-NEXT: [[TMP55:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS15]], i32 0, i32 10
696 // CHECK3-NEXT: store [3 x i32] zeroinitializer, ptr [[TMP55]], align 4
697 // CHECK3-NEXT: [[TMP56:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS15]], i32 0, i32 11
698 // CHECK3-NEXT: store [3 x i32] zeroinitializer, ptr [[TMP56]], align 4
699 // CHECK3-NEXT: [[TMP57:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS15]], i32 0, i32 12
700 // CHECK3-NEXT: store i32 0, ptr [[TMP57]], align 4
701 // CHECK3-NEXT: [[TMP58:%.*]] = call i32 @__tgt_target_kernel(ptr @[[GLOB2]], i64 -1, i32 0, i32 0, ptr @.{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__ZN2SSIiLi123ELx456EE3fooEv_l38.region_id, ptr [[KERNEL_ARGS15]])
702 // CHECK3-NEXT: [[TMP59:%.*]] = icmp ne i32 [[TMP58]], 0
703 // CHECK3-NEXT: br i1 [[TMP59]], label [[OMP_OFFLOAD_FAILED16:%.*]], label [[OMP_OFFLOAD_CONT17:%.*]]
704 // CHECK3: omp_offload.failed16:
705 // CHECK3-NEXT: call void @{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__ZN2SSIiLi123ELx456EE3fooEv_l38(ptr [[THIS1]]) #[[ATTR3]]
706 // CHECK3-NEXT: br label [[OMP_OFFLOAD_CONT17]]
707 // CHECK3: omp_offload.cont17:
708 // CHECK3-NEXT: [[A18:%.*]] = getelementptr inbounds [[STRUCT_SS]], ptr [[THIS1]], i32 0, i32 0
709 // CHECK3-NEXT: [[ARRAYIDX:%.*]] = getelementptr inbounds [123 x i32], ptr [[A18]], i32 0, i32 0
710 // CHECK3-NEXT: [[TMP60:%.*]] = load i32, ptr [[ARRAYIDX]], align 4
711 // CHECK3-NEXT: ret i32 [[TMP60]]
714 // CHECK3-LABEL: define {{[^@]+}}@{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__ZN2SSIiLi123ELx456EE3fooEv_l28
715 // CHECK3-SAME: (ptr noundef [[THIS:%.*]]) #[[ATTR1:[0-9]+]] {
716 // CHECK3-NEXT: entry:
717 // CHECK3-NEXT: [[THIS_ADDR:%.*]] = alloca ptr, align 4
718 // CHECK3-NEXT: store ptr [[THIS]], ptr [[THIS_ADDR]], align 4
719 // CHECK3-NEXT: [[TMP0:%.*]] = load ptr, ptr [[THIS_ADDR]], align 4
720 // CHECK3-NEXT: call void (ptr, i32, ptr, ...) @__kmpc_fork_teams(ptr @[[GLOB2]], i32 1, ptr @{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__ZN2SSIiLi123ELx456EE3fooEv_l28.omp_outlined, ptr [[TMP0]])
721 // CHECK3-NEXT: ret void
724 // CHECK3-LABEL: define {{[^@]+}}@{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__ZN2SSIiLi123ELx456EE3fooEv_l28.omp_outlined
725 // CHECK3-SAME: (ptr noalias noundef [[DOTGLOBAL_TID_:%.*]], ptr noalias noundef [[DOTBOUND_TID_:%.*]], ptr noundef [[THIS:%.*]]) #[[ATTR2:[0-9]+]] {
726 // CHECK3-NEXT: entry:
727 // CHECK3-NEXT: [[DOTGLOBAL_TID__ADDR:%.*]] = alloca ptr, align 4
728 // CHECK3-NEXT: [[DOTBOUND_TID__ADDR:%.*]] = alloca ptr, align 4
729 // CHECK3-NEXT: [[THIS_ADDR:%.*]] = alloca ptr, align 4
730 // CHECK3-NEXT: [[DOTOMP_IV:%.*]] = alloca i32, align 4
731 // CHECK3-NEXT: [[TMP:%.*]] = alloca i32, align 4
732 // CHECK3-NEXT: [[DOTOMP_LB:%.*]] = alloca i32, align 4
733 // CHECK3-NEXT: [[DOTOMP_UB:%.*]] = alloca i32, align 4
734 // CHECK3-NEXT: [[DOTOMP_STRIDE:%.*]] = alloca i32, align 4
735 // CHECK3-NEXT: [[DOTOMP_IS_LAST:%.*]] = alloca i32, align 4
736 // CHECK3-NEXT: [[I:%.*]] = alloca i32, align 4
737 // CHECK3-NEXT: store ptr [[DOTGLOBAL_TID_]], ptr [[DOTGLOBAL_TID__ADDR]], align 4
738 // CHECK3-NEXT: store ptr [[DOTBOUND_TID_]], ptr [[DOTBOUND_TID__ADDR]], align 4
739 // CHECK3-NEXT: store ptr [[THIS]], ptr [[THIS_ADDR]], align 4
740 // CHECK3-NEXT: [[TMP0:%.*]] = load ptr, ptr [[THIS_ADDR]], align 4
741 // CHECK3-NEXT: store i32 0, ptr [[DOTOMP_LB]], align 4
742 // CHECK3-NEXT: store i32 122, ptr [[DOTOMP_UB]], align 4
743 // CHECK3-NEXT: store i32 1, ptr [[DOTOMP_STRIDE]], align 4
744 // CHECK3-NEXT: store i32 0, ptr [[DOTOMP_IS_LAST]], align 4
745 // CHECK3-NEXT: [[TMP1:%.*]] = load ptr, ptr [[DOTGLOBAL_TID__ADDR]], align 4
746 // CHECK3-NEXT: [[TMP2:%.*]] = load i32, ptr [[TMP1]], align 4
747 // CHECK3-NEXT: call void @__kmpc_for_static_init_4(ptr @[[GLOB1:[0-9]+]], i32 [[TMP2]], i32 92, ptr [[DOTOMP_IS_LAST]], ptr [[DOTOMP_LB]], ptr [[DOTOMP_UB]], ptr [[DOTOMP_STRIDE]], i32 1, i32 1)
748 // CHECK3-NEXT: [[TMP3:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4
749 // CHECK3-NEXT: [[CMP:%.*]] = icmp sgt i32 [[TMP3]], 122
750 // CHECK3-NEXT: br i1 [[CMP]], label [[COND_TRUE:%.*]], label [[COND_FALSE:%.*]]
751 // CHECK3: cond.true:
752 // CHECK3-NEXT: br label [[COND_END:%.*]]
753 // CHECK3: cond.false:
754 // CHECK3-NEXT: [[TMP4:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4
755 // CHECK3-NEXT: br label [[COND_END]]
756 // CHECK3: cond.end:
757 // CHECK3-NEXT: [[COND:%.*]] = phi i32 [ 122, [[COND_TRUE]] ], [ [[TMP4]], [[COND_FALSE]] ]
758 // CHECK3-NEXT: store i32 [[COND]], ptr [[DOTOMP_UB]], align 4
759 // CHECK3-NEXT: [[TMP5:%.*]] = load i32, ptr [[DOTOMP_LB]], align 4
760 // CHECK3-NEXT: store i32 [[TMP5]], ptr [[DOTOMP_IV]], align 4
761 // CHECK3-NEXT: br label [[OMP_INNER_FOR_COND:%.*]]
762 // CHECK3: omp.inner.for.cond:
763 // CHECK3-NEXT: [[TMP6:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4
764 // CHECK3-NEXT: [[TMP7:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4
765 // CHECK3-NEXT: [[CMP1:%.*]] = icmp sle i32 [[TMP6]], [[TMP7]]
766 // CHECK3-NEXT: br i1 [[CMP1]], label [[OMP_INNER_FOR_BODY:%.*]], label [[OMP_INNER_FOR_END:%.*]]
767 // CHECK3: omp.inner.for.body:
768 // CHECK3-NEXT: [[TMP8:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4
769 // CHECK3-NEXT: [[MUL:%.*]] = mul nsw i32 [[TMP8]], 1
770 // CHECK3-NEXT: [[ADD:%.*]] = add nsw i32 0, [[MUL]]
771 // CHECK3-NEXT: store i32 [[ADD]], ptr [[I]], align 4
772 // CHECK3-NEXT: [[A:%.*]] = getelementptr inbounds [[STRUCT_SS:%.*]], ptr [[TMP0]], i32 0, i32 0
773 // CHECK3-NEXT: [[TMP9:%.*]] = load i32, ptr [[I]], align 4
774 // CHECK3-NEXT: [[ARRAYIDX:%.*]] = getelementptr inbounds [123 x i32], ptr [[A]], i32 0, i32 [[TMP9]]
775 // CHECK3-NEXT: store i32 0, ptr [[ARRAYIDX]], align 4
776 // CHECK3-NEXT: br label [[OMP_BODY_CONTINUE:%.*]]
777 // CHECK3: omp.body.continue:
778 // CHECK3-NEXT: br label [[OMP_INNER_FOR_INC:%.*]]
779 // CHECK3: omp.inner.for.inc:
780 // CHECK3-NEXT: [[TMP10:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4
781 // CHECK3-NEXT: [[ADD2:%.*]] = add nsw i32 [[TMP10]], 1
782 // CHECK3-NEXT: store i32 [[ADD2]], ptr [[DOTOMP_IV]], align 4
783 // CHECK3-NEXT: br label [[OMP_INNER_FOR_COND]]
784 // CHECK3: omp.inner.for.end:
785 // CHECK3-NEXT: br label [[OMP_LOOP_EXIT:%.*]]
786 // CHECK3: omp.loop.exit:
787 // CHECK3-NEXT: call void @__kmpc_for_static_fini(ptr @[[GLOB1]], i32 [[TMP2]])
788 // CHECK3-NEXT: ret void
791 // CHECK3-LABEL: define {{[^@]+}}@{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__ZN2SSIiLi123ELx456EE3fooEv_l33
792 // CHECK3-SAME: (ptr noundef [[THIS:%.*]]) #[[ATTR1]] {
793 // CHECK3-NEXT: entry:
794 // CHECK3-NEXT: [[THIS_ADDR:%.*]] = alloca ptr, align 4
795 // CHECK3-NEXT: store ptr [[THIS]], ptr [[THIS_ADDR]], align 4
796 // CHECK3-NEXT: [[TMP0:%.*]] = load ptr, ptr [[THIS_ADDR]], align 4
797 // CHECK3-NEXT: call void (ptr, i32, ptr, ...) @__kmpc_fork_teams(ptr @[[GLOB2]], i32 1, ptr @{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__ZN2SSIiLi123ELx456EE3fooEv_l33.omp_outlined, ptr [[TMP0]])
798 // CHECK3-NEXT: ret void
801 // CHECK3-LABEL: define {{[^@]+}}@{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__ZN2SSIiLi123ELx456EE3fooEv_l33.omp_outlined
802 // CHECK3-SAME: (ptr noalias noundef [[DOTGLOBAL_TID_:%.*]], ptr noalias noundef [[DOTBOUND_TID_:%.*]], ptr noundef [[THIS:%.*]]) #[[ATTR2]] {
803 // CHECK3-NEXT: entry:
804 // CHECK3-NEXT: [[DOTGLOBAL_TID__ADDR:%.*]] = alloca ptr, align 4
805 // CHECK3-NEXT: [[DOTBOUND_TID__ADDR:%.*]] = alloca ptr, align 4
806 // CHECK3-NEXT: [[THIS_ADDR:%.*]] = alloca ptr, align 4
807 // CHECK3-NEXT: [[DOTOMP_IV:%.*]] = alloca i32, align 4
808 // CHECK3-NEXT: [[TMP:%.*]] = alloca i32, align 4
809 // CHECK3-NEXT: [[DOTOMP_LB:%.*]] = alloca i32, align 4
810 // CHECK3-NEXT: [[DOTOMP_UB:%.*]] = alloca i32, align 4
811 // CHECK3-NEXT: [[DOTOMP_STRIDE:%.*]] = alloca i32, align 4
812 // CHECK3-NEXT: [[DOTOMP_IS_LAST:%.*]] = alloca i32, align 4
813 // CHECK3-NEXT: [[I:%.*]] = alloca i32, align 4
814 // CHECK3-NEXT: store ptr [[DOTGLOBAL_TID_]], ptr [[DOTGLOBAL_TID__ADDR]], align 4
815 // CHECK3-NEXT: store ptr [[DOTBOUND_TID_]], ptr [[DOTBOUND_TID__ADDR]], align 4
816 // CHECK3-NEXT: store ptr [[THIS]], ptr [[THIS_ADDR]], align 4
817 // CHECK3-NEXT: [[TMP0:%.*]] = load ptr, ptr [[THIS_ADDR]], align 4
818 // CHECK3-NEXT: store i32 0, ptr [[DOTOMP_LB]], align 4
819 // CHECK3-NEXT: store i32 122, ptr [[DOTOMP_UB]], align 4
820 // CHECK3-NEXT: store i32 1, ptr [[DOTOMP_STRIDE]], align 4
821 // CHECK3-NEXT: store i32 0, ptr [[DOTOMP_IS_LAST]], align 4
822 // CHECK3-NEXT: [[TMP1:%.*]] = load ptr, ptr [[DOTGLOBAL_TID__ADDR]], align 4
823 // CHECK3-NEXT: [[TMP2:%.*]] = load i32, ptr [[TMP1]], align 4
824 // CHECK3-NEXT: call void @__kmpc_for_static_init_4(ptr @[[GLOB1]], i32 [[TMP2]], i32 92, ptr [[DOTOMP_IS_LAST]], ptr [[DOTOMP_LB]], ptr [[DOTOMP_UB]], ptr [[DOTOMP_STRIDE]], i32 1, i32 1)
825 // CHECK3-NEXT: [[TMP3:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4
826 // CHECK3-NEXT: [[CMP:%.*]] = icmp sgt i32 [[TMP3]], 122
827 // CHECK3-NEXT: br i1 [[CMP]], label [[COND_TRUE:%.*]], label [[COND_FALSE:%.*]]
828 // CHECK3: cond.true:
829 // CHECK3-NEXT: br label [[COND_END:%.*]]
830 // CHECK3: cond.false:
831 // CHECK3-NEXT: [[TMP4:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4
832 // CHECK3-NEXT: br label [[COND_END]]
833 // CHECK3: cond.end:
834 // CHECK3-NEXT: [[COND:%.*]] = phi i32 [ 122, [[COND_TRUE]] ], [ [[TMP4]], [[COND_FALSE]] ]
835 // CHECK3-NEXT: store i32 [[COND]], ptr [[DOTOMP_UB]], align 4
836 // CHECK3-NEXT: [[TMP5:%.*]] = load i32, ptr [[DOTOMP_LB]], align 4
837 // CHECK3-NEXT: store i32 [[TMP5]], ptr [[DOTOMP_IV]], align 4
838 // CHECK3-NEXT: br label [[OMP_INNER_FOR_COND:%.*]]
839 // CHECK3: omp.inner.for.cond:
840 // CHECK3-NEXT: [[TMP6:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4
841 // CHECK3-NEXT: [[TMP7:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4
842 // CHECK3-NEXT: [[CMP1:%.*]] = icmp sle i32 [[TMP6]], [[TMP7]]
843 // CHECK3-NEXT: br i1 [[CMP1]], label [[OMP_INNER_FOR_BODY:%.*]], label [[OMP_INNER_FOR_END:%.*]]
844 // CHECK3: omp.inner.for.body:
845 // CHECK3-NEXT: [[TMP8:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4
846 // CHECK3-NEXT: [[MUL:%.*]] = mul nsw i32 [[TMP8]], 1
847 // CHECK3-NEXT: [[ADD:%.*]] = add nsw i32 0, [[MUL]]
848 // CHECK3-NEXT: store i32 [[ADD]], ptr [[I]], align 4
849 // CHECK3-NEXT: [[A:%.*]] = getelementptr inbounds [[STRUCT_SS:%.*]], ptr [[TMP0]], i32 0, i32 0
850 // CHECK3-NEXT: [[TMP9:%.*]] = load i32, ptr [[I]], align 4
851 // CHECK3-NEXT: [[ARRAYIDX:%.*]] = getelementptr inbounds [123 x i32], ptr [[A]], i32 0, i32 [[TMP9]]
852 // CHECK3-NEXT: store i32 0, ptr [[ARRAYIDX]], align 4
853 // CHECK3-NEXT: br label [[OMP_BODY_CONTINUE:%.*]]
854 // CHECK3: omp.body.continue:
855 // CHECK3-NEXT: br label [[OMP_INNER_FOR_INC:%.*]]
856 // CHECK3: omp.inner.for.inc:
857 // CHECK3-NEXT: [[TMP10:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4
858 // CHECK3-NEXT: [[ADD2:%.*]] = add nsw i32 [[TMP10]], 1
859 // CHECK3-NEXT: store i32 [[ADD2]], ptr [[DOTOMP_IV]], align 4
860 // CHECK3-NEXT: br label [[OMP_INNER_FOR_COND]]
861 // CHECK3: omp.inner.for.end:
862 // CHECK3-NEXT: br label [[OMP_LOOP_EXIT:%.*]]
863 // CHECK3: omp.loop.exit:
864 // CHECK3-NEXT: call void @__kmpc_for_static_fini(ptr @[[GLOB1]], i32 [[TMP2]])
865 // CHECK3-NEXT: ret void
868 // CHECK3-LABEL: define {{[^@]+}}@{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__ZN2SSIiLi123ELx456EE3fooEv_l38
869 // CHECK3-SAME: (ptr noundef [[THIS:%.*]]) #[[ATTR1]] {
870 // CHECK3-NEXT: entry:
871 // CHECK3-NEXT: [[THIS_ADDR:%.*]] = alloca ptr, align 4
872 // CHECK3-NEXT: store ptr [[THIS]], ptr [[THIS_ADDR]], align 4
873 // CHECK3-NEXT: [[TMP0:%.*]] = load ptr, ptr [[THIS_ADDR]], align 4
874 // CHECK3-NEXT: call void (ptr, i32, ptr, ...) @__kmpc_fork_teams(ptr @[[GLOB2]], i32 1, ptr @{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__ZN2SSIiLi123ELx456EE3fooEv_l38.omp_outlined, ptr [[TMP0]])
875 // CHECK3-NEXT: ret void
878 // CHECK3-LABEL: define {{[^@]+}}@{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__ZN2SSIiLi123ELx456EE3fooEv_l38.omp_outlined
879 // CHECK3-SAME: (ptr noalias noundef [[DOTGLOBAL_TID_:%.*]], ptr noalias noundef [[DOTBOUND_TID_:%.*]], ptr noundef [[THIS:%.*]]) #[[ATTR2]] {
880 // CHECK3-NEXT: entry:
881 // CHECK3-NEXT: [[DOTGLOBAL_TID__ADDR:%.*]] = alloca ptr, align 4
882 // CHECK3-NEXT: [[DOTBOUND_TID__ADDR:%.*]] = alloca ptr, align 4
883 // CHECK3-NEXT: [[THIS_ADDR:%.*]] = alloca ptr, align 4
884 // CHECK3-NEXT: [[DOTOMP_IV:%.*]] = alloca i32, align 4
885 // CHECK3-NEXT: [[TMP:%.*]] = alloca i32, align 4
886 // CHECK3-NEXT: [[DOTOMP_LB:%.*]] = alloca i32, align 4
887 // CHECK3-NEXT: [[DOTOMP_UB:%.*]] = alloca i32, align 4
888 // CHECK3-NEXT: [[DOTOMP_STRIDE:%.*]] = alloca i32, align 4
889 // CHECK3-NEXT: [[DOTOMP_IS_LAST:%.*]] = alloca i32, align 4
890 // CHECK3-NEXT: [[I:%.*]] = alloca i32, align 4
891 // CHECK3-NEXT: store ptr [[DOTGLOBAL_TID_]], ptr [[DOTGLOBAL_TID__ADDR]], align 4
892 // CHECK3-NEXT: store ptr [[DOTBOUND_TID_]], ptr [[DOTBOUND_TID__ADDR]], align 4
893 // CHECK3-NEXT: store ptr [[THIS]], ptr [[THIS_ADDR]], align 4
894 // CHECK3-NEXT: [[TMP0:%.*]] = load ptr, ptr [[THIS_ADDR]], align 4
895 // CHECK3-NEXT: store i32 0, ptr [[DOTOMP_LB]], align 4
896 // CHECK3-NEXT: store i32 122, ptr [[DOTOMP_UB]], align 4
897 // CHECK3-NEXT: store i32 1, ptr [[DOTOMP_STRIDE]], align 4
898 // CHECK3-NEXT: store i32 0, ptr [[DOTOMP_IS_LAST]], align 4
899 // CHECK3-NEXT: [[TMP1:%.*]] = load ptr, ptr [[DOTGLOBAL_TID__ADDR]], align 4
900 // CHECK3-NEXT: [[TMP2:%.*]] = load i32, ptr [[TMP1]], align 4
901 // CHECK3-NEXT: call void @__kmpc_for_static_init_4(ptr @[[GLOB1]], i32 [[TMP2]], i32 91, ptr [[DOTOMP_IS_LAST]], ptr [[DOTOMP_LB]], ptr [[DOTOMP_UB]], ptr [[DOTOMP_STRIDE]], i32 1, i32 61)
902 // CHECK3-NEXT: br label [[OMP_DISPATCH_COND:%.*]]
903 // CHECK3: omp.dispatch.cond:
904 // CHECK3-NEXT: [[TMP3:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4
905 // CHECK3-NEXT: [[CMP:%.*]] = icmp sgt i32 [[TMP3]], 122
906 // CHECK3-NEXT: br i1 [[CMP]], label [[COND_TRUE:%.*]], label [[COND_FALSE:%.*]]
907 // CHECK3: cond.true:
908 // CHECK3-NEXT: br label [[COND_END:%.*]]
909 // CHECK3: cond.false:
910 // CHECK3-NEXT: [[TMP4:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4
911 // CHECK3-NEXT: br label [[COND_END]]
912 // CHECK3: cond.end:
913 // CHECK3-NEXT: [[COND:%.*]] = phi i32 [ 122, [[COND_TRUE]] ], [ [[TMP4]], [[COND_FALSE]] ]
914 // CHECK3-NEXT: store i32 [[COND]], ptr [[DOTOMP_UB]], align 4
915 // CHECK3-NEXT: [[TMP5:%.*]] = load i32, ptr [[DOTOMP_LB]], align 4
916 // CHECK3-NEXT: store i32 [[TMP5]], ptr [[DOTOMP_IV]], align 4
917 // CHECK3-NEXT: [[TMP6:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4
918 // CHECK3-NEXT: [[TMP7:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4
919 // CHECK3-NEXT: [[CMP1:%.*]] = icmp sle i32 [[TMP6]], [[TMP7]]
920 // CHECK3-NEXT: br i1 [[CMP1]], label [[OMP_DISPATCH_BODY:%.*]], label [[OMP_DISPATCH_END:%.*]]
921 // CHECK3: omp.dispatch.body:
922 // CHECK3-NEXT: br label [[OMP_INNER_FOR_COND:%.*]]
923 // CHECK3: omp.inner.for.cond:
924 // CHECK3-NEXT: [[TMP8:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP9:![0-9]+]]
925 // CHECK3-NEXT: [[TMP9:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4, !llvm.access.group [[ACC_GRP9]]
926 // CHECK3-NEXT: [[CMP2:%.*]] = icmp sle i32 [[TMP8]], [[TMP9]]
927 // CHECK3-NEXT: br i1 [[CMP2]], label [[OMP_INNER_FOR_BODY:%.*]], label [[OMP_INNER_FOR_END:%.*]]
928 // CHECK3: omp.inner.for.body:
929 // CHECK3-NEXT: [[TMP10:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP9]]
930 // CHECK3-NEXT: [[MUL:%.*]] = mul nsw i32 [[TMP10]], 1
931 // CHECK3-NEXT: [[ADD:%.*]] = add nsw i32 0, [[MUL]]
932 // CHECK3-NEXT: store i32 [[ADD]], ptr [[I]], align 4, !llvm.access.group [[ACC_GRP9]]
933 // CHECK3-NEXT: [[A:%.*]] = getelementptr inbounds [[STRUCT_SS:%.*]], ptr [[TMP0]], i32 0, i32 0
934 // CHECK3-NEXT: [[TMP11:%.*]] = load i32, ptr [[I]], align 4, !llvm.access.group [[ACC_GRP9]]
935 // CHECK3-NEXT: [[ARRAYIDX:%.*]] = getelementptr inbounds [123 x i32], ptr [[A]], i32 0, i32 [[TMP11]]
936 // CHECK3-NEXT: store i32 0, ptr [[ARRAYIDX]], align 4, !llvm.access.group [[ACC_GRP9]]
937 // CHECK3-NEXT: br label [[OMP_BODY_CONTINUE:%.*]]
938 // CHECK3: omp.body.continue:
939 // CHECK3-NEXT: br label [[OMP_INNER_FOR_INC:%.*]]
940 // CHECK3: omp.inner.for.inc:
941 // CHECK3-NEXT: [[TMP12:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP9]]
942 // CHECK3-NEXT: [[ADD3:%.*]] = add nsw i32 [[TMP12]], 1
943 // CHECK3-NEXT: store i32 [[ADD3]], ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP9]]
944 // CHECK3-NEXT: br label [[OMP_INNER_FOR_COND]], !llvm.loop [[LOOP10:![0-9]+]]
945 // CHECK3: omp.inner.for.end:
946 // CHECK3-NEXT: br label [[OMP_DISPATCH_INC:%.*]]
947 // CHECK3: omp.dispatch.inc:
948 // CHECK3-NEXT: [[TMP13:%.*]] = load i32, ptr [[DOTOMP_LB]], align 4
949 // CHECK3-NEXT: [[TMP14:%.*]] = load i32, ptr [[DOTOMP_STRIDE]], align 4
950 // CHECK3-NEXT: [[ADD4:%.*]] = add nsw i32 [[TMP13]], [[TMP14]]
951 // CHECK3-NEXT: store i32 [[ADD4]], ptr [[DOTOMP_LB]], align 4
952 // CHECK3-NEXT: [[TMP15:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4
953 // CHECK3-NEXT: [[TMP16:%.*]] = load i32, ptr [[DOTOMP_STRIDE]], align 4
954 // CHECK3-NEXT: [[ADD5:%.*]] = add nsw i32 [[TMP15]], [[TMP16]]
955 // CHECK3-NEXT: store i32 [[ADD5]], ptr [[DOTOMP_UB]], align 4
956 // CHECK3-NEXT: br label [[OMP_DISPATCH_COND]]
957 // CHECK3: omp.dispatch.end:
958 // CHECK3-NEXT: call void @__kmpc_for_static_fini(ptr @[[GLOB1]], i32 [[TMP2]])
959 // CHECK3-NEXT: ret void
962 // CHECK3-LABEL: define {{[^@]+}}@.omp_offloading.requires_reg
963 // CHECK3-SAME: () #[[ATTR4:[0-9]+]] {
964 // CHECK3-NEXT: entry:
965 // CHECK3-NEXT: call void @__tgt_register_requires(i64 1)
966 // CHECK3-NEXT: ret void
969 // CHECK9-LABEL: define {{[^@]+}}@main
970 // CHECK9-SAME: (i32 noundef signext [[ARGC:%.*]], ptr noundef [[ARGV:%.*]]) #[[ATTR0:[0-9]+]] {
971 // CHECK9-NEXT: entry:
972 // CHECK9-NEXT: [[RETVAL:%.*]] = alloca i32, align 4
973 // CHECK9-NEXT: [[ARGC_ADDR:%.*]] = alloca i32, align 4
974 // CHECK9-NEXT: [[ARGV_ADDR:%.*]] = alloca ptr, align 8
975 // CHECK9-NEXT: [[N:%.*]] = alloca i32, align 4
976 // CHECK9-NEXT: [[SAVED_STACK:%.*]] = alloca ptr, align 8
977 // CHECK9-NEXT: [[__VLA_EXPR0:%.*]] = alloca i64, align 8
978 // CHECK9-NEXT: [[N_CASTED:%.*]] = alloca i64, align 8
979 // CHECK9-NEXT: [[DOTOFFLOAD_BASEPTRS:%.*]] = alloca [3 x ptr], align 8
980 // CHECK9-NEXT: [[DOTOFFLOAD_PTRS:%.*]] = alloca [3 x ptr], align 8
981 // CHECK9-NEXT: [[DOTOFFLOAD_MAPPERS:%.*]] = alloca [3 x ptr], align 8
982 // CHECK9-NEXT: [[DOTOFFLOAD_SIZES:%.*]] = alloca [3 x i64], align 8
983 // CHECK9-NEXT: [[TMP:%.*]] = alloca i32, align 4
984 // CHECK9-NEXT: [[DOTCAPTURE_EXPR_:%.*]] = alloca i32, align 4
985 // CHECK9-NEXT: [[DOTCAPTURE_EXPR_1:%.*]] = alloca i32, align 4
986 // CHECK9-NEXT: [[KERNEL_ARGS:%.*]] = alloca [[STRUCT___TGT_KERNEL_ARGUMENTS:%.*]], align 8
987 // CHECK9-NEXT: [[N_CASTED3:%.*]] = alloca i64, align 8
988 // CHECK9-NEXT: [[DOTOFFLOAD_BASEPTRS4:%.*]] = alloca [3 x ptr], align 8
989 // CHECK9-NEXT: [[DOTOFFLOAD_PTRS5:%.*]] = alloca [3 x ptr], align 8
990 // CHECK9-NEXT: [[DOTOFFLOAD_MAPPERS6:%.*]] = alloca [3 x ptr], align 8
991 // CHECK9-NEXT: [[DOTOFFLOAD_SIZES7:%.*]] = alloca [3 x i64], align 8
992 // CHECK9-NEXT: [[_TMP8:%.*]] = alloca i32, align 4
993 // CHECK9-NEXT: [[DOTCAPTURE_EXPR_9:%.*]] = alloca i32, align 4
994 // CHECK9-NEXT: [[DOTCAPTURE_EXPR_10:%.*]] = alloca i32, align 4
995 // CHECK9-NEXT: [[KERNEL_ARGS15:%.*]] = alloca [[STRUCT___TGT_KERNEL_ARGUMENTS]], align 8
996 // CHECK9-NEXT: [[N_CASTED18:%.*]] = alloca i64, align 8
997 // CHECK9-NEXT: [[DOTOFFLOAD_BASEPTRS19:%.*]] = alloca [3 x ptr], align 8
998 // CHECK9-NEXT: [[DOTOFFLOAD_PTRS20:%.*]] = alloca [3 x ptr], align 8
999 // CHECK9-NEXT: [[DOTOFFLOAD_MAPPERS21:%.*]] = alloca [3 x ptr], align 8
1000 // CHECK9-NEXT: [[DOTOFFLOAD_SIZES22:%.*]] = alloca [3 x i64], align 8
1001 // CHECK9-NEXT: [[_TMP23:%.*]] = alloca i32, align 4
1002 // CHECK9-NEXT: [[DOTCAPTURE_EXPR_24:%.*]] = alloca i32, align 4
1003 // CHECK9-NEXT: [[DOTCAPTURE_EXPR_25:%.*]] = alloca i32, align 4
1004 // CHECK9-NEXT: [[KERNEL_ARGS30:%.*]] = alloca [[STRUCT___TGT_KERNEL_ARGUMENTS]], align 8
1005 // CHECK9-NEXT: store i32 0, ptr [[RETVAL]], align 4
1006 // CHECK9-NEXT: store i32 [[ARGC]], ptr [[ARGC_ADDR]], align 4
1007 // CHECK9-NEXT: store ptr [[ARGV]], ptr [[ARGV_ADDR]], align 8
1008 // CHECK9-NEXT: store i32 100, ptr [[N]], align 4
1009 // CHECK9-NEXT: [[TMP0:%.*]] = load i32, ptr [[N]], align 4
1010 // CHECK9-NEXT: [[TMP1:%.*]] = zext i32 [[TMP0]] to i64
1011 // CHECK9-NEXT: [[TMP2:%.*]] = call ptr @llvm.stacksave.p0()
1012 // CHECK9-NEXT: store ptr [[TMP2]], ptr [[SAVED_STACK]], align 8
1013 // CHECK9-NEXT: [[VLA:%.*]] = alloca i32, i64 [[TMP1]], align 4
1014 // CHECK9-NEXT: store i64 [[TMP1]], ptr [[__VLA_EXPR0]], align 8
1015 // CHECK9-NEXT: [[TMP3:%.*]] = load i32, ptr [[N]], align 4
1016 // CHECK9-NEXT: store i32 [[TMP3]], ptr [[N_CASTED]], align 4
1017 // CHECK9-NEXT: [[TMP4:%.*]] = load i64, ptr [[N_CASTED]], align 8
1018 // CHECK9-NEXT: [[TMP5:%.*]] = mul nuw i64 [[TMP1]], 4
1019 // CHECK9-NEXT: call void @llvm.memcpy.p0.p0.i64(ptr align 8 [[DOTOFFLOAD_SIZES]], ptr align 8 @.offload_sizes, i64 24, i1 false)
1020 // CHECK9-NEXT: [[TMP6:%.*]] = getelementptr inbounds [3 x ptr], ptr [[DOTOFFLOAD_BASEPTRS]], i32 0, i32 0
1021 // CHECK9-NEXT: store i64 [[TMP4]], ptr [[TMP6]], align 8
1022 // CHECK9-NEXT: [[TMP7:%.*]] = getelementptr inbounds [3 x ptr], ptr [[DOTOFFLOAD_PTRS]], i32 0, i32 0
1023 // CHECK9-NEXT: store i64 [[TMP4]], ptr [[TMP7]], align 8
1024 // CHECK9-NEXT: [[TMP8:%.*]] = getelementptr inbounds [3 x ptr], ptr [[DOTOFFLOAD_MAPPERS]], i64 0, i64 0
1025 // CHECK9-NEXT: store ptr null, ptr [[TMP8]], align 8
1026 // CHECK9-NEXT: [[TMP9:%.*]] = getelementptr inbounds [3 x ptr], ptr [[DOTOFFLOAD_BASEPTRS]], i32 0, i32 1
1027 // CHECK9-NEXT: store i64 [[TMP1]], ptr [[TMP9]], align 8
1028 // CHECK9-NEXT: [[TMP10:%.*]] = getelementptr inbounds [3 x ptr], ptr [[DOTOFFLOAD_PTRS]], i32 0, i32 1
1029 // CHECK9-NEXT: store i64 [[TMP1]], ptr [[TMP10]], align 8
1030 // CHECK9-NEXT: [[TMP11:%.*]] = getelementptr inbounds [3 x ptr], ptr [[DOTOFFLOAD_MAPPERS]], i64 0, i64 1
1031 // CHECK9-NEXT: store ptr null, ptr [[TMP11]], align 8
1032 // CHECK9-NEXT: [[TMP12:%.*]] = getelementptr inbounds [3 x ptr], ptr [[DOTOFFLOAD_BASEPTRS]], i32 0, i32 2
1033 // CHECK9-NEXT: store ptr [[VLA]], ptr [[TMP12]], align 8
1034 // CHECK9-NEXT: [[TMP13:%.*]] = getelementptr inbounds [3 x ptr], ptr [[DOTOFFLOAD_PTRS]], i32 0, i32 2
1035 // CHECK9-NEXT: store ptr [[VLA]], ptr [[TMP13]], align 8
1036 // CHECK9-NEXT: [[TMP14:%.*]] = getelementptr inbounds [3 x i64], ptr [[DOTOFFLOAD_SIZES]], i32 0, i32 2
1037 // CHECK9-NEXT: store i64 [[TMP5]], ptr [[TMP14]], align 8
1038 // CHECK9-NEXT: [[TMP15:%.*]] = getelementptr inbounds [3 x ptr], ptr [[DOTOFFLOAD_MAPPERS]], i64 0, i64 2
1039 // CHECK9-NEXT: store ptr null, ptr [[TMP15]], align 8
1040 // CHECK9-NEXT: [[TMP16:%.*]] = getelementptr inbounds [3 x ptr], ptr [[DOTOFFLOAD_BASEPTRS]], i32 0, i32 0
1041 // CHECK9-NEXT: [[TMP17:%.*]] = getelementptr inbounds [3 x ptr], ptr [[DOTOFFLOAD_PTRS]], i32 0, i32 0
1042 // CHECK9-NEXT: [[TMP18:%.*]] = getelementptr inbounds [3 x i64], ptr [[DOTOFFLOAD_SIZES]], i32 0, i32 0
1043 // CHECK9-NEXT: [[TMP19:%.*]] = load i32, ptr [[N]], align 4
1044 // CHECK9-NEXT: store i32 [[TMP19]], ptr [[DOTCAPTURE_EXPR_]], align 4
1045 // CHECK9-NEXT: [[TMP20:%.*]] = load i32, ptr [[DOTCAPTURE_EXPR_]], align 4
1046 // CHECK9-NEXT: [[SUB:%.*]] = sub nsw i32 [[TMP20]], 0
1047 // CHECK9-NEXT: [[DIV:%.*]] = sdiv i32 [[SUB]], 1
1048 // CHECK9-NEXT: [[SUB2:%.*]] = sub nsw i32 [[DIV]], 1
1049 // CHECK9-NEXT: store i32 [[SUB2]], ptr [[DOTCAPTURE_EXPR_1]], align 4
1050 // CHECK9-NEXT: [[TMP21:%.*]] = load i32, ptr [[DOTCAPTURE_EXPR_1]], align 4
1051 // CHECK9-NEXT: [[ADD:%.*]] = add nsw i32 [[TMP21]], 1
1052 // CHECK9-NEXT: [[TMP22:%.*]] = zext i32 [[ADD]] to i64
1053 // CHECK9-NEXT: [[TMP23:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 0
1054 // CHECK9-NEXT: store i32 2, ptr [[TMP23]], align 4
1055 // CHECK9-NEXT: [[TMP24:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 1
1056 // CHECK9-NEXT: store i32 3, ptr [[TMP24]], align 4
1057 // CHECK9-NEXT: [[TMP25:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 2
1058 // CHECK9-NEXT: store ptr [[TMP16]], ptr [[TMP25]], align 8
1059 // CHECK9-NEXT: [[TMP26:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 3
1060 // CHECK9-NEXT: store ptr [[TMP17]], ptr [[TMP26]], align 8
1061 // CHECK9-NEXT: [[TMP27:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 4
1062 // CHECK9-NEXT: store ptr [[TMP18]], ptr [[TMP27]], align 8
1063 // CHECK9-NEXT: [[TMP28:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 5
1064 // CHECK9-NEXT: store ptr @.offload_maptypes, ptr [[TMP28]], align 8
1065 // CHECK9-NEXT: [[TMP29:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 6
1066 // CHECK9-NEXT: store ptr null, ptr [[TMP29]], align 8
1067 // CHECK9-NEXT: [[TMP30:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 7
1068 // CHECK9-NEXT: store ptr null, ptr [[TMP30]], align 8
1069 // CHECK9-NEXT: [[TMP31:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 8
1070 // CHECK9-NEXT: store i64 [[TMP22]], ptr [[TMP31]], align 8
1071 // CHECK9-NEXT: [[TMP32:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 9
1072 // CHECK9-NEXT: store i64 0, ptr [[TMP32]], align 8
1073 // CHECK9-NEXT: [[TMP33:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 10
1074 // CHECK9-NEXT: store [3 x i32] zeroinitializer, ptr [[TMP33]], align 4
1075 // CHECK9-NEXT: [[TMP34:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 11
1076 // CHECK9-NEXT: store [3 x i32] zeroinitializer, ptr [[TMP34]], align 4
1077 // CHECK9-NEXT: [[TMP35:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 12
1078 // CHECK9-NEXT: store i32 0, ptr [[TMP35]], align 4
1079 // CHECK9-NEXT: [[TMP36:%.*]] = call i32 @__tgt_target_kernel(ptr @[[GLOB2:[0-9]+]], i64 -1, i32 0, i32 0, ptr @.{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}_main_l100.region_id, ptr [[KERNEL_ARGS]])
1080 // CHECK9-NEXT: [[TMP37:%.*]] = icmp ne i32 [[TMP36]], 0
1081 // CHECK9-NEXT: br i1 [[TMP37]], label [[OMP_OFFLOAD_FAILED:%.*]], label [[OMP_OFFLOAD_CONT:%.*]]
1082 // CHECK9: omp_offload.failed:
1083 // CHECK9-NEXT: call void @{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}_main_l100(i64 [[TMP4]], i64 [[TMP1]], ptr [[VLA]]) #[[ATTR4:[0-9]+]]
1084 // CHECK9-NEXT: br label [[OMP_OFFLOAD_CONT]]
1085 // CHECK9: omp_offload.cont:
1086 // CHECK9-NEXT: [[TMP38:%.*]] = load i32, ptr [[N]], align 4
1087 // CHECK9-NEXT: store i32 [[TMP38]], ptr [[N_CASTED3]], align 4
1088 // CHECK9-NEXT: [[TMP39:%.*]] = load i64, ptr [[N_CASTED3]], align 8
1089 // CHECK9-NEXT: [[TMP40:%.*]] = mul nuw i64 [[TMP1]], 4
1090 // CHECK9-NEXT: call void @llvm.memcpy.p0.p0.i64(ptr align 8 [[DOTOFFLOAD_SIZES7]], ptr align 8 @.offload_sizes.1, i64 24, i1 false)
1091 // CHECK9-NEXT: [[TMP41:%.*]] = getelementptr inbounds [3 x ptr], ptr [[DOTOFFLOAD_BASEPTRS4]], i32 0, i32 0
1092 // CHECK9-NEXT: store i64 [[TMP39]], ptr [[TMP41]], align 8
1093 // CHECK9-NEXT: [[TMP42:%.*]] = getelementptr inbounds [3 x ptr], ptr [[DOTOFFLOAD_PTRS5]], i32 0, i32 0
1094 // CHECK9-NEXT: store i64 [[TMP39]], ptr [[TMP42]], align 8
1095 // CHECK9-NEXT: [[TMP43:%.*]] = getelementptr inbounds [3 x ptr], ptr [[DOTOFFLOAD_MAPPERS6]], i64 0, i64 0
1096 // CHECK9-NEXT: store ptr null, ptr [[TMP43]], align 8
1097 // CHECK9-NEXT: [[TMP44:%.*]] = getelementptr inbounds [3 x ptr], ptr [[DOTOFFLOAD_BASEPTRS4]], i32 0, i32 1
1098 // CHECK9-NEXT: store i64 [[TMP1]], ptr [[TMP44]], align 8
1099 // CHECK9-NEXT: [[TMP45:%.*]] = getelementptr inbounds [3 x ptr], ptr [[DOTOFFLOAD_PTRS5]], i32 0, i32 1
1100 // CHECK9-NEXT: store i64 [[TMP1]], ptr [[TMP45]], align 8
1101 // CHECK9-NEXT: [[TMP46:%.*]] = getelementptr inbounds [3 x ptr], ptr [[DOTOFFLOAD_MAPPERS6]], i64 0, i64 1
1102 // CHECK9-NEXT: store ptr null, ptr [[TMP46]], align 8
1103 // CHECK9-NEXT: [[TMP47:%.*]] = getelementptr inbounds [3 x ptr], ptr [[DOTOFFLOAD_BASEPTRS4]], i32 0, i32 2
1104 // CHECK9-NEXT: store ptr [[VLA]], ptr [[TMP47]], align 8
1105 // CHECK9-NEXT: [[TMP48:%.*]] = getelementptr inbounds [3 x ptr], ptr [[DOTOFFLOAD_PTRS5]], i32 0, i32 2
1106 // CHECK9-NEXT: store ptr [[VLA]], ptr [[TMP48]], align 8
1107 // CHECK9-NEXT: [[TMP49:%.*]] = getelementptr inbounds [3 x i64], ptr [[DOTOFFLOAD_SIZES7]], i32 0, i32 2
1108 // CHECK9-NEXT: store i64 [[TMP40]], ptr [[TMP49]], align 8
1109 // CHECK9-NEXT: [[TMP50:%.*]] = getelementptr inbounds [3 x ptr], ptr [[DOTOFFLOAD_MAPPERS6]], i64 0, i64 2
1110 // CHECK9-NEXT: store ptr null, ptr [[TMP50]], align 8
1111 // CHECK9-NEXT: [[TMP51:%.*]] = getelementptr inbounds [3 x ptr], ptr [[DOTOFFLOAD_BASEPTRS4]], i32 0, i32 0
1112 // CHECK9-NEXT: [[TMP52:%.*]] = getelementptr inbounds [3 x ptr], ptr [[DOTOFFLOAD_PTRS5]], i32 0, i32 0
1113 // CHECK9-NEXT: [[TMP53:%.*]] = getelementptr inbounds [3 x i64], ptr [[DOTOFFLOAD_SIZES7]], i32 0, i32 0
1114 // CHECK9-NEXT: [[TMP54:%.*]] = load i32, ptr [[N]], align 4
1115 // CHECK9-NEXT: store i32 [[TMP54]], ptr [[DOTCAPTURE_EXPR_9]], align 4
1116 // CHECK9-NEXT: [[TMP55:%.*]] = load i32, ptr [[DOTCAPTURE_EXPR_9]], align 4
1117 // CHECK9-NEXT: [[SUB11:%.*]] = sub nsw i32 [[TMP55]], 0
1118 // CHECK9-NEXT: [[DIV12:%.*]] = sdiv i32 [[SUB11]], 1
1119 // CHECK9-NEXT: [[SUB13:%.*]] = sub nsw i32 [[DIV12]], 1
1120 // CHECK9-NEXT: store i32 [[SUB13]], ptr [[DOTCAPTURE_EXPR_10]], align 4
1121 // CHECK9-NEXT: [[TMP56:%.*]] = load i32, ptr [[DOTCAPTURE_EXPR_10]], align 4
1122 // CHECK9-NEXT: [[ADD14:%.*]] = add nsw i32 [[TMP56]], 1
1123 // CHECK9-NEXT: [[TMP57:%.*]] = zext i32 [[ADD14]] to i64
1124 // CHECK9-NEXT: [[TMP58:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS15]], i32 0, i32 0
1125 // CHECK9-NEXT: store i32 2, ptr [[TMP58]], align 4
1126 // CHECK9-NEXT: [[TMP59:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS15]], i32 0, i32 1
1127 // CHECK9-NEXT: store i32 3, ptr [[TMP59]], align 4
1128 // CHECK9-NEXT: [[TMP60:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS15]], i32 0, i32 2
1129 // CHECK9-NEXT: store ptr [[TMP51]], ptr [[TMP60]], align 8
1130 // CHECK9-NEXT: [[TMP61:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS15]], i32 0, i32 3
1131 // CHECK9-NEXT: store ptr [[TMP52]], ptr [[TMP61]], align 8
1132 // CHECK9-NEXT: [[TMP62:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS15]], i32 0, i32 4
1133 // CHECK9-NEXT: store ptr [[TMP53]], ptr [[TMP62]], align 8
1134 // CHECK9-NEXT: [[TMP63:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS15]], i32 0, i32 5
1135 // CHECK9-NEXT: store ptr @.offload_maptypes.2, ptr [[TMP63]], align 8
1136 // CHECK9-NEXT: [[TMP64:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS15]], i32 0, i32 6
1137 // CHECK9-NEXT: store ptr null, ptr [[TMP64]], align 8
1138 // CHECK9-NEXT: [[TMP65:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS15]], i32 0, i32 7
1139 // CHECK9-NEXT: store ptr null, ptr [[TMP65]], align 8
1140 // CHECK9-NEXT: [[TMP66:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS15]], i32 0, i32 8
1141 // CHECK9-NEXT: store i64 [[TMP57]], ptr [[TMP66]], align 8
1142 // CHECK9-NEXT: [[TMP67:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS15]], i32 0, i32 9
1143 // CHECK9-NEXT: store i64 0, ptr [[TMP67]], align 8
1144 // CHECK9-NEXT: [[TMP68:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS15]], i32 0, i32 10
1145 // CHECK9-NEXT: store [3 x i32] zeroinitializer, ptr [[TMP68]], align 4
1146 // CHECK9-NEXT: [[TMP69:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS15]], i32 0, i32 11
1147 // CHECK9-NEXT: store [3 x i32] zeroinitializer, ptr [[TMP69]], align 4
1148 // CHECK9-NEXT: [[TMP70:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS15]], i32 0, i32 12
1149 // CHECK9-NEXT: store i32 0, ptr [[TMP70]], align 4
1150 // CHECK9-NEXT: [[TMP71:%.*]] = call i32 @__tgt_target_kernel(ptr @[[GLOB2]], i64 -1, i32 0, i32 0, ptr @.{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}_main_l105.region_id, ptr [[KERNEL_ARGS15]])
1151 // CHECK9-NEXT: [[TMP72:%.*]] = icmp ne i32 [[TMP71]], 0
1152 // CHECK9-NEXT: br i1 [[TMP72]], label [[OMP_OFFLOAD_FAILED16:%.*]], label [[OMP_OFFLOAD_CONT17:%.*]]
1153 // CHECK9: omp_offload.failed16:
1154 // CHECK9-NEXT: call void @{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}_main_l105(i64 [[TMP39]], i64 [[TMP1]], ptr [[VLA]]) #[[ATTR4]]
1155 // CHECK9-NEXT: br label [[OMP_OFFLOAD_CONT17]]
1156 // CHECK9: omp_offload.cont17:
1157 // CHECK9-NEXT: [[TMP73:%.*]] = load i32, ptr [[N]], align 4
1158 // CHECK9-NEXT: store i32 [[TMP73]], ptr [[N_CASTED18]], align 4
1159 // CHECK9-NEXT: [[TMP74:%.*]] = load i64, ptr [[N_CASTED18]], align 8
1160 // CHECK9-NEXT: [[TMP75:%.*]] = mul nuw i64 [[TMP1]], 4
1161 // CHECK9-NEXT: call void @llvm.memcpy.p0.p0.i64(ptr align 8 [[DOTOFFLOAD_SIZES22]], ptr align 8 @.offload_sizes.3, i64 24, i1 false)
1162 // CHECK9-NEXT: [[TMP76:%.*]] = getelementptr inbounds [3 x ptr], ptr [[DOTOFFLOAD_BASEPTRS19]], i32 0, i32 0
1163 // CHECK9-NEXT: store i64 [[TMP74]], ptr [[TMP76]], align 8
1164 // CHECK9-NEXT: [[TMP77:%.*]] = getelementptr inbounds [3 x ptr], ptr [[DOTOFFLOAD_PTRS20]], i32 0, i32 0
1165 // CHECK9-NEXT: store i64 [[TMP74]], ptr [[TMP77]], align 8
1166 // CHECK9-NEXT: [[TMP78:%.*]] = getelementptr inbounds [3 x ptr], ptr [[DOTOFFLOAD_MAPPERS21]], i64 0, i64 0
1167 // CHECK9-NEXT: store ptr null, ptr [[TMP78]], align 8
1168 // CHECK9-NEXT: [[TMP79:%.*]] = getelementptr inbounds [3 x ptr], ptr [[DOTOFFLOAD_BASEPTRS19]], i32 0, i32 1
1169 // CHECK9-NEXT: store i64 [[TMP1]], ptr [[TMP79]], align 8
1170 // CHECK9-NEXT: [[TMP80:%.*]] = getelementptr inbounds [3 x ptr], ptr [[DOTOFFLOAD_PTRS20]], i32 0, i32 1
1171 // CHECK9-NEXT: store i64 [[TMP1]], ptr [[TMP80]], align 8
1172 // CHECK9-NEXT: [[TMP81:%.*]] = getelementptr inbounds [3 x ptr], ptr [[DOTOFFLOAD_MAPPERS21]], i64 0, i64 1
1173 // CHECK9-NEXT: store ptr null, ptr [[TMP81]], align 8
1174 // CHECK9-NEXT: [[TMP82:%.*]] = getelementptr inbounds [3 x ptr], ptr [[DOTOFFLOAD_BASEPTRS19]], i32 0, i32 2
1175 // CHECK9-NEXT: store ptr [[VLA]], ptr [[TMP82]], align 8
1176 // CHECK9-NEXT: [[TMP83:%.*]] = getelementptr inbounds [3 x ptr], ptr [[DOTOFFLOAD_PTRS20]], i32 0, i32 2
1177 // CHECK9-NEXT: store ptr [[VLA]], ptr [[TMP83]], align 8
1178 // CHECK9-NEXT: [[TMP84:%.*]] = getelementptr inbounds [3 x i64], ptr [[DOTOFFLOAD_SIZES22]], i32 0, i32 2
1179 // CHECK9-NEXT: store i64 [[TMP75]], ptr [[TMP84]], align 8
1180 // CHECK9-NEXT: [[TMP85:%.*]] = getelementptr inbounds [3 x ptr], ptr [[DOTOFFLOAD_MAPPERS21]], i64 0, i64 2
1181 // CHECK9-NEXT: store ptr null, ptr [[TMP85]], align 8
1182 // CHECK9-NEXT: [[TMP86:%.*]] = getelementptr inbounds [3 x ptr], ptr [[DOTOFFLOAD_BASEPTRS19]], i32 0, i32 0
1183 // CHECK9-NEXT: [[TMP87:%.*]] = getelementptr inbounds [3 x ptr], ptr [[DOTOFFLOAD_PTRS20]], i32 0, i32 0
1184 // CHECK9-NEXT: [[TMP88:%.*]] = getelementptr inbounds [3 x i64], ptr [[DOTOFFLOAD_SIZES22]], i32 0, i32 0
1185 // CHECK9-NEXT: [[TMP89:%.*]] = load i32, ptr [[N]], align 4
1186 // CHECK9-NEXT: store i32 [[TMP89]], ptr [[DOTCAPTURE_EXPR_24]], align 4
1187 // CHECK9-NEXT: [[TMP90:%.*]] = load i32, ptr [[DOTCAPTURE_EXPR_24]], align 4
1188 // CHECK9-NEXT: [[SUB26:%.*]] = sub nsw i32 [[TMP90]], 0
1189 // CHECK9-NEXT: [[DIV27:%.*]] = sdiv i32 [[SUB26]], 1
1190 // CHECK9-NEXT: [[SUB28:%.*]] = sub nsw i32 [[DIV27]], 1
1191 // CHECK9-NEXT: store i32 [[SUB28]], ptr [[DOTCAPTURE_EXPR_25]], align 4
1192 // CHECK9-NEXT: [[TMP91:%.*]] = load i32, ptr [[DOTCAPTURE_EXPR_25]], align 4
1193 // CHECK9-NEXT: [[ADD29:%.*]] = add nsw i32 [[TMP91]], 1
1194 // CHECK9-NEXT: [[TMP92:%.*]] = zext i32 [[ADD29]] to i64
1195 // CHECK9-NEXT: [[TMP93:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS30]], i32 0, i32 0
1196 // CHECK9-NEXT: store i32 2, ptr [[TMP93]], align 4
1197 // CHECK9-NEXT: [[TMP94:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS30]], i32 0, i32 1
1198 // CHECK9-NEXT: store i32 3, ptr [[TMP94]], align 4
1199 // CHECK9-NEXT: [[TMP95:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS30]], i32 0, i32 2
1200 // CHECK9-NEXT: store ptr [[TMP86]], ptr [[TMP95]], align 8
1201 // CHECK9-NEXT: [[TMP96:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS30]], i32 0, i32 3
1202 // CHECK9-NEXT: store ptr [[TMP87]], ptr [[TMP96]], align 8
1203 // CHECK9-NEXT: [[TMP97:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS30]], i32 0, i32 4
1204 // CHECK9-NEXT: store ptr [[TMP88]], ptr [[TMP97]], align 8
1205 // CHECK9-NEXT: [[TMP98:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS30]], i32 0, i32 5
1206 // CHECK9-NEXT: store ptr @.offload_maptypes.4, ptr [[TMP98]], align 8
1207 // CHECK9-NEXT: [[TMP99:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS30]], i32 0, i32 6
1208 // CHECK9-NEXT: store ptr null, ptr [[TMP99]], align 8
1209 // CHECK9-NEXT: [[TMP100:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS30]], i32 0, i32 7
1210 // CHECK9-NEXT: store ptr null, ptr [[TMP100]], align 8
1211 // CHECK9-NEXT: [[TMP101:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS30]], i32 0, i32 8
1212 // CHECK9-NEXT: store i64 [[TMP92]], ptr [[TMP101]], align 8
1213 // CHECK9-NEXT: [[TMP102:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS30]], i32 0, i32 9
1214 // CHECK9-NEXT: store i64 0, ptr [[TMP102]], align 8
1215 // CHECK9-NEXT: [[TMP103:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS30]], i32 0, i32 10
1216 // CHECK9-NEXT: store [3 x i32] zeroinitializer, ptr [[TMP103]], align 4
1217 // CHECK9-NEXT: [[TMP104:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS30]], i32 0, i32 11
1218 // CHECK9-NEXT: store [3 x i32] zeroinitializer, ptr [[TMP104]], align 4
1219 // CHECK9-NEXT: [[TMP105:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS30]], i32 0, i32 12
1220 // CHECK9-NEXT: store i32 0, ptr [[TMP105]], align 4
1221 // CHECK9-NEXT: [[TMP106:%.*]] = call i32 @__tgt_target_kernel(ptr @[[GLOB2]], i64 -1, i32 0, i32 0, ptr @.{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}_main_l110.region_id, ptr [[KERNEL_ARGS30]])
1222 // CHECK9-NEXT: [[TMP107:%.*]] = icmp ne i32 [[TMP106]], 0
1223 // CHECK9-NEXT: br i1 [[TMP107]], label [[OMP_OFFLOAD_FAILED31:%.*]], label [[OMP_OFFLOAD_CONT32:%.*]]
1224 // CHECK9: omp_offload.failed31:
1225 // CHECK9-NEXT: call void @{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}_main_l110(i64 [[TMP74]], i64 [[TMP1]], ptr [[VLA]]) #[[ATTR4]]
1226 // CHECK9-NEXT: br label [[OMP_OFFLOAD_CONT32]]
1227 // CHECK9: omp_offload.cont32:
1228 // CHECK9-NEXT: [[TMP108:%.*]] = load i32, ptr [[ARGC_ADDR]], align 4
1229 // CHECK9-NEXT: [[CALL:%.*]] = call noundef signext i32 @_Z5tmainIiLi10EEiT_(i32 noundef signext [[TMP108]])
1230 // CHECK9-NEXT: store i32 [[CALL]], ptr [[RETVAL]], align 4
1231 // CHECK9-NEXT: [[TMP109:%.*]] = load ptr, ptr [[SAVED_STACK]], align 8
1232 // CHECK9-NEXT: call void @llvm.stackrestore.p0(ptr [[TMP109]])
1233 // CHECK9-NEXT: [[TMP110:%.*]] = load i32, ptr [[RETVAL]], align 4
1234 // CHECK9-NEXT: ret i32 [[TMP110]]
1237 // CHECK9-LABEL: define {{[^@]+}}@{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}_main_l100
1238 // CHECK9-SAME: (i64 noundef [[N:%.*]], i64 noundef [[VLA:%.*]], ptr noundef nonnull align 4 dereferenceable(4) [[A:%.*]]) #[[ATTR2:[0-9]+]] {
1239 // CHECK9-NEXT: entry:
1240 // CHECK9-NEXT: [[N_ADDR:%.*]] = alloca i64, align 8
1241 // CHECK9-NEXT: [[VLA_ADDR:%.*]] = alloca i64, align 8
1242 // CHECK9-NEXT: [[A_ADDR:%.*]] = alloca ptr, align 8
1243 // CHECK9-NEXT: store i64 [[N]], ptr [[N_ADDR]], align 8
1244 // CHECK9-NEXT: store i64 [[VLA]], ptr [[VLA_ADDR]], align 8
1245 // CHECK9-NEXT: store ptr [[A]], ptr [[A_ADDR]], align 8
1246 // CHECK9-NEXT: [[TMP0:%.*]] = load i64, ptr [[VLA_ADDR]], align 8
1247 // CHECK9-NEXT: [[TMP1:%.*]] = load ptr, ptr [[A_ADDR]], align 8
1248 // CHECK9-NEXT: call void (ptr, i32, ptr, ...) @__kmpc_fork_teams(ptr @[[GLOB2]], i32 3, ptr @{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}_main_l100.omp_outlined, ptr [[N_ADDR]], i64 [[TMP0]], ptr [[TMP1]])
1249 // CHECK9-NEXT: ret void
1252 // CHECK9-LABEL: define {{[^@]+}}@{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}_main_l100.omp_outlined
1253 // 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]+]] {
1254 // CHECK9-NEXT: entry:
1255 // CHECK9-NEXT: [[DOTGLOBAL_TID__ADDR:%.*]] = alloca ptr, align 8
1256 // CHECK9-NEXT: [[DOTBOUND_TID__ADDR:%.*]] = alloca ptr, align 8
1257 // CHECK9-NEXT: [[N_ADDR:%.*]] = alloca ptr, align 8
1258 // CHECK9-NEXT: [[VLA_ADDR:%.*]] = alloca i64, align 8
1259 // CHECK9-NEXT: [[A_ADDR:%.*]] = alloca ptr, align 8
1260 // CHECK9-NEXT: [[DOTOMP_IV:%.*]] = alloca i32, align 4
1261 // CHECK9-NEXT: [[TMP:%.*]] = alloca i32, align 4
1262 // CHECK9-NEXT: [[DOTCAPTURE_EXPR_:%.*]] = alloca i32, align 4
1263 // CHECK9-NEXT: [[DOTCAPTURE_EXPR_1:%.*]] = alloca i32, align 4
1264 // CHECK9-NEXT: [[I:%.*]] = alloca i32, align 4
1265 // CHECK9-NEXT: [[DOTOMP_LB:%.*]] = alloca i32, align 4
1266 // CHECK9-NEXT: [[DOTOMP_UB:%.*]] = alloca i32, align 4
1267 // CHECK9-NEXT: [[DOTOMP_STRIDE:%.*]] = alloca i32, align 4
1268 // CHECK9-NEXT: [[DOTOMP_IS_LAST:%.*]] = alloca i32, align 4
1269 // CHECK9-NEXT: [[I3:%.*]] = alloca i32, align 4
1270 // CHECK9-NEXT: store ptr [[DOTGLOBAL_TID_]], ptr [[DOTGLOBAL_TID__ADDR]], align 8
1271 // CHECK9-NEXT: store ptr [[DOTBOUND_TID_]], ptr [[DOTBOUND_TID__ADDR]], align 8
1272 // CHECK9-NEXT: store ptr [[N]], ptr [[N_ADDR]], align 8
1273 // CHECK9-NEXT: store i64 [[VLA]], ptr [[VLA_ADDR]], align 8
1274 // CHECK9-NEXT: store ptr [[A]], ptr [[A_ADDR]], align 8
1275 // CHECK9-NEXT: [[TMP0:%.*]] = load ptr, ptr [[N_ADDR]], align 8
1276 // CHECK9-NEXT: [[TMP1:%.*]] = load i64, ptr [[VLA_ADDR]], align 8
1277 // CHECK9-NEXT: [[TMP2:%.*]] = load ptr, ptr [[A_ADDR]], align 8
1278 // CHECK9-NEXT: [[TMP3:%.*]] = load i32, ptr [[TMP0]], align 4
1279 // CHECK9-NEXT: store i32 [[TMP3]], ptr [[DOTCAPTURE_EXPR_]], align 4
1280 // CHECK9-NEXT: [[TMP4:%.*]] = load i32, ptr [[DOTCAPTURE_EXPR_]], align 4
1281 // CHECK9-NEXT: [[SUB:%.*]] = sub nsw i32 [[TMP4]], 0
1282 // CHECK9-NEXT: [[DIV:%.*]] = sdiv i32 [[SUB]], 1
1283 // CHECK9-NEXT: [[SUB2:%.*]] = sub nsw i32 [[DIV]], 1
1284 // CHECK9-NEXT: store i32 [[SUB2]], ptr [[DOTCAPTURE_EXPR_1]], align 4
1285 // CHECK9-NEXT: store i32 0, ptr [[I]], align 4
1286 // CHECK9-NEXT: [[TMP5:%.*]] = load i32, ptr [[DOTCAPTURE_EXPR_]], align 4
1287 // CHECK9-NEXT: [[CMP:%.*]] = icmp slt i32 0, [[TMP5]]
1288 // CHECK9-NEXT: br i1 [[CMP]], label [[OMP_PRECOND_THEN:%.*]], label [[OMP_PRECOND_END:%.*]]
1289 // CHECK9: omp.precond.then:
1290 // CHECK9-NEXT: store i32 0, ptr [[DOTOMP_LB]], align 4
1291 // CHECK9-NEXT: [[TMP6:%.*]] = load i32, ptr [[DOTCAPTURE_EXPR_1]], align 4
1292 // CHECK9-NEXT: store i32 [[TMP6]], ptr [[DOTOMP_UB]], align 4
1293 // CHECK9-NEXT: store i32 1, ptr [[DOTOMP_STRIDE]], align 4
1294 // CHECK9-NEXT: store i32 0, ptr [[DOTOMP_IS_LAST]], align 4
1295 // CHECK9-NEXT: [[TMP7:%.*]] = load ptr, ptr [[DOTGLOBAL_TID__ADDR]], align 8
1296 // CHECK9-NEXT: [[TMP8:%.*]] = load i32, ptr [[TMP7]], align 4
1297 // CHECK9-NEXT: call void @__kmpc_for_static_init_4(ptr @[[GLOB1:[0-9]+]], i32 [[TMP8]], i32 92, ptr [[DOTOMP_IS_LAST]], ptr [[DOTOMP_LB]], ptr [[DOTOMP_UB]], ptr [[DOTOMP_STRIDE]], i32 1, i32 1)
1298 // CHECK9-NEXT: [[TMP9:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4
1299 // CHECK9-NEXT: [[TMP10:%.*]] = load i32, ptr [[DOTCAPTURE_EXPR_1]], align 4
1300 // CHECK9-NEXT: [[CMP4:%.*]] = icmp sgt i32 [[TMP9]], [[TMP10]]
1301 // CHECK9-NEXT: br i1 [[CMP4]], label [[COND_TRUE:%.*]], label [[COND_FALSE:%.*]]
1302 // CHECK9: cond.true:
1303 // CHECK9-NEXT: [[TMP11:%.*]] = load i32, ptr [[DOTCAPTURE_EXPR_1]], align 4
1304 // CHECK9-NEXT: br label [[COND_END:%.*]]
1305 // CHECK9: cond.false:
1306 // CHECK9-NEXT: [[TMP12:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4
1307 // CHECK9-NEXT: br label [[COND_END]]
1308 // CHECK9: cond.end:
1309 // CHECK9-NEXT: [[COND:%.*]] = phi i32 [ [[TMP11]], [[COND_TRUE]] ], [ [[TMP12]], [[COND_FALSE]] ]
1310 // CHECK9-NEXT: store i32 [[COND]], ptr [[DOTOMP_UB]], align 4
1311 // CHECK9-NEXT: [[TMP13:%.*]] = load i32, ptr [[DOTOMP_LB]], align 4
1312 // CHECK9-NEXT: store i32 [[TMP13]], ptr [[DOTOMP_IV]], align 4
1313 // CHECK9-NEXT: br label [[OMP_INNER_FOR_COND:%.*]]
1314 // CHECK9: omp.inner.for.cond:
1315 // CHECK9-NEXT: [[TMP14:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4
1316 // CHECK9-NEXT: [[TMP15:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4
1317 // CHECK9-NEXT: [[CMP5:%.*]] = icmp sle i32 [[TMP14]], [[TMP15]]
1318 // CHECK9-NEXT: br i1 [[CMP5]], label [[OMP_INNER_FOR_BODY:%.*]], label [[OMP_INNER_FOR_END:%.*]]
1319 // CHECK9: omp.inner.for.body:
1320 // CHECK9-NEXT: [[TMP16:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4
1321 // CHECK9-NEXT: [[MUL:%.*]] = mul nsw i32 [[TMP16]], 1
1322 // CHECK9-NEXT: [[ADD:%.*]] = add nsw i32 0, [[MUL]]
1323 // CHECK9-NEXT: store i32 [[ADD]], ptr [[I3]], align 4
1324 // CHECK9-NEXT: [[TMP17:%.*]] = load i32, ptr [[I3]], align 4
1325 // CHECK9-NEXT: [[IDXPROM:%.*]] = sext i32 [[TMP17]] to i64
1326 // CHECK9-NEXT: [[ARRAYIDX:%.*]] = getelementptr inbounds i32, ptr [[TMP2]], i64 [[IDXPROM]]
1327 // CHECK9-NEXT: store i32 0, ptr [[ARRAYIDX]], align 4
1328 // CHECK9-NEXT: br label [[OMP_BODY_CONTINUE:%.*]]
1329 // CHECK9: omp.body.continue:
1330 // CHECK9-NEXT: br label [[OMP_INNER_FOR_INC:%.*]]
1331 // CHECK9: omp.inner.for.inc:
1332 // CHECK9-NEXT: [[TMP18:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4
1333 // CHECK9-NEXT: [[ADD6:%.*]] = add nsw i32 [[TMP18]], 1
1334 // CHECK9-NEXT: store i32 [[ADD6]], ptr [[DOTOMP_IV]], align 4
1335 // CHECK9-NEXT: br label [[OMP_INNER_FOR_COND]]
1336 // CHECK9: omp.inner.for.end:
1337 // CHECK9-NEXT: br label [[OMP_LOOP_EXIT:%.*]]
1338 // CHECK9: omp.loop.exit:
1339 // CHECK9-NEXT: [[TMP19:%.*]] = load ptr, ptr [[DOTGLOBAL_TID__ADDR]], align 8
1340 // CHECK9-NEXT: [[TMP20:%.*]] = load i32, ptr [[TMP19]], align 4
1341 // CHECK9-NEXT: call void @__kmpc_for_static_fini(ptr @[[GLOB1]], i32 [[TMP20]])
1342 // CHECK9-NEXT: br label [[OMP_PRECOND_END]]
1343 // CHECK9: omp.precond.end:
1344 // CHECK9-NEXT: ret void
1347 // CHECK9-LABEL: define {{[^@]+}}@{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}_main_l105
1348 // CHECK9-SAME: (i64 noundef [[N:%.*]], i64 noundef [[VLA:%.*]], ptr noundef nonnull align 4 dereferenceable(4) [[A:%.*]]) #[[ATTR2]] {
1349 // CHECK9-NEXT: entry:
1350 // CHECK9-NEXT: [[N_ADDR:%.*]] = alloca i64, align 8
1351 // CHECK9-NEXT: [[VLA_ADDR:%.*]] = alloca i64, align 8
1352 // CHECK9-NEXT: [[A_ADDR:%.*]] = alloca ptr, align 8
1353 // CHECK9-NEXT: store i64 [[N]], ptr [[N_ADDR]], align 8
1354 // CHECK9-NEXT: store i64 [[VLA]], ptr [[VLA_ADDR]], align 8
1355 // CHECK9-NEXT: store ptr [[A]], ptr [[A_ADDR]], align 8
1356 // CHECK9-NEXT: [[TMP0:%.*]] = load i64, ptr [[VLA_ADDR]], align 8
1357 // CHECK9-NEXT: [[TMP1:%.*]] = load ptr, ptr [[A_ADDR]], align 8
1358 // CHECK9-NEXT: call void (ptr, i32, ptr, ...) @__kmpc_fork_teams(ptr @[[GLOB2]], i32 3, ptr @{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}_main_l105.omp_outlined, ptr [[N_ADDR]], i64 [[TMP0]], ptr [[TMP1]])
1359 // CHECK9-NEXT: ret void
1362 // CHECK9-LABEL: define {{[^@]+}}@{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}_main_l105.omp_outlined
1363 // 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]] {
1364 // CHECK9-NEXT: entry:
1365 // CHECK9-NEXT: [[DOTGLOBAL_TID__ADDR:%.*]] = alloca ptr, align 8
1366 // CHECK9-NEXT: [[DOTBOUND_TID__ADDR:%.*]] = alloca ptr, align 8
1367 // CHECK9-NEXT: [[N_ADDR:%.*]] = alloca ptr, align 8
1368 // CHECK9-NEXT: [[VLA_ADDR:%.*]] = alloca i64, align 8
1369 // CHECK9-NEXT: [[A_ADDR:%.*]] = alloca ptr, align 8
1370 // CHECK9-NEXT: [[DOTOMP_IV:%.*]] = alloca i32, align 4
1371 // CHECK9-NEXT: [[TMP:%.*]] = alloca i32, align 4
1372 // CHECK9-NEXT: [[DOTCAPTURE_EXPR_:%.*]] = alloca i32, align 4
1373 // CHECK9-NEXT: [[DOTCAPTURE_EXPR_1:%.*]] = alloca i32, align 4
1374 // CHECK9-NEXT: [[I:%.*]] = alloca i32, align 4
1375 // CHECK9-NEXT: [[DOTOMP_LB:%.*]] = alloca i32, align 4
1376 // CHECK9-NEXT: [[DOTOMP_UB:%.*]] = alloca i32, align 4
1377 // CHECK9-NEXT: [[DOTOMP_STRIDE:%.*]] = alloca i32, align 4
1378 // CHECK9-NEXT: [[DOTOMP_IS_LAST:%.*]] = alloca i32, align 4
1379 // CHECK9-NEXT: [[I3:%.*]] = alloca i32, align 4
1380 // CHECK9-NEXT: store ptr [[DOTGLOBAL_TID_]], ptr [[DOTGLOBAL_TID__ADDR]], align 8
1381 // CHECK9-NEXT: store ptr [[DOTBOUND_TID_]], ptr [[DOTBOUND_TID__ADDR]], align 8
1382 // CHECK9-NEXT: store ptr [[N]], ptr [[N_ADDR]], align 8
1383 // CHECK9-NEXT: store i64 [[VLA]], ptr [[VLA_ADDR]], align 8
1384 // CHECK9-NEXT: store ptr [[A]], ptr [[A_ADDR]], align 8
1385 // CHECK9-NEXT: [[TMP0:%.*]] = load ptr, ptr [[N_ADDR]], align 8
1386 // CHECK9-NEXT: [[TMP1:%.*]] = load i64, ptr [[VLA_ADDR]], align 8
1387 // CHECK9-NEXT: [[TMP2:%.*]] = load ptr, ptr [[A_ADDR]], align 8
1388 // CHECK9-NEXT: [[TMP3:%.*]] = load i32, ptr [[TMP0]], align 4
1389 // CHECK9-NEXT: store i32 [[TMP3]], ptr [[DOTCAPTURE_EXPR_]], align 4
1390 // CHECK9-NEXT: [[TMP4:%.*]] = load i32, ptr [[DOTCAPTURE_EXPR_]], align 4
1391 // CHECK9-NEXT: [[SUB:%.*]] = sub nsw i32 [[TMP4]], 0
1392 // CHECK9-NEXT: [[DIV:%.*]] = sdiv i32 [[SUB]], 1
1393 // CHECK9-NEXT: [[SUB2:%.*]] = sub nsw i32 [[DIV]], 1
1394 // CHECK9-NEXT: store i32 [[SUB2]], ptr [[DOTCAPTURE_EXPR_1]], align 4
1395 // CHECK9-NEXT: store i32 0, ptr [[I]], align 4
1396 // CHECK9-NEXT: [[TMP5:%.*]] = load i32, ptr [[DOTCAPTURE_EXPR_]], align 4
1397 // CHECK9-NEXT: [[CMP:%.*]] = icmp slt i32 0, [[TMP5]]
1398 // CHECK9-NEXT: br i1 [[CMP]], label [[OMP_PRECOND_THEN:%.*]], label [[OMP_PRECOND_END:%.*]]
1399 // CHECK9: omp.precond.then:
1400 // CHECK9-NEXT: store i32 0, ptr [[DOTOMP_LB]], align 4
1401 // CHECK9-NEXT: [[TMP6:%.*]] = load i32, ptr [[DOTCAPTURE_EXPR_1]], align 4
1402 // CHECK9-NEXT: store i32 [[TMP6]], ptr [[DOTOMP_UB]], align 4
1403 // CHECK9-NEXT: store i32 1, ptr [[DOTOMP_STRIDE]], align 4
1404 // CHECK9-NEXT: store i32 0, ptr [[DOTOMP_IS_LAST]], align 4
1405 // CHECK9-NEXT: [[TMP7:%.*]] = load ptr, ptr [[DOTGLOBAL_TID__ADDR]], align 8
1406 // CHECK9-NEXT: [[TMP8:%.*]] = load i32, ptr [[TMP7]], align 4
1407 // CHECK9-NEXT: call void @__kmpc_for_static_init_4(ptr @[[GLOB1]], i32 [[TMP8]], i32 92, ptr [[DOTOMP_IS_LAST]], ptr [[DOTOMP_LB]], ptr [[DOTOMP_UB]], ptr [[DOTOMP_STRIDE]], i32 1, i32 1)
1408 // CHECK9-NEXT: [[TMP9:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4
1409 // CHECK9-NEXT: [[TMP10:%.*]] = load i32, ptr [[DOTCAPTURE_EXPR_1]], align 4
1410 // CHECK9-NEXT: [[CMP4:%.*]] = icmp sgt i32 [[TMP9]], [[TMP10]]
1411 // CHECK9-NEXT: br i1 [[CMP4]], label [[COND_TRUE:%.*]], label [[COND_FALSE:%.*]]
1412 // CHECK9: cond.true:
1413 // CHECK9-NEXT: [[TMP11:%.*]] = load i32, ptr [[DOTCAPTURE_EXPR_1]], align 4
1414 // CHECK9-NEXT: br label [[COND_END:%.*]]
1415 // CHECK9: cond.false:
1416 // CHECK9-NEXT: [[TMP12:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4
1417 // CHECK9-NEXT: br label [[COND_END]]
1418 // CHECK9: cond.end:
1419 // CHECK9-NEXT: [[COND:%.*]] = phi i32 [ [[TMP11]], [[COND_TRUE]] ], [ [[TMP12]], [[COND_FALSE]] ]
1420 // CHECK9-NEXT: store i32 [[COND]], ptr [[DOTOMP_UB]], align 4
1421 // CHECK9-NEXT: [[TMP13:%.*]] = load i32, ptr [[DOTOMP_LB]], align 4
1422 // CHECK9-NEXT: store i32 [[TMP13]], ptr [[DOTOMP_IV]], align 4
1423 // CHECK9-NEXT: br label [[OMP_INNER_FOR_COND:%.*]]
1424 // CHECK9: omp.inner.for.cond:
1425 // CHECK9-NEXT: [[TMP14:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4
1426 // CHECK9-NEXT: [[TMP15:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4
1427 // CHECK9-NEXT: [[CMP5:%.*]] = icmp sle i32 [[TMP14]], [[TMP15]]
1428 // CHECK9-NEXT: br i1 [[CMP5]], label [[OMP_INNER_FOR_BODY:%.*]], label [[OMP_INNER_FOR_END:%.*]]
1429 // CHECK9: omp.inner.for.body:
1430 // CHECK9-NEXT: [[TMP16:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4
1431 // CHECK9-NEXT: [[MUL:%.*]] = mul nsw i32 [[TMP16]], 1
1432 // CHECK9-NEXT: [[ADD:%.*]] = add nsw i32 0, [[MUL]]
1433 // CHECK9-NEXT: store i32 [[ADD]], ptr [[I3]], align 4
1434 // CHECK9-NEXT: [[TMP17:%.*]] = load i32, ptr [[I3]], align 4
1435 // CHECK9-NEXT: [[IDXPROM:%.*]] = sext i32 [[TMP17]] to i64
1436 // CHECK9-NEXT: [[ARRAYIDX:%.*]] = getelementptr inbounds i32, ptr [[TMP2]], i64 [[IDXPROM]]
1437 // CHECK9-NEXT: store i32 0, ptr [[ARRAYIDX]], align 4
1438 // CHECK9-NEXT: br label [[OMP_BODY_CONTINUE:%.*]]
1439 // CHECK9: omp.body.continue:
1440 // CHECK9-NEXT: br label [[OMP_INNER_FOR_INC:%.*]]
1441 // CHECK9: omp.inner.for.inc:
1442 // CHECK9-NEXT: [[TMP18:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4
1443 // CHECK9-NEXT: [[ADD6:%.*]] = add nsw i32 [[TMP18]], 1
1444 // CHECK9-NEXT: store i32 [[ADD6]], ptr [[DOTOMP_IV]], align 4
1445 // CHECK9-NEXT: br label [[OMP_INNER_FOR_COND]]
1446 // CHECK9: omp.inner.for.end:
1447 // CHECK9-NEXT: br label [[OMP_LOOP_EXIT:%.*]]
1448 // CHECK9: omp.loop.exit:
1449 // CHECK9-NEXT: [[TMP19:%.*]] = load ptr, ptr [[DOTGLOBAL_TID__ADDR]], align 8
1450 // CHECK9-NEXT: [[TMP20:%.*]] = load i32, ptr [[TMP19]], align 4
1451 // CHECK9-NEXT: call void @__kmpc_for_static_fini(ptr @[[GLOB1]], i32 [[TMP20]])
1452 // CHECK9-NEXT: br label [[OMP_PRECOND_END]]
1453 // CHECK9: omp.precond.end:
1454 // CHECK9-NEXT: ret void
1457 // CHECK9-LABEL: define {{[^@]+}}@{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}_main_l110
1458 // CHECK9-SAME: (i64 noundef [[N:%.*]], i64 noundef [[VLA:%.*]], ptr noundef nonnull align 4 dereferenceable(4) [[A:%.*]]) #[[ATTR2]] {
1459 // CHECK9-NEXT: entry:
1460 // CHECK9-NEXT: [[N_ADDR:%.*]] = alloca i64, align 8
1461 // CHECK9-NEXT: [[VLA_ADDR:%.*]] = alloca i64, align 8
1462 // CHECK9-NEXT: [[A_ADDR:%.*]] = alloca ptr, align 8
1463 // CHECK9-NEXT: [[DOTCAPTURE_EXPR_:%.*]] = alloca i32, align 4
1464 // CHECK9-NEXT: [[DOTCAPTURE_EXPR__CASTED:%.*]] = alloca i64, align 8
1465 // CHECK9-NEXT: store i64 [[N]], ptr [[N_ADDR]], align 8
1466 // CHECK9-NEXT: store i64 [[VLA]], ptr [[VLA_ADDR]], align 8
1467 // CHECK9-NEXT: store ptr [[A]], ptr [[A_ADDR]], align 8
1468 // CHECK9-NEXT: [[TMP0:%.*]] = load i64, ptr [[VLA_ADDR]], align 8
1469 // CHECK9-NEXT: [[TMP1:%.*]] = load ptr, ptr [[A_ADDR]], align 8
1470 // CHECK9-NEXT: [[TMP2:%.*]] = load i32, ptr [[N_ADDR]], align 4
1471 // CHECK9-NEXT: store i32 [[TMP2]], ptr [[DOTCAPTURE_EXPR_]], align 4
1472 // CHECK9-NEXT: [[TMP3:%.*]] = load i32, ptr [[DOTCAPTURE_EXPR_]], align 4
1473 // CHECK9-NEXT: store i32 [[TMP3]], ptr [[DOTCAPTURE_EXPR__CASTED]], align 4
1474 // CHECK9-NEXT: [[TMP4:%.*]] = load i64, ptr [[DOTCAPTURE_EXPR__CASTED]], align 8
1475 // CHECK9-NEXT: call void (ptr, i32, ptr, ...) @__kmpc_fork_teams(ptr @[[GLOB2]], i32 4, ptr @{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}_main_l110.omp_outlined, ptr [[N_ADDR]], i64 [[TMP0]], ptr [[TMP1]], i64 [[TMP4]])
1476 // CHECK9-NEXT: ret void
1479 // CHECK9-LABEL: define {{[^@]+}}@{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}_main_l110.omp_outlined
1480 // 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:%.*]], i64 noundef [[DOTCAPTURE_EXPR_:%.*]]) #[[ATTR3]] {
1481 // CHECK9-NEXT: entry:
1482 // CHECK9-NEXT: [[DOTGLOBAL_TID__ADDR:%.*]] = alloca ptr, align 8
1483 // CHECK9-NEXT: [[DOTBOUND_TID__ADDR:%.*]] = alloca ptr, align 8
1484 // CHECK9-NEXT: [[N_ADDR:%.*]] = alloca ptr, align 8
1485 // CHECK9-NEXT: [[VLA_ADDR:%.*]] = alloca i64, align 8
1486 // CHECK9-NEXT: [[A_ADDR:%.*]] = alloca ptr, align 8
1487 // CHECK9-NEXT: [[DOTCAPTURE_EXPR__ADDR:%.*]] = alloca i64, align 8
1488 // CHECK9-NEXT: [[DOTOMP_IV:%.*]] = alloca i32, align 4
1489 // CHECK9-NEXT: [[TMP:%.*]] = alloca i32, align 4
1490 // CHECK9-NEXT: [[DOTCAPTURE_EXPR_1:%.*]] = alloca i32, align 4
1491 // CHECK9-NEXT: [[DOTCAPTURE_EXPR_2:%.*]] = alloca i32, align 4
1492 // CHECK9-NEXT: [[I:%.*]] = alloca i32, align 4
1493 // CHECK9-NEXT: [[DOTOMP_LB:%.*]] = alloca i32, align 4
1494 // CHECK9-NEXT: [[DOTOMP_UB:%.*]] = alloca i32, align 4
1495 // CHECK9-NEXT: [[DOTOMP_STRIDE:%.*]] = alloca i32, align 4
1496 // CHECK9-NEXT: [[DOTOMP_IS_LAST:%.*]] = alloca i32, align 4
1497 // CHECK9-NEXT: [[I4:%.*]] = alloca i32, align 4
1498 // CHECK9-NEXT: store ptr [[DOTGLOBAL_TID_]], ptr [[DOTGLOBAL_TID__ADDR]], align 8
1499 // CHECK9-NEXT: store ptr [[DOTBOUND_TID_]], ptr [[DOTBOUND_TID__ADDR]], align 8
1500 // CHECK9-NEXT: store ptr [[N]], ptr [[N_ADDR]], align 8
1501 // CHECK9-NEXT: store i64 [[VLA]], ptr [[VLA_ADDR]], align 8
1502 // CHECK9-NEXT: store ptr [[A]], ptr [[A_ADDR]], align 8
1503 // CHECK9-NEXT: store i64 [[DOTCAPTURE_EXPR_]], ptr [[DOTCAPTURE_EXPR__ADDR]], align 8
1504 // CHECK9-NEXT: [[TMP0:%.*]] = load ptr, ptr [[N_ADDR]], align 8
1505 // CHECK9-NEXT: [[TMP1:%.*]] = load i64, ptr [[VLA_ADDR]], align 8
1506 // CHECK9-NEXT: [[TMP2:%.*]] = load ptr, ptr [[A_ADDR]], align 8
1507 // CHECK9-NEXT: [[TMP3:%.*]] = load i32, ptr [[TMP0]], align 4
1508 // CHECK9-NEXT: store i32 [[TMP3]], ptr [[DOTCAPTURE_EXPR_1]], align 4
1509 // CHECK9-NEXT: [[TMP4:%.*]] = load i32, ptr [[DOTCAPTURE_EXPR_1]], align 4
1510 // CHECK9-NEXT: [[SUB:%.*]] = sub nsw i32 [[TMP4]], 0
1511 // CHECK9-NEXT: [[DIV:%.*]] = sdiv i32 [[SUB]], 1
1512 // CHECK9-NEXT: [[SUB3:%.*]] = sub nsw i32 [[DIV]], 1
1513 // CHECK9-NEXT: store i32 [[SUB3]], ptr [[DOTCAPTURE_EXPR_2]], align 4
1514 // CHECK9-NEXT: store i32 0, ptr [[I]], align 4
1515 // CHECK9-NEXT: [[TMP5:%.*]] = load i32, ptr [[DOTCAPTURE_EXPR_1]], align 4
1516 // CHECK9-NEXT: [[CMP:%.*]] = icmp slt i32 0, [[TMP5]]
1517 // CHECK9-NEXT: br i1 [[CMP]], label [[OMP_PRECOND_THEN:%.*]], label [[OMP_PRECOND_END:%.*]]
1518 // CHECK9: omp.precond.then:
1519 // CHECK9-NEXT: store i32 0, ptr [[DOTOMP_LB]], align 4
1520 // CHECK9-NEXT: [[TMP6:%.*]] = load i32, ptr [[DOTCAPTURE_EXPR_2]], align 4
1521 // CHECK9-NEXT: store i32 [[TMP6]], ptr [[DOTOMP_UB]], align 4
1522 // CHECK9-NEXT: store i32 1, ptr [[DOTOMP_STRIDE]], align 4
1523 // CHECK9-NEXT: store i32 0, ptr [[DOTOMP_IS_LAST]], align 4
1524 // CHECK9-NEXT: [[TMP7:%.*]] = load i32, ptr [[DOTCAPTURE_EXPR__ADDR]], align 4
1525 // CHECK9-NEXT: [[TMP8:%.*]] = load ptr, ptr [[DOTGLOBAL_TID__ADDR]], align 8
1526 // CHECK9-NEXT: [[TMP9:%.*]] = load i32, ptr [[TMP8]], align 4
1527 // CHECK9-NEXT: call void @__kmpc_for_static_init_4(ptr @[[GLOB1]], i32 [[TMP9]], i32 91, ptr [[DOTOMP_IS_LAST]], ptr [[DOTOMP_LB]], ptr [[DOTOMP_UB]], ptr [[DOTOMP_STRIDE]], i32 1, i32 [[TMP7]])
1528 // CHECK9-NEXT: br label [[OMP_DISPATCH_COND:%.*]]
1529 // CHECK9: omp.dispatch.cond:
1530 // CHECK9-NEXT: [[TMP10:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4
1531 // CHECK9-NEXT: [[TMP11:%.*]] = load i32, ptr [[DOTCAPTURE_EXPR_2]], align 4
1532 // CHECK9-NEXT: [[CMP5:%.*]] = icmp sgt i32 [[TMP10]], [[TMP11]]
1533 // CHECK9-NEXT: br i1 [[CMP5]], label [[COND_TRUE:%.*]], label [[COND_FALSE:%.*]]
1534 // CHECK9: cond.true:
1535 // CHECK9-NEXT: [[TMP12:%.*]] = load i32, ptr [[DOTCAPTURE_EXPR_2]], align 4
1536 // CHECK9-NEXT: br label [[COND_END:%.*]]
1537 // CHECK9: cond.false:
1538 // CHECK9-NEXT: [[TMP13:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4
1539 // CHECK9-NEXT: br label [[COND_END]]
1540 // CHECK9: cond.end:
1541 // CHECK9-NEXT: [[COND:%.*]] = phi i32 [ [[TMP12]], [[COND_TRUE]] ], [ [[TMP13]], [[COND_FALSE]] ]
1542 // CHECK9-NEXT: store i32 [[COND]], ptr [[DOTOMP_UB]], align 4
1543 // CHECK9-NEXT: [[TMP14:%.*]] = load i32, ptr [[DOTOMP_LB]], align 4
1544 // CHECK9-NEXT: store i32 [[TMP14]], ptr [[DOTOMP_IV]], align 4
1545 // CHECK9-NEXT: [[TMP15:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4
1546 // CHECK9-NEXT: [[TMP16:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4
1547 // CHECK9-NEXT: [[CMP6:%.*]] = icmp sle i32 [[TMP15]], [[TMP16]]
1548 // CHECK9-NEXT: br i1 [[CMP6]], label [[OMP_DISPATCH_BODY:%.*]], label [[OMP_DISPATCH_END:%.*]]
1549 // CHECK9: omp.dispatch.body:
1550 // CHECK9-NEXT: br label [[OMP_INNER_FOR_COND:%.*]]
1551 // CHECK9: omp.inner.for.cond:
1552 // CHECK9-NEXT: [[TMP17:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP11:![0-9]+]]
1553 // CHECK9-NEXT: [[TMP18:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4, !llvm.access.group [[ACC_GRP11]]
1554 // CHECK9-NEXT: [[CMP7:%.*]] = icmp sle i32 [[TMP17]], [[TMP18]]
1555 // CHECK9-NEXT: br i1 [[CMP7]], label [[OMP_INNER_FOR_BODY:%.*]], label [[OMP_INNER_FOR_END:%.*]]
1556 // CHECK9: omp.inner.for.body:
1557 // CHECK9-NEXT: [[TMP19:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP11]]
1558 // CHECK9-NEXT: [[MUL:%.*]] = mul nsw i32 [[TMP19]], 1
1559 // CHECK9-NEXT: [[ADD:%.*]] = add nsw i32 0, [[MUL]]
1560 // CHECK9-NEXT: store i32 [[ADD]], ptr [[I4]], align 4, !llvm.access.group [[ACC_GRP11]]
1561 // CHECK9-NEXT: [[TMP20:%.*]] = load i32, ptr [[I4]], align 4, !llvm.access.group [[ACC_GRP11]]
1562 // CHECK9-NEXT: [[IDXPROM:%.*]] = sext i32 [[TMP20]] to i64
1563 // CHECK9-NEXT: [[ARRAYIDX:%.*]] = getelementptr inbounds i32, ptr [[TMP2]], i64 [[IDXPROM]]
1564 // CHECK9-NEXT: store i32 0, ptr [[ARRAYIDX]], align 4, !llvm.access.group [[ACC_GRP11]]
1565 // CHECK9-NEXT: br label [[OMP_BODY_CONTINUE:%.*]]
1566 // CHECK9: omp.body.continue:
1567 // CHECK9-NEXT: br label [[OMP_INNER_FOR_INC:%.*]]
1568 // CHECK9: omp.inner.for.inc:
1569 // CHECK9-NEXT: [[TMP21:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP11]]
1570 // CHECK9-NEXT: [[ADD8:%.*]] = add nsw i32 [[TMP21]], 1
1571 // CHECK9-NEXT: store i32 [[ADD8]], ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP11]]
1572 // CHECK9-NEXT: br label [[OMP_INNER_FOR_COND]], !llvm.loop [[LOOP12:![0-9]+]]
1573 // CHECK9: omp.inner.for.end:
1574 // CHECK9-NEXT: br label [[OMP_DISPATCH_INC:%.*]]
1575 // CHECK9: omp.dispatch.inc:
1576 // CHECK9-NEXT: [[TMP22:%.*]] = load i32, ptr [[DOTOMP_LB]], align 4
1577 // CHECK9-NEXT: [[TMP23:%.*]] = load i32, ptr [[DOTOMP_STRIDE]], align 4
1578 // CHECK9-NEXT: [[ADD9:%.*]] = add nsw i32 [[TMP22]], [[TMP23]]
1579 // CHECK9-NEXT: store i32 [[ADD9]], ptr [[DOTOMP_LB]], align 4
1580 // CHECK9-NEXT: [[TMP24:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4
1581 // CHECK9-NEXT: [[TMP25:%.*]] = load i32, ptr [[DOTOMP_STRIDE]], align 4
1582 // CHECK9-NEXT: [[ADD10:%.*]] = add nsw i32 [[TMP24]], [[TMP25]]
1583 // CHECK9-NEXT: store i32 [[ADD10]], ptr [[DOTOMP_UB]], align 4
1584 // CHECK9-NEXT: br label [[OMP_DISPATCH_COND]]
1585 // CHECK9: omp.dispatch.end:
1586 // CHECK9-NEXT: [[TMP26:%.*]] = load ptr, ptr [[DOTGLOBAL_TID__ADDR]], align 8
1587 // CHECK9-NEXT: [[TMP27:%.*]] = load i32, ptr [[TMP26]], align 4
1588 // CHECK9-NEXT: call void @__kmpc_for_static_fini(ptr @[[GLOB1]], i32 [[TMP27]])
1589 // CHECK9-NEXT: br label [[OMP_PRECOND_END]]
1590 // CHECK9: omp.precond.end:
1591 // CHECK9-NEXT: ret void
1594 // CHECK9-LABEL: define {{[^@]+}}@_Z5tmainIiLi10EEiT_
1595 // CHECK9-SAME: (i32 noundef signext [[ARGC:%.*]]) #[[ATTR6:[0-9]+]] comdat {
1596 // CHECK9-NEXT: entry:
1597 // CHECK9-NEXT: [[ARGC_ADDR:%.*]] = alloca i32, align 4
1598 // CHECK9-NEXT: [[A:%.*]] = alloca [10 x i32], align 4
1599 // CHECK9-NEXT: [[DOTOFFLOAD_BASEPTRS:%.*]] = alloca [1 x ptr], align 8
1600 // CHECK9-NEXT: [[DOTOFFLOAD_PTRS:%.*]] = alloca [1 x ptr], align 8
1601 // CHECK9-NEXT: [[DOTOFFLOAD_MAPPERS:%.*]] = alloca [1 x ptr], align 8
1602 // CHECK9-NEXT: [[TMP:%.*]] = alloca i32, align 4
1603 // CHECK9-NEXT: [[KERNEL_ARGS:%.*]] = alloca [[STRUCT___TGT_KERNEL_ARGUMENTS:%.*]], align 8
1604 // CHECK9-NEXT: [[DOTOFFLOAD_BASEPTRS1:%.*]] = alloca [1 x ptr], align 8
1605 // CHECK9-NEXT: [[DOTOFFLOAD_PTRS2:%.*]] = alloca [1 x ptr], align 8
1606 // CHECK9-NEXT: [[DOTOFFLOAD_MAPPERS3:%.*]] = alloca [1 x ptr], align 8
1607 // CHECK9-NEXT: [[_TMP4:%.*]] = alloca i32, align 4
1608 // CHECK9-NEXT: [[KERNEL_ARGS5:%.*]] = alloca [[STRUCT___TGT_KERNEL_ARGUMENTS]], align 8
1609 // CHECK9-NEXT: [[DOTOFFLOAD_BASEPTRS8:%.*]] = alloca [1 x ptr], align 8
1610 // CHECK9-NEXT: [[DOTOFFLOAD_PTRS9:%.*]] = alloca [1 x ptr], align 8
1611 // CHECK9-NEXT: [[DOTOFFLOAD_MAPPERS10:%.*]] = alloca [1 x ptr], align 8
1612 // CHECK9-NEXT: [[_TMP11:%.*]] = alloca i32, align 4
1613 // CHECK9-NEXT: [[KERNEL_ARGS12:%.*]] = alloca [[STRUCT___TGT_KERNEL_ARGUMENTS]], align 8
1614 // CHECK9-NEXT: store i32 [[ARGC]], ptr [[ARGC_ADDR]], align 4
1615 // CHECK9-NEXT: [[TMP0:%.*]] = getelementptr inbounds [1 x ptr], ptr [[DOTOFFLOAD_BASEPTRS]], i32 0, i32 0
1616 // CHECK9-NEXT: store ptr [[A]], ptr [[TMP0]], align 8
1617 // CHECK9-NEXT: [[TMP1:%.*]] = getelementptr inbounds [1 x ptr], ptr [[DOTOFFLOAD_PTRS]], i32 0, i32 0
1618 // CHECK9-NEXT: store ptr [[A]], ptr [[TMP1]], align 8
1619 // CHECK9-NEXT: [[TMP2:%.*]] = getelementptr inbounds [1 x ptr], ptr [[DOTOFFLOAD_MAPPERS]], i64 0, i64 0
1620 // CHECK9-NEXT: store ptr null, ptr [[TMP2]], align 8
1621 // CHECK9-NEXT: [[TMP3:%.*]] = getelementptr inbounds [1 x ptr], ptr [[DOTOFFLOAD_BASEPTRS]], i32 0, i32 0
1622 // CHECK9-NEXT: [[TMP4:%.*]] = getelementptr inbounds [1 x ptr], ptr [[DOTOFFLOAD_PTRS]], i32 0, i32 0
1623 // CHECK9-NEXT: [[TMP5:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 0
1624 // CHECK9-NEXT: store i32 2, ptr [[TMP5]], align 4
1625 // CHECK9-NEXT: [[TMP6:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 1
1626 // CHECK9-NEXT: store i32 1, ptr [[TMP6]], align 4
1627 // CHECK9-NEXT: [[TMP7:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 2
1628 // CHECK9-NEXT: store ptr [[TMP3]], ptr [[TMP7]], align 8
1629 // CHECK9-NEXT: [[TMP8:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 3
1630 // CHECK9-NEXT: store ptr [[TMP4]], ptr [[TMP8]], align 8
1631 // CHECK9-NEXT: [[TMP9:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 4
1632 // CHECK9-NEXT: store ptr @.offload_sizes.5, ptr [[TMP9]], align 8
1633 // CHECK9-NEXT: [[TMP10:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 5
1634 // CHECK9-NEXT: store ptr @.offload_maptypes.6, ptr [[TMP10]], align 8
1635 // CHECK9-NEXT: [[TMP11:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 6
1636 // CHECK9-NEXT: store ptr null, ptr [[TMP11]], align 8
1637 // CHECK9-NEXT: [[TMP12:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 7
1638 // CHECK9-NEXT: store ptr null, ptr [[TMP12]], align 8
1639 // CHECK9-NEXT: [[TMP13:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 8
1640 // CHECK9-NEXT: store i64 10, ptr [[TMP13]], align 8
1641 // CHECK9-NEXT: [[TMP14:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 9
1642 // CHECK9-NEXT: store i64 0, ptr [[TMP14]], align 8
1643 // CHECK9-NEXT: [[TMP15:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 10
1644 // CHECK9-NEXT: store [3 x i32] zeroinitializer, ptr [[TMP15]], align 4
1645 // CHECK9-NEXT: [[TMP16:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 11
1646 // CHECK9-NEXT: store [3 x i32] zeroinitializer, ptr [[TMP16]], align 4
1647 // CHECK9-NEXT: [[TMP17:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 12
1648 // CHECK9-NEXT: store i32 0, ptr [[TMP17]], align 4
1649 // CHECK9-NEXT: [[TMP18:%.*]] = call i32 @__tgt_target_kernel(ptr @[[GLOB2]], i64 -1, i32 0, i32 0, ptr @.{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z5tmainIiLi10EEiT__l79.region_id, ptr [[KERNEL_ARGS]])
1650 // CHECK9-NEXT: [[TMP19:%.*]] = icmp ne i32 [[TMP18]], 0
1651 // CHECK9-NEXT: br i1 [[TMP19]], label [[OMP_OFFLOAD_FAILED:%.*]], label [[OMP_OFFLOAD_CONT:%.*]]
1652 // CHECK9: omp_offload.failed:
1653 // CHECK9-NEXT: call void @{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z5tmainIiLi10EEiT__l79(ptr [[A]]) #[[ATTR4]]
1654 // CHECK9-NEXT: br label [[OMP_OFFLOAD_CONT]]
1655 // CHECK9: omp_offload.cont:
1656 // CHECK9-NEXT: [[TMP20:%.*]] = getelementptr inbounds [1 x ptr], ptr [[DOTOFFLOAD_BASEPTRS1]], i32 0, i32 0
1657 // CHECK9-NEXT: store ptr [[A]], ptr [[TMP20]], align 8
1658 // CHECK9-NEXT: [[TMP21:%.*]] = getelementptr inbounds [1 x ptr], ptr [[DOTOFFLOAD_PTRS2]], i32 0, i32 0
1659 // CHECK9-NEXT: store ptr [[A]], ptr [[TMP21]], align 8
1660 // CHECK9-NEXT: [[TMP22:%.*]] = getelementptr inbounds [1 x ptr], ptr [[DOTOFFLOAD_MAPPERS3]], i64 0, i64 0
1661 // CHECK9-NEXT: store ptr null, ptr [[TMP22]], align 8
1662 // CHECK9-NEXT: [[TMP23:%.*]] = getelementptr inbounds [1 x ptr], ptr [[DOTOFFLOAD_BASEPTRS1]], i32 0, i32 0
1663 // CHECK9-NEXT: [[TMP24:%.*]] = getelementptr inbounds [1 x ptr], ptr [[DOTOFFLOAD_PTRS2]], i32 0, i32 0
1664 // CHECK9-NEXT: [[TMP25:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS5]], i32 0, i32 0
1665 // CHECK9-NEXT: store i32 2, ptr [[TMP25]], align 4
1666 // CHECK9-NEXT: [[TMP26:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS5]], i32 0, i32 1
1667 // CHECK9-NEXT: store i32 1, ptr [[TMP26]], align 4
1668 // CHECK9-NEXT: [[TMP27:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS5]], i32 0, i32 2
1669 // CHECK9-NEXT: store ptr [[TMP23]], ptr [[TMP27]], align 8
1670 // CHECK9-NEXT: [[TMP28:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS5]], i32 0, i32 3
1671 // CHECK9-NEXT: store ptr [[TMP24]], ptr [[TMP28]], align 8
1672 // CHECK9-NEXT: [[TMP29:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS5]], i32 0, i32 4
1673 // CHECK9-NEXT: store ptr @.offload_sizes.7, ptr [[TMP29]], align 8
1674 // CHECK9-NEXT: [[TMP30:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS5]], i32 0, i32 5
1675 // CHECK9-NEXT: store ptr @.offload_maptypes.8, ptr [[TMP30]], align 8
1676 // CHECK9-NEXT: [[TMP31:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS5]], i32 0, i32 6
1677 // CHECK9-NEXT: store ptr null, ptr [[TMP31]], align 8
1678 // CHECK9-NEXT: [[TMP32:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS5]], i32 0, i32 7
1679 // CHECK9-NEXT: store ptr null, ptr [[TMP32]], align 8
1680 // CHECK9-NEXT: [[TMP33:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS5]], i32 0, i32 8
1681 // CHECK9-NEXT: store i64 10, ptr [[TMP33]], align 8
1682 // CHECK9-NEXT: [[TMP34:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS5]], i32 0, i32 9
1683 // CHECK9-NEXT: store i64 0, ptr [[TMP34]], align 8
1684 // CHECK9-NEXT: [[TMP35:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS5]], i32 0, i32 10
1685 // CHECK9-NEXT: store [3 x i32] zeroinitializer, ptr [[TMP35]], align 4
1686 // CHECK9-NEXT: [[TMP36:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS5]], i32 0, i32 11
1687 // CHECK9-NEXT: store [3 x i32] zeroinitializer, ptr [[TMP36]], align 4
1688 // CHECK9-NEXT: [[TMP37:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS5]], i32 0, i32 12
1689 // CHECK9-NEXT: store i32 0, ptr [[TMP37]], align 4
1690 // CHECK9-NEXT: [[TMP38:%.*]] = call i32 @__tgt_target_kernel(ptr @[[GLOB2]], i64 -1, i32 0, i32 0, ptr @.{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z5tmainIiLi10EEiT__l84.region_id, ptr [[KERNEL_ARGS5]])
1691 // CHECK9-NEXT: [[TMP39:%.*]] = icmp ne i32 [[TMP38]], 0
1692 // CHECK9-NEXT: br i1 [[TMP39]], label [[OMP_OFFLOAD_FAILED6:%.*]], label [[OMP_OFFLOAD_CONT7:%.*]]
1693 // CHECK9: omp_offload.failed6:
1694 // CHECK9-NEXT: call void @{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z5tmainIiLi10EEiT__l84(ptr [[A]]) #[[ATTR4]]
1695 // CHECK9-NEXT: br label [[OMP_OFFLOAD_CONT7]]
1696 // CHECK9: omp_offload.cont7:
1697 // CHECK9-NEXT: [[TMP40:%.*]] = getelementptr inbounds [1 x ptr], ptr [[DOTOFFLOAD_BASEPTRS8]], i32 0, i32 0
1698 // CHECK9-NEXT: store ptr [[A]], ptr [[TMP40]], align 8
1699 // CHECK9-NEXT: [[TMP41:%.*]] = getelementptr inbounds [1 x ptr], ptr [[DOTOFFLOAD_PTRS9]], i32 0, i32 0
1700 // CHECK9-NEXT: store ptr [[A]], ptr [[TMP41]], align 8
1701 // CHECK9-NEXT: [[TMP42:%.*]] = getelementptr inbounds [1 x ptr], ptr [[DOTOFFLOAD_MAPPERS10]], i64 0, i64 0
1702 // CHECK9-NEXT: store ptr null, ptr [[TMP42]], align 8
1703 // CHECK9-NEXT: [[TMP43:%.*]] = getelementptr inbounds [1 x ptr], ptr [[DOTOFFLOAD_BASEPTRS8]], i32 0, i32 0
1704 // CHECK9-NEXT: [[TMP44:%.*]] = getelementptr inbounds [1 x ptr], ptr [[DOTOFFLOAD_PTRS9]], i32 0, i32 0
1705 // CHECK9-NEXT: [[TMP45:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS12]], i32 0, i32 0
1706 // CHECK9-NEXT: store i32 2, ptr [[TMP45]], align 4
1707 // CHECK9-NEXT: [[TMP46:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS12]], i32 0, i32 1
1708 // CHECK9-NEXT: store i32 1, ptr [[TMP46]], align 4
1709 // CHECK9-NEXT: [[TMP47:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS12]], i32 0, i32 2
1710 // CHECK9-NEXT: store ptr [[TMP43]], ptr [[TMP47]], align 8
1711 // CHECK9-NEXT: [[TMP48:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS12]], i32 0, i32 3
1712 // CHECK9-NEXT: store ptr [[TMP44]], ptr [[TMP48]], align 8
1713 // CHECK9-NEXT: [[TMP49:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS12]], i32 0, i32 4
1714 // CHECK9-NEXT: store ptr @.offload_sizes.9, ptr [[TMP49]], align 8
1715 // CHECK9-NEXT: [[TMP50:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS12]], i32 0, i32 5
1716 // CHECK9-NEXT: store ptr @.offload_maptypes.10, ptr [[TMP50]], align 8
1717 // CHECK9-NEXT: [[TMP51:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS12]], i32 0, i32 6
1718 // CHECK9-NEXT: store ptr null, ptr [[TMP51]], align 8
1719 // CHECK9-NEXT: [[TMP52:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS12]], i32 0, i32 7
1720 // CHECK9-NEXT: store ptr null, ptr [[TMP52]], align 8
1721 // CHECK9-NEXT: [[TMP53:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS12]], i32 0, i32 8
1722 // CHECK9-NEXT: store i64 10, ptr [[TMP53]], align 8
1723 // CHECK9-NEXT: [[TMP54:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS12]], i32 0, i32 9
1724 // CHECK9-NEXT: store i64 0, ptr [[TMP54]], align 8
1725 // CHECK9-NEXT: [[TMP55:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS12]], i32 0, i32 10
1726 // CHECK9-NEXT: store [3 x i32] zeroinitializer, ptr [[TMP55]], align 4
1727 // CHECK9-NEXT: [[TMP56:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS12]], i32 0, i32 11
1728 // CHECK9-NEXT: store [3 x i32] zeroinitializer, ptr [[TMP56]], align 4
1729 // CHECK9-NEXT: [[TMP57:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS12]], i32 0, i32 12
1730 // CHECK9-NEXT: store i32 0, ptr [[TMP57]], align 4
1731 // CHECK9-NEXT: [[TMP58:%.*]] = call i32 @__tgt_target_kernel(ptr @[[GLOB2]], i64 -1, i32 0, i32 0, ptr @.{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z5tmainIiLi10EEiT__l89.region_id, ptr [[KERNEL_ARGS12]])
1732 // CHECK9-NEXT: [[TMP59:%.*]] = icmp ne i32 [[TMP58]], 0
1733 // CHECK9-NEXT: br i1 [[TMP59]], label [[OMP_OFFLOAD_FAILED13:%.*]], label [[OMP_OFFLOAD_CONT14:%.*]]
1734 // CHECK9: omp_offload.failed13:
1735 // CHECK9-NEXT: call void @{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z5tmainIiLi10EEiT__l89(ptr [[A]]) #[[ATTR4]]
1736 // CHECK9-NEXT: br label [[OMP_OFFLOAD_CONT14]]
1737 // CHECK9: omp_offload.cont14:
1738 // CHECK9-NEXT: ret i32 0
1741 // CHECK9-LABEL: define {{[^@]+}}@{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z5tmainIiLi10EEiT__l79
1742 // CHECK9-SAME: (ptr noundef nonnull align 4 dereferenceable(40) [[A:%.*]]) #[[ATTR2]] {
1743 // CHECK9-NEXT: entry:
1744 // CHECK9-NEXT: [[A_ADDR:%.*]] = alloca ptr, align 8
1745 // CHECK9-NEXT: store ptr [[A]], ptr [[A_ADDR]], align 8
1746 // CHECK9-NEXT: [[TMP0:%.*]] = load ptr, ptr [[A_ADDR]], align 8
1747 // CHECK9-NEXT: call void (ptr, i32, ptr, ...) @__kmpc_fork_teams(ptr @[[GLOB2]], i32 1, ptr @{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z5tmainIiLi10EEiT__l79.omp_outlined, ptr [[TMP0]])
1748 // CHECK9-NEXT: ret void
1751 // CHECK9-LABEL: define {{[^@]+}}@{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z5tmainIiLi10EEiT__l79.omp_outlined
1752 // CHECK9-SAME: (ptr noalias noundef [[DOTGLOBAL_TID_:%.*]], ptr noalias noundef [[DOTBOUND_TID_:%.*]], ptr noundef nonnull align 4 dereferenceable(40) [[A:%.*]]) #[[ATTR3]] {
1753 // CHECK9-NEXT: entry:
1754 // CHECK9-NEXT: [[DOTGLOBAL_TID__ADDR:%.*]] = alloca ptr, align 8
1755 // CHECK9-NEXT: [[DOTBOUND_TID__ADDR:%.*]] = alloca ptr, align 8
1756 // CHECK9-NEXT: [[A_ADDR:%.*]] = alloca ptr, align 8
1757 // CHECK9-NEXT: [[DOTOMP_IV:%.*]] = alloca i32, align 4
1758 // CHECK9-NEXT: [[TMP:%.*]] = alloca i32, align 4
1759 // CHECK9-NEXT: [[DOTOMP_LB:%.*]] = alloca i32, align 4
1760 // CHECK9-NEXT: [[DOTOMP_UB:%.*]] = alloca i32, align 4
1761 // CHECK9-NEXT: [[DOTOMP_STRIDE:%.*]] = alloca i32, align 4
1762 // CHECK9-NEXT: [[DOTOMP_IS_LAST:%.*]] = alloca i32, align 4
1763 // CHECK9-NEXT: [[I:%.*]] = alloca i32, align 4
1764 // CHECK9-NEXT: store ptr [[DOTGLOBAL_TID_]], ptr [[DOTGLOBAL_TID__ADDR]], align 8
1765 // CHECK9-NEXT: store ptr [[DOTBOUND_TID_]], ptr [[DOTBOUND_TID__ADDR]], align 8
1766 // CHECK9-NEXT: store ptr [[A]], ptr [[A_ADDR]], align 8
1767 // CHECK9-NEXT: [[TMP0:%.*]] = load ptr, ptr [[A_ADDR]], align 8
1768 // CHECK9-NEXT: store i32 0, ptr [[DOTOMP_LB]], align 4
1769 // CHECK9-NEXT: store i32 9, ptr [[DOTOMP_UB]], align 4
1770 // CHECK9-NEXT: store i32 1, ptr [[DOTOMP_STRIDE]], align 4
1771 // CHECK9-NEXT: store i32 0, ptr [[DOTOMP_IS_LAST]], align 4
1772 // CHECK9-NEXT: [[TMP1:%.*]] = load ptr, ptr [[DOTGLOBAL_TID__ADDR]], align 8
1773 // CHECK9-NEXT: [[TMP2:%.*]] = load i32, ptr [[TMP1]], align 4
1774 // CHECK9-NEXT: call void @__kmpc_for_static_init_4(ptr @[[GLOB1]], i32 [[TMP2]], i32 92, ptr [[DOTOMP_IS_LAST]], ptr [[DOTOMP_LB]], ptr [[DOTOMP_UB]], ptr [[DOTOMP_STRIDE]], i32 1, i32 1)
1775 // CHECK9-NEXT: [[TMP3:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4
1776 // CHECK9-NEXT: [[CMP:%.*]] = icmp sgt i32 [[TMP3]], 9
1777 // CHECK9-NEXT: br i1 [[CMP]], label [[COND_TRUE:%.*]], label [[COND_FALSE:%.*]]
1778 // CHECK9: cond.true:
1779 // CHECK9-NEXT: br label [[COND_END:%.*]]
1780 // CHECK9: cond.false:
1781 // CHECK9-NEXT: [[TMP4:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4
1782 // CHECK9-NEXT: br label [[COND_END]]
1783 // CHECK9: cond.end:
1784 // CHECK9-NEXT: [[COND:%.*]] = phi i32 [ 9, [[COND_TRUE]] ], [ [[TMP4]], [[COND_FALSE]] ]
1785 // CHECK9-NEXT: store i32 [[COND]], ptr [[DOTOMP_UB]], align 4
1786 // CHECK9-NEXT: [[TMP5:%.*]] = load i32, ptr [[DOTOMP_LB]], align 4
1787 // CHECK9-NEXT: store i32 [[TMP5]], ptr [[DOTOMP_IV]], align 4
1788 // CHECK9-NEXT: br label [[OMP_INNER_FOR_COND:%.*]]
1789 // CHECK9: omp.inner.for.cond:
1790 // CHECK9-NEXT: [[TMP6:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4
1791 // CHECK9-NEXT: [[TMP7:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4
1792 // CHECK9-NEXT: [[CMP1:%.*]] = icmp sle i32 [[TMP6]], [[TMP7]]
1793 // CHECK9-NEXT: br i1 [[CMP1]], label [[OMP_INNER_FOR_BODY:%.*]], label [[OMP_INNER_FOR_END:%.*]]
1794 // CHECK9: omp.inner.for.body:
1795 // CHECK9-NEXT: [[TMP8:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4
1796 // CHECK9-NEXT: [[MUL:%.*]] = mul nsw i32 [[TMP8]], 1
1797 // CHECK9-NEXT: [[ADD:%.*]] = add nsw i32 0, [[MUL]]
1798 // CHECK9-NEXT: store i32 [[ADD]], ptr [[I]], align 4
1799 // CHECK9-NEXT: [[TMP9:%.*]] = load i32, ptr [[I]], align 4
1800 // CHECK9-NEXT: [[IDXPROM:%.*]] = sext i32 [[TMP9]] to i64
1801 // CHECK9-NEXT: [[ARRAYIDX:%.*]] = getelementptr inbounds [10 x i32], ptr [[TMP0]], i64 0, i64 [[IDXPROM]]
1802 // CHECK9-NEXT: store i32 0, ptr [[ARRAYIDX]], align 4
1803 // CHECK9-NEXT: br label [[OMP_BODY_CONTINUE:%.*]]
1804 // CHECK9: omp.body.continue:
1805 // CHECK9-NEXT: br label [[OMP_INNER_FOR_INC:%.*]]
1806 // CHECK9: omp.inner.for.inc:
1807 // CHECK9-NEXT: [[TMP10:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4
1808 // CHECK9-NEXT: [[ADD2:%.*]] = add nsw i32 [[TMP10]], 1
1809 // CHECK9-NEXT: store i32 [[ADD2]], ptr [[DOTOMP_IV]], align 4
1810 // CHECK9-NEXT: br label [[OMP_INNER_FOR_COND]]
1811 // CHECK9: omp.inner.for.end:
1812 // CHECK9-NEXT: br label [[OMP_LOOP_EXIT:%.*]]
1813 // CHECK9: omp.loop.exit:
1814 // CHECK9-NEXT: call void @__kmpc_for_static_fini(ptr @[[GLOB1]], i32 [[TMP2]])
1815 // CHECK9-NEXT: ret void
1818 // CHECK9-LABEL: define {{[^@]+}}@{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z5tmainIiLi10EEiT__l84
1819 // CHECK9-SAME: (ptr noundef nonnull align 4 dereferenceable(40) [[A:%.*]]) #[[ATTR2]] {
1820 // CHECK9-NEXT: entry:
1821 // CHECK9-NEXT: [[A_ADDR:%.*]] = alloca ptr, align 8
1822 // CHECK9-NEXT: store ptr [[A]], ptr [[A_ADDR]], align 8
1823 // CHECK9-NEXT: [[TMP0:%.*]] = load ptr, ptr [[A_ADDR]], align 8
1824 // CHECK9-NEXT: call void (ptr, i32, ptr, ...) @__kmpc_fork_teams(ptr @[[GLOB2]], i32 1, ptr @{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z5tmainIiLi10EEiT__l84.omp_outlined, ptr [[TMP0]])
1825 // CHECK9-NEXT: ret void
1828 // CHECK9-LABEL: define {{[^@]+}}@{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z5tmainIiLi10EEiT__l84.omp_outlined
1829 // CHECK9-SAME: (ptr noalias noundef [[DOTGLOBAL_TID_:%.*]], ptr noalias noundef [[DOTBOUND_TID_:%.*]], ptr noundef nonnull align 4 dereferenceable(40) [[A:%.*]]) #[[ATTR3]] {
1830 // CHECK9-NEXT: entry:
1831 // CHECK9-NEXT: [[DOTGLOBAL_TID__ADDR:%.*]] = alloca ptr, align 8
1832 // CHECK9-NEXT: [[DOTBOUND_TID__ADDR:%.*]] = alloca ptr, align 8
1833 // CHECK9-NEXT: [[A_ADDR:%.*]] = alloca ptr, align 8
1834 // CHECK9-NEXT: [[DOTOMP_IV:%.*]] = alloca i32, align 4
1835 // CHECK9-NEXT: [[TMP:%.*]] = alloca i32, align 4
1836 // CHECK9-NEXT: [[DOTOMP_LB:%.*]] = alloca i32, align 4
1837 // CHECK9-NEXT: [[DOTOMP_UB:%.*]] = alloca i32, align 4
1838 // CHECK9-NEXT: [[DOTOMP_STRIDE:%.*]] = alloca i32, align 4
1839 // CHECK9-NEXT: [[DOTOMP_IS_LAST:%.*]] = alloca i32, align 4
1840 // CHECK9-NEXT: [[I:%.*]] = alloca i32, align 4
1841 // CHECK9-NEXT: store ptr [[DOTGLOBAL_TID_]], ptr [[DOTGLOBAL_TID__ADDR]], align 8
1842 // CHECK9-NEXT: store ptr [[DOTBOUND_TID_]], ptr [[DOTBOUND_TID__ADDR]], align 8
1843 // CHECK9-NEXT: store ptr [[A]], ptr [[A_ADDR]], align 8
1844 // CHECK9-NEXT: [[TMP0:%.*]] = load ptr, ptr [[A_ADDR]], align 8
1845 // CHECK9-NEXT: store i32 0, ptr [[DOTOMP_LB]], align 4
1846 // CHECK9-NEXT: store i32 9, ptr [[DOTOMP_UB]], align 4
1847 // CHECK9-NEXT: store i32 1, ptr [[DOTOMP_STRIDE]], align 4
1848 // CHECK9-NEXT: store i32 0, ptr [[DOTOMP_IS_LAST]], align 4
1849 // CHECK9-NEXT: [[TMP1:%.*]] = load ptr, ptr [[DOTGLOBAL_TID__ADDR]], align 8
1850 // CHECK9-NEXT: [[TMP2:%.*]] = load i32, ptr [[TMP1]], align 4
1851 // CHECK9-NEXT: call void @__kmpc_for_static_init_4(ptr @[[GLOB1]], i32 [[TMP2]], i32 92, ptr [[DOTOMP_IS_LAST]], ptr [[DOTOMP_LB]], ptr [[DOTOMP_UB]], ptr [[DOTOMP_STRIDE]], i32 1, i32 1)
1852 // CHECK9-NEXT: [[TMP3:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4
1853 // CHECK9-NEXT: [[CMP:%.*]] = icmp sgt i32 [[TMP3]], 9
1854 // CHECK9-NEXT: br i1 [[CMP]], label [[COND_TRUE:%.*]], label [[COND_FALSE:%.*]]
1855 // CHECK9: cond.true:
1856 // CHECK9-NEXT: br label [[COND_END:%.*]]
1857 // CHECK9: cond.false:
1858 // CHECK9-NEXT: [[TMP4:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4
1859 // CHECK9-NEXT: br label [[COND_END]]
1860 // CHECK9: cond.end:
1861 // CHECK9-NEXT: [[COND:%.*]] = phi i32 [ 9, [[COND_TRUE]] ], [ [[TMP4]], [[COND_FALSE]] ]
1862 // CHECK9-NEXT: store i32 [[COND]], ptr [[DOTOMP_UB]], align 4
1863 // CHECK9-NEXT: [[TMP5:%.*]] = load i32, ptr [[DOTOMP_LB]], align 4
1864 // CHECK9-NEXT: store i32 [[TMP5]], ptr [[DOTOMP_IV]], align 4
1865 // CHECK9-NEXT: br label [[OMP_INNER_FOR_COND:%.*]]
1866 // CHECK9: omp.inner.for.cond:
1867 // CHECK9-NEXT: [[TMP6:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4
1868 // CHECK9-NEXT: [[TMP7:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4
1869 // CHECK9-NEXT: [[CMP1:%.*]] = icmp sle i32 [[TMP6]], [[TMP7]]
1870 // CHECK9-NEXT: br i1 [[CMP1]], label [[OMP_INNER_FOR_BODY:%.*]], label [[OMP_INNER_FOR_END:%.*]]
1871 // CHECK9: omp.inner.for.body:
1872 // CHECK9-NEXT: [[TMP8:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4
1873 // CHECK9-NEXT: [[MUL:%.*]] = mul nsw i32 [[TMP8]], 1
1874 // CHECK9-NEXT: [[ADD:%.*]] = add nsw i32 0, [[MUL]]
1875 // CHECK9-NEXT: store i32 [[ADD]], ptr [[I]], align 4
1876 // CHECK9-NEXT: [[TMP9:%.*]] = load i32, ptr [[I]], align 4
1877 // CHECK9-NEXT: [[IDXPROM:%.*]] = sext i32 [[TMP9]] to i64
1878 // CHECK9-NEXT: [[ARRAYIDX:%.*]] = getelementptr inbounds [10 x i32], ptr [[TMP0]], i64 0, i64 [[IDXPROM]]
1879 // CHECK9-NEXT: store i32 0, ptr [[ARRAYIDX]], align 4
1880 // CHECK9-NEXT: br label [[OMP_BODY_CONTINUE:%.*]]
1881 // CHECK9: omp.body.continue:
1882 // CHECK9-NEXT: br label [[OMP_INNER_FOR_INC:%.*]]
1883 // CHECK9: omp.inner.for.inc:
1884 // CHECK9-NEXT: [[TMP10:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4
1885 // CHECK9-NEXT: [[ADD2:%.*]] = add nsw i32 [[TMP10]], 1
1886 // CHECK9-NEXT: store i32 [[ADD2]], ptr [[DOTOMP_IV]], align 4
1887 // CHECK9-NEXT: br label [[OMP_INNER_FOR_COND]]
1888 // CHECK9: omp.inner.for.end:
1889 // CHECK9-NEXT: br label [[OMP_LOOP_EXIT:%.*]]
1890 // CHECK9: omp.loop.exit:
1891 // CHECK9-NEXT: call void @__kmpc_for_static_fini(ptr @[[GLOB1]], i32 [[TMP2]])
1892 // CHECK9-NEXT: ret void
1895 // CHECK9-LABEL: define {{[^@]+}}@{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z5tmainIiLi10EEiT__l89
1896 // CHECK9-SAME: (ptr noundef nonnull align 4 dereferenceable(40) [[A:%.*]]) #[[ATTR2]] {
1897 // CHECK9-NEXT: entry:
1898 // CHECK9-NEXT: [[A_ADDR:%.*]] = alloca ptr, align 8
1899 // CHECK9-NEXT: store ptr [[A]], ptr [[A_ADDR]], align 8
1900 // CHECK9-NEXT: [[TMP0:%.*]] = load ptr, ptr [[A_ADDR]], align 8
1901 // CHECK9-NEXT: call void (ptr, i32, ptr, ...) @__kmpc_fork_teams(ptr @[[GLOB2]], i32 1, ptr @{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z5tmainIiLi10EEiT__l89.omp_outlined, ptr [[TMP0]])
1902 // CHECK9-NEXT: ret void
1905 // CHECK9-LABEL: define {{[^@]+}}@{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z5tmainIiLi10EEiT__l89.omp_outlined
1906 // CHECK9-SAME: (ptr noalias noundef [[DOTGLOBAL_TID_:%.*]], ptr noalias noundef [[DOTBOUND_TID_:%.*]], ptr noundef nonnull align 4 dereferenceable(40) [[A:%.*]]) #[[ATTR3]] {
1907 // CHECK9-NEXT: entry:
1908 // CHECK9-NEXT: [[DOTGLOBAL_TID__ADDR:%.*]] = alloca ptr, align 8
1909 // CHECK9-NEXT: [[DOTBOUND_TID__ADDR:%.*]] = alloca ptr, align 8
1910 // CHECK9-NEXT: [[A_ADDR:%.*]] = alloca ptr, align 8
1911 // CHECK9-NEXT: [[DOTOMP_IV:%.*]] = alloca i32, align 4
1912 // CHECK9-NEXT: [[TMP:%.*]] = alloca i32, align 4
1913 // CHECK9-NEXT: [[DOTOMP_LB:%.*]] = alloca i32, align 4
1914 // CHECK9-NEXT: [[DOTOMP_UB:%.*]] = alloca i32, align 4
1915 // CHECK9-NEXT: [[DOTOMP_STRIDE:%.*]] = alloca i32, align 4
1916 // CHECK9-NEXT: [[DOTOMP_IS_LAST:%.*]] = alloca i32, align 4
1917 // CHECK9-NEXT: [[I:%.*]] = alloca i32, align 4
1918 // CHECK9-NEXT: store ptr [[DOTGLOBAL_TID_]], ptr [[DOTGLOBAL_TID__ADDR]], align 8
1919 // CHECK9-NEXT: store ptr [[DOTBOUND_TID_]], ptr [[DOTBOUND_TID__ADDR]], align 8
1920 // CHECK9-NEXT: store ptr [[A]], ptr [[A_ADDR]], align 8
1921 // CHECK9-NEXT: [[TMP0:%.*]] = load ptr, ptr [[A_ADDR]], align 8
1922 // CHECK9-NEXT: store i32 0, ptr [[DOTOMP_LB]], align 4
1923 // CHECK9-NEXT: store i32 9, ptr [[DOTOMP_UB]], align 4
1924 // CHECK9-NEXT: store i32 1, ptr [[DOTOMP_STRIDE]], align 4
1925 // CHECK9-NEXT: store i32 0, ptr [[DOTOMP_IS_LAST]], align 4
1926 // CHECK9-NEXT: [[TMP1:%.*]] = load ptr, ptr [[DOTGLOBAL_TID__ADDR]], align 8
1927 // CHECK9-NEXT: [[TMP2:%.*]] = load i32, ptr [[TMP1]], align 4
1928 // CHECK9-NEXT: call void @__kmpc_for_static_init_4(ptr @[[GLOB1]], i32 [[TMP2]], i32 91, ptr [[DOTOMP_IS_LAST]], ptr [[DOTOMP_LB]], ptr [[DOTOMP_UB]], ptr [[DOTOMP_STRIDE]], i32 1, i32 10)
1929 // CHECK9-NEXT: br label [[OMP_DISPATCH_COND:%.*]]
1930 // CHECK9: omp.dispatch.cond:
1931 // CHECK9-NEXT: [[TMP3:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4
1932 // CHECK9-NEXT: [[CMP:%.*]] = icmp sgt i32 [[TMP3]], 9
1933 // CHECK9-NEXT: br i1 [[CMP]], label [[COND_TRUE:%.*]], label [[COND_FALSE:%.*]]
1934 // CHECK9: cond.true:
1935 // CHECK9-NEXT: br label [[COND_END:%.*]]
1936 // CHECK9: cond.false:
1937 // CHECK9-NEXT: [[TMP4:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4
1938 // CHECK9-NEXT: br label [[COND_END]]
1939 // CHECK9: cond.end:
1940 // CHECK9-NEXT: [[COND:%.*]] = phi i32 [ 9, [[COND_TRUE]] ], [ [[TMP4]], [[COND_FALSE]] ]
1941 // CHECK9-NEXT: store i32 [[COND]], ptr [[DOTOMP_UB]], align 4
1942 // CHECK9-NEXT: [[TMP5:%.*]] = load i32, ptr [[DOTOMP_LB]], align 4
1943 // CHECK9-NEXT: store i32 [[TMP5]], ptr [[DOTOMP_IV]], align 4
1944 // CHECK9-NEXT: [[TMP6:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4
1945 // CHECK9-NEXT: [[TMP7:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4
1946 // CHECK9-NEXT: [[CMP1:%.*]] = icmp sle i32 [[TMP6]], [[TMP7]]
1947 // CHECK9-NEXT: br i1 [[CMP1]], label [[OMP_DISPATCH_BODY:%.*]], label [[OMP_DISPATCH_END:%.*]]
1948 // CHECK9: omp.dispatch.body:
1949 // CHECK9-NEXT: br label [[OMP_INNER_FOR_COND:%.*]]
1950 // CHECK9: omp.inner.for.cond:
1951 // CHECK9-NEXT: [[TMP8:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP14:![0-9]+]]
1952 // CHECK9-NEXT: [[TMP9:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4, !llvm.access.group [[ACC_GRP14]]
1953 // CHECK9-NEXT: [[CMP2:%.*]] = icmp sle i32 [[TMP8]], [[TMP9]]
1954 // CHECK9-NEXT: br i1 [[CMP2]], label [[OMP_INNER_FOR_BODY:%.*]], label [[OMP_INNER_FOR_END:%.*]]
1955 // CHECK9: omp.inner.for.body:
1956 // CHECK9-NEXT: [[TMP10:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP14]]
1957 // CHECK9-NEXT: [[MUL:%.*]] = mul nsw i32 [[TMP10]], 1
1958 // CHECK9-NEXT: [[ADD:%.*]] = add nsw i32 0, [[MUL]]
1959 // CHECK9-NEXT: store i32 [[ADD]], ptr [[I]], align 4, !llvm.access.group [[ACC_GRP14]]
1960 // CHECK9-NEXT: [[TMP11:%.*]] = load i32, ptr [[I]], align 4, !llvm.access.group [[ACC_GRP14]]
1961 // CHECK9-NEXT: [[IDXPROM:%.*]] = sext i32 [[TMP11]] to i64
1962 // CHECK9-NEXT: [[ARRAYIDX:%.*]] = getelementptr inbounds [10 x i32], ptr [[TMP0]], i64 0, i64 [[IDXPROM]]
1963 // CHECK9-NEXT: store i32 0, ptr [[ARRAYIDX]], align 4, !llvm.access.group [[ACC_GRP14]]
1964 // CHECK9-NEXT: br label [[OMP_BODY_CONTINUE:%.*]]
1965 // CHECK9: omp.body.continue:
1966 // CHECK9-NEXT: br label [[OMP_INNER_FOR_INC:%.*]]
1967 // CHECK9: omp.inner.for.inc:
1968 // CHECK9-NEXT: [[TMP12:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP14]]
1969 // CHECK9-NEXT: [[ADD3:%.*]] = add nsw i32 [[TMP12]], 1
1970 // CHECK9-NEXT: store i32 [[ADD3]], ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP14]]
1971 // CHECK9-NEXT: br label [[OMP_INNER_FOR_COND]], !llvm.loop [[LOOP15:![0-9]+]]
1972 // CHECK9: omp.inner.for.end:
1973 // CHECK9-NEXT: br label [[OMP_DISPATCH_INC:%.*]]
1974 // CHECK9: omp.dispatch.inc:
1975 // CHECK9-NEXT: [[TMP13:%.*]] = load i32, ptr [[DOTOMP_LB]], align 4
1976 // CHECK9-NEXT: [[TMP14:%.*]] = load i32, ptr [[DOTOMP_STRIDE]], align 4
1977 // CHECK9-NEXT: [[ADD4:%.*]] = add nsw i32 [[TMP13]], [[TMP14]]
1978 // CHECK9-NEXT: store i32 [[ADD4]], ptr [[DOTOMP_LB]], align 4
1979 // CHECK9-NEXT: [[TMP15:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4
1980 // CHECK9-NEXT: [[TMP16:%.*]] = load i32, ptr [[DOTOMP_STRIDE]], align 4
1981 // CHECK9-NEXT: [[ADD5:%.*]] = add nsw i32 [[TMP15]], [[TMP16]]
1982 // CHECK9-NEXT: store i32 [[ADD5]], ptr [[DOTOMP_UB]], align 4
1983 // CHECK9-NEXT: br label [[OMP_DISPATCH_COND]]
1984 // CHECK9: omp.dispatch.end:
1985 // CHECK9-NEXT: call void @__kmpc_for_static_fini(ptr @[[GLOB1]], i32 [[TMP2]])
1986 // CHECK9-NEXT: ret void
1989 // CHECK9-LABEL: define {{[^@]+}}@.omp_offloading.requires_reg
1990 // CHECK9-SAME: () #[[ATTR7:[0-9]+]] {
1991 // CHECK9-NEXT: entry:
1992 // CHECK9-NEXT: call void @__tgt_register_requires(i64 1)
1993 // CHECK9-NEXT: ret void
1996 // CHECK11-LABEL: define {{[^@]+}}@main
1997 // CHECK11-SAME: (i32 noundef [[ARGC:%.*]], ptr noundef [[ARGV:%.*]]) #[[ATTR0:[0-9]+]] {
1998 // CHECK11-NEXT: entry:
1999 // CHECK11-NEXT: [[RETVAL:%.*]] = alloca i32, align 4
2000 // CHECK11-NEXT: [[ARGC_ADDR:%.*]] = alloca i32, align 4
2001 // CHECK11-NEXT: [[ARGV_ADDR:%.*]] = alloca ptr, align 4
2002 // CHECK11-NEXT: [[N:%.*]] = alloca i32, align 4
2003 // CHECK11-NEXT: [[SAVED_STACK:%.*]] = alloca ptr, align 4
2004 // CHECK11-NEXT: [[__VLA_EXPR0:%.*]] = alloca i32, align 4
2005 // CHECK11-NEXT: [[N_CASTED:%.*]] = alloca i32, align 4
2006 // CHECK11-NEXT: [[DOTOFFLOAD_BASEPTRS:%.*]] = alloca [3 x ptr], align 4
2007 // CHECK11-NEXT: [[DOTOFFLOAD_PTRS:%.*]] = alloca [3 x ptr], align 4
2008 // CHECK11-NEXT: [[DOTOFFLOAD_MAPPERS:%.*]] = alloca [3 x ptr], align 4
2009 // CHECK11-NEXT: [[DOTOFFLOAD_SIZES:%.*]] = alloca [3 x i64], align 4
2010 // CHECK11-NEXT: [[TMP:%.*]] = alloca i32, align 4
2011 // CHECK11-NEXT: [[DOTCAPTURE_EXPR_:%.*]] = alloca i32, align 4
2012 // CHECK11-NEXT: [[DOTCAPTURE_EXPR_1:%.*]] = alloca i32, align 4
2013 // CHECK11-NEXT: [[KERNEL_ARGS:%.*]] = alloca [[STRUCT___TGT_KERNEL_ARGUMENTS:%.*]], align 8
2014 // CHECK11-NEXT: [[N_CASTED3:%.*]] = alloca i32, align 4
2015 // CHECK11-NEXT: [[DOTOFFLOAD_BASEPTRS4:%.*]] = alloca [3 x ptr], align 4
2016 // CHECK11-NEXT: [[DOTOFFLOAD_PTRS5:%.*]] = alloca [3 x ptr], align 4
2017 // CHECK11-NEXT: [[DOTOFFLOAD_MAPPERS6:%.*]] = alloca [3 x ptr], align 4
2018 // CHECK11-NEXT: [[DOTOFFLOAD_SIZES7:%.*]] = alloca [3 x i64], align 4
2019 // CHECK11-NEXT: [[_TMP8:%.*]] = alloca i32, align 4
2020 // CHECK11-NEXT: [[DOTCAPTURE_EXPR_9:%.*]] = alloca i32, align 4
2021 // CHECK11-NEXT: [[DOTCAPTURE_EXPR_10:%.*]] = alloca i32, align 4
2022 // CHECK11-NEXT: [[KERNEL_ARGS15:%.*]] = alloca [[STRUCT___TGT_KERNEL_ARGUMENTS]], align 8
2023 // CHECK11-NEXT: [[N_CASTED18:%.*]] = alloca i32, align 4
2024 // CHECK11-NEXT: [[DOTOFFLOAD_BASEPTRS19:%.*]] = alloca [3 x ptr], align 4
2025 // CHECK11-NEXT: [[DOTOFFLOAD_PTRS20:%.*]] = alloca [3 x ptr], align 4
2026 // CHECK11-NEXT: [[DOTOFFLOAD_MAPPERS21:%.*]] = alloca [3 x ptr], align 4
2027 // CHECK11-NEXT: [[DOTOFFLOAD_SIZES22:%.*]] = alloca [3 x i64], align 4
2028 // CHECK11-NEXT: [[_TMP23:%.*]] = alloca i32, align 4
2029 // CHECK11-NEXT: [[DOTCAPTURE_EXPR_24:%.*]] = alloca i32, align 4
2030 // CHECK11-NEXT: [[DOTCAPTURE_EXPR_25:%.*]] = alloca i32, align 4
2031 // CHECK11-NEXT: [[KERNEL_ARGS30:%.*]] = alloca [[STRUCT___TGT_KERNEL_ARGUMENTS]], align 8
2032 // CHECK11-NEXT: store i32 0, ptr [[RETVAL]], align 4
2033 // CHECK11-NEXT: store i32 [[ARGC]], ptr [[ARGC_ADDR]], align 4
2034 // CHECK11-NEXT: store ptr [[ARGV]], ptr [[ARGV_ADDR]], align 4
2035 // CHECK11-NEXT: store i32 100, ptr [[N]], align 4
2036 // CHECK11-NEXT: [[TMP0:%.*]] = load i32, ptr [[N]], align 4
2037 // CHECK11-NEXT: [[TMP1:%.*]] = call ptr @llvm.stacksave.p0()
2038 // CHECK11-NEXT: store ptr [[TMP1]], ptr [[SAVED_STACK]], align 4
2039 // CHECK11-NEXT: [[VLA:%.*]] = alloca i32, i32 [[TMP0]], align 4
2040 // CHECK11-NEXT: store i32 [[TMP0]], ptr [[__VLA_EXPR0]], align 4
2041 // CHECK11-NEXT: [[TMP2:%.*]] = load i32, ptr [[N]], align 4
2042 // CHECK11-NEXT: store i32 [[TMP2]], ptr [[N_CASTED]], align 4
2043 // CHECK11-NEXT: [[TMP3:%.*]] = load i32, ptr [[N_CASTED]], align 4
2044 // CHECK11-NEXT: [[TMP4:%.*]] = mul nuw i32 [[TMP0]], 4
2045 // CHECK11-NEXT: [[TMP5:%.*]] = sext i32 [[TMP4]] to i64
2046 // CHECK11-NEXT: call void @llvm.memcpy.p0.p0.i32(ptr align 4 [[DOTOFFLOAD_SIZES]], ptr align 4 @.offload_sizes, i32 24, i1 false)
2047 // CHECK11-NEXT: [[TMP6:%.*]] = getelementptr inbounds [3 x ptr], ptr [[DOTOFFLOAD_BASEPTRS]], i32 0, i32 0
2048 // CHECK11-NEXT: store i32 [[TMP3]], ptr [[TMP6]], align 4
2049 // CHECK11-NEXT: [[TMP7:%.*]] = getelementptr inbounds [3 x ptr], ptr [[DOTOFFLOAD_PTRS]], i32 0, i32 0
2050 // CHECK11-NEXT: store i32 [[TMP3]], ptr [[TMP7]], align 4
2051 // CHECK11-NEXT: [[TMP8:%.*]] = getelementptr inbounds [3 x ptr], ptr [[DOTOFFLOAD_MAPPERS]], i32 0, i32 0
2052 // CHECK11-NEXT: store ptr null, ptr [[TMP8]], align 4
2053 // CHECK11-NEXT: [[TMP9:%.*]] = getelementptr inbounds [3 x ptr], ptr [[DOTOFFLOAD_BASEPTRS]], i32 0, i32 1
2054 // CHECK11-NEXT: store i32 [[TMP0]], ptr [[TMP9]], align 4
2055 // CHECK11-NEXT: [[TMP10:%.*]] = getelementptr inbounds [3 x ptr], ptr [[DOTOFFLOAD_PTRS]], i32 0, i32 1
2056 // CHECK11-NEXT: store i32 [[TMP0]], ptr [[TMP10]], align 4
2057 // CHECK11-NEXT: [[TMP11:%.*]] = getelementptr inbounds [3 x ptr], ptr [[DOTOFFLOAD_MAPPERS]], i32 0, i32 1
2058 // CHECK11-NEXT: store ptr null, ptr [[TMP11]], align 4
2059 // CHECK11-NEXT: [[TMP12:%.*]] = getelementptr inbounds [3 x ptr], ptr [[DOTOFFLOAD_BASEPTRS]], i32 0, i32 2
2060 // CHECK11-NEXT: store ptr [[VLA]], ptr [[TMP12]], align 4
2061 // CHECK11-NEXT: [[TMP13:%.*]] = getelementptr inbounds [3 x ptr], ptr [[DOTOFFLOAD_PTRS]], i32 0, i32 2
2062 // CHECK11-NEXT: store ptr [[VLA]], ptr [[TMP13]], align 4
2063 // CHECK11-NEXT: [[TMP14:%.*]] = getelementptr inbounds [3 x i64], ptr [[DOTOFFLOAD_SIZES]], i32 0, i32 2
2064 // CHECK11-NEXT: store i64 [[TMP5]], ptr [[TMP14]], align 4
2065 // CHECK11-NEXT: [[TMP15:%.*]] = getelementptr inbounds [3 x ptr], ptr [[DOTOFFLOAD_MAPPERS]], i32 0, i32 2
2066 // CHECK11-NEXT: store ptr null, ptr [[TMP15]], align 4
2067 // CHECK11-NEXT: [[TMP16:%.*]] = getelementptr inbounds [3 x ptr], ptr [[DOTOFFLOAD_BASEPTRS]], i32 0, i32 0
2068 // CHECK11-NEXT: [[TMP17:%.*]] = getelementptr inbounds [3 x ptr], ptr [[DOTOFFLOAD_PTRS]], i32 0, i32 0
2069 // CHECK11-NEXT: [[TMP18:%.*]] = getelementptr inbounds [3 x i64], ptr [[DOTOFFLOAD_SIZES]], i32 0, i32 0
2070 // CHECK11-NEXT: [[TMP19:%.*]] = load i32, ptr [[N]], align 4
2071 // CHECK11-NEXT: store i32 [[TMP19]], ptr [[DOTCAPTURE_EXPR_]], align 4
2072 // CHECK11-NEXT: [[TMP20:%.*]] = load i32, ptr [[DOTCAPTURE_EXPR_]], align 4
2073 // CHECK11-NEXT: [[SUB:%.*]] = sub nsw i32 [[TMP20]], 0
2074 // CHECK11-NEXT: [[DIV:%.*]] = sdiv i32 [[SUB]], 1
2075 // CHECK11-NEXT: [[SUB2:%.*]] = sub nsw i32 [[DIV]], 1
2076 // CHECK11-NEXT: store i32 [[SUB2]], ptr [[DOTCAPTURE_EXPR_1]], align 4
2077 // CHECK11-NEXT: [[TMP21:%.*]] = load i32, ptr [[DOTCAPTURE_EXPR_1]], align 4
2078 // CHECK11-NEXT: [[ADD:%.*]] = add nsw i32 [[TMP21]], 1
2079 // CHECK11-NEXT: [[TMP22:%.*]] = zext i32 [[ADD]] to i64
2080 // CHECK11-NEXT: [[TMP23:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 0
2081 // CHECK11-NEXT: store i32 2, ptr [[TMP23]], align 4
2082 // CHECK11-NEXT: [[TMP24:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 1
2083 // CHECK11-NEXT: store i32 3, ptr [[TMP24]], align 4
2084 // CHECK11-NEXT: [[TMP25:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 2
2085 // CHECK11-NEXT: store ptr [[TMP16]], ptr [[TMP25]], align 4
2086 // CHECK11-NEXT: [[TMP26:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 3
2087 // CHECK11-NEXT: store ptr [[TMP17]], ptr [[TMP26]], align 4
2088 // CHECK11-NEXT: [[TMP27:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 4
2089 // CHECK11-NEXT: store ptr [[TMP18]], ptr [[TMP27]], align 4
2090 // CHECK11-NEXT: [[TMP28:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 5
2091 // CHECK11-NEXT: store ptr @.offload_maptypes, ptr [[TMP28]], align 4
2092 // CHECK11-NEXT: [[TMP29:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 6
2093 // CHECK11-NEXT: store ptr null, ptr [[TMP29]], align 4
2094 // CHECK11-NEXT: [[TMP30:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 7
2095 // CHECK11-NEXT: store ptr null, ptr [[TMP30]], align 4
2096 // CHECK11-NEXT: [[TMP31:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 8
2097 // CHECK11-NEXT: store i64 [[TMP22]], ptr [[TMP31]], align 8
2098 // CHECK11-NEXT: [[TMP32:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 9
2099 // CHECK11-NEXT: store i64 0, ptr [[TMP32]], align 8
2100 // CHECK11-NEXT: [[TMP33:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 10
2101 // CHECK11-NEXT: store [3 x i32] zeroinitializer, ptr [[TMP33]], align 4
2102 // CHECK11-NEXT: [[TMP34:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 11
2103 // CHECK11-NEXT: store [3 x i32] zeroinitializer, ptr [[TMP34]], align 4
2104 // CHECK11-NEXT: [[TMP35:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 12
2105 // CHECK11-NEXT: store i32 0, ptr [[TMP35]], align 4
2106 // CHECK11-NEXT: [[TMP36:%.*]] = call i32 @__tgt_target_kernel(ptr @[[GLOB2:[0-9]+]], i64 -1, i32 0, i32 0, ptr @.{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}_main_l100.region_id, ptr [[KERNEL_ARGS]])
2107 // CHECK11-NEXT: [[TMP37:%.*]] = icmp ne i32 [[TMP36]], 0
2108 // CHECK11-NEXT: br i1 [[TMP37]], label [[OMP_OFFLOAD_FAILED:%.*]], label [[OMP_OFFLOAD_CONT:%.*]]
2109 // CHECK11: omp_offload.failed:
2110 // CHECK11-NEXT: call void @{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}_main_l100(i32 [[TMP3]], i32 [[TMP0]], ptr [[VLA]]) #[[ATTR4:[0-9]+]]
2111 // CHECK11-NEXT: br label [[OMP_OFFLOAD_CONT]]
2112 // CHECK11: omp_offload.cont:
2113 // CHECK11-NEXT: [[TMP38:%.*]] = load i32, ptr [[N]], align 4
2114 // CHECK11-NEXT: store i32 [[TMP38]], ptr [[N_CASTED3]], align 4
2115 // CHECK11-NEXT: [[TMP39:%.*]] = load i32, ptr [[N_CASTED3]], align 4
2116 // CHECK11-NEXT: [[TMP40:%.*]] = mul nuw i32 [[TMP0]], 4
2117 // CHECK11-NEXT: [[TMP41:%.*]] = sext i32 [[TMP40]] to i64
2118 // CHECK11-NEXT: call void @llvm.memcpy.p0.p0.i32(ptr align 4 [[DOTOFFLOAD_SIZES7]], ptr align 4 @.offload_sizes.1, i32 24, i1 false)
2119 // CHECK11-NEXT: [[TMP42:%.*]] = getelementptr inbounds [3 x ptr], ptr [[DOTOFFLOAD_BASEPTRS4]], i32 0, i32 0
2120 // CHECK11-NEXT: store i32 [[TMP39]], ptr [[TMP42]], align 4
2121 // CHECK11-NEXT: [[TMP43:%.*]] = getelementptr inbounds [3 x ptr], ptr [[DOTOFFLOAD_PTRS5]], i32 0, i32 0
2122 // CHECK11-NEXT: store i32 [[TMP39]], ptr [[TMP43]], align 4
2123 // CHECK11-NEXT: [[TMP44:%.*]] = getelementptr inbounds [3 x ptr], ptr [[DOTOFFLOAD_MAPPERS6]], i32 0, i32 0
2124 // CHECK11-NEXT: store ptr null, ptr [[TMP44]], align 4
2125 // CHECK11-NEXT: [[TMP45:%.*]] = getelementptr inbounds [3 x ptr], ptr [[DOTOFFLOAD_BASEPTRS4]], i32 0, i32 1
2126 // CHECK11-NEXT: store i32 [[TMP0]], ptr [[TMP45]], align 4
2127 // CHECK11-NEXT: [[TMP46:%.*]] = getelementptr inbounds [3 x ptr], ptr [[DOTOFFLOAD_PTRS5]], i32 0, i32 1
2128 // CHECK11-NEXT: store i32 [[TMP0]], ptr [[TMP46]], align 4
2129 // CHECK11-NEXT: [[TMP47:%.*]] = getelementptr inbounds [3 x ptr], ptr [[DOTOFFLOAD_MAPPERS6]], i32 0, i32 1
2130 // CHECK11-NEXT: store ptr null, ptr [[TMP47]], align 4
2131 // CHECK11-NEXT: [[TMP48:%.*]] = getelementptr inbounds [3 x ptr], ptr [[DOTOFFLOAD_BASEPTRS4]], i32 0, i32 2
2132 // CHECK11-NEXT: store ptr [[VLA]], ptr [[TMP48]], align 4
2133 // CHECK11-NEXT: [[TMP49:%.*]] = getelementptr inbounds [3 x ptr], ptr [[DOTOFFLOAD_PTRS5]], i32 0, i32 2
2134 // CHECK11-NEXT: store ptr [[VLA]], ptr [[TMP49]], align 4
2135 // CHECK11-NEXT: [[TMP50:%.*]] = getelementptr inbounds [3 x i64], ptr [[DOTOFFLOAD_SIZES7]], i32 0, i32 2
2136 // CHECK11-NEXT: store i64 [[TMP41]], ptr [[TMP50]], align 4
2137 // CHECK11-NEXT: [[TMP51:%.*]] = getelementptr inbounds [3 x ptr], ptr [[DOTOFFLOAD_MAPPERS6]], i32 0, i32 2
2138 // CHECK11-NEXT: store ptr null, ptr [[TMP51]], align 4
2139 // CHECK11-NEXT: [[TMP52:%.*]] = getelementptr inbounds [3 x ptr], ptr [[DOTOFFLOAD_BASEPTRS4]], i32 0, i32 0
2140 // CHECK11-NEXT: [[TMP53:%.*]] = getelementptr inbounds [3 x ptr], ptr [[DOTOFFLOAD_PTRS5]], i32 0, i32 0
2141 // CHECK11-NEXT: [[TMP54:%.*]] = getelementptr inbounds [3 x i64], ptr [[DOTOFFLOAD_SIZES7]], i32 0, i32 0
2142 // CHECK11-NEXT: [[TMP55:%.*]] = load i32, ptr [[N]], align 4
2143 // CHECK11-NEXT: store i32 [[TMP55]], ptr [[DOTCAPTURE_EXPR_9]], align 4
2144 // CHECK11-NEXT: [[TMP56:%.*]] = load i32, ptr [[DOTCAPTURE_EXPR_9]], align 4
2145 // CHECK11-NEXT: [[SUB11:%.*]] = sub nsw i32 [[TMP56]], 0
2146 // CHECK11-NEXT: [[DIV12:%.*]] = sdiv i32 [[SUB11]], 1
2147 // CHECK11-NEXT: [[SUB13:%.*]] = sub nsw i32 [[DIV12]], 1
2148 // CHECK11-NEXT: store i32 [[SUB13]], ptr [[DOTCAPTURE_EXPR_10]], align 4
2149 // CHECK11-NEXT: [[TMP57:%.*]] = load i32, ptr [[DOTCAPTURE_EXPR_10]], align 4
2150 // CHECK11-NEXT: [[ADD14:%.*]] = add nsw i32 [[TMP57]], 1
2151 // CHECK11-NEXT: [[TMP58:%.*]] = zext i32 [[ADD14]] to i64
2152 // CHECK11-NEXT: [[TMP59:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS15]], i32 0, i32 0
2153 // CHECK11-NEXT: store i32 2, ptr [[TMP59]], align 4
2154 // CHECK11-NEXT: [[TMP60:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS15]], i32 0, i32 1
2155 // CHECK11-NEXT: store i32 3, ptr [[TMP60]], align 4
2156 // CHECK11-NEXT: [[TMP61:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS15]], i32 0, i32 2
2157 // CHECK11-NEXT: store ptr [[TMP52]], ptr [[TMP61]], align 4
2158 // CHECK11-NEXT: [[TMP62:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS15]], i32 0, i32 3
2159 // CHECK11-NEXT: store ptr [[TMP53]], ptr [[TMP62]], align 4
2160 // CHECK11-NEXT: [[TMP63:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS15]], i32 0, i32 4
2161 // CHECK11-NEXT: store ptr [[TMP54]], ptr [[TMP63]], align 4
2162 // CHECK11-NEXT: [[TMP64:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS15]], i32 0, i32 5
2163 // CHECK11-NEXT: store ptr @.offload_maptypes.2, ptr [[TMP64]], align 4
2164 // CHECK11-NEXT: [[TMP65:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS15]], i32 0, i32 6
2165 // CHECK11-NEXT: store ptr null, ptr [[TMP65]], align 4
2166 // CHECK11-NEXT: [[TMP66:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS15]], i32 0, i32 7
2167 // CHECK11-NEXT: store ptr null, ptr [[TMP66]], align 4
2168 // CHECK11-NEXT: [[TMP67:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS15]], i32 0, i32 8
2169 // CHECK11-NEXT: store i64 [[TMP58]], ptr [[TMP67]], align 8
2170 // CHECK11-NEXT: [[TMP68:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS15]], i32 0, i32 9
2171 // CHECK11-NEXT: store i64 0, ptr [[TMP68]], align 8
2172 // CHECK11-NEXT: [[TMP69:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS15]], i32 0, i32 10
2173 // CHECK11-NEXT: store [3 x i32] zeroinitializer, ptr [[TMP69]], align 4
2174 // CHECK11-NEXT: [[TMP70:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS15]], i32 0, i32 11
2175 // CHECK11-NEXT: store [3 x i32] zeroinitializer, ptr [[TMP70]], align 4
2176 // CHECK11-NEXT: [[TMP71:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS15]], i32 0, i32 12
2177 // CHECK11-NEXT: store i32 0, ptr [[TMP71]], align 4
2178 // CHECK11-NEXT: [[TMP72:%.*]] = call i32 @__tgt_target_kernel(ptr @[[GLOB2]], i64 -1, i32 0, i32 0, ptr @.{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}_main_l105.region_id, ptr [[KERNEL_ARGS15]])
2179 // CHECK11-NEXT: [[TMP73:%.*]] = icmp ne i32 [[TMP72]], 0
2180 // CHECK11-NEXT: br i1 [[TMP73]], label [[OMP_OFFLOAD_FAILED16:%.*]], label [[OMP_OFFLOAD_CONT17:%.*]]
2181 // CHECK11: omp_offload.failed16:
2182 // CHECK11-NEXT: call void @{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}_main_l105(i32 [[TMP39]], i32 [[TMP0]], ptr [[VLA]]) #[[ATTR4]]
2183 // CHECK11-NEXT: br label [[OMP_OFFLOAD_CONT17]]
2184 // CHECK11: omp_offload.cont17:
2185 // CHECK11-NEXT: [[TMP74:%.*]] = load i32, ptr [[N]], align 4
2186 // CHECK11-NEXT: store i32 [[TMP74]], ptr [[N_CASTED18]], align 4
2187 // CHECK11-NEXT: [[TMP75:%.*]] = load i32, ptr [[N_CASTED18]], align 4
2188 // CHECK11-NEXT: [[TMP76:%.*]] = mul nuw i32 [[TMP0]], 4
2189 // CHECK11-NEXT: [[TMP77:%.*]] = sext i32 [[TMP76]] to i64
2190 // CHECK11-NEXT: call void @llvm.memcpy.p0.p0.i32(ptr align 4 [[DOTOFFLOAD_SIZES22]], ptr align 4 @.offload_sizes.3, i32 24, i1 false)
2191 // CHECK11-NEXT: [[TMP78:%.*]] = getelementptr inbounds [3 x ptr], ptr [[DOTOFFLOAD_BASEPTRS19]], i32 0, i32 0
2192 // CHECK11-NEXT: store i32 [[TMP75]], ptr [[TMP78]], align 4
2193 // CHECK11-NEXT: [[TMP79:%.*]] = getelementptr inbounds [3 x ptr], ptr [[DOTOFFLOAD_PTRS20]], i32 0, i32 0
2194 // CHECK11-NEXT: store i32 [[TMP75]], ptr [[TMP79]], align 4
2195 // CHECK11-NEXT: [[TMP80:%.*]] = getelementptr inbounds [3 x ptr], ptr [[DOTOFFLOAD_MAPPERS21]], i32 0, i32 0
2196 // CHECK11-NEXT: store ptr null, ptr [[TMP80]], align 4
2197 // CHECK11-NEXT: [[TMP81:%.*]] = getelementptr inbounds [3 x ptr], ptr [[DOTOFFLOAD_BASEPTRS19]], i32 0, i32 1
2198 // CHECK11-NEXT: store i32 [[TMP0]], ptr [[TMP81]], align 4
2199 // CHECK11-NEXT: [[TMP82:%.*]] = getelementptr inbounds [3 x ptr], ptr [[DOTOFFLOAD_PTRS20]], i32 0, i32 1
2200 // CHECK11-NEXT: store i32 [[TMP0]], ptr [[TMP82]], align 4
2201 // CHECK11-NEXT: [[TMP83:%.*]] = getelementptr inbounds [3 x ptr], ptr [[DOTOFFLOAD_MAPPERS21]], i32 0, i32 1
2202 // CHECK11-NEXT: store ptr null, ptr [[TMP83]], align 4
2203 // CHECK11-NEXT: [[TMP84:%.*]] = getelementptr inbounds [3 x ptr], ptr [[DOTOFFLOAD_BASEPTRS19]], i32 0, i32 2
2204 // CHECK11-NEXT: store ptr [[VLA]], ptr [[TMP84]], align 4
2205 // CHECK11-NEXT: [[TMP85:%.*]] = getelementptr inbounds [3 x ptr], ptr [[DOTOFFLOAD_PTRS20]], i32 0, i32 2
2206 // CHECK11-NEXT: store ptr [[VLA]], ptr [[TMP85]], align 4
2207 // CHECK11-NEXT: [[TMP86:%.*]] = getelementptr inbounds [3 x i64], ptr [[DOTOFFLOAD_SIZES22]], i32 0, i32 2
2208 // CHECK11-NEXT: store i64 [[TMP77]], ptr [[TMP86]], align 4
2209 // CHECK11-NEXT: [[TMP87:%.*]] = getelementptr inbounds [3 x ptr], ptr [[DOTOFFLOAD_MAPPERS21]], i32 0, i32 2
2210 // CHECK11-NEXT: store ptr null, ptr [[TMP87]], align 4
2211 // CHECK11-NEXT: [[TMP88:%.*]] = getelementptr inbounds [3 x ptr], ptr [[DOTOFFLOAD_BASEPTRS19]], i32 0, i32 0
2212 // CHECK11-NEXT: [[TMP89:%.*]] = getelementptr inbounds [3 x ptr], ptr [[DOTOFFLOAD_PTRS20]], i32 0, i32 0
2213 // CHECK11-NEXT: [[TMP90:%.*]] = getelementptr inbounds [3 x i64], ptr [[DOTOFFLOAD_SIZES22]], i32 0, i32 0
2214 // CHECK11-NEXT: [[TMP91:%.*]] = load i32, ptr [[N]], align 4
2215 // CHECK11-NEXT: store i32 [[TMP91]], ptr [[DOTCAPTURE_EXPR_24]], align 4
2216 // CHECK11-NEXT: [[TMP92:%.*]] = load i32, ptr [[DOTCAPTURE_EXPR_24]], align 4
2217 // CHECK11-NEXT: [[SUB26:%.*]] = sub nsw i32 [[TMP92]], 0
2218 // CHECK11-NEXT: [[DIV27:%.*]] = sdiv i32 [[SUB26]], 1
2219 // CHECK11-NEXT: [[SUB28:%.*]] = sub nsw i32 [[DIV27]], 1
2220 // CHECK11-NEXT: store i32 [[SUB28]], ptr [[DOTCAPTURE_EXPR_25]], align 4
2221 // CHECK11-NEXT: [[TMP93:%.*]] = load i32, ptr [[DOTCAPTURE_EXPR_25]], align 4
2222 // CHECK11-NEXT: [[ADD29:%.*]] = add nsw i32 [[TMP93]], 1
2223 // CHECK11-NEXT: [[TMP94:%.*]] = zext i32 [[ADD29]] to i64
2224 // CHECK11-NEXT: [[TMP95:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS30]], i32 0, i32 0
2225 // CHECK11-NEXT: store i32 2, ptr [[TMP95]], align 4
2226 // CHECK11-NEXT: [[TMP96:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS30]], i32 0, i32 1
2227 // CHECK11-NEXT: store i32 3, ptr [[TMP96]], align 4
2228 // CHECK11-NEXT: [[TMP97:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS30]], i32 0, i32 2
2229 // CHECK11-NEXT: store ptr [[TMP88]], ptr [[TMP97]], align 4
2230 // CHECK11-NEXT: [[TMP98:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS30]], i32 0, i32 3
2231 // CHECK11-NEXT: store ptr [[TMP89]], ptr [[TMP98]], align 4
2232 // CHECK11-NEXT: [[TMP99:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS30]], i32 0, i32 4
2233 // CHECK11-NEXT: store ptr [[TMP90]], ptr [[TMP99]], align 4
2234 // CHECK11-NEXT: [[TMP100:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS30]], i32 0, i32 5
2235 // CHECK11-NEXT: store ptr @.offload_maptypes.4, ptr [[TMP100]], align 4
2236 // CHECK11-NEXT: [[TMP101:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS30]], i32 0, i32 6
2237 // CHECK11-NEXT: store ptr null, ptr [[TMP101]], align 4
2238 // CHECK11-NEXT: [[TMP102:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS30]], i32 0, i32 7
2239 // CHECK11-NEXT: store ptr null, ptr [[TMP102]], align 4
2240 // CHECK11-NEXT: [[TMP103:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS30]], i32 0, i32 8
2241 // CHECK11-NEXT: store i64 [[TMP94]], ptr [[TMP103]], align 8
2242 // CHECK11-NEXT: [[TMP104:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS30]], i32 0, i32 9
2243 // CHECK11-NEXT: store i64 0, ptr [[TMP104]], align 8
2244 // CHECK11-NEXT: [[TMP105:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS30]], i32 0, i32 10
2245 // CHECK11-NEXT: store [3 x i32] zeroinitializer, ptr [[TMP105]], align 4
2246 // CHECK11-NEXT: [[TMP106:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS30]], i32 0, i32 11
2247 // CHECK11-NEXT: store [3 x i32] zeroinitializer, ptr [[TMP106]], align 4
2248 // CHECK11-NEXT: [[TMP107:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS30]], i32 0, i32 12
2249 // CHECK11-NEXT: store i32 0, ptr [[TMP107]], align 4
2250 // CHECK11-NEXT: [[TMP108:%.*]] = call i32 @__tgt_target_kernel(ptr @[[GLOB2]], i64 -1, i32 0, i32 0, ptr @.{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}_main_l110.region_id, ptr [[KERNEL_ARGS30]])
2251 // CHECK11-NEXT: [[TMP109:%.*]] = icmp ne i32 [[TMP108]], 0
2252 // CHECK11-NEXT: br i1 [[TMP109]], label [[OMP_OFFLOAD_FAILED31:%.*]], label [[OMP_OFFLOAD_CONT32:%.*]]
2253 // CHECK11: omp_offload.failed31:
2254 // CHECK11-NEXT: call void @{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}_main_l110(i32 [[TMP75]], i32 [[TMP0]], ptr [[VLA]]) #[[ATTR4]]
2255 // CHECK11-NEXT: br label [[OMP_OFFLOAD_CONT32]]
2256 // CHECK11: omp_offload.cont32:
2257 // CHECK11-NEXT: [[TMP110:%.*]] = load i32, ptr [[ARGC_ADDR]], align 4
2258 // CHECK11-NEXT: [[CALL:%.*]] = call noundef i32 @_Z5tmainIiLi10EEiT_(i32 noundef [[TMP110]])
2259 // CHECK11-NEXT: store i32 [[CALL]], ptr [[RETVAL]], align 4
2260 // CHECK11-NEXT: [[TMP111:%.*]] = load ptr, ptr [[SAVED_STACK]], align 4
2261 // CHECK11-NEXT: call void @llvm.stackrestore.p0(ptr [[TMP111]])
2262 // CHECK11-NEXT: [[TMP112:%.*]] = load i32, ptr [[RETVAL]], align 4
2263 // CHECK11-NEXT: ret i32 [[TMP112]]
2266 // CHECK11-LABEL: define {{[^@]+}}@{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}_main_l100
2267 // CHECK11-SAME: (i32 noundef [[N:%.*]], i32 noundef [[VLA:%.*]], ptr noundef nonnull align 4 dereferenceable(4) [[A:%.*]]) #[[ATTR2:[0-9]+]] {
2268 // CHECK11-NEXT: entry:
2269 // CHECK11-NEXT: [[N_ADDR:%.*]] = alloca i32, align 4
2270 // CHECK11-NEXT: [[VLA_ADDR:%.*]] = alloca i32, align 4
2271 // CHECK11-NEXT: [[A_ADDR:%.*]] = alloca ptr, align 4
2272 // CHECK11-NEXT: store i32 [[N]], ptr [[N_ADDR]], align 4
2273 // CHECK11-NEXT: store i32 [[VLA]], ptr [[VLA_ADDR]], align 4
2274 // CHECK11-NEXT: store ptr [[A]], ptr [[A_ADDR]], align 4
2275 // CHECK11-NEXT: [[TMP0:%.*]] = load i32, ptr [[VLA_ADDR]], align 4
2276 // CHECK11-NEXT: [[TMP1:%.*]] = load ptr, ptr [[A_ADDR]], align 4
2277 // CHECK11-NEXT: call void (ptr, i32, ptr, ...) @__kmpc_fork_teams(ptr @[[GLOB2]], i32 3, ptr @{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}_main_l100.omp_outlined, ptr [[N_ADDR]], i32 [[TMP0]], ptr [[TMP1]])
2278 // CHECK11-NEXT: ret void
2281 // CHECK11-LABEL: define {{[^@]+}}@{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}_main_l100.omp_outlined
2282 // 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]+]] {
2283 // CHECK11-NEXT: entry:
2284 // CHECK11-NEXT: [[DOTGLOBAL_TID__ADDR:%.*]] = alloca ptr, align 4
2285 // CHECK11-NEXT: [[DOTBOUND_TID__ADDR:%.*]] = alloca ptr, align 4
2286 // CHECK11-NEXT: [[N_ADDR:%.*]] = alloca ptr, align 4
2287 // CHECK11-NEXT: [[VLA_ADDR:%.*]] = alloca i32, align 4
2288 // CHECK11-NEXT: [[A_ADDR:%.*]] = alloca ptr, align 4
2289 // CHECK11-NEXT: [[DOTOMP_IV:%.*]] = alloca i32, align 4
2290 // CHECK11-NEXT: [[TMP:%.*]] = alloca i32, align 4
2291 // CHECK11-NEXT: [[DOTCAPTURE_EXPR_:%.*]] = alloca i32, align 4
2292 // CHECK11-NEXT: [[DOTCAPTURE_EXPR_1:%.*]] = alloca i32, align 4
2293 // CHECK11-NEXT: [[I:%.*]] = alloca i32, align 4
2294 // CHECK11-NEXT: [[DOTOMP_LB:%.*]] = alloca i32, align 4
2295 // CHECK11-NEXT: [[DOTOMP_UB:%.*]] = alloca i32, align 4
2296 // CHECK11-NEXT: [[DOTOMP_STRIDE:%.*]] = alloca i32, align 4
2297 // CHECK11-NEXT: [[DOTOMP_IS_LAST:%.*]] = alloca i32, align 4
2298 // CHECK11-NEXT: [[I3:%.*]] = alloca i32, align 4
2299 // CHECK11-NEXT: store ptr [[DOTGLOBAL_TID_]], ptr [[DOTGLOBAL_TID__ADDR]], align 4
2300 // CHECK11-NEXT: store ptr [[DOTBOUND_TID_]], ptr [[DOTBOUND_TID__ADDR]], align 4
2301 // CHECK11-NEXT: store ptr [[N]], ptr [[N_ADDR]], align 4
2302 // CHECK11-NEXT: store i32 [[VLA]], ptr [[VLA_ADDR]], align 4
2303 // CHECK11-NEXT: store ptr [[A]], ptr [[A_ADDR]], align 4
2304 // CHECK11-NEXT: [[TMP0:%.*]] = load ptr, ptr [[N_ADDR]], align 4
2305 // CHECK11-NEXT: [[TMP1:%.*]] = load i32, ptr [[VLA_ADDR]], align 4
2306 // CHECK11-NEXT: [[TMP2:%.*]] = load ptr, ptr [[A_ADDR]], align 4
2307 // CHECK11-NEXT: [[TMP3:%.*]] = load i32, ptr [[TMP0]], align 4
2308 // CHECK11-NEXT: store i32 [[TMP3]], ptr [[DOTCAPTURE_EXPR_]], align 4
2309 // CHECK11-NEXT: [[TMP4:%.*]] = load i32, ptr [[DOTCAPTURE_EXPR_]], align 4
2310 // CHECK11-NEXT: [[SUB:%.*]] = sub nsw i32 [[TMP4]], 0
2311 // CHECK11-NEXT: [[DIV:%.*]] = sdiv i32 [[SUB]], 1
2312 // CHECK11-NEXT: [[SUB2:%.*]] = sub nsw i32 [[DIV]], 1
2313 // CHECK11-NEXT: store i32 [[SUB2]], ptr [[DOTCAPTURE_EXPR_1]], align 4
2314 // CHECK11-NEXT: store i32 0, ptr [[I]], align 4
2315 // CHECK11-NEXT: [[TMP5:%.*]] = load i32, ptr [[DOTCAPTURE_EXPR_]], align 4
2316 // CHECK11-NEXT: [[CMP:%.*]] = icmp slt i32 0, [[TMP5]]
2317 // CHECK11-NEXT: br i1 [[CMP]], label [[OMP_PRECOND_THEN:%.*]], label [[OMP_PRECOND_END:%.*]]
2318 // CHECK11: omp.precond.then:
2319 // CHECK11-NEXT: store i32 0, ptr [[DOTOMP_LB]], align 4
2320 // CHECK11-NEXT: [[TMP6:%.*]] = load i32, ptr [[DOTCAPTURE_EXPR_1]], align 4
2321 // CHECK11-NEXT: store i32 [[TMP6]], ptr [[DOTOMP_UB]], align 4
2322 // CHECK11-NEXT: store i32 1, ptr [[DOTOMP_STRIDE]], align 4
2323 // CHECK11-NEXT: store i32 0, ptr [[DOTOMP_IS_LAST]], align 4
2324 // CHECK11-NEXT: [[TMP7:%.*]] = load ptr, ptr [[DOTGLOBAL_TID__ADDR]], align 4
2325 // CHECK11-NEXT: [[TMP8:%.*]] = load i32, ptr [[TMP7]], align 4
2326 // CHECK11-NEXT: call void @__kmpc_for_static_init_4(ptr @[[GLOB1:[0-9]+]], i32 [[TMP8]], i32 92, ptr [[DOTOMP_IS_LAST]], ptr [[DOTOMP_LB]], ptr [[DOTOMP_UB]], ptr [[DOTOMP_STRIDE]], i32 1, i32 1)
2327 // CHECK11-NEXT: [[TMP9:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4
2328 // CHECK11-NEXT: [[TMP10:%.*]] = load i32, ptr [[DOTCAPTURE_EXPR_1]], align 4
2329 // CHECK11-NEXT: [[CMP4:%.*]] = icmp sgt i32 [[TMP9]], [[TMP10]]
2330 // CHECK11-NEXT: br i1 [[CMP4]], label [[COND_TRUE:%.*]], label [[COND_FALSE:%.*]]
2331 // CHECK11: cond.true:
2332 // CHECK11-NEXT: [[TMP11:%.*]] = load i32, ptr [[DOTCAPTURE_EXPR_1]], align 4
2333 // CHECK11-NEXT: br label [[COND_END:%.*]]
2334 // CHECK11: cond.false:
2335 // CHECK11-NEXT: [[TMP12:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4
2336 // CHECK11-NEXT: br label [[COND_END]]
2337 // CHECK11: cond.end:
2338 // CHECK11-NEXT: [[COND:%.*]] = phi i32 [ [[TMP11]], [[COND_TRUE]] ], [ [[TMP12]], [[COND_FALSE]] ]
2339 // CHECK11-NEXT: store i32 [[COND]], ptr [[DOTOMP_UB]], align 4
2340 // CHECK11-NEXT: [[TMP13:%.*]] = load i32, ptr [[DOTOMP_LB]], align 4
2341 // CHECK11-NEXT: store i32 [[TMP13]], ptr [[DOTOMP_IV]], align 4
2342 // CHECK11-NEXT: br label [[OMP_INNER_FOR_COND:%.*]]
2343 // CHECK11: omp.inner.for.cond:
2344 // CHECK11-NEXT: [[TMP14:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4
2345 // CHECK11-NEXT: [[TMP15:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4
2346 // CHECK11-NEXT: [[CMP5:%.*]] = icmp sle i32 [[TMP14]], [[TMP15]]
2347 // CHECK11-NEXT: br i1 [[CMP5]], label [[OMP_INNER_FOR_BODY:%.*]], label [[OMP_INNER_FOR_END:%.*]]
2348 // CHECK11: omp.inner.for.body:
2349 // CHECK11-NEXT: [[TMP16:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4
2350 // CHECK11-NEXT: [[MUL:%.*]] = mul nsw i32 [[TMP16]], 1
2351 // CHECK11-NEXT: [[ADD:%.*]] = add nsw i32 0, [[MUL]]
2352 // CHECK11-NEXT: store i32 [[ADD]], ptr [[I3]], align 4
2353 // CHECK11-NEXT: [[TMP17:%.*]] = load i32, ptr [[I3]], align 4
2354 // CHECK11-NEXT: [[ARRAYIDX:%.*]] = getelementptr inbounds i32, ptr [[TMP2]], i32 [[TMP17]]
2355 // CHECK11-NEXT: store i32 0, ptr [[ARRAYIDX]], align 4
2356 // CHECK11-NEXT: br label [[OMP_BODY_CONTINUE:%.*]]
2357 // CHECK11: omp.body.continue:
2358 // CHECK11-NEXT: br label [[OMP_INNER_FOR_INC:%.*]]
2359 // CHECK11: omp.inner.for.inc:
2360 // CHECK11-NEXT: [[TMP18:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4
2361 // CHECK11-NEXT: [[ADD6:%.*]] = add nsw i32 [[TMP18]], 1
2362 // CHECK11-NEXT: store i32 [[ADD6]], ptr [[DOTOMP_IV]], align 4
2363 // CHECK11-NEXT: br label [[OMP_INNER_FOR_COND]]
2364 // CHECK11: omp.inner.for.end:
2365 // CHECK11-NEXT: br label [[OMP_LOOP_EXIT:%.*]]
2366 // CHECK11: omp.loop.exit:
2367 // CHECK11-NEXT: [[TMP19:%.*]] = load ptr, ptr [[DOTGLOBAL_TID__ADDR]], align 4
2368 // CHECK11-NEXT: [[TMP20:%.*]] = load i32, ptr [[TMP19]], align 4
2369 // CHECK11-NEXT: call void @__kmpc_for_static_fini(ptr @[[GLOB1]], i32 [[TMP20]])
2370 // CHECK11-NEXT: br label [[OMP_PRECOND_END]]
2371 // CHECK11: omp.precond.end:
2372 // CHECK11-NEXT: ret void
2375 // CHECK11-LABEL: define {{[^@]+}}@{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}_main_l105
2376 // CHECK11-SAME: (i32 noundef [[N:%.*]], i32 noundef [[VLA:%.*]], ptr noundef nonnull align 4 dereferenceable(4) [[A:%.*]]) #[[ATTR2]] {
2377 // CHECK11-NEXT: entry:
2378 // CHECK11-NEXT: [[N_ADDR:%.*]] = alloca i32, align 4
2379 // CHECK11-NEXT: [[VLA_ADDR:%.*]] = alloca i32, align 4
2380 // CHECK11-NEXT: [[A_ADDR:%.*]] = alloca ptr, align 4
2381 // CHECK11-NEXT: store i32 [[N]], ptr [[N_ADDR]], align 4
2382 // CHECK11-NEXT: store i32 [[VLA]], ptr [[VLA_ADDR]], align 4
2383 // CHECK11-NEXT: store ptr [[A]], ptr [[A_ADDR]], align 4
2384 // CHECK11-NEXT: [[TMP0:%.*]] = load i32, ptr [[VLA_ADDR]], align 4
2385 // CHECK11-NEXT: [[TMP1:%.*]] = load ptr, ptr [[A_ADDR]], align 4
2386 // CHECK11-NEXT: call void (ptr, i32, ptr, ...) @__kmpc_fork_teams(ptr @[[GLOB2]], i32 3, ptr @{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}_main_l105.omp_outlined, ptr [[N_ADDR]], i32 [[TMP0]], ptr [[TMP1]])
2387 // CHECK11-NEXT: ret void
2390 // CHECK11-LABEL: define {{[^@]+}}@{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}_main_l105.omp_outlined
2391 // 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]] {
2392 // CHECK11-NEXT: entry:
2393 // CHECK11-NEXT: [[DOTGLOBAL_TID__ADDR:%.*]] = alloca ptr, align 4
2394 // CHECK11-NEXT: [[DOTBOUND_TID__ADDR:%.*]] = alloca ptr, align 4
2395 // CHECK11-NEXT: [[N_ADDR:%.*]] = alloca ptr, align 4
2396 // CHECK11-NEXT: [[VLA_ADDR:%.*]] = alloca i32, align 4
2397 // CHECK11-NEXT: [[A_ADDR:%.*]] = alloca ptr, align 4
2398 // CHECK11-NEXT: [[DOTOMP_IV:%.*]] = alloca i32, align 4
2399 // CHECK11-NEXT: [[TMP:%.*]] = alloca i32, align 4
2400 // CHECK11-NEXT: [[DOTCAPTURE_EXPR_:%.*]] = alloca i32, align 4
2401 // CHECK11-NEXT: [[DOTCAPTURE_EXPR_1:%.*]] = alloca i32, align 4
2402 // CHECK11-NEXT: [[I:%.*]] = alloca i32, align 4
2403 // CHECK11-NEXT: [[DOTOMP_LB:%.*]] = alloca i32, align 4
2404 // CHECK11-NEXT: [[DOTOMP_UB:%.*]] = alloca i32, align 4
2405 // CHECK11-NEXT: [[DOTOMP_STRIDE:%.*]] = alloca i32, align 4
2406 // CHECK11-NEXT: [[DOTOMP_IS_LAST:%.*]] = alloca i32, align 4
2407 // CHECK11-NEXT: [[I3:%.*]] = alloca i32, align 4
2408 // CHECK11-NEXT: store ptr [[DOTGLOBAL_TID_]], ptr [[DOTGLOBAL_TID__ADDR]], align 4
2409 // CHECK11-NEXT: store ptr [[DOTBOUND_TID_]], ptr [[DOTBOUND_TID__ADDR]], align 4
2410 // CHECK11-NEXT: store ptr [[N]], ptr [[N_ADDR]], align 4
2411 // CHECK11-NEXT: store i32 [[VLA]], ptr [[VLA_ADDR]], align 4
2412 // CHECK11-NEXT: store ptr [[A]], ptr [[A_ADDR]], align 4
2413 // CHECK11-NEXT: [[TMP0:%.*]] = load ptr, ptr [[N_ADDR]], align 4
2414 // CHECK11-NEXT: [[TMP1:%.*]] = load i32, ptr [[VLA_ADDR]], align 4
2415 // CHECK11-NEXT: [[TMP2:%.*]] = load ptr, ptr [[A_ADDR]], align 4
2416 // CHECK11-NEXT: [[TMP3:%.*]] = load i32, ptr [[TMP0]], align 4
2417 // CHECK11-NEXT: store i32 [[TMP3]], ptr [[DOTCAPTURE_EXPR_]], align 4
2418 // CHECK11-NEXT: [[TMP4:%.*]] = load i32, ptr [[DOTCAPTURE_EXPR_]], align 4
2419 // CHECK11-NEXT: [[SUB:%.*]] = sub nsw i32 [[TMP4]], 0
2420 // CHECK11-NEXT: [[DIV:%.*]] = sdiv i32 [[SUB]], 1
2421 // CHECK11-NEXT: [[SUB2:%.*]] = sub nsw i32 [[DIV]], 1
2422 // CHECK11-NEXT: store i32 [[SUB2]], ptr [[DOTCAPTURE_EXPR_1]], align 4
2423 // CHECK11-NEXT: store i32 0, ptr [[I]], align 4
2424 // CHECK11-NEXT: [[TMP5:%.*]] = load i32, ptr [[DOTCAPTURE_EXPR_]], align 4
2425 // CHECK11-NEXT: [[CMP:%.*]] = icmp slt i32 0, [[TMP5]]
2426 // CHECK11-NEXT: br i1 [[CMP]], label [[OMP_PRECOND_THEN:%.*]], label [[OMP_PRECOND_END:%.*]]
2427 // CHECK11: omp.precond.then:
2428 // CHECK11-NEXT: store i32 0, ptr [[DOTOMP_LB]], align 4
2429 // CHECK11-NEXT: [[TMP6:%.*]] = load i32, ptr [[DOTCAPTURE_EXPR_1]], align 4
2430 // CHECK11-NEXT: store i32 [[TMP6]], ptr [[DOTOMP_UB]], align 4
2431 // CHECK11-NEXT: store i32 1, ptr [[DOTOMP_STRIDE]], align 4
2432 // CHECK11-NEXT: store i32 0, ptr [[DOTOMP_IS_LAST]], align 4
2433 // CHECK11-NEXT: [[TMP7:%.*]] = load ptr, ptr [[DOTGLOBAL_TID__ADDR]], align 4
2434 // CHECK11-NEXT: [[TMP8:%.*]] = load i32, ptr [[TMP7]], align 4
2435 // CHECK11-NEXT: call void @__kmpc_for_static_init_4(ptr @[[GLOB1]], i32 [[TMP8]], i32 92, ptr [[DOTOMP_IS_LAST]], ptr [[DOTOMP_LB]], ptr [[DOTOMP_UB]], ptr [[DOTOMP_STRIDE]], i32 1, i32 1)
2436 // CHECK11-NEXT: [[TMP9:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4
2437 // CHECK11-NEXT: [[TMP10:%.*]] = load i32, ptr [[DOTCAPTURE_EXPR_1]], align 4
2438 // CHECK11-NEXT: [[CMP4:%.*]] = icmp sgt i32 [[TMP9]], [[TMP10]]
2439 // CHECK11-NEXT: br i1 [[CMP4]], label [[COND_TRUE:%.*]], label [[COND_FALSE:%.*]]
2440 // CHECK11: cond.true:
2441 // CHECK11-NEXT: [[TMP11:%.*]] = load i32, ptr [[DOTCAPTURE_EXPR_1]], align 4
2442 // CHECK11-NEXT: br label [[COND_END:%.*]]
2443 // CHECK11: cond.false:
2444 // CHECK11-NEXT: [[TMP12:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4
2445 // CHECK11-NEXT: br label [[COND_END]]
2446 // CHECK11: cond.end:
2447 // CHECK11-NEXT: [[COND:%.*]] = phi i32 [ [[TMP11]], [[COND_TRUE]] ], [ [[TMP12]], [[COND_FALSE]] ]
2448 // CHECK11-NEXT: store i32 [[COND]], ptr [[DOTOMP_UB]], align 4
2449 // CHECK11-NEXT: [[TMP13:%.*]] = load i32, ptr [[DOTOMP_LB]], align 4
2450 // CHECK11-NEXT: store i32 [[TMP13]], ptr [[DOTOMP_IV]], align 4
2451 // CHECK11-NEXT: br label [[OMP_INNER_FOR_COND:%.*]]
2452 // CHECK11: omp.inner.for.cond:
2453 // CHECK11-NEXT: [[TMP14:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4
2454 // CHECK11-NEXT: [[TMP15:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4
2455 // CHECK11-NEXT: [[CMP5:%.*]] = icmp sle i32 [[TMP14]], [[TMP15]]
2456 // CHECK11-NEXT: br i1 [[CMP5]], label [[OMP_INNER_FOR_BODY:%.*]], label [[OMP_INNER_FOR_END:%.*]]
2457 // CHECK11: omp.inner.for.body:
2458 // CHECK11-NEXT: [[TMP16:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4
2459 // CHECK11-NEXT: [[MUL:%.*]] = mul nsw i32 [[TMP16]], 1
2460 // CHECK11-NEXT: [[ADD:%.*]] = add nsw i32 0, [[MUL]]
2461 // CHECK11-NEXT: store i32 [[ADD]], ptr [[I3]], align 4
2462 // CHECK11-NEXT: [[TMP17:%.*]] = load i32, ptr [[I3]], align 4
2463 // CHECK11-NEXT: [[ARRAYIDX:%.*]] = getelementptr inbounds i32, ptr [[TMP2]], i32 [[TMP17]]
2464 // CHECK11-NEXT: store i32 0, ptr [[ARRAYIDX]], align 4
2465 // CHECK11-NEXT: br label [[OMP_BODY_CONTINUE:%.*]]
2466 // CHECK11: omp.body.continue:
2467 // CHECK11-NEXT: br label [[OMP_INNER_FOR_INC:%.*]]
2468 // CHECK11: omp.inner.for.inc:
2469 // CHECK11-NEXT: [[TMP18:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4
2470 // CHECK11-NEXT: [[ADD6:%.*]] = add nsw i32 [[TMP18]], 1
2471 // CHECK11-NEXT: store i32 [[ADD6]], ptr [[DOTOMP_IV]], align 4
2472 // CHECK11-NEXT: br label [[OMP_INNER_FOR_COND]]
2473 // CHECK11: omp.inner.for.end:
2474 // CHECK11-NEXT: br label [[OMP_LOOP_EXIT:%.*]]
2475 // CHECK11: omp.loop.exit:
2476 // CHECK11-NEXT: [[TMP19:%.*]] = load ptr, ptr [[DOTGLOBAL_TID__ADDR]], align 4
2477 // CHECK11-NEXT: [[TMP20:%.*]] = load i32, ptr [[TMP19]], align 4
2478 // CHECK11-NEXT: call void @__kmpc_for_static_fini(ptr @[[GLOB1]], i32 [[TMP20]])
2479 // CHECK11-NEXT: br label [[OMP_PRECOND_END]]
2480 // CHECK11: omp.precond.end:
2481 // CHECK11-NEXT: ret void
2484 // CHECK11-LABEL: define {{[^@]+}}@{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}_main_l110
2485 // CHECK11-SAME: (i32 noundef [[N:%.*]], i32 noundef [[VLA:%.*]], ptr noundef nonnull align 4 dereferenceable(4) [[A:%.*]]) #[[ATTR2]] {
2486 // CHECK11-NEXT: entry:
2487 // CHECK11-NEXT: [[N_ADDR:%.*]] = alloca i32, align 4
2488 // CHECK11-NEXT: [[VLA_ADDR:%.*]] = alloca i32, align 4
2489 // CHECK11-NEXT: [[A_ADDR:%.*]] = alloca ptr, align 4
2490 // CHECK11-NEXT: [[DOTCAPTURE_EXPR_:%.*]] = alloca i32, align 4
2491 // CHECK11-NEXT: [[DOTCAPTURE_EXPR__CASTED:%.*]] = alloca i32, align 4
2492 // CHECK11-NEXT: store i32 [[N]], ptr [[N_ADDR]], align 4
2493 // CHECK11-NEXT: store i32 [[VLA]], ptr [[VLA_ADDR]], align 4
2494 // CHECK11-NEXT: store ptr [[A]], ptr [[A_ADDR]], align 4
2495 // CHECK11-NEXT: [[TMP0:%.*]] = load i32, ptr [[VLA_ADDR]], align 4
2496 // CHECK11-NEXT: [[TMP1:%.*]] = load ptr, ptr [[A_ADDR]], align 4
2497 // CHECK11-NEXT: [[TMP2:%.*]] = load i32, ptr [[N_ADDR]], align 4
2498 // CHECK11-NEXT: store i32 [[TMP2]], ptr [[DOTCAPTURE_EXPR_]], align 4
2499 // CHECK11-NEXT: [[TMP3:%.*]] = load i32, ptr [[DOTCAPTURE_EXPR_]], align 4
2500 // CHECK11-NEXT: store i32 [[TMP3]], ptr [[DOTCAPTURE_EXPR__CASTED]], align 4
2501 // CHECK11-NEXT: [[TMP4:%.*]] = load i32, ptr [[DOTCAPTURE_EXPR__CASTED]], align 4
2502 // CHECK11-NEXT: call void (ptr, i32, ptr, ...) @__kmpc_fork_teams(ptr @[[GLOB2]], i32 4, ptr @{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}_main_l110.omp_outlined, ptr [[N_ADDR]], i32 [[TMP0]], ptr [[TMP1]], i32 [[TMP4]])
2503 // CHECK11-NEXT: ret void
2506 // CHECK11-LABEL: define {{[^@]+}}@{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}_main_l110.omp_outlined
2507 // 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:%.*]], i32 noundef [[DOTCAPTURE_EXPR_:%.*]]) #[[ATTR3]] {
2508 // CHECK11-NEXT: entry:
2509 // CHECK11-NEXT: [[DOTGLOBAL_TID__ADDR:%.*]] = alloca ptr, align 4
2510 // CHECK11-NEXT: [[DOTBOUND_TID__ADDR:%.*]] = alloca ptr, align 4
2511 // CHECK11-NEXT: [[N_ADDR:%.*]] = alloca ptr, align 4
2512 // CHECK11-NEXT: [[VLA_ADDR:%.*]] = alloca i32, align 4
2513 // CHECK11-NEXT: [[A_ADDR:%.*]] = alloca ptr, align 4
2514 // CHECK11-NEXT: [[DOTCAPTURE_EXPR__ADDR:%.*]] = alloca i32, align 4
2515 // CHECK11-NEXT: [[DOTOMP_IV:%.*]] = alloca i32, align 4
2516 // CHECK11-NEXT: [[TMP:%.*]] = alloca i32, align 4
2517 // CHECK11-NEXT: [[DOTCAPTURE_EXPR_1:%.*]] = alloca i32, align 4
2518 // CHECK11-NEXT: [[DOTCAPTURE_EXPR_2:%.*]] = alloca i32, align 4
2519 // CHECK11-NEXT: [[I:%.*]] = alloca i32, align 4
2520 // CHECK11-NEXT: [[DOTOMP_LB:%.*]] = alloca i32, align 4
2521 // CHECK11-NEXT: [[DOTOMP_UB:%.*]] = alloca i32, align 4
2522 // CHECK11-NEXT: [[DOTOMP_STRIDE:%.*]] = alloca i32, align 4
2523 // CHECK11-NEXT: [[DOTOMP_IS_LAST:%.*]] = alloca i32, align 4
2524 // CHECK11-NEXT: [[I4:%.*]] = alloca i32, align 4
2525 // CHECK11-NEXT: store ptr [[DOTGLOBAL_TID_]], ptr [[DOTGLOBAL_TID__ADDR]], align 4
2526 // CHECK11-NEXT: store ptr [[DOTBOUND_TID_]], ptr [[DOTBOUND_TID__ADDR]], align 4
2527 // CHECK11-NEXT: store ptr [[N]], ptr [[N_ADDR]], align 4
2528 // CHECK11-NEXT: store i32 [[VLA]], ptr [[VLA_ADDR]], align 4
2529 // CHECK11-NEXT: store ptr [[A]], ptr [[A_ADDR]], align 4
2530 // CHECK11-NEXT: store i32 [[DOTCAPTURE_EXPR_]], ptr [[DOTCAPTURE_EXPR__ADDR]], align 4
2531 // CHECK11-NEXT: [[TMP0:%.*]] = load ptr, ptr [[N_ADDR]], align 4
2532 // CHECK11-NEXT: [[TMP1:%.*]] = load i32, ptr [[VLA_ADDR]], align 4
2533 // CHECK11-NEXT: [[TMP2:%.*]] = load ptr, ptr [[A_ADDR]], align 4
2534 // CHECK11-NEXT: [[TMP3:%.*]] = load i32, ptr [[TMP0]], align 4
2535 // CHECK11-NEXT: store i32 [[TMP3]], ptr [[DOTCAPTURE_EXPR_1]], align 4
2536 // CHECK11-NEXT: [[TMP4:%.*]] = load i32, ptr [[DOTCAPTURE_EXPR_1]], align 4
2537 // CHECK11-NEXT: [[SUB:%.*]] = sub nsw i32 [[TMP4]], 0
2538 // CHECK11-NEXT: [[DIV:%.*]] = sdiv i32 [[SUB]], 1
2539 // CHECK11-NEXT: [[SUB3:%.*]] = sub nsw i32 [[DIV]], 1
2540 // CHECK11-NEXT: store i32 [[SUB3]], ptr [[DOTCAPTURE_EXPR_2]], align 4
2541 // CHECK11-NEXT: store i32 0, ptr [[I]], align 4
2542 // CHECK11-NEXT: [[TMP5:%.*]] = load i32, ptr [[DOTCAPTURE_EXPR_1]], align 4
2543 // CHECK11-NEXT: [[CMP:%.*]] = icmp slt i32 0, [[TMP5]]
2544 // CHECK11-NEXT: br i1 [[CMP]], label [[OMP_PRECOND_THEN:%.*]], label [[OMP_PRECOND_END:%.*]]
2545 // CHECK11: omp.precond.then:
2546 // CHECK11-NEXT: store i32 0, ptr [[DOTOMP_LB]], align 4
2547 // CHECK11-NEXT: [[TMP6:%.*]] = load i32, ptr [[DOTCAPTURE_EXPR_2]], align 4
2548 // CHECK11-NEXT: store i32 [[TMP6]], ptr [[DOTOMP_UB]], align 4
2549 // CHECK11-NEXT: store i32 1, ptr [[DOTOMP_STRIDE]], align 4
2550 // CHECK11-NEXT: store i32 0, ptr [[DOTOMP_IS_LAST]], align 4
2551 // CHECK11-NEXT: [[TMP7:%.*]] = load i32, ptr [[DOTCAPTURE_EXPR__ADDR]], align 4
2552 // CHECK11-NEXT: [[TMP8:%.*]] = load ptr, ptr [[DOTGLOBAL_TID__ADDR]], align 4
2553 // CHECK11-NEXT: [[TMP9:%.*]] = load i32, ptr [[TMP8]], align 4
2554 // CHECK11-NEXT: call void @__kmpc_for_static_init_4(ptr @[[GLOB1]], i32 [[TMP9]], i32 91, ptr [[DOTOMP_IS_LAST]], ptr [[DOTOMP_LB]], ptr [[DOTOMP_UB]], ptr [[DOTOMP_STRIDE]], i32 1, i32 [[TMP7]])
2555 // CHECK11-NEXT: br label [[OMP_DISPATCH_COND:%.*]]
2556 // CHECK11: omp.dispatch.cond:
2557 // CHECK11-NEXT: [[TMP10:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4
2558 // CHECK11-NEXT: [[TMP11:%.*]] = load i32, ptr [[DOTCAPTURE_EXPR_2]], align 4
2559 // CHECK11-NEXT: [[CMP5:%.*]] = icmp sgt i32 [[TMP10]], [[TMP11]]
2560 // CHECK11-NEXT: br i1 [[CMP5]], label [[COND_TRUE:%.*]], label [[COND_FALSE:%.*]]
2561 // CHECK11: cond.true:
2562 // CHECK11-NEXT: [[TMP12:%.*]] = load i32, ptr [[DOTCAPTURE_EXPR_2]], align 4
2563 // CHECK11-NEXT: br label [[COND_END:%.*]]
2564 // CHECK11: cond.false:
2565 // CHECK11-NEXT: [[TMP13:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4
2566 // CHECK11-NEXT: br label [[COND_END]]
2567 // CHECK11: cond.end:
2568 // CHECK11-NEXT: [[COND:%.*]] = phi i32 [ [[TMP12]], [[COND_TRUE]] ], [ [[TMP13]], [[COND_FALSE]] ]
2569 // CHECK11-NEXT: store i32 [[COND]], ptr [[DOTOMP_UB]], align 4
2570 // CHECK11-NEXT: [[TMP14:%.*]] = load i32, ptr [[DOTOMP_LB]], align 4
2571 // CHECK11-NEXT: store i32 [[TMP14]], ptr [[DOTOMP_IV]], align 4
2572 // CHECK11-NEXT: [[TMP15:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4
2573 // CHECK11-NEXT: [[TMP16:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4
2574 // CHECK11-NEXT: [[CMP6:%.*]] = icmp sle i32 [[TMP15]], [[TMP16]]
2575 // CHECK11-NEXT: br i1 [[CMP6]], label [[OMP_DISPATCH_BODY:%.*]], label [[OMP_DISPATCH_END:%.*]]
2576 // CHECK11: omp.dispatch.body:
2577 // CHECK11-NEXT: br label [[OMP_INNER_FOR_COND:%.*]]
2578 // CHECK11: omp.inner.for.cond:
2579 // CHECK11-NEXT: [[TMP17:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP12:![0-9]+]]
2580 // CHECK11-NEXT: [[TMP18:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4, !llvm.access.group [[ACC_GRP12]]
2581 // CHECK11-NEXT: [[CMP7:%.*]] = icmp sle i32 [[TMP17]], [[TMP18]]
2582 // CHECK11-NEXT: br i1 [[CMP7]], label [[OMP_INNER_FOR_BODY:%.*]], label [[OMP_INNER_FOR_END:%.*]]
2583 // CHECK11: omp.inner.for.body:
2584 // CHECK11-NEXT: [[TMP19:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP12]]
2585 // CHECK11-NEXT: [[MUL:%.*]] = mul nsw i32 [[TMP19]], 1
2586 // CHECK11-NEXT: [[ADD:%.*]] = add nsw i32 0, [[MUL]]
2587 // CHECK11-NEXT: store i32 [[ADD]], ptr [[I4]], align 4, !llvm.access.group [[ACC_GRP12]]
2588 // CHECK11-NEXT: [[TMP20:%.*]] = load i32, ptr [[I4]], align 4, !llvm.access.group [[ACC_GRP12]]
2589 // CHECK11-NEXT: [[ARRAYIDX:%.*]] = getelementptr inbounds i32, ptr [[TMP2]], i32 [[TMP20]]
2590 // CHECK11-NEXT: store i32 0, ptr [[ARRAYIDX]], align 4, !llvm.access.group [[ACC_GRP12]]
2591 // CHECK11-NEXT: br label [[OMP_BODY_CONTINUE:%.*]]
2592 // CHECK11: omp.body.continue:
2593 // CHECK11-NEXT: br label [[OMP_INNER_FOR_INC:%.*]]
2594 // CHECK11: omp.inner.for.inc:
2595 // CHECK11-NEXT: [[TMP21:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP12]]
2596 // CHECK11-NEXT: [[ADD8:%.*]] = add nsw i32 [[TMP21]], 1
2597 // CHECK11-NEXT: store i32 [[ADD8]], ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP12]]
2598 // CHECK11-NEXT: br label [[OMP_INNER_FOR_COND]], !llvm.loop [[LOOP13:![0-9]+]]
2599 // CHECK11: omp.inner.for.end:
2600 // CHECK11-NEXT: br label [[OMP_DISPATCH_INC:%.*]]
2601 // CHECK11: omp.dispatch.inc:
2602 // CHECK11-NEXT: [[TMP22:%.*]] = load i32, ptr [[DOTOMP_LB]], align 4
2603 // CHECK11-NEXT: [[TMP23:%.*]] = load i32, ptr [[DOTOMP_STRIDE]], align 4
2604 // CHECK11-NEXT: [[ADD9:%.*]] = add nsw i32 [[TMP22]], [[TMP23]]
2605 // CHECK11-NEXT: store i32 [[ADD9]], ptr [[DOTOMP_LB]], align 4
2606 // CHECK11-NEXT: [[TMP24:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4
2607 // CHECK11-NEXT: [[TMP25:%.*]] = load i32, ptr [[DOTOMP_STRIDE]], align 4
2608 // CHECK11-NEXT: [[ADD10:%.*]] = add nsw i32 [[TMP24]], [[TMP25]]
2609 // CHECK11-NEXT: store i32 [[ADD10]], ptr [[DOTOMP_UB]], align 4
2610 // CHECK11-NEXT: br label [[OMP_DISPATCH_COND]]
2611 // CHECK11: omp.dispatch.end:
2612 // CHECK11-NEXT: [[TMP26:%.*]] = load ptr, ptr [[DOTGLOBAL_TID__ADDR]], align 4
2613 // CHECK11-NEXT: [[TMP27:%.*]] = load i32, ptr [[TMP26]], align 4
2614 // CHECK11-NEXT: call void @__kmpc_for_static_fini(ptr @[[GLOB1]], i32 [[TMP27]])
2615 // CHECK11-NEXT: br label [[OMP_PRECOND_END]]
2616 // CHECK11: omp.precond.end:
2617 // CHECK11-NEXT: ret void
2620 // CHECK11-LABEL: define {{[^@]+}}@_Z5tmainIiLi10EEiT_
2621 // CHECK11-SAME: (i32 noundef [[ARGC:%.*]]) #[[ATTR6:[0-9]+]] comdat {
2622 // CHECK11-NEXT: entry:
2623 // CHECK11-NEXT: [[ARGC_ADDR:%.*]] = alloca i32, align 4
2624 // CHECK11-NEXT: [[A:%.*]] = alloca [10 x i32], align 4
2625 // CHECK11-NEXT: [[DOTOFFLOAD_BASEPTRS:%.*]] = alloca [1 x ptr], align 4
2626 // CHECK11-NEXT: [[DOTOFFLOAD_PTRS:%.*]] = alloca [1 x ptr], align 4
2627 // CHECK11-NEXT: [[DOTOFFLOAD_MAPPERS:%.*]] = alloca [1 x ptr], align 4
2628 // CHECK11-NEXT: [[TMP:%.*]] = alloca i32, align 4
2629 // CHECK11-NEXT: [[KERNEL_ARGS:%.*]] = alloca [[STRUCT___TGT_KERNEL_ARGUMENTS:%.*]], align 8
2630 // CHECK11-NEXT: [[DOTOFFLOAD_BASEPTRS1:%.*]] = alloca [1 x ptr], align 4
2631 // CHECK11-NEXT: [[DOTOFFLOAD_PTRS2:%.*]] = alloca [1 x ptr], align 4
2632 // CHECK11-NEXT: [[DOTOFFLOAD_MAPPERS3:%.*]] = alloca [1 x ptr], align 4
2633 // CHECK11-NEXT: [[_TMP4:%.*]] = alloca i32, align 4
2634 // CHECK11-NEXT: [[KERNEL_ARGS5:%.*]] = alloca [[STRUCT___TGT_KERNEL_ARGUMENTS]], align 8
2635 // CHECK11-NEXT: [[DOTOFFLOAD_BASEPTRS8:%.*]] = alloca [1 x ptr], align 4
2636 // CHECK11-NEXT: [[DOTOFFLOAD_PTRS9:%.*]] = alloca [1 x ptr], align 4
2637 // CHECK11-NEXT: [[DOTOFFLOAD_MAPPERS10:%.*]] = alloca [1 x ptr], align 4
2638 // CHECK11-NEXT: [[_TMP11:%.*]] = alloca i32, align 4
2639 // CHECK11-NEXT: [[KERNEL_ARGS12:%.*]] = alloca [[STRUCT___TGT_KERNEL_ARGUMENTS]], align 8
2640 // CHECK11-NEXT: store i32 [[ARGC]], ptr [[ARGC_ADDR]], align 4
2641 // CHECK11-NEXT: [[TMP0:%.*]] = getelementptr inbounds [1 x ptr], ptr [[DOTOFFLOAD_BASEPTRS]], i32 0, i32 0
2642 // CHECK11-NEXT: store ptr [[A]], ptr [[TMP0]], align 4
2643 // CHECK11-NEXT: [[TMP1:%.*]] = getelementptr inbounds [1 x ptr], ptr [[DOTOFFLOAD_PTRS]], i32 0, i32 0
2644 // CHECK11-NEXT: store ptr [[A]], ptr [[TMP1]], align 4
2645 // CHECK11-NEXT: [[TMP2:%.*]] = getelementptr inbounds [1 x ptr], ptr [[DOTOFFLOAD_MAPPERS]], i32 0, i32 0
2646 // CHECK11-NEXT: store ptr null, ptr [[TMP2]], align 4
2647 // CHECK11-NEXT: [[TMP3:%.*]] = getelementptr inbounds [1 x ptr], ptr [[DOTOFFLOAD_BASEPTRS]], i32 0, i32 0
2648 // CHECK11-NEXT: [[TMP4:%.*]] = getelementptr inbounds [1 x ptr], ptr [[DOTOFFLOAD_PTRS]], i32 0, i32 0
2649 // CHECK11-NEXT: [[TMP5:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 0
2650 // CHECK11-NEXT: store i32 2, ptr [[TMP5]], align 4
2651 // CHECK11-NEXT: [[TMP6:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 1
2652 // CHECK11-NEXT: store i32 1, ptr [[TMP6]], align 4
2653 // CHECK11-NEXT: [[TMP7:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 2
2654 // CHECK11-NEXT: store ptr [[TMP3]], ptr [[TMP7]], align 4
2655 // CHECK11-NEXT: [[TMP8:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 3
2656 // CHECK11-NEXT: store ptr [[TMP4]], ptr [[TMP8]], align 4
2657 // CHECK11-NEXT: [[TMP9:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 4
2658 // CHECK11-NEXT: store ptr @.offload_sizes.5, ptr [[TMP9]], align 4
2659 // CHECK11-NEXT: [[TMP10:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 5
2660 // CHECK11-NEXT: store ptr @.offload_maptypes.6, ptr [[TMP10]], align 4
2661 // CHECK11-NEXT: [[TMP11:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 6
2662 // CHECK11-NEXT: store ptr null, ptr [[TMP11]], align 4
2663 // CHECK11-NEXT: [[TMP12:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 7
2664 // CHECK11-NEXT: store ptr null, ptr [[TMP12]], align 4
2665 // CHECK11-NEXT: [[TMP13:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 8
2666 // CHECK11-NEXT: store i64 10, ptr [[TMP13]], align 8
2667 // CHECK11-NEXT: [[TMP14:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 9
2668 // CHECK11-NEXT: store i64 0, ptr [[TMP14]], align 8
2669 // CHECK11-NEXT: [[TMP15:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 10
2670 // CHECK11-NEXT: store [3 x i32] zeroinitializer, ptr [[TMP15]], align 4
2671 // CHECK11-NEXT: [[TMP16:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 11
2672 // CHECK11-NEXT: store [3 x i32] zeroinitializer, ptr [[TMP16]], align 4
2673 // CHECK11-NEXT: [[TMP17:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 12
2674 // CHECK11-NEXT: store i32 0, ptr [[TMP17]], align 4
2675 // CHECK11-NEXT: [[TMP18:%.*]] = call i32 @__tgt_target_kernel(ptr @[[GLOB2]], i64 -1, i32 0, i32 0, ptr @.{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z5tmainIiLi10EEiT__l79.region_id, ptr [[KERNEL_ARGS]])
2676 // CHECK11-NEXT: [[TMP19:%.*]] = icmp ne i32 [[TMP18]], 0
2677 // CHECK11-NEXT: br i1 [[TMP19]], label [[OMP_OFFLOAD_FAILED:%.*]], label [[OMP_OFFLOAD_CONT:%.*]]
2678 // CHECK11: omp_offload.failed:
2679 // CHECK11-NEXT: call void @{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z5tmainIiLi10EEiT__l79(ptr [[A]]) #[[ATTR4]]
2680 // CHECK11-NEXT: br label [[OMP_OFFLOAD_CONT]]
2681 // CHECK11: omp_offload.cont:
2682 // CHECK11-NEXT: [[TMP20:%.*]] = getelementptr inbounds [1 x ptr], ptr [[DOTOFFLOAD_BASEPTRS1]], i32 0, i32 0
2683 // CHECK11-NEXT: store ptr [[A]], ptr [[TMP20]], align 4
2684 // CHECK11-NEXT: [[TMP21:%.*]] = getelementptr inbounds [1 x ptr], ptr [[DOTOFFLOAD_PTRS2]], i32 0, i32 0
2685 // CHECK11-NEXT: store ptr [[A]], ptr [[TMP21]], align 4
2686 // CHECK11-NEXT: [[TMP22:%.*]] = getelementptr inbounds [1 x ptr], ptr [[DOTOFFLOAD_MAPPERS3]], i32 0, i32 0
2687 // CHECK11-NEXT: store ptr null, ptr [[TMP22]], align 4
2688 // CHECK11-NEXT: [[TMP23:%.*]] = getelementptr inbounds [1 x ptr], ptr [[DOTOFFLOAD_BASEPTRS1]], i32 0, i32 0
2689 // CHECK11-NEXT: [[TMP24:%.*]] = getelementptr inbounds [1 x ptr], ptr [[DOTOFFLOAD_PTRS2]], i32 0, i32 0
2690 // CHECK11-NEXT: [[TMP25:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS5]], i32 0, i32 0
2691 // CHECK11-NEXT: store i32 2, ptr [[TMP25]], align 4
2692 // CHECK11-NEXT: [[TMP26:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS5]], i32 0, i32 1
2693 // CHECK11-NEXT: store i32 1, ptr [[TMP26]], align 4
2694 // CHECK11-NEXT: [[TMP27:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS5]], i32 0, i32 2
2695 // CHECK11-NEXT: store ptr [[TMP23]], ptr [[TMP27]], align 4
2696 // CHECK11-NEXT: [[TMP28:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS5]], i32 0, i32 3
2697 // CHECK11-NEXT: store ptr [[TMP24]], ptr [[TMP28]], align 4
2698 // CHECK11-NEXT: [[TMP29:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS5]], i32 0, i32 4
2699 // CHECK11-NEXT: store ptr @.offload_sizes.7, ptr [[TMP29]], align 4
2700 // CHECK11-NEXT: [[TMP30:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS5]], i32 0, i32 5
2701 // CHECK11-NEXT: store ptr @.offload_maptypes.8, ptr [[TMP30]], align 4
2702 // CHECK11-NEXT: [[TMP31:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS5]], i32 0, i32 6
2703 // CHECK11-NEXT: store ptr null, ptr [[TMP31]], align 4
2704 // CHECK11-NEXT: [[TMP32:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS5]], i32 0, i32 7
2705 // CHECK11-NEXT: store ptr null, ptr [[TMP32]], align 4
2706 // CHECK11-NEXT: [[TMP33:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS5]], i32 0, i32 8
2707 // CHECK11-NEXT: store i64 10, ptr [[TMP33]], align 8
2708 // CHECK11-NEXT: [[TMP34:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS5]], i32 0, i32 9
2709 // CHECK11-NEXT: store i64 0, ptr [[TMP34]], align 8
2710 // CHECK11-NEXT: [[TMP35:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS5]], i32 0, i32 10
2711 // CHECK11-NEXT: store [3 x i32] zeroinitializer, ptr [[TMP35]], align 4
2712 // CHECK11-NEXT: [[TMP36:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS5]], i32 0, i32 11
2713 // CHECK11-NEXT: store [3 x i32] zeroinitializer, ptr [[TMP36]], align 4
2714 // CHECK11-NEXT: [[TMP37:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS5]], i32 0, i32 12
2715 // CHECK11-NEXT: store i32 0, ptr [[TMP37]], align 4
2716 // CHECK11-NEXT: [[TMP38:%.*]] = call i32 @__tgt_target_kernel(ptr @[[GLOB2]], i64 -1, i32 0, i32 0, ptr @.{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z5tmainIiLi10EEiT__l84.region_id, ptr [[KERNEL_ARGS5]])
2717 // CHECK11-NEXT: [[TMP39:%.*]] = icmp ne i32 [[TMP38]], 0
2718 // CHECK11-NEXT: br i1 [[TMP39]], label [[OMP_OFFLOAD_FAILED6:%.*]], label [[OMP_OFFLOAD_CONT7:%.*]]
2719 // CHECK11: omp_offload.failed6:
2720 // CHECK11-NEXT: call void @{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z5tmainIiLi10EEiT__l84(ptr [[A]]) #[[ATTR4]]
2721 // CHECK11-NEXT: br label [[OMP_OFFLOAD_CONT7]]
2722 // CHECK11: omp_offload.cont7:
2723 // CHECK11-NEXT: [[TMP40:%.*]] = getelementptr inbounds [1 x ptr], ptr [[DOTOFFLOAD_BASEPTRS8]], i32 0, i32 0
2724 // CHECK11-NEXT: store ptr [[A]], ptr [[TMP40]], align 4
2725 // CHECK11-NEXT: [[TMP41:%.*]] = getelementptr inbounds [1 x ptr], ptr [[DOTOFFLOAD_PTRS9]], i32 0, i32 0
2726 // CHECK11-NEXT: store ptr [[A]], ptr [[TMP41]], align 4
2727 // CHECK11-NEXT: [[TMP42:%.*]] = getelementptr inbounds [1 x ptr], ptr [[DOTOFFLOAD_MAPPERS10]], i32 0, i32 0
2728 // CHECK11-NEXT: store ptr null, ptr [[TMP42]], align 4
2729 // CHECK11-NEXT: [[TMP43:%.*]] = getelementptr inbounds [1 x ptr], ptr [[DOTOFFLOAD_BASEPTRS8]], i32 0, i32 0
2730 // CHECK11-NEXT: [[TMP44:%.*]] = getelementptr inbounds [1 x ptr], ptr [[DOTOFFLOAD_PTRS9]], i32 0, i32 0
2731 // CHECK11-NEXT: [[TMP45:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS12]], i32 0, i32 0
2732 // CHECK11-NEXT: store i32 2, ptr [[TMP45]], align 4
2733 // CHECK11-NEXT: [[TMP46:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS12]], i32 0, i32 1
2734 // CHECK11-NEXT: store i32 1, ptr [[TMP46]], align 4
2735 // CHECK11-NEXT: [[TMP47:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS12]], i32 0, i32 2
2736 // CHECK11-NEXT: store ptr [[TMP43]], ptr [[TMP47]], align 4
2737 // CHECK11-NEXT: [[TMP48:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS12]], i32 0, i32 3
2738 // CHECK11-NEXT: store ptr [[TMP44]], ptr [[TMP48]], align 4
2739 // CHECK11-NEXT: [[TMP49:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS12]], i32 0, i32 4
2740 // CHECK11-NEXT: store ptr @.offload_sizes.9, ptr [[TMP49]], align 4
2741 // CHECK11-NEXT: [[TMP50:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS12]], i32 0, i32 5
2742 // CHECK11-NEXT: store ptr @.offload_maptypes.10, ptr [[TMP50]], align 4
2743 // CHECK11-NEXT: [[TMP51:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS12]], i32 0, i32 6
2744 // CHECK11-NEXT: store ptr null, ptr [[TMP51]], align 4
2745 // CHECK11-NEXT: [[TMP52:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS12]], i32 0, i32 7
2746 // CHECK11-NEXT: store ptr null, ptr [[TMP52]], align 4
2747 // CHECK11-NEXT: [[TMP53:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS12]], i32 0, i32 8
2748 // CHECK11-NEXT: store i64 10, ptr [[TMP53]], align 8
2749 // CHECK11-NEXT: [[TMP54:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS12]], i32 0, i32 9
2750 // CHECK11-NEXT: store i64 0, ptr [[TMP54]], align 8
2751 // CHECK11-NEXT: [[TMP55:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS12]], i32 0, i32 10
2752 // CHECK11-NEXT: store [3 x i32] zeroinitializer, ptr [[TMP55]], align 4
2753 // CHECK11-NEXT: [[TMP56:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS12]], i32 0, i32 11
2754 // CHECK11-NEXT: store [3 x i32] zeroinitializer, ptr [[TMP56]], align 4
2755 // CHECK11-NEXT: [[TMP57:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS12]], i32 0, i32 12
2756 // CHECK11-NEXT: store i32 0, ptr [[TMP57]], align 4
2757 // CHECK11-NEXT: [[TMP58:%.*]] = call i32 @__tgt_target_kernel(ptr @[[GLOB2]], i64 -1, i32 0, i32 0, ptr @.{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z5tmainIiLi10EEiT__l89.region_id, ptr [[KERNEL_ARGS12]])
2758 // CHECK11-NEXT: [[TMP59:%.*]] = icmp ne i32 [[TMP58]], 0
2759 // CHECK11-NEXT: br i1 [[TMP59]], label [[OMP_OFFLOAD_FAILED13:%.*]], label [[OMP_OFFLOAD_CONT14:%.*]]
2760 // CHECK11: omp_offload.failed13:
2761 // CHECK11-NEXT: call void @{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z5tmainIiLi10EEiT__l89(ptr [[A]]) #[[ATTR4]]
2762 // CHECK11-NEXT: br label [[OMP_OFFLOAD_CONT14]]
2763 // CHECK11: omp_offload.cont14:
2764 // CHECK11-NEXT: ret i32 0
2767 // CHECK11-LABEL: define {{[^@]+}}@{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z5tmainIiLi10EEiT__l79
2768 // CHECK11-SAME: (ptr noundef nonnull align 4 dereferenceable(40) [[A:%.*]]) #[[ATTR2]] {
2769 // CHECK11-NEXT: entry:
2770 // CHECK11-NEXT: [[A_ADDR:%.*]] = alloca ptr, align 4
2771 // CHECK11-NEXT: store ptr [[A]], ptr [[A_ADDR]], align 4
2772 // CHECK11-NEXT: [[TMP0:%.*]] = load ptr, ptr [[A_ADDR]], align 4
2773 // CHECK11-NEXT: call void (ptr, i32, ptr, ...) @__kmpc_fork_teams(ptr @[[GLOB2]], i32 1, ptr @{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z5tmainIiLi10EEiT__l79.omp_outlined, ptr [[TMP0]])
2774 // CHECK11-NEXT: ret void
2777 // CHECK11-LABEL: define {{[^@]+}}@{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z5tmainIiLi10EEiT__l79.omp_outlined
2778 // CHECK11-SAME: (ptr noalias noundef [[DOTGLOBAL_TID_:%.*]], ptr noalias noundef [[DOTBOUND_TID_:%.*]], ptr noundef nonnull align 4 dereferenceable(40) [[A:%.*]]) #[[ATTR3]] {
2779 // CHECK11-NEXT: entry:
2780 // CHECK11-NEXT: [[DOTGLOBAL_TID__ADDR:%.*]] = alloca ptr, align 4
2781 // CHECK11-NEXT: [[DOTBOUND_TID__ADDR:%.*]] = alloca ptr, align 4
2782 // CHECK11-NEXT: [[A_ADDR:%.*]] = alloca ptr, align 4
2783 // CHECK11-NEXT: [[DOTOMP_IV:%.*]] = alloca i32, align 4
2784 // CHECK11-NEXT: [[TMP:%.*]] = alloca i32, align 4
2785 // CHECK11-NEXT: [[DOTOMP_LB:%.*]] = alloca i32, align 4
2786 // CHECK11-NEXT: [[DOTOMP_UB:%.*]] = alloca i32, align 4
2787 // CHECK11-NEXT: [[DOTOMP_STRIDE:%.*]] = alloca i32, align 4
2788 // CHECK11-NEXT: [[DOTOMP_IS_LAST:%.*]] = alloca i32, align 4
2789 // CHECK11-NEXT: [[I:%.*]] = alloca i32, align 4
2790 // CHECK11-NEXT: store ptr [[DOTGLOBAL_TID_]], ptr [[DOTGLOBAL_TID__ADDR]], align 4
2791 // CHECK11-NEXT: store ptr [[DOTBOUND_TID_]], ptr [[DOTBOUND_TID__ADDR]], align 4
2792 // CHECK11-NEXT: store ptr [[A]], ptr [[A_ADDR]], align 4
2793 // CHECK11-NEXT: [[TMP0:%.*]] = load ptr, ptr [[A_ADDR]], align 4
2794 // CHECK11-NEXT: store i32 0, ptr [[DOTOMP_LB]], align 4
2795 // CHECK11-NEXT: store i32 9, ptr [[DOTOMP_UB]], align 4
2796 // CHECK11-NEXT: store i32 1, ptr [[DOTOMP_STRIDE]], align 4
2797 // CHECK11-NEXT: store i32 0, ptr [[DOTOMP_IS_LAST]], align 4
2798 // CHECK11-NEXT: [[TMP1:%.*]] = load ptr, ptr [[DOTGLOBAL_TID__ADDR]], align 4
2799 // CHECK11-NEXT: [[TMP2:%.*]] = load i32, ptr [[TMP1]], align 4
2800 // CHECK11-NEXT: call void @__kmpc_for_static_init_4(ptr @[[GLOB1]], i32 [[TMP2]], i32 92, ptr [[DOTOMP_IS_LAST]], ptr [[DOTOMP_LB]], ptr [[DOTOMP_UB]], ptr [[DOTOMP_STRIDE]], i32 1, i32 1)
2801 // CHECK11-NEXT: [[TMP3:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4
2802 // CHECK11-NEXT: [[CMP:%.*]] = icmp sgt i32 [[TMP3]], 9
2803 // CHECK11-NEXT: br i1 [[CMP]], label [[COND_TRUE:%.*]], label [[COND_FALSE:%.*]]
2804 // CHECK11: cond.true:
2805 // CHECK11-NEXT: br label [[COND_END:%.*]]
2806 // CHECK11: cond.false:
2807 // CHECK11-NEXT: [[TMP4:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4
2808 // CHECK11-NEXT: br label [[COND_END]]
2809 // CHECK11: cond.end:
2810 // CHECK11-NEXT: [[COND:%.*]] = phi i32 [ 9, [[COND_TRUE]] ], [ [[TMP4]], [[COND_FALSE]] ]
2811 // CHECK11-NEXT: store i32 [[COND]], ptr [[DOTOMP_UB]], align 4
2812 // CHECK11-NEXT: [[TMP5:%.*]] = load i32, ptr [[DOTOMP_LB]], align 4
2813 // CHECK11-NEXT: store i32 [[TMP5]], ptr [[DOTOMP_IV]], align 4
2814 // CHECK11-NEXT: br label [[OMP_INNER_FOR_COND:%.*]]
2815 // CHECK11: omp.inner.for.cond:
2816 // CHECK11-NEXT: [[TMP6:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4
2817 // CHECK11-NEXT: [[TMP7:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4
2818 // CHECK11-NEXT: [[CMP1:%.*]] = icmp sle i32 [[TMP6]], [[TMP7]]
2819 // CHECK11-NEXT: br i1 [[CMP1]], label [[OMP_INNER_FOR_BODY:%.*]], label [[OMP_INNER_FOR_END:%.*]]
2820 // CHECK11: omp.inner.for.body:
2821 // CHECK11-NEXT: [[TMP8:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4
2822 // CHECK11-NEXT: [[MUL:%.*]] = mul nsw i32 [[TMP8]], 1
2823 // CHECK11-NEXT: [[ADD:%.*]] = add nsw i32 0, [[MUL]]
2824 // CHECK11-NEXT: store i32 [[ADD]], ptr [[I]], align 4
2825 // CHECK11-NEXT: [[TMP9:%.*]] = load i32, ptr [[I]], align 4
2826 // CHECK11-NEXT: [[ARRAYIDX:%.*]] = getelementptr inbounds [10 x i32], ptr [[TMP0]], i32 0, i32 [[TMP9]]
2827 // CHECK11-NEXT: store i32 0, ptr [[ARRAYIDX]], align 4
2828 // CHECK11-NEXT: br label [[OMP_BODY_CONTINUE:%.*]]
2829 // CHECK11: omp.body.continue:
2830 // CHECK11-NEXT: br label [[OMP_INNER_FOR_INC:%.*]]
2831 // CHECK11: omp.inner.for.inc:
2832 // CHECK11-NEXT: [[TMP10:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4
2833 // CHECK11-NEXT: [[ADD2:%.*]] = add nsw i32 [[TMP10]], 1
2834 // CHECK11-NEXT: store i32 [[ADD2]], ptr [[DOTOMP_IV]], align 4
2835 // CHECK11-NEXT: br label [[OMP_INNER_FOR_COND]]
2836 // CHECK11: omp.inner.for.end:
2837 // CHECK11-NEXT: br label [[OMP_LOOP_EXIT:%.*]]
2838 // CHECK11: omp.loop.exit:
2839 // CHECK11-NEXT: call void @__kmpc_for_static_fini(ptr @[[GLOB1]], i32 [[TMP2]])
2840 // CHECK11-NEXT: ret void
2843 // CHECK11-LABEL: define {{[^@]+}}@{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z5tmainIiLi10EEiT__l84
2844 // CHECK11-SAME: (ptr noundef nonnull align 4 dereferenceable(40) [[A:%.*]]) #[[ATTR2]] {
2845 // CHECK11-NEXT: entry:
2846 // CHECK11-NEXT: [[A_ADDR:%.*]] = alloca ptr, align 4
2847 // CHECK11-NEXT: store ptr [[A]], ptr [[A_ADDR]], align 4
2848 // CHECK11-NEXT: [[TMP0:%.*]] = load ptr, ptr [[A_ADDR]], align 4
2849 // CHECK11-NEXT: call void (ptr, i32, ptr, ...) @__kmpc_fork_teams(ptr @[[GLOB2]], i32 1, ptr @{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z5tmainIiLi10EEiT__l84.omp_outlined, ptr [[TMP0]])
2850 // CHECK11-NEXT: ret void
2853 // CHECK11-LABEL: define {{[^@]+}}@{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z5tmainIiLi10EEiT__l84.omp_outlined
2854 // CHECK11-SAME: (ptr noalias noundef [[DOTGLOBAL_TID_:%.*]], ptr noalias noundef [[DOTBOUND_TID_:%.*]], ptr noundef nonnull align 4 dereferenceable(40) [[A:%.*]]) #[[ATTR3]] {
2855 // CHECK11-NEXT: entry:
2856 // CHECK11-NEXT: [[DOTGLOBAL_TID__ADDR:%.*]] = alloca ptr, align 4
2857 // CHECK11-NEXT: [[DOTBOUND_TID__ADDR:%.*]] = alloca ptr, align 4
2858 // CHECK11-NEXT: [[A_ADDR:%.*]] = alloca ptr, align 4
2859 // CHECK11-NEXT: [[DOTOMP_IV:%.*]] = alloca i32, align 4
2860 // CHECK11-NEXT: [[TMP:%.*]] = alloca i32, align 4
2861 // CHECK11-NEXT: [[DOTOMP_LB:%.*]] = alloca i32, align 4
2862 // CHECK11-NEXT: [[DOTOMP_UB:%.*]] = alloca i32, align 4
2863 // CHECK11-NEXT: [[DOTOMP_STRIDE:%.*]] = alloca i32, align 4
2864 // CHECK11-NEXT: [[DOTOMP_IS_LAST:%.*]] = alloca i32, align 4
2865 // CHECK11-NEXT: [[I:%.*]] = alloca i32, align 4
2866 // CHECK11-NEXT: store ptr [[DOTGLOBAL_TID_]], ptr [[DOTGLOBAL_TID__ADDR]], align 4
2867 // CHECK11-NEXT: store ptr [[DOTBOUND_TID_]], ptr [[DOTBOUND_TID__ADDR]], align 4
2868 // CHECK11-NEXT: store ptr [[A]], ptr [[A_ADDR]], align 4
2869 // CHECK11-NEXT: [[TMP0:%.*]] = load ptr, ptr [[A_ADDR]], align 4
2870 // CHECK11-NEXT: store i32 0, ptr [[DOTOMP_LB]], align 4
2871 // CHECK11-NEXT: store i32 9, ptr [[DOTOMP_UB]], align 4
2872 // CHECK11-NEXT: store i32 1, ptr [[DOTOMP_STRIDE]], align 4
2873 // CHECK11-NEXT: store i32 0, ptr [[DOTOMP_IS_LAST]], align 4
2874 // CHECK11-NEXT: [[TMP1:%.*]] = load ptr, ptr [[DOTGLOBAL_TID__ADDR]], align 4
2875 // CHECK11-NEXT: [[TMP2:%.*]] = load i32, ptr [[TMP1]], align 4
2876 // CHECK11-NEXT: call void @__kmpc_for_static_init_4(ptr @[[GLOB1]], i32 [[TMP2]], i32 92, ptr [[DOTOMP_IS_LAST]], ptr [[DOTOMP_LB]], ptr [[DOTOMP_UB]], ptr [[DOTOMP_STRIDE]], i32 1, i32 1)
2877 // CHECK11-NEXT: [[TMP3:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4
2878 // CHECK11-NEXT: [[CMP:%.*]] = icmp sgt i32 [[TMP3]], 9
2879 // CHECK11-NEXT: br i1 [[CMP]], label [[COND_TRUE:%.*]], label [[COND_FALSE:%.*]]
2880 // CHECK11: cond.true:
2881 // CHECK11-NEXT: br label [[COND_END:%.*]]
2882 // CHECK11: cond.false:
2883 // CHECK11-NEXT: [[TMP4:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4
2884 // CHECK11-NEXT: br label [[COND_END]]
2885 // CHECK11: cond.end:
2886 // CHECK11-NEXT: [[COND:%.*]] = phi i32 [ 9, [[COND_TRUE]] ], [ [[TMP4]], [[COND_FALSE]] ]
2887 // CHECK11-NEXT: store i32 [[COND]], ptr [[DOTOMP_UB]], align 4
2888 // CHECK11-NEXT: [[TMP5:%.*]] = load i32, ptr [[DOTOMP_LB]], align 4
2889 // CHECK11-NEXT: store i32 [[TMP5]], ptr [[DOTOMP_IV]], align 4
2890 // CHECK11-NEXT: br label [[OMP_INNER_FOR_COND:%.*]]
2891 // CHECK11: omp.inner.for.cond:
2892 // CHECK11-NEXT: [[TMP6:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4
2893 // CHECK11-NEXT: [[TMP7:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4
2894 // CHECK11-NEXT: [[CMP1:%.*]] = icmp sle i32 [[TMP6]], [[TMP7]]
2895 // CHECK11-NEXT: br i1 [[CMP1]], label [[OMP_INNER_FOR_BODY:%.*]], label [[OMP_INNER_FOR_END:%.*]]
2896 // CHECK11: omp.inner.for.body:
2897 // CHECK11-NEXT: [[TMP8:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4
2898 // CHECK11-NEXT: [[MUL:%.*]] = mul nsw i32 [[TMP8]], 1
2899 // CHECK11-NEXT: [[ADD:%.*]] = add nsw i32 0, [[MUL]]
2900 // CHECK11-NEXT: store i32 [[ADD]], ptr [[I]], align 4
2901 // CHECK11-NEXT: [[TMP9:%.*]] = load i32, ptr [[I]], align 4
2902 // CHECK11-NEXT: [[ARRAYIDX:%.*]] = getelementptr inbounds [10 x i32], ptr [[TMP0]], i32 0, i32 [[TMP9]]
2903 // CHECK11-NEXT: store i32 0, ptr [[ARRAYIDX]], align 4
2904 // CHECK11-NEXT: br label [[OMP_BODY_CONTINUE:%.*]]
2905 // CHECK11: omp.body.continue:
2906 // CHECK11-NEXT: br label [[OMP_INNER_FOR_INC:%.*]]
2907 // CHECK11: omp.inner.for.inc:
2908 // CHECK11-NEXT: [[TMP10:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4
2909 // CHECK11-NEXT: [[ADD2:%.*]] = add nsw i32 [[TMP10]], 1
2910 // CHECK11-NEXT: store i32 [[ADD2]], ptr [[DOTOMP_IV]], align 4
2911 // CHECK11-NEXT: br label [[OMP_INNER_FOR_COND]]
2912 // CHECK11: omp.inner.for.end:
2913 // CHECK11-NEXT: br label [[OMP_LOOP_EXIT:%.*]]
2914 // CHECK11: omp.loop.exit:
2915 // CHECK11-NEXT: call void @__kmpc_for_static_fini(ptr @[[GLOB1]], i32 [[TMP2]])
2916 // CHECK11-NEXT: ret void
2919 // CHECK11-LABEL: define {{[^@]+}}@{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z5tmainIiLi10EEiT__l89
2920 // CHECK11-SAME: (ptr noundef nonnull align 4 dereferenceable(40) [[A:%.*]]) #[[ATTR2]] {
2921 // CHECK11-NEXT: entry:
2922 // CHECK11-NEXT: [[A_ADDR:%.*]] = alloca ptr, align 4
2923 // CHECK11-NEXT: store ptr [[A]], ptr [[A_ADDR]], align 4
2924 // CHECK11-NEXT: [[TMP0:%.*]] = load ptr, ptr [[A_ADDR]], align 4
2925 // CHECK11-NEXT: call void (ptr, i32, ptr, ...) @__kmpc_fork_teams(ptr @[[GLOB2]], i32 1, ptr @{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z5tmainIiLi10EEiT__l89.omp_outlined, ptr [[TMP0]])
2926 // CHECK11-NEXT: ret void
2929 // CHECK11-LABEL: define {{[^@]+}}@{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z5tmainIiLi10EEiT__l89.omp_outlined
2930 // CHECK11-SAME: (ptr noalias noundef [[DOTGLOBAL_TID_:%.*]], ptr noalias noundef [[DOTBOUND_TID_:%.*]], ptr noundef nonnull align 4 dereferenceable(40) [[A:%.*]]) #[[ATTR3]] {
2931 // CHECK11-NEXT: entry:
2932 // CHECK11-NEXT: [[DOTGLOBAL_TID__ADDR:%.*]] = alloca ptr, align 4
2933 // CHECK11-NEXT: [[DOTBOUND_TID__ADDR:%.*]] = alloca ptr, align 4
2934 // CHECK11-NEXT: [[A_ADDR:%.*]] = alloca ptr, align 4
2935 // CHECK11-NEXT: [[DOTOMP_IV:%.*]] = alloca i32, align 4
2936 // CHECK11-NEXT: [[TMP:%.*]] = alloca i32, align 4
2937 // CHECK11-NEXT: [[DOTOMP_LB:%.*]] = alloca i32, align 4
2938 // CHECK11-NEXT: [[DOTOMP_UB:%.*]] = alloca i32, align 4
2939 // CHECK11-NEXT: [[DOTOMP_STRIDE:%.*]] = alloca i32, align 4
2940 // CHECK11-NEXT: [[DOTOMP_IS_LAST:%.*]] = alloca i32, align 4
2941 // CHECK11-NEXT: [[I:%.*]] = alloca i32, align 4
2942 // CHECK11-NEXT: store ptr [[DOTGLOBAL_TID_]], ptr [[DOTGLOBAL_TID__ADDR]], align 4
2943 // CHECK11-NEXT: store ptr [[DOTBOUND_TID_]], ptr [[DOTBOUND_TID__ADDR]], align 4
2944 // CHECK11-NEXT: store ptr [[A]], ptr [[A_ADDR]], align 4
2945 // CHECK11-NEXT: [[TMP0:%.*]] = load ptr, ptr [[A_ADDR]], align 4
2946 // CHECK11-NEXT: store i32 0, ptr [[DOTOMP_LB]], align 4
2947 // CHECK11-NEXT: store i32 9, ptr [[DOTOMP_UB]], align 4
2948 // CHECK11-NEXT: store i32 1, ptr [[DOTOMP_STRIDE]], align 4
2949 // CHECK11-NEXT: store i32 0, ptr [[DOTOMP_IS_LAST]], align 4
2950 // CHECK11-NEXT: [[TMP1:%.*]] = load ptr, ptr [[DOTGLOBAL_TID__ADDR]], align 4
2951 // CHECK11-NEXT: [[TMP2:%.*]] = load i32, ptr [[TMP1]], align 4
2952 // CHECK11-NEXT: call void @__kmpc_for_static_init_4(ptr @[[GLOB1]], i32 [[TMP2]], i32 91, ptr [[DOTOMP_IS_LAST]], ptr [[DOTOMP_LB]], ptr [[DOTOMP_UB]], ptr [[DOTOMP_STRIDE]], i32 1, i32 10)
2953 // CHECK11-NEXT: br label [[OMP_DISPATCH_COND:%.*]]
2954 // CHECK11: omp.dispatch.cond:
2955 // CHECK11-NEXT: [[TMP3:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4
2956 // CHECK11-NEXT: [[CMP:%.*]] = icmp sgt i32 [[TMP3]], 9
2957 // CHECK11-NEXT: br i1 [[CMP]], label [[COND_TRUE:%.*]], label [[COND_FALSE:%.*]]
2958 // CHECK11: cond.true:
2959 // CHECK11-NEXT: br label [[COND_END:%.*]]
2960 // CHECK11: cond.false:
2961 // CHECK11-NEXT: [[TMP4:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4
2962 // CHECK11-NEXT: br label [[COND_END]]
2963 // CHECK11: cond.end:
2964 // CHECK11-NEXT: [[COND:%.*]] = phi i32 [ 9, [[COND_TRUE]] ], [ [[TMP4]], [[COND_FALSE]] ]
2965 // CHECK11-NEXT: store i32 [[COND]], ptr [[DOTOMP_UB]], align 4
2966 // CHECK11-NEXT: [[TMP5:%.*]] = load i32, ptr [[DOTOMP_LB]], align 4
2967 // CHECK11-NEXT: store i32 [[TMP5]], ptr [[DOTOMP_IV]], align 4
2968 // CHECK11-NEXT: [[TMP6:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4
2969 // CHECK11-NEXT: [[TMP7:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4
2970 // CHECK11-NEXT: [[CMP1:%.*]] = icmp sle i32 [[TMP6]], [[TMP7]]
2971 // CHECK11-NEXT: br i1 [[CMP1]], label [[OMP_DISPATCH_BODY:%.*]], label [[OMP_DISPATCH_END:%.*]]
2972 // CHECK11: omp.dispatch.body:
2973 // CHECK11-NEXT: br label [[OMP_INNER_FOR_COND:%.*]]
2974 // CHECK11: omp.inner.for.cond:
2975 // CHECK11-NEXT: [[TMP8:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP15:![0-9]+]]
2976 // CHECK11-NEXT: [[TMP9:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4, !llvm.access.group [[ACC_GRP15]]
2977 // CHECK11-NEXT: [[CMP2:%.*]] = icmp sle i32 [[TMP8]], [[TMP9]]
2978 // CHECK11-NEXT: br i1 [[CMP2]], label [[OMP_INNER_FOR_BODY:%.*]], label [[OMP_INNER_FOR_END:%.*]]
2979 // CHECK11: omp.inner.for.body:
2980 // CHECK11-NEXT: [[TMP10:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP15]]
2981 // CHECK11-NEXT: [[MUL:%.*]] = mul nsw i32 [[TMP10]], 1
2982 // CHECK11-NEXT: [[ADD:%.*]] = add nsw i32 0, [[MUL]]
2983 // CHECK11-NEXT: store i32 [[ADD]], ptr [[I]], align 4, !llvm.access.group [[ACC_GRP15]]
2984 // CHECK11-NEXT: [[TMP11:%.*]] = load i32, ptr [[I]], align 4, !llvm.access.group [[ACC_GRP15]]
2985 // CHECK11-NEXT: [[ARRAYIDX:%.*]] = getelementptr inbounds [10 x i32], ptr [[TMP0]], i32 0, i32 [[TMP11]]
2986 // CHECK11-NEXT: store i32 0, ptr [[ARRAYIDX]], align 4, !llvm.access.group [[ACC_GRP15]]
2987 // CHECK11-NEXT: br label [[OMP_BODY_CONTINUE:%.*]]
2988 // CHECK11: omp.body.continue:
2989 // CHECK11-NEXT: br label [[OMP_INNER_FOR_INC:%.*]]
2990 // CHECK11: omp.inner.for.inc:
2991 // CHECK11-NEXT: [[TMP12:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP15]]
2992 // CHECK11-NEXT: [[ADD3:%.*]] = add nsw i32 [[TMP12]], 1
2993 // CHECK11-NEXT: store i32 [[ADD3]], ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP15]]
2994 // CHECK11-NEXT: br label [[OMP_INNER_FOR_COND]], !llvm.loop [[LOOP16:![0-9]+]]
2995 // CHECK11: omp.inner.for.end:
2996 // CHECK11-NEXT: br label [[OMP_DISPATCH_INC:%.*]]
2997 // CHECK11: omp.dispatch.inc:
2998 // CHECK11-NEXT: [[TMP13:%.*]] = load i32, ptr [[DOTOMP_LB]], align 4
2999 // CHECK11-NEXT: [[TMP14:%.*]] = load i32, ptr [[DOTOMP_STRIDE]], align 4
3000 // CHECK11-NEXT: [[ADD4:%.*]] = add nsw i32 [[TMP13]], [[TMP14]]
3001 // CHECK11-NEXT: store i32 [[ADD4]], ptr [[DOTOMP_LB]], align 4
3002 // CHECK11-NEXT: [[TMP15:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4
3003 // CHECK11-NEXT: [[TMP16:%.*]] = load i32, ptr [[DOTOMP_STRIDE]], align 4
3004 // CHECK11-NEXT: [[ADD5:%.*]] = add nsw i32 [[TMP15]], [[TMP16]]
3005 // CHECK11-NEXT: store i32 [[ADD5]], ptr [[DOTOMP_UB]], align 4
3006 // CHECK11-NEXT: br label [[OMP_DISPATCH_COND]]
3007 // CHECK11: omp.dispatch.end:
3008 // CHECK11-NEXT: call void @__kmpc_for_static_fini(ptr @[[GLOB1]], i32 [[TMP2]])
3009 // CHECK11-NEXT: ret void
3012 // CHECK11-LABEL: define {{[^@]+}}@.omp_offloading.requires_reg
3013 // CHECK11-SAME: () #[[ATTR7:[0-9]+]] {
3014 // CHECK11-NEXT: entry:
3015 // CHECK11-NEXT: call void @__tgt_register_requires(i64 1)
3016 // CHECK11-NEXT: ret void