Run DCE after a LoopFlatten test to reduce spurious output [nfc]
[llvm-project.git] / clang / test / OpenMP / distribute_parallel_for_simd_if_codegen.cpp
blobde8d061aa6a6a090d038dc713ad9d7509a4fbe22
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 // RUN: %clang_cc1 -verify -fopenmp -fopenmp-version=45 -fopenmp-targets=powerpc64le-ibm-linux-gnu -x c++ -triple x86_64-unknown-unknown -emit-llvm %s -o - | FileCheck %s --check-prefix=CHECK1
3 // RUN: %clang_cc1 -fopenmp -fopenmp-version=45 -fopenmp-targets=powerpc64le-ibm-linux-gnu -x c++ -std=c++11 -triple x86_64-unknown-unknown -emit-pch -o %t %s
4 // RUN: %clang_cc1 -fopenmp -fopenmp-version=45 -fopenmp-targets=powerpc64le-ibm-linux-gnu -x c++ -triple x86_64-unknown-unknown -std=c++11 -include-pch %t -verify %s -emit-llvm -o - | FileCheck %s --check-prefix=CHECK1
5 // RUN: %clang_cc1 -verify -fopenmp -fopenmp-targets=powerpc64le-ibm-linux-gnu -x c++ -triple x86_64-unknown-unknown -emit-llvm %s -o - | FileCheck %s --check-prefix=CHECK3
6 // RUN: %clang_cc1 -fopenmp -fopenmp-targets=powerpc64le-ibm-linux-gnu -x c++ -std=c++11 -triple x86_64-unknown-unknown -emit-pch -o %t %s
7 // RUN: %clang_cc1 -fopenmp -fopenmp-targets=powerpc64le-ibm-linux-gnu -x c++ -triple x86_64-unknown-unknown -std=c++11 -include-pch %t -verify %s -emit-llvm -o - | FileCheck %s --check-prefix=CHECK3
9 // RUN: %clang_cc1 -verify -fopenmp-simd -fopenmp-version=45 -fopenmp-targets=powerpc64le-ibm-linux-gnu -x c++ -triple x86_64-unknown-unknown -emit-llvm %s -o - | FileCheck %s --check-prefix=CHECK5
10 // RUN: %clang_cc1 -fopenmp-simd -fopenmp-version=45 -fopenmp-targets=powerpc64le-ibm-linux-gnu -x c++ -std=c++11 -triple x86_64-unknown-unknown -emit-pch -o %t %s
11 // RUN: %clang_cc1 -fopenmp-simd -fopenmp-version=45 -fopenmp-targets=powerpc64le-ibm-linux-gnu -x c++ -triple x86_64-unknown-unknown -std=c++11 -include-pch %t -verify %s -emit-llvm -o - | FileCheck %s --check-prefix=CHECK5
12 // RUN: %clang_cc1 -verify -fopenmp-simd -fopenmp-targets=powerpc64le-ibm-linux-gnu -x c++ -triple x86_64-unknown-unknown -emit-llvm %s -o - | FileCheck %s --check-prefix=CHECK7
13 // RUN: %clang_cc1 -fopenmp-simd -fopenmp-targets=powerpc64le-ibm-linux-gnu -x c++ -std=c++11 -triple x86_64-unknown-unknown -emit-pch -o %t %s
14 // RUN: %clang_cc1 -fopenmp-simd -fopenmp-targets=powerpc64le-ibm-linux-gnu -x c++ -triple x86_64-unknown-unknown -std=c++11 -include-pch %t -verify %s -emit-llvm -o - | FileCheck %s --check-prefix=CHECK7
16 // RUN: %clang_cc1 -verify -fopenmp -fopenmp-version=45 -fopenmp-targets=powerpc64le-ibm-linux-gnu -x c++ -triple aarch64-unknown-unknown -emit-llvm %s -o - | FileCheck %s --check-prefix=CHECK9
17 // RUN: %clang_cc1 -fopenmp -fopenmp-version=45 -fopenmp-targets=powerpc64le-ibm-linux-gnu -x c++ -std=c++11 -triple aarch64-unknown-unknown -emit-pch -o %t %s
18 // RUN: %clang_cc1 -fopenmp -fopenmp-version=45 -fopenmp-targets=powerpc64le-ibm-linux-gnu -x c++ -triple aarch64-unknown-unknown -std=c++11 -include-pch %t -verify %s -emit-llvm -o - | FileCheck %s --check-prefix=CHECK9
19 // RUN: %clang_cc1 -verify -fopenmp -fopenmp-targets=powerpc64le-ibm-linux-gnu -x c++ -triple aarch64-unknown-unknown -emit-llvm %s -o - | FileCheck %s --check-prefix=CHECK11
20 // RUN: %clang_cc1 -fopenmp -fopenmp-targets=powerpc64le-ibm-linux-gnu -x c++ -std=c++11 -triple aarch64-unknown-unknown -emit-pch -o %t %s
21 // RUN: %clang_cc1 -fopenmp -fopenmp-targets=powerpc64le-ibm-linux-gnu -x c++ -triple aarch64-unknown-unknown -std=c++11 -include-pch %t -verify %s -emit-llvm -o - | FileCheck %s --check-prefix=CHECK11
23 // RUN: %clang_cc1 -verify -fopenmp-simd -fopenmp-version=45 -fopenmp-targets=powerpc64le-ibm-linux-gnu -x c++ -triple aarch64-unknown-unknown -emit-llvm %s -o - | FileCheck %s --check-prefix=CHECK13
24 // RUN: %clang_cc1 -fopenmp-simd -fopenmp-version=45 -fopenmp-targets=powerpc64le-ibm-linux-gnu -x c++ -std=c++11 -triple aarch64-unknown-unknown -emit-pch -o %t %s
25 // RUN: %clang_cc1 -fopenmp-simd -fopenmp-version=45 -fopenmp-targets=powerpc64le-ibm-linux-gnu -x c++ -triple aarch64-unknown-unknown -std=c++11 -include-pch %t -verify %s -emit-llvm -o - | FileCheck %s --check-prefix=CHECK13
26 // RUN: %clang_cc1 -verify -fopenmp-simd -fopenmp-targets=powerpc64le-ibm-linux-gnu -x c++ -triple aarch64-unknown-unknown -emit-llvm %s -o - | FileCheck %s --check-prefix=CHECK15
27 // RUN: %clang_cc1 -fopenmp-simd -fopenmp-targets=powerpc64le-ibm-linux-gnu -x c++ -std=c++11 -triple aarch64-unknown-unknown -emit-pch -o %t %s
28 // RUN: %clang_cc1 -fopenmp-simd -fopenmp-targets=powerpc64le-ibm-linux-gnu -x c++ -triple aarch64-unknown-unknown -std=c++11 -include-pch %t -verify %s -emit-llvm -o - | FileCheck %s --check-prefix=CHECK15
29 // expected-no-diagnostics
30 #ifndef HEADER
31 #define HEADER
33 void fn1();
34 void fn2();
35 void fn3();
36 void fn4();
37 void fn5();
38 void fn6();
40 int Arg;
42 void gtid_test() {
43 #pragma omp target
44 #pragma omp teams
45 #pragma omp distribute parallel for simd
46 for(int i = 0 ; i < 100; i++) {}
48 #pragma omp target
49 #pragma omp teams
50 #pragma omp distribute parallel for simd if (parallel: false)
51 for(int i = 0 ; i < 100; i++) {
52 gtid_test();
57 template <typename T>
58 int tmain(T Arg) {
59 #pragma omp target
60 #pragma omp teams
61 #pragma omp distribute parallel for simd if (true)
62 for(int i = 0 ; i < 100; i++) {
63 fn1();
65 #pragma omp target
66 #pragma omp teams
67 #pragma omp distribute parallel for simd if (false)
68 for(int i = 0 ; i < 100; i++) {
69 fn2();
71 #pragma omp target
72 #pragma omp teams
73 #pragma omp distribute parallel for simd if (parallel: Arg)
74 for(int i = 0 ; i < 100; i++) {
75 fn3();
77 return 0;
80 int main() {
81 #pragma omp target
82 #pragma omp teams
83 #pragma omp distribute parallel for simd if (true)
84 for(int i = 0 ; i < 100; i++) {
87 fn4();
90 #pragma omp target
91 #pragma omp teams
92 #pragma omp distribute parallel for simd if (false)
93 for(int i = 0 ; i < 100; i++) {
96 fn5();
99 #pragma omp target
100 #pragma omp teams
101 #pragma omp distribute parallel for simd if (Arg)
102 for(int i = 0 ; i < 100; i++) {
105 fn6();
108 return tmain(Arg);
116 // call void [[T_OUTLINE_FUN_3:@.+]](
119 #endif
120 // CHECK1-LABEL: define {{[^@]+}}@_Z9gtid_testv
121 // CHECK1-SAME: () #[[ATTR0:[0-9]+]] {
122 // CHECK1-NEXT: entry:
123 // CHECK1-NEXT: [[TMP:%.*]] = alloca i32, align 4
124 // CHECK1-NEXT: [[KERNEL_ARGS:%.*]] = alloca [[STRUCT___TGT_KERNEL_ARGUMENTS:%.*]], align 8
125 // CHECK1-NEXT: [[_TMP1:%.*]] = alloca i32, align 4
126 // CHECK1-NEXT: [[KERNEL_ARGS2:%.*]] = alloca [[STRUCT___TGT_KERNEL_ARGUMENTS]], align 8
127 // CHECK1-NEXT: [[TMP0:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 0
128 // CHECK1-NEXT: store i32 2, ptr [[TMP0]], align 4
129 // CHECK1-NEXT: [[TMP1:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 1
130 // CHECK1-NEXT: store i32 0, ptr [[TMP1]], align 4
131 // CHECK1-NEXT: [[TMP2:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 2
132 // CHECK1-NEXT: store ptr null, ptr [[TMP2]], align 8
133 // CHECK1-NEXT: [[TMP3:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 3
134 // CHECK1-NEXT: store ptr null, ptr [[TMP3]], align 8
135 // CHECK1-NEXT: [[TMP4:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 4
136 // CHECK1-NEXT: store ptr null, ptr [[TMP4]], align 8
137 // CHECK1-NEXT: [[TMP5:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 5
138 // CHECK1-NEXT: store ptr null, ptr [[TMP5]], align 8
139 // CHECK1-NEXT: [[TMP6:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 6
140 // CHECK1-NEXT: store ptr null, ptr [[TMP6]], align 8
141 // CHECK1-NEXT: [[TMP7:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 7
142 // CHECK1-NEXT: store ptr null, ptr [[TMP7]], align 8
143 // CHECK1-NEXT: [[TMP8:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 8
144 // CHECK1-NEXT: store i64 100, ptr [[TMP8]], align 8
145 // CHECK1-NEXT: [[TMP9:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 9
146 // CHECK1-NEXT: store i64 0, ptr [[TMP9]], align 8
147 // CHECK1-NEXT: [[TMP10:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 10
148 // CHECK1-NEXT: store [3 x i32] zeroinitializer, ptr [[TMP10]], align 4
149 // CHECK1-NEXT: [[TMP11:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 11
150 // CHECK1-NEXT: store [3 x i32] zeroinitializer, ptr [[TMP11]], align 4
151 // CHECK1-NEXT: [[TMP12:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 12
152 // CHECK1-NEXT: store i32 0, ptr [[TMP12]], align 4
153 // CHECK1-NEXT: [[TMP13:%.*]] = call i32 @__tgt_target_kernel(ptr @[[GLOB3:[0-9]+]], i64 -1, i32 0, i32 0, ptr @.{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z9gtid_testv_l43.region_id, ptr [[KERNEL_ARGS]])
154 // CHECK1-NEXT: [[TMP14:%.*]] = icmp ne i32 [[TMP13]], 0
155 // CHECK1-NEXT: br i1 [[TMP14]], label [[OMP_OFFLOAD_FAILED:%.*]], label [[OMP_OFFLOAD_CONT:%.*]]
156 // CHECK1: omp_offload.failed:
157 // CHECK1-NEXT: call void @{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z9gtid_testv_l43() #[[ATTR2:[0-9]+]]
158 // CHECK1-NEXT: br label [[OMP_OFFLOAD_CONT]]
159 // CHECK1: omp_offload.cont:
160 // CHECK1-NEXT: [[TMP15:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS2]], i32 0, i32 0
161 // CHECK1-NEXT: store i32 2, ptr [[TMP15]], align 4
162 // CHECK1-NEXT: [[TMP16:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS2]], i32 0, i32 1
163 // CHECK1-NEXT: store i32 0, ptr [[TMP16]], align 4
164 // CHECK1-NEXT: [[TMP17:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS2]], i32 0, i32 2
165 // CHECK1-NEXT: store ptr null, ptr [[TMP17]], align 8
166 // CHECK1-NEXT: [[TMP18:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS2]], i32 0, i32 3
167 // CHECK1-NEXT: store ptr null, ptr [[TMP18]], align 8
168 // CHECK1-NEXT: [[TMP19:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS2]], i32 0, i32 4
169 // CHECK1-NEXT: store ptr null, ptr [[TMP19]], align 8
170 // CHECK1-NEXT: [[TMP20:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS2]], i32 0, i32 5
171 // CHECK1-NEXT: store ptr null, ptr [[TMP20]], align 8
172 // CHECK1-NEXT: [[TMP21:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS2]], i32 0, i32 6
173 // CHECK1-NEXT: store ptr null, ptr [[TMP21]], align 8
174 // CHECK1-NEXT: [[TMP22:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS2]], i32 0, i32 7
175 // CHECK1-NEXT: store ptr null, ptr [[TMP22]], align 8
176 // CHECK1-NEXT: [[TMP23:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS2]], i32 0, i32 8
177 // CHECK1-NEXT: store i64 100, ptr [[TMP23]], align 8
178 // CHECK1-NEXT: [[TMP24:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS2]], i32 0, i32 9
179 // CHECK1-NEXT: store i64 0, ptr [[TMP24]], align 8
180 // CHECK1-NEXT: [[TMP25:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS2]], i32 0, i32 10
181 // CHECK1-NEXT: store [3 x i32] zeroinitializer, ptr [[TMP25]], align 4
182 // CHECK1-NEXT: [[TMP26:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS2]], i32 0, i32 11
183 // CHECK1-NEXT: store [3 x i32] zeroinitializer, ptr [[TMP26]], align 4
184 // CHECK1-NEXT: [[TMP27:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS2]], i32 0, i32 12
185 // CHECK1-NEXT: store i32 0, ptr [[TMP27]], align 4
186 // CHECK1-NEXT: [[TMP28:%.*]] = call i32 @__tgt_target_kernel(ptr @[[GLOB3]], i64 -1, i32 0, i32 0, ptr @.{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z9gtid_testv_l48.region_id, ptr [[KERNEL_ARGS2]])
187 // CHECK1-NEXT: [[TMP29:%.*]] = icmp ne i32 [[TMP28]], 0
188 // CHECK1-NEXT: br i1 [[TMP29]], label [[OMP_OFFLOAD_FAILED3:%.*]], label [[OMP_OFFLOAD_CONT4:%.*]]
189 // CHECK1: omp_offload.failed3:
190 // CHECK1-NEXT: call void @{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z9gtid_testv_l48() #[[ATTR2]]
191 // CHECK1-NEXT: br label [[OMP_OFFLOAD_CONT4]]
192 // CHECK1: omp_offload.cont4:
193 // CHECK1-NEXT: ret void
196 // CHECK1-LABEL: define {{[^@]+}}@{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z9gtid_testv_l43
197 // CHECK1-SAME: () #[[ATTR1:[0-9]+]] {
198 // CHECK1-NEXT: entry:
199 // CHECK1-NEXT: call void (ptr, i32, ptr, ...) @__kmpc_fork_teams(ptr @[[GLOB3]], i32 0, ptr @{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z9gtid_testv_l43.omp_outlined)
200 // CHECK1-NEXT: ret void
203 // CHECK1-LABEL: define {{[^@]+}}@{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z9gtid_testv_l43.omp_outlined
204 // CHECK1-SAME: (ptr noalias noundef [[DOTGLOBAL_TID_:%.*]], ptr noalias noundef [[DOTBOUND_TID_:%.*]]) #[[ATTR1]] {
205 // CHECK1-NEXT: entry:
206 // CHECK1-NEXT: [[DOTGLOBAL_TID__ADDR:%.*]] = alloca ptr, align 8
207 // CHECK1-NEXT: [[DOTBOUND_TID__ADDR:%.*]] = alloca ptr, align 8
208 // CHECK1-NEXT: [[DOTOMP_IV:%.*]] = alloca i32, align 4
209 // CHECK1-NEXT: [[TMP:%.*]] = alloca i32, align 4
210 // CHECK1-NEXT: [[DOTOMP_COMB_LB:%.*]] = alloca i32, align 4
211 // CHECK1-NEXT: [[DOTOMP_COMB_UB:%.*]] = alloca i32, align 4
212 // CHECK1-NEXT: [[DOTOMP_STRIDE:%.*]] = alloca i32, align 4
213 // CHECK1-NEXT: [[DOTOMP_IS_LAST:%.*]] = alloca i32, align 4
214 // CHECK1-NEXT: [[I:%.*]] = alloca i32, align 4
215 // CHECK1-NEXT: store ptr [[DOTGLOBAL_TID_]], ptr [[DOTGLOBAL_TID__ADDR]], align 8
216 // CHECK1-NEXT: store ptr [[DOTBOUND_TID_]], ptr [[DOTBOUND_TID__ADDR]], align 8
217 // CHECK1-NEXT: store i32 0, ptr [[DOTOMP_COMB_LB]], align 4
218 // CHECK1-NEXT: store i32 99, ptr [[DOTOMP_COMB_UB]], align 4
219 // CHECK1-NEXT: store i32 1, ptr [[DOTOMP_STRIDE]], align 4
220 // CHECK1-NEXT: store i32 0, ptr [[DOTOMP_IS_LAST]], align 4
221 // CHECK1-NEXT: [[TMP0:%.*]] = load ptr, ptr [[DOTGLOBAL_TID__ADDR]], align 8
222 // CHECK1-NEXT: [[TMP1:%.*]] = load i32, ptr [[TMP0]], align 4
223 // CHECK1-NEXT: call void @__kmpc_for_static_init_4(ptr @[[GLOB1:[0-9]+]], i32 [[TMP1]], i32 92, ptr [[DOTOMP_IS_LAST]], ptr [[DOTOMP_COMB_LB]], ptr [[DOTOMP_COMB_UB]], ptr [[DOTOMP_STRIDE]], i32 1, i32 1)
224 // CHECK1-NEXT: [[TMP2:%.*]] = load i32, ptr [[DOTOMP_COMB_UB]], align 4
225 // CHECK1-NEXT: [[CMP:%.*]] = icmp sgt i32 [[TMP2]], 99
226 // CHECK1-NEXT: br i1 [[CMP]], label [[COND_TRUE:%.*]], label [[COND_FALSE:%.*]]
227 // CHECK1: cond.true:
228 // CHECK1-NEXT: br label [[COND_END:%.*]]
229 // CHECK1: cond.false:
230 // CHECK1-NEXT: [[TMP3:%.*]] = load i32, ptr [[DOTOMP_COMB_UB]], align 4
231 // CHECK1-NEXT: br label [[COND_END]]
232 // CHECK1: cond.end:
233 // CHECK1-NEXT: [[COND:%.*]] = phi i32 [ 99, [[COND_TRUE]] ], [ [[TMP3]], [[COND_FALSE]] ]
234 // CHECK1-NEXT: store i32 [[COND]], ptr [[DOTOMP_COMB_UB]], align 4
235 // CHECK1-NEXT: [[TMP4:%.*]] = load i32, ptr [[DOTOMP_COMB_LB]], align 4
236 // CHECK1-NEXT: store i32 [[TMP4]], ptr [[DOTOMP_IV]], align 4
237 // CHECK1-NEXT: br label [[OMP_INNER_FOR_COND:%.*]]
238 // CHECK1: omp.inner.for.cond:
239 // CHECK1-NEXT: [[TMP5:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP11:![0-9]+]]
240 // CHECK1-NEXT: [[TMP6:%.*]] = load i32, ptr [[DOTOMP_COMB_UB]], align 4, !llvm.access.group [[ACC_GRP11]]
241 // CHECK1-NEXT: [[CMP1:%.*]] = icmp sle i32 [[TMP5]], [[TMP6]]
242 // CHECK1-NEXT: br i1 [[CMP1]], label [[OMP_INNER_FOR_BODY:%.*]], label [[OMP_INNER_FOR_END:%.*]]
243 // CHECK1: omp.inner.for.body:
244 // CHECK1-NEXT: [[TMP7:%.*]] = load i32, ptr [[DOTOMP_COMB_LB]], align 4, !llvm.access.group [[ACC_GRP11]]
245 // CHECK1-NEXT: [[TMP8:%.*]] = zext i32 [[TMP7]] to i64
246 // CHECK1-NEXT: [[TMP9:%.*]] = load i32, ptr [[DOTOMP_COMB_UB]], align 4, !llvm.access.group [[ACC_GRP11]]
247 // CHECK1-NEXT: [[TMP10:%.*]] = zext i32 [[TMP9]] to i64
248 // CHECK1-NEXT: call void (ptr, i32, ptr, ...) @__kmpc_fork_call(ptr @[[GLOB3]], i32 2, ptr @{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z9gtid_testv_l43.omp_outlined.omp_outlined, i64 [[TMP8]], i64 [[TMP10]]), !llvm.access.group [[ACC_GRP11]]
249 // CHECK1-NEXT: br label [[OMP_INNER_FOR_INC:%.*]]
250 // CHECK1: omp.inner.for.inc:
251 // CHECK1-NEXT: [[TMP11:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP11]]
252 // CHECK1-NEXT: [[TMP12:%.*]] = load i32, ptr [[DOTOMP_STRIDE]], align 4, !llvm.access.group [[ACC_GRP11]]
253 // CHECK1-NEXT: [[ADD:%.*]] = add nsw i32 [[TMP11]], [[TMP12]]
254 // CHECK1-NEXT: store i32 [[ADD]], ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP11]]
255 // CHECK1-NEXT: br label [[OMP_INNER_FOR_COND]], !llvm.loop [[LOOP12:![0-9]+]]
256 // CHECK1: omp.inner.for.end:
257 // CHECK1-NEXT: br label [[OMP_LOOP_EXIT:%.*]]
258 // CHECK1: omp.loop.exit:
259 // CHECK1-NEXT: call void @__kmpc_for_static_fini(ptr @[[GLOB1]], i32 [[TMP1]])
260 // CHECK1-NEXT: [[TMP13:%.*]] = load i32, ptr [[DOTOMP_IS_LAST]], align 4
261 // CHECK1-NEXT: [[TMP14:%.*]] = icmp ne i32 [[TMP13]], 0
262 // CHECK1-NEXT: br i1 [[TMP14]], label [[DOTOMP_FINAL_THEN:%.*]], label [[DOTOMP_FINAL_DONE:%.*]]
263 // CHECK1: .omp.final.then:
264 // CHECK1-NEXT: store i32 100, ptr [[I]], align 4
265 // CHECK1-NEXT: br label [[DOTOMP_FINAL_DONE]]
266 // CHECK1: .omp.final.done:
267 // CHECK1-NEXT: ret void
270 // CHECK1-LABEL: define {{[^@]+}}@{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z9gtid_testv_l43.omp_outlined.omp_outlined
271 // CHECK1-SAME: (ptr noalias noundef [[DOTGLOBAL_TID_:%.*]], ptr noalias noundef [[DOTBOUND_TID_:%.*]], i64 noundef [[DOTPREVIOUS_LB_:%.*]], i64 noundef [[DOTPREVIOUS_UB_:%.*]]) #[[ATTR1]] {
272 // CHECK1-NEXT: entry:
273 // CHECK1-NEXT: [[DOTGLOBAL_TID__ADDR:%.*]] = alloca ptr, align 8
274 // CHECK1-NEXT: [[DOTBOUND_TID__ADDR:%.*]] = alloca ptr, align 8
275 // CHECK1-NEXT: [[DOTPREVIOUS_LB__ADDR:%.*]] = alloca i64, align 8
276 // CHECK1-NEXT: [[DOTPREVIOUS_UB__ADDR:%.*]] = alloca i64, align 8
277 // CHECK1-NEXT: [[DOTOMP_IV:%.*]] = alloca i32, align 4
278 // CHECK1-NEXT: [[TMP:%.*]] = alloca i32, align 4
279 // CHECK1-NEXT: [[DOTOMP_LB:%.*]] = alloca i32, align 4
280 // CHECK1-NEXT: [[DOTOMP_UB:%.*]] = alloca i32, align 4
281 // CHECK1-NEXT: [[DOTOMP_STRIDE:%.*]] = alloca i32, align 4
282 // CHECK1-NEXT: [[DOTOMP_IS_LAST:%.*]] = alloca i32, align 4
283 // CHECK1-NEXT: [[I:%.*]] = alloca i32, align 4
284 // CHECK1-NEXT: store ptr [[DOTGLOBAL_TID_]], ptr [[DOTGLOBAL_TID__ADDR]], align 8
285 // CHECK1-NEXT: store ptr [[DOTBOUND_TID_]], ptr [[DOTBOUND_TID__ADDR]], align 8
286 // CHECK1-NEXT: store i64 [[DOTPREVIOUS_LB_]], ptr [[DOTPREVIOUS_LB__ADDR]], align 8
287 // CHECK1-NEXT: store i64 [[DOTPREVIOUS_UB_]], ptr [[DOTPREVIOUS_UB__ADDR]], align 8
288 // CHECK1-NEXT: store i32 0, ptr [[DOTOMP_LB]], align 4
289 // CHECK1-NEXT: store i32 99, ptr [[DOTOMP_UB]], align 4
290 // CHECK1-NEXT: [[TMP0:%.*]] = load i64, ptr [[DOTPREVIOUS_LB__ADDR]], align 8
291 // CHECK1-NEXT: [[CONV:%.*]] = trunc i64 [[TMP0]] to i32
292 // CHECK1-NEXT: [[TMP1:%.*]] = load i64, ptr [[DOTPREVIOUS_UB__ADDR]], align 8
293 // CHECK1-NEXT: [[CONV1:%.*]] = trunc i64 [[TMP1]] to i32
294 // CHECK1-NEXT: store i32 [[CONV]], ptr [[DOTOMP_LB]], align 4
295 // CHECK1-NEXT: store i32 [[CONV1]], ptr [[DOTOMP_UB]], align 4
296 // CHECK1-NEXT: store i32 1, ptr [[DOTOMP_STRIDE]], align 4
297 // CHECK1-NEXT: store i32 0, ptr [[DOTOMP_IS_LAST]], align 4
298 // CHECK1-NEXT: [[TMP2:%.*]] = load ptr, ptr [[DOTGLOBAL_TID__ADDR]], align 8
299 // CHECK1-NEXT: [[TMP3:%.*]] = load i32, ptr [[TMP2]], align 4
300 // CHECK1-NEXT: call void @__kmpc_for_static_init_4(ptr @[[GLOB2:[0-9]+]], i32 [[TMP3]], i32 34, ptr [[DOTOMP_IS_LAST]], ptr [[DOTOMP_LB]], ptr [[DOTOMP_UB]], ptr [[DOTOMP_STRIDE]], i32 1, i32 1)
301 // CHECK1-NEXT: [[TMP4:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4
302 // CHECK1-NEXT: [[CMP:%.*]] = icmp sgt i32 [[TMP4]], 99
303 // CHECK1-NEXT: br i1 [[CMP]], label [[COND_TRUE:%.*]], label [[COND_FALSE:%.*]]
304 // CHECK1: cond.true:
305 // CHECK1-NEXT: br label [[COND_END:%.*]]
306 // CHECK1: cond.false:
307 // CHECK1-NEXT: [[TMP5:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4
308 // CHECK1-NEXT: br label [[COND_END]]
309 // CHECK1: cond.end:
310 // CHECK1-NEXT: [[COND:%.*]] = phi i32 [ 99, [[COND_TRUE]] ], [ [[TMP5]], [[COND_FALSE]] ]
311 // CHECK1-NEXT: store i32 [[COND]], ptr [[DOTOMP_UB]], align 4
312 // CHECK1-NEXT: [[TMP6:%.*]] = load i32, ptr [[DOTOMP_LB]], align 4
313 // CHECK1-NEXT: store i32 [[TMP6]], ptr [[DOTOMP_IV]], align 4
314 // CHECK1-NEXT: br label [[OMP_INNER_FOR_COND:%.*]]
315 // CHECK1: omp.inner.for.cond:
316 // CHECK1-NEXT: [[TMP7:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP15:![0-9]+]]
317 // CHECK1-NEXT: [[TMP8:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4, !llvm.access.group [[ACC_GRP15]]
318 // CHECK1-NEXT: [[CMP2:%.*]] = icmp sle i32 [[TMP7]], [[TMP8]]
319 // CHECK1-NEXT: br i1 [[CMP2]], label [[OMP_INNER_FOR_BODY:%.*]], label [[OMP_INNER_FOR_END:%.*]]
320 // CHECK1: omp.inner.for.body:
321 // CHECK1-NEXT: [[TMP9:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP15]]
322 // CHECK1-NEXT: [[MUL:%.*]] = mul nsw i32 [[TMP9]], 1
323 // CHECK1-NEXT: [[ADD:%.*]] = add nsw i32 0, [[MUL]]
324 // CHECK1-NEXT: store i32 [[ADD]], ptr [[I]], align 4, !llvm.access.group [[ACC_GRP15]]
325 // CHECK1-NEXT: br label [[OMP_BODY_CONTINUE:%.*]]
326 // CHECK1: omp.body.continue:
327 // CHECK1-NEXT: br label [[OMP_INNER_FOR_INC:%.*]]
328 // CHECK1: omp.inner.for.inc:
329 // CHECK1-NEXT: [[TMP10:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP15]]
330 // CHECK1-NEXT: [[ADD3:%.*]] = add nsw i32 [[TMP10]], 1
331 // CHECK1-NEXT: store i32 [[ADD3]], ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP15]]
332 // CHECK1-NEXT: br label [[OMP_INNER_FOR_COND]], !llvm.loop [[LOOP16:![0-9]+]]
333 // CHECK1: omp.inner.for.end:
334 // CHECK1-NEXT: br label [[OMP_LOOP_EXIT:%.*]]
335 // CHECK1: omp.loop.exit:
336 // CHECK1-NEXT: call void @__kmpc_for_static_fini(ptr @[[GLOB1]], i32 [[TMP3]])
337 // CHECK1-NEXT: [[TMP11:%.*]] = load i32, ptr [[DOTOMP_IS_LAST]], align 4
338 // CHECK1-NEXT: [[TMP12:%.*]] = icmp ne i32 [[TMP11]], 0
339 // CHECK1-NEXT: br i1 [[TMP12]], label [[DOTOMP_FINAL_THEN:%.*]], label [[DOTOMP_FINAL_DONE:%.*]]
340 // CHECK1: .omp.final.then:
341 // CHECK1-NEXT: store i32 100, ptr [[I]], align 4
342 // CHECK1-NEXT: br label [[DOTOMP_FINAL_DONE]]
343 // CHECK1: .omp.final.done:
344 // CHECK1-NEXT: ret void
347 // CHECK1-LABEL: define {{[^@]+}}@{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z9gtid_testv_l48
348 // CHECK1-SAME: () #[[ATTR1]] {
349 // CHECK1-NEXT: entry:
350 // CHECK1-NEXT: call void (ptr, i32, ptr, ...) @__kmpc_fork_teams(ptr @[[GLOB3]], i32 0, ptr @{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z9gtid_testv_l48.omp_outlined)
351 // CHECK1-NEXT: ret void
354 // CHECK1-LABEL: define {{[^@]+}}@{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z9gtid_testv_l48.omp_outlined
355 // CHECK1-SAME: (ptr noalias noundef [[DOTGLOBAL_TID_:%.*]], ptr noalias noundef [[DOTBOUND_TID_:%.*]]) #[[ATTR1]] {
356 // CHECK1-NEXT: entry:
357 // CHECK1-NEXT: [[DOTGLOBAL_TID__ADDR:%.*]] = alloca ptr, align 8
358 // CHECK1-NEXT: [[DOTBOUND_TID__ADDR:%.*]] = alloca ptr, align 8
359 // CHECK1-NEXT: [[DOTOMP_IV:%.*]] = alloca i32, align 4
360 // CHECK1-NEXT: [[TMP:%.*]] = alloca i32, align 4
361 // CHECK1-NEXT: [[DOTOMP_COMB_LB:%.*]] = alloca i32, align 4
362 // CHECK1-NEXT: [[DOTOMP_COMB_UB:%.*]] = alloca i32, align 4
363 // CHECK1-NEXT: [[DOTOMP_STRIDE:%.*]] = alloca i32, align 4
364 // CHECK1-NEXT: [[DOTOMP_IS_LAST:%.*]] = alloca i32, align 4
365 // CHECK1-NEXT: [[I:%.*]] = alloca i32, align 4
366 // CHECK1-NEXT: [[DOTBOUND_ZERO_ADDR:%.*]] = alloca i32, align 4
367 // CHECK1-NEXT: store ptr [[DOTGLOBAL_TID_]], ptr [[DOTGLOBAL_TID__ADDR]], align 8
368 // CHECK1-NEXT: store ptr [[DOTBOUND_TID_]], ptr [[DOTBOUND_TID__ADDR]], align 8
369 // CHECK1-NEXT: store i32 0, ptr [[DOTOMP_COMB_LB]], align 4
370 // CHECK1-NEXT: store i32 99, ptr [[DOTOMP_COMB_UB]], align 4
371 // CHECK1-NEXT: store i32 1, ptr [[DOTOMP_STRIDE]], align 4
372 // CHECK1-NEXT: store i32 0, ptr [[DOTOMP_IS_LAST]], align 4
373 // CHECK1-NEXT: [[TMP0:%.*]] = load ptr, ptr [[DOTGLOBAL_TID__ADDR]], align 8
374 // CHECK1-NEXT: [[TMP1:%.*]] = load i32, ptr [[TMP0]], align 4
375 // CHECK1-NEXT: call void @__kmpc_for_static_init_4(ptr @[[GLOB1]], i32 [[TMP1]], i32 92, ptr [[DOTOMP_IS_LAST]], ptr [[DOTOMP_COMB_LB]], ptr [[DOTOMP_COMB_UB]], ptr [[DOTOMP_STRIDE]], i32 1, i32 1)
376 // CHECK1-NEXT: [[TMP2:%.*]] = load i32, ptr [[DOTOMP_COMB_UB]], align 4
377 // CHECK1-NEXT: [[CMP:%.*]] = icmp sgt i32 [[TMP2]], 99
378 // CHECK1-NEXT: br i1 [[CMP]], label [[COND_TRUE:%.*]], label [[COND_FALSE:%.*]]
379 // CHECK1: cond.true:
380 // CHECK1-NEXT: br label [[COND_END:%.*]]
381 // CHECK1: cond.false:
382 // CHECK1-NEXT: [[TMP3:%.*]] = load i32, ptr [[DOTOMP_COMB_UB]], align 4
383 // CHECK1-NEXT: br label [[COND_END]]
384 // CHECK1: cond.end:
385 // CHECK1-NEXT: [[COND:%.*]] = phi i32 [ 99, [[COND_TRUE]] ], [ [[TMP3]], [[COND_FALSE]] ]
386 // CHECK1-NEXT: store i32 [[COND]], ptr [[DOTOMP_COMB_UB]], align 4
387 // CHECK1-NEXT: [[TMP4:%.*]] = load i32, ptr [[DOTOMP_COMB_LB]], align 4
388 // CHECK1-NEXT: store i32 [[TMP4]], ptr [[DOTOMP_IV]], align 4
389 // CHECK1-NEXT: br label [[OMP_INNER_FOR_COND:%.*]]
390 // CHECK1: omp.inner.for.cond:
391 // CHECK1-NEXT: [[TMP5:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP20:![0-9]+]]
392 // CHECK1-NEXT: [[TMP6:%.*]] = load i32, ptr [[DOTOMP_COMB_UB]], align 4, !llvm.access.group [[ACC_GRP20]]
393 // CHECK1-NEXT: [[CMP1:%.*]] = icmp sle i32 [[TMP5]], [[TMP6]]
394 // CHECK1-NEXT: br i1 [[CMP1]], label [[OMP_INNER_FOR_BODY:%.*]], label [[OMP_INNER_FOR_END:%.*]]
395 // CHECK1: omp.inner.for.body:
396 // CHECK1-NEXT: [[TMP7:%.*]] = load i32, ptr [[DOTOMP_COMB_LB]], align 4, !llvm.access.group [[ACC_GRP20]]
397 // CHECK1-NEXT: [[TMP8:%.*]] = zext i32 [[TMP7]] to i64
398 // CHECK1-NEXT: [[TMP9:%.*]] = load i32, ptr [[DOTOMP_COMB_UB]], align 4, !llvm.access.group [[ACC_GRP20]]
399 // CHECK1-NEXT: [[TMP10:%.*]] = zext i32 [[TMP9]] to i64
400 // CHECK1-NEXT: call void @__kmpc_serialized_parallel(ptr @[[GLOB3]], i32 [[TMP1]]), !llvm.access.group [[ACC_GRP20]]
401 // CHECK1-NEXT: [[TMP11:%.*]] = load ptr, ptr [[DOTGLOBAL_TID__ADDR]], align 8, !llvm.access.group [[ACC_GRP20]]
402 // CHECK1-NEXT: store i32 0, ptr [[DOTBOUND_ZERO_ADDR]], align 4, !llvm.access.group [[ACC_GRP20]]
403 // CHECK1-NEXT: call void @{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z9gtid_testv_l48.omp_outlined.omp_outlined(ptr [[TMP11]], ptr [[DOTBOUND_ZERO_ADDR]], i64 [[TMP8]], i64 [[TMP10]]) #[[ATTR2]], !llvm.access.group [[ACC_GRP20]]
404 // CHECK1-NEXT: call void @__kmpc_end_serialized_parallel(ptr @[[GLOB3]], i32 [[TMP1]]), !llvm.access.group [[ACC_GRP20]]
405 // CHECK1-NEXT: br label [[OMP_INNER_FOR_INC:%.*]]
406 // CHECK1: omp.inner.for.inc:
407 // CHECK1-NEXT: [[TMP12:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP20]]
408 // CHECK1-NEXT: [[TMP13:%.*]] = load i32, ptr [[DOTOMP_STRIDE]], align 4, !llvm.access.group [[ACC_GRP20]]
409 // CHECK1-NEXT: [[ADD:%.*]] = add nsw i32 [[TMP12]], [[TMP13]]
410 // CHECK1-NEXT: store i32 [[ADD]], ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP20]]
411 // CHECK1-NEXT: br label [[OMP_INNER_FOR_COND]], !llvm.loop [[LOOP21:![0-9]+]]
412 // CHECK1: omp.inner.for.end:
413 // CHECK1-NEXT: br label [[OMP_LOOP_EXIT:%.*]]
414 // CHECK1: omp.loop.exit:
415 // CHECK1-NEXT: call void @__kmpc_for_static_fini(ptr @[[GLOB1]], i32 [[TMP1]])
416 // CHECK1-NEXT: [[TMP14:%.*]] = load i32, ptr [[DOTOMP_IS_LAST]], align 4
417 // CHECK1-NEXT: [[TMP15:%.*]] = icmp ne i32 [[TMP14]], 0
418 // CHECK1-NEXT: br i1 [[TMP15]], label [[DOTOMP_FINAL_THEN:%.*]], label [[DOTOMP_FINAL_DONE:%.*]]
419 // CHECK1: .omp.final.then:
420 // CHECK1-NEXT: store i32 100, ptr [[I]], align 4
421 // CHECK1-NEXT: br label [[DOTOMP_FINAL_DONE]]
422 // CHECK1: .omp.final.done:
423 // CHECK1-NEXT: ret void
426 // CHECK1-LABEL: define {{[^@]+}}@{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z9gtid_testv_l48.omp_outlined.omp_outlined
427 // CHECK1-SAME: (ptr noalias noundef [[DOTGLOBAL_TID_:%.*]], ptr noalias noundef [[DOTBOUND_TID_:%.*]], i64 noundef [[DOTPREVIOUS_LB_:%.*]], i64 noundef [[DOTPREVIOUS_UB_:%.*]]) #[[ATTR1]] {
428 // CHECK1-NEXT: entry:
429 // CHECK1-NEXT: [[DOTGLOBAL_TID__ADDR:%.*]] = alloca ptr, align 8
430 // CHECK1-NEXT: [[DOTBOUND_TID__ADDR:%.*]] = alloca ptr, align 8
431 // CHECK1-NEXT: [[DOTPREVIOUS_LB__ADDR:%.*]] = alloca i64, align 8
432 // CHECK1-NEXT: [[DOTPREVIOUS_UB__ADDR:%.*]] = alloca i64, align 8
433 // CHECK1-NEXT: [[DOTOMP_IV:%.*]] = alloca i32, align 4
434 // CHECK1-NEXT: [[TMP:%.*]] = alloca i32, align 4
435 // CHECK1-NEXT: [[DOTOMP_LB:%.*]] = alloca i32, align 4
436 // CHECK1-NEXT: [[DOTOMP_UB:%.*]] = alloca i32, align 4
437 // CHECK1-NEXT: [[DOTOMP_STRIDE:%.*]] = alloca i32, align 4
438 // CHECK1-NEXT: [[DOTOMP_IS_LAST:%.*]] = alloca i32, align 4
439 // CHECK1-NEXT: [[I:%.*]] = alloca i32, align 4
440 // CHECK1-NEXT: store ptr [[DOTGLOBAL_TID_]], ptr [[DOTGLOBAL_TID__ADDR]], align 8
441 // CHECK1-NEXT: store ptr [[DOTBOUND_TID_]], ptr [[DOTBOUND_TID__ADDR]], align 8
442 // CHECK1-NEXT: store i64 [[DOTPREVIOUS_LB_]], ptr [[DOTPREVIOUS_LB__ADDR]], align 8
443 // CHECK1-NEXT: store i64 [[DOTPREVIOUS_UB_]], ptr [[DOTPREVIOUS_UB__ADDR]], align 8
444 // CHECK1-NEXT: store i32 0, ptr [[DOTOMP_LB]], align 4
445 // CHECK1-NEXT: store i32 99, ptr [[DOTOMP_UB]], align 4
446 // CHECK1-NEXT: [[TMP0:%.*]] = load i64, ptr [[DOTPREVIOUS_LB__ADDR]], align 8
447 // CHECK1-NEXT: [[CONV:%.*]] = trunc i64 [[TMP0]] to i32
448 // CHECK1-NEXT: [[TMP1:%.*]] = load i64, ptr [[DOTPREVIOUS_UB__ADDR]], align 8
449 // CHECK1-NEXT: [[CONV1:%.*]] = trunc i64 [[TMP1]] to i32
450 // CHECK1-NEXT: store i32 [[CONV]], ptr [[DOTOMP_LB]], align 4
451 // CHECK1-NEXT: store i32 [[CONV1]], ptr [[DOTOMP_UB]], align 4
452 // CHECK1-NEXT: store i32 1, ptr [[DOTOMP_STRIDE]], align 4
453 // CHECK1-NEXT: store i32 0, ptr [[DOTOMP_IS_LAST]], align 4
454 // CHECK1-NEXT: [[TMP2:%.*]] = load ptr, ptr [[DOTGLOBAL_TID__ADDR]], align 8
455 // CHECK1-NEXT: [[TMP3:%.*]] = load i32, ptr [[TMP2]], align 4
456 // CHECK1-NEXT: call void @__kmpc_for_static_init_4(ptr @[[GLOB2]], i32 [[TMP3]], i32 34, ptr [[DOTOMP_IS_LAST]], ptr [[DOTOMP_LB]], ptr [[DOTOMP_UB]], ptr [[DOTOMP_STRIDE]], i32 1, i32 1)
457 // CHECK1-NEXT: [[TMP4:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4
458 // CHECK1-NEXT: [[CMP:%.*]] = icmp sgt i32 [[TMP4]], 99
459 // CHECK1-NEXT: br i1 [[CMP]], label [[COND_TRUE:%.*]], label [[COND_FALSE:%.*]]
460 // CHECK1: cond.true:
461 // CHECK1-NEXT: br label [[COND_END:%.*]]
462 // CHECK1: cond.false:
463 // CHECK1-NEXT: [[TMP5:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4
464 // CHECK1-NEXT: br label [[COND_END]]
465 // CHECK1: cond.end:
466 // CHECK1-NEXT: [[COND:%.*]] = phi i32 [ 99, [[COND_TRUE]] ], [ [[TMP5]], [[COND_FALSE]] ]
467 // CHECK1-NEXT: store i32 [[COND]], ptr [[DOTOMP_UB]], align 4
468 // CHECK1-NEXT: [[TMP6:%.*]] = load i32, ptr [[DOTOMP_LB]], align 4
469 // CHECK1-NEXT: store i32 [[TMP6]], ptr [[DOTOMP_IV]], align 4
470 // CHECK1-NEXT: br label [[OMP_INNER_FOR_COND:%.*]]
471 // CHECK1: omp.inner.for.cond:
472 // CHECK1-NEXT: [[TMP7:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP23:![0-9]+]]
473 // CHECK1-NEXT: [[TMP8:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4, !llvm.access.group [[ACC_GRP23]]
474 // CHECK1-NEXT: [[CMP2:%.*]] = icmp sle i32 [[TMP7]], [[TMP8]]
475 // CHECK1-NEXT: br i1 [[CMP2]], label [[OMP_INNER_FOR_BODY:%.*]], label [[OMP_INNER_FOR_END:%.*]]
476 // CHECK1: omp.inner.for.body:
477 // CHECK1-NEXT: [[TMP9:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP23]]
478 // CHECK1-NEXT: [[MUL:%.*]] = mul nsw i32 [[TMP9]], 1
479 // CHECK1-NEXT: [[ADD:%.*]] = add nsw i32 0, [[MUL]]
480 // CHECK1-NEXT: store i32 [[ADD]], ptr [[I]], align 4, !llvm.access.group [[ACC_GRP23]]
481 // CHECK1-NEXT: call void @_Z9gtid_testv(), !llvm.access.group [[ACC_GRP23]]
482 // CHECK1-NEXT: br label [[OMP_BODY_CONTINUE:%.*]]
483 // CHECK1: omp.body.continue:
484 // CHECK1-NEXT: br label [[OMP_INNER_FOR_INC:%.*]]
485 // CHECK1: omp.inner.for.inc:
486 // CHECK1-NEXT: [[TMP10:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP23]]
487 // CHECK1-NEXT: [[ADD3:%.*]] = add nsw i32 [[TMP10]], 1
488 // CHECK1-NEXT: store i32 [[ADD3]], ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP23]]
489 // CHECK1-NEXT: br label [[OMP_INNER_FOR_COND]], !llvm.loop [[LOOP24:![0-9]+]]
490 // CHECK1: omp.inner.for.end:
491 // CHECK1-NEXT: br label [[OMP_LOOP_EXIT:%.*]]
492 // CHECK1: omp.loop.exit:
493 // CHECK1-NEXT: call void @__kmpc_for_static_fini(ptr @[[GLOB1]], i32 [[TMP3]])
494 // CHECK1-NEXT: [[TMP11:%.*]] = load i32, ptr [[DOTOMP_IS_LAST]], align 4
495 // CHECK1-NEXT: [[TMP12:%.*]] = icmp ne i32 [[TMP11]], 0
496 // CHECK1-NEXT: br i1 [[TMP12]], label [[DOTOMP_FINAL_THEN:%.*]], label [[DOTOMP_FINAL_DONE:%.*]]
497 // CHECK1: .omp.final.then:
498 // CHECK1-NEXT: store i32 100, ptr [[I]], align 4
499 // CHECK1-NEXT: br label [[DOTOMP_FINAL_DONE]]
500 // CHECK1: .omp.final.done:
501 // CHECK1-NEXT: ret void
504 // CHECK1-LABEL: define {{[^@]+}}@main
505 // CHECK1-SAME: () #[[ATTR3:[0-9]+]] {
506 // CHECK1-NEXT: entry:
507 // CHECK1-NEXT: [[RETVAL:%.*]] = alloca i32, align 4
508 // CHECK1-NEXT: [[TMP:%.*]] = alloca i32, align 4
509 // CHECK1-NEXT: [[KERNEL_ARGS:%.*]] = alloca [[STRUCT___TGT_KERNEL_ARGUMENTS:%.*]], align 8
510 // CHECK1-NEXT: [[_TMP1:%.*]] = alloca i32, align 4
511 // CHECK1-NEXT: [[KERNEL_ARGS2:%.*]] = alloca [[STRUCT___TGT_KERNEL_ARGUMENTS]], align 8
512 // CHECK1-NEXT: [[ARG_CASTED:%.*]] = alloca i64, align 8
513 // CHECK1-NEXT: [[DOTOFFLOAD_BASEPTRS:%.*]] = alloca [1 x ptr], align 8
514 // CHECK1-NEXT: [[DOTOFFLOAD_PTRS:%.*]] = alloca [1 x ptr], align 8
515 // CHECK1-NEXT: [[DOTOFFLOAD_MAPPERS:%.*]] = alloca [1 x ptr], align 8
516 // CHECK1-NEXT: [[_TMP5:%.*]] = alloca i32, align 4
517 // CHECK1-NEXT: [[KERNEL_ARGS6:%.*]] = alloca [[STRUCT___TGT_KERNEL_ARGUMENTS]], align 8
518 // CHECK1-NEXT: store i32 0, ptr [[RETVAL]], align 4
519 // CHECK1-NEXT: [[TMP0:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 0
520 // CHECK1-NEXT: store i32 2, ptr [[TMP0]], align 4
521 // CHECK1-NEXT: [[TMP1:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 1
522 // CHECK1-NEXT: store i32 0, ptr [[TMP1]], align 4
523 // CHECK1-NEXT: [[TMP2:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 2
524 // CHECK1-NEXT: store ptr null, ptr [[TMP2]], align 8
525 // CHECK1-NEXT: [[TMP3:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 3
526 // CHECK1-NEXT: store ptr null, ptr [[TMP3]], align 8
527 // CHECK1-NEXT: [[TMP4:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 4
528 // CHECK1-NEXT: store ptr null, ptr [[TMP4]], align 8
529 // CHECK1-NEXT: [[TMP5:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 5
530 // CHECK1-NEXT: store ptr null, ptr [[TMP5]], align 8
531 // CHECK1-NEXT: [[TMP6:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 6
532 // CHECK1-NEXT: store ptr null, ptr [[TMP6]], align 8
533 // CHECK1-NEXT: [[TMP7:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 7
534 // CHECK1-NEXT: store ptr null, ptr [[TMP7]], align 8
535 // CHECK1-NEXT: [[TMP8:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 8
536 // CHECK1-NEXT: store i64 100, ptr [[TMP8]], align 8
537 // CHECK1-NEXT: [[TMP9:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 9
538 // CHECK1-NEXT: store i64 0, ptr [[TMP9]], align 8
539 // CHECK1-NEXT: [[TMP10:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 10
540 // CHECK1-NEXT: store [3 x i32] zeroinitializer, ptr [[TMP10]], align 4
541 // CHECK1-NEXT: [[TMP11:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 11
542 // CHECK1-NEXT: store [3 x i32] zeroinitializer, ptr [[TMP11]], align 4
543 // CHECK1-NEXT: [[TMP12:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 12
544 // CHECK1-NEXT: store i32 0, ptr [[TMP12]], align 4
545 // CHECK1-NEXT: [[TMP13:%.*]] = call i32 @__tgt_target_kernel(ptr @[[GLOB3]], i64 -1, i32 0, i32 0, ptr @.{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}_main_l81.region_id, ptr [[KERNEL_ARGS]])
546 // CHECK1-NEXT: [[TMP14:%.*]] = icmp ne i32 [[TMP13]], 0
547 // CHECK1-NEXT: br i1 [[TMP14]], label [[OMP_OFFLOAD_FAILED:%.*]], label [[OMP_OFFLOAD_CONT:%.*]]
548 // CHECK1: omp_offload.failed:
549 // CHECK1-NEXT: call void @{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}_main_l81() #[[ATTR2]]
550 // CHECK1-NEXT: br label [[OMP_OFFLOAD_CONT]]
551 // CHECK1: omp_offload.cont:
552 // CHECK1-NEXT: [[TMP15:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS2]], i32 0, i32 0
553 // CHECK1-NEXT: store i32 2, ptr [[TMP15]], align 4
554 // CHECK1-NEXT: [[TMP16:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS2]], i32 0, i32 1
555 // CHECK1-NEXT: store i32 0, ptr [[TMP16]], align 4
556 // CHECK1-NEXT: [[TMP17:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS2]], i32 0, i32 2
557 // CHECK1-NEXT: store ptr null, ptr [[TMP17]], align 8
558 // CHECK1-NEXT: [[TMP18:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS2]], i32 0, i32 3
559 // CHECK1-NEXT: store ptr null, ptr [[TMP18]], align 8
560 // CHECK1-NEXT: [[TMP19:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS2]], i32 0, i32 4
561 // CHECK1-NEXT: store ptr null, ptr [[TMP19]], align 8
562 // CHECK1-NEXT: [[TMP20:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS2]], i32 0, i32 5
563 // CHECK1-NEXT: store ptr null, ptr [[TMP20]], align 8
564 // CHECK1-NEXT: [[TMP21:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS2]], i32 0, i32 6
565 // CHECK1-NEXT: store ptr null, ptr [[TMP21]], align 8
566 // CHECK1-NEXT: [[TMP22:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS2]], i32 0, i32 7
567 // CHECK1-NEXT: store ptr null, ptr [[TMP22]], align 8
568 // CHECK1-NEXT: [[TMP23:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS2]], i32 0, i32 8
569 // CHECK1-NEXT: store i64 100, ptr [[TMP23]], align 8
570 // CHECK1-NEXT: [[TMP24:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS2]], i32 0, i32 9
571 // CHECK1-NEXT: store i64 0, ptr [[TMP24]], align 8
572 // CHECK1-NEXT: [[TMP25:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS2]], i32 0, i32 10
573 // CHECK1-NEXT: store [3 x i32] zeroinitializer, ptr [[TMP25]], align 4
574 // CHECK1-NEXT: [[TMP26:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS2]], i32 0, i32 11
575 // CHECK1-NEXT: store [3 x i32] zeroinitializer, ptr [[TMP26]], align 4
576 // CHECK1-NEXT: [[TMP27:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS2]], i32 0, i32 12
577 // CHECK1-NEXT: store i32 0, ptr [[TMP27]], align 4
578 // CHECK1-NEXT: [[TMP28:%.*]] = call i32 @__tgt_target_kernel(ptr @[[GLOB3]], i64 -1, i32 0, i32 0, ptr @.{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}_main_l90.region_id, ptr [[KERNEL_ARGS2]])
579 // CHECK1-NEXT: [[TMP29:%.*]] = icmp ne i32 [[TMP28]], 0
580 // CHECK1-NEXT: br i1 [[TMP29]], label [[OMP_OFFLOAD_FAILED3:%.*]], label [[OMP_OFFLOAD_CONT4:%.*]]
581 // CHECK1: omp_offload.failed3:
582 // CHECK1-NEXT: call void @{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}_main_l90() #[[ATTR2]]
583 // CHECK1-NEXT: br label [[OMP_OFFLOAD_CONT4]]
584 // CHECK1: omp_offload.cont4:
585 // CHECK1-NEXT: [[TMP30:%.*]] = load i32, ptr @Arg, align 4
586 // CHECK1-NEXT: store i32 [[TMP30]], ptr [[ARG_CASTED]], align 4
587 // CHECK1-NEXT: [[TMP31:%.*]] = load i64, ptr [[ARG_CASTED]], align 8
588 // CHECK1-NEXT: [[TMP32:%.*]] = getelementptr inbounds [1 x ptr], ptr [[DOTOFFLOAD_BASEPTRS]], i32 0, i32 0
589 // CHECK1-NEXT: store i64 [[TMP31]], ptr [[TMP32]], align 8
590 // CHECK1-NEXT: [[TMP33:%.*]] = getelementptr inbounds [1 x ptr], ptr [[DOTOFFLOAD_PTRS]], i32 0, i32 0
591 // CHECK1-NEXT: store i64 [[TMP31]], ptr [[TMP33]], align 8
592 // CHECK1-NEXT: [[TMP34:%.*]] = getelementptr inbounds [1 x ptr], ptr [[DOTOFFLOAD_MAPPERS]], i64 0, i64 0
593 // CHECK1-NEXT: store ptr null, ptr [[TMP34]], align 8
594 // CHECK1-NEXT: [[TMP35:%.*]] = getelementptr inbounds [1 x ptr], ptr [[DOTOFFLOAD_BASEPTRS]], i32 0, i32 0
595 // CHECK1-NEXT: [[TMP36:%.*]] = getelementptr inbounds [1 x ptr], ptr [[DOTOFFLOAD_PTRS]], i32 0, i32 0
596 // CHECK1-NEXT: [[TMP37:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS6]], i32 0, i32 0
597 // CHECK1-NEXT: store i32 2, ptr [[TMP37]], align 4
598 // CHECK1-NEXT: [[TMP38:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS6]], i32 0, i32 1
599 // CHECK1-NEXT: store i32 1, ptr [[TMP38]], align 4
600 // CHECK1-NEXT: [[TMP39:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS6]], i32 0, i32 2
601 // CHECK1-NEXT: store ptr [[TMP35]], ptr [[TMP39]], align 8
602 // CHECK1-NEXT: [[TMP40:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS6]], i32 0, i32 3
603 // CHECK1-NEXT: store ptr [[TMP36]], ptr [[TMP40]], align 8
604 // CHECK1-NEXT: [[TMP41:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS6]], i32 0, i32 4
605 // CHECK1-NEXT: store ptr @.offload_sizes, ptr [[TMP41]], align 8
606 // CHECK1-NEXT: [[TMP42:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS6]], i32 0, i32 5
607 // CHECK1-NEXT: store ptr @.offload_maptypes, ptr [[TMP42]], align 8
608 // CHECK1-NEXT: [[TMP43:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS6]], i32 0, i32 6
609 // CHECK1-NEXT: store ptr null, ptr [[TMP43]], align 8
610 // CHECK1-NEXT: [[TMP44:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS6]], i32 0, i32 7
611 // CHECK1-NEXT: store ptr null, ptr [[TMP44]], align 8
612 // CHECK1-NEXT: [[TMP45:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS6]], i32 0, i32 8
613 // CHECK1-NEXT: store i64 100, ptr [[TMP45]], align 8
614 // CHECK1-NEXT: [[TMP46:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS6]], i32 0, i32 9
615 // CHECK1-NEXT: store i64 0, ptr [[TMP46]], align 8
616 // CHECK1-NEXT: [[TMP47:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS6]], i32 0, i32 10
617 // CHECK1-NEXT: store [3 x i32] zeroinitializer, ptr [[TMP47]], align 4
618 // CHECK1-NEXT: [[TMP48:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS6]], i32 0, i32 11
619 // CHECK1-NEXT: store [3 x i32] zeroinitializer, ptr [[TMP48]], align 4
620 // CHECK1-NEXT: [[TMP49:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS6]], i32 0, i32 12
621 // CHECK1-NEXT: store i32 0, ptr [[TMP49]], align 4
622 // CHECK1-NEXT: [[TMP50:%.*]] = call i32 @__tgt_target_kernel(ptr @[[GLOB3]], i64 -1, i32 0, i32 0, ptr @.{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}_main_l99.region_id, ptr [[KERNEL_ARGS6]])
623 // CHECK1-NEXT: [[TMP51:%.*]] = icmp ne i32 [[TMP50]], 0
624 // CHECK1-NEXT: br i1 [[TMP51]], label [[OMP_OFFLOAD_FAILED7:%.*]], label [[OMP_OFFLOAD_CONT8:%.*]]
625 // CHECK1: omp_offload.failed7:
626 // CHECK1-NEXT: call void @{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}_main_l99(i64 [[TMP31]]) #[[ATTR2]]
627 // CHECK1-NEXT: br label [[OMP_OFFLOAD_CONT8]]
628 // CHECK1: omp_offload.cont8:
629 // CHECK1-NEXT: [[TMP52:%.*]] = load i32, ptr @Arg, align 4
630 // CHECK1-NEXT: [[CALL:%.*]] = call noundef i32 @_Z5tmainIiEiT_(i32 noundef [[TMP52]])
631 // CHECK1-NEXT: ret i32 [[CALL]]
634 // CHECK1-LABEL: define {{[^@]+}}@{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}_main_l81
635 // CHECK1-SAME: () #[[ATTR1]] {
636 // CHECK1-NEXT: entry:
637 // CHECK1-NEXT: call void (ptr, i32, ptr, ...) @__kmpc_fork_teams(ptr @[[GLOB3]], i32 0, ptr @{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}_main_l81.omp_outlined)
638 // CHECK1-NEXT: ret void
641 // CHECK1-LABEL: define {{[^@]+}}@{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}_main_l81.omp_outlined
642 // CHECK1-SAME: (ptr noalias noundef [[DOTGLOBAL_TID_:%.*]], ptr noalias noundef [[DOTBOUND_TID_:%.*]]) #[[ATTR1]] {
643 // CHECK1-NEXT: entry:
644 // CHECK1-NEXT: [[DOTGLOBAL_TID__ADDR:%.*]] = alloca ptr, align 8
645 // CHECK1-NEXT: [[DOTBOUND_TID__ADDR:%.*]] = alloca ptr, align 8
646 // CHECK1-NEXT: [[DOTOMP_IV:%.*]] = alloca i32, align 4
647 // CHECK1-NEXT: [[TMP:%.*]] = alloca i32, align 4
648 // CHECK1-NEXT: [[DOTOMP_COMB_LB:%.*]] = alloca i32, align 4
649 // CHECK1-NEXT: [[DOTOMP_COMB_UB:%.*]] = alloca i32, align 4
650 // CHECK1-NEXT: [[DOTOMP_STRIDE:%.*]] = alloca i32, align 4
651 // CHECK1-NEXT: [[DOTOMP_IS_LAST:%.*]] = alloca i32, align 4
652 // CHECK1-NEXT: [[I:%.*]] = alloca i32, align 4
653 // CHECK1-NEXT: store ptr [[DOTGLOBAL_TID_]], ptr [[DOTGLOBAL_TID__ADDR]], align 8
654 // CHECK1-NEXT: store ptr [[DOTBOUND_TID_]], ptr [[DOTBOUND_TID__ADDR]], align 8
655 // CHECK1-NEXT: store i32 0, ptr [[DOTOMP_COMB_LB]], align 4
656 // CHECK1-NEXT: store i32 99, ptr [[DOTOMP_COMB_UB]], align 4
657 // CHECK1-NEXT: store i32 1, ptr [[DOTOMP_STRIDE]], align 4
658 // CHECK1-NEXT: store i32 0, ptr [[DOTOMP_IS_LAST]], align 4
659 // CHECK1-NEXT: [[TMP0:%.*]] = load ptr, ptr [[DOTGLOBAL_TID__ADDR]], align 8
660 // CHECK1-NEXT: [[TMP1:%.*]] = load i32, ptr [[TMP0]], align 4
661 // CHECK1-NEXT: call void @__kmpc_for_static_init_4(ptr @[[GLOB1]], i32 [[TMP1]], i32 92, ptr [[DOTOMP_IS_LAST]], ptr [[DOTOMP_COMB_LB]], ptr [[DOTOMP_COMB_UB]], ptr [[DOTOMP_STRIDE]], i32 1, i32 1)
662 // CHECK1-NEXT: [[TMP2:%.*]] = load i32, ptr [[DOTOMP_COMB_UB]], align 4
663 // CHECK1-NEXT: [[CMP:%.*]] = icmp sgt i32 [[TMP2]], 99
664 // CHECK1-NEXT: br i1 [[CMP]], label [[COND_TRUE:%.*]], label [[COND_FALSE:%.*]]
665 // CHECK1: cond.true:
666 // CHECK1-NEXT: br label [[COND_END:%.*]]
667 // CHECK1: cond.false:
668 // CHECK1-NEXT: [[TMP3:%.*]] = load i32, ptr [[DOTOMP_COMB_UB]], align 4
669 // CHECK1-NEXT: br label [[COND_END]]
670 // CHECK1: cond.end:
671 // CHECK1-NEXT: [[COND:%.*]] = phi i32 [ 99, [[COND_TRUE]] ], [ [[TMP3]], [[COND_FALSE]] ]
672 // CHECK1-NEXT: store i32 [[COND]], ptr [[DOTOMP_COMB_UB]], align 4
673 // CHECK1-NEXT: [[TMP4:%.*]] = load i32, ptr [[DOTOMP_COMB_LB]], align 4
674 // CHECK1-NEXT: store i32 [[TMP4]], ptr [[DOTOMP_IV]], align 4
675 // CHECK1-NEXT: br label [[OMP_INNER_FOR_COND:%.*]]
676 // CHECK1: omp.inner.for.cond:
677 // CHECK1-NEXT: [[TMP5:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP26:![0-9]+]]
678 // CHECK1-NEXT: [[TMP6:%.*]] = load i32, ptr [[DOTOMP_COMB_UB]], align 4, !llvm.access.group [[ACC_GRP26]]
679 // CHECK1-NEXT: [[CMP1:%.*]] = icmp sle i32 [[TMP5]], [[TMP6]]
680 // CHECK1-NEXT: br i1 [[CMP1]], label [[OMP_INNER_FOR_BODY:%.*]], label [[OMP_INNER_FOR_END:%.*]]
681 // CHECK1: omp.inner.for.body:
682 // CHECK1-NEXT: [[TMP7:%.*]] = load i32, ptr [[DOTOMP_COMB_LB]], align 4, !llvm.access.group [[ACC_GRP26]]
683 // CHECK1-NEXT: [[TMP8:%.*]] = zext i32 [[TMP7]] to i64
684 // CHECK1-NEXT: [[TMP9:%.*]] = load i32, ptr [[DOTOMP_COMB_UB]], align 4, !llvm.access.group [[ACC_GRP26]]
685 // CHECK1-NEXT: [[TMP10:%.*]] = zext i32 [[TMP9]] to i64
686 // CHECK1-NEXT: call void (ptr, i32, ptr, ...) @__kmpc_fork_call(ptr @[[GLOB3]], i32 2, ptr @{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}_main_l81.omp_outlined.omp_outlined, i64 [[TMP8]], i64 [[TMP10]]), !llvm.access.group [[ACC_GRP26]]
687 // CHECK1-NEXT: br label [[OMP_INNER_FOR_INC:%.*]]
688 // CHECK1: omp.inner.for.inc:
689 // CHECK1-NEXT: [[TMP11:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP26]]
690 // CHECK1-NEXT: [[TMP12:%.*]] = load i32, ptr [[DOTOMP_STRIDE]], align 4, !llvm.access.group [[ACC_GRP26]]
691 // CHECK1-NEXT: [[ADD:%.*]] = add nsw i32 [[TMP11]], [[TMP12]]
692 // CHECK1-NEXT: store i32 [[ADD]], ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP26]]
693 // CHECK1-NEXT: br label [[OMP_INNER_FOR_COND]], !llvm.loop [[LOOP27:![0-9]+]]
694 // CHECK1: omp.inner.for.end:
695 // CHECK1-NEXT: br label [[OMP_LOOP_EXIT:%.*]]
696 // CHECK1: omp.loop.exit:
697 // CHECK1-NEXT: call void @__kmpc_for_static_fini(ptr @[[GLOB1]], i32 [[TMP1]])
698 // CHECK1-NEXT: [[TMP13:%.*]] = load i32, ptr [[DOTOMP_IS_LAST]], align 4
699 // CHECK1-NEXT: [[TMP14:%.*]] = icmp ne i32 [[TMP13]], 0
700 // CHECK1-NEXT: br i1 [[TMP14]], label [[DOTOMP_FINAL_THEN:%.*]], label [[DOTOMP_FINAL_DONE:%.*]]
701 // CHECK1: .omp.final.then:
702 // CHECK1-NEXT: store i32 100, ptr [[I]], align 4
703 // CHECK1-NEXT: br label [[DOTOMP_FINAL_DONE]]
704 // CHECK1: .omp.final.done:
705 // CHECK1-NEXT: ret void
708 // CHECK1-LABEL: define {{[^@]+}}@{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}_main_l81.omp_outlined.omp_outlined
709 // CHECK1-SAME: (ptr noalias noundef [[DOTGLOBAL_TID_:%.*]], ptr noalias noundef [[DOTBOUND_TID_:%.*]], i64 noundef [[DOTPREVIOUS_LB_:%.*]], i64 noundef [[DOTPREVIOUS_UB_:%.*]]) #[[ATTR1]] {
710 // CHECK1-NEXT: entry:
711 // CHECK1-NEXT: [[DOTGLOBAL_TID__ADDR:%.*]] = alloca ptr, align 8
712 // CHECK1-NEXT: [[DOTBOUND_TID__ADDR:%.*]] = alloca ptr, align 8
713 // CHECK1-NEXT: [[DOTPREVIOUS_LB__ADDR:%.*]] = alloca i64, align 8
714 // CHECK1-NEXT: [[DOTPREVIOUS_UB__ADDR:%.*]] = alloca i64, align 8
715 // CHECK1-NEXT: [[DOTOMP_IV:%.*]] = alloca i32, align 4
716 // CHECK1-NEXT: [[TMP:%.*]] = alloca i32, align 4
717 // CHECK1-NEXT: [[DOTOMP_LB:%.*]] = alloca i32, align 4
718 // CHECK1-NEXT: [[DOTOMP_UB:%.*]] = alloca i32, align 4
719 // CHECK1-NEXT: [[DOTOMP_STRIDE:%.*]] = alloca i32, align 4
720 // CHECK1-NEXT: [[DOTOMP_IS_LAST:%.*]] = alloca i32, align 4
721 // CHECK1-NEXT: [[I:%.*]] = alloca i32, align 4
722 // CHECK1-NEXT: store ptr [[DOTGLOBAL_TID_]], ptr [[DOTGLOBAL_TID__ADDR]], align 8
723 // CHECK1-NEXT: store ptr [[DOTBOUND_TID_]], ptr [[DOTBOUND_TID__ADDR]], align 8
724 // CHECK1-NEXT: store i64 [[DOTPREVIOUS_LB_]], ptr [[DOTPREVIOUS_LB__ADDR]], align 8
725 // CHECK1-NEXT: store i64 [[DOTPREVIOUS_UB_]], ptr [[DOTPREVIOUS_UB__ADDR]], align 8
726 // CHECK1-NEXT: store i32 0, ptr [[DOTOMP_LB]], align 4
727 // CHECK1-NEXT: store i32 99, ptr [[DOTOMP_UB]], align 4
728 // CHECK1-NEXT: [[TMP0:%.*]] = load i64, ptr [[DOTPREVIOUS_LB__ADDR]], align 8
729 // CHECK1-NEXT: [[CONV:%.*]] = trunc i64 [[TMP0]] to i32
730 // CHECK1-NEXT: [[TMP1:%.*]] = load i64, ptr [[DOTPREVIOUS_UB__ADDR]], align 8
731 // CHECK1-NEXT: [[CONV1:%.*]] = trunc i64 [[TMP1]] to i32
732 // CHECK1-NEXT: store i32 [[CONV]], ptr [[DOTOMP_LB]], align 4
733 // CHECK1-NEXT: store i32 [[CONV1]], ptr [[DOTOMP_UB]], align 4
734 // CHECK1-NEXT: store i32 1, ptr [[DOTOMP_STRIDE]], align 4
735 // CHECK1-NEXT: store i32 0, ptr [[DOTOMP_IS_LAST]], align 4
736 // CHECK1-NEXT: [[TMP2:%.*]] = load ptr, ptr [[DOTGLOBAL_TID__ADDR]], align 8
737 // CHECK1-NEXT: [[TMP3:%.*]] = load i32, ptr [[TMP2]], align 4
738 // CHECK1-NEXT: call void @__kmpc_for_static_init_4(ptr @[[GLOB2]], i32 [[TMP3]], i32 34, ptr [[DOTOMP_IS_LAST]], ptr [[DOTOMP_LB]], ptr [[DOTOMP_UB]], ptr [[DOTOMP_STRIDE]], i32 1, i32 1)
739 // CHECK1-NEXT: [[TMP4:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4
740 // CHECK1-NEXT: [[CMP:%.*]] = icmp sgt i32 [[TMP4]], 99
741 // CHECK1-NEXT: br i1 [[CMP]], label [[COND_TRUE:%.*]], label [[COND_FALSE:%.*]]
742 // CHECK1: cond.true:
743 // CHECK1-NEXT: br label [[COND_END:%.*]]
744 // CHECK1: cond.false:
745 // CHECK1-NEXT: [[TMP5:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4
746 // CHECK1-NEXT: br label [[COND_END]]
747 // CHECK1: cond.end:
748 // CHECK1-NEXT: [[COND:%.*]] = phi i32 [ 99, [[COND_TRUE]] ], [ [[TMP5]], [[COND_FALSE]] ]
749 // CHECK1-NEXT: store i32 [[COND]], ptr [[DOTOMP_UB]], align 4
750 // CHECK1-NEXT: [[TMP6:%.*]] = load i32, ptr [[DOTOMP_LB]], align 4
751 // CHECK1-NEXT: store i32 [[TMP6]], ptr [[DOTOMP_IV]], align 4
752 // CHECK1-NEXT: br label [[OMP_INNER_FOR_COND:%.*]]
753 // CHECK1: omp.inner.for.cond:
754 // CHECK1-NEXT: [[TMP7:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP29:![0-9]+]]
755 // CHECK1-NEXT: [[TMP8:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4, !llvm.access.group [[ACC_GRP29]]
756 // CHECK1-NEXT: [[CMP2:%.*]] = icmp sle i32 [[TMP7]], [[TMP8]]
757 // CHECK1-NEXT: br i1 [[CMP2]], label [[OMP_INNER_FOR_BODY:%.*]], label [[OMP_INNER_FOR_END:%.*]]
758 // CHECK1: omp.inner.for.body:
759 // CHECK1-NEXT: [[TMP9:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP29]]
760 // CHECK1-NEXT: [[MUL:%.*]] = mul nsw i32 [[TMP9]], 1
761 // CHECK1-NEXT: [[ADD:%.*]] = add nsw i32 0, [[MUL]]
762 // CHECK1-NEXT: store i32 [[ADD]], ptr [[I]], align 4, !llvm.access.group [[ACC_GRP29]]
763 // CHECK1-NEXT: call void @_Z3fn4v(), !llvm.access.group [[ACC_GRP29]]
764 // CHECK1-NEXT: br label [[OMP_BODY_CONTINUE:%.*]]
765 // CHECK1: omp.body.continue:
766 // CHECK1-NEXT: br label [[OMP_INNER_FOR_INC:%.*]]
767 // CHECK1: omp.inner.for.inc:
768 // CHECK1-NEXT: [[TMP10:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP29]]
769 // CHECK1-NEXT: [[ADD3:%.*]] = add nsw i32 [[TMP10]], 1
770 // CHECK1-NEXT: store i32 [[ADD3]], ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP29]]
771 // CHECK1-NEXT: br label [[OMP_INNER_FOR_COND]], !llvm.loop [[LOOP30:![0-9]+]]
772 // CHECK1: omp.inner.for.end:
773 // CHECK1-NEXT: br label [[OMP_LOOP_EXIT:%.*]]
774 // CHECK1: omp.loop.exit:
775 // CHECK1-NEXT: call void @__kmpc_for_static_fini(ptr @[[GLOB1]], i32 [[TMP3]])
776 // CHECK1-NEXT: [[TMP11:%.*]] = load i32, ptr [[DOTOMP_IS_LAST]], align 4
777 // CHECK1-NEXT: [[TMP12:%.*]] = icmp ne i32 [[TMP11]], 0
778 // CHECK1-NEXT: br i1 [[TMP12]], label [[DOTOMP_FINAL_THEN:%.*]], label [[DOTOMP_FINAL_DONE:%.*]]
779 // CHECK1: .omp.final.then:
780 // CHECK1-NEXT: store i32 100, ptr [[I]], align 4
781 // CHECK1-NEXT: br label [[DOTOMP_FINAL_DONE]]
782 // CHECK1: .omp.final.done:
783 // CHECK1-NEXT: ret void
786 // CHECK1-LABEL: define {{[^@]+}}@{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}_main_l90
787 // CHECK1-SAME: () #[[ATTR1]] {
788 // CHECK1-NEXT: entry:
789 // CHECK1-NEXT: call void (ptr, i32, ptr, ...) @__kmpc_fork_teams(ptr @[[GLOB3]], i32 0, ptr @{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}_main_l90.omp_outlined)
790 // CHECK1-NEXT: ret void
793 // CHECK1-LABEL: define {{[^@]+}}@{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}_main_l90.omp_outlined
794 // CHECK1-SAME: (ptr noalias noundef [[DOTGLOBAL_TID_:%.*]], ptr noalias noundef [[DOTBOUND_TID_:%.*]]) #[[ATTR1]] {
795 // CHECK1-NEXT: entry:
796 // CHECK1-NEXT: [[DOTGLOBAL_TID__ADDR:%.*]] = alloca ptr, align 8
797 // CHECK1-NEXT: [[DOTBOUND_TID__ADDR:%.*]] = alloca ptr, align 8
798 // CHECK1-NEXT: [[DOTOMP_IV:%.*]] = alloca i32, align 4
799 // CHECK1-NEXT: [[TMP:%.*]] = alloca i32, align 4
800 // CHECK1-NEXT: [[DOTOMP_COMB_LB:%.*]] = alloca i32, align 4
801 // CHECK1-NEXT: [[DOTOMP_COMB_UB:%.*]] = alloca i32, align 4
802 // CHECK1-NEXT: [[DOTOMP_STRIDE:%.*]] = alloca i32, align 4
803 // CHECK1-NEXT: [[DOTOMP_IS_LAST:%.*]] = alloca i32, align 4
804 // CHECK1-NEXT: [[I:%.*]] = alloca i32, align 4
805 // CHECK1-NEXT: [[DOTBOUND_ZERO_ADDR:%.*]] = alloca i32, align 4
806 // CHECK1-NEXT: store ptr [[DOTGLOBAL_TID_]], ptr [[DOTGLOBAL_TID__ADDR]], align 8
807 // CHECK1-NEXT: store ptr [[DOTBOUND_TID_]], ptr [[DOTBOUND_TID__ADDR]], align 8
808 // CHECK1-NEXT: store i32 0, ptr [[DOTOMP_COMB_LB]], align 4
809 // CHECK1-NEXT: store i32 99, ptr [[DOTOMP_COMB_UB]], align 4
810 // CHECK1-NEXT: store i32 1, ptr [[DOTOMP_STRIDE]], align 4
811 // CHECK1-NEXT: store i32 0, ptr [[DOTOMP_IS_LAST]], align 4
812 // CHECK1-NEXT: [[TMP0:%.*]] = load ptr, ptr [[DOTGLOBAL_TID__ADDR]], align 8
813 // CHECK1-NEXT: [[TMP1:%.*]] = load i32, ptr [[TMP0]], align 4
814 // CHECK1-NEXT: call void @__kmpc_for_static_init_4(ptr @[[GLOB1]], i32 [[TMP1]], i32 92, ptr [[DOTOMP_IS_LAST]], ptr [[DOTOMP_COMB_LB]], ptr [[DOTOMP_COMB_UB]], ptr [[DOTOMP_STRIDE]], i32 1, i32 1)
815 // CHECK1-NEXT: [[TMP2:%.*]] = load i32, ptr [[DOTOMP_COMB_UB]], align 4
816 // CHECK1-NEXT: [[CMP:%.*]] = icmp sgt i32 [[TMP2]], 99
817 // CHECK1-NEXT: br i1 [[CMP]], label [[COND_TRUE:%.*]], label [[COND_FALSE:%.*]]
818 // CHECK1: cond.true:
819 // CHECK1-NEXT: br label [[COND_END:%.*]]
820 // CHECK1: cond.false:
821 // CHECK1-NEXT: [[TMP3:%.*]] = load i32, ptr [[DOTOMP_COMB_UB]], align 4
822 // CHECK1-NEXT: br label [[COND_END]]
823 // CHECK1: cond.end:
824 // CHECK1-NEXT: [[COND:%.*]] = phi i32 [ 99, [[COND_TRUE]] ], [ [[TMP3]], [[COND_FALSE]] ]
825 // CHECK1-NEXT: store i32 [[COND]], ptr [[DOTOMP_COMB_UB]], align 4
826 // CHECK1-NEXT: [[TMP4:%.*]] = load i32, ptr [[DOTOMP_COMB_LB]], align 4
827 // CHECK1-NEXT: store i32 [[TMP4]], ptr [[DOTOMP_IV]], align 4
828 // CHECK1-NEXT: br label [[OMP_INNER_FOR_COND:%.*]]
829 // CHECK1: omp.inner.for.cond:
830 // CHECK1-NEXT: [[TMP5:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP32:![0-9]+]]
831 // CHECK1-NEXT: [[TMP6:%.*]] = load i32, ptr [[DOTOMP_COMB_UB]], align 4, !llvm.access.group [[ACC_GRP32]]
832 // CHECK1-NEXT: [[CMP1:%.*]] = icmp sle i32 [[TMP5]], [[TMP6]]
833 // CHECK1-NEXT: br i1 [[CMP1]], label [[OMP_INNER_FOR_BODY:%.*]], label [[OMP_INNER_FOR_END:%.*]]
834 // CHECK1: omp.inner.for.body:
835 // CHECK1-NEXT: [[TMP7:%.*]] = load i32, ptr [[DOTOMP_COMB_LB]], align 4, !llvm.access.group [[ACC_GRP32]]
836 // CHECK1-NEXT: [[TMP8:%.*]] = zext i32 [[TMP7]] to i64
837 // CHECK1-NEXT: [[TMP9:%.*]] = load i32, ptr [[DOTOMP_COMB_UB]], align 4, !llvm.access.group [[ACC_GRP32]]
838 // CHECK1-NEXT: [[TMP10:%.*]] = zext i32 [[TMP9]] to i64
839 // CHECK1-NEXT: call void @__kmpc_serialized_parallel(ptr @[[GLOB3]], i32 [[TMP1]]), !llvm.access.group [[ACC_GRP32]]
840 // CHECK1-NEXT: [[TMP11:%.*]] = load ptr, ptr [[DOTGLOBAL_TID__ADDR]], align 8, !llvm.access.group [[ACC_GRP32]]
841 // CHECK1-NEXT: store i32 0, ptr [[DOTBOUND_ZERO_ADDR]], align 4, !llvm.access.group [[ACC_GRP32]]
842 // CHECK1-NEXT: call void @{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}_main_l90.omp_outlined.omp_outlined(ptr [[TMP11]], ptr [[DOTBOUND_ZERO_ADDR]], i64 [[TMP8]], i64 [[TMP10]]) #[[ATTR2]], !llvm.access.group [[ACC_GRP32]]
843 // CHECK1-NEXT: call void @__kmpc_end_serialized_parallel(ptr @[[GLOB3]], i32 [[TMP1]]), !llvm.access.group [[ACC_GRP32]]
844 // CHECK1-NEXT: br label [[OMP_INNER_FOR_INC:%.*]]
845 // CHECK1: omp.inner.for.inc:
846 // CHECK1-NEXT: [[TMP12:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP32]]
847 // CHECK1-NEXT: [[TMP13:%.*]] = load i32, ptr [[DOTOMP_STRIDE]], align 4, !llvm.access.group [[ACC_GRP32]]
848 // CHECK1-NEXT: [[ADD:%.*]] = add nsw i32 [[TMP12]], [[TMP13]]
849 // CHECK1-NEXT: store i32 [[ADD]], ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP32]]
850 // CHECK1-NEXT: br label [[OMP_INNER_FOR_COND]], !llvm.loop [[LOOP33:![0-9]+]]
851 // CHECK1: omp.inner.for.end:
852 // CHECK1-NEXT: br label [[OMP_LOOP_EXIT:%.*]]
853 // CHECK1: omp.loop.exit:
854 // CHECK1-NEXT: call void @__kmpc_for_static_fini(ptr @[[GLOB1]], i32 [[TMP1]])
855 // CHECK1-NEXT: [[TMP14:%.*]] = load i32, ptr [[DOTOMP_IS_LAST]], align 4
856 // CHECK1-NEXT: [[TMP15:%.*]] = icmp ne i32 [[TMP14]], 0
857 // CHECK1-NEXT: br i1 [[TMP15]], label [[DOTOMP_FINAL_THEN:%.*]], label [[DOTOMP_FINAL_DONE:%.*]]
858 // CHECK1: .omp.final.then:
859 // CHECK1-NEXT: store i32 100, ptr [[I]], align 4
860 // CHECK1-NEXT: br label [[DOTOMP_FINAL_DONE]]
861 // CHECK1: .omp.final.done:
862 // CHECK1-NEXT: ret void
865 // CHECK1-LABEL: define {{[^@]+}}@{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}_main_l90.omp_outlined.omp_outlined
866 // CHECK1-SAME: (ptr noalias noundef [[DOTGLOBAL_TID_:%.*]], ptr noalias noundef [[DOTBOUND_TID_:%.*]], i64 noundef [[DOTPREVIOUS_LB_:%.*]], i64 noundef [[DOTPREVIOUS_UB_:%.*]]) #[[ATTR1]] {
867 // CHECK1-NEXT: entry:
868 // CHECK1-NEXT: [[DOTGLOBAL_TID__ADDR:%.*]] = alloca ptr, align 8
869 // CHECK1-NEXT: [[DOTBOUND_TID__ADDR:%.*]] = alloca ptr, align 8
870 // CHECK1-NEXT: [[DOTPREVIOUS_LB__ADDR:%.*]] = alloca i64, align 8
871 // CHECK1-NEXT: [[DOTPREVIOUS_UB__ADDR:%.*]] = alloca i64, align 8
872 // CHECK1-NEXT: [[DOTOMP_IV:%.*]] = alloca i32, align 4
873 // CHECK1-NEXT: [[TMP:%.*]] = alloca i32, align 4
874 // CHECK1-NEXT: [[DOTOMP_LB:%.*]] = alloca i32, align 4
875 // CHECK1-NEXT: [[DOTOMP_UB:%.*]] = alloca i32, align 4
876 // CHECK1-NEXT: [[DOTOMP_STRIDE:%.*]] = alloca i32, align 4
877 // CHECK1-NEXT: [[DOTOMP_IS_LAST:%.*]] = alloca i32, align 4
878 // CHECK1-NEXT: [[I:%.*]] = alloca i32, align 4
879 // CHECK1-NEXT: store ptr [[DOTGLOBAL_TID_]], ptr [[DOTGLOBAL_TID__ADDR]], align 8
880 // CHECK1-NEXT: store ptr [[DOTBOUND_TID_]], ptr [[DOTBOUND_TID__ADDR]], align 8
881 // CHECK1-NEXT: store i64 [[DOTPREVIOUS_LB_]], ptr [[DOTPREVIOUS_LB__ADDR]], align 8
882 // CHECK1-NEXT: store i64 [[DOTPREVIOUS_UB_]], ptr [[DOTPREVIOUS_UB__ADDR]], align 8
883 // CHECK1-NEXT: store i32 0, ptr [[DOTOMP_LB]], align 4
884 // CHECK1-NEXT: store i32 99, ptr [[DOTOMP_UB]], align 4
885 // CHECK1-NEXT: [[TMP0:%.*]] = load i64, ptr [[DOTPREVIOUS_LB__ADDR]], align 8
886 // CHECK1-NEXT: [[CONV:%.*]] = trunc i64 [[TMP0]] to i32
887 // CHECK1-NEXT: [[TMP1:%.*]] = load i64, ptr [[DOTPREVIOUS_UB__ADDR]], align 8
888 // CHECK1-NEXT: [[CONV1:%.*]] = trunc i64 [[TMP1]] to i32
889 // CHECK1-NEXT: store i32 [[CONV]], ptr [[DOTOMP_LB]], align 4
890 // CHECK1-NEXT: store i32 [[CONV1]], ptr [[DOTOMP_UB]], align 4
891 // CHECK1-NEXT: store i32 1, ptr [[DOTOMP_STRIDE]], align 4
892 // CHECK1-NEXT: store i32 0, ptr [[DOTOMP_IS_LAST]], align 4
893 // CHECK1-NEXT: [[TMP2:%.*]] = load ptr, ptr [[DOTGLOBAL_TID__ADDR]], align 8
894 // CHECK1-NEXT: [[TMP3:%.*]] = load i32, ptr [[TMP2]], align 4
895 // CHECK1-NEXT: call void @__kmpc_for_static_init_4(ptr @[[GLOB2]], i32 [[TMP3]], i32 34, ptr [[DOTOMP_IS_LAST]], ptr [[DOTOMP_LB]], ptr [[DOTOMP_UB]], ptr [[DOTOMP_STRIDE]], i32 1, i32 1)
896 // CHECK1-NEXT: [[TMP4:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4
897 // CHECK1-NEXT: [[CMP:%.*]] = icmp sgt i32 [[TMP4]], 99
898 // CHECK1-NEXT: br i1 [[CMP]], label [[COND_TRUE:%.*]], label [[COND_FALSE:%.*]]
899 // CHECK1: cond.true:
900 // CHECK1-NEXT: br label [[COND_END:%.*]]
901 // CHECK1: cond.false:
902 // CHECK1-NEXT: [[TMP5:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4
903 // CHECK1-NEXT: br label [[COND_END]]
904 // CHECK1: cond.end:
905 // CHECK1-NEXT: [[COND:%.*]] = phi i32 [ 99, [[COND_TRUE]] ], [ [[TMP5]], [[COND_FALSE]] ]
906 // CHECK1-NEXT: store i32 [[COND]], ptr [[DOTOMP_UB]], align 4
907 // CHECK1-NEXT: [[TMP6:%.*]] = load i32, ptr [[DOTOMP_LB]], align 4
908 // CHECK1-NEXT: store i32 [[TMP6]], ptr [[DOTOMP_IV]], align 4
909 // CHECK1-NEXT: br label [[OMP_INNER_FOR_COND:%.*]]
910 // CHECK1: omp.inner.for.cond:
911 // CHECK1-NEXT: [[TMP7:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP35:![0-9]+]]
912 // CHECK1-NEXT: [[TMP8:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4, !llvm.access.group [[ACC_GRP35]]
913 // CHECK1-NEXT: [[CMP2:%.*]] = icmp sle i32 [[TMP7]], [[TMP8]]
914 // CHECK1-NEXT: br i1 [[CMP2]], label [[OMP_INNER_FOR_BODY:%.*]], label [[OMP_INNER_FOR_END:%.*]]
915 // CHECK1: omp.inner.for.body:
916 // CHECK1-NEXT: [[TMP9:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP35]]
917 // CHECK1-NEXT: [[MUL:%.*]] = mul nsw i32 [[TMP9]], 1
918 // CHECK1-NEXT: [[ADD:%.*]] = add nsw i32 0, [[MUL]]
919 // CHECK1-NEXT: store i32 [[ADD]], ptr [[I]], align 4, !llvm.access.group [[ACC_GRP35]]
920 // CHECK1-NEXT: call void @_Z3fn5v(), !llvm.access.group [[ACC_GRP35]]
921 // CHECK1-NEXT: br label [[OMP_BODY_CONTINUE:%.*]]
922 // CHECK1: omp.body.continue:
923 // CHECK1-NEXT: br label [[OMP_INNER_FOR_INC:%.*]]
924 // CHECK1: omp.inner.for.inc:
925 // CHECK1-NEXT: [[TMP10:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP35]]
926 // CHECK1-NEXT: [[ADD3:%.*]] = add nsw i32 [[TMP10]], 1
927 // CHECK1-NEXT: store i32 [[ADD3]], ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP35]]
928 // CHECK1-NEXT: br label [[OMP_INNER_FOR_COND]], !llvm.loop [[LOOP36:![0-9]+]]
929 // CHECK1: omp.inner.for.end:
930 // CHECK1-NEXT: br label [[OMP_LOOP_EXIT:%.*]]
931 // CHECK1: omp.loop.exit:
932 // CHECK1-NEXT: call void @__kmpc_for_static_fini(ptr @[[GLOB1]], i32 [[TMP3]])
933 // CHECK1-NEXT: [[TMP11:%.*]] = load i32, ptr [[DOTOMP_IS_LAST]], align 4
934 // CHECK1-NEXT: [[TMP12:%.*]] = icmp ne i32 [[TMP11]], 0
935 // CHECK1-NEXT: br i1 [[TMP12]], label [[DOTOMP_FINAL_THEN:%.*]], label [[DOTOMP_FINAL_DONE:%.*]]
936 // CHECK1: .omp.final.then:
937 // CHECK1-NEXT: store i32 100, ptr [[I]], align 4
938 // CHECK1-NEXT: br label [[DOTOMP_FINAL_DONE]]
939 // CHECK1: .omp.final.done:
940 // CHECK1-NEXT: ret void
943 // CHECK1-LABEL: define {{[^@]+}}@{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}_main_l99
944 // CHECK1-SAME: (i64 noundef [[ARG:%.*]]) #[[ATTR1]] {
945 // CHECK1-NEXT: entry:
946 // CHECK1-NEXT: [[ARG_ADDR:%.*]] = alloca i64, align 8
947 // CHECK1-NEXT: store i64 [[ARG]], ptr [[ARG_ADDR]], align 8
948 // CHECK1-NEXT: call void (ptr, i32, ptr, ...) @__kmpc_fork_teams(ptr @[[GLOB3]], i32 1, ptr @{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}_main_l99.omp_outlined, ptr [[ARG_ADDR]])
949 // CHECK1-NEXT: ret void
952 // CHECK1-LABEL: define {{[^@]+}}@{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}_main_l99.omp_outlined
953 // CHECK1-SAME: (ptr noalias noundef [[DOTGLOBAL_TID_:%.*]], ptr noalias noundef [[DOTBOUND_TID_:%.*]], ptr noundef nonnull align 4 dereferenceable(4) [[ARG:%.*]]) #[[ATTR1]] {
954 // CHECK1-NEXT: entry:
955 // CHECK1-NEXT: [[DOTGLOBAL_TID__ADDR:%.*]] = alloca ptr, align 8
956 // CHECK1-NEXT: [[DOTBOUND_TID__ADDR:%.*]] = alloca ptr, align 8
957 // CHECK1-NEXT: [[ARG_ADDR:%.*]] = alloca ptr, align 8
958 // CHECK1-NEXT: [[DOTOMP_IV:%.*]] = alloca i32, align 4
959 // CHECK1-NEXT: [[TMP:%.*]] = alloca i32, align 4
960 // CHECK1-NEXT: [[DOTOMP_COMB_LB:%.*]] = alloca i32, align 4
961 // CHECK1-NEXT: [[DOTOMP_COMB_UB:%.*]] = alloca i32, align 4
962 // CHECK1-NEXT: [[DOTOMP_STRIDE:%.*]] = alloca i32, align 4
963 // CHECK1-NEXT: [[DOTOMP_IS_LAST:%.*]] = alloca i32, align 4
964 // CHECK1-NEXT: [[I:%.*]] = alloca i32, align 4
965 // CHECK1-NEXT: [[DOTBOUND_ZERO_ADDR:%.*]] = alloca i32, align 4
966 // CHECK1-NEXT: store ptr [[DOTGLOBAL_TID_]], ptr [[DOTGLOBAL_TID__ADDR]], align 8
967 // CHECK1-NEXT: store ptr [[DOTBOUND_TID_]], ptr [[DOTBOUND_TID__ADDR]], align 8
968 // CHECK1-NEXT: store ptr [[ARG]], ptr [[ARG_ADDR]], align 8
969 // CHECK1-NEXT: [[TMP0:%.*]] = load ptr, ptr [[ARG_ADDR]], align 8
970 // CHECK1-NEXT: store i32 0, ptr [[DOTOMP_COMB_LB]], align 4
971 // CHECK1-NEXT: store i32 99, ptr [[DOTOMP_COMB_UB]], align 4
972 // CHECK1-NEXT: store i32 1, ptr [[DOTOMP_STRIDE]], align 4
973 // CHECK1-NEXT: store i32 0, ptr [[DOTOMP_IS_LAST]], align 4
974 // CHECK1-NEXT: [[TMP1:%.*]] = load ptr, ptr [[DOTGLOBAL_TID__ADDR]], align 8
975 // CHECK1-NEXT: [[TMP2:%.*]] = load i32, ptr [[TMP1]], align 4
976 // CHECK1-NEXT: call void @__kmpc_for_static_init_4(ptr @[[GLOB1]], i32 [[TMP2]], i32 92, ptr [[DOTOMP_IS_LAST]], ptr [[DOTOMP_COMB_LB]], ptr [[DOTOMP_COMB_UB]], ptr [[DOTOMP_STRIDE]], i32 1, i32 1)
977 // CHECK1-NEXT: [[TMP3:%.*]] = load i32, ptr [[DOTOMP_COMB_UB]], align 4
978 // CHECK1-NEXT: [[CMP:%.*]] = icmp sgt i32 [[TMP3]], 99
979 // CHECK1-NEXT: br i1 [[CMP]], label [[COND_TRUE:%.*]], label [[COND_FALSE:%.*]]
980 // CHECK1: cond.true:
981 // CHECK1-NEXT: br label [[COND_END:%.*]]
982 // CHECK1: cond.false:
983 // CHECK1-NEXT: [[TMP4:%.*]] = load i32, ptr [[DOTOMP_COMB_UB]], align 4
984 // CHECK1-NEXT: br label [[COND_END]]
985 // CHECK1: cond.end:
986 // CHECK1-NEXT: [[COND:%.*]] = phi i32 [ 99, [[COND_TRUE]] ], [ [[TMP4]], [[COND_FALSE]] ]
987 // CHECK1-NEXT: store i32 [[COND]], ptr [[DOTOMP_COMB_UB]], align 4
988 // CHECK1-NEXT: [[TMP5:%.*]] = load i32, ptr [[DOTOMP_COMB_LB]], align 4
989 // CHECK1-NEXT: store i32 [[TMP5]], ptr [[DOTOMP_IV]], align 4
990 // CHECK1-NEXT: br label [[OMP_INNER_FOR_COND:%.*]]
991 // CHECK1: omp.inner.for.cond:
992 // CHECK1-NEXT: [[TMP6:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP38:![0-9]+]]
993 // CHECK1-NEXT: [[TMP7:%.*]] = load i32, ptr [[DOTOMP_COMB_UB]], align 4, !llvm.access.group [[ACC_GRP38]]
994 // CHECK1-NEXT: [[CMP1:%.*]] = icmp sle i32 [[TMP6]], [[TMP7]]
995 // CHECK1-NEXT: br i1 [[CMP1]], label [[OMP_INNER_FOR_BODY:%.*]], label [[OMP_INNER_FOR_END:%.*]]
996 // CHECK1: omp.inner.for.body:
997 // CHECK1-NEXT: [[TMP8:%.*]] = load i32, ptr [[DOTOMP_COMB_LB]], align 4, !llvm.access.group [[ACC_GRP38]]
998 // CHECK1-NEXT: [[TMP9:%.*]] = zext i32 [[TMP8]] to i64
999 // CHECK1-NEXT: [[TMP10:%.*]] = load i32, ptr [[DOTOMP_COMB_UB]], align 4, !llvm.access.group [[ACC_GRP38]]
1000 // CHECK1-NEXT: [[TMP11:%.*]] = zext i32 [[TMP10]] to i64
1001 // CHECK1-NEXT: [[TMP12:%.*]] = load i32, ptr [[TMP0]], align 4, !llvm.access.group [[ACC_GRP38]]
1002 // CHECK1-NEXT: [[TOBOOL:%.*]] = icmp ne i32 [[TMP12]], 0
1003 // CHECK1-NEXT: br i1 [[TOBOOL]], label [[OMP_IF_THEN:%.*]], label [[OMP_IF_ELSE:%.*]]
1004 // CHECK1: omp_if.then:
1005 // CHECK1-NEXT: call void (ptr, i32, ptr, ...) @__kmpc_fork_call(ptr @[[GLOB3]], i32 2, ptr @{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}_main_l99.omp_outlined.omp_outlined, i64 [[TMP9]], i64 [[TMP11]]), !llvm.access.group [[ACC_GRP38]]
1006 // CHECK1-NEXT: br label [[OMP_IF_END:%.*]]
1007 // CHECK1: omp_if.else:
1008 // CHECK1-NEXT: call void @__kmpc_serialized_parallel(ptr @[[GLOB3]], i32 [[TMP2]]), !llvm.access.group [[ACC_GRP38]]
1009 // CHECK1-NEXT: [[TMP13:%.*]] = load ptr, ptr [[DOTGLOBAL_TID__ADDR]], align 8, !llvm.access.group [[ACC_GRP38]]
1010 // CHECK1-NEXT: store i32 0, ptr [[DOTBOUND_ZERO_ADDR]], align 4, !llvm.access.group [[ACC_GRP38]]
1011 // CHECK1-NEXT: call void @{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}_main_l99.omp_outlined.omp_outlined(ptr [[TMP13]], ptr [[DOTBOUND_ZERO_ADDR]], i64 [[TMP9]], i64 [[TMP11]]) #[[ATTR2]], !llvm.access.group [[ACC_GRP38]]
1012 // CHECK1-NEXT: call void @__kmpc_end_serialized_parallel(ptr @[[GLOB3]], i32 [[TMP2]]), !llvm.access.group [[ACC_GRP38]]
1013 // CHECK1-NEXT: br label [[OMP_IF_END]]
1014 // CHECK1: omp_if.end:
1015 // CHECK1-NEXT: br label [[OMP_INNER_FOR_INC:%.*]]
1016 // CHECK1: omp.inner.for.inc:
1017 // CHECK1-NEXT: [[TMP14:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP38]]
1018 // CHECK1-NEXT: [[TMP15:%.*]] = load i32, ptr [[DOTOMP_STRIDE]], align 4, !llvm.access.group [[ACC_GRP38]]
1019 // CHECK1-NEXT: [[ADD:%.*]] = add nsw i32 [[TMP14]], [[TMP15]]
1020 // CHECK1-NEXT: store i32 [[ADD]], ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP38]]
1021 // CHECK1-NEXT: br label [[OMP_INNER_FOR_COND]], !llvm.loop [[LOOP39:![0-9]+]]
1022 // CHECK1: omp.inner.for.end:
1023 // CHECK1-NEXT: br label [[OMP_LOOP_EXIT:%.*]]
1024 // CHECK1: omp.loop.exit:
1025 // CHECK1-NEXT: call void @__kmpc_for_static_fini(ptr @[[GLOB1]], i32 [[TMP2]])
1026 // CHECK1-NEXT: [[TMP16:%.*]] = load i32, ptr [[DOTOMP_IS_LAST]], align 4
1027 // CHECK1-NEXT: [[TMP17:%.*]] = icmp ne i32 [[TMP16]], 0
1028 // CHECK1-NEXT: br i1 [[TMP17]], label [[DOTOMP_FINAL_THEN:%.*]], label [[DOTOMP_FINAL_DONE:%.*]]
1029 // CHECK1: .omp.final.then:
1030 // CHECK1-NEXT: store i32 100, ptr [[I]], align 4
1031 // CHECK1-NEXT: br label [[DOTOMP_FINAL_DONE]]
1032 // CHECK1: .omp.final.done:
1033 // CHECK1-NEXT: ret void
1036 // CHECK1-LABEL: define {{[^@]+}}@{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}_main_l99.omp_outlined.omp_outlined
1037 // CHECK1-SAME: (ptr noalias noundef [[DOTGLOBAL_TID_:%.*]], ptr noalias noundef [[DOTBOUND_TID_:%.*]], i64 noundef [[DOTPREVIOUS_LB_:%.*]], i64 noundef [[DOTPREVIOUS_UB_:%.*]]) #[[ATTR1]] {
1038 // CHECK1-NEXT: entry:
1039 // CHECK1-NEXT: [[DOTGLOBAL_TID__ADDR:%.*]] = alloca ptr, align 8
1040 // CHECK1-NEXT: [[DOTBOUND_TID__ADDR:%.*]] = alloca ptr, align 8
1041 // CHECK1-NEXT: [[DOTPREVIOUS_LB__ADDR:%.*]] = alloca i64, align 8
1042 // CHECK1-NEXT: [[DOTPREVIOUS_UB__ADDR:%.*]] = alloca i64, align 8
1043 // CHECK1-NEXT: [[DOTOMP_IV:%.*]] = alloca i32, align 4
1044 // CHECK1-NEXT: [[TMP:%.*]] = alloca i32, align 4
1045 // CHECK1-NEXT: [[DOTOMP_LB:%.*]] = alloca i32, align 4
1046 // CHECK1-NEXT: [[DOTOMP_UB:%.*]] = alloca i32, align 4
1047 // CHECK1-NEXT: [[DOTOMP_STRIDE:%.*]] = alloca i32, align 4
1048 // CHECK1-NEXT: [[DOTOMP_IS_LAST:%.*]] = alloca i32, align 4
1049 // CHECK1-NEXT: [[I:%.*]] = alloca i32, align 4
1050 // CHECK1-NEXT: store ptr [[DOTGLOBAL_TID_]], ptr [[DOTGLOBAL_TID__ADDR]], align 8
1051 // CHECK1-NEXT: store ptr [[DOTBOUND_TID_]], ptr [[DOTBOUND_TID__ADDR]], align 8
1052 // CHECK1-NEXT: store i64 [[DOTPREVIOUS_LB_]], ptr [[DOTPREVIOUS_LB__ADDR]], align 8
1053 // CHECK1-NEXT: store i64 [[DOTPREVIOUS_UB_]], ptr [[DOTPREVIOUS_UB__ADDR]], align 8
1054 // CHECK1-NEXT: store i32 0, ptr [[DOTOMP_LB]], align 4
1055 // CHECK1-NEXT: store i32 99, ptr [[DOTOMP_UB]], align 4
1056 // CHECK1-NEXT: [[TMP0:%.*]] = load i64, ptr [[DOTPREVIOUS_LB__ADDR]], align 8
1057 // CHECK1-NEXT: [[CONV:%.*]] = trunc i64 [[TMP0]] to i32
1058 // CHECK1-NEXT: [[TMP1:%.*]] = load i64, ptr [[DOTPREVIOUS_UB__ADDR]], align 8
1059 // CHECK1-NEXT: [[CONV1:%.*]] = trunc i64 [[TMP1]] to i32
1060 // CHECK1-NEXT: store i32 [[CONV]], ptr [[DOTOMP_LB]], align 4
1061 // CHECK1-NEXT: store i32 [[CONV1]], ptr [[DOTOMP_UB]], align 4
1062 // CHECK1-NEXT: store i32 1, ptr [[DOTOMP_STRIDE]], align 4
1063 // CHECK1-NEXT: store i32 0, ptr [[DOTOMP_IS_LAST]], align 4
1064 // CHECK1-NEXT: [[TMP2:%.*]] = load ptr, ptr [[DOTGLOBAL_TID__ADDR]], align 8
1065 // CHECK1-NEXT: [[TMP3:%.*]] = load i32, ptr [[TMP2]], align 4
1066 // CHECK1-NEXT: call void @__kmpc_for_static_init_4(ptr @[[GLOB2]], i32 [[TMP3]], i32 34, ptr [[DOTOMP_IS_LAST]], ptr [[DOTOMP_LB]], ptr [[DOTOMP_UB]], ptr [[DOTOMP_STRIDE]], i32 1, i32 1)
1067 // CHECK1-NEXT: [[TMP4:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4
1068 // CHECK1-NEXT: [[CMP:%.*]] = icmp sgt i32 [[TMP4]], 99
1069 // CHECK1-NEXT: br i1 [[CMP]], label [[COND_TRUE:%.*]], label [[COND_FALSE:%.*]]
1070 // CHECK1: cond.true:
1071 // CHECK1-NEXT: br label [[COND_END:%.*]]
1072 // CHECK1: cond.false:
1073 // CHECK1-NEXT: [[TMP5:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4
1074 // CHECK1-NEXT: br label [[COND_END]]
1075 // CHECK1: cond.end:
1076 // CHECK1-NEXT: [[COND:%.*]] = phi i32 [ 99, [[COND_TRUE]] ], [ [[TMP5]], [[COND_FALSE]] ]
1077 // CHECK1-NEXT: store i32 [[COND]], ptr [[DOTOMP_UB]], align 4
1078 // CHECK1-NEXT: [[TMP6:%.*]] = load i32, ptr [[DOTOMP_LB]], align 4
1079 // CHECK1-NEXT: store i32 [[TMP6]], ptr [[DOTOMP_IV]], align 4
1080 // CHECK1-NEXT: br label [[OMP_INNER_FOR_COND:%.*]]
1081 // CHECK1: omp.inner.for.cond:
1082 // CHECK1-NEXT: [[TMP7:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP41:![0-9]+]]
1083 // CHECK1-NEXT: [[TMP8:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4, !llvm.access.group [[ACC_GRP41]]
1084 // CHECK1-NEXT: [[CMP2:%.*]] = icmp sle i32 [[TMP7]], [[TMP8]]
1085 // CHECK1-NEXT: br i1 [[CMP2]], label [[OMP_INNER_FOR_BODY:%.*]], label [[OMP_INNER_FOR_END:%.*]]
1086 // CHECK1: omp.inner.for.body:
1087 // CHECK1-NEXT: [[TMP9:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP41]]
1088 // CHECK1-NEXT: [[MUL:%.*]] = mul nsw i32 [[TMP9]], 1
1089 // CHECK1-NEXT: [[ADD:%.*]] = add nsw i32 0, [[MUL]]
1090 // CHECK1-NEXT: store i32 [[ADD]], ptr [[I]], align 4, !llvm.access.group [[ACC_GRP41]]
1091 // CHECK1-NEXT: call void @_Z3fn6v(), !llvm.access.group [[ACC_GRP41]]
1092 // CHECK1-NEXT: br label [[OMP_BODY_CONTINUE:%.*]]
1093 // CHECK1: omp.body.continue:
1094 // CHECK1-NEXT: br label [[OMP_INNER_FOR_INC:%.*]]
1095 // CHECK1: omp.inner.for.inc:
1096 // CHECK1-NEXT: [[TMP10:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP41]]
1097 // CHECK1-NEXT: [[ADD3:%.*]] = add nsw i32 [[TMP10]], 1
1098 // CHECK1-NEXT: store i32 [[ADD3]], ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP41]]
1099 // CHECK1-NEXT: br label [[OMP_INNER_FOR_COND]], !llvm.loop [[LOOP42:![0-9]+]]
1100 // CHECK1: omp.inner.for.end:
1101 // CHECK1-NEXT: br label [[OMP_LOOP_EXIT:%.*]]
1102 // CHECK1: omp.loop.exit:
1103 // CHECK1-NEXT: call void @__kmpc_for_static_fini(ptr @[[GLOB1]], i32 [[TMP3]])
1104 // CHECK1-NEXT: [[TMP11:%.*]] = load i32, ptr [[DOTOMP_IS_LAST]], align 4
1105 // CHECK1-NEXT: [[TMP12:%.*]] = icmp ne i32 [[TMP11]], 0
1106 // CHECK1-NEXT: br i1 [[TMP12]], label [[DOTOMP_FINAL_THEN:%.*]], label [[DOTOMP_FINAL_DONE:%.*]]
1107 // CHECK1: .omp.final.then:
1108 // CHECK1-NEXT: store i32 100, ptr [[I]], align 4
1109 // CHECK1-NEXT: br label [[DOTOMP_FINAL_DONE]]
1110 // CHECK1: .omp.final.done:
1111 // CHECK1-NEXT: ret void
1114 // CHECK1-LABEL: define {{[^@]+}}@_Z5tmainIiEiT_
1115 // CHECK1-SAME: (i32 noundef [[ARG:%.*]]) #[[ATTR0]] comdat {
1116 // CHECK1-NEXT: entry:
1117 // CHECK1-NEXT: [[ARG_ADDR:%.*]] = alloca i32, align 4
1118 // CHECK1-NEXT: [[TMP:%.*]] = alloca i32, align 4
1119 // CHECK1-NEXT: [[KERNEL_ARGS:%.*]] = alloca [[STRUCT___TGT_KERNEL_ARGUMENTS:%.*]], align 8
1120 // CHECK1-NEXT: [[_TMP1:%.*]] = alloca i32, align 4
1121 // CHECK1-NEXT: [[KERNEL_ARGS2:%.*]] = alloca [[STRUCT___TGT_KERNEL_ARGUMENTS]], align 8
1122 // CHECK1-NEXT: [[ARG_CASTED:%.*]] = alloca i64, align 8
1123 // CHECK1-NEXT: [[DOTOFFLOAD_BASEPTRS:%.*]] = alloca [1 x ptr], align 8
1124 // CHECK1-NEXT: [[DOTOFFLOAD_PTRS:%.*]] = alloca [1 x ptr], align 8
1125 // CHECK1-NEXT: [[DOTOFFLOAD_MAPPERS:%.*]] = alloca [1 x ptr], align 8
1126 // CHECK1-NEXT: [[_TMP5:%.*]] = alloca i32, align 4
1127 // CHECK1-NEXT: [[KERNEL_ARGS6:%.*]] = alloca [[STRUCT___TGT_KERNEL_ARGUMENTS]], align 8
1128 // CHECK1-NEXT: store i32 [[ARG]], ptr [[ARG_ADDR]], align 4
1129 // CHECK1-NEXT: [[TMP0:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 0
1130 // CHECK1-NEXT: store i32 2, ptr [[TMP0]], align 4
1131 // CHECK1-NEXT: [[TMP1:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 1
1132 // CHECK1-NEXT: store i32 0, ptr [[TMP1]], align 4
1133 // CHECK1-NEXT: [[TMP2:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 2
1134 // CHECK1-NEXT: store ptr null, ptr [[TMP2]], align 8
1135 // CHECK1-NEXT: [[TMP3:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 3
1136 // CHECK1-NEXT: store ptr null, ptr [[TMP3]], align 8
1137 // CHECK1-NEXT: [[TMP4:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 4
1138 // CHECK1-NEXT: store ptr null, ptr [[TMP4]], align 8
1139 // CHECK1-NEXT: [[TMP5:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 5
1140 // CHECK1-NEXT: store ptr null, ptr [[TMP5]], align 8
1141 // CHECK1-NEXT: [[TMP6:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 6
1142 // CHECK1-NEXT: store ptr null, ptr [[TMP6]], align 8
1143 // CHECK1-NEXT: [[TMP7:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 7
1144 // CHECK1-NEXT: store ptr null, ptr [[TMP7]], align 8
1145 // CHECK1-NEXT: [[TMP8:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 8
1146 // CHECK1-NEXT: store i64 100, ptr [[TMP8]], align 8
1147 // CHECK1-NEXT: [[TMP9:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 9
1148 // CHECK1-NEXT: store i64 0, ptr [[TMP9]], align 8
1149 // CHECK1-NEXT: [[TMP10:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 10
1150 // CHECK1-NEXT: store [3 x i32] zeroinitializer, ptr [[TMP10]], align 4
1151 // CHECK1-NEXT: [[TMP11:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 11
1152 // CHECK1-NEXT: store [3 x i32] zeroinitializer, ptr [[TMP11]], align 4
1153 // CHECK1-NEXT: [[TMP12:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 12
1154 // CHECK1-NEXT: store i32 0, ptr [[TMP12]], align 4
1155 // CHECK1-NEXT: [[TMP13:%.*]] = call i32 @__tgt_target_kernel(ptr @[[GLOB3]], i64 -1, i32 0, i32 0, ptr @.{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z5tmainIiEiT__l59.region_id, ptr [[KERNEL_ARGS]])
1156 // CHECK1-NEXT: [[TMP14:%.*]] = icmp ne i32 [[TMP13]], 0
1157 // CHECK1-NEXT: br i1 [[TMP14]], label [[OMP_OFFLOAD_FAILED:%.*]], label [[OMP_OFFLOAD_CONT:%.*]]
1158 // CHECK1: omp_offload.failed:
1159 // CHECK1-NEXT: call void @{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z5tmainIiEiT__l59() #[[ATTR2]]
1160 // CHECK1-NEXT: br label [[OMP_OFFLOAD_CONT]]
1161 // CHECK1: omp_offload.cont:
1162 // CHECK1-NEXT: [[TMP15:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS2]], i32 0, i32 0
1163 // CHECK1-NEXT: store i32 2, ptr [[TMP15]], align 4
1164 // CHECK1-NEXT: [[TMP16:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS2]], i32 0, i32 1
1165 // CHECK1-NEXT: store i32 0, ptr [[TMP16]], align 4
1166 // CHECK1-NEXT: [[TMP17:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS2]], i32 0, i32 2
1167 // CHECK1-NEXT: store ptr null, ptr [[TMP17]], align 8
1168 // CHECK1-NEXT: [[TMP18:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS2]], i32 0, i32 3
1169 // CHECK1-NEXT: store ptr null, ptr [[TMP18]], align 8
1170 // CHECK1-NEXT: [[TMP19:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS2]], i32 0, i32 4
1171 // CHECK1-NEXT: store ptr null, ptr [[TMP19]], align 8
1172 // CHECK1-NEXT: [[TMP20:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS2]], i32 0, i32 5
1173 // CHECK1-NEXT: store ptr null, ptr [[TMP20]], align 8
1174 // CHECK1-NEXT: [[TMP21:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS2]], i32 0, i32 6
1175 // CHECK1-NEXT: store ptr null, ptr [[TMP21]], align 8
1176 // CHECK1-NEXT: [[TMP22:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS2]], i32 0, i32 7
1177 // CHECK1-NEXT: store ptr null, ptr [[TMP22]], align 8
1178 // CHECK1-NEXT: [[TMP23:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS2]], i32 0, i32 8
1179 // CHECK1-NEXT: store i64 100, ptr [[TMP23]], align 8
1180 // CHECK1-NEXT: [[TMP24:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS2]], i32 0, i32 9
1181 // CHECK1-NEXT: store i64 0, ptr [[TMP24]], align 8
1182 // CHECK1-NEXT: [[TMP25:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS2]], i32 0, i32 10
1183 // CHECK1-NEXT: store [3 x i32] zeroinitializer, ptr [[TMP25]], align 4
1184 // CHECK1-NEXT: [[TMP26:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS2]], i32 0, i32 11
1185 // CHECK1-NEXT: store [3 x i32] zeroinitializer, ptr [[TMP26]], align 4
1186 // CHECK1-NEXT: [[TMP27:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS2]], i32 0, i32 12
1187 // CHECK1-NEXT: store i32 0, ptr [[TMP27]], align 4
1188 // CHECK1-NEXT: [[TMP28:%.*]] = call i32 @__tgt_target_kernel(ptr @[[GLOB3]], i64 -1, i32 0, i32 0, ptr @.{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z5tmainIiEiT__l65.region_id, ptr [[KERNEL_ARGS2]])
1189 // CHECK1-NEXT: [[TMP29:%.*]] = icmp ne i32 [[TMP28]], 0
1190 // CHECK1-NEXT: br i1 [[TMP29]], label [[OMP_OFFLOAD_FAILED3:%.*]], label [[OMP_OFFLOAD_CONT4:%.*]]
1191 // CHECK1: omp_offload.failed3:
1192 // CHECK1-NEXT: call void @{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z5tmainIiEiT__l65() #[[ATTR2]]
1193 // CHECK1-NEXT: br label [[OMP_OFFLOAD_CONT4]]
1194 // CHECK1: omp_offload.cont4:
1195 // CHECK1-NEXT: [[TMP30:%.*]] = load i32, ptr [[ARG_ADDR]], align 4
1196 // CHECK1-NEXT: store i32 [[TMP30]], ptr [[ARG_CASTED]], align 4
1197 // CHECK1-NEXT: [[TMP31:%.*]] = load i64, ptr [[ARG_CASTED]], align 8
1198 // CHECK1-NEXT: [[TMP32:%.*]] = getelementptr inbounds [1 x ptr], ptr [[DOTOFFLOAD_BASEPTRS]], i32 0, i32 0
1199 // CHECK1-NEXT: store i64 [[TMP31]], ptr [[TMP32]], align 8
1200 // CHECK1-NEXT: [[TMP33:%.*]] = getelementptr inbounds [1 x ptr], ptr [[DOTOFFLOAD_PTRS]], i32 0, i32 0
1201 // CHECK1-NEXT: store i64 [[TMP31]], ptr [[TMP33]], align 8
1202 // CHECK1-NEXT: [[TMP34:%.*]] = getelementptr inbounds [1 x ptr], ptr [[DOTOFFLOAD_MAPPERS]], i64 0, i64 0
1203 // CHECK1-NEXT: store ptr null, ptr [[TMP34]], align 8
1204 // CHECK1-NEXT: [[TMP35:%.*]] = getelementptr inbounds [1 x ptr], ptr [[DOTOFFLOAD_BASEPTRS]], i32 0, i32 0
1205 // CHECK1-NEXT: [[TMP36:%.*]] = getelementptr inbounds [1 x ptr], ptr [[DOTOFFLOAD_PTRS]], i32 0, i32 0
1206 // CHECK1-NEXT: [[TMP37:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS6]], i32 0, i32 0
1207 // CHECK1-NEXT: store i32 2, ptr [[TMP37]], align 4
1208 // CHECK1-NEXT: [[TMP38:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS6]], i32 0, i32 1
1209 // CHECK1-NEXT: store i32 1, ptr [[TMP38]], align 4
1210 // CHECK1-NEXT: [[TMP39:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS6]], i32 0, i32 2
1211 // CHECK1-NEXT: store ptr [[TMP35]], ptr [[TMP39]], align 8
1212 // CHECK1-NEXT: [[TMP40:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS6]], i32 0, i32 3
1213 // CHECK1-NEXT: store ptr [[TMP36]], ptr [[TMP40]], align 8
1214 // CHECK1-NEXT: [[TMP41:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS6]], i32 0, i32 4
1215 // CHECK1-NEXT: store ptr @.offload_sizes.1, ptr [[TMP41]], align 8
1216 // CHECK1-NEXT: [[TMP42:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS6]], i32 0, i32 5
1217 // CHECK1-NEXT: store ptr @.offload_maptypes.2, ptr [[TMP42]], align 8
1218 // CHECK1-NEXT: [[TMP43:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS6]], i32 0, i32 6
1219 // CHECK1-NEXT: store ptr null, ptr [[TMP43]], align 8
1220 // CHECK1-NEXT: [[TMP44:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS6]], i32 0, i32 7
1221 // CHECK1-NEXT: store ptr null, ptr [[TMP44]], align 8
1222 // CHECK1-NEXT: [[TMP45:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS6]], i32 0, i32 8
1223 // CHECK1-NEXT: store i64 100, ptr [[TMP45]], align 8
1224 // CHECK1-NEXT: [[TMP46:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS6]], i32 0, i32 9
1225 // CHECK1-NEXT: store i64 0, ptr [[TMP46]], align 8
1226 // CHECK1-NEXT: [[TMP47:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS6]], i32 0, i32 10
1227 // CHECK1-NEXT: store [3 x i32] zeroinitializer, ptr [[TMP47]], align 4
1228 // CHECK1-NEXT: [[TMP48:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS6]], i32 0, i32 11
1229 // CHECK1-NEXT: store [3 x i32] zeroinitializer, ptr [[TMP48]], align 4
1230 // CHECK1-NEXT: [[TMP49:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS6]], i32 0, i32 12
1231 // CHECK1-NEXT: store i32 0, ptr [[TMP49]], align 4
1232 // CHECK1-NEXT: [[TMP50:%.*]] = call i32 @__tgt_target_kernel(ptr @[[GLOB3]], i64 -1, i32 0, i32 0, ptr @.{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z5tmainIiEiT__l71.region_id, ptr [[KERNEL_ARGS6]])
1233 // CHECK1-NEXT: [[TMP51:%.*]] = icmp ne i32 [[TMP50]], 0
1234 // CHECK1-NEXT: br i1 [[TMP51]], label [[OMP_OFFLOAD_FAILED7:%.*]], label [[OMP_OFFLOAD_CONT8:%.*]]
1235 // CHECK1: omp_offload.failed7:
1236 // CHECK1-NEXT: call void @{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z5tmainIiEiT__l71(i64 [[TMP31]]) #[[ATTR2]]
1237 // CHECK1-NEXT: br label [[OMP_OFFLOAD_CONT8]]
1238 // CHECK1: omp_offload.cont8:
1239 // CHECK1-NEXT: ret i32 0
1242 // CHECK1-LABEL: define {{[^@]+}}@{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z5tmainIiEiT__l59
1243 // CHECK1-SAME: () #[[ATTR1]] {
1244 // CHECK1-NEXT: entry:
1245 // CHECK1-NEXT: call void (ptr, i32, ptr, ...) @__kmpc_fork_teams(ptr @[[GLOB3]], i32 0, ptr @{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z5tmainIiEiT__l59.omp_outlined)
1246 // CHECK1-NEXT: ret void
1249 // CHECK1-LABEL: define {{[^@]+}}@{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z5tmainIiEiT__l59.omp_outlined
1250 // CHECK1-SAME: (ptr noalias noundef [[DOTGLOBAL_TID_:%.*]], ptr noalias noundef [[DOTBOUND_TID_:%.*]]) #[[ATTR1]] {
1251 // CHECK1-NEXT: entry:
1252 // CHECK1-NEXT: [[DOTGLOBAL_TID__ADDR:%.*]] = alloca ptr, align 8
1253 // CHECK1-NEXT: [[DOTBOUND_TID__ADDR:%.*]] = alloca ptr, align 8
1254 // CHECK1-NEXT: [[DOTOMP_IV:%.*]] = alloca i32, align 4
1255 // CHECK1-NEXT: [[TMP:%.*]] = alloca i32, align 4
1256 // CHECK1-NEXT: [[DOTOMP_COMB_LB:%.*]] = alloca i32, align 4
1257 // CHECK1-NEXT: [[DOTOMP_COMB_UB:%.*]] = alloca i32, align 4
1258 // CHECK1-NEXT: [[DOTOMP_STRIDE:%.*]] = alloca i32, align 4
1259 // CHECK1-NEXT: [[DOTOMP_IS_LAST:%.*]] = alloca i32, align 4
1260 // CHECK1-NEXT: [[I:%.*]] = alloca i32, align 4
1261 // CHECK1-NEXT: store ptr [[DOTGLOBAL_TID_]], ptr [[DOTGLOBAL_TID__ADDR]], align 8
1262 // CHECK1-NEXT: store ptr [[DOTBOUND_TID_]], ptr [[DOTBOUND_TID__ADDR]], align 8
1263 // CHECK1-NEXT: store i32 0, ptr [[DOTOMP_COMB_LB]], align 4
1264 // CHECK1-NEXT: store i32 99, ptr [[DOTOMP_COMB_UB]], align 4
1265 // CHECK1-NEXT: store i32 1, ptr [[DOTOMP_STRIDE]], align 4
1266 // CHECK1-NEXT: store i32 0, ptr [[DOTOMP_IS_LAST]], align 4
1267 // CHECK1-NEXT: [[TMP0:%.*]] = load ptr, ptr [[DOTGLOBAL_TID__ADDR]], align 8
1268 // CHECK1-NEXT: [[TMP1:%.*]] = load i32, ptr [[TMP0]], align 4
1269 // CHECK1-NEXT: call void @__kmpc_for_static_init_4(ptr @[[GLOB1]], i32 [[TMP1]], i32 92, ptr [[DOTOMP_IS_LAST]], ptr [[DOTOMP_COMB_LB]], ptr [[DOTOMP_COMB_UB]], ptr [[DOTOMP_STRIDE]], i32 1, i32 1)
1270 // CHECK1-NEXT: [[TMP2:%.*]] = load i32, ptr [[DOTOMP_COMB_UB]], align 4
1271 // CHECK1-NEXT: [[CMP:%.*]] = icmp sgt i32 [[TMP2]], 99
1272 // CHECK1-NEXT: br i1 [[CMP]], label [[COND_TRUE:%.*]], label [[COND_FALSE:%.*]]
1273 // CHECK1: cond.true:
1274 // CHECK1-NEXT: br label [[COND_END:%.*]]
1275 // CHECK1: cond.false:
1276 // CHECK1-NEXT: [[TMP3:%.*]] = load i32, ptr [[DOTOMP_COMB_UB]], align 4
1277 // CHECK1-NEXT: br label [[COND_END]]
1278 // CHECK1: cond.end:
1279 // CHECK1-NEXT: [[COND:%.*]] = phi i32 [ 99, [[COND_TRUE]] ], [ [[TMP3]], [[COND_FALSE]] ]
1280 // CHECK1-NEXT: store i32 [[COND]], ptr [[DOTOMP_COMB_UB]], align 4
1281 // CHECK1-NEXT: [[TMP4:%.*]] = load i32, ptr [[DOTOMP_COMB_LB]], align 4
1282 // CHECK1-NEXT: store i32 [[TMP4]], ptr [[DOTOMP_IV]], align 4
1283 // CHECK1-NEXT: br label [[OMP_INNER_FOR_COND:%.*]]
1284 // CHECK1: omp.inner.for.cond:
1285 // CHECK1-NEXT: [[TMP5:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP44:![0-9]+]]
1286 // CHECK1-NEXT: [[TMP6:%.*]] = load i32, ptr [[DOTOMP_COMB_UB]], align 4, !llvm.access.group [[ACC_GRP44]]
1287 // CHECK1-NEXT: [[CMP1:%.*]] = icmp sle i32 [[TMP5]], [[TMP6]]
1288 // CHECK1-NEXT: br i1 [[CMP1]], label [[OMP_INNER_FOR_BODY:%.*]], label [[OMP_INNER_FOR_END:%.*]]
1289 // CHECK1: omp.inner.for.body:
1290 // CHECK1-NEXT: [[TMP7:%.*]] = load i32, ptr [[DOTOMP_COMB_LB]], align 4, !llvm.access.group [[ACC_GRP44]]
1291 // CHECK1-NEXT: [[TMP8:%.*]] = zext i32 [[TMP7]] to i64
1292 // CHECK1-NEXT: [[TMP9:%.*]] = load i32, ptr [[DOTOMP_COMB_UB]], align 4, !llvm.access.group [[ACC_GRP44]]
1293 // CHECK1-NEXT: [[TMP10:%.*]] = zext i32 [[TMP9]] to i64
1294 // CHECK1-NEXT: call void (ptr, i32, ptr, ...) @__kmpc_fork_call(ptr @[[GLOB3]], i32 2, ptr @{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z5tmainIiEiT__l59.omp_outlined.omp_outlined, i64 [[TMP8]], i64 [[TMP10]]), !llvm.access.group [[ACC_GRP44]]
1295 // CHECK1-NEXT: br label [[OMP_INNER_FOR_INC:%.*]]
1296 // CHECK1: omp.inner.for.inc:
1297 // CHECK1-NEXT: [[TMP11:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP44]]
1298 // CHECK1-NEXT: [[TMP12:%.*]] = load i32, ptr [[DOTOMP_STRIDE]], align 4, !llvm.access.group [[ACC_GRP44]]
1299 // CHECK1-NEXT: [[ADD:%.*]] = add nsw i32 [[TMP11]], [[TMP12]]
1300 // CHECK1-NEXT: store i32 [[ADD]], ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP44]]
1301 // CHECK1-NEXT: br label [[OMP_INNER_FOR_COND]], !llvm.loop [[LOOP45:![0-9]+]]
1302 // CHECK1: omp.inner.for.end:
1303 // CHECK1-NEXT: br label [[OMP_LOOP_EXIT:%.*]]
1304 // CHECK1: omp.loop.exit:
1305 // CHECK1-NEXT: call void @__kmpc_for_static_fini(ptr @[[GLOB1]], i32 [[TMP1]])
1306 // CHECK1-NEXT: [[TMP13:%.*]] = load i32, ptr [[DOTOMP_IS_LAST]], align 4
1307 // CHECK1-NEXT: [[TMP14:%.*]] = icmp ne i32 [[TMP13]], 0
1308 // CHECK1-NEXT: br i1 [[TMP14]], label [[DOTOMP_FINAL_THEN:%.*]], label [[DOTOMP_FINAL_DONE:%.*]]
1309 // CHECK1: .omp.final.then:
1310 // CHECK1-NEXT: store i32 100, ptr [[I]], align 4
1311 // CHECK1-NEXT: br label [[DOTOMP_FINAL_DONE]]
1312 // CHECK1: .omp.final.done:
1313 // CHECK1-NEXT: ret void
1316 // CHECK1-LABEL: define {{[^@]+}}@{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z5tmainIiEiT__l59.omp_outlined.omp_outlined
1317 // CHECK1-SAME: (ptr noalias noundef [[DOTGLOBAL_TID_:%.*]], ptr noalias noundef [[DOTBOUND_TID_:%.*]], i64 noundef [[DOTPREVIOUS_LB_:%.*]], i64 noundef [[DOTPREVIOUS_UB_:%.*]]) #[[ATTR1]] {
1318 // CHECK1-NEXT: entry:
1319 // CHECK1-NEXT: [[DOTGLOBAL_TID__ADDR:%.*]] = alloca ptr, align 8
1320 // CHECK1-NEXT: [[DOTBOUND_TID__ADDR:%.*]] = alloca ptr, align 8
1321 // CHECK1-NEXT: [[DOTPREVIOUS_LB__ADDR:%.*]] = alloca i64, align 8
1322 // CHECK1-NEXT: [[DOTPREVIOUS_UB__ADDR:%.*]] = alloca i64, align 8
1323 // CHECK1-NEXT: [[DOTOMP_IV:%.*]] = alloca i32, align 4
1324 // CHECK1-NEXT: [[TMP:%.*]] = alloca i32, align 4
1325 // CHECK1-NEXT: [[DOTOMP_LB:%.*]] = alloca i32, align 4
1326 // CHECK1-NEXT: [[DOTOMP_UB:%.*]] = alloca i32, align 4
1327 // CHECK1-NEXT: [[DOTOMP_STRIDE:%.*]] = alloca i32, align 4
1328 // CHECK1-NEXT: [[DOTOMP_IS_LAST:%.*]] = alloca i32, align 4
1329 // CHECK1-NEXT: [[I:%.*]] = alloca i32, align 4
1330 // CHECK1-NEXT: store ptr [[DOTGLOBAL_TID_]], ptr [[DOTGLOBAL_TID__ADDR]], align 8
1331 // CHECK1-NEXT: store ptr [[DOTBOUND_TID_]], ptr [[DOTBOUND_TID__ADDR]], align 8
1332 // CHECK1-NEXT: store i64 [[DOTPREVIOUS_LB_]], ptr [[DOTPREVIOUS_LB__ADDR]], align 8
1333 // CHECK1-NEXT: store i64 [[DOTPREVIOUS_UB_]], ptr [[DOTPREVIOUS_UB__ADDR]], align 8
1334 // CHECK1-NEXT: store i32 0, ptr [[DOTOMP_LB]], align 4
1335 // CHECK1-NEXT: store i32 99, ptr [[DOTOMP_UB]], align 4
1336 // CHECK1-NEXT: [[TMP0:%.*]] = load i64, ptr [[DOTPREVIOUS_LB__ADDR]], align 8
1337 // CHECK1-NEXT: [[CONV:%.*]] = trunc i64 [[TMP0]] to i32
1338 // CHECK1-NEXT: [[TMP1:%.*]] = load i64, ptr [[DOTPREVIOUS_UB__ADDR]], align 8
1339 // CHECK1-NEXT: [[CONV1:%.*]] = trunc i64 [[TMP1]] to i32
1340 // CHECK1-NEXT: store i32 [[CONV]], ptr [[DOTOMP_LB]], align 4
1341 // CHECK1-NEXT: store i32 [[CONV1]], ptr [[DOTOMP_UB]], align 4
1342 // CHECK1-NEXT: store i32 1, ptr [[DOTOMP_STRIDE]], align 4
1343 // CHECK1-NEXT: store i32 0, ptr [[DOTOMP_IS_LAST]], align 4
1344 // CHECK1-NEXT: [[TMP2:%.*]] = load ptr, ptr [[DOTGLOBAL_TID__ADDR]], align 8
1345 // CHECK1-NEXT: [[TMP3:%.*]] = load i32, ptr [[TMP2]], align 4
1346 // CHECK1-NEXT: call void @__kmpc_for_static_init_4(ptr @[[GLOB2]], i32 [[TMP3]], i32 34, ptr [[DOTOMP_IS_LAST]], ptr [[DOTOMP_LB]], ptr [[DOTOMP_UB]], ptr [[DOTOMP_STRIDE]], i32 1, i32 1)
1347 // CHECK1-NEXT: [[TMP4:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4
1348 // CHECK1-NEXT: [[CMP:%.*]] = icmp sgt i32 [[TMP4]], 99
1349 // CHECK1-NEXT: br i1 [[CMP]], label [[COND_TRUE:%.*]], label [[COND_FALSE:%.*]]
1350 // CHECK1: cond.true:
1351 // CHECK1-NEXT: br label [[COND_END:%.*]]
1352 // CHECK1: cond.false:
1353 // CHECK1-NEXT: [[TMP5:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4
1354 // CHECK1-NEXT: br label [[COND_END]]
1355 // CHECK1: cond.end:
1356 // CHECK1-NEXT: [[COND:%.*]] = phi i32 [ 99, [[COND_TRUE]] ], [ [[TMP5]], [[COND_FALSE]] ]
1357 // CHECK1-NEXT: store i32 [[COND]], ptr [[DOTOMP_UB]], align 4
1358 // CHECK1-NEXT: [[TMP6:%.*]] = load i32, ptr [[DOTOMP_LB]], align 4
1359 // CHECK1-NEXT: store i32 [[TMP6]], ptr [[DOTOMP_IV]], align 4
1360 // CHECK1-NEXT: br label [[OMP_INNER_FOR_COND:%.*]]
1361 // CHECK1: omp.inner.for.cond:
1362 // CHECK1-NEXT: [[TMP7:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP47:![0-9]+]]
1363 // CHECK1-NEXT: [[TMP8:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4, !llvm.access.group [[ACC_GRP47]]
1364 // CHECK1-NEXT: [[CMP2:%.*]] = icmp sle i32 [[TMP7]], [[TMP8]]
1365 // CHECK1-NEXT: br i1 [[CMP2]], label [[OMP_INNER_FOR_BODY:%.*]], label [[OMP_INNER_FOR_END:%.*]]
1366 // CHECK1: omp.inner.for.body:
1367 // CHECK1-NEXT: [[TMP9:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP47]]
1368 // CHECK1-NEXT: [[MUL:%.*]] = mul nsw i32 [[TMP9]], 1
1369 // CHECK1-NEXT: [[ADD:%.*]] = add nsw i32 0, [[MUL]]
1370 // CHECK1-NEXT: store i32 [[ADD]], ptr [[I]], align 4, !llvm.access.group [[ACC_GRP47]]
1371 // CHECK1-NEXT: call void @_Z3fn1v(), !llvm.access.group [[ACC_GRP47]]
1372 // CHECK1-NEXT: br label [[OMP_BODY_CONTINUE:%.*]]
1373 // CHECK1: omp.body.continue:
1374 // CHECK1-NEXT: br label [[OMP_INNER_FOR_INC:%.*]]
1375 // CHECK1: omp.inner.for.inc:
1376 // CHECK1-NEXT: [[TMP10:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP47]]
1377 // CHECK1-NEXT: [[ADD3:%.*]] = add nsw i32 [[TMP10]], 1
1378 // CHECK1-NEXT: store i32 [[ADD3]], ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP47]]
1379 // CHECK1-NEXT: br label [[OMP_INNER_FOR_COND]], !llvm.loop [[LOOP48:![0-9]+]]
1380 // CHECK1: omp.inner.for.end:
1381 // CHECK1-NEXT: br label [[OMP_LOOP_EXIT:%.*]]
1382 // CHECK1: omp.loop.exit:
1383 // CHECK1-NEXT: call void @__kmpc_for_static_fini(ptr @[[GLOB1]], i32 [[TMP3]])
1384 // CHECK1-NEXT: [[TMP11:%.*]] = load i32, ptr [[DOTOMP_IS_LAST]], align 4
1385 // CHECK1-NEXT: [[TMP12:%.*]] = icmp ne i32 [[TMP11]], 0
1386 // CHECK1-NEXT: br i1 [[TMP12]], label [[DOTOMP_FINAL_THEN:%.*]], label [[DOTOMP_FINAL_DONE:%.*]]
1387 // CHECK1: .omp.final.then:
1388 // CHECK1-NEXT: store i32 100, ptr [[I]], align 4
1389 // CHECK1-NEXT: br label [[DOTOMP_FINAL_DONE]]
1390 // CHECK1: .omp.final.done:
1391 // CHECK1-NEXT: ret void
1394 // CHECK1-LABEL: define {{[^@]+}}@{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z5tmainIiEiT__l65
1395 // CHECK1-SAME: () #[[ATTR1]] {
1396 // CHECK1-NEXT: entry:
1397 // CHECK1-NEXT: call void (ptr, i32, ptr, ...) @__kmpc_fork_teams(ptr @[[GLOB3]], i32 0, ptr @{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z5tmainIiEiT__l65.omp_outlined)
1398 // CHECK1-NEXT: ret void
1401 // CHECK1-LABEL: define {{[^@]+}}@{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z5tmainIiEiT__l65.omp_outlined
1402 // CHECK1-SAME: (ptr noalias noundef [[DOTGLOBAL_TID_:%.*]], ptr noalias noundef [[DOTBOUND_TID_:%.*]]) #[[ATTR1]] {
1403 // CHECK1-NEXT: entry:
1404 // CHECK1-NEXT: [[DOTGLOBAL_TID__ADDR:%.*]] = alloca ptr, align 8
1405 // CHECK1-NEXT: [[DOTBOUND_TID__ADDR:%.*]] = alloca ptr, align 8
1406 // CHECK1-NEXT: [[DOTOMP_IV:%.*]] = alloca i32, align 4
1407 // CHECK1-NEXT: [[TMP:%.*]] = alloca i32, align 4
1408 // CHECK1-NEXT: [[DOTOMP_COMB_LB:%.*]] = alloca i32, align 4
1409 // CHECK1-NEXT: [[DOTOMP_COMB_UB:%.*]] = alloca i32, align 4
1410 // CHECK1-NEXT: [[DOTOMP_STRIDE:%.*]] = alloca i32, align 4
1411 // CHECK1-NEXT: [[DOTOMP_IS_LAST:%.*]] = alloca i32, align 4
1412 // CHECK1-NEXT: [[I:%.*]] = alloca i32, align 4
1413 // CHECK1-NEXT: [[DOTBOUND_ZERO_ADDR:%.*]] = alloca i32, align 4
1414 // CHECK1-NEXT: store ptr [[DOTGLOBAL_TID_]], ptr [[DOTGLOBAL_TID__ADDR]], align 8
1415 // CHECK1-NEXT: store ptr [[DOTBOUND_TID_]], ptr [[DOTBOUND_TID__ADDR]], align 8
1416 // CHECK1-NEXT: store i32 0, ptr [[DOTOMP_COMB_LB]], align 4
1417 // CHECK1-NEXT: store i32 99, ptr [[DOTOMP_COMB_UB]], align 4
1418 // CHECK1-NEXT: store i32 1, ptr [[DOTOMP_STRIDE]], align 4
1419 // CHECK1-NEXT: store i32 0, ptr [[DOTOMP_IS_LAST]], align 4
1420 // CHECK1-NEXT: [[TMP0:%.*]] = load ptr, ptr [[DOTGLOBAL_TID__ADDR]], align 8
1421 // CHECK1-NEXT: [[TMP1:%.*]] = load i32, ptr [[TMP0]], align 4
1422 // CHECK1-NEXT: call void @__kmpc_for_static_init_4(ptr @[[GLOB1]], i32 [[TMP1]], i32 92, ptr [[DOTOMP_IS_LAST]], ptr [[DOTOMP_COMB_LB]], ptr [[DOTOMP_COMB_UB]], ptr [[DOTOMP_STRIDE]], i32 1, i32 1)
1423 // CHECK1-NEXT: [[TMP2:%.*]] = load i32, ptr [[DOTOMP_COMB_UB]], align 4
1424 // CHECK1-NEXT: [[CMP:%.*]] = icmp sgt i32 [[TMP2]], 99
1425 // CHECK1-NEXT: br i1 [[CMP]], label [[COND_TRUE:%.*]], label [[COND_FALSE:%.*]]
1426 // CHECK1: cond.true:
1427 // CHECK1-NEXT: br label [[COND_END:%.*]]
1428 // CHECK1: cond.false:
1429 // CHECK1-NEXT: [[TMP3:%.*]] = load i32, ptr [[DOTOMP_COMB_UB]], align 4
1430 // CHECK1-NEXT: br label [[COND_END]]
1431 // CHECK1: cond.end:
1432 // CHECK1-NEXT: [[COND:%.*]] = phi i32 [ 99, [[COND_TRUE]] ], [ [[TMP3]], [[COND_FALSE]] ]
1433 // CHECK1-NEXT: store i32 [[COND]], ptr [[DOTOMP_COMB_UB]], align 4
1434 // CHECK1-NEXT: [[TMP4:%.*]] = load i32, ptr [[DOTOMP_COMB_LB]], align 4
1435 // CHECK1-NEXT: store i32 [[TMP4]], ptr [[DOTOMP_IV]], align 4
1436 // CHECK1-NEXT: br label [[OMP_INNER_FOR_COND:%.*]]
1437 // CHECK1: omp.inner.for.cond:
1438 // CHECK1-NEXT: [[TMP5:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP50:![0-9]+]]
1439 // CHECK1-NEXT: [[TMP6:%.*]] = load i32, ptr [[DOTOMP_COMB_UB]], align 4, !llvm.access.group [[ACC_GRP50]]
1440 // CHECK1-NEXT: [[CMP1:%.*]] = icmp sle i32 [[TMP5]], [[TMP6]]
1441 // CHECK1-NEXT: br i1 [[CMP1]], label [[OMP_INNER_FOR_BODY:%.*]], label [[OMP_INNER_FOR_END:%.*]]
1442 // CHECK1: omp.inner.for.body:
1443 // CHECK1-NEXT: [[TMP7:%.*]] = load i32, ptr [[DOTOMP_COMB_LB]], align 4, !llvm.access.group [[ACC_GRP50]]
1444 // CHECK1-NEXT: [[TMP8:%.*]] = zext i32 [[TMP7]] to i64
1445 // CHECK1-NEXT: [[TMP9:%.*]] = load i32, ptr [[DOTOMP_COMB_UB]], align 4, !llvm.access.group [[ACC_GRP50]]
1446 // CHECK1-NEXT: [[TMP10:%.*]] = zext i32 [[TMP9]] to i64
1447 // CHECK1-NEXT: call void @__kmpc_serialized_parallel(ptr @[[GLOB3]], i32 [[TMP1]]), !llvm.access.group [[ACC_GRP50]]
1448 // CHECK1-NEXT: [[TMP11:%.*]] = load ptr, ptr [[DOTGLOBAL_TID__ADDR]], align 8, !llvm.access.group [[ACC_GRP50]]
1449 // CHECK1-NEXT: store i32 0, ptr [[DOTBOUND_ZERO_ADDR]], align 4, !llvm.access.group [[ACC_GRP50]]
1450 // CHECK1-NEXT: call void @{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z5tmainIiEiT__l65.omp_outlined.omp_outlined(ptr [[TMP11]], ptr [[DOTBOUND_ZERO_ADDR]], i64 [[TMP8]], i64 [[TMP10]]) #[[ATTR2]], !llvm.access.group [[ACC_GRP50]]
1451 // CHECK1-NEXT: call void @__kmpc_end_serialized_parallel(ptr @[[GLOB3]], i32 [[TMP1]]), !llvm.access.group [[ACC_GRP50]]
1452 // CHECK1-NEXT: br label [[OMP_INNER_FOR_INC:%.*]]
1453 // CHECK1: omp.inner.for.inc:
1454 // CHECK1-NEXT: [[TMP12:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP50]]
1455 // CHECK1-NEXT: [[TMP13:%.*]] = load i32, ptr [[DOTOMP_STRIDE]], align 4, !llvm.access.group [[ACC_GRP50]]
1456 // CHECK1-NEXT: [[ADD:%.*]] = add nsw i32 [[TMP12]], [[TMP13]]
1457 // CHECK1-NEXT: store i32 [[ADD]], ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP50]]
1458 // CHECK1-NEXT: br label [[OMP_INNER_FOR_COND]], !llvm.loop [[LOOP51:![0-9]+]]
1459 // CHECK1: omp.inner.for.end:
1460 // CHECK1-NEXT: br label [[OMP_LOOP_EXIT:%.*]]
1461 // CHECK1: omp.loop.exit:
1462 // CHECK1-NEXT: call void @__kmpc_for_static_fini(ptr @[[GLOB1]], i32 [[TMP1]])
1463 // CHECK1-NEXT: [[TMP14:%.*]] = load i32, ptr [[DOTOMP_IS_LAST]], align 4
1464 // CHECK1-NEXT: [[TMP15:%.*]] = icmp ne i32 [[TMP14]], 0
1465 // CHECK1-NEXT: br i1 [[TMP15]], label [[DOTOMP_FINAL_THEN:%.*]], label [[DOTOMP_FINAL_DONE:%.*]]
1466 // CHECK1: .omp.final.then:
1467 // CHECK1-NEXT: store i32 100, ptr [[I]], align 4
1468 // CHECK1-NEXT: br label [[DOTOMP_FINAL_DONE]]
1469 // CHECK1: .omp.final.done:
1470 // CHECK1-NEXT: ret void
1473 // CHECK1-LABEL: define {{[^@]+}}@{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z5tmainIiEiT__l65.omp_outlined.omp_outlined
1474 // CHECK1-SAME: (ptr noalias noundef [[DOTGLOBAL_TID_:%.*]], ptr noalias noundef [[DOTBOUND_TID_:%.*]], i64 noundef [[DOTPREVIOUS_LB_:%.*]], i64 noundef [[DOTPREVIOUS_UB_:%.*]]) #[[ATTR1]] {
1475 // CHECK1-NEXT: entry:
1476 // CHECK1-NEXT: [[DOTGLOBAL_TID__ADDR:%.*]] = alloca ptr, align 8
1477 // CHECK1-NEXT: [[DOTBOUND_TID__ADDR:%.*]] = alloca ptr, align 8
1478 // CHECK1-NEXT: [[DOTPREVIOUS_LB__ADDR:%.*]] = alloca i64, align 8
1479 // CHECK1-NEXT: [[DOTPREVIOUS_UB__ADDR:%.*]] = alloca i64, align 8
1480 // CHECK1-NEXT: [[DOTOMP_IV:%.*]] = alloca i32, align 4
1481 // CHECK1-NEXT: [[TMP:%.*]] = alloca i32, align 4
1482 // CHECK1-NEXT: [[DOTOMP_LB:%.*]] = alloca i32, align 4
1483 // CHECK1-NEXT: [[DOTOMP_UB:%.*]] = alloca i32, align 4
1484 // CHECK1-NEXT: [[DOTOMP_STRIDE:%.*]] = alloca i32, align 4
1485 // CHECK1-NEXT: [[DOTOMP_IS_LAST:%.*]] = alloca i32, align 4
1486 // CHECK1-NEXT: [[I:%.*]] = alloca i32, align 4
1487 // CHECK1-NEXT: store ptr [[DOTGLOBAL_TID_]], ptr [[DOTGLOBAL_TID__ADDR]], align 8
1488 // CHECK1-NEXT: store ptr [[DOTBOUND_TID_]], ptr [[DOTBOUND_TID__ADDR]], align 8
1489 // CHECK1-NEXT: store i64 [[DOTPREVIOUS_LB_]], ptr [[DOTPREVIOUS_LB__ADDR]], align 8
1490 // CHECK1-NEXT: store i64 [[DOTPREVIOUS_UB_]], ptr [[DOTPREVIOUS_UB__ADDR]], align 8
1491 // CHECK1-NEXT: store i32 0, ptr [[DOTOMP_LB]], align 4
1492 // CHECK1-NEXT: store i32 99, ptr [[DOTOMP_UB]], align 4
1493 // CHECK1-NEXT: [[TMP0:%.*]] = load i64, ptr [[DOTPREVIOUS_LB__ADDR]], align 8
1494 // CHECK1-NEXT: [[CONV:%.*]] = trunc i64 [[TMP0]] to i32
1495 // CHECK1-NEXT: [[TMP1:%.*]] = load i64, ptr [[DOTPREVIOUS_UB__ADDR]], align 8
1496 // CHECK1-NEXT: [[CONV1:%.*]] = trunc i64 [[TMP1]] to i32
1497 // CHECK1-NEXT: store i32 [[CONV]], ptr [[DOTOMP_LB]], align 4
1498 // CHECK1-NEXT: store i32 [[CONV1]], ptr [[DOTOMP_UB]], align 4
1499 // CHECK1-NEXT: store i32 1, ptr [[DOTOMP_STRIDE]], align 4
1500 // CHECK1-NEXT: store i32 0, ptr [[DOTOMP_IS_LAST]], align 4
1501 // CHECK1-NEXT: [[TMP2:%.*]] = load ptr, ptr [[DOTGLOBAL_TID__ADDR]], align 8
1502 // CHECK1-NEXT: [[TMP3:%.*]] = load i32, ptr [[TMP2]], align 4
1503 // CHECK1-NEXT: call void @__kmpc_for_static_init_4(ptr @[[GLOB2]], i32 [[TMP3]], i32 34, ptr [[DOTOMP_IS_LAST]], ptr [[DOTOMP_LB]], ptr [[DOTOMP_UB]], ptr [[DOTOMP_STRIDE]], i32 1, i32 1)
1504 // CHECK1-NEXT: [[TMP4:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4
1505 // CHECK1-NEXT: [[CMP:%.*]] = icmp sgt i32 [[TMP4]], 99
1506 // CHECK1-NEXT: br i1 [[CMP]], label [[COND_TRUE:%.*]], label [[COND_FALSE:%.*]]
1507 // CHECK1: cond.true:
1508 // CHECK1-NEXT: br label [[COND_END:%.*]]
1509 // CHECK1: cond.false:
1510 // CHECK1-NEXT: [[TMP5:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4
1511 // CHECK1-NEXT: br label [[COND_END]]
1512 // CHECK1: cond.end:
1513 // CHECK1-NEXT: [[COND:%.*]] = phi i32 [ 99, [[COND_TRUE]] ], [ [[TMP5]], [[COND_FALSE]] ]
1514 // CHECK1-NEXT: store i32 [[COND]], ptr [[DOTOMP_UB]], align 4
1515 // CHECK1-NEXT: [[TMP6:%.*]] = load i32, ptr [[DOTOMP_LB]], align 4
1516 // CHECK1-NEXT: store i32 [[TMP6]], ptr [[DOTOMP_IV]], align 4
1517 // CHECK1-NEXT: br label [[OMP_INNER_FOR_COND:%.*]]
1518 // CHECK1: omp.inner.for.cond:
1519 // CHECK1-NEXT: [[TMP7:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP53:![0-9]+]]
1520 // CHECK1-NEXT: [[TMP8:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4, !llvm.access.group [[ACC_GRP53]]
1521 // CHECK1-NEXT: [[CMP2:%.*]] = icmp sle i32 [[TMP7]], [[TMP8]]
1522 // CHECK1-NEXT: br i1 [[CMP2]], label [[OMP_INNER_FOR_BODY:%.*]], label [[OMP_INNER_FOR_END:%.*]]
1523 // CHECK1: omp.inner.for.body:
1524 // CHECK1-NEXT: [[TMP9:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP53]]
1525 // CHECK1-NEXT: [[MUL:%.*]] = mul nsw i32 [[TMP9]], 1
1526 // CHECK1-NEXT: [[ADD:%.*]] = add nsw i32 0, [[MUL]]
1527 // CHECK1-NEXT: store i32 [[ADD]], ptr [[I]], align 4, !llvm.access.group [[ACC_GRP53]]
1528 // CHECK1-NEXT: call void @_Z3fn2v(), !llvm.access.group [[ACC_GRP53]]
1529 // CHECK1-NEXT: br label [[OMP_BODY_CONTINUE:%.*]]
1530 // CHECK1: omp.body.continue:
1531 // CHECK1-NEXT: br label [[OMP_INNER_FOR_INC:%.*]]
1532 // CHECK1: omp.inner.for.inc:
1533 // CHECK1-NEXT: [[TMP10:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP53]]
1534 // CHECK1-NEXT: [[ADD3:%.*]] = add nsw i32 [[TMP10]], 1
1535 // CHECK1-NEXT: store i32 [[ADD3]], ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP53]]
1536 // CHECK1-NEXT: br label [[OMP_INNER_FOR_COND]], !llvm.loop [[LOOP54:![0-9]+]]
1537 // CHECK1: omp.inner.for.end:
1538 // CHECK1-NEXT: br label [[OMP_LOOP_EXIT:%.*]]
1539 // CHECK1: omp.loop.exit:
1540 // CHECK1-NEXT: call void @__kmpc_for_static_fini(ptr @[[GLOB1]], i32 [[TMP3]])
1541 // CHECK1-NEXT: [[TMP11:%.*]] = load i32, ptr [[DOTOMP_IS_LAST]], align 4
1542 // CHECK1-NEXT: [[TMP12:%.*]] = icmp ne i32 [[TMP11]], 0
1543 // CHECK1-NEXT: br i1 [[TMP12]], label [[DOTOMP_FINAL_THEN:%.*]], label [[DOTOMP_FINAL_DONE:%.*]]
1544 // CHECK1: .omp.final.then:
1545 // CHECK1-NEXT: store i32 100, ptr [[I]], align 4
1546 // CHECK1-NEXT: br label [[DOTOMP_FINAL_DONE]]
1547 // CHECK1: .omp.final.done:
1548 // CHECK1-NEXT: ret void
1551 // CHECK1-LABEL: define {{[^@]+}}@{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z5tmainIiEiT__l71
1552 // CHECK1-SAME: (i64 noundef [[ARG:%.*]]) #[[ATTR1]] {
1553 // CHECK1-NEXT: entry:
1554 // CHECK1-NEXT: [[ARG_ADDR:%.*]] = alloca i64, align 8
1555 // CHECK1-NEXT: store i64 [[ARG]], ptr [[ARG_ADDR]], align 8
1556 // CHECK1-NEXT: call void (ptr, i32, ptr, ...) @__kmpc_fork_teams(ptr @[[GLOB3]], i32 1, ptr @{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z5tmainIiEiT__l71.omp_outlined, ptr [[ARG_ADDR]])
1557 // CHECK1-NEXT: ret void
1560 // CHECK1-LABEL: define {{[^@]+}}@{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z5tmainIiEiT__l71.omp_outlined
1561 // CHECK1-SAME: (ptr noalias noundef [[DOTGLOBAL_TID_:%.*]], ptr noalias noundef [[DOTBOUND_TID_:%.*]], ptr noundef nonnull align 4 dereferenceable(4) [[ARG:%.*]]) #[[ATTR1]] {
1562 // CHECK1-NEXT: entry:
1563 // CHECK1-NEXT: [[DOTGLOBAL_TID__ADDR:%.*]] = alloca ptr, align 8
1564 // CHECK1-NEXT: [[DOTBOUND_TID__ADDR:%.*]] = alloca ptr, align 8
1565 // CHECK1-NEXT: [[ARG_ADDR:%.*]] = alloca ptr, align 8
1566 // CHECK1-NEXT: [[DOTOMP_IV:%.*]] = alloca i32, align 4
1567 // CHECK1-NEXT: [[TMP:%.*]] = alloca i32, align 4
1568 // CHECK1-NEXT: [[DOTOMP_COMB_LB:%.*]] = alloca i32, align 4
1569 // CHECK1-NEXT: [[DOTOMP_COMB_UB:%.*]] = alloca i32, align 4
1570 // CHECK1-NEXT: [[DOTOMP_STRIDE:%.*]] = alloca i32, align 4
1571 // CHECK1-NEXT: [[DOTOMP_IS_LAST:%.*]] = alloca i32, align 4
1572 // CHECK1-NEXT: [[I:%.*]] = alloca i32, align 4
1573 // CHECK1-NEXT: [[DOTBOUND_ZERO_ADDR:%.*]] = alloca i32, align 4
1574 // CHECK1-NEXT: store ptr [[DOTGLOBAL_TID_]], ptr [[DOTGLOBAL_TID__ADDR]], align 8
1575 // CHECK1-NEXT: store ptr [[DOTBOUND_TID_]], ptr [[DOTBOUND_TID__ADDR]], align 8
1576 // CHECK1-NEXT: store ptr [[ARG]], ptr [[ARG_ADDR]], align 8
1577 // CHECK1-NEXT: [[TMP0:%.*]] = load ptr, ptr [[ARG_ADDR]], align 8
1578 // CHECK1-NEXT: store i32 0, ptr [[DOTOMP_COMB_LB]], align 4
1579 // CHECK1-NEXT: store i32 99, ptr [[DOTOMP_COMB_UB]], align 4
1580 // CHECK1-NEXT: store i32 1, ptr [[DOTOMP_STRIDE]], align 4
1581 // CHECK1-NEXT: store i32 0, ptr [[DOTOMP_IS_LAST]], align 4
1582 // CHECK1-NEXT: [[TMP1:%.*]] = load ptr, ptr [[DOTGLOBAL_TID__ADDR]], align 8
1583 // CHECK1-NEXT: [[TMP2:%.*]] = load i32, ptr [[TMP1]], align 4
1584 // CHECK1-NEXT: call void @__kmpc_for_static_init_4(ptr @[[GLOB1]], i32 [[TMP2]], i32 92, ptr [[DOTOMP_IS_LAST]], ptr [[DOTOMP_COMB_LB]], ptr [[DOTOMP_COMB_UB]], ptr [[DOTOMP_STRIDE]], i32 1, i32 1)
1585 // CHECK1-NEXT: [[TMP3:%.*]] = load i32, ptr [[DOTOMP_COMB_UB]], align 4
1586 // CHECK1-NEXT: [[CMP:%.*]] = icmp sgt i32 [[TMP3]], 99
1587 // CHECK1-NEXT: br i1 [[CMP]], label [[COND_TRUE:%.*]], label [[COND_FALSE:%.*]]
1588 // CHECK1: cond.true:
1589 // CHECK1-NEXT: br label [[COND_END:%.*]]
1590 // CHECK1: cond.false:
1591 // CHECK1-NEXT: [[TMP4:%.*]] = load i32, ptr [[DOTOMP_COMB_UB]], align 4
1592 // CHECK1-NEXT: br label [[COND_END]]
1593 // CHECK1: cond.end:
1594 // CHECK1-NEXT: [[COND:%.*]] = phi i32 [ 99, [[COND_TRUE]] ], [ [[TMP4]], [[COND_FALSE]] ]
1595 // CHECK1-NEXT: store i32 [[COND]], ptr [[DOTOMP_COMB_UB]], align 4
1596 // CHECK1-NEXT: [[TMP5:%.*]] = load i32, ptr [[DOTOMP_COMB_LB]], align 4
1597 // CHECK1-NEXT: store i32 [[TMP5]], ptr [[DOTOMP_IV]], align 4
1598 // CHECK1-NEXT: br label [[OMP_INNER_FOR_COND:%.*]]
1599 // CHECK1: omp.inner.for.cond:
1600 // CHECK1-NEXT: [[TMP6:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP56:![0-9]+]]
1601 // CHECK1-NEXT: [[TMP7:%.*]] = load i32, ptr [[DOTOMP_COMB_UB]], align 4, !llvm.access.group [[ACC_GRP56]]
1602 // CHECK1-NEXT: [[CMP1:%.*]] = icmp sle i32 [[TMP6]], [[TMP7]]
1603 // CHECK1-NEXT: br i1 [[CMP1]], label [[OMP_INNER_FOR_BODY:%.*]], label [[OMP_INNER_FOR_END:%.*]]
1604 // CHECK1: omp.inner.for.body:
1605 // CHECK1-NEXT: [[TMP8:%.*]] = load i32, ptr [[DOTOMP_COMB_LB]], align 4, !llvm.access.group [[ACC_GRP56]]
1606 // CHECK1-NEXT: [[TMP9:%.*]] = zext i32 [[TMP8]] to i64
1607 // CHECK1-NEXT: [[TMP10:%.*]] = load i32, ptr [[DOTOMP_COMB_UB]], align 4, !llvm.access.group [[ACC_GRP56]]
1608 // CHECK1-NEXT: [[TMP11:%.*]] = zext i32 [[TMP10]] to i64
1609 // CHECK1-NEXT: [[TMP12:%.*]] = load i32, ptr [[TMP0]], align 4, !llvm.access.group [[ACC_GRP56]]
1610 // CHECK1-NEXT: [[TOBOOL:%.*]] = icmp ne i32 [[TMP12]], 0
1611 // CHECK1-NEXT: br i1 [[TOBOOL]], label [[OMP_IF_THEN:%.*]], label [[OMP_IF_ELSE:%.*]]
1612 // CHECK1: omp_if.then:
1613 // CHECK1-NEXT: call void (ptr, i32, ptr, ...) @__kmpc_fork_call(ptr @[[GLOB3]], i32 2, ptr @{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z5tmainIiEiT__l71.omp_outlined.omp_outlined, i64 [[TMP9]], i64 [[TMP11]]), !llvm.access.group [[ACC_GRP56]]
1614 // CHECK1-NEXT: br label [[OMP_IF_END:%.*]]
1615 // CHECK1: omp_if.else:
1616 // CHECK1-NEXT: call void @__kmpc_serialized_parallel(ptr @[[GLOB3]], i32 [[TMP2]]), !llvm.access.group [[ACC_GRP56]]
1617 // CHECK1-NEXT: [[TMP13:%.*]] = load ptr, ptr [[DOTGLOBAL_TID__ADDR]], align 8, !llvm.access.group [[ACC_GRP56]]
1618 // CHECK1-NEXT: store i32 0, ptr [[DOTBOUND_ZERO_ADDR]], align 4, !llvm.access.group [[ACC_GRP56]]
1619 // CHECK1-NEXT: call void @{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z5tmainIiEiT__l71.omp_outlined.omp_outlined(ptr [[TMP13]], ptr [[DOTBOUND_ZERO_ADDR]], i64 [[TMP9]], i64 [[TMP11]]) #[[ATTR2]], !llvm.access.group [[ACC_GRP56]]
1620 // CHECK1-NEXT: call void @__kmpc_end_serialized_parallel(ptr @[[GLOB3]], i32 [[TMP2]]), !llvm.access.group [[ACC_GRP56]]
1621 // CHECK1-NEXT: br label [[OMP_IF_END]]
1622 // CHECK1: omp_if.end:
1623 // CHECK1-NEXT: br label [[OMP_INNER_FOR_INC:%.*]]
1624 // CHECK1: omp.inner.for.inc:
1625 // CHECK1-NEXT: [[TMP14:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP56]]
1626 // CHECK1-NEXT: [[TMP15:%.*]] = load i32, ptr [[DOTOMP_STRIDE]], align 4, !llvm.access.group [[ACC_GRP56]]
1627 // CHECK1-NEXT: [[ADD:%.*]] = add nsw i32 [[TMP14]], [[TMP15]]
1628 // CHECK1-NEXT: store i32 [[ADD]], ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP56]]
1629 // CHECK1-NEXT: br label [[OMP_INNER_FOR_COND]], !llvm.loop [[LOOP57:![0-9]+]]
1630 // CHECK1: omp.inner.for.end:
1631 // CHECK1-NEXT: br label [[OMP_LOOP_EXIT:%.*]]
1632 // CHECK1: omp.loop.exit:
1633 // CHECK1-NEXT: call void @__kmpc_for_static_fini(ptr @[[GLOB1]], i32 [[TMP2]])
1634 // CHECK1-NEXT: [[TMP16:%.*]] = load i32, ptr [[DOTOMP_IS_LAST]], align 4
1635 // CHECK1-NEXT: [[TMP17:%.*]] = icmp ne i32 [[TMP16]], 0
1636 // CHECK1-NEXT: br i1 [[TMP17]], label [[DOTOMP_FINAL_THEN:%.*]], label [[DOTOMP_FINAL_DONE:%.*]]
1637 // CHECK1: .omp.final.then:
1638 // CHECK1-NEXT: store i32 100, ptr [[I]], align 4
1639 // CHECK1-NEXT: br label [[DOTOMP_FINAL_DONE]]
1640 // CHECK1: .omp.final.done:
1641 // CHECK1-NEXT: ret void
1644 // CHECK1-LABEL: define {{[^@]+}}@{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z5tmainIiEiT__l71.omp_outlined.omp_outlined
1645 // CHECK1-SAME: (ptr noalias noundef [[DOTGLOBAL_TID_:%.*]], ptr noalias noundef [[DOTBOUND_TID_:%.*]], i64 noundef [[DOTPREVIOUS_LB_:%.*]], i64 noundef [[DOTPREVIOUS_UB_:%.*]]) #[[ATTR1]] {
1646 // CHECK1-NEXT: entry:
1647 // CHECK1-NEXT: [[DOTGLOBAL_TID__ADDR:%.*]] = alloca ptr, align 8
1648 // CHECK1-NEXT: [[DOTBOUND_TID__ADDR:%.*]] = alloca ptr, align 8
1649 // CHECK1-NEXT: [[DOTPREVIOUS_LB__ADDR:%.*]] = alloca i64, align 8
1650 // CHECK1-NEXT: [[DOTPREVIOUS_UB__ADDR:%.*]] = alloca i64, align 8
1651 // CHECK1-NEXT: [[DOTOMP_IV:%.*]] = alloca i32, align 4
1652 // CHECK1-NEXT: [[TMP:%.*]] = alloca i32, align 4
1653 // CHECK1-NEXT: [[DOTOMP_LB:%.*]] = alloca i32, align 4
1654 // CHECK1-NEXT: [[DOTOMP_UB:%.*]] = alloca i32, align 4
1655 // CHECK1-NEXT: [[DOTOMP_STRIDE:%.*]] = alloca i32, align 4
1656 // CHECK1-NEXT: [[DOTOMP_IS_LAST:%.*]] = alloca i32, align 4
1657 // CHECK1-NEXT: [[I:%.*]] = alloca i32, align 4
1658 // CHECK1-NEXT: store ptr [[DOTGLOBAL_TID_]], ptr [[DOTGLOBAL_TID__ADDR]], align 8
1659 // CHECK1-NEXT: store ptr [[DOTBOUND_TID_]], ptr [[DOTBOUND_TID__ADDR]], align 8
1660 // CHECK1-NEXT: store i64 [[DOTPREVIOUS_LB_]], ptr [[DOTPREVIOUS_LB__ADDR]], align 8
1661 // CHECK1-NEXT: store i64 [[DOTPREVIOUS_UB_]], ptr [[DOTPREVIOUS_UB__ADDR]], align 8
1662 // CHECK1-NEXT: store i32 0, ptr [[DOTOMP_LB]], align 4
1663 // CHECK1-NEXT: store i32 99, ptr [[DOTOMP_UB]], align 4
1664 // CHECK1-NEXT: [[TMP0:%.*]] = load i64, ptr [[DOTPREVIOUS_LB__ADDR]], align 8
1665 // CHECK1-NEXT: [[CONV:%.*]] = trunc i64 [[TMP0]] to i32
1666 // CHECK1-NEXT: [[TMP1:%.*]] = load i64, ptr [[DOTPREVIOUS_UB__ADDR]], align 8
1667 // CHECK1-NEXT: [[CONV1:%.*]] = trunc i64 [[TMP1]] to i32
1668 // CHECK1-NEXT: store i32 [[CONV]], ptr [[DOTOMP_LB]], align 4
1669 // CHECK1-NEXT: store i32 [[CONV1]], ptr [[DOTOMP_UB]], align 4
1670 // CHECK1-NEXT: store i32 1, ptr [[DOTOMP_STRIDE]], align 4
1671 // CHECK1-NEXT: store i32 0, ptr [[DOTOMP_IS_LAST]], align 4
1672 // CHECK1-NEXT: [[TMP2:%.*]] = load ptr, ptr [[DOTGLOBAL_TID__ADDR]], align 8
1673 // CHECK1-NEXT: [[TMP3:%.*]] = load i32, ptr [[TMP2]], align 4
1674 // CHECK1-NEXT: call void @__kmpc_for_static_init_4(ptr @[[GLOB2]], i32 [[TMP3]], i32 34, ptr [[DOTOMP_IS_LAST]], ptr [[DOTOMP_LB]], ptr [[DOTOMP_UB]], ptr [[DOTOMP_STRIDE]], i32 1, i32 1)
1675 // CHECK1-NEXT: [[TMP4:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4
1676 // CHECK1-NEXT: [[CMP:%.*]] = icmp sgt i32 [[TMP4]], 99
1677 // CHECK1-NEXT: br i1 [[CMP]], label [[COND_TRUE:%.*]], label [[COND_FALSE:%.*]]
1678 // CHECK1: cond.true:
1679 // CHECK1-NEXT: br label [[COND_END:%.*]]
1680 // CHECK1: cond.false:
1681 // CHECK1-NEXT: [[TMP5:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4
1682 // CHECK1-NEXT: br label [[COND_END]]
1683 // CHECK1: cond.end:
1684 // CHECK1-NEXT: [[COND:%.*]] = phi i32 [ 99, [[COND_TRUE]] ], [ [[TMP5]], [[COND_FALSE]] ]
1685 // CHECK1-NEXT: store i32 [[COND]], ptr [[DOTOMP_UB]], align 4
1686 // CHECK1-NEXT: [[TMP6:%.*]] = load i32, ptr [[DOTOMP_LB]], align 4
1687 // CHECK1-NEXT: store i32 [[TMP6]], ptr [[DOTOMP_IV]], align 4
1688 // CHECK1-NEXT: br label [[OMP_INNER_FOR_COND:%.*]]
1689 // CHECK1: omp.inner.for.cond:
1690 // CHECK1-NEXT: [[TMP7:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP59:![0-9]+]]
1691 // CHECK1-NEXT: [[TMP8:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4, !llvm.access.group [[ACC_GRP59]]
1692 // CHECK1-NEXT: [[CMP2:%.*]] = icmp sle i32 [[TMP7]], [[TMP8]]
1693 // CHECK1-NEXT: br i1 [[CMP2]], label [[OMP_INNER_FOR_BODY:%.*]], label [[OMP_INNER_FOR_END:%.*]]
1694 // CHECK1: omp.inner.for.body:
1695 // CHECK1-NEXT: [[TMP9:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP59]]
1696 // CHECK1-NEXT: [[MUL:%.*]] = mul nsw i32 [[TMP9]], 1
1697 // CHECK1-NEXT: [[ADD:%.*]] = add nsw i32 0, [[MUL]]
1698 // CHECK1-NEXT: store i32 [[ADD]], ptr [[I]], align 4, !llvm.access.group [[ACC_GRP59]]
1699 // CHECK1-NEXT: call void @_Z3fn3v(), !llvm.access.group [[ACC_GRP59]]
1700 // CHECK1-NEXT: br label [[OMP_BODY_CONTINUE:%.*]]
1701 // CHECK1: omp.body.continue:
1702 // CHECK1-NEXT: br label [[OMP_INNER_FOR_INC:%.*]]
1703 // CHECK1: omp.inner.for.inc:
1704 // CHECK1-NEXT: [[TMP10:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP59]]
1705 // CHECK1-NEXT: [[ADD3:%.*]] = add nsw i32 [[TMP10]], 1
1706 // CHECK1-NEXT: store i32 [[ADD3]], ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP59]]
1707 // CHECK1-NEXT: br label [[OMP_INNER_FOR_COND]], !llvm.loop [[LOOP60:![0-9]+]]
1708 // CHECK1: omp.inner.for.end:
1709 // CHECK1-NEXT: br label [[OMP_LOOP_EXIT:%.*]]
1710 // CHECK1: omp.loop.exit:
1711 // CHECK1-NEXT: call void @__kmpc_for_static_fini(ptr @[[GLOB1]], i32 [[TMP3]])
1712 // CHECK1-NEXT: [[TMP11:%.*]] = load i32, ptr [[DOTOMP_IS_LAST]], align 4
1713 // CHECK1-NEXT: [[TMP12:%.*]] = icmp ne i32 [[TMP11]], 0
1714 // CHECK1-NEXT: br i1 [[TMP12]], label [[DOTOMP_FINAL_THEN:%.*]], label [[DOTOMP_FINAL_DONE:%.*]]
1715 // CHECK1: .omp.final.then:
1716 // CHECK1-NEXT: store i32 100, ptr [[I]], align 4
1717 // CHECK1-NEXT: br label [[DOTOMP_FINAL_DONE]]
1718 // CHECK1: .omp.final.done:
1719 // CHECK1-NEXT: ret void
1722 // CHECK1-LABEL: define {{[^@]+}}@.omp_offloading.requires_reg
1723 // CHECK1-SAME: () #[[ATTR5:[0-9]+]] {
1724 // CHECK1-NEXT: entry:
1725 // CHECK1-NEXT: call void @__tgt_register_requires(i64 1)
1726 // CHECK1-NEXT: ret void
1729 // CHECK3-LABEL: define {{[^@]+}}@_Z9gtid_testv
1730 // CHECK3-SAME: () #[[ATTR0:[0-9]+]] {
1731 // CHECK3-NEXT: entry:
1732 // CHECK3-NEXT: [[TMP:%.*]] = alloca i32, align 4
1733 // CHECK3-NEXT: [[KERNEL_ARGS:%.*]] = alloca [[STRUCT___TGT_KERNEL_ARGUMENTS:%.*]], align 8
1734 // CHECK3-NEXT: [[_TMP1:%.*]] = alloca i32, align 4
1735 // CHECK3-NEXT: [[KERNEL_ARGS2:%.*]] = alloca [[STRUCT___TGT_KERNEL_ARGUMENTS]], align 8
1736 // CHECK3-NEXT: [[TMP0:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 0
1737 // CHECK3-NEXT: store i32 2, ptr [[TMP0]], align 4
1738 // CHECK3-NEXT: [[TMP1:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 1
1739 // CHECK3-NEXT: store i32 0, ptr [[TMP1]], align 4
1740 // CHECK3-NEXT: [[TMP2:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 2
1741 // CHECK3-NEXT: store ptr null, ptr [[TMP2]], align 8
1742 // CHECK3-NEXT: [[TMP3:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 3
1743 // CHECK3-NEXT: store ptr null, ptr [[TMP3]], align 8
1744 // CHECK3-NEXT: [[TMP4:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 4
1745 // CHECK3-NEXT: store ptr null, ptr [[TMP4]], align 8
1746 // CHECK3-NEXT: [[TMP5:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 5
1747 // CHECK3-NEXT: store ptr null, ptr [[TMP5]], align 8
1748 // CHECK3-NEXT: [[TMP6:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 6
1749 // CHECK3-NEXT: store ptr null, ptr [[TMP6]], align 8
1750 // CHECK3-NEXT: [[TMP7:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 7
1751 // CHECK3-NEXT: store ptr null, ptr [[TMP7]], align 8
1752 // CHECK3-NEXT: [[TMP8:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 8
1753 // CHECK3-NEXT: store i64 100, ptr [[TMP8]], align 8
1754 // CHECK3-NEXT: [[TMP9:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 9
1755 // CHECK3-NEXT: store i64 0, ptr [[TMP9]], align 8
1756 // CHECK3-NEXT: [[TMP10:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 10
1757 // CHECK3-NEXT: store [3 x i32] zeroinitializer, ptr [[TMP10]], align 4
1758 // CHECK3-NEXT: [[TMP11:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 11
1759 // CHECK3-NEXT: store [3 x i32] zeroinitializer, ptr [[TMP11]], align 4
1760 // CHECK3-NEXT: [[TMP12:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 12
1761 // CHECK3-NEXT: store i32 0, ptr [[TMP12]], align 4
1762 // CHECK3-NEXT: [[TMP13:%.*]] = call i32 @__tgt_target_kernel(ptr @[[GLOB3:[0-9]+]], i64 -1, i32 0, i32 0, ptr @.{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z9gtid_testv_l43.region_id, ptr [[KERNEL_ARGS]])
1763 // CHECK3-NEXT: [[TMP14:%.*]] = icmp ne i32 [[TMP13]], 0
1764 // CHECK3-NEXT: br i1 [[TMP14]], label [[OMP_OFFLOAD_FAILED:%.*]], label [[OMP_OFFLOAD_CONT:%.*]]
1765 // CHECK3: omp_offload.failed:
1766 // CHECK3-NEXT: call void @{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z9gtid_testv_l43() #[[ATTR2:[0-9]+]]
1767 // CHECK3-NEXT: br label [[OMP_OFFLOAD_CONT]]
1768 // CHECK3: omp_offload.cont:
1769 // CHECK3-NEXT: [[TMP15:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS2]], i32 0, i32 0
1770 // CHECK3-NEXT: store i32 2, ptr [[TMP15]], align 4
1771 // CHECK3-NEXT: [[TMP16:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS2]], i32 0, i32 1
1772 // CHECK3-NEXT: store i32 0, ptr [[TMP16]], align 4
1773 // CHECK3-NEXT: [[TMP17:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS2]], i32 0, i32 2
1774 // CHECK3-NEXT: store ptr null, ptr [[TMP17]], align 8
1775 // CHECK3-NEXT: [[TMP18:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS2]], i32 0, i32 3
1776 // CHECK3-NEXT: store ptr null, ptr [[TMP18]], align 8
1777 // CHECK3-NEXT: [[TMP19:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS2]], i32 0, i32 4
1778 // CHECK3-NEXT: store ptr null, ptr [[TMP19]], align 8
1779 // CHECK3-NEXT: [[TMP20:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS2]], i32 0, i32 5
1780 // CHECK3-NEXT: store ptr null, ptr [[TMP20]], align 8
1781 // CHECK3-NEXT: [[TMP21:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS2]], i32 0, i32 6
1782 // CHECK3-NEXT: store ptr null, ptr [[TMP21]], align 8
1783 // CHECK3-NEXT: [[TMP22:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS2]], i32 0, i32 7
1784 // CHECK3-NEXT: store ptr null, ptr [[TMP22]], align 8
1785 // CHECK3-NEXT: [[TMP23:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS2]], i32 0, i32 8
1786 // CHECK3-NEXT: store i64 100, ptr [[TMP23]], align 8
1787 // CHECK3-NEXT: [[TMP24:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS2]], i32 0, i32 9
1788 // CHECK3-NEXT: store i64 0, ptr [[TMP24]], align 8
1789 // CHECK3-NEXT: [[TMP25:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS2]], i32 0, i32 10
1790 // CHECK3-NEXT: store [3 x i32] zeroinitializer, ptr [[TMP25]], align 4
1791 // CHECK3-NEXT: [[TMP26:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS2]], i32 0, i32 11
1792 // CHECK3-NEXT: store [3 x i32] zeroinitializer, ptr [[TMP26]], align 4
1793 // CHECK3-NEXT: [[TMP27:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS2]], i32 0, i32 12
1794 // CHECK3-NEXT: store i32 0, ptr [[TMP27]], align 4
1795 // CHECK3-NEXT: [[TMP28:%.*]] = call i32 @__tgt_target_kernel(ptr @[[GLOB3]], i64 -1, i32 0, i32 0, ptr @.{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z9gtid_testv_l48.region_id, ptr [[KERNEL_ARGS2]])
1796 // CHECK3-NEXT: [[TMP29:%.*]] = icmp ne i32 [[TMP28]], 0
1797 // CHECK3-NEXT: br i1 [[TMP29]], label [[OMP_OFFLOAD_FAILED3:%.*]], label [[OMP_OFFLOAD_CONT4:%.*]]
1798 // CHECK3: omp_offload.failed3:
1799 // CHECK3-NEXT: call void @{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z9gtid_testv_l48() #[[ATTR2]]
1800 // CHECK3-NEXT: br label [[OMP_OFFLOAD_CONT4]]
1801 // CHECK3: omp_offload.cont4:
1802 // CHECK3-NEXT: ret void
1805 // CHECK3-LABEL: define {{[^@]+}}@{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z9gtid_testv_l43
1806 // CHECK3-SAME: () #[[ATTR1:[0-9]+]] {
1807 // CHECK3-NEXT: entry:
1808 // CHECK3-NEXT: call void (ptr, i32, ptr, ...) @__kmpc_fork_teams(ptr @[[GLOB3]], i32 0, ptr @{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z9gtid_testv_l43.omp_outlined)
1809 // CHECK3-NEXT: ret void
1812 // CHECK3-LABEL: define {{[^@]+}}@{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z9gtid_testv_l43.omp_outlined
1813 // CHECK3-SAME: (ptr noalias noundef [[DOTGLOBAL_TID_:%.*]], ptr noalias noundef [[DOTBOUND_TID_:%.*]]) #[[ATTR1]] {
1814 // CHECK3-NEXT: entry:
1815 // CHECK3-NEXT: [[DOTGLOBAL_TID__ADDR:%.*]] = alloca ptr, align 8
1816 // CHECK3-NEXT: [[DOTBOUND_TID__ADDR:%.*]] = alloca ptr, align 8
1817 // CHECK3-NEXT: [[DOTOMP_IV:%.*]] = alloca i32, align 4
1818 // CHECK3-NEXT: [[TMP:%.*]] = alloca i32, align 4
1819 // CHECK3-NEXT: [[DOTOMP_COMB_LB:%.*]] = alloca i32, align 4
1820 // CHECK3-NEXT: [[DOTOMP_COMB_UB:%.*]] = alloca i32, align 4
1821 // CHECK3-NEXT: [[DOTOMP_STRIDE:%.*]] = alloca i32, align 4
1822 // CHECK3-NEXT: [[DOTOMP_IS_LAST:%.*]] = alloca i32, align 4
1823 // CHECK3-NEXT: [[I:%.*]] = alloca i32, align 4
1824 // CHECK3-NEXT: store ptr [[DOTGLOBAL_TID_]], ptr [[DOTGLOBAL_TID__ADDR]], align 8
1825 // CHECK3-NEXT: store ptr [[DOTBOUND_TID_]], ptr [[DOTBOUND_TID__ADDR]], align 8
1826 // CHECK3-NEXT: store i32 0, ptr [[DOTOMP_COMB_LB]], align 4
1827 // CHECK3-NEXT: store i32 99, ptr [[DOTOMP_COMB_UB]], align 4
1828 // CHECK3-NEXT: store i32 1, ptr [[DOTOMP_STRIDE]], align 4
1829 // CHECK3-NEXT: store i32 0, ptr [[DOTOMP_IS_LAST]], align 4
1830 // CHECK3-NEXT: [[TMP0:%.*]] = load ptr, ptr [[DOTGLOBAL_TID__ADDR]], align 8
1831 // CHECK3-NEXT: [[TMP1:%.*]] = load i32, ptr [[TMP0]], align 4
1832 // CHECK3-NEXT: call void @__kmpc_for_static_init_4(ptr @[[GLOB1:[0-9]+]], i32 [[TMP1]], i32 92, ptr [[DOTOMP_IS_LAST]], ptr [[DOTOMP_COMB_LB]], ptr [[DOTOMP_COMB_UB]], ptr [[DOTOMP_STRIDE]], i32 1, i32 1)
1833 // CHECK3-NEXT: [[TMP2:%.*]] = load i32, ptr [[DOTOMP_COMB_UB]], align 4
1834 // CHECK3-NEXT: [[CMP:%.*]] = icmp sgt i32 [[TMP2]], 99
1835 // CHECK3-NEXT: br i1 [[CMP]], label [[COND_TRUE:%.*]], label [[COND_FALSE:%.*]]
1836 // CHECK3: cond.true:
1837 // CHECK3-NEXT: br label [[COND_END:%.*]]
1838 // CHECK3: cond.false:
1839 // CHECK3-NEXT: [[TMP3:%.*]] = load i32, ptr [[DOTOMP_COMB_UB]], align 4
1840 // CHECK3-NEXT: br label [[COND_END]]
1841 // CHECK3: cond.end:
1842 // CHECK3-NEXT: [[COND:%.*]] = phi i32 [ 99, [[COND_TRUE]] ], [ [[TMP3]], [[COND_FALSE]] ]
1843 // CHECK3-NEXT: store i32 [[COND]], ptr [[DOTOMP_COMB_UB]], align 4
1844 // CHECK3-NEXT: [[TMP4:%.*]] = load i32, ptr [[DOTOMP_COMB_LB]], align 4
1845 // CHECK3-NEXT: store i32 [[TMP4]], ptr [[DOTOMP_IV]], align 4
1846 // CHECK3-NEXT: br label [[OMP_INNER_FOR_COND:%.*]]
1847 // CHECK3: omp.inner.for.cond:
1848 // CHECK3-NEXT: [[TMP5:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP11:![0-9]+]]
1849 // CHECK3-NEXT: [[TMP6:%.*]] = load i32, ptr [[DOTOMP_COMB_UB]], align 4, !llvm.access.group [[ACC_GRP11]]
1850 // CHECK3-NEXT: [[CMP1:%.*]] = icmp sle i32 [[TMP5]], [[TMP6]]
1851 // CHECK3-NEXT: br i1 [[CMP1]], label [[OMP_INNER_FOR_BODY:%.*]], label [[OMP_INNER_FOR_END:%.*]]
1852 // CHECK3: omp.inner.for.body:
1853 // CHECK3-NEXT: [[TMP7:%.*]] = load i32, ptr [[DOTOMP_COMB_LB]], align 4, !llvm.access.group [[ACC_GRP11]]
1854 // CHECK3-NEXT: [[TMP8:%.*]] = zext i32 [[TMP7]] to i64
1855 // CHECK3-NEXT: [[TMP9:%.*]] = load i32, ptr [[DOTOMP_COMB_UB]], align 4, !llvm.access.group [[ACC_GRP11]]
1856 // CHECK3-NEXT: [[TMP10:%.*]] = zext i32 [[TMP9]] to i64
1857 // CHECK3-NEXT: call void (ptr, i32, ptr, ...) @__kmpc_fork_call(ptr @[[GLOB3]], i32 2, ptr @{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z9gtid_testv_l43.omp_outlined.omp_outlined, i64 [[TMP8]], i64 [[TMP10]]), !llvm.access.group [[ACC_GRP11]]
1858 // CHECK3-NEXT: br label [[OMP_INNER_FOR_INC:%.*]]
1859 // CHECK3: omp.inner.for.inc:
1860 // CHECK3-NEXT: [[TMP11:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP11]]
1861 // CHECK3-NEXT: [[TMP12:%.*]] = load i32, ptr [[DOTOMP_STRIDE]], align 4, !llvm.access.group [[ACC_GRP11]]
1862 // CHECK3-NEXT: [[ADD:%.*]] = add nsw i32 [[TMP11]], [[TMP12]]
1863 // CHECK3-NEXT: store i32 [[ADD]], ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP11]]
1864 // CHECK3-NEXT: br label [[OMP_INNER_FOR_COND]], !llvm.loop [[LOOP12:![0-9]+]]
1865 // CHECK3: omp.inner.for.end:
1866 // CHECK3-NEXT: br label [[OMP_LOOP_EXIT:%.*]]
1867 // CHECK3: omp.loop.exit:
1868 // CHECK3-NEXT: call void @__kmpc_for_static_fini(ptr @[[GLOB1]], i32 [[TMP1]])
1869 // CHECK3-NEXT: [[TMP13:%.*]] = load i32, ptr [[DOTOMP_IS_LAST]], align 4
1870 // CHECK3-NEXT: [[TMP14:%.*]] = icmp ne i32 [[TMP13]], 0
1871 // CHECK3-NEXT: br i1 [[TMP14]], label [[DOTOMP_FINAL_THEN:%.*]], label [[DOTOMP_FINAL_DONE:%.*]]
1872 // CHECK3: .omp.final.then:
1873 // CHECK3-NEXT: store i32 100, ptr [[I]], align 4
1874 // CHECK3-NEXT: br label [[DOTOMP_FINAL_DONE]]
1875 // CHECK3: .omp.final.done:
1876 // CHECK3-NEXT: ret void
1879 // CHECK3-LABEL: define {{[^@]+}}@{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z9gtid_testv_l43.omp_outlined.omp_outlined
1880 // CHECK3-SAME: (ptr noalias noundef [[DOTGLOBAL_TID_:%.*]], ptr noalias noundef [[DOTBOUND_TID_:%.*]], i64 noundef [[DOTPREVIOUS_LB_:%.*]], i64 noundef [[DOTPREVIOUS_UB_:%.*]]) #[[ATTR1]] {
1881 // CHECK3-NEXT: entry:
1882 // CHECK3-NEXT: [[DOTGLOBAL_TID__ADDR:%.*]] = alloca ptr, align 8
1883 // CHECK3-NEXT: [[DOTBOUND_TID__ADDR:%.*]] = alloca ptr, align 8
1884 // CHECK3-NEXT: [[DOTPREVIOUS_LB__ADDR:%.*]] = alloca i64, align 8
1885 // CHECK3-NEXT: [[DOTPREVIOUS_UB__ADDR:%.*]] = alloca i64, align 8
1886 // CHECK3-NEXT: [[DOTOMP_IV:%.*]] = alloca i32, align 4
1887 // CHECK3-NEXT: [[TMP:%.*]] = alloca i32, align 4
1888 // CHECK3-NEXT: [[DOTOMP_LB:%.*]] = alloca i32, align 4
1889 // CHECK3-NEXT: [[DOTOMP_UB:%.*]] = alloca i32, align 4
1890 // CHECK3-NEXT: [[DOTOMP_STRIDE:%.*]] = alloca i32, align 4
1891 // CHECK3-NEXT: [[DOTOMP_IS_LAST:%.*]] = alloca i32, align 4
1892 // CHECK3-NEXT: [[I:%.*]] = alloca i32, align 4
1893 // CHECK3-NEXT: store ptr [[DOTGLOBAL_TID_]], ptr [[DOTGLOBAL_TID__ADDR]], align 8
1894 // CHECK3-NEXT: store ptr [[DOTBOUND_TID_]], ptr [[DOTBOUND_TID__ADDR]], align 8
1895 // CHECK3-NEXT: store i64 [[DOTPREVIOUS_LB_]], ptr [[DOTPREVIOUS_LB__ADDR]], align 8
1896 // CHECK3-NEXT: store i64 [[DOTPREVIOUS_UB_]], ptr [[DOTPREVIOUS_UB__ADDR]], align 8
1897 // CHECK3-NEXT: store i32 0, ptr [[DOTOMP_LB]], align 4
1898 // CHECK3-NEXT: store i32 99, ptr [[DOTOMP_UB]], align 4
1899 // CHECK3-NEXT: [[TMP0:%.*]] = load i64, ptr [[DOTPREVIOUS_LB__ADDR]], align 8
1900 // CHECK3-NEXT: [[CONV:%.*]] = trunc i64 [[TMP0]] to i32
1901 // CHECK3-NEXT: [[TMP1:%.*]] = load i64, ptr [[DOTPREVIOUS_UB__ADDR]], align 8
1902 // CHECK3-NEXT: [[CONV1:%.*]] = trunc i64 [[TMP1]] to i32
1903 // CHECK3-NEXT: store i32 [[CONV]], ptr [[DOTOMP_LB]], align 4
1904 // CHECK3-NEXT: store i32 [[CONV1]], ptr [[DOTOMP_UB]], align 4
1905 // CHECK3-NEXT: store i32 1, ptr [[DOTOMP_STRIDE]], align 4
1906 // CHECK3-NEXT: store i32 0, ptr [[DOTOMP_IS_LAST]], align 4
1907 // CHECK3-NEXT: [[TMP2:%.*]] = load ptr, ptr [[DOTGLOBAL_TID__ADDR]], align 8
1908 // CHECK3-NEXT: [[TMP3:%.*]] = load i32, ptr [[TMP2]], align 4
1909 // CHECK3-NEXT: call void @__kmpc_for_static_init_4(ptr @[[GLOB2:[0-9]+]], i32 [[TMP3]], i32 34, ptr [[DOTOMP_IS_LAST]], ptr [[DOTOMP_LB]], ptr [[DOTOMP_UB]], ptr [[DOTOMP_STRIDE]], i32 1, i32 1)
1910 // CHECK3-NEXT: [[TMP4:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4
1911 // CHECK3-NEXT: [[CMP:%.*]] = icmp sgt i32 [[TMP4]], 99
1912 // CHECK3-NEXT: br i1 [[CMP]], label [[COND_TRUE:%.*]], label [[COND_FALSE:%.*]]
1913 // CHECK3: cond.true:
1914 // CHECK3-NEXT: br label [[COND_END:%.*]]
1915 // CHECK3: cond.false:
1916 // CHECK3-NEXT: [[TMP5:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4
1917 // CHECK3-NEXT: br label [[COND_END]]
1918 // CHECK3: cond.end:
1919 // CHECK3-NEXT: [[COND:%.*]] = phi i32 [ 99, [[COND_TRUE]] ], [ [[TMP5]], [[COND_FALSE]] ]
1920 // CHECK3-NEXT: store i32 [[COND]], ptr [[DOTOMP_UB]], align 4
1921 // CHECK3-NEXT: [[TMP6:%.*]] = load i32, ptr [[DOTOMP_LB]], align 4
1922 // CHECK3-NEXT: store i32 [[TMP6]], ptr [[DOTOMP_IV]], align 4
1923 // CHECK3-NEXT: br label [[OMP_INNER_FOR_COND:%.*]]
1924 // CHECK3: omp.inner.for.cond:
1925 // CHECK3-NEXT: [[TMP7:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP15:![0-9]+]]
1926 // CHECK3-NEXT: [[TMP8:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4, !llvm.access.group [[ACC_GRP15]]
1927 // CHECK3-NEXT: [[CMP2:%.*]] = icmp sle i32 [[TMP7]], [[TMP8]]
1928 // CHECK3-NEXT: br i1 [[CMP2]], label [[OMP_INNER_FOR_BODY:%.*]], label [[OMP_INNER_FOR_END:%.*]]
1929 // CHECK3: omp.inner.for.body:
1930 // CHECK3-NEXT: [[TMP9:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP15]]
1931 // CHECK3-NEXT: [[MUL:%.*]] = mul nsw i32 [[TMP9]], 1
1932 // CHECK3-NEXT: [[ADD:%.*]] = add nsw i32 0, [[MUL]]
1933 // CHECK3-NEXT: store i32 [[ADD]], ptr [[I]], align 4, !llvm.access.group [[ACC_GRP15]]
1934 // CHECK3-NEXT: br label [[OMP_BODY_CONTINUE:%.*]]
1935 // CHECK3: omp.body.continue:
1936 // CHECK3-NEXT: br label [[OMP_INNER_FOR_INC:%.*]]
1937 // CHECK3: omp.inner.for.inc:
1938 // CHECK3-NEXT: [[TMP10:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP15]]
1939 // CHECK3-NEXT: [[ADD3:%.*]] = add nsw i32 [[TMP10]], 1
1940 // CHECK3-NEXT: store i32 [[ADD3]], ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP15]]
1941 // CHECK3-NEXT: br label [[OMP_INNER_FOR_COND]], !llvm.loop [[LOOP16:![0-9]+]]
1942 // CHECK3: omp.inner.for.end:
1943 // CHECK3-NEXT: br label [[OMP_LOOP_EXIT:%.*]]
1944 // CHECK3: omp.loop.exit:
1945 // CHECK3-NEXT: call void @__kmpc_for_static_fini(ptr @[[GLOB1]], i32 [[TMP3]])
1946 // CHECK3-NEXT: [[TMP11:%.*]] = load i32, ptr [[DOTOMP_IS_LAST]], align 4
1947 // CHECK3-NEXT: [[TMP12:%.*]] = icmp ne i32 [[TMP11]], 0
1948 // CHECK3-NEXT: br i1 [[TMP12]], label [[DOTOMP_FINAL_THEN:%.*]], label [[DOTOMP_FINAL_DONE:%.*]]
1949 // CHECK3: .omp.final.then:
1950 // CHECK3-NEXT: store i32 100, ptr [[I]], align 4
1951 // CHECK3-NEXT: br label [[DOTOMP_FINAL_DONE]]
1952 // CHECK3: .omp.final.done:
1953 // CHECK3-NEXT: ret void
1956 // CHECK3-LABEL: define {{[^@]+}}@{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z9gtid_testv_l48
1957 // CHECK3-SAME: () #[[ATTR1]] {
1958 // CHECK3-NEXT: entry:
1959 // CHECK3-NEXT: call void (ptr, i32, ptr, ...) @__kmpc_fork_teams(ptr @[[GLOB3]], i32 0, ptr @{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z9gtid_testv_l48.omp_outlined)
1960 // CHECK3-NEXT: ret void
1963 // CHECK3-LABEL: define {{[^@]+}}@{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z9gtid_testv_l48.omp_outlined
1964 // CHECK3-SAME: (ptr noalias noundef [[DOTGLOBAL_TID_:%.*]], ptr noalias noundef [[DOTBOUND_TID_:%.*]]) #[[ATTR1]] {
1965 // CHECK3-NEXT: entry:
1966 // CHECK3-NEXT: [[DOTGLOBAL_TID__ADDR:%.*]] = alloca ptr, align 8
1967 // CHECK3-NEXT: [[DOTBOUND_TID__ADDR:%.*]] = alloca ptr, align 8
1968 // CHECK3-NEXT: [[DOTOMP_IV:%.*]] = alloca i32, align 4
1969 // CHECK3-NEXT: [[TMP:%.*]] = alloca i32, align 4
1970 // CHECK3-NEXT: [[DOTOMP_COMB_LB:%.*]] = alloca i32, align 4
1971 // CHECK3-NEXT: [[DOTOMP_COMB_UB:%.*]] = alloca i32, align 4
1972 // CHECK3-NEXT: [[DOTOMP_STRIDE:%.*]] = alloca i32, align 4
1973 // CHECK3-NEXT: [[DOTOMP_IS_LAST:%.*]] = alloca i32, align 4
1974 // CHECK3-NEXT: [[I:%.*]] = alloca i32, align 4
1975 // CHECK3-NEXT: [[DOTBOUND_ZERO_ADDR:%.*]] = alloca i32, align 4
1976 // CHECK3-NEXT: store ptr [[DOTGLOBAL_TID_]], ptr [[DOTGLOBAL_TID__ADDR]], align 8
1977 // CHECK3-NEXT: store ptr [[DOTBOUND_TID_]], ptr [[DOTBOUND_TID__ADDR]], align 8
1978 // CHECK3-NEXT: store i32 0, ptr [[DOTOMP_COMB_LB]], align 4
1979 // CHECK3-NEXT: store i32 99, ptr [[DOTOMP_COMB_UB]], align 4
1980 // CHECK3-NEXT: store i32 1, ptr [[DOTOMP_STRIDE]], align 4
1981 // CHECK3-NEXT: store i32 0, ptr [[DOTOMP_IS_LAST]], align 4
1982 // CHECK3-NEXT: [[TMP0:%.*]] = load ptr, ptr [[DOTGLOBAL_TID__ADDR]], align 8
1983 // CHECK3-NEXT: [[TMP1:%.*]] = load i32, ptr [[TMP0]], align 4
1984 // CHECK3-NEXT: call void @__kmpc_for_static_init_4(ptr @[[GLOB1]], i32 [[TMP1]], i32 92, ptr [[DOTOMP_IS_LAST]], ptr [[DOTOMP_COMB_LB]], ptr [[DOTOMP_COMB_UB]], ptr [[DOTOMP_STRIDE]], i32 1, i32 1)
1985 // CHECK3-NEXT: [[TMP2:%.*]] = load i32, ptr [[DOTOMP_COMB_UB]], align 4
1986 // CHECK3-NEXT: [[CMP:%.*]] = icmp sgt i32 [[TMP2]], 99
1987 // CHECK3-NEXT: br i1 [[CMP]], label [[COND_TRUE:%.*]], label [[COND_FALSE:%.*]]
1988 // CHECK3: cond.true:
1989 // CHECK3-NEXT: br label [[COND_END:%.*]]
1990 // CHECK3: cond.false:
1991 // CHECK3-NEXT: [[TMP3:%.*]] = load i32, ptr [[DOTOMP_COMB_UB]], align 4
1992 // CHECK3-NEXT: br label [[COND_END]]
1993 // CHECK3: cond.end:
1994 // CHECK3-NEXT: [[COND:%.*]] = phi i32 [ 99, [[COND_TRUE]] ], [ [[TMP3]], [[COND_FALSE]] ]
1995 // CHECK3-NEXT: store i32 [[COND]], ptr [[DOTOMP_COMB_UB]], align 4
1996 // CHECK3-NEXT: [[TMP4:%.*]] = load i32, ptr [[DOTOMP_COMB_LB]], align 4
1997 // CHECK3-NEXT: store i32 [[TMP4]], ptr [[DOTOMP_IV]], align 4
1998 // CHECK3-NEXT: br label [[OMP_INNER_FOR_COND:%.*]]
1999 // CHECK3: omp.inner.for.cond:
2000 // CHECK3-NEXT: [[TMP5:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP20:![0-9]+]]
2001 // CHECK3-NEXT: [[TMP6:%.*]] = load i32, ptr [[DOTOMP_COMB_UB]], align 4, !llvm.access.group [[ACC_GRP20]]
2002 // CHECK3-NEXT: [[CMP1:%.*]] = icmp sle i32 [[TMP5]], [[TMP6]]
2003 // CHECK3-NEXT: br i1 [[CMP1]], label [[OMP_INNER_FOR_BODY:%.*]], label [[OMP_INNER_FOR_END:%.*]]
2004 // CHECK3: omp.inner.for.body:
2005 // CHECK3-NEXT: [[TMP7:%.*]] = load i32, ptr [[DOTOMP_COMB_LB]], align 4, !llvm.access.group [[ACC_GRP20]]
2006 // CHECK3-NEXT: [[TMP8:%.*]] = zext i32 [[TMP7]] to i64
2007 // CHECK3-NEXT: [[TMP9:%.*]] = load i32, ptr [[DOTOMP_COMB_UB]], align 4, !llvm.access.group [[ACC_GRP20]]
2008 // CHECK3-NEXT: [[TMP10:%.*]] = zext i32 [[TMP9]] to i64
2009 // CHECK3-NEXT: call void @__kmpc_serialized_parallel(ptr @[[GLOB3]], i32 [[TMP1]]), !llvm.access.group [[ACC_GRP20]]
2010 // CHECK3-NEXT: [[TMP11:%.*]] = load ptr, ptr [[DOTGLOBAL_TID__ADDR]], align 8, !llvm.access.group [[ACC_GRP20]]
2011 // CHECK3-NEXT: store i32 0, ptr [[DOTBOUND_ZERO_ADDR]], align 4, !llvm.access.group [[ACC_GRP20]]
2012 // CHECK3-NEXT: call void @{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z9gtid_testv_l48.omp_outlined.omp_outlined(ptr [[TMP11]], ptr [[DOTBOUND_ZERO_ADDR]], i64 [[TMP8]], i64 [[TMP10]]) #[[ATTR2]], !llvm.access.group [[ACC_GRP20]]
2013 // CHECK3-NEXT: call void @__kmpc_end_serialized_parallel(ptr @[[GLOB3]], i32 [[TMP1]]), !llvm.access.group [[ACC_GRP20]]
2014 // CHECK3-NEXT: br label [[OMP_INNER_FOR_INC:%.*]]
2015 // CHECK3: omp.inner.for.inc:
2016 // CHECK3-NEXT: [[TMP12:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP20]]
2017 // CHECK3-NEXT: [[TMP13:%.*]] = load i32, ptr [[DOTOMP_STRIDE]], align 4, !llvm.access.group [[ACC_GRP20]]
2018 // CHECK3-NEXT: [[ADD:%.*]] = add nsw i32 [[TMP12]], [[TMP13]]
2019 // CHECK3-NEXT: store i32 [[ADD]], ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP20]]
2020 // CHECK3-NEXT: br label [[OMP_INNER_FOR_COND]], !llvm.loop [[LOOP21:![0-9]+]]
2021 // CHECK3: omp.inner.for.end:
2022 // CHECK3-NEXT: br label [[OMP_LOOP_EXIT:%.*]]
2023 // CHECK3: omp.loop.exit:
2024 // CHECK3-NEXT: call void @__kmpc_for_static_fini(ptr @[[GLOB1]], i32 [[TMP1]])
2025 // CHECK3-NEXT: [[TMP14:%.*]] = load i32, ptr [[DOTOMP_IS_LAST]], align 4
2026 // CHECK3-NEXT: [[TMP15:%.*]] = icmp ne i32 [[TMP14]], 0
2027 // CHECK3-NEXT: br i1 [[TMP15]], label [[DOTOMP_FINAL_THEN:%.*]], label [[DOTOMP_FINAL_DONE:%.*]]
2028 // CHECK3: .omp.final.then:
2029 // CHECK3-NEXT: store i32 100, ptr [[I]], align 4
2030 // CHECK3-NEXT: br label [[DOTOMP_FINAL_DONE]]
2031 // CHECK3: .omp.final.done:
2032 // CHECK3-NEXT: ret void
2035 // CHECK3-LABEL: define {{[^@]+}}@{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z9gtid_testv_l48.omp_outlined.omp_outlined
2036 // CHECK3-SAME: (ptr noalias noundef [[DOTGLOBAL_TID_:%.*]], ptr noalias noundef [[DOTBOUND_TID_:%.*]], i64 noundef [[DOTPREVIOUS_LB_:%.*]], i64 noundef [[DOTPREVIOUS_UB_:%.*]]) #[[ATTR1]] {
2037 // CHECK3-NEXT: entry:
2038 // CHECK3-NEXT: [[DOTGLOBAL_TID__ADDR:%.*]] = alloca ptr, align 8
2039 // CHECK3-NEXT: [[DOTBOUND_TID__ADDR:%.*]] = alloca ptr, align 8
2040 // CHECK3-NEXT: [[DOTPREVIOUS_LB__ADDR:%.*]] = alloca i64, align 8
2041 // CHECK3-NEXT: [[DOTPREVIOUS_UB__ADDR:%.*]] = alloca i64, align 8
2042 // CHECK3-NEXT: [[DOTOMP_IV:%.*]] = alloca i32, align 4
2043 // CHECK3-NEXT: [[TMP:%.*]] = alloca i32, align 4
2044 // CHECK3-NEXT: [[DOTOMP_LB:%.*]] = alloca i32, align 4
2045 // CHECK3-NEXT: [[DOTOMP_UB:%.*]] = alloca i32, align 4
2046 // CHECK3-NEXT: [[DOTOMP_STRIDE:%.*]] = alloca i32, align 4
2047 // CHECK3-NEXT: [[DOTOMP_IS_LAST:%.*]] = alloca i32, align 4
2048 // CHECK3-NEXT: [[I:%.*]] = alloca i32, align 4
2049 // CHECK3-NEXT: store ptr [[DOTGLOBAL_TID_]], ptr [[DOTGLOBAL_TID__ADDR]], align 8
2050 // CHECK3-NEXT: store ptr [[DOTBOUND_TID_]], ptr [[DOTBOUND_TID__ADDR]], align 8
2051 // CHECK3-NEXT: store i64 [[DOTPREVIOUS_LB_]], ptr [[DOTPREVIOUS_LB__ADDR]], align 8
2052 // CHECK3-NEXT: store i64 [[DOTPREVIOUS_UB_]], ptr [[DOTPREVIOUS_UB__ADDR]], align 8
2053 // CHECK3-NEXT: store i32 0, ptr [[DOTOMP_LB]], align 4
2054 // CHECK3-NEXT: store i32 99, ptr [[DOTOMP_UB]], align 4
2055 // CHECK3-NEXT: [[TMP0:%.*]] = load i64, ptr [[DOTPREVIOUS_LB__ADDR]], align 8
2056 // CHECK3-NEXT: [[CONV:%.*]] = trunc i64 [[TMP0]] to i32
2057 // CHECK3-NEXT: [[TMP1:%.*]] = load i64, ptr [[DOTPREVIOUS_UB__ADDR]], align 8
2058 // CHECK3-NEXT: [[CONV1:%.*]] = trunc i64 [[TMP1]] to i32
2059 // CHECK3-NEXT: store i32 [[CONV]], ptr [[DOTOMP_LB]], align 4
2060 // CHECK3-NEXT: store i32 [[CONV1]], ptr [[DOTOMP_UB]], align 4
2061 // CHECK3-NEXT: store i32 1, ptr [[DOTOMP_STRIDE]], align 4
2062 // CHECK3-NEXT: store i32 0, ptr [[DOTOMP_IS_LAST]], align 4
2063 // CHECK3-NEXT: [[TMP2:%.*]] = load ptr, ptr [[DOTGLOBAL_TID__ADDR]], align 8
2064 // CHECK3-NEXT: [[TMP3:%.*]] = load i32, ptr [[TMP2]], align 4
2065 // CHECK3-NEXT: call void @__kmpc_for_static_init_4(ptr @[[GLOB2]], i32 [[TMP3]], i32 34, ptr [[DOTOMP_IS_LAST]], ptr [[DOTOMP_LB]], ptr [[DOTOMP_UB]], ptr [[DOTOMP_STRIDE]], i32 1, i32 1)
2066 // CHECK3-NEXT: [[TMP4:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4
2067 // CHECK3-NEXT: [[CMP:%.*]] = icmp sgt i32 [[TMP4]], 99
2068 // CHECK3-NEXT: br i1 [[CMP]], label [[COND_TRUE:%.*]], label [[COND_FALSE:%.*]]
2069 // CHECK3: cond.true:
2070 // CHECK3-NEXT: br label [[COND_END:%.*]]
2071 // CHECK3: cond.false:
2072 // CHECK3-NEXT: [[TMP5:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4
2073 // CHECK3-NEXT: br label [[COND_END]]
2074 // CHECK3: cond.end:
2075 // CHECK3-NEXT: [[COND:%.*]] = phi i32 [ 99, [[COND_TRUE]] ], [ [[TMP5]], [[COND_FALSE]] ]
2076 // CHECK3-NEXT: store i32 [[COND]], ptr [[DOTOMP_UB]], align 4
2077 // CHECK3-NEXT: [[TMP6:%.*]] = load i32, ptr [[DOTOMP_LB]], align 4
2078 // CHECK3-NEXT: store i32 [[TMP6]], ptr [[DOTOMP_IV]], align 4
2079 // CHECK3-NEXT: br label [[OMP_INNER_FOR_COND:%.*]]
2080 // CHECK3: omp.inner.for.cond:
2081 // CHECK3-NEXT: [[TMP7:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP23:![0-9]+]]
2082 // CHECK3-NEXT: [[TMP8:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4, !llvm.access.group [[ACC_GRP23]]
2083 // CHECK3-NEXT: [[CMP2:%.*]] = icmp sle i32 [[TMP7]], [[TMP8]]
2084 // CHECK3-NEXT: br i1 [[CMP2]], label [[OMP_INNER_FOR_BODY:%.*]], label [[OMP_INNER_FOR_END:%.*]]
2085 // CHECK3: omp.inner.for.body:
2086 // CHECK3-NEXT: [[TMP9:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP23]]
2087 // CHECK3-NEXT: [[MUL:%.*]] = mul nsw i32 [[TMP9]], 1
2088 // CHECK3-NEXT: [[ADD:%.*]] = add nsw i32 0, [[MUL]]
2089 // CHECK3-NEXT: store i32 [[ADD]], ptr [[I]], align 4, !llvm.access.group [[ACC_GRP23]]
2090 // CHECK3-NEXT: call void @_Z9gtid_testv(), !llvm.access.group [[ACC_GRP23]]
2091 // CHECK3-NEXT: br label [[OMP_BODY_CONTINUE:%.*]]
2092 // CHECK3: omp.body.continue:
2093 // CHECK3-NEXT: br label [[OMP_INNER_FOR_INC:%.*]]
2094 // CHECK3: omp.inner.for.inc:
2095 // CHECK3-NEXT: [[TMP10:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP23]]
2096 // CHECK3-NEXT: [[ADD3:%.*]] = add nsw i32 [[TMP10]], 1
2097 // CHECK3-NEXT: store i32 [[ADD3]], ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP23]]
2098 // CHECK3-NEXT: br label [[OMP_INNER_FOR_COND]], !llvm.loop [[LOOP24:![0-9]+]]
2099 // CHECK3: omp.inner.for.end:
2100 // CHECK3-NEXT: br label [[OMP_LOOP_EXIT:%.*]]
2101 // CHECK3: omp.loop.exit:
2102 // CHECK3-NEXT: call void @__kmpc_for_static_fini(ptr @[[GLOB1]], i32 [[TMP3]])
2103 // CHECK3-NEXT: [[TMP11:%.*]] = load i32, ptr [[DOTOMP_IS_LAST]], align 4
2104 // CHECK3-NEXT: [[TMP12:%.*]] = icmp ne i32 [[TMP11]], 0
2105 // CHECK3-NEXT: br i1 [[TMP12]], label [[DOTOMP_FINAL_THEN:%.*]], label [[DOTOMP_FINAL_DONE:%.*]]
2106 // CHECK3: .omp.final.then:
2107 // CHECK3-NEXT: store i32 100, ptr [[I]], align 4
2108 // CHECK3-NEXT: br label [[DOTOMP_FINAL_DONE]]
2109 // CHECK3: .omp.final.done:
2110 // CHECK3-NEXT: ret void
2113 // CHECK3-LABEL: define {{[^@]+}}@main
2114 // CHECK3-SAME: () #[[ATTR3:[0-9]+]] {
2115 // CHECK3-NEXT: entry:
2116 // CHECK3-NEXT: [[RETVAL:%.*]] = alloca i32, align 4
2117 // CHECK3-NEXT: [[TMP:%.*]] = alloca i32, align 4
2118 // CHECK3-NEXT: [[KERNEL_ARGS:%.*]] = alloca [[STRUCT___TGT_KERNEL_ARGUMENTS:%.*]], align 8
2119 // CHECK3-NEXT: [[_TMP1:%.*]] = alloca i32, align 4
2120 // CHECK3-NEXT: [[KERNEL_ARGS2:%.*]] = alloca [[STRUCT___TGT_KERNEL_ARGUMENTS]], align 8
2121 // CHECK3-NEXT: [[ARG_CASTED:%.*]] = alloca i64, align 8
2122 // CHECK3-NEXT: [[DOTOFFLOAD_BASEPTRS:%.*]] = alloca [1 x ptr], align 8
2123 // CHECK3-NEXT: [[DOTOFFLOAD_PTRS:%.*]] = alloca [1 x ptr], align 8
2124 // CHECK3-NEXT: [[DOTOFFLOAD_MAPPERS:%.*]] = alloca [1 x ptr], align 8
2125 // CHECK3-NEXT: [[_TMP5:%.*]] = alloca i32, align 4
2126 // CHECK3-NEXT: [[KERNEL_ARGS6:%.*]] = alloca [[STRUCT___TGT_KERNEL_ARGUMENTS]], align 8
2127 // CHECK3-NEXT: store i32 0, ptr [[RETVAL]], align 4
2128 // CHECK3-NEXT: [[TMP0:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 0
2129 // CHECK3-NEXT: store i32 2, ptr [[TMP0]], align 4
2130 // CHECK3-NEXT: [[TMP1:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 1
2131 // CHECK3-NEXT: store i32 0, ptr [[TMP1]], align 4
2132 // CHECK3-NEXT: [[TMP2:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 2
2133 // CHECK3-NEXT: store ptr null, ptr [[TMP2]], align 8
2134 // CHECK3-NEXT: [[TMP3:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 3
2135 // CHECK3-NEXT: store ptr null, ptr [[TMP3]], align 8
2136 // CHECK3-NEXT: [[TMP4:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 4
2137 // CHECK3-NEXT: store ptr null, ptr [[TMP4]], align 8
2138 // CHECK3-NEXT: [[TMP5:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 5
2139 // CHECK3-NEXT: store ptr null, ptr [[TMP5]], align 8
2140 // CHECK3-NEXT: [[TMP6:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 6
2141 // CHECK3-NEXT: store ptr null, ptr [[TMP6]], align 8
2142 // CHECK3-NEXT: [[TMP7:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 7
2143 // CHECK3-NEXT: store ptr null, ptr [[TMP7]], align 8
2144 // CHECK3-NEXT: [[TMP8:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 8
2145 // CHECK3-NEXT: store i64 100, ptr [[TMP8]], align 8
2146 // CHECK3-NEXT: [[TMP9:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 9
2147 // CHECK3-NEXT: store i64 0, ptr [[TMP9]], align 8
2148 // CHECK3-NEXT: [[TMP10:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 10
2149 // CHECK3-NEXT: store [3 x i32] zeroinitializer, ptr [[TMP10]], align 4
2150 // CHECK3-NEXT: [[TMP11:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 11
2151 // CHECK3-NEXT: store [3 x i32] zeroinitializer, ptr [[TMP11]], align 4
2152 // CHECK3-NEXT: [[TMP12:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 12
2153 // CHECK3-NEXT: store i32 0, ptr [[TMP12]], align 4
2154 // CHECK3-NEXT: [[TMP13:%.*]] = call i32 @__tgt_target_kernel(ptr @[[GLOB3]], i64 -1, i32 0, i32 0, ptr @.{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}_main_l81.region_id, ptr [[KERNEL_ARGS]])
2155 // CHECK3-NEXT: [[TMP14:%.*]] = icmp ne i32 [[TMP13]], 0
2156 // CHECK3-NEXT: br i1 [[TMP14]], label [[OMP_OFFLOAD_FAILED:%.*]], label [[OMP_OFFLOAD_CONT:%.*]]
2157 // CHECK3: omp_offload.failed:
2158 // CHECK3-NEXT: call void @{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}_main_l81() #[[ATTR2]]
2159 // CHECK3-NEXT: br label [[OMP_OFFLOAD_CONT]]
2160 // CHECK3: omp_offload.cont:
2161 // CHECK3-NEXT: [[TMP15:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS2]], i32 0, i32 0
2162 // CHECK3-NEXT: store i32 2, ptr [[TMP15]], align 4
2163 // CHECK3-NEXT: [[TMP16:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS2]], i32 0, i32 1
2164 // CHECK3-NEXT: store i32 0, ptr [[TMP16]], align 4
2165 // CHECK3-NEXT: [[TMP17:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS2]], i32 0, i32 2
2166 // CHECK3-NEXT: store ptr null, ptr [[TMP17]], align 8
2167 // CHECK3-NEXT: [[TMP18:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS2]], i32 0, i32 3
2168 // CHECK3-NEXT: store ptr null, ptr [[TMP18]], align 8
2169 // CHECK3-NEXT: [[TMP19:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS2]], i32 0, i32 4
2170 // CHECK3-NEXT: store ptr null, ptr [[TMP19]], align 8
2171 // CHECK3-NEXT: [[TMP20:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS2]], i32 0, i32 5
2172 // CHECK3-NEXT: store ptr null, ptr [[TMP20]], align 8
2173 // CHECK3-NEXT: [[TMP21:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS2]], i32 0, i32 6
2174 // CHECK3-NEXT: store ptr null, ptr [[TMP21]], align 8
2175 // CHECK3-NEXT: [[TMP22:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS2]], i32 0, i32 7
2176 // CHECK3-NEXT: store ptr null, ptr [[TMP22]], align 8
2177 // CHECK3-NEXT: [[TMP23:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS2]], i32 0, i32 8
2178 // CHECK3-NEXT: store i64 100, ptr [[TMP23]], align 8
2179 // CHECK3-NEXT: [[TMP24:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS2]], i32 0, i32 9
2180 // CHECK3-NEXT: store i64 0, ptr [[TMP24]], align 8
2181 // CHECK3-NEXT: [[TMP25:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS2]], i32 0, i32 10
2182 // CHECK3-NEXT: store [3 x i32] zeroinitializer, ptr [[TMP25]], align 4
2183 // CHECK3-NEXT: [[TMP26:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS2]], i32 0, i32 11
2184 // CHECK3-NEXT: store [3 x i32] zeroinitializer, ptr [[TMP26]], align 4
2185 // CHECK3-NEXT: [[TMP27:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS2]], i32 0, i32 12
2186 // CHECK3-NEXT: store i32 0, ptr [[TMP27]], align 4
2187 // CHECK3-NEXT: [[TMP28:%.*]] = call i32 @__tgt_target_kernel(ptr @[[GLOB3]], i64 -1, i32 0, i32 0, ptr @.{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}_main_l90.region_id, ptr [[KERNEL_ARGS2]])
2188 // CHECK3-NEXT: [[TMP29:%.*]] = icmp ne i32 [[TMP28]], 0
2189 // CHECK3-NEXT: br i1 [[TMP29]], label [[OMP_OFFLOAD_FAILED3:%.*]], label [[OMP_OFFLOAD_CONT4:%.*]]
2190 // CHECK3: omp_offload.failed3:
2191 // CHECK3-NEXT: call void @{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}_main_l90() #[[ATTR2]]
2192 // CHECK3-NEXT: br label [[OMP_OFFLOAD_CONT4]]
2193 // CHECK3: omp_offload.cont4:
2194 // CHECK3-NEXT: [[TMP30:%.*]] = load i32, ptr @Arg, align 4
2195 // CHECK3-NEXT: store i32 [[TMP30]], ptr [[ARG_CASTED]], align 4
2196 // CHECK3-NEXT: [[TMP31:%.*]] = load i64, ptr [[ARG_CASTED]], align 8
2197 // CHECK3-NEXT: [[TMP32:%.*]] = getelementptr inbounds [1 x ptr], ptr [[DOTOFFLOAD_BASEPTRS]], i32 0, i32 0
2198 // CHECK3-NEXT: store i64 [[TMP31]], ptr [[TMP32]], align 8
2199 // CHECK3-NEXT: [[TMP33:%.*]] = getelementptr inbounds [1 x ptr], ptr [[DOTOFFLOAD_PTRS]], i32 0, i32 0
2200 // CHECK3-NEXT: store i64 [[TMP31]], ptr [[TMP33]], align 8
2201 // CHECK3-NEXT: [[TMP34:%.*]] = getelementptr inbounds [1 x ptr], ptr [[DOTOFFLOAD_MAPPERS]], i64 0, i64 0
2202 // CHECK3-NEXT: store ptr null, ptr [[TMP34]], align 8
2203 // CHECK3-NEXT: [[TMP35:%.*]] = getelementptr inbounds [1 x ptr], ptr [[DOTOFFLOAD_BASEPTRS]], i32 0, i32 0
2204 // CHECK3-NEXT: [[TMP36:%.*]] = getelementptr inbounds [1 x ptr], ptr [[DOTOFFLOAD_PTRS]], i32 0, i32 0
2205 // CHECK3-NEXT: [[TMP37:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS6]], i32 0, i32 0
2206 // CHECK3-NEXT: store i32 2, ptr [[TMP37]], align 4
2207 // CHECK3-NEXT: [[TMP38:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS6]], i32 0, i32 1
2208 // CHECK3-NEXT: store i32 1, ptr [[TMP38]], align 4
2209 // CHECK3-NEXT: [[TMP39:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS6]], i32 0, i32 2
2210 // CHECK3-NEXT: store ptr [[TMP35]], ptr [[TMP39]], align 8
2211 // CHECK3-NEXT: [[TMP40:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS6]], i32 0, i32 3
2212 // CHECK3-NEXT: store ptr [[TMP36]], ptr [[TMP40]], align 8
2213 // CHECK3-NEXT: [[TMP41:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS6]], i32 0, i32 4
2214 // CHECK3-NEXT: store ptr @.offload_sizes, ptr [[TMP41]], align 8
2215 // CHECK3-NEXT: [[TMP42:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS6]], i32 0, i32 5
2216 // CHECK3-NEXT: store ptr @.offload_maptypes, ptr [[TMP42]], align 8
2217 // CHECK3-NEXT: [[TMP43:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS6]], i32 0, i32 6
2218 // CHECK3-NEXT: store ptr null, ptr [[TMP43]], align 8
2219 // CHECK3-NEXT: [[TMP44:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS6]], i32 0, i32 7
2220 // CHECK3-NEXT: store ptr null, ptr [[TMP44]], align 8
2221 // CHECK3-NEXT: [[TMP45:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS6]], i32 0, i32 8
2222 // CHECK3-NEXT: store i64 100, ptr [[TMP45]], align 8
2223 // CHECK3-NEXT: [[TMP46:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS6]], i32 0, i32 9
2224 // CHECK3-NEXT: store i64 0, ptr [[TMP46]], align 8
2225 // CHECK3-NEXT: [[TMP47:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS6]], i32 0, i32 10
2226 // CHECK3-NEXT: store [3 x i32] zeroinitializer, ptr [[TMP47]], align 4
2227 // CHECK3-NEXT: [[TMP48:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS6]], i32 0, i32 11
2228 // CHECK3-NEXT: store [3 x i32] zeroinitializer, ptr [[TMP48]], align 4
2229 // CHECK3-NEXT: [[TMP49:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS6]], i32 0, i32 12
2230 // CHECK3-NEXT: store i32 0, ptr [[TMP49]], align 4
2231 // CHECK3-NEXT: [[TMP50:%.*]] = call i32 @__tgt_target_kernel(ptr @[[GLOB3]], i64 -1, i32 0, i32 0, ptr @.{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}_main_l99.region_id, ptr [[KERNEL_ARGS6]])
2232 // CHECK3-NEXT: [[TMP51:%.*]] = icmp ne i32 [[TMP50]], 0
2233 // CHECK3-NEXT: br i1 [[TMP51]], label [[OMP_OFFLOAD_FAILED7:%.*]], label [[OMP_OFFLOAD_CONT8:%.*]]
2234 // CHECK3: omp_offload.failed7:
2235 // CHECK3-NEXT: call void @{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}_main_l99(i64 [[TMP31]]) #[[ATTR2]]
2236 // CHECK3-NEXT: br label [[OMP_OFFLOAD_CONT8]]
2237 // CHECK3: omp_offload.cont8:
2238 // CHECK3-NEXT: [[TMP52:%.*]] = load i32, ptr @Arg, align 4
2239 // CHECK3-NEXT: [[CALL:%.*]] = call noundef i32 @_Z5tmainIiEiT_(i32 noundef [[TMP52]])
2240 // CHECK3-NEXT: ret i32 [[CALL]]
2243 // CHECK3-LABEL: define {{[^@]+}}@{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}_main_l81
2244 // CHECK3-SAME: () #[[ATTR1]] {
2245 // CHECK3-NEXT: entry:
2246 // CHECK3-NEXT: call void (ptr, i32, ptr, ...) @__kmpc_fork_teams(ptr @[[GLOB3]], i32 0, ptr @{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}_main_l81.omp_outlined)
2247 // CHECK3-NEXT: ret void
2250 // CHECK3-LABEL: define {{[^@]+}}@{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}_main_l81.omp_outlined
2251 // CHECK3-SAME: (ptr noalias noundef [[DOTGLOBAL_TID_:%.*]], ptr noalias noundef [[DOTBOUND_TID_:%.*]]) #[[ATTR1]] {
2252 // CHECK3-NEXT: entry:
2253 // CHECK3-NEXT: [[DOTGLOBAL_TID__ADDR:%.*]] = alloca ptr, align 8
2254 // CHECK3-NEXT: [[DOTBOUND_TID__ADDR:%.*]] = alloca ptr, align 8
2255 // CHECK3-NEXT: [[DOTOMP_IV:%.*]] = alloca i32, align 4
2256 // CHECK3-NEXT: [[TMP:%.*]] = alloca i32, align 4
2257 // CHECK3-NEXT: [[DOTOMP_COMB_LB:%.*]] = alloca i32, align 4
2258 // CHECK3-NEXT: [[DOTOMP_COMB_UB:%.*]] = alloca i32, align 4
2259 // CHECK3-NEXT: [[DOTOMP_STRIDE:%.*]] = alloca i32, align 4
2260 // CHECK3-NEXT: [[DOTOMP_IS_LAST:%.*]] = alloca i32, align 4
2261 // CHECK3-NEXT: [[I:%.*]] = alloca i32, align 4
2262 // CHECK3-NEXT: store ptr [[DOTGLOBAL_TID_]], ptr [[DOTGLOBAL_TID__ADDR]], align 8
2263 // CHECK3-NEXT: store ptr [[DOTBOUND_TID_]], ptr [[DOTBOUND_TID__ADDR]], align 8
2264 // CHECK3-NEXT: store i32 0, ptr [[DOTOMP_COMB_LB]], align 4
2265 // CHECK3-NEXT: store i32 99, ptr [[DOTOMP_COMB_UB]], align 4
2266 // CHECK3-NEXT: store i32 1, ptr [[DOTOMP_STRIDE]], align 4
2267 // CHECK3-NEXT: store i32 0, ptr [[DOTOMP_IS_LAST]], align 4
2268 // CHECK3-NEXT: [[TMP0:%.*]] = load ptr, ptr [[DOTGLOBAL_TID__ADDR]], align 8
2269 // CHECK3-NEXT: [[TMP1:%.*]] = load i32, ptr [[TMP0]], align 4
2270 // CHECK3-NEXT: call void @__kmpc_for_static_init_4(ptr @[[GLOB1]], i32 [[TMP1]], i32 92, ptr [[DOTOMP_IS_LAST]], ptr [[DOTOMP_COMB_LB]], ptr [[DOTOMP_COMB_UB]], ptr [[DOTOMP_STRIDE]], i32 1, i32 1)
2271 // CHECK3-NEXT: [[TMP2:%.*]] = load i32, ptr [[DOTOMP_COMB_UB]], align 4
2272 // CHECK3-NEXT: [[CMP:%.*]] = icmp sgt i32 [[TMP2]], 99
2273 // CHECK3-NEXT: br i1 [[CMP]], label [[COND_TRUE:%.*]], label [[COND_FALSE:%.*]]
2274 // CHECK3: cond.true:
2275 // CHECK3-NEXT: br label [[COND_END:%.*]]
2276 // CHECK3: cond.false:
2277 // CHECK3-NEXT: [[TMP3:%.*]] = load i32, ptr [[DOTOMP_COMB_UB]], align 4
2278 // CHECK3-NEXT: br label [[COND_END]]
2279 // CHECK3: cond.end:
2280 // CHECK3-NEXT: [[COND:%.*]] = phi i32 [ 99, [[COND_TRUE]] ], [ [[TMP3]], [[COND_FALSE]] ]
2281 // CHECK3-NEXT: store i32 [[COND]], ptr [[DOTOMP_COMB_UB]], align 4
2282 // CHECK3-NEXT: [[TMP4:%.*]] = load i32, ptr [[DOTOMP_COMB_LB]], align 4
2283 // CHECK3-NEXT: store i32 [[TMP4]], ptr [[DOTOMP_IV]], align 4
2284 // CHECK3-NEXT: br label [[OMP_INNER_FOR_COND:%.*]]
2285 // CHECK3: omp.inner.for.cond:
2286 // CHECK3-NEXT: [[TMP5:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP26:![0-9]+]]
2287 // CHECK3-NEXT: [[TMP6:%.*]] = load i32, ptr [[DOTOMP_COMB_UB]], align 4, !llvm.access.group [[ACC_GRP26]]
2288 // CHECK3-NEXT: [[CMP1:%.*]] = icmp sle i32 [[TMP5]], [[TMP6]]
2289 // CHECK3-NEXT: br i1 [[CMP1]], label [[OMP_INNER_FOR_BODY:%.*]], label [[OMP_INNER_FOR_END:%.*]]
2290 // CHECK3: omp.inner.for.body:
2291 // CHECK3-NEXT: [[TMP7:%.*]] = load i32, ptr [[DOTOMP_COMB_LB]], align 4, !llvm.access.group [[ACC_GRP26]]
2292 // CHECK3-NEXT: [[TMP8:%.*]] = zext i32 [[TMP7]] to i64
2293 // CHECK3-NEXT: [[TMP9:%.*]] = load i32, ptr [[DOTOMP_COMB_UB]], align 4, !llvm.access.group [[ACC_GRP26]]
2294 // CHECK3-NEXT: [[TMP10:%.*]] = zext i32 [[TMP9]] to i64
2295 // CHECK3-NEXT: call void (ptr, i32, ptr, ...) @__kmpc_fork_call(ptr @[[GLOB3]], i32 2, ptr @{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}_main_l81.omp_outlined.omp_outlined, i64 [[TMP8]], i64 [[TMP10]]), !llvm.access.group [[ACC_GRP26]]
2296 // CHECK3-NEXT: br label [[OMP_INNER_FOR_INC:%.*]]
2297 // CHECK3: omp.inner.for.inc:
2298 // CHECK3-NEXT: [[TMP11:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP26]]
2299 // CHECK3-NEXT: [[TMP12:%.*]] = load i32, ptr [[DOTOMP_STRIDE]], align 4, !llvm.access.group [[ACC_GRP26]]
2300 // CHECK3-NEXT: [[ADD:%.*]] = add nsw i32 [[TMP11]], [[TMP12]]
2301 // CHECK3-NEXT: store i32 [[ADD]], ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP26]]
2302 // CHECK3-NEXT: br label [[OMP_INNER_FOR_COND]], !llvm.loop [[LOOP27:![0-9]+]]
2303 // CHECK3: omp.inner.for.end:
2304 // CHECK3-NEXT: br label [[OMP_LOOP_EXIT:%.*]]
2305 // CHECK3: omp.loop.exit:
2306 // CHECK3-NEXT: call void @__kmpc_for_static_fini(ptr @[[GLOB1]], i32 [[TMP1]])
2307 // CHECK3-NEXT: [[TMP13:%.*]] = load i32, ptr [[DOTOMP_IS_LAST]], align 4
2308 // CHECK3-NEXT: [[TMP14:%.*]] = icmp ne i32 [[TMP13]], 0
2309 // CHECK3-NEXT: br i1 [[TMP14]], label [[DOTOMP_FINAL_THEN:%.*]], label [[DOTOMP_FINAL_DONE:%.*]]
2310 // CHECK3: .omp.final.then:
2311 // CHECK3-NEXT: store i32 100, ptr [[I]], align 4
2312 // CHECK3-NEXT: br label [[DOTOMP_FINAL_DONE]]
2313 // CHECK3: .omp.final.done:
2314 // CHECK3-NEXT: ret void
2317 // CHECK3-LABEL: define {{[^@]+}}@{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}_main_l81.omp_outlined.omp_outlined
2318 // CHECK3-SAME: (ptr noalias noundef [[DOTGLOBAL_TID_:%.*]], ptr noalias noundef [[DOTBOUND_TID_:%.*]], i64 noundef [[DOTPREVIOUS_LB_:%.*]], i64 noundef [[DOTPREVIOUS_UB_:%.*]]) #[[ATTR1]] {
2319 // CHECK3-NEXT: entry:
2320 // CHECK3-NEXT: [[DOTGLOBAL_TID__ADDR:%.*]] = alloca ptr, align 8
2321 // CHECK3-NEXT: [[DOTBOUND_TID__ADDR:%.*]] = alloca ptr, align 8
2322 // CHECK3-NEXT: [[DOTPREVIOUS_LB__ADDR:%.*]] = alloca i64, align 8
2323 // CHECK3-NEXT: [[DOTPREVIOUS_UB__ADDR:%.*]] = alloca i64, align 8
2324 // CHECK3-NEXT: [[DOTOMP_IV:%.*]] = alloca i32, align 4
2325 // CHECK3-NEXT: [[TMP:%.*]] = alloca i32, align 4
2326 // CHECK3-NEXT: [[DOTOMP_LB:%.*]] = alloca i32, align 4
2327 // CHECK3-NEXT: [[DOTOMP_UB:%.*]] = alloca i32, align 4
2328 // CHECK3-NEXT: [[DOTOMP_STRIDE:%.*]] = alloca i32, align 4
2329 // CHECK3-NEXT: [[DOTOMP_IS_LAST:%.*]] = alloca i32, align 4
2330 // CHECK3-NEXT: [[I:%.*]] = alloca i32, align 4
2331 // CHECK3-NEXT: store ptr [[DOTGLOBAL_TID_]], ptr [[DOTGLOBAL_TID__ADDR]], align 8
2332 // CHECK3-NEXT: store ptr [[DOTBOUND_TID_]], ptr [[DOTBOUND_TID__ADDR]], align 8
2333 // CHECK3-NEXT: store i64 [[DOTPREVIOUS_LB_]], ptr [[DOTPREVIOUS_LB__ADDR]], align 8
2334 // CHECK3-NEXT: store i64 [[DOTPREVIOUS_UB_]], ptr [[DOTPREVIOUS_UB__ADDR]], align 8
2335 // CHECK3-NEXT: store i32 0, ptr [[DOTOMP_LB]], align 4
2336 // CHECK3-NEXT: store i32 99, ptr [[DOTOMP_UB]], align 4
2337 // CHECK3-NEXT: [[TMP0:%.*]] = load i64, ptr [[DOTPREVIOUS_LB__ADDR]], align 8
2338 // CHECK3-NEXT: [[CONV:%.*]] = trunc i64 [[TMP0]] to i32
2339 // CHECK3-NEXT: [[TMP1:%.*]] = load i64, ptr [[DOTPREVIOUS_UB__ADDR]], align 8
2340 // CHECK3-NEXT: [[CONV1:%.*]] = trunc i64 [[TMP1]] to i32
2341 // CHECK3-NEXT: store i32 [[CONV]], ptr [[DOTOMP_LB]], align 4
2342 // CHECK3-NEXT: store i32 [[CONV1]], ptr [[DOTOMP_UB]], align 4
2343 // CHECK3-NEXT: store i32 1, ptr [[DOTOMP_STRIDE]], align 4
2344 // CHECK3-NEXT: store i32 0, ptr [[DOTOMP_IS_LAST]], align 4
2345 // CHECK3-NEXT: [[TMP2:%.*]] = load ptr, ptr [[DOTGLOBAL_TID__ADDR]], align 8
2346 // CHECK3-NEXT: [[TMP3:%.*]] = load i32, ptr [[TMP2]], align 4
2347 // CHECK3-NEXT: call void @__kmpc_for_static_init_4(ptr @[[GLOB2]], i32 [[TMP3]], i32 34, ptr [[DOTOMP_IS_LAST]], ptr [[DOTOMP_LB]], ptr [[DOTOMP_UB]], ptr [[DOTOMP_STRIDE]], i32 1, i32 1)
2348 // CHECK3-NEXT: [[TMP4:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4
2349 // CHECK3-NEXT: [[CMP:%.*]] = icmp sgt i32 [[TMP4]], 99
2350 // CHECK3-NEXT: br i1 [[CMP]], label [[COND_TRUE:%.*]], label [[COND_FALSE:%.*]]
2351 // CHECK3: cond.true:
2352 // CHECK3-NEXT: br label [[COND_END:%.*]]
2353 // CHECK3: cond.false:
2354 // CHECK3-NEXT: [[TMP5:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4
2355 // CHECK3-NEXT: br label [[COND_END]]
2356 // CHECK3: cond.end:
2357 // CHECK3-NEXT: [[COND:%.*]] = phi i32 [ 99, [[COND_TRUE]] ], [ [[TMP5]], [[COND_FALSE]] ]
2358 // CHECK3-NEXT: store i32 [[COND]], ptr [[DOTOMP_UB]], align 4
2359 // CHECK3-NEXT: [[TMP6:%.*]] = load i32, ptr [[DOTOMP_LB]], align 4
2360 // CHECK3-NEXT: store i32 [[TMP6]], ptr [[DOTOMP_IV]], align 4
2361 // CHECK3-NEXT: br label [[OMP_INNER_FOR_COND:%.*]]
2362 // CHECK3: omp.inner.for.cond:
2363 // CHECK3-NEXT: [[TMP7:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP29:![0-9]+]]
2364 // CHECK3-NEXT: [[TMP8:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4, !llvm.access.group [[ACC_GRP29]]
2365 // CHECK3-NEXT: [[CMP2:%.*]] = icmp sle i32 [[TMP7]], [[TMP8]]
2366 // CHECK3-NEXT: br i1 [[CMP2]], label [[OMP_INNER_FOR_BODY:%.*]], label [[OMP_INNER_FOR_END:%.*]]
2367 // CHECK3: omp.inner.for.body:
2368 // CHECK3-NEXT: [[TMP9:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP29]]
2369 // CHECK3-NEXT: [[MUL:%.*]] = mul nsw i32 [[TMP9]], 1
2370 // CHECK3-NEXT: [[ADD:%.*]] = add nsw i32 0, [[MUL]]
2371 // CHECK3-NEXT: store i32 [[ADD]], ptr [[I]], align 4, !llvm.access.group [[ACC_GRP29]]
2372 // CHECK3-NEXT: call void @_Z3fn4v(), !llvm.access.group [[ACC_GRP29]]
2373 // CHECK3-NEXT: br label [[OMP_BODY_CONTINUE:%.*]]
2374 // CHECK3: omp.body.continue:
2375 // CHECK3-NEXT: br label [[OMP_INNER_FOR_INC:%.*]]
2376 // CHECK3: omp.inner.for.inc:
2377 // CHECK3-NEXT: [[TMP10:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP29]]
2378 // CHECK3-NEXT: [[ADD3:%.*]] = add nsw i32 [[TMP10]], 1
2379 // CHECK3-NEXT: store i32 [[ADD3]], ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP29]]
2380 // CHECK3-NEXT: br label [[OMP_INNER_FOR_COND]], !llvm.loop [[LOOP30:![0-9]+]]
2381 // CHECK3: omp.inner.for.end:
2382 // CHECK3-NEXT: br label [[OMP_LOOP_EXIT:%.*]]
2383 // CHECK3: omp.loop.exit:
2384 // CHECK3-NEXT: call void @__kmpc_for_static_fini(ptr @[[GLOB1]], i32 [[TMP3]])
2385 // CHECK3-NEXT: [[TMP11:%.*]] = load i32, ptr [[DOTOMP_IS_LAST]], align 4
2386 // CHECK3-NEXT: [[TMP12:%.*]] = icmp ne i32 [[TMP11]], 0
2387 // CHECK3-NEXT: br i1 [[TMP12]], label [[DOTOMP_FINAL_THEN:%.*]], label [[DOTOMP_FINAL_DONE:%.*]]
2388 // CHECK3: .omp.final.then:
2389 // CHECK3-NEXT: store i32 100, ptr [[I]], align 4
2390 // CHECK3-NEXT: br label [[DOTOMP_FINAL_DONE]]
2391 // CHECK3: .omp.final.done:
2392 // CHECK3-NEXT: ret void
2395 // CHECK3-LABEL: define {{[^@]+}}@{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}_main_l90
2396 // CHECK3-SAME: () #[[ATTR1]] {
2397 // CHECK3-NEXT: entry:
2398 // CHECK3-NEXT: call void (ptr, i32, ptr, ...) @__kmpc_fork_teams(ptr @[[GLOB3]], i32 0, ptr @{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}_main_l90.omp_outlined)
2399 // CHECK3-NEXT: ret void
2402 // CHECK3-LABEL: define {{[^@]+}}@{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}_main_l90.omp_outlined
2403 // CHECK3-SAME: (ptr noalias noundef [[DOTGLOBAL_TID_:%.*]], ptr noalias noundef [[DOTBOUND_TID_:%.*]]) #[[ATTR1]] {
2404 // CHECK3-NEXT: entry:
2405 // CHECK3-NEXT: [[DOTGLOBAL_TID__ADDR:%.*]] = alloca ptr, align 8
2406 // CHECK3-NEXT: [[DOTBOUND_TID__ADDR:%.*]] = alloca ptr, align 8
2407 // CHECK3-NEXT: [[DOTOMP_IV:%.*]] = alloca i32, align 4
2408 // CHECK3-NEXT: [[TMP:%.*]] = alloca i32, align 4
2409 // CHECK3-NEXT: [[DOTOMP_COMB_LB:%.*]] = alloca i32, align 4
2410 // CHECK3-NEXT: [[DOTOMP_COMB_UB:%.*]] = alloca i32, align 4
2411 // CHECK3-NEXT: [[DOTOMP_STRIDE:%.*]] = alloca i32, align 4
2412 // CHECK3-NEXT: [[DOTOMP_IS_LAST:%.*]] = alloca i32, align 4
2413 // CHECK3-NEXT: [[I:%.*]] = alloca i32, align 4
2414 // CHECK3-NEXT: [[DOTBOUND_ZERO_ADDR:%.*]] = alloca i32, align 4
2415 // CHECK3-NEXT: store ptr [[DOTGLOBAL_TID_]], ptr [[DOTGLOBAL_TID__ADDR]], align 8
2416 // CHECK3-NEXT: store ptr [[DOTBOUND_TID_]], ptr [[DOTBOUND_TID__ADDR]], align 8
2417 // CHECK3-NEXT: store i32 0, ptr [[DOTOMP_COMB_LB]], align 4
2418 // CHECK3-NEXT: store i32 99, ptr [[DOTOMP_COMB_UB]], align 4
2419 // CHECK3-NEXT: store i32 1, ptr [[DOTOMP_STRIDE]], align 4
2420 // CHECK3-NEXT: store i32 0, ptr [[DOTOMP_IS_LAST]], align 4
2421 // CHECK3-NEXT: [[TMP0:%.*]] = load ptr, ptr [[DOTGLOBAL_TID__ADDR]], align 8
2422 // CHECK3-NEXT: [[TMP1:%.*]] = load i32, ptr [[TMP0]], align 4
2423 // CHECK3-NEXT: call void @__kmpc_for_static_init_4(ptr @[[GLOB1]], i32 [[TMP1]], i32 92, ptr [[DOTOMP_IS_LAST]], ptr [[DOTOMP_COMB_LB]], ptr [[DOTOMP_COMB_UB]], ptr [[DOTOMP_STRIDE]], i32 1, i32 1)
2424 // CHECK3-NEXT: [[TMP2:%.*]] = load i32, ptr [[DOTOMP_COMB_UB]], align 4
2425 // CHECK3-NEXT: [[CMP:%.*]] = icmp sgt i32 [[TMP2]], 99
2426 // CHECK3-NEXT: br i1 [[CMP]], label [[COND_TRUE:%.*]], label [[COND_FALSE:%.*]]
2427 // CHECK3: cond.true:
2428 // CHECK3-NEXT: br label [[COND_END:%.*]]
2429 // CHECK3: cond.false:
2430 // CHECK3-NEXT: [[TMP3:%.*]] = load i32, ptr [[DOTOMP_COMB_UB]], align 4
2431 // CHECK3-NEXT: br label [[COND_END]]
2432 // CHECK3: cond.end:
2433 // CHECK3-NEXT: [[COND:%.*]] = phi i32 [ 99, [[COND_TRUE]] ], [ [[TMP3]], [[COND_FALSE]] ]
2434 // CHECK3-NEXT: store i32 [[COND]], ptr [[DOTOMP_COMB_UB]], align 4
2435 // CHECK3-NEXT: [[TMP4:%.*]] = load i32, ptr [[DOTOMP_COMB_LB]], align 4
2436 // CHECK3-NEXT: store i32 [[TMP4]], ptr [[DOTOMP_IV]], align 4
2437 // CHECK3-NEXT: br label [[OMP_INNER_FOR_COND:%.*]]
2438 // CHECK3: omp.inner.for.cond:
2439 // CHECK3-NEXT: [[TMP5:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4
2440 // CHECK3-NEXT: [[TMP6:%.*]] = load i32, ptr [[DOTOMP_COMB_UB]], align 4
2441 // CHECK3-NEXT: [[CMP1:%.*]] = icmp sle i32 [[TMP5]], [[TMP6]]
2442 // CHECK3-NEXT: br i1 [[CMP1]], label [[OMP_INNER_FOR_BODY:%.*]], label [[OMP_INNER_FOR_END:%.*]]
2443 // CHECK3: omp.inner.for.body:
2444 // CHECK3-NEXT: [[TMP7:%.*]] = load i32, ptr [[DOTOMP_COMB_LB]], align 4
2445 // CHECK3-NEXT: [[TMP8:%.*]] = zext i32 [[TMP7]] to i64
2446 // CHECK3-NEXT: [[TMP9:%.*]] = load i32, ptr [[DOTOMP_COMB_UB]], align 4
2447 // CHECK3-NEXT: [[TMP10:%.*]] = zext i32 [[TMP9]] to i64
2448 // CHECK3-NEXT: call void @__kmpc_serialized_parallel(ptr @[[GLOB3]], i32 [[TMP1]])
2449 // CHECK3-NEXT: [[TMP11:%.*]] = load ptr, ptr [[DOTGLOBAL_TID__ADDR]], align 8
2450 // CHECK3-NEXT: store i32 0, ptr [[DOTBOUND_ZERO_ADDR]], align 4
2451 // CHECK3-NEXT: call void @{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}_main_l90.omp_outlined.omp_outlined(ptr [[TMP11]], ptr [[DOTBOUND_ZERO_ADDR]], i64 [[TMP8]], i64 [[TMP10]]) #[[ATTR2]]
2452 // CHECK3-NEXT: call void @__kmpc_end_serialized_parallel(ptr @[[GLOB3]], i32 [[TMP1]])
2453 // CHECK3-NEXT: br label [[OMP_INNER_FOR_INC:%.*]]
2454 // CHECK3: omp.inner.for.inc:
2455 // CHECK3-NEXT: [[TMP12:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4
2456 // CHECK3-NEXT: [[TMP13:%.*]] = load i32, ptr [[DOTOMP_STRIDE]], align 4
2457 // CHECK3-NEXT: [[ADD:%.*]] = add nsw i32 [[TMP12]], [[TMP13]]
2458 // CHECK3-NEXT: store i32 [[ADD]], ptr [[DOTOMP_IV]], align 4
2459 // CHECK3-NEXT: br label [[OMP_INNER_FOR_COND]], !llvm.loop [[LOOP32:![0-9]+]]
2460 // CHECK3: omp.inner.for.end:
2461 // CHECK3-NEXT: br label [[OMP_LOOP_EXIT:%.*]]
2462 // CHECK3: omp.loop.exit:
2463 // CHECK3-NEXT: call void @__kmpc_for_static_fini(ptr @[[GLOB1]], i32 [[TMP1]])
2464 // CHECK3-NEXT: [[TMP14:%.*]] = load i32, ptr [[DOTOMP_IS_LAST]], align 4
2465 // CHECK3-NEXT: [[TMP15:%.*]] = icmp ne i32 [[TMP14]], 0
2466 // CHECK3-NEXT: br i1 [[TMP15]], label [[DOTOMP_FINAL_THEN:%.*]], label [[DOTOMP_FINAL_DONE:%.*]]
2467 // CHECK3: .omp.final.then:
2468 // CHECK3-NEXT: store i32 100, ptr [[I]], align 4
2469 // CHECK3-NEXT: br label [[DOTOMP_FINAL_DONE]]
2470 // CHECK3: .omp.final.done:
2471 // CHECK3-NEXT: ret void
2474 // CHECK3-LABEL: define {{[^@]+}}@{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}_main_l90.omp_outlined.omp_outlined
2475 // CHECK3-SAME: (ptr noalias noundef [[DOTGLOBAL_TID_:%.*]], ptr noalias noundef [[DOTBOUND_TID_:%.*]], i64 noundef [[DOTPREVIOUS_LB_:%.*]], i64 noundef [[DOTPREVIOUS_UB_:%.*]]) #[[ATTR1]] {
2476 // CHECK3-NEXT: entry:
2477 // CHECK3-NEXT: [[DOTGLOBAL_TID__ADDR:%.*]] = alloca ptr, align 8
2478 // CHECK3-NEXT: [[DOTBOUND_TID__ADDR:%.*]] = alloca ptr, align 8
2479 // CHECK3-NEXT: [[DOTPREVIOUS_LB__ADDR:%.*]] = alloca i64, align 8
2480 // CHECK3-NEXT: [[DOTPREVIOUS_UB__ADDR:%.*]] = alloca i64, align 8
2481 // CHECK3-NEXT: [[DOTOMP_IV:%.*]] = alloca i32, align 4
2482 // CHECK3-NEXT: [[TMP:%.*]] = alloca i32, align 4
2483 // CHECK3-NEXT: [[DOTOMP_LB:%.*]] = alloca i32, align 4
2484 // CHECK3-NEXT: [[DOTOMP_UB:%.*]] = alloca i32, align 4
2485 // CHECK3-NEXT: [[DOTOMP_STRIDE:%.*]] = alloca i32, align 4
2486 // CHECK3-NEXT: [[DOTOMP_IS_LAST:%.*]] = alloca i32, align 4
2487 // CHECK3-NEXT: [[I:%.*]] = alloca i32, align 4
2488 // CHECK3-NEXT: store ptr [[DOTGLOBAL_TID_]], ptr [[DOTGLOBAL_TID__ADDR]], align 8
2489 // CHECK3-NEXT: store ptr [[DOTBOUND_TID_]], ptr [[DOTBOUND_TID__ADDR]], align 8
2490 // CHECK3-NEXT: store i64 [[DOTPREVIOUS_LB_]], ptr [[DOTPREVIOUS_LB__ADDR]], align 8
2491 // CHECK3-NEXT: store i64 [[DOTPREVIOUS_UB_]], ptr [[DOTPREVIOUS_UB__ADDR]], align 8
2492 // CHECK3-NEXT: store i32 0, ptr [[DOTOMP_LB]], align 4
2493 // CHECK3-NEXT: store i32 99, ptr [[DOTOMP_UB]], align 4
2494 // CHECK3-NEXT: [[TMP0:%.*]] = load i64, ptr [[DOTPREVIOUS_LB__ADDR]], align 8
2495 // CHECK3-NEXT: [[CONV:%.*]] = trunc i64 [[TMP0]] to i32
2496 // CHECK3-NEXT: [[TMP1:%.*]] = load i64, ptr [[DOTPREVIOUS_UB__ADDR]], align 8
2497 // CHECK3-NEXT: [[CONV1:%.*]] = trunc i64 [[TMP1]] to i32
2498 // CHECK3-NEXT: store i32 [[CONV]], ptr [[DOTOMP_LB]], align 4
2499 // CHECK3-NEXT: store i32 [[CONV1]], ptr [[DOTOMP_UB]], align 4
2500 // CHECK3-NEXT: store i32 1, ptr [[DOTOMP_STRIDE]], align 4
2501 // CHECK3-NEXT: store i32 0, ptr [[DOTOMP_IS_LAST]], align 4
2502 // CHECK3-NEXT: [[TMP2:%.*]] = load ptr, ptr [[DOTGLOBAL_TID__ADDR]], align 8
2503 // CHECK3-NEXT: [[TMP3:%.*]] = load i32, ptr [[TMP2]], align 4
2504 // CHECK3-NEXT: call void @__kmpc_for_static_init_4(ptr @[[GLOB2]], i32 [[TMP3]], i32 34, ptr [[DOTOMP_IS_LAST]], ptr [[DOTOMP_LB]], ptr [[DOTOMP_UB]], ptr [[DOTOMP_STRIDE]], i32 1, i32 1)
2505 // CHECK3-NEXT: [[TMP4:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4
2506 // CHECK3-NEXT: [[CMP:%.*]] = icmp sgt i32 [[TMP4]], 99
2507 // CHECK3-NEXT: br i1 [[CMP]], label [[COND_TRUE:%.*]], label [[COND_FALSE:%.*]]
2508 // CHECK3: cond.true:
2509 // CHECK3-NEXT: br label [[COND_END:%.*]]
2510 // CHECK3: cond.false:
2511 // CHECK3-NEXT: [[TMP5:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4
2512 // CHECK3-NEXT: br label [[COND_END]]
2513 // CHECK3: cond.end:
2514 // CHECK3-NEXT: [[COND:%.*]] = phi i32 [ 99, [[COND_TRUE]] ], [ [[TMP5]], [[COND_FALSE]] ]
2515 // CHECK3-NEXT: store i32 [[COND]], ptr [[DOTOMP_UB]], align 4
2516 // CHECK3-NEXT: [[TMP6:%.*]] = load i32, ptr [[DOTOMP_LB]], align 4
2517 // CHECK3-NEXT: store i32 [[TMP6]], ptr [[DOTOMP_IV]], align 4
2518 // CHECK3-NEXT: br label [[OMP_INNER_FOR_COND:%.*]]
2519 // CHECK3: omp.inner.for.cond:
2520 // CHECK3-NEXT: [[TMP7:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4
2521 // CHECK3-NEXT: [[TMP8:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4
2522 // CHECK3-NEXT: [[CMP2:%.*]] = icmp sle i32 [[TMP7]], [[TMP8]]
2523 // CHECK3-NEXT: br i1 [[CMP2]], label [[OMP_INNER_FOR_BODY:%.*]], label [[OMP_INNER_FOR_END:%.*]]
2524 // CHECK3: omp.inner.for.body:
2525 // CHECK3-NEXT: [[TMP9:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4
2526 // CHECK3-NEXT: [[MUL:%.*]] = mul nsw i32 [[TMP9]], 1
2527 // CHECK3-NEXT: [[ADD:%.*]] = add nsw i32 0, [[MUL]]
2528 // CHECK3-NEXT: store i32 [[ADD]], ptr [[I]], align 4
2529 // CHECK3-NEXT: call void @_Z3fn5v()
2530 // CHECK3-NEXT: br label [[OMP_BODY_CONTINUE:%.*]]
2531 // CHECK3: omp.body.continue:
2532 // CHECK3-NEXT: br label [[OMP_INNER_FOR_INC:%.*]]
2533 // CHECK3: omp.inner.for.inc:
2534 // CHECK3-NEXT: [[TMP10:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4
2535 // CHECK3-NEXT: [[ADD3:%.*]] = add nsw i32 [[TMP10]], 1
2536 // CHECK3-NEXT: store i32 [[ADD3]], ptr [[DOTOMP_IV]], align 4
2537 // CHECK3-NEXT: br label [[OMP_INNER_FOR_COND]], !llvm.loop [[LOOP34:![0-9]+]]
2538 // CHECK3: omp.inner.for.end:
2539 // CHECK3-NEXT: br label [[OMP_LOOP_EXIT:%.*]]
2540 // CHECK3: omp.loop.exit:
2541 // CHECK3-NEXT: call void @__kmpc_for_static_fini(ptr @[[GLOB1]], i32 [[TMP3]])
2542 // CHECK3-NEXT: [[TMP11:%.*]] = load i32, ptr [[DOTOMP_IS_LAST]], align 4
2543 // CHECK3-NEXT: [[TMP12:%.*]] = icmp ne i32 [[TMP11]], 0
2544 // CHECK3-NEXT: br i1 [[TMP12]], label [[DOTOMP_FINAL_THEN:%.*]], label [[DOTOMP_FINAL_DONE:%.*]]
2545 // CHECK3: .omp.final.then:
2546 // CHECK3-NEXT: store i32 100, ptr [[I]], align 4
2547 // CHECK3-NEXT: br label [[DOTOMP_FINAL_DONE]]
2548 // CHECK3: .omp.final.done:
2549 // CHECK3-NEXT: ret void
2552 // CHECK3-LABEL: define {{[^@]+}}@{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}_main_l99
2553 // CHECK3-SAME: (i64 noundef [[ARG:%.*]]) #[[ATTR1]] {
2554 // CHECK3-NEXT: entry:
2555 // CHECK3-NEXT: [[ARG_ADDR:%.*]] = alloca i64, align 8
2556 // CHECK3-NEXT: store i64 [[ARG]], ptr [[ARG_ADDR]], align 8
2557 // CHECK3-NEXT: call void (ptr, i32, ptr, ...) @__kmpc_fork_teams(ptr @[[GLOB3]], i32 1, ptr @{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}_main_l99.omp_outlined, ptr [[ARG_ADDR]])
2558 // CHECK3-NEXT: ret void
2561 // CHECK3-LABEL: define {{[^@]+}}@{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}_main_l99.omp_outlined
2562 // CHECK3-SAME: (ptr noalias noundef [[DOTGLOBAL_TID_:%.*]], ptr noalias noundef [[DOTBOUND_TID_:%.*]], ptr noundef nonnull align 4 dereferenceable(4) [[ARG:%.*]]) #[[ATTR1]] {
2563 // CHECK3-NEXT: entry:
2564 // CHECK3-NEXT: [[DOTGLOBAL_TID__ADDR:%.*]] = alloca ptr, align 8
2565 // CHECK3-NEXT: [[DOTBOUND_TID__ADDR:%.*]] = alloca ptr, align 8
2566 // CHECK3-NEXT: [[ARG_ADDR:%.*]] = alloca ptr, align 8
2567 // CHECK3-NEXT: [[DOTCAPTURE_EXPR_:%.*]] = alloca i8, align 1
2568 // CHECK3-NEXT: [[DOTOMP_IV:%.*]] = alloca i32, align 4
2569 // CHECK3-NEXT: [[TMP:%.*]] = alloca i32, align 4
2570 // CHECK3-NEXT: [[DOTOMP_COMB_LB:%.*]] = alloca i32, align 4
2571 // CHECK3-NEXT: [[DOTOMP_COMB_UB:%.*]] = alloca i32, align 4
2572 // CHECK3-NEXT: [[DOTOMP_STRIDE:%.*]] = alloca i32, align 4
2573 // CHECK3-NEXT: [[DOTOMP_IS_LAST:%.*]] = alloca i32, align 4
2574 // CHECK3-NEXT: [[I:%.*]] = alloca i32, align 4
2575 // CHECK3-NEXT: [[DOTCAPTURE_EXPR__CASTED:%.*]] = alloca i64, align 8
2576 // CHECK3-NEXT: [[DOTBOUND_ZERO_ADDR:%.*]] = alloca i32, align 4
2577 // CHECK3-NEXT: [[DOTCAPTURE_EXPR__CASTED12:%.*]] = alloca i64, align 8
2578 // CHECK3-NEXT: [[DOTBOUND_ZERO_ADDR17:%.*]] = alloca i32, align 4
2579 // CHECK3-NEXT: store ptr [[DOTGLOBAL_TID_]], ptr [[DOTGLOBAL_TID__ADDR]], align 8
2580 // CHECK3-NEXT: store ptr [[DOTBOUND_TID_]], ptr [[DOTBOUND_TID__ADDR]], align 8
2581 // CHECK3-NEXT: store ptr [[ARG]], ptr [[ARG_ADDR]], align 8
2582 // CHECK3-NEXT: [[TMP0:%.*]] = load ptr, ptr [[ARG_ADDR]], align 8
2583 // CHECK3-NEXT: [[TMP1:%.*]] = load i32, ptr [[TMP0]], align 4
2584 // CHECK3-NEXT: [[TOBOOL:%.*]] = icmp ne i32 [[TMP1]], 0
2585 // CHECK3-NEXT: [[FROMBOOL:%.*]] = zext i1 [[TOBOOL]] to i8
2586 // CHECK3-NEXT: store i8 [[FROMBOOL]], ptr [[DOTCAPTURE_EXPR_]], align 1
2587 // CHECK3-NEXT: store i32 0, ptr [[DOTOMP_COMB_LB]], align 4
2588 // CHECK3-NEXT: store i32 99, ptr [[DOTOMP_COMB_UB]], align 4
2589 // CHECK3-NEXT: store i32 1, ptr [[DOTOMP_STRIDE]], align 4
2590 // CHECK3-NEXT: store i32 0, ptr [[DOTOMP_IS_LAST]], align 4
2591 // CHECK3-NEXT: [[TMP2:%.*]] = load ptr, ptr [[DOTGLOBAL_TID__ADDR]], align 8
2592 // CHECK3-NEXT: [[TMP3:%.*]] = load i32, ptr [[TMP2]], align 4
2593 // CHECK3-NEXT: call void @__kmpc_for_static_init_4(ptr @[[GLOB1]], i32 [[TMP3]], i32 92, ptr [[DOTOMP_IS_LAST]], ptr [[DOTOMP_COMB_LB]], ptr [[DOTOMP_COMB_UB]], ptr [[DOTOMP_STRIDE]], i32 1, i32 1)
2594 // CHECK3-NEXT: [[TMP4:%.*]] = load i32, ptr [[DOTOMP_COMB_UB]], align 4
2595 // CHECK3-NEXT: [[CMP:%.*]] = icmp sgt i32 [[TMP4]], 99
2596 // CHECK3-NEXT: br i1 [[CMP]], label [[COND_TRUE:%.*]], label [[COND_FALSE:%.*]]
2597 // CHECK3: cond.true:
2598 // CHECK3-NEXT: br label [[COND_END:%.*]]
2599 // CHECK3: cond.false:
2600 // CHECK3-NEXT: [[TMP5:%.*]] = load i32, ptr [[DOTOMP_COMB_UB]], align 4
2601 // CHECK3-NEXT: br label [[COND_END]]
2602 // CHECK3: cond.end:
2603 // CHECK3-NEXT: [[COND:%.*]] = phi i32 [ 99, [[COND_TRUE]] ], [ [[TMP5]], [[COND_FALSE]] ]
2604 // CHECK3-NEXT: store i32 [[COND]], ptr [[DOTOMP_COMB_UB]], align 4
2605 // CHECK3-NEXT: [[TMP6:%.*]] = load i32, ptr [[DOTOMP_COMB_LB]], align 4
2606 // CHECK3-NEXT: store i32 [[TMP6]], ptr [[DOTOMP_IV]], align 4
2607 // CHECK3-NEXT: [[TMP7:%.*]] = load i8, ptr [[DOTCAPTURE_EXPR_]], align 1
2608 // CHECK3-NEXT: [[TOBOOL1:%.*]] = trunc i8 [[TMP7]] to i1
2609 // CHECK3-NEXT: br i1 [[TOBOOL1]], label [[OMP_IF_THEN:%.*]], label [[OMP_IF_ELSE7:%.*]]
2610 // CHECK3: omp_if.then:
2611 // CHECK3-NEXT: br label [[OMP_INNER_FOR_COND:%.*]]
2612 // CHECK3: omp.inner.for.cond:
2613 // CHECK3-NEXT: [[TMP8:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP35:![0-9]+]]
2614 // CHECK3-NEXT: [[TMP9:%.*]] = load i32, ptr [[DOTOMP_COMB_UB]], align 4, !llvm.access.group [[ACC_GRP35]]
2615 // CHECK3-NEXT: [[CMP2:%.*]] = icmp sle i32 [[TMP8]], [[TMP9]]
2616 // CHECK3-NEXT: br i1 [[CMP2]], label [[OMP_INNER_FOR_BODY:%.*]], label [[OMP_INNER_FOR_END:%.*]]
2617 // CHECK3: omp.inner.for.body:
2618 // CHECK3-NEXT: [[TMP10:%.*]] = load i32, ptr [[DOTOMP_COMB_LB]], align 4, !llvm.access.group [[ACC_GRP35]]
2619 // CHECK3-NEXT: [[TMP11:%.*]] = zext i32 [[TMP10]] to i64
2620 // CHECK3-NEXT: [[TMP12:%.*]] = load i32, ptr [[DOTOMP_COMB_UB]], align 4, !llvm.access.group [[ACC_GRP35]]
2621 // CHECK3-NEXT: [[TMP13:%.*]] = zext i32 [[TMP12]] to i64
2622 // CHECK3-NEXT: [[TMP14:%.*]] = load i8, ptr [[DOTCAPTURE_EXPR_]], align 1, !llvm.access.group [[ACC_GRP35]]
2623 // CHECK3-NEXT: [[TOBOOL3:%.*]] = trunc i8 [[TMP14]] to i1
2624 // CHECK3-NEXT: [[FROMBOOL4:%.*]] = zext i1 [[TOBOOL3]] to i8
2625 // CHECK3-NEXT: store i8 [[FROMBOOL4]], ptr [[DOTCAPTURE_EXPR__CASTED]], align 1, !llvm.access.group [[ACC_GRP35]]
2626 // CHECK3-NEXT: [[TMP15:%.*]] = load i64, ptr [[DOTCAPTURE_EXPR__CASTED]], align 8, !llvm.access.group [[ACC_GRP35]]
2627 // CHECK3-NEXT: [[TMP16:%.*]] = load i8, ptr [[DOTCAPTURE_EXPR_]], align 1, !llvm.access.group [[ACC_GRP35]]
2628 // CHECK3-NEXT: [[TOBOOL5:%.*]] = trunc i8 [[TMP16]] to i1
2629 // CHECK3-NEXT: br i1 [[TOBOOL5]], label [[OMP_IF_THEN6:%.*]], label [[OMP_IF_ELSE:%.*]]
2630 // CHECK3: omp_if.then6:
2631 // CHECK3-NEXT: call void (ptr, i32, ptr, ...) @__kmpc_fork_call(ptr @[[GLOB3]], i32 3, ptr @{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}_main_l99.omp_outlined.omp_outlined, i64 [[TMP11]], i64 [[TMP13]], i64 [[TMP15]]), !llvm.access.group [[ACC_GRP35]]
2632 // CHECK3-NEXT: br label [[OMP_IF_END:%.*]]
2633 // CHECK3: omp_if.else:
2634 // CHECK3-NEXT: call void @__kmpc_serialized_parallel(ptr @[[GLOB3]], i32 [[TMP3]]), !llvm.access.group [[ACC_GRP35]]
2635 // CHECK3-NEXT: [[TMP17:%.*]] = load ptr, ptr [[DOTGLOBAL_TID__ADDR]], align 8, !llvm.access.group [[ACC_GRP35]]
2636 // CHECK3-NEXT: store i32 0, ptr [[DOTBOUND_ZERO_ADDR]], align 4, !llvm.access.group [[ACC_GRP35]]
2637 // CHECK3-NEXT: call void @{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}_main_l99.omp_outlined.omp_outlined(ptr [[TMP17]], ptr [[DOTBOUND_ZERO_ADDR]], i64 [[TMP11]], i64 [[TMP13]], i64 [[TMP15]]) #[[ATTR2]], !llvm.access.group [[ACC_GRP35]]
2638 // CHECK3-NEXT: call void @__kmpc_end_serialized_parallel(ptr @[[GLOB3]], i32 [[TMP3]]), !llvm.access.group [[ACC_GRP35]]
2639 // CHECK3-NEXT: br label [[OMP_IF_END]]
2640 // CHECK3: omp_if.end:
2641 // CHECK3-NEXT: br label [[OMP_INNER_FOR_INC:%.*]]
2642 // CHECK3: omp.inner.for.inc:
2643 // CHECK3-NEXT: [[TMP18:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP35]]
2644 // CHECK3-NEXT: [[TMP19:%.*]] = load i32, ptr [[DOTOMP_STRIDE]], align 4, !llvm.access.group [[ACC_GRP35]]
2645 // CHECK3-NEXT: [[ADD:%.*]] = add nsw i32 [[TMP18]], [[TMP19]]
2646 // CHECK3-NEXT: store i32 [[ADD]], ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP35]]
2647 // CHECK3-NEXT: br label [[OMP_INNER_FOR_COND]], !llvm.loop [[LOOP36:![0-9]+]]
2648 // CHECK3: omp.inner.for.end:
2649 // CHECK3-NEXT: br label [[OMP_IF_END22:%.*]]
2650 // CHECK3: omp_if.else7:
2651 // CHECK3-NEXT: br label [[OMP_INNER_FOR_COND8:%.*]]
2652 // CHECK3: omp.inner.for.cond8:
2653 // CHECK3-NEXT: [[TMP20:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4
2654 // CHECK3-NEXT: [[TMP21:%.*]] = load i32, ptr [[DOTOMP_COMB_UB]], align 4
2655 // CHECK3-NEXT: [[CMP9:%.*]] = icmp sle i32 [[TMP20]], [[TMP21]]
2656 // CHECK3-NEXT: br i1 [[CMP9]], label [[OMP_INNER_FOR_BODY10:%.*]], label [[OMP_INNER_FOR_END21:%.*]]
2657 // CHECK3: omp.inner.for.body10:
2658 // CHECK3-NEXT: [[TMP22:%.*]] = load i32, ptr [[DOTOMP_COMB_LB]], align 4
2659 // CHECK3-NEXT: [[TMP23:%.*]] = zext i32 [[TMP22]] to i64
2660 // CHECK3-NEXT: [[TMP24:%.*]] = load i32, ptr [[DOTOMP_COMB_UB]], align 4
2661 // CHECK3-NEXT: [[TMP25:%.*]] = zext i32 [[TMP24]] to i64
2662 // CHECK3-NEXT: [[TMP26:%.*]] = load i8, ptr [[DOTCAPTURE_EXPR_]], align 1
2663 // CHECK3-NEXT: [[TOBOOL11:%.*]] = trunc i8 [[TMP26]] to i1
2664 // CHECK3-NEXT: [[FROMBOOL13:%.*]] = zext i1 [[TOBOOL11]] to i8
2665 // CHECK3-NEXT: store i8 [[FROMBOOL13]], ptr [[DOTCAPTURE_EXPR__CASTED12]], align 1
2666 // CHECK3-NEXT: [[TMP27:%.*]] = load i64, ptr [[DOTCAPTURE_EXPR__CASTED12]], align 8
2667 // CHECK3-NEXT: [[TMP28:%.*]] = load i8, ptr [[DOTCAPTURE_EXPR_]], align 1
2668 // CHECK3-NEXT: [[TOBOOL14:%.*]] = trunc i8 [[TMP28]] to i1
2669 // CHECK3-NEXT: br i1 [[TOBOOL14]], label [[OMP_IF_THEN15:%.*]], label [[OMP_IF_ELSE16:%.*]]
2670 // CHECK3: omp_if.then15:
2671 // CHECK3-NEXT: call void (ptr, i32, ptr, ...) @__kmpc_fork_call(ptr @[[GLOB3]], i32 3, ptr @{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}_main_l99.omp_outlined.omp_outlined.1, i64 [[TMP23]], i64 [[TMP25]], i64 [[TMP27]])
2672 // CHECK3-NEXT: br label [[OMP_IF_END18:%.*]]
2673 // CHECK3: omp_if.else16:
2674 // CHECK3-NEXT: call void @__kmpc_serialized_parallel(ptr @[[GLOB3]], i32 [[TMP3]])
2675 // CHECK3-NEXT: [[TMP29:%.*]] = load ptr, ptr [[DOTGLOBAL_TID__ADDR]], align 8
2676 // CHECK3-NEXT: store i32 0, ptr [[DOTBOUND_ZERO_ADDR17]], align 4
2677 // CHECK3-NEXT: call void @{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}_main_l99.omp_outlined.omp_outlined.1(ptr [[TMP29]], ptr [[DOTBOUND_ZERO_ADDR17]], i64 [[TMP23]], i64 [[TMP25]], i64 [[TMP27]]) #[[ATTR2]]
2678 // CHECK3-NEXT: call void @__kmpc_end_serialized_parallel(ptr @[[GLOB3]], i32 [[TMP3]])
2679 // CHECK3-NEXT: br label [[OMP_IF_END18]]
2680 // CHECK3: omp_if.end18:
2681 // CHECK3-NEXT: br label [[OMP_INNER_FOR_INC19:%.*]]
2682 // CHECK3: omp.inner.for.inc19:
2683 // CHECK3-NEXT: [[TMP30:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4
2684 // CHECK3-NEXT: [[TMP31:%.*]] = load i32, ptr [[DOTOMP_STRIDE]], align 4
2685 // CHECK3-NEXT: [[ADD20:%.*]] = add nsw i32 [[TMP30]], [[TMP31]]
2686 // CHECK3-NEXT: store i32 [[ADD20]], ptr [[DOTOMP_IV]], align 4
2687 // CHECK3-NEXT: br label [[OMP_INNER_FOR_COND8]], !llvm.loop [[LOOP38:![0-9]+]]
2688 // CHECK3: omp.inner.for.end21:
2689 // CHECK3-NEXT: br label [[OMP_IF_END22]]
2690 // CHECK3: omp_if.end22:
2691 // CHECK3-NEXT: br label [[OMP_LOOP_EXIT:%.*]]
2692 // CHECK3: omp.loop.exit:
2693 // CHECK3-NEXT: call void @__kmpc_for_static_fini(ptr @[[GLOB1]], i32 [[TMP3]])
2694 // CHECK3-NEXT: [[TMP32:%.*]] = load i32, ptr [[DOTOMP_IS_LAST]], align 4
2695 // CHECK3-NEXT: [[TMP33:%.*]] = icmp ne i32 [[TMP32]], 0
2696 // CHECK3-NEXT: br i1 [[TMP33]], label [[DOTOMP_FINAL_THEN:%.*]], label [[DOTOMP_FINAL_DONE:%.*]]
2697 // CHECK3: .omp.final.then:
2698 // CHECK3-NEXT: store i32 100, ptr [[I]], align 4
2699 // CHECK3-NEXT: br label [[DOTOMP_FINAL_DONE]]
2700 // CHECK3: .omp.final.done:
2701 // CHECK3-NEXT: ret void
2704 // CHECK3-LABEL: define {{[^@]+}}@{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}_main_l99.omp_outlined.omp_outlined
2705 // CHECK3-SAME: (ptr noalias noundef [[DOTGLOBAL_TID_:%.*]], ptr noalias noundef [[DOTBOUND_TID_:%.*]], i64 noundef [[DOTPREVIOUS_LB_:%.*]], i64 noundef [[DOTPREVIOUS_UB_:%.*]], i64 noundef [[DOTCAPTURE_EXPR_:%.*]]) #[[ATTR1]] {
2706 // CHECK3-NEXT: entry:
2707 // CHECK3-NEXT: [[DOTGLOBAL_TID__ADDR:%.*]] = alloca ptr, align 8
2708 // CHECK3-NEXT: [[DOTBOUND_TID__ADDR:%.*]] = alloca ptr, align 8
2709 // CHECK3-NEXT: [[DOTPREVIOUS_LB__ADDR:%.*]] = alloca i64, align 8
2710 // CHECK3-NEXT: [[DOTPREVIOUS_UB__ADDR:%.*]] = alloca i64, align 8
2711 // CHECK3-NEXT: [[DOTCAPTURE_EXPR__ADDR:%.*]] = alloca i64, align 8
2712 // CHECK3-NEXT: [[DOTOMP_IV:%.*]] = alloca i32, align 4
2713 // CHECK3-NEXT: [[TMP:%.*]] = alloca i32, align 4
2714 // CHECK3-NEXT: [[DOTOMP_LB:%.*]] = alloca i32, align 4
2715 // CHECK3-NEXT: [[DOTOMP_UB:%.*]] = alloca i32, align 4
2716 // CHECK3-NEXT: [[DOTOMP_STRIDE:%.*]] = alloca i32, align 4
2717 // CHECK3-NEXT: [[DOTOMP_IS_LAST:%.*]] = alloca i32, align 4
2718 // CHECK3-NEXT: [[I:%.*]] = alloca i32, align 4
2719 // CHECK3-NEXT: store ptr [[DOTGLOBAL_TID_]], ptr [[DOTGLOBAL_TID__ADDR]], align 8
2720 // CHECK3-NEXT: store ptr [[DOTBOUND_TID_]], ptr [[DOTBOUND_TID__ADDR]], align 8
2721 // CHECK3-NEXT: store i64 [[DOTPREVIOUS_LB_]], ptr [[DOTPREVIOUS_LB__ADDR]], align 8
2722 // CHECK3-NEXT: store i64 [[DOTPREVIOUS_UB_]], ptr [[DOTPREVIOUS_UB__ADDR]], align 8
2723 // CHECK3-NEXT: store i64 [[DOTCAPTURE_EXPR_]], ptr [[DOTCAPTURE_EXPR__ADDR]], align 8
2724 // CHECK3-NEXT: store i32 0, ptr [[DOTOMP_LB]], align 4
2725 // CHECK3-NEXT: store i32 99, ptr [[DOTOMP_UB]], align 4
2726 // CHECK3-NEXT: [[TMP0:%.*]] = load i64, ptr [[DOTPREVIOUS_LB__ADDR]], align 8
2727 // CHECK3-NEXT: [[CONV:%.*]] = trunc i64 [[TMP0]] to i32
2728 // CHECK3-NEXT: [[TMP1:%.*]] = load i64, ptr [[DOTPREVIOUS_UB__ADDR]], align 8
2729 // CHECK3-NEXT: [[CONV1:%.*]] = trunc i64 [[TMP1]] to i32
2730 // CHECK3-NEXT: store i32 [[CONV]], ptr [[DOTOMP_LB]], align 4
2731 // CHECK3-NEXT: store i32 [[CONV1]], ptr [[DOTOMP_UB]], align 4
2732 // CHECK3-NEXT: store i32 1, ptr [[DOTOMP_STRIDE]], align 4
2733 // CHECK3-NEXT: store i32 0, ptr [[DOTOMP_IS_LAST]], align 4
2734 // CHECK3-NEXT: [[TMP2:%.*]] = load i8, ptr [[DOTCAPTURE_EXPR__ADDR]], align 1
2735 // CHECK3-NEXT: [[TOBOOL:%.*]] = trunc i8 [[TMP2]] to i1
2736 // CHECK3-NEXT: br i1 [[TOBOOL]], label [[OMP_IF_THEN:%.*]], label [[OMP_IF_ELSE:%.*]]
2737 // CHECK3: omp_if.then:
2738 // CHECK3-NEXT: [[TMP3:%.*]] = load ptr, ptr [[DOTGLOBAL_TID__ADDR]], align 8
2739 // CHECK3-NEXT: [[TMP4:%.*]] = load i32, ptr [[TMP3]], align 4
2740 // CHECK3-NEXT: call void @__kmpc_for_static_init_4(ptr @[[GLOB2]], i32 [[TMP4]], i32 34, ptr [[DOTOMP_IS_LAST]], ptr [[DOTOMP_LB]], ptr [[DOTOMP_UB]], ptr [[DOTOMP_STRIDE]], i32 1, i32 1)
2741 // CHECK3-NEXT: [[TMP5:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4
2742 // CHECK3-NEXT: [[CMP:%.*]] = icmp sgt i32 [[TMP5]], 99
2743 // CHECK3-NEXT: br i1 [[CMP]], label [[COND_TRUE:%.*]], label [[COND_FALSE:%.*]]
2744 // CHECK3: cond.true:
2745 // CHECK3-NEXT: br label [[COND_END:%.*]]
2746 // CHECK3: cond.false:
2747 // CHECK3-NEXT: [[TMP6:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4
2748 // CHECK3-NEXT: br label [[COND_END]]
2749 // CHECK3: cond.end:
2750 // CHECK3-NEXT: [[COND:%.*]] = phi i32 [ 99, [[COND_TRUE]] ], [ [[TMP6]], [[COND_FALSE]] ]
2751 // CHECK3-NEXT: store i32 [[COND]], ptr [[DOTOMP_UB]], align 4
2752 // CHECK3-NEXT: [[TMP7:%.*]] = load i32, ptr [[DOTOMP_LB]], align 4
2753 // CHECK3-NEXT: store i32 [[TMP7]], ptr [[DOTOMP_IV]], align 4
2754 // CHECK3-NEXT: br label [[OMP_INNER_FOR_COND:%.*]]
2755 // CHECK3: omp.inner.for.cond:
2756 // CHECK3-NEXT: [[TMP8:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP39:![0-9]+]]
2757 // CHECK3-NEXT: [[TMP9:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4, !llvm.access.group [[ACC_GRP39]]
2758 // CHECK3-NEXT: [[CMP2:%.*]] = icmp sle i32 [[TMP8]], [[TMP9]]
2759 // CHECK3-NEXT: br i1 [[CMP2]], label [[OMP_INNER_FOR_BODY:%.*]], label [[OMP_INNER_FOR_END:%.*]]
2760 // CHECK3: omp.inner.for.body:
2761 // CHECK3-NEXT: [[TMP10:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP39]]
2762 // CHECK3-NEXT: [[MUL:%.*]] = mul nsw i32 [[TMP10]], 1
2763 // CHECK3-NEXT: [[ADD:%.*]] = add nsw i32 0, [[MUL]]
2764 // CHECK3-NEXT: store i32 [[ADD]], ptr [[I]], align 4, !llvm.access.group [[ACC_GRP39]]
2765 // CHECK3-NEXT: call void @_Z3fn6v(), !llvm.access.group [[ACC_GRP39]]
2766 // CHECK3-NEXT: br label [[OMP_BODY_CONTINUE:%.*]]
2767 // CHECK3: omp.body.continue:
2768 // CHECK3-NEXT: br label [[OMP_INNER_FOR_INC:%.*]]
2769 // CHECK3: omp.inner.for.inc:
2770 // CHECK3-NEXT: [[TMP11:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP39]]
2771 // CHECK3-NEXT: [[ADD3:%.*]] = add nsw i32 [[TMP11]], 1
2772 // CHECK3-NEXT: store i32 [[ADD3]], ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP39]]
2773 // CHECK3-NEXT: br label [[OMP_INNER_FOR_COND]], !llvm.loop [[LOOP40:![0-9]+]]
2774 // CHECK3: omp.inner.for.end:
2775 // CHECK3-NEXT: br label [[OMP_IF_END:%.*]]
2776 // CHECK3: omp_if.else:
2777 // CHECK3-NEXT: [[TMP12:%.*]] = load ptr, ptr [[DOTGLOBAL_TID__ADDR]], align 8
2778 // CHECK3-NEXT: [[TMP13:%.*]] = load i32, ptr [[TMP12]], align 4
2779 // CHECK3-NEXT: call void @__kmpc_for_static_init_4(ptr @[[GLOB2]], i32 [[TMP13]], i32 34, ptr [[DOTOMP_IS_LAST]], ptr [[DOTOMP_LB]], ptr [[DOTOMP_UB]], ptr [[DOTOMP_STRIDE]], i32 1, i32 1)
2780 // CHECK3-NEXT: [[TMP14:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4
2781 // CHECK3-NEXT: [[CMP4:%.*]] = icmp sgt i32 [[TMP14]], 99
2782 // CHECK3-NEXT: br i1 [[CMP4]], label [[COND_TRUE5:%.*]], label [[COND_FALSE6:%.*]]
2783 // CHECK3: cond.true5:
2784 // CHECK3-NEXT: br label [[COND_END7:%.*]]
2785 // CHECK3: cond.false6:
2786 // CHECK3-NEXT: [[TMP15:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4
2787 // CHECK3-NEXT: br label [[COND_END7]]
2788 // CHECK3: cond.end7:
2789 // CHECK3-NEXT: [[COND8:%.*]] = phi i32 [ 99, [[COND_TRUE5]] ], [ [[TMP15]], [[COND_FALSE6]] ]
2790 // CHECK3-NEXT: store i32 [[COND8]], ptr [[DOTOMP_UB]], align 4
2791 // CHECK3-NEXT: [[TMP16:%.*]] = load i32, ptr [[DOTOMP_LB]], align 4
2792 // CHECK3-NEXT: store i32 [[TMP16]], ptr [[DOTOMP_IV]], align 4
2793 // CHECK3-NEXT: br label [[OMP_INNER_FOR_COND9:%.*]]
2794 // CHECK3: omp.inner.for.cond9:
2795 // CHECK3-NEXT: [[TMP17:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4
2796 // CHECK3-NEXT: [[TMP18:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4
2797 // CHECK3-NEXT: [[CMP10:%.*]] = icmp sle i32 [[TMP17]], [[TMP18]]
2798 // CHECK3-NEXT: br i1 [[CMP10]], label [[OMP_INNER_FOR_BODY11:%.*]], label [[OMP_INNER_FOR_END17:%.*]]
2799 // CHECK3: omp.inner.for.body11:
2800 // CHECK3-NEXT: [[TMP19:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4
2801 // CHECK3-NEXT: [[MUL12:%.*]] = mul nsw i32 [[TMP19]], 1
2802 // CHECK3-NEXT: [[ADD13:%.*]] = add nsw i32 0, [[MUL12]]
2803 // CHECK3-NEXT: store i32 [[ADD13]], ptr [[I]], align 4
2804 // CHECK3-NEXT: call void @_Z3fn6v()
2805 // CHECK3-NEXT: br label [[OMP_BODY_CONTINUE14:%.*]]
2806 // CHECK3: omp.body.continue14:
2807 // CHECK3-NEXT: br label [[OMP_INNER_FOR_INC15:%.*]]
2808 // CHECK3: omp.inner.for.inc15:
2809 // CHECK3-NEXT: [[TMP20:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4
2810 // CHECK3-NEXT: [[ADD16:%.*]] = add nsw i32 [[TMP20]], 1
2811 // CHECK3-NEXT: store i32 [[ADD16]], ptr [[DOTOMP_IV]], align 4
2812 // CHECK3-NEXT: br label [[OMP_INNER_FOR_COND9]], !llvm.loop [[LOOP42:![0-9]+]]
2813 // CHECK3: omp.inner.for.end17:
2814 // CHECK3-NEXT: br label [[OMP_IF_END]]
2815 // CHECK3: omp_if.end:
2816 // CHECK3-NEXT: br label [[OMP_LOOP_EXIT:%.*]]
2817 // CHECK3: omp.loop.exit:
2818 // CHECK3-NEXT: [[TMP21:%.*]] = load ptr, ptr [[DOTGLOBAL_TID__ADDR]], align 8
2819 // CHECK3-NEXT: [[TMP22:%.*]] = load i32, ptr [[TMP21]], align 4
2820 // CHECK3-NEXT: call void @__kmpc_for_static_fini(ptr @[[GLOB1]], i32 [[TMP22]])
2821 // CHECK3-NEXT: [[TMP23:%.*]] = load i32, ptr [[DOTOMP_IS_LAST]], align 4
2822 // CHECK3-NEXT: [[TMP24:%.*]] = icmp ne i32 [[TMP23]], 0
2823 // CHECK3-NEXT: br i1 [[TMP24]], label [[DOTOMP_FINAL_THEN:%.*]], label [[DOTOMP_FINAL_DONE:%.*]]
2824 // CHECK3: .omp.final.then:
2825 // CHECK3-NEXT: store i32 100, ptr [[I]], align 4
2826 // CHECK3-NEXT: br label [[DOTOMP_FINAL_DONE]]
2827 // CHECK3: .omp.final.done:
2828 // CHECK3-NEXT: ret void
2831 // CHECK3-LABEL: define {{[^@]+}}@{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}_main_l99.omp_outlined.omp_outlined.1
2832 // CHECK3-SAME: (ptr noalias noundef [[DOTGLOBAL_TID_:%.*]], ptr noalias noundef [[DOTBOUND_TID_:%.*]], i64 noundef [[DOTPREVIOUS_LB_:%.*]], i64 noundef [[DOTPREVIOUS_UB_:%.*]], i64 noundef [[DOTCAPTURE_EXPR_:%.*]]) #[[ATTR1]] {
2833 // CHECK3-NEXT: entry:
2834 // CHECK3-NEXT: [[DOTGLOBAL_TID__ADDR:%.*]] = alloca ptr, align 8
2835 // CHECK3-NEXT: [[DOTBOUND_TID__ADDR:%.*]] = alloca ptr, align 8
2836 // CHECK3-NEXT: [[DOTPREVIOUS_LB__ADDR:%.*]] = alloca i64, align 8
2837 // CHECK3-NEXT: [[DOTPREVIOUS_UB__ADDR:%.*]] = alloca i64, align 8
2838 // CHECK3-NEXT: [[DOTCAPTURE_EXPR__ADDR:%.*]] = alloca i64, align 8
2839 // CHECK3-NEXT: [[DOTOMP_IV:%.*]] = alloca i32, align 4
2840 // CHECK3-NEXT: [[TMP:%.*]] = alloca i32, align 4
2841 // CHECK3-NEXT: [[DOTOMP_LB:%.*]] = alloca i32, align 4
2842 // CHECK3-NEXT: [[DOTOMP_UB:%.*]] = alloca i32, align 4
2843 // CHECK3-NEXT: [[DOTOMP_STRIDE:%.*]] = alloca i32, align 4
2844 // CHECK3-NEXT: [[DOTOMP_IS_LAST:%.*]] = alloca i32, align 4
2845 // CHECK3-NEXT: [[I:%.*]] = alloca i32, align 4
2846 // CHECK3-NEXT: store ptr [[DOTGLOBAL_TID_]], ptr [[DOTGLOBAL_TID__ADDR]], align 8
2847 // CHECK3-NEXT: store ptr [[DOTBOUND_TID_]], ptr [[DOTBOUND_TID__ADDR]], align 8
2848 // CHECK3-NEXT: store i64 [[DOTPREVIOUS_LB_]], ptr [[DOTPREVIOUS_LB__ADDR]], align 8
2849 // CHECK3-NEXT: store i64 [[DOTPREVIOUS_UB_]], ptr [[DOTPREVIOUS_UB__ADDR]], align 8
2850 // CHECK3-NEXT: store i64 [[DOTCAPTURE_EXPR_]], ptr [[DOTCAPTURE_EXPR__ADDR]], align 8
2851 // CHECK3-NEXT: store i32 0, ptr [[DOTOMP_LB]], align 4
2852 // CHECK3-NEXT: store i32 99, ptr [[DOTOMP_UB]], align 4
2853 // CHECK3-NEXT: [[TMP0:%.*]] = load i64, ptr [[DOTPREVIOUS_LB__ADDR]], align 8
2854 // CHECK3-NEXT: [[CONV:%.*]] = trunc i64 [[TMP0]] to i32
2855 // CHECK3-NEXT: [[TMP1:%.*]] = load i64, ptr [[DOTPREVIOUS_UB__ADDR]], align 8
2856 // CHECK3-NEXT: [[CONV1:%.*]] = trunc i64 [[TMP1]] to i32
2857 // CHECK3-NEXT: store i32 [[CONV]], ptr [[DOTOMP_LB]], align 4
2858 // CHECK3-NEXT: store i32 [[CONV1]], ptr [[DOTOMP_UB]], align 4
2859 // CHECK3-NEXT: store i32 1, ptr [[DOTOMP_STRIDE]], align 4
2860 // CHECK3-NEXT: store i32 0, ptr [[DOTOMP_IS_LAST]], align 4
2861 // CHECK3-NEXT: [[TMP2:%.*]] = load i8, ptr [[DOTCAPTURE_EXPR__ADDR]], align 1
2862 // CHECK3-NEXT: [[TOBOOL:%.*]] = trunc i8 [[TMP2]] to i1
2863 // CHECK3-NEXT: br i1 [[TOBOOL]], label [[OMP_IF_THEN:%.*]], label [[OMP_IF_ELSE:%.*]]
2864 // CHECK3: omp_if.then:
2865 // CHECK3-NEXT: [[TMP3:%.*]] = load ptr, ptr [[DOTGLOBAL_TID__ADDR]], align 8
2866 // CHECK3-NEXT: [[TMP4:%.*]] = load i32, ptr [[TMP3]], align 4
2867 // CHECK3-NEXT: call void @__kmpc_for_static_init_4(ptr @[[GLOB2]], i32 [[TMP4]], i32 34, ptr [[DOTOMP_IS_LAST]], ptr [[DOTOMP_LB]], ptr [[DOTOMP_UB]], ptr [[DOTOMP_STRIDE]], i32 1, i32 1)
2868 // CHECK3-NEXT: [[TMP5:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4
2869 // CHECK3-NEXT: [[CMP:%.*]] = icmp sgt i32 [[TMP5]], 99
2870 // CHECK3-NEXT: br i1 [[CMP]], label [[COND_TRUE:%.*]], label [[COND_FALSE:%.*]]
2871 // CHECK3: cond.true:
2872 // CHECK3-NEXT: br label [[COND_END:%.*]]
2873 // CHECK3: cond.false:
2874 // CHECK3-NEXT: [[TMP6:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4
2875 // CHECK3-NEXT: br label [[COND_END]]
2876 // CHECK3: cond.end:
2877 // CHECK3-NEXT: [[COND:%.*]] = phi i32 [ 99, [[COND_TRUE]] ], [ [[TMP6]], [[COND_FALSE]] ]
2878 // CHECK3-NEXT: store i32 [[COND]], ptr [[DOTOMP_UB]], align 4
2879 // CHECK3-NEXT: [[TMP7:%.*]] = load i32, ptr [[DOTOMP_LB]], align 4
2880 // CHECK3-NEXT: store i32 [[TMP7]], ptr [[DOTOMP_IV]], align 4
2881 // CHECK3-NEXT: br label [[OMP_INNER_FOR_COND:%.*]]
2882 // CHECK3: omp.inner.for.cond:
2883 // CHECK3-NEXT: [[TMP8:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP43:![0-9]+]]
2884 // CHECK3-NEXT: [[TMP9:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4, !llvm.access.group [[ACC_GRP43]]
2885 // CHECK3-NEXT: [[CMP2:%.*]] = icmp sle i32 [[TMP8]], [[TMP9]]
2886 // CHECK3-NEXT: br i1 [[CMP2]], label [[OMP_INNER_FOR_BODY:%.*]], label [[OMP_INNER_FOR_END:%.*]]
2887 // CHECK3: omp.inner.for.body:
2888 // CHECK3-NEXT: [[TMP10:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP43]]
2889 // CHECK3-NEXT: [[MUL:%.*]] = mul nsw i32 [[TMP10]], 1
2890 // CHECK3-NEXT: [[ADD:%.*]] = add nsw i32 0, [[MUL]]
2891 // CHECK3-NEXT: store i32 [[ADD]], ptr [[I]], align 4, !llvm.access.group [[ACC_GRP43]]
2892 // CHECK3-NEXT: call void @_Z3fn6v(), !llvm.access.group [[ACC_GRP43]]
2893 // CHECK3-NEXT: br label [[OMP_BODY_CONTINUE:%.*]]
2894 // CHECK3: omp.body.continue:
2895 // CHECK3-NEXT: br label [[OMP_INNER_FOR_INC:%.*]]
2896 // CHECK3: omp.inner.for.inc:
2897 // CHECK3-NEXT: [[TMP11:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP43]]
2898 // CHECK3-NEXT: [[ADD3:%.*]] = add nsw i32 [[TMP11]], 1
2899 // CHECK3-NEXT: store i32 [[ADD3]], ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP43]]
2900 // CHECK3-NEXT: br label [[OMP_INNER_FOR_COND]], !llvm.loop [[LOOP44:![0-9]+]]
2901 // CHECK3: omp.inner.for.end:
2902 // CHECK3-NEXT: br label [[OMP_IF_END:%.*]]
2903 // CHECK3: omp_if.else:
2904 // CHECK3-NEXT: [[TMP12:%.*]] = load ptr, ptr [[DOTGLOBAL_TID__ADDR]], align 8
2905 // CHECK3-NEXT: [[TMP13:%.*]] = load i32, ptr [[TMP12]], align 4
2906 // CHECK3-NEXT: call void @__kmpc_for_static_init_4(ptr @[[GLOB2]], i32 [[TMP13]], i32 34, ptr [[DOTOMP_IS_LAST]], ptr [[DOTOMP_LB]], ptr [[DOTOMP_UB]], ptr [[DOTOMP_STRIDE]], i32 1, i32 1)
2907 // CHECK3-NEXT: [[TMP14:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4
2908 // CHECK3-NEXT: [[CMP4:%.*]] = icmp sgt i32 [[TMP14]], 99
2909 // CHECK3-NEXT: br i1 [[CMP4]], label [[COND_TRUE5:%.*]], label [[COND_FALSE6:%.*]]
2910 // CHECK3: cond.true5:
2911 // CHECK3-NEXT: br label [[COND_END7:%.*]]
2912 // CHECK3: cond.false6:
2913 // CHECK3-NEXT: [[TMP15:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4
2914 // CHECK3-NEXT: br label [[COND_END7]]
2915 // CHECK3: cond.end7:
2916 // CHECK3-NEXT: [[COND8:%.*]] = phi i32 [ 99, [[COND_TRUE5]] ], [ [[TMP15]], [[COND_FALSE6]] ]
2917 // CHECK3-NEXT: store i32 [[COND8]], ptr [[DOTOMP_UB]], align 4
2918 // CHECK3-NEXT: [[TMP16:%.*]] = load i32, ptr [[DOTOMP_LB]], align 4
2919 // CHECK3-NEXT: store i32 [[TMP16]], ptr [[DOTOMP_IV]], align 4
2920 // CHECK3-NEXT: br label [[OMP_INNER_FOR_COND9:%.*]]
2921 // CHECK3: omp.inner.for.cond9:
2922 // CHECK3-NEXT: [[TMP17:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4
2923 // CHECK3-NEXT: [[TMP18:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4
2924 // CHECK3-NEXT: [[CMP10:%.*]] = icmp sle i32 [[TMP17]], [[TMP18]]
2925 // CHECK3-NEXT: br i1 [[CMP10]], label [[OMP_INNER_FOR_BODY11:%.*]], label [[OMP_INNER_FOR_END17:%.*]]
2926 // CHECK3: omp.inner.for.body11:
2927 // CHECK3-NEXT: [[TMP19:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4
2928 // CHECK3-NEXT: [[MUL12:%.*]] = mul nsw i32 [[TMP19]], 1
2929 // CHECK3-NEXT: [[ADD13:%.*]] = add nsw i32 0, [[MUL12]]
2930 // CHECK3-NEXT: store i32 [[ADD13]], ptr [[I]], align 4
2931 // CHECK3-NEXT: call void @_Z3fn6v()
2932 // CHECK3-NEXT: br label [[OMP_BODY_CONTINUE14:%.*]]
2933 // CHECK3: omp.body.continue14:
2934 // CHECK3-NEXT: br label [[OMP_INNER_FOR_INC15:%.*]]
2935 // CHECK3: omp.inner.for.inc15:
2936 // CHECK3-NEXT: [[TMP20:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4
2937 // CHECK3-NEXT: [[ADD16:%.*]] = add nsw i32 [[TMP20]], 1
2938 // CHECK3-NEXT: store i32 [[ADD16]], ptr [[DOTOMP_IV]], align 4
2939 // CHECK3-NEXT: br label [[OMP_INNER_FOR_COND9]], !llvm.loop [[LOOP46:![0-9]+]]
2940 // CHECK3: omp.inner.for.end17:
2941 // CHECK3-NEXT: br label [[OMP_IF_END]]
2942 // CHECK3: omp_if.end:
2943 // CHECK3-NEXT: br label [[OMP_LOOP_EXIT:%.*]]
2944 // CHECK3: omp.loop.exit:
2945 // CHECK3-NEXT: [[TMP21:%.*]] = load ptr, ptr [[DOTGLOBAL_TID__ADDR]], align 8
2946 // CHECK3-NEXT: [[TMP22:%.*]] = load i32, ptr [[TMP21]], align 4
2947 // CHECK3-NEXT: call void @__kmpc_for_static_fini(ptr @[[GLOB1]], i32 [[TMP22]])
2948 // CHECK3-NEXT: [[TMP23:%.*]] = load i32, ptr [[DOTOMP_IS_LAST]], align 4
2949 // CHECK3-NEXT: [[TMP24:%.*]] = icmp ne i32 [[TMP23]], 0
2950 // CHECK3-NEXT: br i1 [[TMP24]], label [[DOTOMP_FINAL_THEN:%.*]], label [[DOTOMP_FINAL_DONE:%.*]]
2951 // CHECK3: .omp.final.then:
2952 // CHECK3-NEXT: store i32 100, ptr [[I]], align 4
2953 // CHECK3-NEXT: br label [[DOTOMP_FINAL_DONE]]
2954 // CHECK3: .omp.final.done:
2955 // CHECK3-NEXT: ret void
2958 // CHECK3-LABEL: define {{[^@]+}}@_Z5tmainIiEiT_
2959 // CHECK3-SAME: (i32 noundef [[ARG:%.*]]) #[[ATTR0]] comdat {
2960 // CHECK3-NEXT: entry:
2961 // CHECK3-NEXT: [[ARG_ADDR:%.*]] = alloca i32, align 4
2962 // CHECK3-NEXT: [[TMP:%.*]] = alloca i32, align 4
2963 // CHECK3-NEXT: [[KERNEL_ARGS:%.*]] = alloca [[STRUCT___TGT_KERNEL_ARGUMENTS:%.*]], align 8
2964 // CHECK3-NEXT: [[_TMP1:%.*]] = alloca i32, align 4
2965 // CHECK3-NEXT: [[KERNEL_ARGS2:%.*]] = alloca [[STRUCT___TGT_KERNEL_ARGUMENTS]], align 8
2966 // CHECK3-NEXT: [[ARG_CASTED:%.*]] = alloca i64, align 8
2967 // CHECK3-NEXT: [[DOTOFFLOAD_BASEPTRS:%.*]] = alloca [1 x ptr], align 8
2968 // CHECK3-NEXT: [[DOTOFFLOAD_PTRS:%.*]] = alloca [1 x ptr], align 8
2969 // CHECK3-NEXT: [[DOTOFFLOAD_MAPPERS:%.*]] = alloca [1 x ptr], align 8
2970 // CHECK3-NEXT: [[_TMP5:%.*]] = alloca i32, align 4
2971 // CHECK3-NEXT: [[KERNEL_ARGS6:%.*]] = alloca [[STRUCT___TGT_KERNEL_ARGUMENTS]], align 8
2972 // CHECK3-NEXT: store i32 [[ARG]], ptr [[ARG_ADDR]], align 4
2973 // CHECK3-NEXT: [[TMP0:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 0
2974 // CHECK3-NEXT: store i32 2, ptr [[TMP0]], align 4
2975 // CHECK3-NEXT: [[TMP1:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 1
2976 // CHECK3-NEXT: store i32 0, ptr [[TMP1]], align 4
2977 // CHECK3-NEXT: [[TMP2:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 2
2978 // CHECK3-NEXT: store ptr null, ptr [[TMP2]], align 8
2979 // CHECK3-NEXT: [[TMP3:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 3
2980 // CHECK3-NEXT: store ptr null, ptr [[TMP3]], align 8
2981 // CHECK3-NEXT: [[TMP4:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 4
2982 // CHECK3-NEXT: store ptr null, ptr [[TMP4]], align 8
2983 // CHECK3-NEXT: [[TMP5:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 5
2984 // CHECK3-NEXT: store ptr null, ptr [[TMP5]], align 8
2985 // CHECK3-NEXT: [[TMP6:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 6
2986 // CHECK3-NEXT: store ptr null, ptr [[TMP6]], align 8
2987 // CHECK3-NEXT: [[TMP7:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 7
2988 // CHECK3-NEXT: store ptr null, ptr [[TMP7]], align 8
2989 // CHECK3-NEXT: [[TMP8:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 8
2990 // CHECK3-NEXT: store i64 100, ptr [[TMP8]], align 8
2991 // CHECK3-NEXT: [[TMP9:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 9
2992 // CHECK3-NEXT: store i64 0, ptr [[TMP9]], align 8
2993 // CHECK3-NEXT: [[TMP10:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 10
2994 // CHECK3-NEXT: store [3 x i32] zeroinitializer, ptr [[TMP10]], align 4
2995 // CHECK3-NEXT: [[TMP11:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 11
2996 // CHECK3-NEXT: store [3 x i32] zeroinitializer, ptr [[TMP11]], align 4
2997 // CHECK3-NEXT: [[TMP12:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 12
2998 // CHECK3-NEXT: store i32 0, ptr [[TMP12]], align 4
2999 // CHECK3-NEXT: [[TMP13:%.*]] = call i32 @__tgt_target_kernel(ptr @[[GLOB3]], i64 -1, i32 0, i32 0, ptr @.{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z5tmainIiEiT__l59.region_id, ptr [[KERNEL_ARGS]])
3000 // CHECK3-NEXT: [[TMP14:%.*]] = icmp ne i32 [[TMP13]], 0
3001 // CHECK3-NEXT: br i1 [[TMP14]], label [[OMP_OFFLOAD_FAILED:%.*]], label [[OMP_OFFLOAD_CONT:%.*]]
3002 // CHECK3: omp_offload.failed:
3003 // CHECK3-NEXT: call void @{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z5tmainIiEiT__l59() #[[ATTR2]]
3004 // CHECK3-NEXT: br label [[OMP_OFFLOAD_CONT]]
3005 // CHECK3: omp_offload.cont:
3006 // CHECK3-NEXT: [[TMP15:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS2]], i32 0, i32 0
3007 // CHECK3-NEXT: store i32 2, ptr [[TMP15]], align 4
3008 // CHECK3-NEXT: [[TMP16:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS2]], i32 0, i32 1
3009 // CHECK3-NEXT: store i32 0, ptr [[TMP16]], align 4
3010 // CHECK3-NEXT: [[TMP17:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS2]], i32 0, i32 2
3011 // CHECK3-NEXT: store ptr null, ptr [[TMP17]], align 8
3012 // CHECK3-NEXT: [[TMP18:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS2]], i32 0, i32 3
3013 // CHECK3-NEXT: store ptr null, ptr [[TMP18]], align 8
3014 // CHECK3-NEXT: [[TMP19:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS2]], i32 0, i32 4
3015 // CHECK3-NEXT: store ptr null, ptr [[TMP19]], align 8
3016 // CHECK3-NEXT: [[TMP20:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS2]], i32 0, i32 5
3017 // CHECK3-NEXT: store ptr null, ptr [[TMP20]], align 8
3018 // CHECK3-NEXT: [[TMP21:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS2]], i32 0, i32 6
3019 // CHECK3-NEXT: store ptr null, ptr [[TMP21]], align 8
3020 // CHECK3-NEXT: [[TMP22:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS2]], i32 0, i32 7
3021 // CHECK3-NEXT: store ptr null, ptr [[TMP22]], align 8
3022 // CHECK3-NEXT: [[TMP23:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS2]], i32 0, i32 8
3023 // CHECK3-NEXT: store i64 100, ptr [[TMP23]], align 8
3024 // CHECK3-NEXT: [[TMP24:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS2]], i32 0, i32 9
3025 // CHECK3-NEXT: store i64 0, ptr [[TMP24]], align 8
3026 // CHECK3-NEXT: [[TMP25:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS2]], i32 0, i32 10
3027 // CHECK3-NEXT: store [3 x i32] zeroinitializer, ptr [[TMP25]], align 4
3028 // CHECK3-NEXT: [[TMP26:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS2]], i32 0, i32 11
3029 // CHECK3-NEXT: store [3 x i32] zeroinitializer, ptr [[TMP26]], align 4
3030 // CHECK3-NEXT: [[TMP27:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS2]], i32 0, i32 12
3031 // CHECK3-NEXT: store i32 0, ptr [[TMP27]], align 4
3032 // CHECK3-NEXT: [[TMP28:%.*]] = call i32 @__tgt_target_kernel(ptr @[[GLOB3]], i64 -1, i32 0, i32 0, ptr @.{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z5tmainIiEiT__l65.region_id, ptr [[KERNEL_ARGS2]])
3033 // CHECK3-NEXT: [[TMP29:%.*]] = icmp ne i32 [[TMP28]], 0
3034 // CHECK3-NEXT: br i1 [[TMP29]], label [[OMP_OFFLOAD_FAILED3:%.*]], label [[OMP_OFFLOAD_CONT4:%.*]]
3035 // CHECK3: omp_offload.failed3:
3036 // CHECK3-NEXT: call void @{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z5tmainIiEiT__l65() #[[ATTR2]]
3037 // CHECK3-NEXT: br label [[OMP_OFFLOAD_CONT4]]
3038 // CHECK3: omp_offload.cont4:
3039 // CHECK3-NEXT: [[TMP30:%.*]] = load i32, ptr [[ARG_ADDR]], align 4
3040 // CHECK3-NEXT: store i32 [[TMP30]], ptr [[ARG_CASTED]], align 4
3041 // CHECK3-NEXT: [[TMP31:%.*]] = load i64, ptr [[ARG_CASTED]], align 8
3042 // CHECK3-NEXT: [[TMP32:%.*]] = getelementptr inbounds [1 x ptr], ptr [[DOTOFFLOAD_BASEPTRS]], i32 0, i32 0
3043 // CHECK3-NEXT: store i64 [[TMP31]], ptr [[TMP32]], align 8
3044 // CHECK3-NEXT: [[TMP33:%.*]] = getelementptr inbounds [1 x ptr], ptr [[DOTOFFLOAD_PTRS]], i32 0, i32 0
3045 // CHECK3-NEXT: store i64 [[TMP31]], ptr [[TMP33]], align 8
3046 // CHECK3-NEXT: [[TMP34:%.*]] = getelementptr inbounds [1 x ptr], ptr [[DOTOFFLOAD_MAPPERS]], i64 0, i64 0
3047 // CHECK3-NEXT: store ptr null, ptr [[TMP34]], align 8
3048 // CHECK3-NEXT: [[TMP35:%.*]] = getelementptr inbounds [1 x ptr], ptr [[DOTOFFLOAD_BASEPTRS]], i32 0, i32 0
3049 // CHECK3-NEXT: [[TMP36:%.*]] = getelementptr inbounds [1 x ptr], ptr [[DOTOFFLOAD_PTRS]], i32 0, i32 0
3050 // CHECK3-NEXT: [[TMP37:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS6]], i32 0, i32 0
3051 // CHECK3-NEXT: store i32 2, ptr [[TMP37]], align 4
3052 // CHECK3-NEXT: [[TMP38:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS6]], i32 0, i32 1
3053 // CHECK3-NEXT: store i32 1, ptr [[TMP38]], align 4
3054 // CHECK3-NEXT: [[TMP39:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS6]], i32 0, i32 2
3055 // CHECK3-NEXT: store ptr [[TMP35]], ptr [[TMP39]], align 8
3056 // CHECK3-NEXT: [[TMP40:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS6]], i32 0, i32 3
3057 // CHECK3-NEXT: store ptr [[TMP36]], ptr [[TMP40]], align 8
3058 // CHECK3-NEXT: [[TMP41:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS6]], i32 0, i32 4
3059 // CHECK3-NEXT: store ptr @.offload_sizes.2, ptr [[TMP41]], align 8
3060 // CHECK3-NEXT: [[TMP42:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS6]], i32 0, i32 5
3061 // CHECK3-NEXT: store ptr @.offload_maptypes.3, ptr [[TMP42]], align 8
3062 // CHECK3-NEXT: [[TMP43:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS6]], i32 0, i32 6
3063 // CHECK3-NEXT: store ptr null, ptr [[TMP43]], align 8
3064 // CHECK3-NEXT: [[TMP44:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS6]], i32 0, i32 7
3065 // CHECK3-NEXT: store ptr null, ptr [[TMP44]], align 8
3066 // CHECK3-NEXT: [[TMP45:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS6]], i32 0, i32 8
3067 // CHECK3-NEXT: store i64 100, ptr [[TMP45]], align 8
3068 // CHECK3-NEXT: [[TMP46:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS6]], i32 0, i32 9
3069 // CHECK3-NEXT: store i64 0, ptr [[TMP46]], align 8
3070 // CHECK3-NEXT: [[TMP47:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS6]], i32 0, i32 10
3071 // CHECK3-NEXT: store [3 x i32] zeroinitializer, ptr [[TMP47]], align 4
3072 // CHECK3-NEXT: [[TMP48:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS6]], i32 0, i32 11
3073 // CHECK3-NEXT: store [3 x i32] zeroinitializer, ptr [[TMP48]], align 4
3074 // CHECK3-NEXT: [[TMP49:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS6]], i32 0, i32 12
3075 // CHECK3-NEXT: store i32 0, ptr [[TMP49]], align 4
3076 // CHECK3-NEXT: [[TMP50:%.*]] = call i32 @__tgt_target_kernel(ptr @[[GLOB3]], i64 -1, i32 0, i32 0, ptr @.{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z5tmainIiEiT__l71.region_id, ptr [[KERNEL_ARGS6]])
3077 // CHECK3-NEXT: [[TMP51:%.*]] = icmp ne i32 [[TMP50]], 0
3078 // CHECK3-NEXT: br i1 [[TMP51]], label [[OMP_OFFLOAD_FAILED7:%.*]], label [[OMP_OFFLOAD_CONT8:%.*]]
3079 // CHECK3: omp_offload.failed7:
3080 // CHECK3-NEXT: call void @{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z5tmainIiEiT__l71(i64 [[TMP31]]) #[[ATTR2]]
3081 // CHECK3-NEXT: br label [[OMP_OFFLOAD_CONT8]]
3082 // CHECK3: omp_offload.cont8:
3083 // CHECK3-NEXT: ret i32 0
3086 // CHECK3-LABEL: define {{[^@]+}}@{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z5tmainIiEiT__l59
3087 // CHECK3-SAME: () #[[ATTR1]] {
3088 // CHECK3-NEXT: entry:
3089 // CHECK3-NEXT: call void (ptr, i32, ptr, ...) @__kmpc_fork_teams(ptr @[[GLOB3]], i32 0, ptr @{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z5tmainIiEiT__l59.omp_outlined)
3090 // CHECK3-NEXT: ret void
3093 // CHECK3-LABEL: define {{[^@]+}}@{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z5tmainIiEiT__l59.omp_outlined
3094 // CHECK3-SAME: (ptr noalias noundef [[DOTGLOBAL_TID_:%.*]], ptr noalias noundef [[DOTBOUND_TID_:%.*]]) #[[ATTR1]] {
3095 // CHECK3-NEXT: entry:
3096 // CHECK3-NEXT: [[DOTGLOBAL_TID__ADDR:%.*]] = alloca ptr, align 8
3097 // CHECK3-NEXT: [[DOTBOUND_TID__ADDR:%.*]] = alloca ptr, align 8
3098 // CHECK3-NEXT: [[DOTOMP_IV:%.*]] = alloca i32, align 4
3099 // CHECK3-NEXT: [[TMP:%.*]] = alloca i32, align 4
3100 // CHECK3-NEXT: [[DOTOMP_COMB_LB:%.*]] = alloca i32, align 4
3101 // CHECK3-NEXT: [[DOTOMP_COMB_UB:%.*]] = alloca i32, align 4
3102 // CHECK3-NEXT: [[DOTOMP_STRIDE:%.*]] = alloca i32, align 4
3103 // CHECK3-NEXT: [[DOTOMP_IS_LAST:%.*]] = alloca i32, align 4
3104 // CHECK3-NEXT: [[I:%.*]] = alloca i32, align 4
3105 // CHECK3-NEXT: store ptr [[DOTGLOBAL_TID_]], ptr [[DOTGLOBAL_TID__ADDR]], align 8
3106 // CHECK3-NEXT: store ptr [[DOTBOUND_TID_]], ptr [[DOTBOUND_TID__ADDR]], align 8
3107 // CHECK3-NEXT: store i32 0, ptr [[DOTOMP_COMB_LB]], align 4
3108 // CHECK3-NEXT: store i32 99, ptr [[DOTOMP_COMB_UB]], align 4
3109 // CHECK3-NEXT: store i32 1, ptr [[DOTOMP_STRIDE]], align 4
3110 // CHECK3-NEXT: store i32 0, ptr [[DOTOMP_IS_LAST]], align 4
3111 // CHECK3-NEXT: [[TMP0:%.*]] = load ptr, ptr [[DOTGLOBAL_TID__ADDR]], align 8
3112 // CHECK3-NEXT: [[TMP1:%.*]] = load i32, ptr [[TMP0]], align 4
3113 // CHECK3-NEXT: call void @__kmpc_for_static_init_4(ptr @[[GLOB1]], i32 [[TMP1]], i32 92, ptr [[DOTOMP_IS_LAST]], ptr [[DOTOMP_COMB_LB]], ptr [[DOTOMP_COMB_UB]], ptr [[DOTOMP_STRIDE]], i32 1, i32 1)
3114 // CHECK3-NEXT: [[TMP2:%.*]] = load i32, ptr [[DOTOMP_COMB_UB]], align 4
3115 // CHECK3-NEXT: [[CMP:%.*]] = icmp sgt i32 [[TMP2]], 99
3116 // CHECK3-NEXT: br i1 [[CMP]], label [[COND_TRUE:%.*]], label [[COND_FALSE:%.*]]
3117 // CHECK3: cond.true:
3118 // CHECK3-NEXT: br label [[COND_END:%.*]]
3119 // CHECK3: cond.false:
3120 // CHECK3-NEXT: [[TMP3:%.*]] = load i32, ptr [[DOTOMP_COMB_UB]], align 4
3121 // CHECK3-NEXT: br label [[COND_END]]
3122 // CHECK3: cond.end:
3123 // CHECK3-NEXT: [[COND:%.*]] = phi i32 [ 99, [[COND_TRUE]] ], [ [[TMP3]], [[COND_FALSE]] ]
3124 // CHECK3-NEXT: store i32 [[COND]], ptr [[DOTOMP_COMB_UB]], align 4
3125 // CHECK3-NEXT: [[TMP4:%.*]] = load i32, ptr [[DOTOMP_COMB_LB]], align 4
3126 // CHECK3-NEXT: store i32 [[TMP4]], ptr [[DOTOMP_IV]], align 4
3127 // CHECK3-NEXT: br label [[OMP_INNER_FOR_COND:%.*]]
3128 // CHECK3: omp.inner.for.cond:
3129 // CHECK3-NEXT: [[TMP5:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP47:![0-9]+]]
3130 // CHECK3-NEXT: [[TMP6:%.*]] = load i32, ptr [[DOTOMP_COMB_UB]], align 4, !llvm.access.group [[ACC_GRP47]]
3131 // CHECK3-NEXT: [[CMP1:%.*]] = icmp sle i32 [[TMP5]], [[TMP6]]
3132 // CHECK3-NEXT: br i1 [[CMP1]], label [[OMP_INNER_FOR_BODY:%.*]], label [[OMP_INNER_FOR_END:%.*]]
3133 // CHECK3: omp.inner.for.body:
3134 // CHECK3-NEXT: [[TMP7:%.*]] = load i32, ptr [[DOTOMP_COMB_LB]], align 4, !llvm.access.group [[ACC_GRP47]]
3135 // CHECK3-NEXT: [[TMP8:%.*]] = zext i32 [[TMP7]] to i64
3136 // CHECK3-NEXT: [[TMP9:%.*]] = load i32, ptr [[DOTOMP_COMB_UB]], align 4, !llvm.access.group [[ACC_GRP47]]
3137 // CHECK3-NEXT: [[TMP10:%.*]] = zext i32 [[TMP9]] to i64
3138 // CHECK3-NEXT: call void (ptr, i32, ptr, ...) @__kmpc_fork_call(ptr @[[GLOB3]], i32 2, ptr @{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z5tmainIiEiT__l59.omp_outlined.omp_outlined, i64 [[TMP8]], i64 [[TMP10]]), !llvm.access.group [[ACC_GRP47]]
3139 // CHECK3-NEXT: br label [[OMP_INNER_FOR_INC:%.*]]
3140 // CHECK3: omp.inner.for.inc:
3141 // CHECK3-NEXT: [[TMP11:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP47]]
3142 // CHECK3-NEXT: [[TMP12:%.*]] = load i32, ptr [[DOTOMP_STRIDE]], align 4, !llvm.access.group [[ACC_GRP47]]
3143 // CHECK3-NEXT: [[ADD:%.*]] = add nsw i32 [[TMP11]], [[TMP12]]
3144 // CHECK3-NEXT: store i32 [[ADD]], ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP47]]
3145 // CHECK3-NEXT: br label [[OMP_INNER_FOR_COND]], !llvm.loop [[LOOP48:![0-9]+]]
3146 // CHECK3: omp.inner.for.end:
3147 // CHECK3-NEXT: br label [[OMP_LOOP_EXIT:%.*]]
3148 // CHECK3: omp.loop.exit:
3149 // CHECK3-NEXT: call void @__kmpc_for_static_fini(ptr @[[GLOB1]], i32 [[TMP1]])
3150 // CHECK3-NEXT: [[TMP13:%.*]] = load i32, ptr [[DOTOMP_IS_LAST]], align 4
3151 // CHECK3-NEXT: [[TMP14:%.*]] = icmp ne i32 [[TMP13]], 0
3152 // CHECK3-NEXT: br i1 [[TMP14]], label [[DOTOMP_FINAL_THEN:%.*]], label [[DOTOMP_FINAL_DONE:%.*]]
3153 // CHECK3: .omp.final.then:
3154 // CHECK3-NEXT: store i32 100, ptr [[I]], align 4
3155 // CHECK3-NEXT: br label [[DOTOMP_FINAL_DONE]]
3156 // CHECK3: .omp.final.done:
3157 // CHECK3-NEXT: ret void
3160 // CHECK3-LABEL: define {{[^@]+}}@{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z5tmainIiEiT__l59.omp_outlined.omp_outlined
3161 // CHECK3-SAME: (ptr noalias noundef [[DOTGLOBAL_TID_:%.*]], ptr noalias noundef [[DOTBOUND_TID_:%.*]], i64 noundef [[DOTPREVIOUS_LB_:%.*]], i64 noundef [[DOTPREVIOUS_UB_:%.*]]) #[[ATTR1]] {
3162 // CHECK3-NEXT: entry:
3163 // CHECK3-NEXT: [[DOTGLOBAL_TID__ADDR:%.*]] = alloca ptr, align 8
3164 // CHECK3-NEXT: [[DOTBOUND_TID__ADDR:%.*]] = alloca ptr, align 8
3165 // CHECK3-NEXT: [[DOTPREVIOUS_LB__ADDR:%.*]] = alloca i64, align 8
3166 // CHECK3-NEXT: [[DOTPREVIOUS_UB__ADDR:%.*]] = alloca i64, align 8
3167 // CHECK3-NEXT: [[DOTOMP_IV:%.*]] = alloca i32, align 4
3168 // CHECK3-NEXT: [[TMP:%.*]] = alloca i32, align 4
3169 // CHECK3-NEXT: [[DOTOMP_LB:%.*]] = alloca i32, align 4
3170 // CHECK3-NEXT: [[DOTOMP_UB:%.*]] = alloca i32, align 4
3171 // CHECK3-NEXT: [[DOTOMP_STRIDE:%.*]] = alloca i32, align 4
3172 // CHECK3-NEXT: [[DOTOMP_IS_LAST:%.*]] = alloca i32, align 4
3173 // CHECK3-NEXT: [[I:%.*]] = alloca i32, align 4
3174 // CHECK3-NEXT: store ptr [[DOTGLOBAL_TID_]], ptr [[DOTGLOBAL_TID__ADDR]], align 8
3175 // CHECK3-NEXT: store ptr [[DOTBOUND_TID_]], ptr [[DOTBOUND_TID__ADDR]], align 8
3176 // CHECK3-NEXT: store i64 [[DOTPREVIOUS_LB_]], ptr [[DOTPREVIOUS_LB__ADDR]], align 8
3177 // CHECK3-NEXT: store i64 [[DOTPREVIOUS_UB_]], ptr [[DOTPREVIOUS_UB__ADDR]], align 8
3178 // CHECK3-NEXT: store i32 0, ptr [[DOTOMP_LB]], align 4
3179 // CHECK3-NEXT: store i32 99, ptr [[DOTOMP_UB]], align 4
3180 // CHECK3-NEXT: [[TMP0:%.*]] = load i64, ptr [[DOTPREVIOUS_LB__ADDR]], align 8
3181 // CHECK3-NEXT: [[CONV:%.*]] = trunc i64 [[TMP0]] to i32
3182 // CHECK3-NEXT: [[TMP1:%.*]] = load i64, ptr [[DOTPREVIOUS_UB__ADDR]], align 8
3183 // CHECK3-NEXT: [[CONV1:%.*]] = trunc i64 [[TMP1]] to i32
3184 // CHECK3-NEXT: store i32 [[CONV]], ptr [[DOTOMP_LB]], align 4
3185 // CHECK3-NEXT: store i32 [[CONV1]], ptr [[DOTOMP_UB]], align 4
3186 // CHECK3-NEXT: store i32 1, ptr [[DOTOMP_STRIDE]], align 4
3187 // CHECK3-NEXT: store i32 0, ptr [[DOTOMP_IS_LAST]], align 4
3188 // CHECK3-NEXT: [[TMP2:%.*]] = load ptr, ptr [[DOTGLOBAL_TID__ADDR]], align 8
3189 // CHECK3-NEXT: [[TMP3:%.*]] = load i32, ptr [[TMP2]], align 4
3190 // CHECK3-NEXT: call void @__kmpc_for_static_init_4(ptr @[[GLOB2]], i32 [[TMP3]], i32 34, ptr [[DOTOMP_IS_LAST]], ptr [[DOTOMP_LB]], ptr [[DOTOMP_UB]], ptr [[DOTOMP_STRIDE]], i32 1, i32 1)
3191 // CHECK3-NEXT: [[TMP4:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4
3192 // CHECK3-NEXT: [[CMP:%.*]] = icmp sgt i32 [[TMP4]], 99
3193 // CHECK3-NEXT: br i1 [[CMP]], label [[COND_TRUE:%.*]], label [[COND_FALSE:%.*]]
3194 // CHECK3: cond.true:
3195 // CHECK3-NEXT: br label [[COND_END:%.*]]
3196 // CHECK3: cond.false:
3197 // CHECK3-NEXT: [[TMP5:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4
3198 // CHECK3-NEXT: br label [[COND_END]]
3199 // CHECK3: cond.end:
3200 // CHECK3-NEXT: [[COND:%.*]] = phi i32 [ 99, [[COND_TRUE]] ], [ [[TMP5]], [[COND_FALSE]] ]
3201 // CHECK3-NEXT: store i32 [[COND]], ptr [[DOTOMP_UB]], align 4
3202 // CHECK3-NEXT: [[TMP6:%.*]] = load i32, ptr [[DOTOMP_LB]], align 4
3203 // CHECK3-NEXT: store i32 [[TMP6]], ptr [[DOTOMP_IV]], align 4
3204 // CHECK3-NEXT: br label [[OMP_INNER_FOR_COND:%.*]]
3205 // CHECK3: omp.inner.for.cond:
3206 // CHECK3-NEXT: [[TMP7:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP50:![0-9]+]]
3207 // CHECK3-NEXT: [[TMP8:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4, !llvm.access.group [[ACC_GRP50]]
3208 // CHECK3-NEXT: [[CMP2:%.*]] = icmp sle i32 [[TMP7]], [[TMP8]]
3209 // CHECK3-NEXT: br i1 [[CMP2]], label [[OMP_INNER_FOR_BODY:%.*]], label [[OMP_INNER_FOR_END:%.*]]
3210 // CHECK3: omp.inner.for.body:
3211 // CHECK3-NEXT: [[TMP9:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP50]]
3212 // CHECK3-NEXT: [[MUL:%.*]] = mul nsw i32 [[TMP9]], 1
3213 // CHECK3-NEXT: [[ADD:%.*]] = add nsw i32 0, [[MUL]]
3214 // CHECK3-NEXT: store i32 [[ADD]], ptr [[I]], align 4, !llvm.access.group [[ACC_GRP50]]
3215 // CHECK3-NEXT: call void @_Z3fn1v(), !llvm.access.group [[ACC_GRP50]]
3216 // CHECK3-NEXT: br label [[OMP_BODY_CONTINUE:%.*]]
3217 // CHECK3: omp.body.continue:
3218 // CHECK3-NEXT: br label [[OMP_INNER_FOR_INC:%.*]]
3219 // CHECK3: omp.inner.for.inc:
3220 // CHECK3-NEXT: [[TMP10:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP50]]
3221 // CHECK3-NEXT: [[ADD3:%.*]] = add nsw i32 [[TMP10]], 1
3222 // CHECK3-NEXT: store i32 [[ADD3]], ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP50]]
3223 // CHECK3-NEXT: br label [[OMP_INNER_FOR_COND]], !llvm.loop [[LOOP51:![0-9]+]]
3224 // CHECK3: omp.inner.for.end:
3225 // CHECK3-NEXT: br label [[OMP_LOOP_EXIT:%.*]]
3226 // CHECK3: omp.loop.exit:
3227 // CHECK3-NEXT: call void @__kmpc_for_static_fini(ptr @[[GLOB1]], i32 [[TMP3]])
3228 // CHECK3-NEXT: [[TMP11:%.*]] = load i32, ptr [[DOTOMP_IS_LAST]], align 4
3229 // CHECK3-NEXT: [[TMP12:%.*]] = icmp ne i32 [[TMP11]], 0
3230 // CHECK3-NEXT: br i1 [[TMP12]], label [[DOTOMP_FINAL_THEN:%.*]], label [[DOTOMP_FINAL_DONE:%.*]]
3231 // CHECK3: .omp.final.then:
3232 // CHECK3-NEXT: store i32 100, ptr [[I]], align 4
3233 // CHECK3-NEXT: br label [[DOTOMP_FINAL_DONE]]
3234 // CHECK3: .omp.final.done:
3235 // CHECK3-NEXT: ret void
3238 // CHECK3-LABEL: define {{[^@]+}}@{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z5tmainIiEiT__l65
3239 // CHECK3-SAME: () #[[ATTR1]] {
3240 // CHECK3-NEXT: entry:
3241 // CHECK3-NEXT: call void (ptr, i32, ptr, ...) @__kmpc_fork_teams(ptr @[[GLOB3]], i32 0, ptr @{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z5tmainIiEiT__l65.omp_outlined)
3242 // CHECK3-NEXT: ret void
3245 // CHECK3-LABEL: define {{[^@]+}}@{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z5tmainIiEiT__l65.omp_outlined
3246 // CHECK3-SAME: (ptr noalias noundef [[DOTGLOBAL_TID_:%.*]], ptr noalias noundef [[DOTBOUND_TID_:%.*]]) #[[ATTR1]] {
3247 // CHECK3-NEXT: entry:
3248 // CHECK3-NEXT: [[DOTGLOBAL_TID__ADDR:%.*]] = alloca ptr, align 8
3249 // CHECK3-NEXT: [[DOTBOUND_TID__ADDR:%.*]] = alloca ptr, align 8
3250 // CHECK3-NEXT: [[DOTOMP_IV:%.*]] = alloca i32, align 4
3251 // CHECK3-NEXT: [[TMP:%.*]] = alloca i32, align 4
3252 // CHECK3-NEXT: [[DOTOMP_COMB_LB:%.*]] = alloca i32, align 4
3253 // CHECK3-NEXT: [[DOTOMP_COMB_UB:%.*]] = alloca i32, align 4
3254 // CHECK3-NEXT: [[DOTOMP_STRIDE:%.*]] = alloca i32, align 4
3255 // CHECK3-NEXT: [[DOTOMP_IS_LAST:%.*]] = alloca i32, align 4
3256 // CHECK3-NEXT: [[I:%.*]] = alloca i32, align 4
3257 // CHECK3-NEXT: [[DOTBOUND_ZERO_ADDR:%.*]] = alloca i32, align 4
3258 // CHECK3-NEXT: store ptr [[DOTGLOBAL_TID_]], ptr [[DOTGLOBAL_TID__ADDR]], align 8
3259 // CHECK3-NEXT: store ptr [[DOTBOUND_TID_]], ptr [[DOTBOUND_TID__ADDR]], align 8
3260 // CHECK3-NEXT: store i32 0, ptr [[DOTOMP_COMB_LB]], align 4
3261 // CHECK3-NEXT: store i32 99, ptr [[DOTOMP_COMB_UB]], align 4
3262 // CHECK3-NEXT: store i32 1, ptr [[DOTOMP_STRIDE]], align 4
3263 // CHECK3-NEXT: store i32 0, ptr [[DOTOMP_IS_LAST]], align 4
3264 // CHECK3-NEXT: [[TMP0:%.*]] = load ptr, ptr [[DOTGLOBAL_TID__ADDR]], align 8
3265 // CHECK3-NEXT: [[TMP1:%.*]] = load i32, ptr [[TMP0]], align 4
3266 // CHECK3-NEXT: call void @__kmpc_for_static_init_4(ptr @[[GLOB1]], i32 [[TMP1]], i32 92, ptr [[DOTOMP_IS_LAST]], ptr [[DOTOMP_COMB_LB]], ptr [[DOTOMP_COMB_UB]], ptr [[DOTOMP_STRIDE]], i32 1, i32 1)
3267 // CHECK3-NEXT: [[TMP2:%.*]] = load i32, ptr [[DOTOMP_COMB_UB]], align 4
3268 // CHECK3-NEXT: [[CMP:%.*]] = icmp sgt i32 [[TMP2]], 99
3269 // CHECK3-NEXT: br i1 [[CMP]], label [[COND_TRUE:%.*]], label [[COND_FALSE:%.*]]
3270 // CHECK3: cond.true:
3271 // CHECK3-NEXT: br label [[COND_END:%.*]]
3272 // CHECK3: cond.false:
3273 // CHECK3-NEXT: [[TMP3:%.*]] = load i32, ptr [[DOTOMP_COMB_UB]], align 4
3274 // CHECK3-NEXT: br label [[COND_END]]
3275 // CHECK3: cond.end:
3276 // CHECK3-NEXT: [[COND:%.*]] = phi i32 [ 99, [[COND_TRUE]] ], [ [[TMP3]], [[COND_FALSE]] ]
3277 // CHECK3-NEXT: store i32 [[COND]], ptr [[DOTOMP_COMB_UB]], align 4
3278 // CHECK3-NEXT: [[TMP4:%.*]] = load i32, ptr [[DOTOMP_COMB_LB]], align 4
3279 // CHECK3-NEXT: store i32 [[TMP4]], ptr [[DOTOMP_IV]], align 4
3280 // CHECK3-NEXT: br label [[OMP_INNER_FOR_COND:%.*]]
3281 // CHECK3: omp.inner.for.cond:
3282 // CHECK3-NEXT: [[TMP5:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4
3283 // CHECK3-NEXT: [[TMP6:%.*]] = load i32, ptr [[DOTOMP_COMB_UB]], align 4
3284 // CHECK3-NEXT: [[CMP1:%.*]] = icmp sle i32 [[TMP5]], [[TMP6]]
3285 // CHECK3-NEXT: br i1 [[CMP1]], label [[OMP_INNER_FOR_BODY:%.*]], label [[OMP_INNER_FOR_END:%.*]]
3286 // CHECK3: omp.inner.for.body:
3287 // CHECK3-NEXT: [[TMP7:%.*]] = load i32, ptr [[DOTOMP_COMB_LB]], align 4
3288 // CHECK3-NEXT: [[TMP8:%.*]] = zext i32 [[TMP7]] to i64
3289 // CHECK3-NEXT: [[TMP9:%.*]] = load i32, ptr [[DOTOMP_COMB_UB]], align 4
3290 // CHECK3-NEXT: [[TMP10:%.*]] = zext i32 [[TMP9]] to i64
3291 // CHECK3-NEXT: call void @__kmpc_serialized_parallel(ptr @[[GLOB3]], i32 [[TMP1]])
3292 // CHECK3-NEXT: [[TMP11:%.*]] = load ptr, ptr [[DOTGLOBAL_TID__ADDR]], align 8
3293 // CHECK3-NEXT: store i32 0, ptr [[DOTBOUND_ZERO_ADDR]], align 4
3294 // CHECK3-NEXT: call void @{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z5tmainIiEiT__l65.omp_outlined.omp_outlined(ptr [[TMP11]], ptr [[DOTBOUND_ZERO_ADDR]], i64 [[TMP8]], i64 [[TMP10]]) #[[ATTR2]]
3295 // CHECK3-NEXT: call void @__kmpc_end_serialized_parallel(ptr @[[GLOB3]], i32 [[TMP1]])
3296 // CHECK3-NEXT: br label [[OMP_INNER_FOR_INC:%.*]]
3297 // CHECK3: omp.inner.for.inc:
3298 // CHECK3-NEXT: [[TMP12:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4
3299 // CHECK3-NEXT: [[TMP13:%.*]] = load i32, ptr [[DOTOMP_STRIDE]], align 4
3300 // CHECK3-NEXT: [[ADD:%.*]] = add nsw i32 [[TMP12]], [[TMP13]]
3301 // CHECK3-NEXT: store i32 [[ADD]], ptr [[DOTOMP_IV]], align 4
3302 // CHECK3-NEXT: br label [[OMP_INNER_FOR_COND]], !llvm.loop [[LOOP53:![0-9]+]]
3303 // CHECK3: omp.inner.for.end:
3304 // CHECK3-NEXT: br label [[OMP_LOOP_EXIT:%.*]]
3305 // CHECK3: omp.loop.exit:
3306 // CHECK3-NEXT: call void @__kmpc_for_static_fini(ptr @[[GLOB1]], i32 [[TMP1]])
3307 // CHECK3-NEXT: [[TMP14:%.*]] = load i32, ptr [[DOTOMP_IS_LAST]], align 4
3308 // CHECK3-NEXT: [[TMP15:%.*]] = icmp ne i32 [[TMP14]], 0
3309 // CHECK3-NEXT: br i1 [[TMP15]], label [[DOTOMP_FINAL_THEN:%.*]], label [[DOTOMP_FINAL_DONE:%.*]]
3310 // CHECK3: .omp.final.then:
3311 // CHECK3-NEXT: store i32 100, ptr [[I]], align 4
3312 // CHECK3-NEXT: br label [[DOTOMP_FINAL_DONE]]
3313 // CHECK3: .omp.final.done:
3314 // CHECK3-NEXT: ret void
3317 // CHECK3-LABEL: define {{[^@]+}}@{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z5tmainIiEiT__l65.omp_outlined.omp_outlined
3318 // CHECK3-SAME: (ptr noalias noundef [[DOTGLOBAL_TID_:%.*]], ptr noalias noundef [[DOTBOUND_TID_:%.*]], i64 noundef [[DOTPREVIOUS_LB_:%.*]], i64 noundef [[DOTPREVIOUS_UB_:%.*]]) #[[ATTR1]] {
3319 // CHECK3-NEXT: entry:
3320 // CHECK3-NEXT: [[DOTGLOBAL_TID__ADDR:%.*]] = alloca ptr, align 8
3321 // CHECK3-NEXT: [[DOTBOUND_TID__ADDR:%.*]] = alloca ptr, align 8
3322 // CHECK3-NEXT: [[DOTPREVIOUS_LB__ADDR:%.*]] = alloca i64, align 8
3323 // CHECK3-NEXT: [[DOTPREVIOUS_UB__ADDR:%.*]] = alloca i64, align 8
3324 // CHECK3-NEXT: [[DOTOMP_IV:%.*]] = alloca i32, align 4
3325 // CHECK3-NEXT: [[TMP:%.*]] = alloca i32, align 4
3326 // CHECK3-NEXT: [[DOTOMP_LB:%.*]] = alloca i32, align 4
3327 // CHECK3-NEXT: [[DOTOMP_UB:%.*]] = alloca i32, align 4
3328 // CHECK3-NEXT: [[DOTOMP_STRIDE:%.*]] = alloca i32, align 4
3329 // CHECK3-NEXT: [[DOTOMP_IS_LAST:%.*]] = alloca i32, align 4
3330 // CHECK3-NEXT: [[I:%.*]] = alloca i32, align 4
3331 // CHECK3-NEXT: store ptr [[DOTGLOBAL_TID_]], ptr [[DOTGLOBAL_TID__ADDR]], align 8
3332 // CHECK3-NEXT: store ptr [[DOTBOUND_TID_]], ptr [[DOTBOUND_TID__ADDR]], align 8
3333 // CHECK3-NEXT: store i64 [[DOTPREVIOUS_LB_]], ptr [[DOTPREVIOUS_LB__ADDR]], align 8
3334 // CHECK3-NEXT: store i64 [[DOTPREVIOUS_UB_]], ptr [[DOTPREVIOUS_UB__ADDR]], align 8
3335 // CHECK3-NEXT: store i32 0, ptr [[DOTOMP_LB]], align 4
3336 // CHECK3-NEXT: store i32 99, ptr [[DOTOMP_UB]], align 4
3337 // CHECK3-NEXT: [[TMP0:%.*]] = load i64, ptr [[DOTPREVIOUS_LB__ADDR]], align 8
3338 // CHECK3-NEXT: [[CONV:%.*]] = trunc i64 [[TMP0]] to i32
3339 // CHECK3-NEXT: [[TMP1:%.*]] = load i64, ptr [[DOTPREVIOUS_UB__ADDR]], align 8
3340 // CHECK3-NEXT: [[CONV1:%.*]] = trunc i64 [[TMP1]] to i32
3341 // CHECK3-NEXT: store i32 [[CONV]], ptr [[DOTOMP_LB]], align 4
3342 // CHECK3-NEXT: store i32 [[CONV1]], ptr [[DOTOMP_UB]], align 4
3343 // CHECK3-NEXT: store i32 1, ptr [[DOTOMP_STRIDE]], align 4
3344 // CHECK3-NEXT: store i32 0, ptr [[DOTOMP_IS_LAST]], align 4
3345 // CHECK3-NEXT: [[TMP2:%.*]] = load ptr, ptr [[DOTGLOBAL_TID__ADDR]], align 8
3346 // CHECK3-NEXT: [[TMP3:%.*]] = load i32, ptr [[TMP2]], align 4
3347 // CHECK3-NEXT: call void @__kmpc_for_static_init_4(ptr @[[GLOB2]], i32 [[TMP3]], i32 34, ptr [[DOTOMP_IS_LAST]], ptr [[DOTOMP_LB]], ptr [[DOTOMP_UB]], ptr [[DOTOMP_STRIDE]], i32 1, i32 1)
3348 // CHECK3-NEXT: [[TMP4:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4
3349 // CHECK3-NEXT: [[CMP:%.*]] = icmp sgt i32 [[TMP4]], 99
3350 // CHECK3-NEXT: br i1 [[CMP]], label [[COND_TRUE:%.*]], label [[COND_FALSE:%.*]]
3351 // CHECK3: cond.true:
3352 // CHECK3-NEXT: br label [[COND_END:%.*]]
3353 // CHECK3: cond.false:
3354 // CHECK3-NEXT: [[TMP5:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4
3355 // CHECK3-NEXT: br label [[COND_END]]
3356 // CHECK3: cond.end:
3357 // CHECK3-NEXT: [[COND:%.*]] = phi i32 [ 99, [[COND_TRUE]] ], [ [[TMP5]], [[COND_FALSE]] ]
3358 // CHECK3-NEXT: store i32 [[COND]], ptr [[DOTOMP_UB]], align 4
3359 // CHECK3-NEXT: [[TMP6:%.*]] = load i32, ptr [[DOTOMP_LB]], align 4
3360 // CHECK3-NEXT: store i32 [[TMP6]], ptr [[DOTOMP_IV]], align 4
3361 // CHECK3-NEXT: br label [[OMP_INNER_FOR_COND:%.*]]
3362 // CHECK3: omp.inner.for.cond:
3363 // CHECK3-NEXT: [[TMP7:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4
3364 // CHECK3-NEXT: [[TMP8:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4
3365 // CHECK3-NEXT: [[CMP2:%.*]] = icmp sle i32 [[TMP7]], [[TMP8]]
3366 // CHECK3-NEXT: br i1 [[CMP2]], label [[OMP_INNER_FOR_BODY:%.*]], label [[OMP_INNER_FOR_END:%.*]]
3367 // CHECK3: omp.inner.for.body:
3368 // CHECK3-NEXT: [[TMP9:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4
3369 // CHECK3-NEXT: [[MUL:%.*]] = mul nsw i32 [[TMP9]], 1
3370 // CHECK3-NEXT: [[ADD:%.*]] = add nsw i32 0, [[MUL]]
3371 // CHECK3-NEXT: store i32 [[ADD]], ptr [[I]], align 4
3372 // CHECK3-NEXT: call void @_Z3fn2v()
3373 // CHECK3-NEXT: br label [[OMP_BODY_CONTINUE:%.*]]
3374 // CHECK3: omp.body.continue:
3375 // CHECK3-NEXT: br label [[OMP_INNER_FOR_INC:%.*]]
3376 // CHECK3: omp.inner.for.inc:
3377 // CHECK3-NEXT: [[TMP10:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4
3378 // CHECK3-NEXT: [[ADD3:%.*]] = add nsw i32 [[TMP10]], 1
3379 // CHECK3-NEXT: store i32 [[ADD3]], ptr [[DOTOMP_IV]], align 4
3380 // CHECK3-NEXT: br label [[OMP_INNER_FOR_COND]], !llvm.loop [[LOOP54:![0-9]+]]
3381 // CHECK3: omp.inner.for.end:
3382 // CHECK3-NEXT: br label [[OMP_LOOP_EXIT:%.*]]
3383 // CHECK3: omp.loop.exit:
3384 // CHECK3-NEXT: call void @__kmpc_for_static_fini(ptr @[[GLOB1]], i32 [[TMP3]])
3385 // CHECK3-NEXT: [[TMP11:%.*]] = load i32, ptr [[DOTOMP_IS_LAST]], align 4
3386 // CHECK3-NEXT: [[TMP12:%.*]] = icmp ne i32 [[TMP11]], 0
3387 // CHECK3-NEXT: br i1 [[TMP12]], label [[DOTOMP_FINAL_THEN:%.*]], label [[DOTOMP_FINAL_DONE:%.*]]
3388 // CHECK3: .omp.final.then:
3389 // CHECK3-NEXT: store i32 100, ptr [[I]], align 4
3390 // CHECK3-NEXT: br label [[DOTOMP_FINAL_DONE]]
3391 // CHECK3: .omp.final.done:
3392 // CHECK3-NEXT: ret void
3395 // CHECK3-LABEL: define {{[^@]+}}@{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z5tmainIiEiT__l71
3396 // CHECK3-SAME: (i64 noundef [[ARG:%.*]]) #[[ATTR1]] {
3397 // CHECK3-NEXT: entry:
3398 // CHECK3-NEXT: [[ARG_ADDR:%.*]] = alloca i64, align 8
3399 // CHECK3-NEXT: store i64 [[ARG]], ptr [[ARG_ADDR]], align 8
3400 // CHECK3-NEXT: call void (ptr, i32, ptr, ...) @__kmpc_fork_teams(ptr @[[GLOB3]], i32 1, ptr @{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z5tmainIiEiT__l71.omp_outlined, ptr [[ARG_ADDR]])
3401 // CHECK3-NEXT: ret void
3404 // CHECK3-LABEL: define {{[^@]+}}@{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z5tmainIiEiT__l71.omp_outlined
3405 // CHECK3-SAME: (ptr noalias noundef [[DOTGLOBAL_TID_:%.*]], ptr noalias noundef [[DOTBOUND_TID_:%.*]], ptr noundef nonnull align 4 dereferenceable(4) [[ARG:%.*]]) #[[ATTR1]] {
3406 // CHECK3-NEXT: entry:
3407 // CHECK3-NEXT: [[DOTGLOBAL_TID__ADDR:%.*]] = alloca ptr, align 8
3408 // CHECK3-NEXT: [[DOTBOUND_TID__ADDR:%.*]] = alloca ptr, align 8
3409 // CHECK3-NEXT: [[ARG_ADDR:%.*]] = alloca ptr, align 8
3410 // CHECK3-NEXT: [[DOTOMP_IV:%.*]] = alloca i32, align 4
3411 // CHECK3-NEXT: [[TMP:%.*]] = alloca i32, align 4
3412 // CHECK3-NEXT: [[DOTOMP_COMB_LB:%.*]] = alloca i32, align 4
3413 // CHECK3-NEXT: [[DOTOMP_COMB_UB:%.*]] = alloca i32, align 4
3414 // CHECK3-NEXT: [[DOTOMP_STRIDE:%.*]] = alloca i32, align 4
3415 // CHECK3-NEXT: [[DOTOMP_IS_LAST:%.*]] = alloca i32, align 4
3416 // CHECK3-NEXT: [[I:%.*]] = alloca i32, align 4
3417 // CHECK3-NEXT: [[DOTBOUND_ZERO_ADDR:%.*]] = alloca i32, align 4
3418 // CHECK3-NEXT: store ptr [[DOTGLOBAL_TID_]], ptr [[DOTGLOBAL_TID__ADDR]], align 8
3419 // CHECK3-NEXT: store ptr [[DOTBOUND_TID_]], ptr [[DOTBOUND_TID__ADDR]], align 8
3420 // CHECK3-NEXT: store ptr [[ARG]], ptr [[ARG_ADDR]], align 8
3421 // CHECK3-NEXT: [[TMP0:%.*]] = load ptr, ptr [[ARG_ADDR]], align 8
3422 // CHECK3-NEXT: store i32 0, ptr [[DOTOMP_COMB_LB]], align 4
3423 // CHECK3-NEXT: store i32 99, ptr [[DOTOMP_COMB_UB]], align 4
3424 // CHECK3-NEXT: store i32 1, ptr [[DOTOMP_STRIDE]], align 4
3425 // CHECK3-NEXT: store i32 0, ptr [[DOTOMP_IS_LAST]], align 4
3426 // CHECK3-NEXT: [[TMP1:%.*]] = load ptr, ptr [[DOTGLOBAL_TID__ADDR]], align 8
3427 // CHECK3-NEXT: [[TMP2:%.*]] = load i32, ptr [[TMP1]], align 4
3428 // CHECK3-NEXT: call void @__kmpc_for_static_init_4(ptr @[[GLOB1]], i32 [[TMP2]], i32 92, ptr [[DOTOMP_IS_LAST]], ptr [[DOTOMP_COMB_LB]], ptr [[DOTOMP_COMB_UB]], ptr [[DOTOMP_STRIDE]], i32 1, i32 1)
3429 // CHECK3-NEXT: [[TMP3:%.*]] = load i32, ptr [[DOTOMP_COMB_UB]], align 4
3430 // CHECK3-NEXT: [[CMP:%.*]] = icmp sgt i32 [[TMP3]], 99
3431 // CHECK3-NEXT: br i1 [[CMP]], label [[COND_TRUE:%.*]], label [[COND_FALSE:%.*]]
3432 // CHECK3: cond.true:
3433 // CHECK3-NEXT: br label [[COND_END:%.*]]
3434 // CHECK3: cond.false:
3435 // CHECK3-NEXT: [[TMP4:%.*]] = load i32, ptr [[DOTOMP_COMB_UB]], align 4
3436 // CHECK3-NEXT: br label [[COND_END]]
3437 // CHECK3: cond.end:
3438 // CHECK3-NEXT: [[COND:%.*]] = phi i32 [ 99, [[COND_TRUE]] ], [ [[TMP4]], [[COND_FALSE]] ]
3439 // CHECK3-NEXT: store i32 [[COND]], ptr [[DOTOMP_COMB_UB]], align 4
3440 // CHECK3-NEXT: [[TMP5:%.*]] = load i32, ptr [[DOTOMP_COMB_LB]], align 4
3441 // CHECK3-NEXT: store i32 [[TMP5]], ptr [[DOTOMP_IV]], align 4
3442 // CHECK3-NEXT: br label [[OMP_INNER_FOR_COND:%.*]]
3443 // CHECK3: omp.inner.for.cond:
3444 // CHECK3-NEXT: [[TMP6:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP55:![0-9]+]]
3445 // CHECK3-NEXT: [[TMP7:%.*]] = load i32, ptr [[DOTOMP_COMB_UB]], align 4, !llvm.access.group [[ACC_GRP55]]
3446 // CHECK3-NEXT: [[CMP1:%.*]] = icmp sle i32 [[TMP6]], [[TMP7]]
3447 // CHECK3-NEXT: br i1 [[CMP1]], label [[OMP_INNER_FOR_BODY:%.*]], label [[OMP_INNER_FOR_END:%.*]]
3448 // CHECK3: omp.inner.for.body:
3449 // CHECK3-NEXT: [[TMP8:%.*]] = load i32, ptr [[DOTOMP_COMB_LB]], align 4, !llvm.access.group [[ACC_GRP55]]
3450 // CHECK3-NEXT: [[TMP9:%.*]] = zext i32 [[TMP8]] to i64
3451 // CHECK3-NEXT: [[TMP10:%.*]] = load i32, ptr [[DOTOMP_COMB_UB]], align 4, !llvm.access.group [[ACC_GRP55]]
3452 // CHECK3-NEXT: [[TMP11:%.*]] = zext i32 [[TMP10]] to i64
3453 // CHECK3-NEXT: [[TMP12:%.*]] = load i32, ptr [[TMP0]], align 4, !llvm.access.group [[ACC_GRP55]]
3454 // CHECK3-NEXT: [[TOBOOL:%.*]] = icmp ne i32 [[TMP12]], 0
3455 // CHECK3-NEXT: br i1 [[TOBOOL]], label [[OMP_IF_THEN:%.*]], label [[OMP_IF_ELSE:%.*]]
3456 // CHECK3: omp_if.then:
3457 // CHECK3-NEXT: call void (ptr, i32, ptr, ...) @__kmpc_fork_call(ptr @[[GLOB3]], i32 2, ptr @{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z5tmainIiEiT__l71.omp_outlined.omp_outlined, i64 [[TMP9]], i64 [[TMP11]]), !llvm.access.group [[ACC_GRP55]]
3458 // CHECK3-NEXT: br label [[OMP_IF_END:%.*]]
3459 // CHECK3: omp_if.else:
3460 // CHECK3-NEXT: call void @__kmpc_serialized_parallel(ptr @[[GLOB3]], i32 [[TMP2]]), !llvm.access.group [[ACC_GRP55]]
3461 // CHECK3-NEXT: [[TMP13:%.*]] = load ptr, ptr [[DOTGLOBAL_TID__ADDR]], align 8, !llvm.access.group [[ACC_GRP55]]
3462 // CHECK3-NEXT: store i32 0, ptr [[DOTBOUND_ZERO_ADDR]], align 4, !llvm.access.group [[ACC_GRP55]]
3463 // CHECK3-NEXT: call void @{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z5tmainIiEiT__l71.omp_outlined.omp_outlined(ptr [[TMP13]], ptr [[DOTBOUND_ZERO_ADDR]], i64 [[TMP9]], i64 [[TMP11]]) #[[ATTR2]], !llvm.access.group [[ACC_GRP55]]
3464 // CHECK3-NEXT: call void @__kmpc_end_serialized_parallel(ptr @[[GLOB3]], i32 [[TMP2]]), !llvm.access.group [[ACC_GRP55]]
3465 // CHECK3-NEXT: br label [[OMP_IF_END]]
3466 // CHECK3: omp_if.end:
3467 // CHECK3-NEXT: br label [[OMP_INNER_FOR_INC:%.*]]
3468 // CHECK3: omp.inner.for.inc:
3469 // CHECK3-NEXT: [[TMP14:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP55]]
3470 // CHECK3-NEXT: [[TMP15:%.*]] = load i32, ptr [[DOTOMP_STRIDE]], align 4, !llvm.access.group [[ACC_GRP55]]
3471 // CHECK3-NEXT: [[ADD:%.*]] = add nsw i32 [[TMP14]], [[TMP15]]
3472 // CHECK3-NEXT: store i32 [[ADD]], ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP55]]
3473 // CHECK3-NEXT: br label [[OMP_INNER_FOR_COND]], !llvm.loop [[LOOP56:![0-9]+]]
3474 // CHECK3: omp.inner.for.end:
3475 // CHECK3-NEXT: br label [[OMP_LOOP_EXIT:%.*]]
3476 // CHECK3: omp.loop.exit:
3477 // CHECK3-NEXT: call void @__kmpc_for_static_fini(ptr @[[GLOB1]], i32 [[TMP2]])
3478 // CHECK3-NEXT: [[TMP16:%.*]] = load i32, ptr [[DOTOMP_IS_LAST]], align 4
3479 // CHECK3-NEXT: [[TMP17:%.*]] = icmp ne i32 [[TMP16]], 0
3480 // CHECK3-NEXT: br i1 [[TMP17]], label [[DOTOMP_FINAL_THEN:%.*]], label [[DOTOMP_FINAL_DONE:%.*]]
3481 // CHECK3: .omp.final.then:
3482 // CHECK3-NEXT: store i32 100, ptr [[I]], align 4
3483 // CHECK3-NEXT: br label [[DOTOMP_FINAL_DONE]]
3484 // CHECK3: .omp.final.done:
3485 // CHECK3-NEXT: ret void
3488 // CHECK3-LABEL: define {{[^@]+}}@{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z5tmainIiEiT__l71.omp_outlined.omp_outlined
3489 // CHECK3-SAME: (ptr noalias noundef [[DOTGLOBAL_TID_:%.*]], ptr noalias noundef [[DOTBOUND_TID_:%.*]], i64 noundef [[DOTPREVIOUS_LB_:%.*]], i64 noundef [[DOTPREVIOUS_UB_:%.*]]) #[[ATTR1]] {
3490 // CHECK3-NEXT: entry:
3491 // CHECK3-NEXT: [[DOTGLOBAL_TID__ADDR:%.*]] = alloca ptr, align 8
3492 // CHECK3-NEXT: [[DOTBOUND_TID__ADDR:%.*]] = alloca ptr, align 8
3493 // CHECK3-NEXT: [[DOTPREVIOUS_LB__ADDR:%.*]] = alloca i64, align 8
3494 // CHECK3-NEXT: [[DOTPREVIOUS_UB__ADDR:%.*]] = alloca i64, align 8
3495 // CHECK3-NEXT: [[DOTOMP_IV:%.*]] = alloca i32, align 4
3496 // CHECK3-NEXT: [[TMP:%.*]] = alloca i32, align 4
3497 // CHECK3-NEXT: [[DOTOMP_LB:%.*]] = alloca i32, align 4
3498 // CHECK3-NEXT: [[DOTOMP_UB:%.*]] = alloca i32, align 4
3499 // CHECK3-NEXT: [[DOTOMP_STRIDE:%.*]] = alloca i32, align 4
3500 // CHECK3-NEXT: [[DOTOMP_IS_LAST:%.*]] = alloca i32, align 4
3501 // CHECK3-NEXT: [[I:%.*]] = alloca i32, align 4
3502 // CHECK3-NEXT: store ptr [[DOTGLOBAL_TID_]], ptr [[DOTGLOBAL_TID__ADDR]], align 8
3503 // CHECK3-NEXT: store ptr [[DOTBOUND_TID_]], ptr [[DOTBOUND_TID__ADDR]], align 8
3504 // CHECK3-NEXT: store i64 [[DOTPREVIOUS_LB_]], ptr [[DOTPREVIOUS_LB__ADDR]], align 8
3505 // CHECK3-NEXT: store i64 [[DOTPREVIOUS_UB_]], ptr [[DOTPREVIOUS_UB__ADDR]], align 8
3506 // CHECK3-NEXT: store i32 0, ptr [[DOTOMP_LB]], align 4
3507 // CHECK3-NEXT: store i32 99, ptr [[DOTOMP_UB]], align 4
3508 // CHECK3-NEXT: [[TMP0:%.*]] = load i64, ptr [[DOTPREVIOUS_LB__ADDR]], align 8
3509 // CHECK3-NEXT: [[CONV:%.*]] = trunc i64 [[TMP0]] to i32
3510 // CHECK3-NEXT: [[TMP1:%.*]] = load i64, ptr [[DOTPREVIOUS_UB__ADDR]], align 8
3511 // CHECK3-NEXT: [[CONV1:%.*]] = trunc i64 [[TMP1]] to i32
3512 // CHECK3-NEXT: store i32 [[CONV]], ptr [[DOTOMP_LB]], align 4
3513 // CHECK3-NEXT: store i32 [[CONV1]], ptr [[DOTOMP_UB]], align 4
3514 // CHECK3-NEXT: store i32 1, ptr [[DOTOMP_STRIDE]], align 4
3515 // CHECK3-NEXT: store i32 0, ptr [[DOTOMP_IS_LAST]], align 4
3516 // CHECK3-NEXT: [[TMP2:%.*]] = load ptr, ptr [[DOTGLOBAL_TID__ADDR]], align 8
3517 // CHECK3-NEXT: [[TMP3:%.*]] = load i32, ptr [[TMP2]], align 4
3518 // CHECK3-NEXT: call void @__kmpc_for_static_init_4(ptr @[[GLOB2]], i32 [[TMP3]], i32 34, ptr [[DOTOMP_IS_LAST]], ptr [[DOTOMP_LB]], ptr [[DOTOMP_UB]], ptr [[DOTOMP_STRIDE]], i32 1, i32 1)
3519 // CHECK3-NEXT: [[TMP4:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4
3520 // CHECK3-NEXT: [[CMP:%.*]] = icmp sgt i32 [[TMP4]], 99
3521 // CHECK3-NEXT: br i1 [[CMP]], label [[COND_TRUE:%.*]], label [[COND_FALSE:%.*]]
3522 // CHECK3: cond.true:
3523 // CHECK3-NEXT: br label [[COND_END:%.*]]
3524 // CHECK3: cond.false:
3525 // CHECK3-NEXT: [[TMP5:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4
3526 // CHECK3-NEXT: br label [[COND_END]]
3527 // CHECK3: cond.end:
3528 // CHECK3-NEXT: [[COND:%.*]] = phi i32 [ 99, [[COND_TRUE]] ], [ [[TMP5]], [[COND_FALSE]] ]
3529 // CHECK3-NEXT: store i32 [[COND]], ptr [[DOTOMP_UB]], align 4
3530 // CHECK3-NEXT: [[TMP6:%.*]] = load i32, ptr [[DOTOMP_LB]], align 4
3531 // CHECK3-NEXT: store i32 [[TMP6]], ptr [[DOTOMP_IV]], align 4
3532 // CHECK3-NEXT: br label [[OMP_INNER_FOR_COND:%.*]]
3533 // CHECK3: omp.inner.for.cond:
3534 // CHECK3-NEXT: [[TMP7:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP58:![0-9]+]]
3535 // CHECK3-NEXT: [[TMP8:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4, !llvm.access.group [[ACC_GRP58]]
3536 // CHECK3-NEXT: [[CMP2:%.*]] = icmp sle i32 [[TMP7]], [[TMP8]]
3537 // CHECK3-NEXT: br i1 [[CMP2]], label [[OMP_INNER_FOR_BODY:%.*]], label [[OMP_INNER_FOR_END:%.*]]
3538 // CHECK3: omp.inner.for.body:
3539 // CHECK3-NEXT: [[TMP9:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP58]]
3540 // CHECK3-NEXT: [[MUL:%.*]] = mul nsw i32 [[TMP9]], 1
3541 // CHECK3-NEXT: [[ADD:%.*]] = add nsw i32 0, [[MUL]]
3542 // CHECK3-NEXT: store i32 [[ADD]], ptr [[I]], align 4, !llvm.access.group [[ACC_GRP58]]
3543 // CHECK3-NEXT: call void @_Z3fn3v(), !llvm.access.group [[ACC_GRP58]]
3544 // CHECK3-NEXT: br label [[OMP_BODY_CONTINUE:%.*]]
3545 // CHECK3: omp.body.continue:
3546 // CHECK3-NEXT: br label [[OMP_INNER_FOR_INC:%.*]]
3547 // CHECK3: omp.inner.for.inc:
3548 // CHECK3-NEXT: [[TMP10:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP58]]
3549 // CHECK3-NEXT: [[ADD3:%.*]] = add nsw i32 [[TMP10]], 1
3550 // CHECK3-NEXT: store i32 [[ADD3]], ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP58]]
3551 // CHECK3-NEXT: br label [[OMP_INNER_FOR_COND]], !llvm.loop [[LOOP59:![0-9]+]]
3552 // CHECK3: omp.inner.for.end:
3553 // CHECK3-NEXT: br label [[OMP_LOOP_EXIT:%.*]]
3554 // CHECK3: omp.loop.exit:
3555 // CHECK3-NEXT: call void @__kmpc_for_static_fini(ptr @[[GLOB1]], i32 [[TMP3]])
3556 // CHECK3-NEXT: [[TMP11:%.*]] = load i32, ptr [[DOTOMP_IS_LAST]], align 4
3557 // CHECK3-NEXT: [[TMP12:%.*]] = icmp ne i32 [[TMP11]], 0
3558 // CHECK3-NEXT: br i1 [[TMP12]], label [[DOTOMP_FINAL_THEN:%.*]], label [[DOTOMP_FINAL_DONE:%.*]]
3559 // CHECK3: .omp.final.then:
3560 // CHECK3-NEXT: store i32 100, ptr [[I]], align 4
3561 // CHECK3-NEXT: br label [[DOTOMP_FINAL_DONE]]
3562 // CHECK3: .omp.final.done:
3563 // CHECK3-NEXT: ret void
3566 // CHECK3-LABEL: define {{[^@]+}}@.omp_offloading.requires_reg
3567 // CHECK3-SAME: () #[[ATTR5:[0-9]+]] {
3568 // CHECK3-NEXT: entry:
3569 // CHECK3-NEXT: call void @__tgt_register_requires(i64 1)
3570 // CHECK3-NEXT: ret void
3573 // CHECK5-LABEL: define {{[^@]+}}@_Z9gtid_testv
3574 // CHECK5-SAME: () #[[ATTR0:[0-9]+]] {
3575 // CHECK5-NEXT: entry:
3576 // CHECK5-NEXT: [[TMP:%.*]] = alloca i32, align 4
3577 // CHECK5-NEXT: [[DOTOMP_LB:%.*]] = alloca i32, align 4
3578 // CHECK5-NEXT: [[DOTOMP_UB:%.*]] = alloca i32, align 4
3579 // CHECK5-NEXT: [[DOTOMP_IV:%.*]] = alloca i32, align 4
3580 // CHECK5-NEXT: [[I:%.*]] = alloca i32, align 4
3581 // CHECK5-NEXT: [[_TMP2:%.*]] = alloca i32, align 4
3582 // CHECK5-NEXT: [[DOTOMP_LB3:%.*]] = alloca i32, align 4
3583 // CHECK5-NEXT: [[DOTOMP_UB4:%.*]] = alloca i32, align 4
3584 // CHECK5-NEXT: [[DOTOMP_IV5:%.*]] = alloca i32, align 4
3585 // CHECK5-NEXT: [[I6:%.*]] = alloca i32, align 4
3586 // CHECK5-NEXT: store i32 0, ptr [[DOTOMP_LB]], align 4
3587 // CHECK5-NEXT: store i32 99, ptr [[DOTOMP_UB]], align 4
3588 // CHECK5-NEXT: [[TMP0:%.*]] = load i32, ptr [[DOTOMP_LB]], align 4
3589 // CHECK5-NEXT: store i32 [[TMP0]], ptr [[DOTOMP_IV]], align 4
3590 // CHECK5-NEXT: br label [[OMP_INNER_FOR_COND:%.*]]
3591 // CHECK5: omp.inner.for.cond:
3592 // CHECK5-NEXT: [[TMP1:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP2:![0-9]+]]
3593 // CHECK5-NEXT: [[TMP2:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4, !llvm.access.group [[ACC_GRP2]]
3594 // CHECK5-NEXT: [[CMP:%.*]] = icmp sle i32 [[TMP1]], [[TMP2]]
3595 // CHECK5-NEXT: br i1 [[CMP]], label [[OMP_INNER_FOR_BODY:%.*]], label [[OMP_INNER_FOR_END:%.*]]
3596 // CHECK5: omp.inner.for.body:
3597 // CHECK5-NEXT: [[TMP3:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP2]]
3598 // CHECK5-NEXT: [[MUL:%.*]] = mul nsw i32 [[TMP3]], 1
3599 // CHECK5-NEXT: [[ADD:%.*]] = add nsw i32 0, [[MUL]]
3600 // CHECK5-NEXT: store i32 [[ADD]], ptr [[I]], align 4, !llvm.access.group [[ACC_GRP2]]
3601 // CHECK5-NEXT: br label [[OMP_BODY_CONTINUE:%.*]]
3602 // CHECK5: omp.body.continue:
3603 // CHECK5-NEXT: br label [[OMP_INNER_FOR_INC:%.*]]
3604 // CHECK5: omp.inner.for.inc:
3605 // CHECK5-NEXT: [[TMP4:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP2]]
3606 // CHECK5-NEXT: [[ADD1:%.*]] = add nsw i32 [[TMP4]], 1
3607 // CHECK5-NEXT: store i32 [[ADD1]], ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP2]]
3608 // CHECK5-NEXT: br label [[OMP_INNER_FOR_COND]], !llvm.loop [[LOOP3:![0-9]+]]
3609 // CHECK5: omp.inner.for.end:
3610 // CHECK5-NEXT: store i32 100, ptr [[I]], align 4
3611 // CHECK5-NEXT: store i32 0, ptr [[DOTOMP_LB3]], align 4
3612 // CHECK5-NEXT: store i32 99, ptr [[DOTOMP_UB4]], align 4
3613 // CHECK5-NEXT: [[TMP5:%.*]] = load i32, ptr [[DOTOMP_LB3]], align 4
3614 // CHECK5-NEXT: store i32 [[TMP5]], ptr [[DOTOMP_IV5]], align 4
3615 // CHECK5-NEXT: br label [[OMP_INNER_FOR_COND7:%.*]]
3616 // CHECK5: omp.inner.for.cond7:
3617 // CHECK5-NEXT: [[TMP6:%.*]] = load i32, ptr [[DOTOMP_IV5]], align 4, !llvm.access.group [[ACC_GRP6:![0-9]+]]
3618 // CHECK5-NEXT: [[TMP7:%.*]] = load i32, ptr [[DOTOMP_UB4]], align 4, !llvm.access.group [[ACC_GRP6]]
3619 // CHECK5-NEXT: [[CMP8:%.*]] = icmp sle i32 [[TMP6]], [[TMP7]]
3620 // CHECK5-NEXT: br i1 [[CMP8]], label [[OMP_INNER_FOR_BODY9:%.*]], label [[OMP_INNER_FOR_END15:%.*]]
3621 // CHECK5: omp.inner.for.body9:
3622 // CHECK5-NEXT: [[TMP8:%.*]] = load i32, ptr [[DOTOMP_IV5]], align 4, !llvm.access.group [[ACC_GRP6]]
3623 // CHECK5-NEXT: [[MUL10:%.*]] = mul nsw i32 [[TMP8]], 1
3624 // CHECK5-NEXT: [[ADD11:%.*]] = add nsw i32 0, [[MUL10]]
3625 // CHECK5-NEXT: store i32 [[ADD11]], ptr [[I6]], align 4, !llvm.access.group [[ACC_GRP6]]
3626 // CHECK5-NEXT: call void @_Z9gtid_testv(), !llvm.access.group [[ACC_GRP6]]
3627 // CHECK5-NEXT: br label [[OMP_BODY_CONTINUE12:%.*]]
3628 // CHECK5: omp.body.continue12:
3629 // CHECK5-NEXT: br label [[OMP_INNER_FOR_INC13:%.*]]
3630 // CHECK5: omp.inner.for.inc13:
3631 // CHECK5-NEXT: [[TMP9:%.*]] = load i32, ptr [[DOTOMP_IV5]], align 4, !llvm.access.group [[ACC_GRP6]]
3632 // CHECK5-NEXT: [[ADD14:%.*]] = add nsw i32 [[TMP9]], 1
3633 // CHECK5-NEXT: store i32 [[ADD14]], ptr [[DOTOMP_IV5]], align 4, !llvm.access.group [[ACC_GRP6]]
3634 // CHECK5-NEXT: br label [[OMP_INNER_FOR_COND7]], !llvm.loop [[LOOP7:![0-9]+]]
3635 // CHECK5: omp.inner.for.end15:
3636 // CHECK5-NEXT: store i32 100, ptr [[I6]], align 4
3637 // CHECK5-NEXT: ret void
3640 // CHECK5-LABEL: define {{[^@]+}}@main
3641 // CHECK5-SAME: () #[[ATTR1:[0-9]+]] {
3642 // CHECK5-NEXT: entry:
3643 // CHECK5-NEXT: [[RETVAL:%.*]] = alloca i32, align 4
3644 // CHECK5-NEXT: [[TMP:%.*]] = alloca i32, align 4
3645 // CHECK5-NEXT: [[DOTOMP_LB:%.*]] = alloca i32, align 4
3646 // CHECK5-NEXT: [[DOTOMP_UB:%.*]] = alloca i32, align 4
3647 // CHECK5-NEXT: [[DOTOMP_IV:%.*]] = alloca i32, align 4
3648 // CHECK5-NEXT: [[I:%.*]] = alloca i32, align 4
3649 // CHECK5-NEXT: [[_TMP2:%.*]] = alloca i32, align 4
3650 // CHECK5-NEXT: [[DOTOMP_LB3:%.*]] = alloca i32, align 4
3651 // CHECK5-NEXT: [[DOTOMP_UB4:%.*]] = alloca i32, align 4
3652 // CHECK5-NEXT: [[DOTOMP_IV5:%.*]] = alloca i32, align 4
3653 // CHECK5-NEXT: [[I6:%.*]] = alloca i32, align 4
3654 // CHECK5-NEXT: [[_TMP16:%.*]] = alloca i32, align 4
3655 // CHECK5-NEXT: [[DOTOMP_LB17:%.*]] = alloca i32, align 4
3656 // CHECK5-NEXT: [[DOTOMP_UB18:%.*]] = alloca i32, align 4
3657 // CHECK5-NEXT: [[DOTOMP_IV19:%.*]] = alloca i32, align 4
3658 // CHECK5-NEXT: [[I20:%.*]] = alloca i32, align 4
3659 // CHECK5-NEXT: store i32 0, ptr [[RETVAL]], align 4
3660 // CHECK5-NEXT: store i32 0, ptr [[DOTOMP_LB]], align 4
3661 // CHECK5-NEXT: store i32 99, ptr [[DOTOMP_UB]], align 4
3662 // CHECK5-NEXT: [[TMP0:%.*]] = load i32, ptr [[DOTOMP_LB]], align 4
3663 // CHECK5-NEXT: store i32 [[TMP0]], ptr [[DOTOMP_IV]], align 4
3664 // CHECK5-NEXT: br label [[OMP_INNER_FOR_COND:%.*]]
3665 // CHECK5: omp.inner.for.cond:
3666 // CHECK5-NEXT: [[TMP1:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP9:![0-9]+]]
3667 // CHECK5-NEXT: [[TMP2:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4, !llvm.access.group [[ACC_GRP9]]
3668 // CHECK5-NEXT: [[CMP:%.*]] = icmp sle i32 [[TMP1]], [[TMP2]]
3669 // CHECK5-NEXT: br i1 [[CMP]], label [[OMP_INNER_FOR_BODY:%.*]], label [[OMP_INNER_FOR_END:%.*]]
3670 // CHECK5: omp.inner.for.body:
3671 // CHECK5-NEXT: [[TMP3:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP9]]
3672 // CHECK5-NEXT: [[MUL:%.*]] = mul nsw i32 [[TMP3]], 1
3673 // CHECK5-NEXT: [[ADD:%.*]] = add nsw i32 0, [[MUL]]
3674 // CHECK5-NEXT: store i32 [[ADD]], ptr [[I]], align 4, !llvm.access.group [[ACC_GRP9]]
3675 // CHECK5-NEXT: call void @_Z3fn4v(), !llvm.access.group [[ACC_GRP9]]
3676 // CHECK5-NEXT: br label [[OMP_BODY_CONTINUE:%.*]]
3677 // CHECK5: omp.body.continue:
3678 // CHECK5-NEXT: br label [[OMP_INNER_FOR_INC:%.*]]
3679 // CHECK5: omp.inner.for.inc:
3680 // CHECK5-NEXT: [[TMP4:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP9]]
3681 // CHECK5-NEXT: [[ADD1:%.*]] = add nsw i32 [[TMP4]], 1
3682 // CHECK5-NEXT: store i32 [[ADD1]], ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP9]]
3683 // CHECK5-NEXT: br label [[OMP_INNER_FOR_COND]], !llvm.loop [[LOOP10:![0-9]+]]
3684 // CHECK5: omp.inner.for.end:
3685 // CHECK5-NEXT: store i32 100, ptr [[I]], align 4
3686 // CHECK5-NEXT: store i32 0, ptr [[DOTOMP_LB3]], align 4
3687 // CHECK5-NEXT: store i32 99, ptr [[DOTOMP_UB4]], align 4
3688 // CHECK5-NEXT: [[TMP5:%.*]] = load i32, ptr [[DOTOMP_LB3]], align 4
3689 // CHECK5-NEXT: store i32 [[TMP5]], ptr [[DOTOMP_IV5]], align 4
3690 // CHECK5-NEXT: br label [[OMP_INNER_FOR_COND7:%.*]]
3691 // CHECK5: omp.inner.for.cond7:
3692 // CHECK5-NEXT: [[TMP6:%.*]] = load i32, ptr [[DOTOMP_IV5]], align 4, !llvm.access.group [[ACC_GRP12:![0-9]+]]
3693 // CHECK5-NEXT: [[TMP7:%.*]] = load i32, ptr [[DOTOMP_UB4]], align 4, !llvm.access.group [[ACC_GRP12]]
3694 // CHECK5-NEXT: [[CMP8:%.*]] = icmp sle i32 [[TMP6]], [[TMP7]]
3695 // CHECK5-NEXT: br i1 [[CMP8]], label [[OMP_INNER_FOR_BODY9:%.*]], label [[OMP_INNER_FOR_END15:%.*]]
3696 // CHECK5: omp.inner.for.body9:
3697 // CHECK5-NEXT: [[TMP8:%.*]] = load i32, ptr [[DOTOMP_IV5]], align 4, !llvm.access.group [[ACC_GRP12]]
3698 // CHECK5-NEXT: [[MUL10:%.*]] = mul nsw i32 [[TMP8]], 1
3699 // CHECK5-NEXT: [[ADD11:%.*]] = add nsw i32 0, [[MUL10]]
3700 // CHECK5-NEXT: store i32 [[ADD11]], ptr [[I6]], align 4, !llvm.access.group [[ACC_GRP12]]
3701 // CHECK5-NEXT: call void @_Z3fn5v(), !llvm.access.group [[ACC_GRP12]]
3702 // CHECK5-NEXT: br label [[OMP_BODY_CONTINUE12:%.*]]
3703 // CHECK5: omp.body.continue12:
3704 // CHECK5-NEXT: br label [[OMP_INNER_FOR_INC13:%.*]]
3705 // CHECK5: omp.inner.for.inc13:
3706 // CHECK5-NEXT: [[TMP9:%.*]] = load i32, ptr [[DOTOMP_IV5]], align 4, !llvm.access.group [[ACC_GRP12]]
3707 // CHECK5-NEXT: [[ADD14:%.*]] = add nsw i32 [[TMP9]], 1
3708 // CHECK5-NEXT: store i32 [[ADD14]], ptr [[DOTOMP_IV5]], align 4, !llvm.access.group [[ACC_GRP12]]
3709 // CHECK5-NEXT: br label [[OMP_INNER_FOR_COND7]], !llvm.loop [[LOOP13:![0-9]+]]
3710 // CHECK5: omp.inner.for.end15:
3711 // CHECK5-NEXT: store i32 100, ptr [[I6]], align 4
3712 // CHECK5-NEXT: store i32 0, ptr [[DOTOMP_LB17]], align 4
3713 // CHECK5-NEXT: store i32 99, ptr [[DOTOMP_UB18]], align 4
3714 // CHECK5-NEXT: [[TMP10:%.*]] = load i32, ptr [[DOTOMP_LB17]], align 4
3715 // CHECK5-NEXT: store i32 [[TMP10]], ptr [[DOTOMP_IV19]], align 4
3716 // CHECK5-NEXT: br label [[OMP_INNER_FOR_COND21:%.*]]
3717 // CHECK5: omp.inner.for.cond21:
3718 // CHECK5-NEXT: [[TMP11:%.*]] = load i32, ptr [[DOTOMP_IV19]], align 4, !llvm.access.group [[ACC_GRP15:![0-9]+]]
3719 // CHECK5-NEXT: [[TMP12:%.*]] = load i32, ptr [[DOTOMP_UB18]], align 4, !llvm.access.group [[ACC_GRP15]]
3720 // CHECK5-NEXT: [[CMP22:%.*]] = icmp sle i32 [[TMP11]], [[TMP12]]
3721 // CHECK5-NEXT: br i1 [[CMP22]], label [[OMP_INNER_FOR_BODY23:%.*]], label [[OMP_INNER_FOR_END29:%.*]]
3722 // CHECK5: omp.inner.for.body23:
3723 // CHECK5-NEXT: [[TMP13:%.*]] = load i32, ptr [[DOTOMP_IV19]], align 4, !llvm.access.group [[ACC_GRP15]]
3724 // CHECK5-NEXT: [[MUL24:%.*]] = mul nsw i32 [[TMP13]], 1
3725 // CHECK5-NEXT: [[ADD25:%.*]] = add nsw i32 0, [[MUL24]]
3726 // CHECK5-NEXT: store i32 [[ADD25]], ptr [[I20]], align 4, !llvm.access.group [[ACC_GRP15]]
3727 // CHECK5-NEXT: call void @_Z3fn6v(), !llvm.access.group [[ACC_GRP15]]
3728 // CHECK5-NEXT: br label [[OMP_BODY_CONTINUE26:%.*]]
3729 // CHECK5: omp.body.continue26:
3730 // CHECK5-NEXT: br label [[OMP_INNER_FOR_INC27:%.*]]
3731 // CHECK5: omp.inner.for.inc27:
3732 // CHECK5-NEXT: [[TMP14:%.*]] = load i32, ptr [[DOTOMP_IV19]], align 4, !llvm.access.group [[ACC_GRP15]]
3733 // CHECK5-NEXT: [[ADD28:%.*]] = add nsw i32 [[TMP14]], 1
3734 // CHECK5-NEXT: store i32 [[ADD28]], ptr [[DOTOMP_IV19]], align 4, !llvm.access.group [[ACC_GRP15]]
3735 // CHECK5-NEXT: br label [[OMP_INNER_FOR_COND21]], !llvm.loop [[LOOP16:![0-9]+]]
3736 // CHECK5: omp.inner.for.end29:
3737 // CHECK5-NEXT: store i32 100, ptr [[I20]], align 4
3738 // CHECK5-NEXT: [[TMP15:%.*]] = load i32, ptr @Arg, align 4
3739 // CHECK5-NEXT: [[CALL:%.*]] = call noundef i32 @_Z5tmainIiEiT_(i32 noundef [[TMP15]])
3740 // CHECK5-NEXT: ret i32 [[CALL]]
3743 // CHECK5-LABEL: define {{[^@]+}}@_Z5tmainIiEiT_
3744 // CHECK5-SAME: (i32 noundef [[ARG:%.*]]) #[[ATTR0]] comdat {
3745 // CHECK5-NEXT: entry:
3746 // CHECK5-NEXT: [[ARG_ADDR:%.*]] = alloca i32, align 4
3747 // CHECK5-NEXT: [[TMP:%.*]] = alloca i32, align 4
3748 // CHECK5-NEXT: [[DOTOMP_LB:%.*]] = alloca i32, align 4
3749 // CHECK5-NEXT: [[DOTOMP_UB:%.*]] = alloca i32, align 4
3750 // CHECK5-NEXT: [[DOTOMP_IV:%.*]] = alloca i32, align 4
3751 // CHECK5-NEXT: [[I:%.*]] = alloca i32, align 4
3752 // CHECK5-NEXT: [[_TMP2:%.*]] = alloca i32, align 4
3753 // CHECK5-NEXT: [[DOTOMP_LB3:%.*]] = alloca i32, align 4
3754 // CHECK5-NEXT: [[DOTOMP_UB4:%.*]] = alloca i32, align 4
3755 // CHECK5-NEXT: [[DOTOMP_IV5:%.*]] = alloca i32, align 4
3756 // CHECK5-NEXT: [[I6:%.*]] = alloca i32, align 4
3757 // CHECK5-NEXT: [[_TMP16:%.*]] = alloca i32, align 4
3758 // CHECK5-NEXT: [[DOTOMP_LB17:%.*]] = alloca i32, align 4
3759 // CHECK5-NEXT: [[DOTOMP_UB18:%.*]] = alloca i32, align 4
3760 // CHECK5-NEXT: [[DOTOMP_IV19:%.*]] = alloca i32, align 4
3761 // CHECK5-NEXT: [[I20:%.*]] = alloca i32, align 4
3762 // CHECK5-NEXT: store i32 [[ARG]], ptr [[ARG_ADDR]], align 4
3763 // CHECK5-NEXT: store i32 0, ptr [[DOTOMP_LB]], align 4
3764 // CHECK5-NEXT: store i32 99, ptr [[DOTOMP_UB]], align 4
3765 // CHECK5-NEXT: [[TMP0:%.*]] = load i32, ptr [[DOTOMP_LB]], align 4
3766 // CHECK5-NEXT: store i32 [[TMP0]], ptr [[DOTOMP_IV]], align 4
3767 // CHECK5-NEXT: br label [[OMP_INNER_FOR_COND:%.*]]
3768 // CHECK5: omp.inner.for.cond:
3769 // CHECK5-NEXT: [[TMP1:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP18:![0-9]+]]
3770 // CHECK5-NEXT: [[TMP2:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4, !llvm.access.group [[ACC_GRP18]]
3771 // CHECK5-NEXT: [[CMP:%.*]] = icmp sle i32 [[TMP1]], [[TMP2]]
3772 // CHECK5-NEXT: br i1 [[CMP]], label [[OMP_INNER_FOR_BODY:%.*]], label [[OMP_INNER_FOR_END:%.*]]
3773 // CHECK5: omp.inner.for.body:
3774 // CHECK5-NEXT: [[TMP3:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP18]]
3775 // CHECK5-NEXT: [[MUL:%.*]] = mul nsw i32 [[TMP3]], 1
3776 // CHECK5-NEXT: [[ADD:%.*]] = add nsw i32 0, [[MUL]]
3777 // CHECK5-NEXT: store i32 [[ADD]], ptr [[I]], align 4, !llvm.access.group [[ACC_GRP18]]
3778 // CHECK5-NEXT: call void @_Z3fn1v(), !llvm.access.group [[ACC_GRP18]]
3779 // CHECK5-NEXT: br label [[OMP_BODY_CONTINUE:%.*]]
3780 // CHECK5: omp.body.continue:
3781 // CHECK5-NEXT: br label [[OMP_INNER_FOR_INC:%.*]]
3782 // CHECK5: omp.inner.for.inc:
3783 // CHECK5-NEXT: [[TMP4:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP18]]
3784 // CHECK5-NEXT: [[ADD1:%.*]] = add nsw i32 [[TMP4]], 1
3785 // CHECK5-NEXT: store i32 [[ADD1]], ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP18]]
3786 // CHECK5-NEXT: br label [[OMP_INNER_FOR_COND]], !llvm.loop [[LOOP19:![0-9]+]]
3787 // CHECK5: omp.inner.for.end:
3788 // CHECK5-NEXT: store i32 100, ptr [[I]], align 4
3789 // CHECK5-NEXT: store i32 0, ptr [[DOTOMP_LB3]], align 4
3790 // CHECK5-NEXT: store i32 99, ptr [[DOTOMP_UB4]], align 4
3791 // CHECK5-NEXT: [[TMP5:%.*]] = load i32, ptr [[DOTOMP_LB3]], align 4
3792 // CHECK5-NEXT: store i32 [[TMP5]], ptr [[DOTOMP_IV5]], align 4
3793 // CHECK5-NEXT: br label [[OMP_INNER_FOR_COND7:%.*]]
3794 // CHECK5: omp.inner.for.cond7:
3795 // CHECK5-NEXT: [[TMP6:%.*]] = load i32, ptr [[DOTOMP_IV5]], align 4, !llvm.access.group [[ACC_GRP21:![0-9]+]]
3796 // CHECK5-NEXT: [[TMP7:%.*]] = load i32, ptr [[DOTOMP_UB4]], align 4, !llvm.access.group [[ACC_GRP21]]
3797 // CHECK5-NEXT: [[CMP8:%.*]] = icmp sle i32 [[TMP6]], [[TMP7]]
3798 // CHECK5-NEXT: br i1 [[CMP8]], label [[OMP_INNER_FOR_BODY9:%.*]], label [[OMP_INNER_FOR_END15:%.*]]
3799 // CHECK5: omp.inner.for.body9:
3800 // CHECK5-NEXT: [[TMP8:%.*]] = load i32, ptr [[DOTOMP_IV5]], align 4, !llvm.access.group [[ACC_GRP21]]
3801 // CHECK5-NEXT: [[MUL10:%.*]] = mul nsw i32 [[TMP8]], 1
3802 // CHECK5-NEXT: [[ADD11:%.*]] = add nsw i32 0, [[MUL10]]
3803 // CHECK5-NEXT: store i32 [[ADD11]], ptr [[I6]], align 4, !llvm.access.group [[ACC_GRP21]]
3804 // CHECK5-NEXT: call void @_Z3fn2v(), !llvm.access.group [[ACC_GRP21]]
3805 // CHECK5-NEXT: br label [[OMP_BODY_CONTINUE12:%.*]]
3806 // CHECK5: omp.body.continue12:
3807 // CHECK5-NEXT: br label [[OMP_INNER_FOR_INC13:%.*]]
3808 // CHECK5: omp.inner.for.inc13:
3809 // CHECK5-NEXT: [[TMP9:%.*]] = load i32, ptr [[DOTOMP_IV5]], align 4, !llvm.access.group [[ACC_GRP21]]
3810 // CHECK5-NEXT: [[ADD14:%.*]] = add nsw i32 [[TMP9]], 1
3811 // CHECK5-NEXT: store i32 [[ADD14]], ptr [[DOTOMP_IV5]], align 4, !llvm.access.group [[ACC_GRP21]]
3812 // CHECK5-NEXT: br label [[OMP_INNER_FOR_COND7]], !llvm.loop [[LOOP22:![0-9]+]]
3813 // CHECK5: omp.inner.for.end15:
3814 // CHECK5-NEXT: store i32 100, ptr [[I6]], align 4
3815 // CHECK5-NEXT: store i32 0, ptr [[DOTOMP_LB17]], align 4
3816 // CHECK5-NEXT: store i32 99, ptr [[DOTOMP_UB18]], align 4
3817 // CHECK5-NEXT: [[TMP10:%.*]] = load i32, ptr [[DOTOMP_LB17]], align 4
3818 // CHECK5-NEXT: store i32 [[TMP10]], ptr [[DOTOMP_IV19]], align 4
3819 // CHECK5-NEXT: br label [[OMP_INNER_FOR_COND21:%.*]]
3820 // CHECK5: omp.inner.for.cond21:
3821 // CHECK5-NEXT: [[TMP11:%.*]] = load i32, ptr [[DOTOMP_IV19]], align 4, !llvm.access.group [[ACC_GRP24:![0-9]+]]
3822 // CHECK5-NEXT: [[TMP12:%.*]] = load i32, ptr [[DOTOMP_UB18]], align 4, !llvm.access.group [[ACC_GRP24]]
3823 // CHECK5-NEXT: [[CMP22:%.*]] = icmp sle i32 [[TMP11]], [[TMP12]]
3824 // CHECK5-NEXT: br i1 [[CMP22]], label [[OMP_INNER_FOR_BODY23:%.*]], label [[OMP_INNER_FOR_END29:%.*]]
3825 // CHECK5: omp.inner.for.body23:
3826 // CHECK5-NEXT: [[TMP13:%.*]] = load i32, ptr [[DOTOMP_IV19]], align 4, !llvm.access.group [[ACC_GRP24]]
3827 // CHECK5-NEXT: [[MUL24:%.*]] = mul nsw i32 [[TMP13]], 1
3828 // CHECK5-NEXT: [[ADD25:%.*]] = add nsw i32 0, [[MUL24]]
3829 // CHECK5-NEXT: store i32 [[ADD25]], ptr [[I20]], align 4, !llvm.access.group [[ACC_GRP24]]
3830 // CHECK5-NEXT: call void @_Z3fn3v(), !llvm.access.group [[ACC_GRP24]]
3831 // CHECK5-NEXT: br label [[OMP_BODY_CONTINUE26:%.*]]
3832 // CHECK5: omp.body.continue26:
3833 // CHECK5-NEXT: br label [[OMP_INNER_FOR_INC27:%.*]]
3834 // CHECK5: omp.inner.for.inc27:
3835 // CHECK5-NEXT: [[TMP14:%.*]] = load i32, ptr [[DOTOMP_IV19]], align 4, !llvm.access.group [[ACC_GRP24]]
3836 // CHECK5-NEXT: [[ADD28:%.*]] = add nsw i32 [[TMP14]], 1
3837 // CHECK5-NEXT: store i32 [[ADD28]], ptr [[DOTOMP_IV19]], align 4, !llvm.access.group [[ACC_GRP24]]
3838 // CHECK5-NEXT: br label [[OMP_INNER_FOR_COND21]], !llvm.loop [[LOOP25:![0-9]+]]
3839 // CHECK5: omp.inner.for.end29:
3840 // CHECK5-NEXT: store i32 100, ptr [[I20]], align 4
3841 // CHECK5-NEXT: ret i32 0
3844 // CHECK7-LABEL: define {{[^@]+}}@_Z9gtid_testv
3845 // CHECK7-SAME: () #[[ATTR0:[0-9]+]] {
3846 // CHECK7-NEXT: entry:
3847 // CHECK7-NEXT: [[TMP:%.*]] = alloca i32, align 4
3848 // CHECK7-NEXT: [[DOTOMP_LB:%.*]] = alloca i32, align 4
3849 // CHECK7-NEXT: [[DOTOMP_UB:%.*]] = alloca i32, align 4
3850 // CHECK7-NEXT: [[DOTOMP_IV:%.*]] = alloca i32, align 4
3851 // CHECK7-NEXT: [[I:%.*]] = alloca i32, align 4
3852 // CHECK7-NEXT: [[_TMP2:%.*]] = alloca i32, align 4
3853 // CHECK7-NEXT: [[DOTOMP_LB3:%.*]] = alloca i32, align 4
3854 // CHECK7-NEXT: [[DOTOMP_UB4:%.*]] = alloca i32, align 4
3855 // CHECK7-NEXT: [[DOTOMP_IV5:%.*]] = alloca i32, align 4
3856 // CHECK7-NEXT: [[I6:%.*]] = alloca i32, align 4
3857 // CHECK7-NEXT: store i32 0, ptr [[DOTOMP_LB]], align 4
3858 // CHECK7-NEXT: store i32 99, ptr [[DOTOMP_UB]], align 4
3859 // CHECK7-NEXT: [[TMP0:%.*]] = load i32, ptr [[DOTOMP_LB]], align 4
3860 // CHECK7-NEXT: store i32 [[TMP0]], ptr [[DOTOMP_IV]], align 4
3861 // CHECK7-NEXT: br label [[OMP_INNER_FOR_COND:%.*]]
3862 // CHECK7: omp.inner.for.cond:
3863 // CHECK7-NEXT: [[TMP1:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP2:![0-9]+]]
3864 // CHECK7-NEXT: [[TMP2:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4, !llvm.access.group [[ACC_GRP2]]
3865 // CHECK7-NEXT: [[CMP:%.*]] = icmp sle i32 [[TMP1]], [[TMP2]]
3866 // CHECK7-NEXT: br i1 [[CMP]], label [[OMP_INNER_FOR_BODY:%.*]], label [[OMP_INNER_FOR_END:%.*]]
3867 // CHECK7: omp.inner.for.body:
3868 // CHECK7-NEXT: [[TMP3:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP2]]
3869 // CHECK7-NEXT: [[MUL:%.*]] = mul nsw i32 [[TMP3]], 1
3870 // CHECK7-NEXT: [[ADD:%.*]] = add nsw i32 0, [[MUL]]
3871 // CHECK7-NEXT: store i32 [[ADD]], ptr [[I]], align 4, !llvm.access.group [[ACC_GRP2]]
3872 // CHECK7-NEXT: br label [[OMP_BODY_CONTINUE:%.*]]
3873 // CHECK7: omp.body.continue:
3874 // CHECK7-NEXT: br label [[OMP_INNER_FOR_INC:%.*]]
3875 // CHECK7: omp.inner.for.inc:
3876 // CHECK7-NEXT: [[TMP4:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP2]]
3877 // CHECK7-NEXT: [[ADD1:%.*]] = add nsw i32 [[TMP4]], 1
3878 // CHECK7-NEXT: store i32 [[ADD1]], ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP2]]
3879 // CHECK7-NEXT: br label [[OMP_INNER_FOR_COND]], !llvm.loop [[LOOP3:![0-9]+]]
3880 // CHECK7: omp.inner.for.end:
3881 // CHECK7-NEXT: store i32 100, ptr [[I]], align 4
3882 // CHECK7-NEXT: store i32 0, ptr [[DOTOMP_LB3]], align 4
3883 // CHECK7-NEXT: store i32 99, ptr [[DOTOMP_UB4]], align 4
3884 // CHECK7-NEXT: [[TMP5:%.*]] = load i32, ptr [[DOTOMP_LB3]], align 4
3885 // CHECK7-NEXT: store i32 [[TMP5]], ptr [[DOTOMP_IV5]], align 4
3886 // CHECK7-NEXT: br label [[OMP_INNER_FOR_COND7:%.*]]
3887 // CHECK7: omp.inner.for.cond7:
3888 // CHECK7-NEXT: [[TMP6:%.*]] = load i32, ptr [[DOTOMP_IV5]], align 4, !llvm.access.group [[ACC_GRP6:![0-9]+]]
3889 // CHECK7-NEXT: [[TMP7:%.*]] = load i32, ptr [[DOTOMP_UB4]], align 4, !llvm.access.group [[ACC_GRP6]]
3890 // CHECK7-NEXT: [[CMP8:%.*]] = icmp sle i32 [[TMP6]], [[TMP7]]
3891 // CHECK7-NEXT: br i1 [[CMP8]], label [[OMP_INNER_FOR_BODY9:%.*]], label [[OMP_INNER_FOR_END15:%.*]]
3892 // CHECK7: omp.inner.for.body9:
3893 // CHECK7-NEXT: [[TMP8:%.*]] = load i32, ptr [[DOTOMP_IV5]], align 4, !llvm.access.group [[ACC_GRP6]]
3894 // CHECK7-NEXT: [[MUL10:%.*]] = mul nsw i32 [[TMP8]], 1
3895 // CHECK7-NEXT: [[ADD11:%.*]] = add nsw i32 0, [[MUL10]]
3896 // CHECK7-NEXT: store i32 [[ADD11]], ptr [[I6]], align 4, !llvm.access.group [[ACC_GRP6]]
3897 // CHECK7-NEXT: call void @_Z9gtid_testv(), !llvm.access.group [[ACC_GRP6]]
3898 // CHECK7-NEXT: br label [[OMP_BODY_CONTINUE12:%.*]]
3899 // CHECK7: omp.body.continue12:
3900 // CHECK7-NEXT: br label [[OMP_INNER_FOR_INC13:%.*]]
3901 // CHECK7: omp.inner.for.inc13:
3902 // CHECK7-NEXT: [[TMP9:%.*]] = load i32, ptr [[DOTOMP_IV5]], align 4, !llvm.access.group [[ACC_GRP6]]
3903 // CHECK7-NEXT: [[ADD14:%.*]] = add nsw i32 [[TMP9]], 1
3904 // CHECK7-NEXT: store i32 [[ADD14]], ptr [[DOTOMP_IV5]], align 4, !llvm.access.group [[ACC_GRP6]]
3905 // CHECK7-NEXT: br label [[OMP_INNER_FOR_COND7]], !llvm.loop [[LOOP7:![0-9]+]]
3906 // CHECK7: omp.inner.for.end15:
3907 // CHECK7-NEXT: store i32 100, ptr [[I6]], align 4
3908 // CHECK7-NEXT: ret void
3911 // CHECK7-LABEL: define {{[^@]+}}@main
3912 // CHECK7-SAME: () #[[ATTR1:[0-9]+]] {
3913 // CHECK7-NEXT: entry:
3914 // CHECK7-NEXT: [[RETVAL:%.*]] = alloca i32, align 4
3915 // CHECK7-NEXT: [[TMP:%.*]] = alloca i32, align 4
3916 // CHECK7-NEXT: [[DOTOMP_LB:%.*]] = alloca i32, align 4
3917 // CHECK7-NEXT: [[DOTOMP_UB:%.*]] = alloca i32, align 4
3918 // CHECK7-NEXT: [[DOTOMP_IV:%.*]] = alloca i32, align 4
3919 // CHECK7-NEXT: [[I:%.*]] = alloca i32, align 4
3920 // CHECK7-NEXT: [[_TMP2:%.*]] = alloca i32, align 4
3921 // CHECK7-NEXT: [[DOTOMP_LB3:%.*]] = alloca i32, align 4
3922 // CHECK7-NEXT: [[DOTOMP_UB4:%.*]] = alloca i32, align 4
3923 // CHECK7-NEXT: [[DOTOMP_IV5:%.*]] = alloca i32, align 4
3924 // CHECK7-NEXT: [[I6:%.*]] = alloca i32, align 4
3925 // CHECK7-NEXT: [[DOTCAPTURE_EXPR_:%.*]] = alloca i8, align 1
3926 // CHECK7-NEXT: [[_TMP16:%.*]] = alloca i32, align 4
3927 // CHECK7-NEXT: [[DOTOMP_LB17:%.*]] = alloca i32, align 4
3928 // CHECK7-NEXT: [[DOTOMP_UB18:%.*]] = alloca i32, align 4
3929 // CHECK7-NEXT: [[DOTOMP_IV19:%.*]] = alloca i32, align 4
3930 // CHECK7-NEXT: [[I20:%.*]] = alloca i32, align 4
3931 // CHECK7-NEXT: store i32 0, ptr [[RETVAL]], align 4
3932 // CHECK7-NEXT: store i32 0, ptr [[DOTOMP_LB]], align 4
3933 // CHECK7-NEXT: store i32 99, ptr [[DOTOMP_UB]], align 4
3934 // CHECK7-NEXT: [[TMP0:%.*]] = load i32, ptr [[DOTOMP_LB]], align 4
3935 // CHECK7-NEXT: store i32 [[TMP0]], ptr [[DOTOMP_IV]], align 4
3936 // CHECK7-NEXT: br label [[OMP_INNER_FOR_COND:%.*]]
3937 // CHECK7: omp.inner.for.cond:
3938 // CHECK7-NEXT: [[TMP1:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP9:![0-9]+]]
3939 // CHECK7-NEXT: [[TMP2:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4, !llvm.access.group [[ACC_GRP9]]
3940 // CHECK7-NEXT: [[CMP:%.*]] = icmp sle i32 [[TMP1]], [[TMP2]]
3941 // CHECK7-NEXT: br i1 [[CMP]], label [[OMP_INNER_FOR_BODY:%.*]], label [[OMP_INNER_FOR_END:%.*]]
3942 // CHECK7: omp.inner.for.body:
3943 // CHECK7-NEXT: [[TMP3:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP9]]
3944 // CHECK7-NEXT: [[MUL:%.*]] = mul nsw i32 [[TMP3]], 1
3945 // CHECK7-NEXT: [[ADD:%.*]] = add nsw i32 0, [[MUL]]
3946 // CHECK7-NEXT: store i32 [[ADD]], ptr [[I]], align 4, !llvm.access.group [[ACC_GRP9]]
3947 // CHECK7-NEXT: call void @_Z3fn4v(), !llvm.access.group [[ACC_GRP9]]
3948 // CHECK7-NEXT: br label [[OMP_BODY_CONTINUE:%.*]]
3949 // CHECK7: omp.body.continue:
3950 // CHECK7-NEXT: br label [[OMP_INNER_FOR_INC:%.*]]
3951 // CHECK7: omp.inner.for.inc:
3952 // CHECK7-NEXT: [[TMP4:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP9]]
3953 // CHECK7-NEXT: [[ADD1:%.*]] = add nsw i32 [[TMP4]], 1
3954 // CHECK7-NEXT: store i32 [[ADD1]], ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP9]]
3955 // CHECK7-NEXT: br label [[OMP_INNER_FOR_COND]], !llvm.loop [[LOOP10:![0-9]+]]
3956 // CHECK7: omp.inner.for.end:
3957 // CHECK7-NEXT: store i32 100, ptr [[I]], align 4
3958 // CHECK7-NEXT: store i32 0, ptr [[DOTOMP_LB3]], align 4
3959 // CHECK7-NEXT: store i32 99, ptr [[DOTOMP_UB4]], align 4
3960 // CHECK7-NEXT: [[TMP5:%.*]] = load i32, ptr [[DOTOMP_LB3]], align 4
3961 // CHECK7-NEXT: store i32 [[TMP5]], ptr [[DOTOMP_IV5]], align 4
3962 // CHECK7-NEXT: br label [[OMP_INNER_FOR_COND7:%.*]]
3963 // CHECK7: omp.inner.for.cond7:
3964 // CHECK7-NEXT: [[TMP6:%.*]] = load i32, ptr [[DOTOMP_IV5]], align 4
3965 // CHECK7-NEXT: [[TMP7:%.*]] = load i32, ptr [[DOTOMP_UB4]], align 4
3966 // CHECK7-NEXT: [[CMP8:%.*]] = icmp sle i32 [[TMP6]], [[TMP7]]
3967 // CHECK7-NEXT: br i1 [[CMP8]], label [[OMP_INNER_FOR_BODY9:%.*]], label [[OMP_INNER_FOR_END15:%.*]]
3968 // CHECK7: omp.inner.for.body9:
3969 // CHECK7-NEXT: [[TMP8:%.*]] = load i32, ptr [[DOTOMP_IV5]], align 4
3970 // CHECK7-NEXT: [[MUL10:%.*]] = mul nsw i32 [[TMP8]], 1
3971 // CHECK7-NEXT: [[ADD11:%.*]] = add nsw i32 0, [[MUL10]]
3972 // CHECK7-NEXT: store i32 [[ADD11]], ptr [[I6]], align 4
3973 // CHECK7-NEXT: call void @_Z3fn5v()
3974 // CHECK7-NEXT: br label [[OMP_BODY_CONTINUE12:%.*]]
3975 // CHECK7: omp.body.continue12:
3976 // CHECK7-NEXT: br label [[OMP_INNER_FOR_INC13:%.*]]
3977 // CHECK7: omp.inner.for.inc13:
3978 // CHECK7-NEXT: [[TMP9:%.*]] = load i32, ptr [[DOTOMP_IV5]], align 4
3979 // CHECK7-NEXT: [[ADD14:%.*]] = add nsw i32 [[TMP9]], 1
3980 // CHECK7-NEXT: store i32 [[ADD14]], ptr [[DOTOMP_IV5]], align 4
3981 // CHECK7-NEXT: br label [[OMP_INNER_FOR_COND7]], !llvm.loop [[LOOP12:![0-9]+]]
3982 // CHECK7: omp.inner.for.end15:
3983 // CHECK7-NEXT: store i32 100, ptr [[I6]], align 4
3984 // CHECK7-NEXT: [[TMP10:%.*]] = load i32, ptr @Arg, align 4
3985 // CHECK7-NEXT: [[TOBOOL:%.*]] = icmp ne i32 [[TMP10]], 0
3986 // CHECK7-NEXT: [[FROMBOOL:%.*]] = zext i1 [[TOBOOL]] to i8
3987 // CHECK7-NEXT: store i8 [[FROMBOOL]], ptr [[DOTCAPTURE_EXPR_]], align 1
3988 // CHECK7-NEXT: store i32 0, ptr [[DOTOMP_LB17]], align 4
3989 // CHECK7-NEXT: store i32 99, ptr [[DOTOMP_UB18]], align 4
3990 // CHECK7-NEXT: [[TMP11:%.*]] = load i32, ptr [[DOTOMP_LB17]], align 4
3991 // CHECK7-NEXT: store i32 [[TMP11]], ptr [[DOTOMP_IV19]], align 4
3992 // CHECK7-NEXT: [[TMP12:%.*]] = load i8, ptr [[DOTCAPTURE_EXPR_]], align 1
3993 // CHECK7-NEXT: [[TOBOOL21:%.*]] = trunc i8 [[TMP12]] to i1
3994 // CHECK7-NEXT: br i1 [[TOBOOL21]], label [[OMP_IF_THEN:%.*]], label [[OMP_IF_ELSE:%.*]]
3995 // CHECK7: omp_if.then:
3996 // CHECK7-NEXT: br label [[OMP_INNER_FOR_COND22:%.*]]
3997 // CHECK7: omp.inner.for.cond22:
3998 // CHECK7-NEXT: [[TMP13:%.*]] = load i32, ptr [[DOTOMP_IV19]], align 4, !llvm.access.group [[ACC_GRP14:![0-9]+]]
3999 // CHECK7-NEXT: [[TMP14:%.*]] = load i32, ptr [[DOTOMP_UB18]], align 4, !llvm.access.group [[ACC_GRP14]]
4000 // CHECK7-NEXT: [[CMP23:%.*]] = icmp sle i32 [[TMP13]], [[TMP14]]
4001 // CHECK7-NEXT: br i1 [[CMP23]], label [[OMP_INNER_FOR_BODY24:%.*]], label [[OMP_INNER_FOR_END30:%.*]]
4002 // CHECK7: omp.inner.for.body24:
4003 // CHECK7-NEXT: [[TMP15:%.*]] = load i32, ptr [[DOTOMP_IV19]], align 4, !llvm.access.group [[ACC_GRP14]]
4004 // CHECK7-NEXT: [[MUL25:%.*]] = mul nsw i32 [[TMP15]], 1
4005 // CHECK7-NEXT: [[ADD26:%.*]] = add nsw i32 0, [[MUL25]]
4006 // CHECK7-NEXT: store i32 [[ADD26]], ptr [[I20]], align 4, !llvm.access.group [[ACC_GRP14]]
4007 // CHECK7-NEXT: call void @_Z3fn6v(), !llvm.access.group [[ACC_GRP14]]
4008 // CHECK7-NEXT: br label [[OMP_BODY_CONTINUE27:%.*]]
4009 // CHECK7: omp.body.continue27:
4010 // CHECK7-NEXT: br label [[OMP_INNER_FOR_INC28:%.*]]
4011 // CHECK7: omp.inner.for.inc28:
4012 // CHECK7-NEXT: [[TMP16:%.*]] = load i32, ptr [[DOTOMP_IV19]], align 4, !llvm.access.group [[ACC_GRP14]]
4013 // CHECK7-NEXT: [[ADD29:%.*]] = add nsw i32 [[TMP16]], 1
4014 // CHECK7-NEXT: store i32 [[ADD29]], ptr [[DOTOMP_IV19]], align 4, !llvm.access.group [[ACC_GRP14]]
4015 // CHECK7-NEXT: br label [[OMP_INNER_FOR_COND22]], !llvm.loop [[LOOP15:![0-9]+]]
4016 // CHECK7: omp.inner.for.end30:
4017 // CHECK7-NEXT: br label [[OMP_IF_END:%.*]]
4018 // CHECK7: omp_if.else:
4019 // CHECK7-NEXT: br label [[OMP_INNER_FOR_COND31:%.*]]
4020 // CHECK7: omp.inner.for.cond31:
4021 // CHECK7-NEXT: [[TMP17:%.*]] = load i32, ptr [[DOTOMP_IV19]], align 4
4022 // CHECK7-NEXT: [[TMP18:%.*]] = load i32, ptr [[DOTOMP_UB18]], align 4
4023 // CHECK7-NEXT: [[CMP32:%.*]] = icmp sle i32 [[TMP17]], [[TMP18]]
4024 // CHECK7-NEXT: br i1 [[CMP32]], label [[OMP_INNER_FOR_BODY33:%.*]], label [[OMP_INNER_FOR_END39:%.*]]
4025 // CHECK7: omp.inner.for.body33:
4026 // CHECK7-NEXT: [[TMP19:%.*]] = load i32, ptr [[DOTOMP_IV19]], align 4
4027 // CHECK7-NEXT: [[MUL34:%.*]] = mul nsw i32 [[TMP19]], 1
4028 // CHECK7-NEXT: [[ADD35:%.*]] = add nsw i32 0, [[MUL34]]
4029 // CHECK7-NEXT: store i32 [[ADD35]], ptr [[I20]], align 4
4030 // CHECK7-NEXT: call void @_Z3fn6v()
4031 // CHECK7-NEXT: br label [[OMP_BODY_CONTINUE36:%.*]]
4032 // CHECK7: omp.body.continue36:
4033 // CHECK7-NEXT: br label [[OMP_INNER_FOR_INC37:%.*]]
4034 // CHECK7: omp.inner.for.inc37:
4035 // CHECK7-NEXT: [[TMP20:%.*]] = load i32, ptr [[DOTOMP_IV19]], align 4
4036 // CHECK7-NEXT: [[ADD38:%.*]] = add nsw i32 [[TMP20]], 1
4037 // CHECK7-NEXT: store i32 [[ADD38]], ptr [[DOTOMP_IV19]], align 4
4038 // CHECK7-NEXT: br label [[OMP_INNER_FOR_COND31]], !llvm.loop [[LOOP17:![0-9]+]]
4039 // CHECK7: omp.inner.for.end39:
4040 // CHECK7-NEXT: br label [[OMP_IF_END]]
4041 // CHECK7: omp_if.end:
4042 // CHECK7-NEXT: store i32 100, ptr [[I20]], align 4
4043 // CHECK7-NEXT: [[TMP21:%.*]] = load i32, ptr @Arg, align 4
4044 // CHECK7-NEXT: [[CALL:%.*]] = call noundef i32 @_Z5tmainIiEiT_(i32 noundef [[TMP21]])
4045 // CHECK7-NEXT: ret i32 [[CALL]]
4048 // CHECK7-LABEL: define {{[^@]+}}@_Z5tmainIiEiT_
4049 // CHECK7-SAME: (i32 noundef [[ARG:%.*]]) #[[ATTR0]] comdat {
4050 // CHECK7-NEXT: entry:
4051 // CHECK7-NEXT: [[ARG_ADDR:%.*]] = alloca i32, align 4
4052 // CHECK7-NEXT: [[TMP:%.*]] = alloca i32, align 4
4053 // CHECK7-NEXT: [[DOTOMP_LB:%.*]] = alloca i32, align 4
4054 // CHECK7-NEXT: [[DOTOMP_UB:%.*]] = alloca i32, align 4
4055 // CHECK7-NEXT: [[DOTOMP_IV:%.*]] = alloca i32, align 4
4056 // CHECK7-NEXT: [[I:%.*]] = alloca i32, align 4
4057 // CHECK7-NEXT: [[_TMP2:%.*]] = alloca i32, align 4
4058 // CHECK7-NEXT: [[DOTOMP_LB3:%.*]] = alloca i32, align 4
4059 // CHECK7-NEXT: [[DOTOMP_UB4:%.*]] = alloca i32, align 4
4060 // CHECK7-NEXT: [[DOTOMP_IV5:%.*]] = alloca i32, align 4
4061 // CHECK7-NEXT: [[I6:%.*]] = alloca i32, align 4
4062 // CHECK7-NEXT: [[_TMP16:%.*]] = alloca i32, align 4
4063 // CHECK7-NEXT: [[DOTOMP_LB17:%.*]] = alloca i32, align 4
4064 // CHECK7-NEXT: [[DOTOMP_UB18:%.*]] = alloca i32, align 4
4065 // CHECK7-NEXT: [[DOTOMP_IV19:%.*]] = alloca i32, align 4
4066 // CHECK7-NEXT: [[I20:%.*]] = alloca i32, align 4
4067 // CHECK7-NEXT: store i32 [[ARG]], ptr [[ARG_ADDR]], align 4
4068 // CHECK7-NEXT: store i32 0, ptr [[DOTOMP_LB]], align 4
4069 // CHECK7-NEXT: store i32 99, ptr [[DOTOMP_UB]], align 4
4070 // CHECK7-NEXT: [[TMP0:%.*]] = load i32, ptr [[DOTOMP_LB]], align 4
4071 // CHECK7-NEXT: store i32 [[TMP0]], ptr [[DOTOMP_IV]], align 4
4072 // CHECK7-NEXT: br label [[OMP_INNER_FOR_COND:%.*]]
4073 // CHECK7: omp.inner.for.cond:
4074 // CHECK7-NEXT: [[TMP1:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP18:![0-9]+]]
4075 // CHECK7-NEXT: [[TMP2:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4, !llvm.access.group [[ACC_GRP18]]
4076 // CHECK7-NEXT: [[CMP:%.*]] = icmp sle i32 [[TMP1]], [[TMP2]]
4077 // CHECK7-NEXT: br i1 [[CMP]], label [[OMP_INNER_FOR_BODY:%.*]], label [[OMP_INNER_FOR_END:%.*]]
4078 // CHECK7: omp.inner.for.body:
4079 // CHECK7-NEXT: [[TMP3:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP18]]
4080 // CHECK7-NEXT: [[MUL:%.*]] = mul nsw i32 [[TMP3]], 1
4081 // CHECK7-NEXT: [[ADD:%.*]] = add nsw i32 0, [[MUL]]
4082 // CHECK7-NEXT: store i32 [[ADD]], ptr [[I]], align 4, !llvm.access.group [[ACC_GRP18]]
4083 // CHECK7-NEXT: call void @_Z3fn1v(), !llvm.access.group [[ACC_GRP18]]
4084 // CHECK7-NEXT: br label [[OMP_BODY_CONTINUE:%.*]]
4085 // CHECK7: omp.body.continue:
4086 // CHECK7-NEXT: br label [[OMP_INNER_FOR_INC:%.*]]
4087 // CHECK7: omp.inner.for.inc:
4088 // CHECK7-NEXT: [[TMP4:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP18]]
4089 // CHECK7-NEXT: [[ADD1:%.*]] = add nsw i32 [[TMP4]], 1
4090 // CHECK7-NEXT: store i32 [[ADD1]], ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP18]]
4091 // CHECK7-NEXT: br label [[OMP_INNER_FOR_COND]], !llvm.loop [[LOOP19:![0-9]+]]
4092 // CHECK7: omp.inner.for.end:
4093 // CHECK7-NEXT: store i32 100, ptr [[I]], align 4
4094 // CHECK7-NEXT: store i32 0, ptr [[DOTOMP_LB3]], align 4
4095 // CHECK7-NEXT: store i32 99, ptr [[DOTOMP_UB4]], align 4
4096 // CHECK7-NEXT: [[TMP5:%.*]] = load i32, ptr [[DOTOMP_LB3]], align 4
4097 // CHECK7-NEXT: store i32 [[TMP5]], ptr [[DOTOMP_IV5]], align 4
4098 // CHECK7-NEXT: br label [[OMP_INNER_FOR_COND7:%.*]]
4099 // CHECK7: omp.inner.for.cond7:
4100 // CHECK7-NEXT: [[TMP6:%.*]] = load i32, ptr [[DOTOMP_IV5]], align 4
4101 // CHECK7-NEXT: [[TMP7:%.*]] = load i32, ptr [[DOTOMP_UB4]], align 4
4102 // CHECK7-NEXT: [[CMP8:%.*]] = icmp sle i32 [[TMP6]], [[TMP7]]
4103 // CHECK7-NEXT: br i1 [[CMP8]], label [[OMP_INNER_FOR_BODY9:%.*]], label [[OMP_INNER_FOR_END15:%.*]]
4104 // CHECK7: omp.inner.for.body9:
4105 // CHECK7-NEXT: [[TMP8:%.*]] = load i32, ptr [[DOTOMP_IV5]], align 4
4106 // CHECK7-NEXT: [[MUL10:%.*]] = mul nsw i32 [[TMP8]], 1
4107 // CHECK7-NEXT: [[ADD11:%.*]] = add nsw i32 0, [[MUL10]]
4108 // CHECK7-NEXT: store i32 [[ADD11]], ptr [[I6]], align 4
4109 // CHECK7-NEXT: call void @_Z3fn2v()
4110 // CHECK7-NEXT: br label [[OMP_BODY_CONTINUE12:%.*]]
4111 // CHECK7: omp.body.continue12:
4112 // CHECK7-NEXT: br label [[OMP_INNER_FOR_INC13:%.*]]
4113 // CHECK7: omp.inner.for.inc13:
4114 // CHECK7-NEXT: [[TMP9:%.*]] = load i32, ptr [[DOTOMP_IV5]], align 4
4115 // CHECK7-NEXT: [[ADD14:%.*]] = add nsw i32 [[TMP9]], 1
4116 // CHECK7-NEXT: store i32 [[ADD14]], ptr [[DOTOMP_IV5]], align 4
4117 // CHECK7-NEXT: br label [[OMP_INNER_FOR_COND7]], !llvm.loop [[LOOP21:![0-9]+]]
4118 // CHECK7: omp.inner.for.end15:
4119 // CHECK7-NEXT: store i32 100, ptr [[I6]], align 4
4120 // CHECK7-NEXT: store i32 0, ptr [[DOTOMP_LB17]], align 4
4121 // CHECK7-NEXT: store i32 99, ptr [[DOTOMP_UB18]], align 4
4122 // CHECK7-NEXT: [[TMP10:%.*]] = load i32, ptr [[DOTOMP_LB17]], align 4
4123 // CHECK7-NEXT: store i32 [[TMP10]], ptr [[DOTOMP_IV19]], align 4
4124 // CHECK7-NEXT: br label [[OMP_INNER_FOR_COND21:%.*]]
4125 // CHECK7: omp.inner.for.cond21:
4126 // CHECK7-NEXT: [[TMP11:%.*]] = load i32, ptr [[DOTOMP_IV19]], align 4, !llvm.access.group [[ACC_GRP22:![0-9]+]]
4127 // CHECK7-NEXT: [[TMP12:%.*]] = load i32, ptr [[DOTOMP_UB18]], align 4, !llvm.access.group [[ACC_GRP22]]
4128 // CHECK7-NEXT: [[CMP22:%.*]] = icmp sle i32 [[TMP11]], [[TMP12]]
4129 // CHECK7-NEXT: br i1 [[CMP22]], label [[OMP_INNER_FOR_BODY23:%.*]], label [[OMP_INNER_FOR_END29:%.*]]
4130 // CHECK7: omp.inner.for.body23:
4131 // CHECK7-NEXT: [[TMP13:%.*]] = load i32, ptr [[DOTOMP_IV19]], align 4, !llvm.access.group [[ACC_GRP22]]
4132 // CHECK7-NEXT: [[MUL24:%.*]] = mul nsw i32 [[TMP13]], 1
4133 // CHECK7-NEXT: [[ADD25:%.*]] = add nsw i32 0, [[MUL24]]
4134 // CHECK7-NEXT: store i32 [[ADD25]], ptr [[I20]], align 4, !llvm.access.group [[ACC_GRP22]]
4135 // CHECK7-NEXT: call void @_Z3fn3v(), !llvm.access.group [[ACC_GRP22]]
4136 // CHECK7-NEXT: br label [[OMP_BODY_CONTINUE26:%.*]]
4137 // CHECK7: omp.body.continue26:
4138 // CHECK7-NEXT: br label [[OMP_INNER_FOR_INC27:%.*]]
4139 // CHECK7: omp.inner.for.inc27:
4140 // CHECK7-NEXT: [[TMP14:%.*]] = load i32, ptr [[DOTOMP_IV19]], align 4, !llvm.access.group [[ACC_GRP22]]
4141 // CHECK7-NEXT: [[ADD28:%.*]] = add nsw i32 [[TMP14]], 1
4142 // CHECK7-NEXT: store i32 [[ADD28]], ptr [[DOTOMP_IV19]], align 4, !llvm.access.group [[ACC_GRP22]]
4143 // CHECK7-NEXT: br label [[OMP_INNER_FOR_COND21]], !llvm.loop [[LOOP23:![0-9]+]]
4144 // CHECK7: omp.inner.for.end29:
4145 // CHECK7-NEXT: store i32 100, ptr [[I20]], align 4
4146 // CHECK7-NEXT: ret i32 0
4149 // CHECK9-LABEL: define {{[^@]+}}@_Z9gtid_testv
4150 // CHECK9-SAME: () #[[ATTR0:[0-9]+]] {
4151 // CHECK9-NEXT: entry:
4152 // CHECK9-NEXT: [[TMP:%.*]] = alloca i32, align 4
4153 // CHECK9-NEXT: [[KERNEL_ARGS:%.*]] = alloca [[STRUCT___TGT_KERNEL_ARGUMENTS:%.*]], align 8
4154 // CHECK9-NEXT: [[_TMP1:%.*]] = alloca i32, align 4
4155 // CHECK9-NEXT: [[KERNEL_ARGS2:%.*]] = alloca [[STRUCT___TGT_KERNEL_ARGUMENTS]], align 8
4156 // CHECK9-NEXT: [[TMP0:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 0
4157 // CHECK9-NEXT: store i32 2, ptr [[TMP0]], align 4
4158 // CHECK9-NEXT: [[TMP1:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 1
4159 // CHECK9-NEXT: store i32 0, ptr [[TMP1]], align 4
4160 // CHECK9-NEXT: [[TMP2:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 2
4161 // CHECK9-NEXT: store ptr null, ptr [[TMP2]], align 8
4162 // CHECK9-NEXT: [[TMP3:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 3
4163 // CHECK9-NEXT: store ptr null, ptr [[TMP3]], align 8
4164 // CHECK9-NEXT: [[TMP4:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 4
4165 // CHECK9-NEXT: store ptr null, ptr [[TMP4]], align 8
4166 // CHECK9-NEXT: [[TMP5:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 5
4167 // CHECK9-NEXT: store ptr null, ptr [[TMP5]], align 8
4168 // CHECK9-NEXT: [[TMP6:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 6
4169 // CHECK9-NEXT: store ptr null, ptr [[TMP6]], align 8
4170 // CHECK9-NEXT: [[TMP7:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 7
4171 // CHECK9-NEXT: store ptr null, ptr [[TMP7]], align 8
4172 // CHECK9-NEXT: [[TMP8:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 8
4173 // CHECK9-NEXT: store i64 100, ptr [[TMP8]], align 8
4174 // CHECK9-NEXT: [[TMP9:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 9
4175 // CHECK9-NEXT: store i64 0, ptr [[TMP9]], align 8
4176 // CHECK9-NEXT: [[TMP10:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 10
4177 // CHECK9-NEXT: store [3 x i32] zeroinitializer, ptr [[TMP10]], align 4
4178 // CHECK9-NEXT: [[TMP11:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 11
4179 // CHECK9-NEXT: store [3 x i32] zeroinitializer, ptr [[TMP11]], align 4
4180 // CHECK9-NEXT: [[TMP12:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 12
4181 // CHECK9-NEXT: store i32 0, ptr [[TMP12]], align 4
4182 // CHECK9-NEXT: [[TMP13:%.*]] = call i32 @__tgt_target_kernel(ptr @[[GLOB3:[0-9]+]], i64 -1, i32 0, i32 0, ptr @.{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z9gtid_testv_l43.region_id, ptr [[KERNEL_ARGS]])
4183 // CHECK9-NEXT: [[TMP14:%.*]] = icmp ne i32 [[TMP13]], 0
4184 // CHECK9-NEXT: br i1 [[TMP14]], label [[OMP_OFFLOAD_FAILED:%.*]], label [[OMP_OFFLOAD_CONT:%.*]]
4185 // CHECK9: omp_offload.failed:
4186 // CHECK9-NEXT: call void @{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z9gtid_testv_l43() #[[ATTR2:[0-9]+]]
4187 // CHECK9-NEXT: br label [[OMP_OFFLOAD_CONT]]
4188 // CHECK9: omp_offload.cont:
4189 // CHECK9-NEXT: [[TMP15:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS2]], i32 0, i32 0
4190 // CHECK9-NEXT: store i32 2, ptr [[TMP15]], align 4
4191 // CHECK9-NEXT: [[TMP16:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS2]], i32 0, i32 1
4192 // CHECK9-NEXT: store i32 0, ptr [[TMP16]], align 4
4193 // CHECK9-NEXT: [[TMP17:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS2]], i32 0, i32 2
4194 // CHECK9-NEXT: store ptr null, ptr [[TMP17]], align 8
4195 // CHECK9-NEXT: [[TMP18:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS2]], i32 0, i32 3
4196 // CHECK9-NEXT: store ptr null, ptr [[TMP18]], align 8
4197 // CHECK9-NEXT: [[TMP19:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS2]], i32 0, i32 4
4198 // CHECK9-NEXT: store ptr null, ptr [[TMP19]], align 8
4199 // CHECK9-NEXT: [[TMP20:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS2]], i32 0, i32 5
4200 // CHECK9-NEXT: store ptr null, ptr [[TMP20]], align 8
4201 // CHECK9-NEXT: [[TMP21:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS2]], i32 0, i32 6
4202 // CHECK9-NEXT: store ptr null, ptr [[TMP21]], align 8
4203 // CHECK9-NEXT: [[TMP22:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS2]], i32 0, i32 7
4204 // CHECK9-NEXT: store ptr null, ptr [[TMP22]], align 8
4205 // CHECK9-NEXT: [[TMP23:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS2]], i32 0, i32 8
4206 // CHECK9-NEXT: store i64 100, ptr [[TMP23]], align 8
4207 // CHECK9-NEXT: [[TMP24:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS2]], i32 0, i32 9
4208 // CHECK9-NEXT: store i64 0, ptr [[TMP24]], align 8
4209 // CHECK9-NEXT: [[TMP25:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS2]], i32 0, i32 10
4210 // CHECK9-NEXT: store [3 x i32] zeroinitializer, ptr [[TMP25]], align 4
4211 // CHECK9-NEXT: [[TMP26:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS2]], i32 0, i32 11
4212 // CHECK9-NEXT: store [3 x i32] zeroinitializer, ptr [[TMP26]], align 4
4213 // CHECK9-NEXT: [[TMP27:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS2]], i32 0, i32 12
4214 // CHECK9-NEXT: store i32 0, ptr [[TMP27]], align 4
4215 // CHECK9-NEXT: [[TMP28:%.*]] = call i32 @__tgt_target_kernel(ptr @[[GLOB3]], i64 -1, i32 0, i32 0, ptr @.{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z9gtid_testv_l48.region_id, ptr [[KERNEL_ARGS2]])
4216 // CHECK9-NEXT: [[TMP29:%.*]] = icmp ne i32 [[TMP28]], 0
4217 // CHECK9-NEXT: br i1 [[TMP29]], label [[OMP_OFFLOAD_FAILED3:%.*]], label [[OMP_OFFLOAD_CONT4:%.*]]
4218 // CHECK9: omp_offload.failed3:
4219 // CHECK9-NEXT: call void @{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z9gtid_testv_l48() #[[ATTR2]]
4220 // CHECK9-NEXT: br label [[OMP_OFFLOAD_CONT4]]
4221 // CHECK9: omp_offload.cont4:
4222 // CHECK9-NEXT: ret void
4225 // CHECK9-LABEL: define {{[^@]+}}@{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z9gtid_testv_l43
4226 // CHECK9-SAME: () #[[ATTR1:[0-9]+]] {
4227 // CHECK9-NEXT: entry:
4228 // CHECK9-NEXT: call void (ptr, i32, ptr, ...) @__kmpc_fork_teams(ptr @[[GLOB3]], i32 0, ptr @{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z9gtid_testv_l43.omp_outlined)
4229 // CHECK9-NEXT: ret void
4232 // CHECK9-LABEL: define {{[^@]+}}@{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z9gtid_testv_l43.omp_outlined
4233 // CHECK9-SAME: (ptr noalias noundef [[DOTGLOBAL_TID_:%.*]], ptr noalias noundef [[DOTBOUND_TID_:%.*]]) #[[ATTR1]] {
4234 // CHECK9-NEXT: entry:
4235 // CHECK9-NEXT: [[DOTGLOBAL_TID__ADDR:%.*]] = alloca ptr, align 8
4236 // CHECK9-NEXT: [[DOTBOUND_TID__ADDR:%.*]] = alloca ptr, align 8
4237 // CHECK9-NEXT: [[DOTOMP_IV:%.*]] = alloca i32, align 4
4238 // CHECK9-NEXT: [[TMP:%.*]] = alloca i32, align 4
4239 // CHECK9-NEXT: [[DOTOMP_COMB_LB:%.*]] = alloca i32, align 4
4240 // CHECK9-NEXT: [[DOTOMP_COMB_UB:%.*]] = alloca i32, align 4
4241 // CHECK9-NEXT: [[DOTOMP_STRIDE:%.*]] = alloca i32, align 4
4242 // CHECK9-NEXT: [[DOTOMP_IS_LAST:%.*]] = alloca i32, align 4
4243 // CHECK9-NEXT: [[I:%.*]] = alloca i32, align 4
4244 // CHECK9-NEXT: store ptr [[DOTGLOBAL_TID_]], ptr [[DOTGLOBAL_TID__ADDR]], align 8
4245 // CHECK9-NEXT: store ptr [[DOTBOUND_TID_]], ptr [[DOTBOUND_TID__ADDR]], align 8
4246 // CHECK9-NEXT: store i32 0, ptr [[DOTOMP_COMB_LB]], align 4
4247 // CHECK9-NEXT: store i32 99, ptr [[DOTOMP_COMB_UB]], align 4
4248 // CHECK9-NEXT: store i32 1, ptr [[DOTOMP_STRIDE]], align 4
4249 // CHECK9-NEXT: store i32 0, ptr [[DOTOMP_IS_LAST]], align 4
4250 // CHECK9-NEXT: [[TMP0:%.*]] = load ptr, ptr [[DOTGLOBAL_TID__ADDR]], align 8
4251 // CHECK9-NEXT: [[TMP1:%.*]] = load i32, ptr [[TMP0]], align 4
4252 // CHECK9-NEXT: call void @__kmpc_for_static_init_4(ptr @[[GLOB1:[0-9]+]], i32 [[TMP1]], i32 92, ptr [[DOTOMP_IS_LAST]], ptr [[DOTOMP_COMB_LB]], ptr [[DOTOMP_COMB_UB]], ptr [[DOTOMP_STRIDE]], i32 1, i32 1)
4253 // CHECK9-NEXT: [[TMP2:%.*]] = load i32, ptr [[DOTOMP_COMB_UB]], align 4
4254 // CHECK9-NEXT: [[CMP:%.*]] = icmp sgt i32 [[TMP2]], 99
4255 // CHECK9-NEXT: br i1 [[CMP]], label [[COND_TRUE:%.*]], label [[COND_FALSE:%.*]]
4256 // CHECK9: cond.true:
4257 // CHECK9-NEXT: br label [[COND_END:%.*]]
4258 // CHECK9: cond.false:
4259 // CHECK9-NEXT: [[TMP3:%.*]] = load i32, ptr [[DOTOMP_COMB_UB]], align 4
4260 // CHECK9-NEXT: br label [[COND_END]]
4261 // CHECK9: cond.end:
4262 // CHECK9-NEXT: [[COND:%.*]] = phi i32 [ 99, [[COND_TRUE]] ], [ [[TMP3]], [[COND_FALSE]] ]
4263 // CHECK9-NEXT: store i32 [[COND]], ptr [[DOTOMP_COMB_UB]], align 4
4264 // CHECK9-NEXT: [[TMP4:%.*]] = load i32, ptr [[DOTOMP_COMB_LB]], align 4
4265 // CHECK9-NEXT: store i32 [[TMP4]], ptr [[DOTOMP_IV]], align 4
4266 // CHECK9-NEXT: br label [[OMP_INNER_FOR_COND:%.*]]
4267 // CHECK9: omp.inner.for.cond:
4268 // CHECK9-NEXT: [[TMP5:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP11:![0-9]+]]
4269 // CHECK9-NEXT: [[TMP6:%.*]] = load i32, ptr [[DOTOMP_COMB_UB]], align 4, !llvm.access.group [[ACC_GRP11]]
4270 // CHECK9-NEXT: [[CMP1:%.*]] = icmp sle i32 [[TMP5]], [[TMP6]]
4271 // CHECK9-NEXT: br i1 [[CMP1]], label [[OMP_INNER_FOR_BODY:%.*]], label [[OMP_INNER_FOR_END:%.*]]
4272 // CHECK9: omp.inner.for.body:
4273 // CHECK9-NEXT: [[TMP7:%.*]] = load i32, ptr [[DOTOMP_COMB_LB]], align 4, !llvm.access.group [[ACC_GRP11]]
4274 // CHECK9-NEXT: [[TMP8:%.*]] = zext i32 [[TMP7]] to i64
4275 // CHECK9-NEXT: [[TMP9:%.*]] = load i32, ptr [[DOTOMP_COMB_UB]], align 4, !llvm.access.group [[ACC_GRP11]]
4276 // CHECK9-NEXT: [[TMP10:%.*]] = zext i32 [[TMP9]] to i64
4277 // CHECK9-NEXT: call void (ptr, i32, ptr, ...) @__kmpc_fork_call(ptr @[[GLOB3]], i32 2, ptr @{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z9gtid_testv_l43.omp_outlined.omp_outlined, i64 [[TMP8]], i64 [[TMP10]]), !llvm.access.group [[ACC_GRP11]]
4278 // CHECK9-NEXT: br label [[OMP_INNER_FOR_INC:%.*]]
4279 // CHECK9: omp.inner.for.inc:
4280 // CHECK9-NEXT: [[TMP11:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP11]]
4281 // CHECK9-NEXT: [[TMP12:%.*]] = load i32, ptr [[DOTOMP_STRIDE]], align 4, !llvm.access.group [[ACC_GRP11]]
4282 // CHECK9-NEXT: [[ADD:%.*]] = add nsw i32 [[TMP11]], [[TMP12]]
4283 // CHECK9-NEXT: store i32 [[ADD]], ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP11]]
4284 // CHECK9-NEXT: br label [[OMP_INNER_FOR_COND]], !llvm.loop [[LOOP12:![0-9]+]]
4285 // CHECK9: omp.inner.for.end:
4286 // CHECK9-NEXT: br label [[OMP_LOOP_EXIT:%.*]]
4287 // CHECK9: omp.loop.exit:
4288 // CHECK9-NEXT: call void @__kmpc_for_static_fini(ptr @[[GLOB1]], i32 [[TMP1]])
4289 // CHECK9-NEXT: [[TMP13:%.*]] = load i32, ptr [[DOTOMP_IS_LAST]], align 4
4290 // CHECK9-NEXT: [[TMP14:%.*]] = icmp ne i32 [[TMP13]], 0
4291 // CHECK9-NEXT: br i1 [[TMP14]], label [[DOTOMP_FINAL_THEN:%.*]], label [[DOTOMP_FINAL_DONE:%.*]]
4292 // CHECK9: .omp.final.then:
4293 // CHECK9-NEXT: store i32 100, ptr [[I]], align 4
4294 // CHECK9-NEXT: br label [[DOTOMP_FINAL_DONE]]
4295 // CHECK9: .omp.final.done:
4296 // CHECK9-NEXT: ret void
4299 // CHECK9-LABEL: define {{[^@]+}}@{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z9gtid_testv_l43.omp_outlined.omp_outlined
4300 // CHECK9-SAME: (ptr noalias noundef [[DOTGLOBAL_TID_:%.*]], ptr noalias noundef [[DOTBOUND_TID_:%.*]], i64 noundef [[DOTPREVIOUS_LB_:%.*]], i64 noundef [[DOTPREVIOUS_UB_:%.*]]) #[[ATTR1]] {
4301 // CHECK9-NEXT: entry:
4302 // CHECK9-NEXT: [[DOTGLOBAL_TID__ADDR:%.*]] = alloca ptr, align 8
4303 // CHECK9-NEXT: [[DOTBOUND_TID__ADDR:%.*]] = alloca ptr, align 8
4304 // CHECK9-NEXT: [[DOTPREVIOUS_LB__ADDR:%.*]] = alloca i64, align 8
4305 // CHECK9-NEXT: [[DOTPREVIOUS_UB__ADDR:%.*]] = alloca i64, align 8
4306 // CHECK9-NEXT: [[DOTOMP_IV:%.*]] = alloca i32, align 4
4307 // CHECK9-NEXT: [[TMP:%.*]] = alloca i32, align 4
4308 // CHECK9-NEXT: [[DOTOMP_LB:%.*]] = alloca i32, align 4
4309 // CHECK9-NEXT: [[DOTOMP_UB:%.*]] = alloca i32, align 4
4310 // CHECK9-NEXT: [[DOTOMP_STRIDE:%.*]] = alloca i32, align 4
4311 // CHECK9-NEXT: [[DOTOMP_IS_LAST:%.*]] = alloca i32, align 4
4312 // CHECK9-NEXT: [[I:%.*]] = alloca i32, align 4
4313 // CHECK9-NEXT: store ptr [[DOTGLOBAL_TID_]], ptr [[DOTGLOBAL_TID__ADDR]], align 8
4314 // CHECK9-NEXT: store ptr [[DOTBOUND_TID_]], ptr [[DOTBOUND_TID__ADDR]], align 8
4315 // CHECK9-NEXT: store i64 [[DOTPREVIOUS_LB_]], ptr [[DOTPREVIOUS_LB__ADDR]], align 8
4316 // CHECK9-NEXT: store i64 [[DOTPREVIOUS_UB_]], ptr [[DOTPREVIOUS_UB__ADDR]], align 8
4317 // CHECK9-NEXT: store i32 0, ptr [[DOTOMP_LB]], align 4
4318 // CHECK9-NEXT: store i32 99, ptr [[DOTOMP_UB]], align 4
4319 // CHECK9-NEXT: [[TMP0:%.*]] = load i64, ptr [[DOTPREVIOUS_LB__ADDR]], align 8
4320 // CHECK9-NEXT: [[CONV:%.*]] = trunc i64 [[TMP0]] to i32
4321 // CHECK9-NEXT: [[TMP1:%.*]] = load i64, ptr [[DOTPREVIOUS_UB__ADDR]], align 8
4322 // CHECK9-NEXT: [[CONV1:%.*]] = trunc i64 [[TMP1]] to i32
4323 // CHECK9-NEXT: store i32 [[CONV]], ptr [[DOTOMP_LB]], align 4
4324 // CHECK9-NEXT: store i32 [[CONV1]], ptr [[DOTOMP_UB]], align 4
4325 // CHECK9-NEXT: store i32 1, ptr [[DOTOMP_STRIDE]], align 4
4326 // CHECK9-NEXT: store i32 0, ptr [[DOTOMP_IS_LAST]], align 4
4327 // CHECK9-NEXT: [[TMP2:%.*]] = load ptr, ptr [[DOTGLOBAL_TID__ADDR]], align 8
4328 // CHECK9-NEXT: [[TMP3:%.*]] = load i32, ptr [[TMP2]], align 4
4329 // CHECK9-NEXT: call void @__kmpc_for_static_init_4(ptr @[[GLOB2:[0-9]+]], i32 [[TMP3]], i32 34, ptr [[DOTOMP_IS_LAST]], ptr [[DOTOMP_LB]], ptr [[DOTOMP_UB]], ptr [[DOTOMP_STRIDE]], i32 1, i32 1)
4330 // CHECK9-NEXT: [[TMP4:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4
4331 // CHECK9-NEXT: [[CMP:%.*]] = icmp sgt i32 [[TMP4]], 99
4332 // CHECK9-NEXT: br i1 [[CMP]], label [[COND_TRUE:%.*]], label [[COND_FALSE:%.*]]
4333 // CHECK9: cond.true:
4334 // CHECK9-NEXT: br label [[COND_END:%.*]]
4335 // CHECK9: cond.false:
4336 // CHECK9-NEXT: [[TMP5:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4
4337 // CHECK9-NEXT: br label [[COND_END]]
4338 // CHECK9: cond.end:
4339 // CHECK9-NEXT: [[COND:%.*]] = phi i32 [ 99, [[COND_TRUE]] ], [ [[TMP5]], [[COND_FALSE]] ]
4340 // CHECK9-NEXT: store i32 [[COND]], ptr [[DOTOMP_UB]], align 4
4341 // CHECK9-NEXT: [[TMP6:%.*]] = load i32, ptr [[DOTOMP_LB]], align 4
4342 // CHECK9-NEXT: store i32 [[TMP6]], ptr [[DOTOMP_IV]], align 4
4343 // CHECK9-NEXT: br label [[OMP_INNER_FOR_COND:%.*]]
4344 // CHECK9: omp.inner.for.cond:
4345 // CHECK9-NEXT: [[TMP7:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP15:![0-9]+]]
4346 // CHECK9-NEXT: [[TMP8:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4, !llvm.access.group [[ACC_GRP15]]
4347 // CHECK9-NEXT: [[CMP2:%.*]] = icmp sle i32 [[TMP7]], [[TMP8]]
4348 // CHECK9-NEXT: br i1 [[CMP2]], label [[OMP_INNER_FOR_BODY:%.*]], label [[OMP_INNER_FOR_END:%.*]]
4349 // CHECK9: omp.inner.for.body:
4350 // CHECK9-NEXT: [[TMP9:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP15]]
4351 // CHECK9-NEXT: [[MUL:%.*]] = mul nsw i32 [[TMP9]], 1
4352 // CHECK9-NEXT: [[ADD:%.*]] = add nsw i32 0, [[MUL]]
4353 // CHECK9-NEXT: store i32 [[ADD]], ptr [[I]], align 4, !llvm.access.group [[ACC_GRP15]]
4354 // CHECK9-NEXT: br label [[OMP_BODY_CONTINUE:%.*]]
4355 // CHECK9: omp.body.continue:
4356 // CHECK9-NEXT: br label [[OMP_INNER_FOR_INC:%.*]]
4357 // CHECK9: omp.inner.for.inc:
4358 // CHECK9-NEXT: [[TMP10:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP15]]
4359 // CHECK9-NEXT: [[ADD3:%.*]] = add nsw i32 [[TMP10]], 1
4360 // CHECK9-NEXT: store i32 [[ADD3]], ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP15]]
4361 // CHECK9-NEXT: br label [[OMP_INNER_FOR_COND]], !llvm.loop [[LOOP16:![0-9]+]]
4362 // CHECK9: omp.inner.for.end:
4363 // CHECK9-NEXT: br label [[OMP_LOOP_EXIT:%.*]]
4364 // CHECK9: omp.loop.exit:
4365 // CHECK9-NEXT: call void @__kmpc_for_static_fini(ptr @[[GLOB1]], i32 [[TMP3]])
4366 // CHECK9-NEXT: [[TMP11:%.*]] = load i32, ptr [[DOTOMP_IS_LAST]], align 4
4367 // CHECK9-NEXT: [[TMP12:%.*]] = icmp ne i32 [[TMP11]], 0
4368 // CHECK9-NEXT: br i1 [[TMP12]], label [[DOTOMP_FINAL_THEN:%.*]], label [[DOTOMP_FINAL_DONE:%.*]]
4369 // CHECK9: .omp.final.then:
4370 // CHECK9-NEXT: store i32 100, ptr [[I]], align 4
4371 // CHECK9-NEXT: br label [[DOTOMP_FINAL_DONE]]
4372 // CHECK9: .omp.final.done:
4373 // CHECK9-NEXT: ret void
4376 // CHECK9-LABEL: define {{[^@]+}}@{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z9gtid_testv_l48
4377 // CHECK9-SAME: () #[[ATTR1]] {
4378 // CHECK9-NEXT: entry:
4379 // CHECK9-NEXT: call void (ptr, i32, ptr, ...) @__kmpc_fork_teams(ptr @[[GLOB3]], i32 0, ptr @{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z9gtid_testv_l48.omp_outlined)
4380 // CHECK9-NEXT: ret void
4383 // CHECK9-LABEL: define {{[^@]+}}@{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z9gtid_testv_l48.omp_outlined
4384 // CHECK9-SAME: (ptr noalias noundef [[DOTGLOBAL_TID_:%.*]], ptr noalias noundef [[DOTBOUND_TID_:%.*]]) #[[ATTR1]] {
4385 // CHECK9-NEXT: entry:
4386 // CHECK9-NEXT: [[DOTGLOBAL_TID__ADDR:%.*]] = alloca ptr, align 8
4387 // CHECK9-NEXT: [[DOTBOUND_TID__ADDR:%.*]] = alloca ptr, align 8
4388 // CHECK9-NEXT: [[DOTOMP_IV:%.*]] = alloca i32, align 4
4389 // CHECK9-NEXT: [[TMP:%.*]] = alloca i32, align 4
4390 // CHECK9-NEXT: [[DOTOMP_COMB_LB:%.*]] = alloca i32, align 4
4391 // CHECK9-NEXT: [[DOTOMP_COMB_UB:%.*]] = alloca i32, align 4
4392 // CHECK9-NEXT: [[DOTOMP_STRIDE:%.*]] = alloca i32, align 4
4393 // CHECK9-NEXT: [[DOTOMP_IS_LAST:%.*]] = alloca i32, align 4
4394 // CHECK9-NEXT: [[I:%.*]] = alloca i32, align 4
4395 // CHECK9-NEXT: [[DOTBOUND_ZERO_ADDR:%.*]] = alloca i32, align 4
4396 // CHECK9-NEXT: store ptr [[DOTGLOBAL_TID_]], ptr [[DOTGLOBAL_TID__ADDR]], align 8
4397 // CHECK9-NEXT: store ptr [[DOTBOUND_TID_]], ptr [[DOTBOUND_TID__ADDR]], align 8
4398 // CHECK9-NEXT: store i32 0, ptr [[DOTOMP_COMB_LB]], align 4
4399 // CHECK9-NEXT: store i32 99, ptr [[DOTOMP_COMB_UB]], align 4
4400 // CHECK9-NEXT: store i32 1, ptr [[DOTOMP_STRIDE]], align 4
4401 // CHECK9-NEXT: store i32 0, ptr [[DOTOMP_IS_LAST]], align 4
4402 // CHECK9-NEXT: [[TMP0:%.*]] = load ptr, ptr [[DOTGLOBAL_TID__ADDR]], align 8
4403 // CHECK9-NEXT: [[TMP1:%.*]] = load i32, ptr [[TMP0]], align 4
4404 // CHECK9-NEXT: call void @__kmpc_for_static_init_4(ptr @[[GLOB1]], i32 [[TMP1]], i32 92, ptr [[DOTOMP_IS_LAST]], ptr [[DOTOMP_COMB_LB]], ptr [[DOTOMP_COMB_UB]], ptr [[DOTOMP_STRIDE]], i32 1, i32 1)
4405 // CHECK9-NEXT: [[TMP2:%.*]] = load i32, ptr [[DOTOMP_COMB_UB]], align 4
4406 // CHECK9-NEXT: [[CMP:%.*]] = icmp sgt i32 [[TMP2]], 99
4407 // CHECK9-NEXT: br i1 [[CMP]], label [[COND_TRUE:%.*]], label [[COND_FALSE:%.*]]
4408 // CHECK9: cond.true:
4409 // CHECK9-NEXT: br label [[COND_END:%.*]]
4410 // CHECK9: cond.false:
4411 // CHECK9-NEXT: [[TMP3:%.*]] = load i32, ptr [[DOTOMP_COMB_UB]], align 4
4412 // CHECK9-NEXT: br label [[COND_END]]
4413 // CHECK9: cond.end:
4414 // CHECK9-NEXT: [[COND:%.*]] = phi i32 [ 99, [[COND_TRUE]] ], [ [[TMP3]], [[COND_FALSE]] ]
4415 // CHECK9-NEXT: store i32 [[COND]], ptr [[DOTOMP_COMB_UB]], align 4
4416 // CHECK9-NEXT: [[TMP4:%.*]] = load i32, ptr [[DOTOMP_COMB_LB]], align 4
4417 // CHECK9-NEXT: store i32 [[TMP4]], ptr [[DOTOMP_IV]], align 4
4418 // CHECK9-NEXT: br label [[OMP_INNER_FOR_COND:%.*]]
4419 // CHECK9: omp.inner.for.cond:
4420 // CHECK9-NEXT: [[TMP5:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP20:![0-9]+]]
4421 // CHECK9-NEXT: [[TMP6:%.*]] = load i32, ptr [[DOTOMP_COMB_UB]], align 4, !llvm.access.group [[ACC_GRP20]]
4422 // CHECK9-NEXT: [[CMP1:%.*]] = icmp sle i32 [[TMP5]], [[TMP6]]
4423 // CHECK9-NEXT: br i1 [[CMP1]], label [[OMP_INNER_FOR_BODY:%.*]], label [[OMP_INNER_FOR_END:%.*]]
4424 // CHECK9: omp.inner.for.body:
4425 // CHECK9-NEXT: [[TMP7:%.*]] = load i32, ptr [[DOTOMP_COMB_LB]], align 4, !llvm.access.group [[ACC_GRP20]]
4426 // CHECK9-NEXT: [[TMP8:%.*]] = zext i32 [[TMP7]] to i64
4427 // CHECK9-NEXT: [[TMP9:%.*]] = load i32, ptr [[DOTOMP_COMB_UB]], align 4, !llvm.access.group [[ACC_GRP20]]
4428 // CHECK9-NEXT: [[TMP10:%.*]] = zext i32 [[TMP9]] to i64
4429 // CHECK9-NEXT: call void @__kmpc_serialized_parallel(ptr @[[GLOB3]], i32 [[TMP1]]), !llvm.access.group [[ACC_GRP20]]
4430 // CHECK9-NEXT: [[TMP11:%.*]] = load ptr, ptr [[DOTGLOBAL_TID__ADDR]], align 8, !llvm.access.group [[ACC_GRP20]]
4431 // CHECK9-NEXT: store i32 0, ptr [[DOTBOUND_ZERO_ADDR]], align 4, !llvm.access.group [[ACC_GRP20]]
4432 // CHECK9-NEXT: call void @{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z9gtid_testv_l48.omp_outlined.omp_outlined(ptr [[TMP11]], ptr [[DOTBOUND_ZERO_ADDR]], i64 [[TMP8]], i64 [[TMP10]]) #[[ATTR2]], !llvm.access.group [[ACC_GRP20]]
4433 // CHECK9-NEXT: call void @__kmpc_end_serialized_parallel(ptr @[[GLOB3]], i32 [[TMP1]]), !llvm.access.group [[ACC_GRP20]]
4434 // CHECK9-NEXT: br label [[OMP_INNER_FOR_INC:%.*]]
4435 // CHECK9: omp.inner.for.inc:
4436 // CHECK9-NEXT: [[TMP12:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP20]]
4437 // CHECK9-NEXT: [[TMP13:%.*]] = load i32, ptr [[DOTOMP_STRIDE]], align 4, !llvm.access.group [[ACC_GRP20]]
4438 // CHECK9-NEXT: [[ADD:%.*]] = add nsw i32 [[TMP12]], [[TMP13]]
4439 // CHECK9-NEXT: store i32 [[ADD]], ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP20]]
4440 // CHECK9-NEXT: br label [[OMP_INNER_FOR_COND]], !llvm.loop [[LOOP21:![0-9]+]]
4441 // CHECK9: omp.inner.for.end:
4442 // CHECK9-NEXT: br label [[OMP_LOOP_EXIT:%.*]]
4443 // CHECK9: omp.loop.exit:
4444 // CHECK9-NEXT: call void @__kmpc_for_static_fini(ptr @[[GLOB1]], i32 [[TMP1]])
4445 // CHECK9-NEXT: [[TMP14:%.*]] = load i32, ptr [[DOTOMP_IS_LAST]], align 4
4446 // CHECK9-NEXT: [[TMP15:%.*]] = icmp ne i32 [[TMP14]], 0
4447 // CHECK9-NEXT: br i1 [[TMP15]], label [[DOTOMP_FINAL_THEN:%.*]], label [[DOTOMP_FINAL_DONE:%.*]]
4448 // CHECK9: .omp.final.then:
4449 // CHECK9-NEXT: store i32 100, ptr [[I]], align 4
4450 // CHECK9-NEXT: br label [[DOTOMP_FINAL_DONE]]
4451 // CHECK9: .omp.final.done:
4452 // CHECK9-NEXT: ret void
4455 // CHECK9-LABEL: define {{[^@]+}}@{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z9gtid_testv_l48.omp_outlined.omp_outlined
4456 // CHECK9-SAME: (ptr noalias noundef [[DOTGLOBAL_TID_:%.*]], ptr noalias noundef [[DOTBOUND_TID_:%.*]], i64 noundef [[DOTPREVIOUS_LB_:%.*]], i64 noundef [[DOTPREVIOUS_UB_:%.*]]) #[[ATTR1]] {
4457 // CHECK9-NEXT: entry:
4458 // CHECK9-NEXT: [[DOTGLOBAL_TID__ADDR:%.*]] = alloca ptr, align 8
4459 // CHECK9-NEXT: [[DOTBOUND_TID__ADDR:%.*]] = alloca ptr, align 8
4460 // CHECK9-NEXT: [[DOTPREVIOUS_LB__ADDR:%.*]] = alloca i64, align 8
4461 // CHECK9-NEXT: [[DOTPREVIOUS_UB__ADDR:%.*]] = alloca i64, align 8
4462 // CHECK9-NEXT: [[DOTOMP_IV:%.*]] = alloca i32, align 4
4463 // CHECK9-NEXT: [[TMP:%.*]] = alloca i32, align 4
4464 // CHECK9-NEXT: [[DOTOMP_LB:%.*]] = alloca i32, align 4
4465 // CHECK9-NEXT: [[DOTOMP_UB:%.*]] = alloca i32, align 4
4466 // CHECK9-NEXT: [[DOTOMP_STRIDE:%.*]] = alloca i32, align 4
4467 // CHECK9-NEXT: [[DOTOMP_IS_LAST:%.*]] = alloca i32, align 4
4468 // CHECK9-NEXT: [[I:%.*]] = alloca i32, align 4
4469 // CHECK9-NEXT: store ptr [[DOTGLOBAL_TID_]], ptr [[DOTGLOBAL_TID__ADDR]], align 8
4470 // CHECK9-NEXT: store ptr [[DOTBOUND_TID_]], ptr [[DOTBOUND_TID__ADDR]], align 8
4471 // CHECK9-NEXT: store i64 [[DOTPREVIOUS_LB_]], ptr [[DOTPREVIOUS_LB__ADDR]], align 8
4472 // CHECK9-NEXT: store i64 [[DOTPREVIOUS_UB_]], ptr [[DOTPREVIOUS_UB__ADDR]], align 8
4473 // CHECK9-NEXT: store i32 0, ptr [[DOTOMP_LB]], align 4
4474 // CHECK9-NEXT: store i32 99, ptr [[DOTOMP_UB]], align 4
4475 // CHECK9-NEXT: [[TMP0:%.*]] = load i64, ptr [[DOTPREVIOUS_LB__ADDR]], align 8
4476 // CHECK9-NEXT: [[CONV:%.*]] = trunc i64 [[TMP0]] to i32
4477 // CHECK9-NEXT: [[TMP1:%.*]] = load i64, ptr [[DOTPREVIOUS_UB__ADDR]], align 8
4478 // CHECK9-NEXT: [[CONV1:%.*]] = trunc i64 [[TMP1]] to i32
4479 // CHECK9-NEXT: store i32 [[CONV]], ptr [[DOTOMP_LB]], align 4
4480 // CHECK9-NEXT: store i32 [[CONV1]], ptr [[DOTOMP_UB]], align 4
4481 // CHECK9-NEXT: store i32 1, ptr [[DOTOMP_STRIDE]], align 4
4482 // CHECK9-NEXT: store i32 0, ptr [[DOTOMP_IS_LAST]], align 4
4483 // CHECK9-NEXT: [[TMP2:%.*]] = load ptr, ptr [[DOTGLOBAL_TID__ADDR]], align 8
4484 // CHECK9-NEXT: [[TMP3:%.*]] = load i32, ptr [[TMP2]], align 4
4485 // CHECK9-NEXT: call void @__kmpc_for_static_init_4(ptr @[[GLOB2]], i32 [[TMP3]], i32 34, ptr [[DOTOMP_IS_LAST]], ptr [[DOTOMP_LB]], ptr [[DOTOMP_UB]], ptr [[DOTOMP_STRIDE]], i32 1, i32 1)
4486 // CHECK9-NEXT: [[TMP4:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4
4487 // CHECK9-NEXT: [[CMP:%.*]] = icmp sgt i32 [[TMP4]], 99
4488 // CHECK9-NEXT: br i1 [[CMP]], label [[COND_TRUE:%.*]], label [[COND_FALSE:%.*]]
4489 // CHECK9: cond.true:
4490 // CHECK9-NEXT: br label [[COND_END:%.*]]
4491 // CHECK9: cond.false:
4492 // CHECK9-NEXT: [[TMP5:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4
4493 // CHECK9-NEXT: br label [[COND_END]]
4494 // CHECK9: cond.end:
4495 // CHECK9-NEXT: [[COND:%.*]] = phi i32 [ 99, [[COND_TRUE]] ], [ [[TMP5]], [[COND_FALSE]] ]
4496 // CHECK9-NEXT: store i32 [[COND]], ptr [[DOTOMP_UB]], align 4
4497 // CHECK9-NEXT: [[TMP6:%.*]] = load i32, ptr [[DOTOMP_LB]], align 4
4498 // CHECK9-NEXT: store i32 [[TMP6]], ptr [[DOTOMP_IV]], align 4
4499 // CHECK9-NEXT: br label [[OMP_INNER_FOR_COND:%.*]]
4500 // CHECK9: omp.inner.for.cond:
4501 // CHECK9-NEXT: [[TMP7:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP23:![0-9]+]]
4502 // CHECK9-NEXT: [[TMP8:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4, !llvm.access.group [[ACC_GRP23]]
4503 // CHECK9-NEXT: [[CMP2:%.*]] = icmp sle i32 [[TMP7]], [[TMP8]]
4504 // CHECK9-NEXT: br i1 [[CMP2]], label [[OMP_INNER_FOR_BODY:%.*]], label [[OMP_INNER_FOR_END:%.*]]
4505 // CHECK9: omp.inner.for.body:
4506 // CHECK9-NEXT: [[TMP9:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP23]]
4507 // CHECK9-NEXT: [[MUL:%.*]] = mul nsw i32 [[TMP9]], 1
4508 // CHECK9-NEXT: [[ADD:%.*]] = add nsw i32 0, [[MUL]]
4509 // CHECK9-NEXT: store i32 [[ADD]], ptr [[I]], align 4, !llvm.access.group [[ACC_GRP23]]
4510 // CHECK9-NEXT: call void @_Z9gtid_testv(), !llvm.access.group [[ACC_GRP23]]
4511 // CHECK9-NEXT: br label [[OMP_BODY_CONTINUE:%.*]]
4512 // CHECK9: omp.body.continue:
4513 // CHECK9-NEXT: br label [[OMP_INNER_FOR_INC:%.*]]
4514 // CHECK9: omp.inner.for.inc:
4515 // CHECK9-NEXT: [[TMP10:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP23]]
4516 // CHECK9-NEXT: [[ADD3:%.*]] = add nsw i32 [[TMP10]], 1
4517 // CHECK9-NEXT: store i32 [[ADD3]], ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP23]]
4518 // CHECK9-NEXT: br label [[OMP_INNER_FOR_COND]], !llvm.loop [[LOOP24:![0-9]+]]
4519 // CHECK9: omp.inner.for.end:
4520 // CHECK9-NEXT: br label [[OMP_LOOP_EXIT:%.*]]
4521 // CHECK9: omp.loop.exit:
4522 // CHECK9-NEXT: call void @__kmpc_for_static_fini(ptr @[[GLOB1]], i32 [[TMP3]])
4523 // CHECK9-NEXT: [[TMP11:%.*]] = load i32, ptr [[DOTOMP_IS_LAST]], align 4
4524 // CHECK9-NEXT: [[TMP12:%.*]] = icmp ne i32 [[TMP11]], 0
4525 // CHECK9-NEXT: br i1 [[TMP12]], label [[DOTOMP_FINAL_THEN:%.*]], label [[DOTOMP_FINAL_DONE:%.*]]
4526 // CHECK9: .omp.final.then:
4527 // CHECK9-NEXT: store i32 100, ptr [[I]], align 4
4528 // CHECK9-NEXT: br label [[DOTOMP_FINAL_DONE]]
4529 // CHECK9: .omp.final.done:
4530 // CHECK9-NEXT: ret void
4533 // CHECK9-LABEL: define {{[^@]+}}@main
4534 // CHECK9-SAME: () #[[ATTR3:[0-9]+]] {
4535 // CHECK9-NEXT: entry:
4536 // CHECK9-NEXT: [[RETVAL:%.*]] = alloca i32, align 4
4537 // CHECK9-NEXT: [[TMP:%.*]] = alloca i32, align 4
4538 // CHECK9-NEXT: [[KERNEL_ARGS:%.*]] = alloca [[STRUCT___TGT_KERNEL_ARGUMENTS:%.*]], align 8
4539 // CHECK9-NEXT: [[_TMP1:%.*]] = alloca i32, align 4
4540 // CHECK9-NEXT: [[KERNEL_ARGS2:%.*]] = alloca [[STRUCT___TGT_KERNEL_ARGUMENTS]], align 8
4541 // CHECK9-NEXT: [[ARG_CASTED:%.*]] = alloca i64, align 8
4542 // CHECK9-NEXT: [[DOTOFFLOAD_BASEPTRS:%.*]] = alloca [1 x ptr], align 8
4543 // CHECK9-NEXT: [[DOTOFFLOAD_PTRS:%.*]] = alloca [1 x ptr], align 8
4544 // CHECK9-NEXT: [[DOTOFFLOAD_MAPPERS:%.*]] = alloca [1 x ptr], align 8
4545 // CHECK9-NEXT: [[_TMP5:%.*]] = alloca i32, align 4
4546 // CHECK9-NEXT: [[KERNEL_ARGS6:%.*]] = alloca [[STRUCT___TGT_KERNEL_ARGUMENTS]], align 8
4547 // CHECK9-NEXT: store i32 0, ptr [[RETVAL]], align 4
4548 // CHECK9-NEXT: [[TMP0:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 0
4549 // CHECK9-NEXT: store i32 2, ptr [[TMP0]], align 4
4550 // CHECK9-NEXT: [[TMP1:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 1
4551 // CHECK9-NEXT: store i32 0, ptr [[TMP1]], align 4
4552 // CHECK9-NEXT: [[TMP2:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 2
4553 // CHECK9-NEXT: store ptr null, ptr [[TMP2]], align 8
4554 // CHECK9-NEXT: [[TMP3:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 3
4555 // CHECK9-NEXT: store ptr null, ptr [[TMP3]], align 8
4556 // CHECK9-NEXT: [[TMP4:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 4
4557 // CHECK9-NEXT: store ptr null, ptr [[TMP4]], align 8
4558 // CHECK9-NEXT: [[TMP5:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 5
4559 // CHECK9-NEXT: store ptr null, ptr [[TMP5]], align 8
4560 // CHECK9-NEXT: [[TMP6:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 6
4561 // CHECK9-NEXT: store ptr null, ptr [[TMP6]], align 8
4562 // CHECK9-NEXT: [[TMP7:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 7
4563 // CHECK9-NEXT: store ptr null, ptr [[TMP7]], align 8
4564 // CHECK9-NEXT: [[TMP8:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 8
4565 // CHECK9-NEXT: store i64 100, ptr [[TMP8]], align 8
4566 // CHECK9-NEXT: [[TMP9:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 9
4567 // CHECK9-NEXT: store i64 0, ptr [[TMP9]], align 8
4568 // CHECK9-NEXT: [[TMP10:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 10
4569 // CHECK9-NEXT: store [3 x i32] zeroinitializer, ptr [[TMP10]], align 4
4570 // CHECK9-NEXT: [[TMP11:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 11
4571 // CHECK9-NEXT: store [3 x i32] zeroinitializer, ptr [[TMP11]], align 4
4572 // CHECK9-NEXT: [[TMP12:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 12
4573 // CHECK9-NEXT: store i32 0, ptr [[TMP12]], align 4
4574 // CHECK9-NEXT: [[TMP13:%.*]] = call i32 @__tgt_target_kernel(ptr @[[GLOB3]], i64 -1, i32 0, i32 0, ptr @.{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}_main_l81.region_id, ptr [[KERNEL_ARGS]])
4575 // CHECK9-NEXT: [[TMP14:%.*]] = icmp ne i32 [[TMP13]], 0
4576 // CHECK9-NEXT: br i1 [[TMP14]], label [[OMP_OFFLOAD_FAILED:%.*]], label [[OMP_OFFLOAD_CONT:%.*]]
4577 // CHECK9: omp_offload.failed:
4578 // CHECK9-NEXT: call void @{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}_main_l81() #[[ATTR2]]
4579 // CHECK9-NEXT: br label [[OMP_OFFLOAD_CONT]]
4580 // CHECK9: omp_offload.cont:
4581 // CHECK9-NEXT: [[TMP15:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS2]], i32 0, i32 0
4582 // CHECK9-NEXT: store i32 2, ptr [[TMP15]], align 4
4583 // CHECK9-NEXT: [[TMP16:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS2]], i32 0, i32 1
4584 // CHECK9-NEXT: store i32 0, ptr [[TMP16]], align 4
4585 // CHECK9-NEXT: [[TMP17:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS2]], i32 0, i32 2
4586 // CHECK9-NEXT: store ptr null, ptr [[TMP17]], align 8
4587 // CHECK9-NEXT: [[TMP18:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS2]], i32 0, i32 3
4588 // CHECK9-NEXT: store ptr null, ptr [[TMP18]], align 8
4589 // CHECK9-NEXT: [[TMP19:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS2]], i32 0, i32 4
4590 // CHECK9-NEXT: store ptr null, ptr [[TMP19]], align 8
4591 // CHECK9-NEXT: [[TMP20:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS2]], i32 0, i32 5
4592 // CHECK9-NEXT: store ptr null, ptr [[TMP20]], align 8
4593 // CHECK9-NEXT: [[TMP21:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS2]], i32 0, i32 6
4594 // CHECK9-NEXT: store ptr null, ptr [[TMP21]], align 8
4595 // CHECK9-NEXT: [[TMP22:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS2]], i32 0, i32 7
4596 // CHECK9-NEXT: store ptr null, ptr [[TMP22]], align 8
4597 // CHECK9-NEXT: [[TMP23:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS2]], i32 0, i32 8
4598 // CHECK9-NEXT: store i64 100, ptr [[TMP23]], align 8
4599 // CHECK9-NEXT: [[TMP24:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS2]], i32 0, i32 9
4600 // CHECK9-NEXT: store i64 0, ptr [[TMP24]], align 8
4601 // CHECK9-NEXT: [[TMP25:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS2]], i32 0, i32 10
4602 // CHECK9-NEXT: store [3 x i32] zeroinitializer, ptr [[TMP25]], align 4
4603 // CHECK9-NEXT: [[TMP26:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS2]], i32 0, i32 11
4604 // CHECK9-NEXT: store [3 x i32] zeroinitializer, ptr [[TMP26]], align 4
4605 // CHECK9-NEXT: [[TMP27:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS2]], i32 0, i32 12
4606 // CHECK9-NEXT: store i32 0, ptr [[TMP27]], align 4
4607 // CHECK9-NEXT: [[TMP28:%.*]] = call i32 @__tgt_target_kernel(ptr @[[GLOB3]], i64 -1, i32 0, i32 0, ptr @.{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}_main_l90.region_id, ptr [[KERNEL_ARGS2]])
4608 // CHECK9-NEXT: [[TMP29:%.*]] = icmp ne i32 [[TMP28]], 0
4609 // CHECK9-NEXT: br i1 [[TMP29]], label [[OMP_OFFLOAD_FAILED3:%.*]], label [[OMP_OFFLOAD_CONT4:%.*]]
4610 // CHECK9: omp_offload.failed3:
4611 // CHECK9-NEXT: call void @{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}_main_l90() #[[ATTR2]]
4612 // CHECK9-NEXT: br label [[OMP_OFFLOAD_CONT4]]
4613 // CHECK9: omp_offload.cont4:
4614 // CHECK9-NEXT: [[TMP30:%.*]] = load i32, ptr @Arg, align 4
4615 // CHECK9-NEXT: store i32 [[TMP30]], ptr [[ARG_CASTED]], align 4
4616 // CHECK9-NEXT: [[TMP31:%.*]] = load i64, ptr [[ARG_CASTED]], align 8
4617 // CHECK9-NEXT: [[TMP32:%.*]] = getelementptr inbounds [1 x ptr], ptr [[DOTOFFLOAD_BASEPTRS]], i32 0, i32 0
4618 // CHECK9-NEXT: store i64 [[TMP31]], ptr [[TMP32]], align 8
4619 // CHECK9-NEXT: [[TMP33:%.*]] = getelementptr inbounds [1 x ptr], ptr [[DOTOFFLOAD_PTRS]], i32 0, i32 0
4620 // CHECK9-NEXT: store i64 [[TMP31]], ptr [[TMP33]], align 8
4621 // CHECK9-NEXT: [[TMP34:%.*]] = getelementptr inbounds [1 x ptr], ptr [[DOTOFFLOAD_MAPPERS]], i64 0, i64 0
4622 // CHECK9-NEXT: store ptr null, ptr [[TMP34]], align 8
4623 // CHECK9-NEXT: [[TMP35:%.*]] = getelementptr inbounds [1 x ptr], ptr [[DOTOFFLOAD_BASEPTRS]], i32 0, i32 0
4624 // CHECK9-NEXT: [[TMP36:%.*]] = getelementptr inbounds [1 x ptr], ptr [[DOTOFFLOAD_PTRS]], i32 0, i32 0
4625 // CHECK9-NEXT: [[TMP37:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS6]], i32 0, i32 0
4626 // CHECK9-NEXT: store i32 2, ptr [[TMP37]], align 4
4627 // CHECK9-NEXT: [[TMP38:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS6]], i32 0, i32 1
4628 // CHECK9-NEXT: store i32 1, ptr [[TMP38]], align 4
4629 // CHECK9-NEXT: [[TMP39:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS6]], i32 0, i32 2
4630 // CHECK9-NEXT: store ptr [[TMP35]], ptr [[TMP39]], align 8
4631 // CHECK9-NEXT: [[TMP40:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS6]], i32 0, i32 3
4632 // CHECK9-NEXT: store ptr [[TMP36]], ptr [[TMP40]], align 8
4633 // CHECK9-NEXT: [[TMP41:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS6]], i32 0, i32 4
4634 // CHECK9-NEXT: store ptr @.offload_sizes, ptr [[TMP41]], align 8
4635 // CHECK9-NEXT: [[TMP42:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS6]], i32 0, i32 5
4636 // CHECK9-NEXT: store ptr @.offload_maptypes, ptr [[TMP42]], align 8
4637 // CHECK9-NEXT: [[TMP43:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS6]], i32 0, i32 6
4638 // CHECK9-NEXT: store ptr null, ptr [[TMP43]], align 8
4639 // CHECK9-NEXT: [[TMP44:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS6]], i32 0, i32 7
4640 // CHECK9-NEXT: store ptr null, ptr [[TMP44]], align 8
4641 // CHECK9-NEXT: [[TMP45:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS6]], i32 0, i32 8
4642 // CHECK9-NEXT: store i64 100, ptr [[TMP45]], align 8
4643 // CHECK9-NEXT: [[TMP46:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS6]], i32 0, i32 9
4644 // CHECK9-NEXT: store i64 0, ptr [[TMP46]], align 8
4645 // CHECK9-NEXT: [[TMP47:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS6]], i32 0, i32 10
4646 // CHECK9-NEXT: store [3 x i32] zeroinitializer, ptr [[TMP47]], align 4
4647 // CHECK9-NEXT: [[TMP48:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS6]], i32 0, i32 11
4648 // CHECK9-NEXT: store [3 x i32] zeroinitializer, ptr [[TMP48]], align 4
4649 // CHECK9-NEXT: [[TMP49:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS6]], i32 0, i32 12
4650 // CHECK9-NEXT: store i32 0, ptr [[TMP49]], align 4
4651 // CHECK9-NEXT: [[TMP50:%.*]] = call i32 @__tgt_target_kernel(ptr @[[GLOB3]], i64 -1, i32 0, i32 0, ptr @.{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}_main_l99.region_id, ptr [[KERNEL_ARGS6]])
4652 // CHECK9-NEXT: [[TMP51:%.*]] = icmp ne i32 [[TMP50]], 0
4653 // CHECK9-NEXT: br i1 [[TMP51]], label [[OMP_OFFLOAD_FAILED7:%.*]], label [[OMP_OFFLOAD_CONT8:%.*]]
4654 // CHECK9: omp_offload.failed7:
4655 // CHECK9-NEXT: call void @{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}_main_l99(i64 [[TMP31]]) #[[ATTR2]]
4656 // CHECK9-NEXT: br label [[OMP_OFFLOAD_CONT8]]
4657 // CHECK9: omp_offload.cont8:
4658 // CHECK9-NEXT: [[TMP52:%.*]] = load i32, ptr @Arg, align 4
4659 // CHECK9-NEXT: [[CALL:%.*]] = call noundef i32 @_Z5tmainIiEiT_(i32 noundef [[TMP52]])
4660 // CHECK9-NEXT: ret i32 [[CALL]]
4663 // CHECK9-LABEL: define {{[^@]+}}@{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}_main_l81
4664 // CHECK9-SAME: () #[[ATTR1]] {
4665 // CHECK9-NEXT: entry:
4666 // CHECK9-NEXT: call void (ptr, i32, ptr, ...) @__kmpc_fork_teams(ptr @[[GLOB3]], i32 0, ptr @{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}_main_l81.omp_outlined)
4667 // CHECK9-NEXT: ret void
4670 // CHECK9-LABEL: define {{[^@]+}}@{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}_main_l81.omp_outlined
4671 // CHECK9-SAME: (ptr noalias noundef [[DOTGLOBAL_TID_:%.*]], ptr noalias noundef [[DOTBOUND_TID_:%.*]]) #[[ATTR1]] {
4672 // CHECK9-NEXT: entry:
4673 // CHECK9-NEXT: [[DOTGLOBAL_TID__ADDR:%.*]] = alloca ptr, align 8
4674 // CHECK9-NEXT: [[DOTBOUND_TID__ADDR:%.*]] = alloca ptr, align 8
4675 // CHECK9-NEXT: [[DOTOMP_IV:%.*]] = alloca i32, align 4
4676 // CHECK9-NEXT: [[TMP:%.*]] = alloca i32, align 4
4677 // CHECK9-NEXT: [[DOTOMP_COMB_LB:%.*]] = alloca i32, align 4
4678 // CHECK9-NEXT: [[DOTOMP_COMB_UB:%.*]] = alloca i32, align 4
4679 // CHECK9-NEXT: [[DOTOMP_STRIDE:%.*]] = alloca i32, align 4
4680 // CHECK9-NEXT: [[DOTOMP_IS_LAST:%.*]] = alloca i32, align 4
4681 // CHECK9-NEXT: [[I:%.*]] = alloca i32, align 4
4682 // CHECK9-NEXT: store ptr [[DOTGLOBAL_TID_]], ptr [[DOTGLOBAL_TID__ADDR]], align 8
4683 // CHECK9-NEXT: store ptr [[DOTBOUND_TID_]], ptr [[DOTBOUND_TID__ADDR]], align 8
4684 // CHECK9-NEXT: store i32 0, ptr [[DOTOMP_COMB_LB]], align 4
4685 // CHECK9-NEXT: store i32 99, ptr [[DOTOMP_COMB_UB]], align 4
4686 // CHECK9-NEXT: store i32 1, ptr [[DOTOMP_STRIDE]], align 4
4687 // CHECK9-NEXT: store i32 0, ptr [[DOTOMP_IS_LAST]], align 4
4688 // CHECK9-NEXT: [[TMP0:%.*]] = load ptr, ptr [[DOTGLOBAL_TID__ADDR]], align 8
4689 // CHECK9-NEXT: [[TMP1:%.*]] = load i32, ptr [[TMP0]], align 4
4690 // CHECK9-NEXT: call void @__kmpc_for_static_init_4(ptr @[[GLOB1]], i32 [[TMP1]], i32 92, ptr [[DOTOMP_IS_LAST]], ptr [[DOTOMP_COMB_LB]], ptr [[DOTOMP_COMB_UB]], ptr [[DOTOMP_STRIDE]], i32 1, i32 1)
4691 // CHECK9-NEXT: [[TMP2:%.*]] = load i32, ptr [[DOTOMP_COMB_UB]], align 4
4692 // CHECK9-NEXT: [[CMP:%.*]] = icmp sgt i32 [[TMP2]], 99
4693 // CHECK9-NEXT: br i1 [[CMP]], label [[COND_TRUE:%.*]], label [[COND_FALSE:%.*]]
4694 // CHECK9: cond.true:
4695 // CHECK9-NEXT: br label [[COND_END:%.*]]
4696 // CHECK9: cond.false:
4697 // CHECK9-NEXT: [[TMP3:%.*]] = load i32, ptr [[DOTOMP_COMB_UB]], align 4
4698 // CHECK9-NEXT: br label [[COND_END]]
4699 // CHECK9: cond.end:
4700 // CHECK9-NEXT: [[COND:%.*]] = phi i32 [ 99, [[COND_TRUE]] ], [ [[TMP3]], [[COND_FALSE]] ]
4701 // CHECK9-NEXT: store i32 [[COND]], ptr [[DOTOMP_COMB_UB]], align 4
4702 // CHECK9-NEXT: [[TMP4:%.*]] = load i32, ptr [[DOTOMP_COMB_LB]], align 4
4703 // CHECK9-NEXT: store i32 [[TMP4]], ptr [[DOTOMP_IV]], align 4
4704 // CHECK9-NEXT: br label [[OMP_INNER_FOR_COND:%.*]]
4705 // CHECK9: omp.inner.for.cond:
4706 // CHECK9-NEXT: [[TMP5:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP26:![0-9]+]]
4707 // CHECK9-NEXT: [[TMP6:%.*]] = load i32, ptr [[DOTOMP_COMB_UB]], align 4, !llvm.access.group [[ACC_GRP26]]
4708 // CHECK9-NEXT: [[CMP1:%.*]] = icmp sle i32 [[TMP5]], [[TMP6]]
4709 // CHECK9-NEXT: br i1 [[CMP1]], label [[OMP_INNER_FOR_BODY:%.*]], label [[OMP_INNER_FOR_END:%.*]]
4710 // CHECK9: omp.inner.for.body:
4711 // CHECK9-NEXT: [[TMP7:%.*]] = load i32, ptr [[DOTOMP_COMB_LB]], align 4, !llvm.access.group [[ACC_GRP26]]
4712 // CHECK9-NEXT: [[TMP8:%.*]] = zext i32 [[TMP7]] to i64
4713 // CHECK9-NEXT: [[TMP9:%.*]] = load i32, ptr [[DOTOMP_COMB_UB]], align 4, !llvm.access.group [[ACC_GRP26]]
4714 // CHECK9-NEXT: [[TMP10:%.*]] = zext i32 [[TMP9]] to i64
4715 // CHECK9-NEXT: call void (ptr, i32, ptr, ...) @__kmpc_fork_call(ptr @[[GLOB3]], i32 2, ptr @{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}_main_l81.omp_outlined.omp_outlined, i64 [[TMP8]], i64 [[TMP10]]), !llvm.access.group [[ACC_GRP26]]
4716 // CHECK9-NEXT: br label [[OMP_INNER_FOR_INC:%.*]]
4717 // CHECK9: omp.inner.for.inc:
4718 // CHECK9-NEXT: [[TMP11:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP26]]
4719 // CHECK9-NEXT: [[TMP12:%.*]] = load i32, ptr [[DOTOMP_STRIDE]], align 4, !llvm.access.group [[ACC_GRP26]]
4720 // CHECK9-NEXT: [[ADD:%.*]] = add nsw i32 [[TMP11]], [[TMP12]]
4721 // CHECK9-NEXT: store i32 [[ADD]], ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP26]]
4722 // CHECK9-NEXT: br label [[OMP_INNER_FOR_COND]], !llvm.loop [[LOOP27:![0-9]+]]
4723 // CHECK9: omp.inner.for.end:
4724 // CHECK9-NEXT: br label [[OMP_LOOP_EXIT:%.*]]
4725 // CHECK9: omp.loop.exit:
4726 // CHECK9-NEXT: call void @__kmpc_for_static_fini(ptr @[[GLOB1]], i32 [[TMP1]])
4727 // CHECK9-NEXT: [[TMP13:%.*]] = load i32, ptr [[DOTOMP_IS_LAST]], align 4
4728 // CHECK9-NEXT: [[TMP14:%.*]] = icmp ne i32 [[TMP13]], 0
4729 // CHECK9-NEXT: br i1 [[TMP14]], label [[DOTOMP_FINAL_THEN:%.*]], label [[DOTOMP_FINAL_DONE:%.*]]
4730 // CHECK9: .omp.final.then:
4731 // CHECK9-NEXT: store i32 100, ptr [[I]], align 4
4732 // CHECK9-NEXT: br label [[DOTOMP_FINAL_DONE]]
4733 // CHECK9: .omp.final.done:
4734 // CHECK9-NEXT: ret void
4737 // CHECK9-LABEL: define {{[^@]+}}@{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}_main_l81.omp_outlined.omp_outlined
4738 // CHECK9-SAME: (ptr noalias noundef [[DOTGLOBAL_TID_:%.*]], ptr noalias noundef [[DOTBOUND_TID_:%.*]], i64 noundef [[DOTPREVIOUS_LB_:%.*]], i64 noundef [[DOTPREVIOUS_UB_:%.*]]) #[[ATTR1]] {
4739 // CHECK9-NEXT: entry:
4740 // CHECK9-NEXT: [[DOTGLOBAL_TID__ADDR:%.*]] = alloca ptr, align 8
4741 // CHECK9-NEXT: [[DOTBOUND_TID__ADDR:%.*]] = alloca ptr, align 8
4742 // CHECK9-NEXT: [[DOTPREVIOUS_LB__ADDR:%.*]] = alloca i64, align 8
4743 // CHECK9-NEXT: [[DOTPREVIOUS_UB__ADDR:%.*]] = alloca i64, align 8
4744 // CHECK9-NEXT: [[DOTOMP_IV:%.*]] = alloca i32, align 4
4745 // CHECK9-NEXT: [[TMP:%.*]] = alloca i32, align 4
4746 // CHECK9-NEXT: [[DOTOMP_LB:%.*]] = alloca i32, align 4
4747 // CHECK9-NEXT: [[DOTOMP_UB:%.*]] = alloca i32, align 4
4748 // CHECK9-NEXT: [[DOTOMP_STRIDE:%.*]] = alloca i32, align 4
4749 // CHECK9-NEXT: [[DOTOMP_IS_LAST:%.*]] = alloca i32, align 4
4750 // CHECK9-NEXT: [[I:%.*]] = alloca i32, align 4
4751 // CHECK9-NEXT: store ptr [[DOTGLOBAL_TID_]], ptr [[DOTGLOBAL_TID__ADDR]], align 8
4752 // CHECK9-NEXT: store ptr [[DOTBOUND_TID_]], ptr [[DOTBOUND_TID__ADDR]], align 8
4753 // CHECK9-NEXT: store i64 [[DOTPREVIOUS_LB_]], ptr [[DOTPREVIOUS_LB__ADDR]], align 8
4754 // CHECK9-NEXT: store i64 [[DOTPREVIOUS_UB_]], ptr [[DOTPREVIOUS_UB__ADDR]], align 8
4755 // CHECK9-NEXT: store i32 0, ptr [[DOTOMP_LB]], align 4
4756 // CHECK9-NEXT: store i32 99, ptr [[DOTOMP_UB]], align 4
4757 // CHECK9-NEXT: [[TMP0:%.*]] = load i64, ptr [[DOTPREVIOUS_LB__ADDR]], align 8
4758 // CHECK9-NEXT: [[CONV:%.*]] = trunc i64 [[TMP0]] to i32
4759 // CHECK9-NEXT: [[TMP1:%.*]] = load i64, ptr [[DOTPREVIOUS_UB__ADDR]], align 8
4760 // CHECK9-NEXT: [[CONV1:%.*]] = trunc i64 [[TMP1]] to i32
4761 // CHECK9-NEXT: store i32 [[CONV]], ptr [[DOTOMP_LB]], align 4
4762 // CHECK9-NEXT: store i32 [[CONV1]], ptr [[DOTOMP_UB]], align 4
4763 // CHECK9-NEXT: store i32 1, ptr [[DOTOMP_STRIDE]], align 4
4764 // CHECK9-NEXT: store i32 0, ptr [[DOTOMP_IS_LAST]], align 4
4765 // CHECK9-NEXT: [[TMP2:%.*]] = load ptr, ptr [[DOTGLOBAL_TID__ADDR]], align 8
4766 // CHECK9-NEXT: [[TMP3:%.*]] = load i32, ptr [[TMP2]], align 4
4767 // CHECK9-NEXT: call void @__kmpc_for_static_init_4(ptr @[[GLOB2]], i32 [[TMP3]], i32 34, ptr [[DOTOMP_IS_LAST]], ptr [[DOTOMP_LB]], ptr [[DOTOMP_UB]], ptr [[DOTOMP_STRIDE]], i32 1, i32 1)
4768 // CHECK9-NEXT: [[TMP4:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4
4769 // CHECK9-NEXT: [[CMP:%.*]] = icmp sgt i32 [[TMP4]], 99
4770 // CHECK9-NEXT: br i1 [[CMP]], label [[COND_TRUE:%.*]], label [[COND_FALSE:%.*]]
4771 // CHECK9: cond.true:
4772 // CHECK9-NEXT: br label [[COND_END:%.*]]
4773 // CHECK9: cond.false:
4774 // CHECK9-NEXT: [[TMP5:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4
4775 // CHECK9-NEXT: br label [[COND_END]]
4776 // CHECK9: cond.end:
4777 // CHECK9-NEXT: [[COND:%.*]] = phi i32 [ 99, [[COND_TRUE]] ], [ [[TMP5]], [[COND_FALSE]] ]
4778 // CHECK9-NEXT: store i32 [[COND]], ptr [[DOTOMP_UB]], align 4
4779 // CHECK9-NEXT: [[TMP6:%.*]] = load i32, ptr [[DOTOMP_LB]], align 4
4780 // CHECK9-NEXT: store i32 [[TMP6]], ptr [[DOTOMP_IV]], align 4
4781 // CHECK9-NEXT: br label [[OMP_INNER_FOR_COND:%.*]]
4782 // CHECK9: omp.inner.for.cond:
4783 // CHECK9-NEXT: [[TMP7:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP29:![0-9]+]]
4784 // CHECK9-NEXT: [[TMP8:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4, !llvm.access.group [[ACC_GRP29]]
4785 // CHECK9-NEXT: [[CMP2:%.*]] = icmp sle i32 [[TMP7]], [[TMP8]]
4786 // CHECK9-NEXT: br i1 [[CMP2]], label [[OMP_INNER_FOR_BODY:%.*]], label [[OMP_INNER_FOR_END:%.*]]
4787 // CHECK9: omp.inner.for.body:
4788 // CHECK9-NEXT: [[TMP9:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP29]]
4789 // CHECK9-NEXT: [[MUL:%.*]] = mul nsw i32 [[TMP9]], 1
4790 // CHECK9-NEXT: [[ADD:%.*]] = add nsw i32 0, [[MUL]]
4791 // CHECK9-NEXT: store i32 [[ADD]], ptr [[I]], align 4, !llvm.access.group [[ACC_GRP29]]
4792 // CHECK9-NEXT: call void @_Z3fn4v(), !llvm.access.group [[ACC_GRP29]]
4793 // CHECK9-NEXT: br label [[OMP_BODY_CONTINUE:%.*]]
4794 // CHECK9: omp.body.continue:
4795 // CHECK9-NEXT: br label [[OMP_INNER_FOR_INC:%.*]]
4796 // CHECK9: omp.inner.for.inc:
4797 // CHECK9-NEXT: [[TMP10:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP29]]
4798 // CHECK9-NEXT: [[ADD3:%.*]] = add nsw i32 [[TMP10]], 1
4799 // CHECK9-NEXT: store i32 [[ADD3]], ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP29]]
4800 // CHECK9-NEXT: br label [[OMP_INNER_FOR_COND]], !llvm.loop [[LOOP30:![0-9]+]]
4801 // CHECK9: omp.inner.for.end:
4802 // CHECK9-NEXT: br label [[OMP_LOOP_EXIT:%.*]]
4803 // CHECK9: omp.loop.exit:
4804 // CHECK9-NEXT: call void @__kmpc_for_static_fini(ptr @[[GLOB1]], i32 [[TMP3]])
4805 // CHECK9-NEXT: [[TMP11:%.*]] = load i32, ptr [[DOTOMP_IS_LAST]], align 4
4806 // CHECK9-NEXT: [[TMP12:%.*]] = icmp ne i32 [[TMP11]], 0
4807 // CHECK9-NEXT: br i1 [[TMP12]], label [[DOTOMP_FINAL_THEN:%.*]], label [[DOTOMP_FINAL_DONE:%.*]]
4808 // CHECK9: .omp.final.then:
4809 // CHECK9-NEXT: store i32 100, ptr [[I]], align 4
4810 // CHECK9-NEXT: br label [[DOTOMP_FINAL_DONE]]
4811 // CHECK9: .omp.final.done:
4812 // CHECK9-NEXT: ret void
4815 // CHECK9-LABEL: define {{[^@]+}}@{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}_main_l90
4816 // CHECK9-SAME: () #[[ATTR1]] {
4817 // CHECK9-NEXT: entry:
4818 // CHECK9-NEXT: call void (ptr, i32, ptr, ...) @__kmpc_fork_teams(ptr @[[GLOB3]], i32 0, ptr @{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}_main_l90.omp_outlined)
4819 // CHECK9-NEXT: ret void
4822 // CHECK9-LABEL: define {{[^@]+}}@{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}_main_l90.omp_outlined
4823 // CHECK9-SAME: (ptr noalias noundef [[DOTGLOBAL_TID_:%.*]], ptr noalias noundef [[DOTBOUND_TID_:%.*]]) #[[ATTR1]] {
4824 // CHECK9-NEXT: entry:
4825 // CHECK9-NEXT: [[DOTGLOBAL_TID__ADDR:%.*]] = alloca ptr, align 8
4826 // CHECK9-NEXT: [[DOTBOUND_TID__ADDR:%.*]] = alloca ptr, align 8
4827 // CHECK9-NEXT: [[DOTOMP_IV:%.*]] = alloca i32, align 4
4828 // CHECK9-NEXT: [[TMP:%.*]] = alloca i32, align 4
4829 // CHECK9-NEXT: [[DOTOMP_COMB_LB:%.*]] = alloca i32, align 4
4830 // CHECK9-NEXT: [[DOTOMP_COMB_UB:%.*]] = alloca i32, align 4
4831 // CHECK9-NEXT: [[DOTOMP_STRIDE:%.*]] = alloca i32, align 4
4832 // CHECK9-NEXT: [[DOTOMP_IS_LAST:%.*]] = alloca i32, align 4
4833 // CHECK9-NEXT: [[I:%.*]] = alloca i32, align 4
4834 // CHECK9-NEXT: [[DOTBOUND_ZERO_ADDR:%.*]] = alloca i32, align 4
4835 // CHECK9-NEXT: store ptr [[DOTGLOBAL_TID_]], ptr [[DOTGLOBAL_TID__ADDR]], align 8
4836 // CHECK9-NEXT: store ptr [[DOTBOUND_TID_]], ptr [[DOTBOUND_TID__ADDR]], align 8
4837 // CHECK9-NEXT: store i32 0, ptr [[DOTOMP_COMB_LB]], align 4
4838 // CHECK9-NEXT: store i32 99, ptr [[DOTOMP_COMB_UB]], align 4
4839 // CHECK9-NEXT: store i32 1, ptr [[DOTOMP_STRIDE]], align 4
4840 // CHECK9-NEXT: store i32 0, ptr [[DOTOMP_IS_LAST]], align 4
4841 // CHECK9-NEXT: [[TMP0:%.*]] = load ptr, ptr [[DOTGLOBAL_TID__ADDR]], align 8
4842 // CHECK9-NEXT: [[TMP1:%.*]] = load i32, ptr [[TMP0]], align 4
4843 // CHECK9-NEXT: call void @__kmpc_for_static_init_4(ptr @[[GLOB1]], i32 [[TMP1]], i32 92, ptr [[DOTOMP_IS_LAST]], ptr [[DOTOMP_COMB_LB]], ptr [[DOTOMP_COMB_UB]], ptr [[DOTOMP_STRIDE]], i32 1, i32 1)
4844 // CHECK9-NEXT: [[TMP2:%.*]] = load i32, ptr [[DOTOMP_COMB_UB]], align 4
4845 // CHECK9-NEXT: [[CMP:%.*]] = icmp sgt i32 [[TMP2]], 99
4846 // CHECK9-NEXT: br i1 [[CMP]], label [[COND_TRUE:%.*]], label [[COND_FALSE:%.*]]
4847 // CHECK9: cond.true:
4848 // CHECK9-NEXT: br label [[COND_END:%.*]]
4849 // CHECK9: cond.false:
4850 // CHECK9-NEXT: [[TMP3:%.*]] = load i32, ptr [[DOTOMP_COMB_UB]], align 4
4851 // CHECK9-NEXT: br label [[COND_END]]
4852 // CHECK9: cond.end:
4853 // CHECK9-NEXT: [[COND:%.*]] = phi i32 [ 99, [[COND_TRUE]] ], [ [[TMP3]], [[COND_FALSE]] ]
4854 // CHECK9-NEXT: store i32 [[COND]], ptr [[DOTOMP_COMB_UB]], align 4
4855 // CHECK9-NEXT: [[TMP4:%.*]] = load i32, ptr [[DOTOMP_COMB_LB]], align 4
4856 // CHECK9-NEXT: store i32 [[TMP4]], ptr [[DOTOMP_IV]], align 4
4857 // CHECK9-NEXT: br label [[OMP_INNER_FOR_COND:%.*]]
4858 // CHECK9: omp.inner.for.cond:
4859 // CHECK9-NEXT: [[TMP5:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP32:![0-9]+]]
4860 // CHECK9-NEXT: [[TMP6:%.*]] = load i32, ptr [[DOTOMP_COMB_UB]], align 4, !llvm.access.group [[ACC_GRP32]]
4861 // CHECK9-NEXT: [[CMP1:%.*]] = icmp sle i32 [[TMP5]], [[TMP6]]
4862 // CHECK9-NEXT: br i1 [[CMP1]], label [[OMP_INNER_FOR_BODY:%.*]], label [[OMP_INNER_FOR_END:%.*]]
4863 // CHECK9: omp.inner.for.body:
4864 // CHECK9-NEXT: [[TMP7:%.*]] = load i32, ptr [[DOTOMP_COMB_LB]], align 4, !llvm.access.group [[ACC_GRP32]]
4865 // CHECK9-NEXT: [[TMP8:%.*]] = zext i32 [[TMP7]] to i64
4866 // CHECK9-NEXT: [[TMP9:%.*]] = load i32, ptr [[DOTOMP_COMB_UB]], align 4, !llvm.access.group [[ACC_GRP32]]
4867 // CHECK9-NEXT: [[TMP10:%.*]] = zext i32 [[TMP9]] to i64
4868 // CHECK9-NEXT: call void @__kmpc_serialized_parallel(ptr @[[GLOB3]], i32 [[TMP1]]), !llvm.access.group [[ACC_GRP32]]
4869 // CHECK9-NEXT: [[TMP11:%.*]] = load ptr, ptr [[DOTGLOBAL_TID__ADDR]], align 8, !llvm.access.group [[ACC_GRP32]]
4870 // CHECK9-NEXT: store i32 0, ptr [[DOTBOUND_ZERO_ADDR]], align 4, !llvm.access.group [[ACC_GRP32]]
4871 // CHECK9-NEXT: call void @{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}_main_l90.omp_outlined.omp_outlined(ptr [[TMP11]], ptr [[DOTBOUND_ZERO_ADDR]], i64 [[TMP8]], i64 [[TMP10]]) #[[ATTR2]], !llvm.access.group [[ACC_GRP32]]
4872 // CHECK9-NEXT: call void @__kmpc_end_serialized_parallel(ptr @[[GLOB3]], i32 [[TMP1]]), !llvm.access.group [[ACC_GRP32]]
4873 // CHECK9-NEXT: br label [[OMP_INNER_FOR_INC:%.*]]
4874 // CHECK9: omp.inner.for.inc:
4875 // CHECK9-NEXT: [[TMP12:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP32]]
4876 // CHECK9-NEXT: [[TMP13:%.*]] = load i32, ptr [[DOTOMP_STRIDE]], align 4, !llvm.access.group [[ACC_GRP32]]
4877 // CHECK9-NEXT: [[ADD:%.*]] = add nsw i32 [[TMP12]], [[TMP13]]
4878 // CHECK9-NEXT: store i32 [[ADD]], ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP32]]
4879 // CHECK9-NEXT: br label [[OMP_INNER_FOR_COND]], !llvm.loop [[LOOP33:![0-9]+]]
4880 // CHECK9: omp.inner.for.end:
4881 // CHECK9-NEXT: br label [[OMP_LOOP_EXIT:%.*]]
4882 // CHECK9: omp.loop.exit:
4883 // CHECK9-NEXT: call void @__kmpc_for_static_fini(ptr @[[GLOB1]], i32 [[TMP1]])
4884 // CHECK9-NEXT: [[TMP14:%.*]] = load i32, ptr [[DOTOMP_IS_LAST]], align 4
4885 // CHECK9-NEXT: [[TMP15:%.*]] = icmp ne i32 [[TMP14]], 0
4886 // CHECK9-NEXT: br i1 [[TMP15]], label [[DOTOMP_FINAL_THEN:%.*]], label [[DOTOMP_FINAL_DONE:%.*]]
4887 // CHECK9: .omp.final.then:
4888 // CHECK9-NEXT: store i32 100, ptr [[I]], align 4
4889 // CHECK9-NEXT: br label [[DOTOMP_FINAL_DONE]]
4890 // CHECK9: .omp.final.done:
4891 // CHECK9-NEXT: ret void
4894 // CHECK9-LABEL: define {{[^@]+}}@{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}_main_l90.omp_outlined.omp_outlined
4895 // CHECK9-SAME: (ptr noalias noundef [[DOTGLOBAL_TID_:%.*]], ptr noalias noundef [[DOTBOUND_TID_:%.*]], i64 noundef [[DOTPREVIOUS_LB_:%.*]], i64 noundef [[DOTPREVIOUS_UB_:%.*]]) #[[ATTR1]] {
4896 // CHECK9-NEXT: entry:
4897 // CHECK9-NEXT: [[DOTGLOBAL_TID__ADDR:%.*]] = alloca ptr, align 8
4898 // CHECK9-NEXT: [[DOTBOUND_TID__ADDR:%.*]] = alloca ptr, align 8
4899 // CHECK9-NEXT: [[DOTPREVIOUS_LB__ADDR:%.*]] = alloca i64, align 8
4900 // CHECK9-NEXT: [[DOTPREVIOUS_UB__ADDR:%.*]] = alloca i64, align 8
4901 // CHECK9-NEXT: [[DOTOMP_IV:%.*]] = alloca i32, align 4
4902 // CHECK9-NEXT: [[TMP:%.*]] = alloca i32, align 4
4903 // CHECK9-NEXT: [[DOTOMP_LB:%.*]] = alloca i32, align 4
4904 // CHECK9-NEXT: [[DOTOMP_UB:%.*]] = alloca i32, align 4
4905 // CHECK9-NEXT: [[DOTOMP_STRIDE:%.*]] = alloca i32, align 4
4906 // CHECK9-NEXT: [[DOTOMP_IS_LAST:%.*]] = alloca i32, align 4
4907 // CHECK9-NEXT: [[I:%.*]] = alloca i32, align 4
4908 // CHECK9-NEXT: store ptr [[DOTGLOBAL_TID_]], ptr [[DOTGLOBAL_TID__ADDR]], align 8
4909 // CHECK9-NEXT: store ptr [[DOTBOUND_TID_]], ptr [[DOTBOUND_TID__ADDR]], align 8
4910 // CHECK9-NEXT: store i64 [[DOTPREVIOUS_LB_]], ptr [[DOTPREVIOUS_LB__ADDR]], align 8
4911 // CHECK9-NEXT: store i64 [[DOTPREVIOUS_UB_]], ptr [[DOTPREVIOUS_UB__ADDR]], align 8
4912 // CHECK9-NEXT: store i32 0, ptr [[DOTOMP_LB]], align 4
4913 // CHECK9-NEXT: store i32 99, ptr [[DOTOMP_UB]], align 4
4914 // CHECK9-NEXT: [[TMP0:%.*]] = load i64, ptr [[DOTPREVIOUS_LB__ADDR]], align 8
4915 // CHECK9-NEXT: [[CONV:%.*]] = trunc i64 [[TMP0]] to i32
4916 // CHECK9-NEXT: [[TMP1:%.*]] = load i64, ptr [[DOTPREVIOUS_UB__ADDR]], align 8
4917 // CHECK9-NEXT: [[CONV1:%.*]] = trunc i64 [[TMP1]] to i32
4918 // CHECK9-NEXT: store i32 [[CONV]], ptr [[DOTOMP_LB]], align 4
4919 // CHECK9-NEXT: store i32 [[CONV1]], ptr [[DOTOMP_UB]], align 4
4920 // CHECK9-NEXT: store i32 1, ptr [[DOTOMP_STRIDE]], align 4
4921 // CHECK9-NEXT: store i32 0, ptr [[DOTOMP_IS_LAST]], align 4
4922 // CHECK9-NEXT: [[TMP2:%.*]] = load ptr, ptr [[DOTGLOBAL_TID__ADDR]], align 8
4923 // CHECK9-NEXT: [[TMP3:%.*]] = load i32, ptr [[TMP2]], align 4
4924 // CHECK9-NEXT: call void @__kmpc_for_static_init_4(ptr @[[GLOB2]], i32 [[TMP3]], i32 34, ptr [[DOTOMP_IS_LAST]], ptr [[DOTOMP_LB]], ptr [[DOTOMP_UB]], ptr [[DOTOMP_STRIDE]], i32 1, i32 1)
4925 // CHECK9-NEXT: [[TMP4:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4
4926 // CHECK9-NEXT: [[CMP:%.*]] = icmp sgt i32 [[TMP4]], 99
4927 // CHECK9-NEXT: br i1 [[CMP]], label [[COND_TRUE:%.*]], label [[COND_FALSE:%.*]]
4928 // CHECK9: cond.true:
4929 // CHECK9-NEXT: br label [[COND_END:%.*]]
4930 // CHECK9: cond.false:
4931 // CHECK9-NEXT: [[TMP5:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4
4932 // CHECK9-NEXT: br label [[COND_END]]
4933 // CHECK9: cond.end:
4934 // CHECK9-NEXT: [[COND:%.*]] = phi i32 [ 99, [[COND_TRUE]] ], [ [[TMP5]], [[COND_FALSE]] ]
4935 // CHECK9-NEXT: store i32 [[COND]], ptr [[DOTOMP_UB]], align 4
4936 // CHECK9-NEXT: [[TMP6:%.*]] = load i32, ptr [[DOTOMP_LB]], align 4
4937 // CHECK9-NEXT: store i32 [[TMP6]], ptr [[DOTOMP_IV]], align 4
4938 // CHECK9-NEXT: br label [[OMP_INNER_FOR_COND:%.*]]
4939 // CHECK9: omp.inner.for.cond:
4940 // CHECK9-NEXT: [[TMP7:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP35:![0-9]+]]
4941 // CHECK9-NEXT: [[TMP8:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4, !llvm.access.group [[ACC_GRP35]]
4942 // CHECK9-NEXT: [[CMP2:%.*]] = icmp sle i32 [[TMP7]], [[TMP8]]
4943 // CHECK9-NEXT: br i1 [[CMP2]], label [[OMP_INNER_FOR_BODY:%.*]], label [[OMP_INNER_FOR_END:%.*]]
4944 // CHECK9: omp.inner.for.body:
4945 // CHECK9-NEXT: [[TMP9:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP35]]
4946 // CHECK9-NEXT: [[MUL:%.*]] = mul nsw i32 [[TMP9]], 1
4947 // CHECK9-NEXT: [[ADD:%.*]] = add nsw i32 0, [[MUL]]
4948 // CHECK9-NEXT: store i32 [[ADD]], ptr [[I]], align 4, !llvm.access.group [[ACC_GRP35]]
4949 // CHECK9-NEXT: call void @_Z3fn5v(), !llvm.access.group [[ACC_GRP35]]
4950 // CHECK9-NEXT: br label [[OMP_BODY_CONTINUE:%.*]]
4951 // CHECK9: omp.body.continue:
4952 // CHECK9-NEXT: br label [[OMP_INNER_FOR_INC:%.*]]
4953 // CHECK9: omp.inner.for.inc:
4954 // CHECK9-NEXT: [[TMP10:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP35]]
4955 // CHECK9-NEXT: [[ADD3:%.*]] = add nsw i32 [[TMP10]], 1
4956 // CHECK9-NEXT: store i32 [[ADD3]], ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP35]]
4957 // CHECK9-NEXT: br label [[OMP_INNER_FOR_COND]], !llvm.loop [[LOOP36:![0-9]+]]
4958 // CHECK9: omp.inner.for.end:
4959 // CHECK9-NEXT: br label [[OMP_LOOP_EXIT:%.*]]
4960 // CHECK9: omp.loop.exit:
4961 // CHECK9-NEXT: call void @__kmpc_for_static_fini(ptr @[[GLOB1]], i32 [[TMP3]])
4962 // CHECK9-NEXT: [[TMP11:%.*]] = load i32, ptr [[DOTOMP_IS_LAST]], align 4
4963 // CHECK9-NEXT: [[TMP12:%.*]] = icmp ne i32 [[TMP11]], 0
4964 // CHECK9-NEXT: br i1 [[TMP12]], label [[DOTOMP_FINAL_THEN:%.*]], label [[DOTOMP_FINAL_DONE:%.*]]
4965 // CHECK9: .omp.final.then:
4966 // CHECK9-NEXT: store i32 100, ptr [[I]], align 4
4967 // CHECK9-NEXT: br label [[DOTOMP_FINAL_DONE]]
4968 // CHECK9: .omp.final.done:
4969 // CHECK9-NEXT: ret void
4972 // CHECK9-LABEL: define {{[^@]+}}@{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}_main_l99
4973 // CHECK9-SAME: (i64 noundef [[ARG:%.*]]) #[[ATTR1]] {
4974 // CHECK9-NEXT: entry:
4975 // CHECK9-NEXT: [[ARG_ADDR:%.*]] = alloca i64, align 8
4976 // CHECK9-NEXT: store i64 [[ARG]], ptr [[ARG_ADDR]], align 8
4977 // CHECK9-NEXT: call void (ptr, i32, ptr, ...) @__kmpc_fork_teams(ptr @[[GLOB3]], i32 1, ptr @{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}_main_l99.omp_outlined, ptr [[ARG_ADDR]])
4978 // CHECK9-NEXT: ret void
4981 // CHECK9-LABEL: define {{[^@]+}}@{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}_main_l99.omp_outlined
4982 // CHECK9-SAME: (ptr noalias noundef [[DOTGLOBAL_TID_:%.*]], ptr noalias noundef [[DOTBOUND_TID_:%.*]], ptr noundef nonnull align 4 dereferenceable(4) [[ARG:%.*]]) #[[ATTR1]] {
4983 // CHECK9-NEXT: entry:
4984 // CHECK9-NEXT: [[DOTGLOBAL_TID__ADDR:%.*]] = alloca ptr, align 8
4985 // CHECK9-NEXT: [[DOTBOUND_TID__ADDR:%.*]] = alloca ptr, align 8
4986 // CHECK9-NEXT: [[ARG_ADDR:%.*]] = alloca ptr, align 8
4987 // CHECK9-NEXT: [[DOTOMP_IV:%.*]] = alloca i32, align 4
4988 // CHECK9-NEXT: [[TMP:%.*]] = alloca i32, align 4
4989 // CHECK9-NEXT: [[DOTOMP_COMB_LB:%.*]] = alloca i32, align 4
4990 // CHECK9-NEXT: [[DOTOMP_COMB_UB:%.*]] = alloca i32, align 4
4991 // CHECK9-NEXT: [[DOTOMP_STRIDE:%.*]] = alloca i32, align 4
4992 // CHECK9-NEXT: [[DOTOMP_IS_LAST:%.*]] = alloca i32, align 4
4993 // CHECK9-NEXT: [[I:%.*]] = alloca i32, align 4
4994 // CHECK9-NEXT: [[DOTBOUND_ZERO_ADDR:%.*]] = alloca i32, align 4
4995 // CHECK9-NEXT: store ptr [[DOTGLOBAL_TID_]], ptr [[DOTGLOBAL_TID__ADDR]], align 8
4996 // CHECK9-NEXT: store ptr [[DOTBOUND_TID_]], ptr [[DOTBOUND_TID__ADDR]], align 8
4997 // CHECK9-NEXT: store ptr [[ARG]], ptr [[ARG_ADDR]], align 8
4998 // CHECK9-NEXT: [[TMP0:%.*]] = load ptr, ptr [[ARG_ADDR]], align 8
4999 // CHECK9-NEXT: store i32 0, ptr [[DOTOMP_COMB_LB]], align 4
5000 // CHECK9-NEXT: store i32 99, ptr [[DOTOMP_COMB_UB]], align 4
5001 // CHECK9-NEXT: store i32 1, ptr [[DOTOMP_STRIDE]], align 4
5002 // CHECK9-NEXT: store i32 0, ptr [[DOTOMP_IS_LAST]], align 4
5003 // CHECK9-NEXT: [[TMP1:%.*]] = load ptr, ptr [[DOTGLOBAL_TID__ADDR]], align 8
5004 // CHECK9-NEXT: [[TMP2:%.*]] = load i32, ptr [[TMP1]], align 4
5005 // CHECK9-NEXT: call void @__kmpc_for_static_init_4(ptr @[[GLOB1]], i32 [[TMP2]], i32 92, ptr [[DOTOMP_IS_LAST]], ptr [[DOTOMP_COMB_LB]], ptr [[DOTOMP_COMB_UB]], ptr [[DOTOMP_STRIDE]], i32 1, i32 1)
5006 // CHECK9-NEXT: [[TMP3:%.*]] = load i32, ptr [[DOTOMP_COMB_UB]], align 4
5007 // CHECK9-NEXT: [[CMP:%.*]] = icmp sgt i32 [[TMP3]], 99
5008 // CHECK9-NEXT: br i1 [[CMP]], label [[COND_TRUE:%.*]], label [[COND_FALSE:%.*]]
5009 // CHECK9: cond.true:
5010 // CHECK9-NEXT: br label [[COND_END:%.*]]
5011 // CHECK9: cond.false:
5012 // CHECK9-NEXT: [[TMP4:%.*]] = load i32, ptr [[DOTOMP_COMB_UB]], align 4
5013 // CHECK9-NEXT: br label [[COND_END]]
5014 // CHECK9: cond.end:
5015 // CHECK9-NEXT: [[COND:%.*]] = phi i32 [ 99, [[COND_TRUE]] ], [ [[TMP4]], [[COND_FALSE]] ]
5016 // CHECK9-NEXT: store i32 [[COND]], ptr [[DOTOMP_COMB_UB]], align 4
5017 // CHECK9-NEXT: [[TMP5:%.*]] = load i32, ptr [[DOTOMP_COMB_LB]], align 4
5018 // CHECK9-NEXT: store i32 [[TMP5]], ptr [[DOTOMP_IV]], align 4
5019 // CHECK9-NEXT: br label [[OMP_INNER_FOR_COND:%.*]]
5020 // CHECK9: omp.inner.for.cond:
5021 // CHECK9-NEXT: [[TMP6:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP38:![0-9]+]]
5022 // CHECK9-NEXT: [[TMP7:%.*]] = load i32, ptr [[DOTOMP_COMB_UB]], align 4, !llvm.access.group [[ACC_GRP38]]
5023 // CHECK9-NEXT: [[CMP1:%.*]] = icmp sle i32 [[TMP6]], [[TMP7]]
5024 // CHECK9-NEXT: br i1 [[CMP1]], label [[OMP_INNER_FOR_BODY:%.*]], label [[OMP_INNER_FOR_END:%.*]]
5025 // CHECK9: omp.inner.for.body:
5026 // CHECK9-NEXT: [[TMP8:%.*]] = load i32, ptr [[DOTOMP_COMB_LB]], align 4, !llvm.access.group [[ACC_GRP38]]
5027 // CHECK9-NEXT: [[TMP9:%.*]] = zext i32 [[TMP8]] to i64
5028 // CHECK9-NEXT: [[TMP10:%.*]] = load i32, ptr [[DOTOMP_COMB_UB]], align 4, !llvm.access.group [[ACC_GRP38]]
5029 // CHECK9-NEXT: [[TMP11:%.*]] = zext i32 [[TMP10]] to i64
5030 // CHECK9-NEXT: [[TMP12:%.*]] = load i32, ptr [[TMP0]], align 4, !llvm.access.group [[ACC_GRP38]]
5031 // CHECK9-NEXT: [[TOBOOL:%.*]] = icmp ne i32 [[TMP12]], 0
5032 // CHECK9-NEXT: br i1 [[TOBOOL]], label [[OMP_IF_THEN:%.*]], label [[OMP_IF_ELSE:%.*]]
5033 // CHECK9: omp_if.then:
5034 // CHECK9-NEXT: call void (ptr, i32, ptr, ...) @__kmpc_fork_call(ptr @[[GLOB3]], i32 2, ptr @{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}_main_l99.omp_outlined.omp_outlined, i64 [[TMP9]], i64 [[TMP11]]), !llvm.access.group [[ACC_GRP38]]
5035 // CHECK9-NEXT: br label [[OMP_IF_END:%.*]]
5036 // CHECK9: omp_if.else:
5037 // CHECK9-NEXT: call void @__kmpc_serialized_parallel(ptr @[[GLOB3]], i32 [[TMP2]]), !llvm.access.group [[ACC_GRP38]]
5038 // CHECK9-NEXT: [[TMP13:%.*]] = load ptr, ptr [[DOTGLOBAL_TID__ADDR]], align 8, !llvm.access.group [[ACC_GRP38]]
5039 // CHECK9-NEXT: store i32 0, ptr [[DOTBOUND_ZERO_ADDR]], align 4, !llvm.access.group [[ACC_GRP38]]
5040 // CHECK9-NEXT: call void @{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}_main_l99.omp_outlined.omp_outlined(ptr [[TMP13]], ptr [[DOTBOUND_ZERO_ADDR]], i64 [[TMP9]], i64 [[TMP11]]) #[[ATTR2]], !llvm.access.group [[ACC_GRP38]]
5041 // CHECK9-NEXT: call void @__kmpc_end_serialized_parallel(ptr @[[GLOB3]], i32 [[TMP2]]), !llvm.access.group [[ACC_GRP38]]
5042 // CHECK9-NEXT: br label [[OMP_IF_END]]
5043 // CHECK9: omp_if.end:
5044 // CHECK9-NEXT: br label [[OMP_INNER_FOR_INC:%.*]]
5045 // CHECK9: omp.inner.for.inc:
5046 // CHECK9-NEXT: [[TMP14:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP38]]
5047 // CHECK9-NEXT: [[TMP15:%.*]] = load i32, ptr [[DOTOMP_STRIDE]], align 4, !llvm.access.group [[ACC_GRP38]]
5048 // CHECK9-NEXT: [[ADD:%.*]] = add nsw i32 [[TMP14]], [[TMP15]]
5049 // CHECK9-NEXT: store i32 [[ADD]], ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP38]]
5050 // CHECK9-NEXT: br label [[OMP_INNER_FOR_COND]], !llvm.loop [[LOOP39:![0-9]+]]
5051 // CHECK9: omp.inner.for.end:
5052 // CHECK9-NEXT: br label [[OMP_LOOP_EXIT:%.*]]
5053 // CHECK9: omp.loop.exit:
5054 // CHECK9-NEXT: call void @__kmpc_for_static_fini(ptr @[[GLOB1]], i32 [[TMP2]])
5055 // CHECK9-NEXT: [[TMP16:%.*]] = load i32, ptr [[DOTOMP_IS_LAST]], align 4
5056 // CHECK9-NEXT: [[TMP17:%.*]] = icmp ne i32 [[TMP16]], 0
5057 // CHECK9-NEXT: br i1 [[TMP17]], label [[DOTOMP_FINAL_THEN:%.*]], label [[DOTOMP_FINAL_DONE:%.*]]
5058 // CHECK9: .omp.final.then:
5059 // CHECK9-NEXT: store i32 100, ptr [[I]], align 4
5060 // CHECK9-NEXT: br label [[DOTOMP_FINAL_DONE]]
5061 // CHECK9: .omp.final.done:
5062 // CHECK9-NEXT: ret void
5065 // CHECK9-LABEL: define {{[^@]+}}@{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}_main_l99.omp_outlined.omp_outlined
5066 // CHECK9-SAME: (ptr noalias noundef [[DOTGLOBAL_TID_:%.*]], ptr noalias noundef [[DOTBOUND_TID_:%.*]], i64 noundef [[DOTPREVIOUS_LB_:%.*]], i64 noundef [[DOTPREVIOUS_UB_:%.*]]) #[[ATTR1]] {
5067 // CHECK9-NEXT: entry:
5068 // CHECK9-NEXT: [[DOTGLOBAL_TID__ADDR:%.*]] = alloca ptr, align 8
5069 // CHECK9-NEXT: [[DOTBOUND_TID__ADDR:%.*]] = alloca ptr, align 8
5070 // CHECK9-NEXT: [[DOTPREVIOUS_LB__ADDR:%.*]] = alloca i64, align 8
5071 // CHECK9-NEXT: [[DOTPREVIOUS_UB__ADDR:%.*]] = alloca i64, align 8
5072 // CHECK9-NEXT: [[DOTOMP_IV:%.*]] = alloca i32, align 4
5073 // CHECK9-NEXT: [[TMP:%.*]] = alloca i32, align 4
5074 // CHECK9-NEXT: [[DOTOMP_LB:%.*]] = alloca i32, align 4
5075 // CHECK9-NEXT: [[DOTOMP_UB:%.*]] = alloca i32, align 4
5076 // CHECK9-NEXT: [[DOTOMP_STRIDE:%.*]] = alloca i32, align 4
5077 // CHECK9-NEXT: [[DOTOMP_IS_LAST:%.*]] = alloca i32, align 4
5078 // CHECK9-NEXT: [[I:%.*]] = alloca i32, align 4
5079 // CHECK9-NEXT: store ptr [[DOTGLOBAL_TID_]], ptr [[DOTGLOBAL_TID__ADDR]], align 8
5080 // CHECK9-NEXT: store ptr [[DOTBOUND_TID_]], ptr [[DOTBOUND_TID__ADDR]], align 8
5081 // CHECK9-NEXT: store i64 [[DOTPREVIOUS_LB_]], ptr [[DOTPREVIOUS_LB__ADDR]], align 8
5082 // CHECK9-NEXT: store i64 [[DOTPREVIOUS_UB_]], ptr [[DOTPREVIOUS_UB__ADDR]], align 8
5083 // CHECK9-NEXT: store i32 0, ptr [[DOTOMP_LB]], align 4
5084 // CHECK9-NEXT: store i32 99, ptr [[DOTOMP_UB]], align 4
5085 // CHECK9-NEXT: [[TMP0:%.*]] = load i64, ptr [[DOTPREVIOUS_LB__ADDR]], align 8
5086 // CHECK9-NEXT: [[CONV:%.*]] = trunc i64 [[TMP0]] to i32
5087 // CHECK9-NEXT: [[TMP1:%.*]] = load i64, ptr [[DOTPREVIOUS_UB__ADDR]], align 8
5088 // CHECK9-NEXT: [[CONV1:%.*]] = trunc i64 [[TMP1]] to i32
5089 // CHECK9-NEXT: store i32 [[CONV]], ptr [[DOTOMP_LB]], align 4
5090 // CHECK9-NEXT: store i32 [[CONV1]], ptr [[DOTOMP_UB]], align 4
5091 // CHECK9-NEXT: store i32 1, ptr [[DOTOMP_STRIDE]], align 4
5092 // CHECK9-NEXT: store i32 0, ptr [[DOTOMP_IS_LAST]], align 4
5093 // CHECK9-NEXT: [[TMP2:%.*]] = load ptr, ptr [[DOTGLOBAL_TID__ADDR]], align 8
5094 // CHECK9-NEXT: [[TMP3:%.*]] = load i32, ptr [[TMP2]], align 4
5095 // CHECK9-NEXT: call void @__kmpc_for_static_init_4(ptr @[[GLOB2]], i32 [[TMP3]], i32 34, ptr [[DOTOMP_IS_LAST]], ptr [[DOTOMP_LB]], ptr [[DOTOMP_UB]], ptr [[DOTOMP_STRIDE]], i32 1, i32 1)
5096 // CHECK9-NEXT: [[TMP4:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4
5097 // CHECK9-NEXT: [[CMP:%.*]] = icmp sgt i32 [[TMP4]], 99
5098 // CHECK9-NEXT: br i1 [[CMP]], label [[COND_TRUE:%.*]], label [[COND_FALSE:%.*]]
5099 // CHECK9: cond.true:
5100 // CHECK9-NEXT: br label [[COND_END:%.*]]
5101 // CHECK9: cond.false:
5102 // CHECK9-NEXT: [[TMP5:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4
5103 // CHECK9-NEXT: br label [[COND_END]]
5104 // CHECK9: cond.end:
5105 // CHECK9-NEXT: [[COND:%.*]] = phi i32 [ 99, [[COND_TRUE]] ], [ [[TMP5]], [[COND_FALSE]] ]
5106 // CHECK9-NEXT: store i32 [[COND]], ptr [[DOTOMP_UB]], align 4
5107 // CHECK9-NEXT: [[TMP6:%.*]] = load i32, ptr [[DOTOMP_LB]], align 4
5108 // CHECK9-NEXT: store i32 [[TMP6]], ptr [[DOTOMP_IV]], align 4
5109 // CHECK9-NEXT: br label [[OMP_INNER_FOR_COND:%.*]]
5110 // CHECK9: omp.inner.for.cond:
5111 // CHECK9-NEXT: [[TMP7:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP41:![0-9]+]]
5112 // CHECK9-NEXT: [[TMP8:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4, !llvm.access.group [[ACC_GRP41]]
5113 // CHECK9-NEXT: [[CMP2:%.*]] = icmp sle i32 [[TMP7]], [[TMP8]]
5114 // CHECK9-NEXT: br i1 [[CMP2]], label [[OMP_INNER_FOR_BODY:%.*]], label [[OMP_INNER_FOR_END:%.*]]
5115 // CHECK9: omp.inner.for.body:
5116 // CHECK9-NEXT: [[TMP9:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP41]]
5117 // CHECK9-NEXT: [[MUL:%.*]] = mul nsw i32 [[TMP9]], 1
5118 // CHECK9-NEXT: [[ADD:%.*]] = add nsw i32 0, [[MUL]]
5119 // CHECK9-NEXT: store i32 [[ADD]], ptr [[I]], align 4, !llvm.access.group [[ACC_GRP41]]
5120 // CHECK9-NEXT: call void @_Z3fn6v(), !llvm.access.group [[ACC_GRP41]]
5121 // CHECK9-NEXT: br label [[OMP_BODY_CONTINUE:%.*]]
5122 // CHECK9: omp.body.continue:
5123 // CHECK9-NEXT: br label [[OMP_INNER_FOR_INC:%.*]]
5124 // CHECK9: omp.inner.for.inc:
5125 // CHECK9-NEXT: [[TMP10:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP41]]
5126 // CHECK9-NEXT: [[ADD3:%.*]] = add nsw i32 [[TMP10]], 1
5127 // CHECK9-NEXT: store i32 [[ADD3]], ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP41]]
5128 // CHECK9-NEXT: br label [[OMP_INNER_FOR_COND]], !llvm.loop [[LOOP42:![0-9]+]]
5129 // CHECK9: omp.inner.for.end:
5130 // CHECK9-NEXT: br label [[OMP_LOOP_EXIT:%.*]]
5131 // CHECK9: omp.loop.exit:
5132 // CHECK9-NEXT: call void @__kmpc_for_static_fini(ptr @[[GLOB1]], i32 [[TMP3]])
5133 // CHECK9-NEXT: [[TMP11:%.*]] = load i32, ptr [[DOTOMP_IS_LAST]], align 4
5134 // CHECK9-NEXT: [[TMP12:%.*]] = icmp ne i32 [[TMP11]], 0
5135 // CHECK9-NEXT: br i1 [[TMP12]], label [[DOTOMP_FINAL_THEN:%.*]], label [[DOTOMP_FINAL_DONE:%.*]]
5136 // CHECK9: .omp.final.then:
5137 // CHECK9-NEXT: store i32 100, ptr [[I]], align 4
5138 // CHECK9-NEXT: br label [[DOTOMP_FINAL_DONE]]
5139 // CHECK9: .omp.final.done:
5140 // CHECK9-NEXT: ret void
5143 // CHECK9-LABEL: define {{[^@]+}}@_Z5tmainIiEiT_
5144 // CHECK9-SAME: (i32 noundef [[ARG:%.*]]) #[[ATTR0]] comdat {
5145 // CHECK9-NEXT: entry:
5146 // CHECK9-NEXT: [[ARG_ADDR:%.*]] = alloca i32, align 4
5147 // CHECK9-NEXT: [[TMP:%.*]] = alloca i32, align 4
5148 // CHECK9-NEXT: [[KERNEL_ARGS:%.*]] = alloca [[STRUCT___TGT_KERNEL_ARGUMENTS:%.*]], align 8
5149 // CHECK9-NEXT: [[_TMP1:%.*]] = alloca i32, align 4
5150 // CHECK9-NEXT: [[KERNEL_ARGS2:%.*]] = alloca [[STRUCT___TGT_KERNEL_ARGUMENTS]], align 8
5151 // CHECK9-NEXT: [[ARG_CASTED:%.*]] = alloca i64, align 8
5152 // CHECK9-NEXT: [[DOTOFFLOAD_BASEPTRS:%.*]] = alloca [1 x ptr], align 8
5153 // CHECK9-NEXT: [[DOTOFFLOAD_PTRS:%.*]] = alloca [1 x ptr], align 8
5154 // CHECK9-NEXT: [[DOTOFFLOAD_MAPPERS:%.*]] = alloca [1 x ptr], align 8
5155 // CHECK9-NEXT: [[_TMP5:%.*]] = alloca i32, align 4
5156 // CHECK9-NEXT: [[KERNEL_ARGS6:%.*]] = alloca [[STRUCT___TGT_KERNEL_ARGUMENTS]], align 8
5157 // CHECK9-NEXT: store i32 [[ARG]], ptr [[ARG_ADDR]], align 4
5158 // CHECK9-NEXT: [[TMP0:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 0
5159 // CHECK9-NEXT: store i32 2, ptr [[TMP0]], align 4
5160 // CHECK9-NEXT: [[TMP1:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 1
5161 // CHECK9-NEXT: store i32 0, ptr [[TMP1]], align 4
5162 // CHECK9-NEXT: [[TMP2:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 2
5163 // CHECK9-NEXT: store ptr null, ptr [[TMP2]], align 8
5164 // CHECK9-NEXT: [[TMP3:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 3
5165 // CHECK9-NEXT: store ptr null, ptr [[TMP3]], align 8
5166 // CHECK9-NEXT: [[TMP4:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 4
5167 // CHECK9-NEXT: store ptr null, ptr [[TMP4]], align 8
5168 // CHECK9-NEXT: [[TMP5:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 5
5169 // CHECK9-NEXT: store ptr null, ptr [[TMP5]], align 8
5170 // CHECK9-NEXT: [[TMP6:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 6
5171 // CHECK9-NEXT: store ptr null, ptr [[TMP6]], align 8
5172 // CHECK9-NEXT: [[TMP7:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 7
5173 // CHECK9-NEXT: store ptr null, ptr [[TMP7]], align 8
5174 // CHECK9-NEXT: [[TMP8:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 8
5175 // CHECK9-NEXT: store i64 100, ptr [[TMP8]], align 8
5176 // CHECK9-NEXT: [[TMP9:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 9
5177 // CHECK9-NEXT: store i64 0, ptr [[TMP9]], align 8
5178 // CHECK9-NEXT: [[TMP10:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 10
5179 // CHECK9-NEXT: store [3 x i32] zeroinitializer, ptr [[TMP10]], align 4
5180 // CHECK9-NEXT: [[TMP11:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 11
5181 // CHECK9-NEXT: store [3 x i32] zeroinitializer, ptr [[TMP11]], align 4
5182 // CHECK9-NEXT: [[TMP12:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 12
5183 // CHECK9-NEXT: store i32 0, ptr [[TMP12]], align 4
5184 // CHECK9-NEXT: [[TMP13:%.*]] = call i32 @__tgt_target_kernel(ptr @[[GLOB3]], i64 -1, i32 0, i32 0, ptr @.{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z5tmainIiEiT__l59.region_id, ptr [[KERNEL_ARGS]])
5185 // CHECK9-NEXT: [[TMP14:%.*]] = icmp ne i32 [[TMP13]], 0
5186 // CHECK9-NEXT: br i1 [[TMP14]], label [[OMP_OFFLOAD_FAILED:%.*]], label [[OMP_OFFLOAD_CONT:%.*]]
5187 // CHECK9: omp_offload.failed:
5188 // CHECK9-NEXT: call void @{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z5tmainIiEiT__l59() #[[ATTR2]]
5189 // CHECK9-NEXT: br label [[OMP_OFFLOAD_CONT]]
5190 // CHECK9: omp_offload.cont:
5191 // CHECK9-NEXT: [[TMP15:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS2]], i32 0, i32 0
5192 // CHECK9-NEXT: store i32 2, ptr [[TMP15]], align 4
5193 // CHECK9-NEXT: [[TMP16:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS2]], i32 0, i32 1
5194 // CHECK9-NEXT: store i32 0, ptr [[TMP16]], align 4
5195 // CHECK9-NEXT: [[TMP17:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS2]], i32 0, i32 2
5196 // CHECK9-NEXT: store ptr null, ptr [[TMP17]], align 8
5197 // CHECK9-NEXT: [[TMP18:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS2]], i32 0, i32 3
5198 // CHECK9-NEXT: store ptr null, ptr [[TMP18]], align 8
5199 // CHECK9-NEXT: [[TMP19:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS2]], i32 0, i32 4
5200 // CHECK9-NEXT: store ptr null, ptr [[TMP19]], align 8
5201 // CHECK9-NEXT: [[TMP20:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS2]], i32 0, i32 5
5202 // CHECK9-NEXT: store ptr null, ptr [[TMP20]], align 8
5203 // CHECK9-NEXT: [[TMP21:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS2]], i32 0, i32 6
5204 // CHECK9-NEXT: store ptr null, ptr [[TMP21]], align 8
5205 // CHECK9-NEXT: [[TMP22:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS2]], i32 0, i32 7
5206 // CHECK9-NEXT: store ptr null, ptr [[TMP22]], align 8
5207 // CHECK9-NEXT: [[TMP23:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS2]], i32 0, i32 8
5208 // CHECK9-NEXT: store i64 100, ptr [[TMP23]], align 8
5209 // CHECK9-NEXT: [[TMP24:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS2]], i32 0, i32 9
5210 // CHECK9-NEXT: store i64 0, ptr [[TMP24]], align 8
5211 // CHECK9-NEXT: [[TMP25:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS2]], i32 0, i32 10
5212 // CHECK9-NEXT: store [3 x i32] zeroinitializer, ptr [[TMP25]], align 4
5213 // CHECK9-NEXT: [[TMP26:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS2]], i32 0, i32 11
5214 // CHECK9-NEXT: store [3 x i32] zeroinitializer, ptr [[TMP26]], align 4
5215 // CHECK9-NEXT: [[TMP27:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS2]], i32 0, i32 12
5216 // CHECK9-NEXT: store i32 0, ptr [[TMP27]], align 4
5217 // CHECK9-NEXT: [[TMP28:%.*]] = call i32 @__tgt_target_kernel(ptr @[[GLOB3]], i64 -1, i32 0, i32 0, ptr @.{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z5tmainIiEiT__l65.region_id, ptr [[KERNEL_ARGS2]])
5218 // CHECK9-NEXT: [[TMP29:%.*]] = icmp ne i32 [[TMP28]], 0
5219 // CHECK9-NEXT: br i1 [[TMP29]], label [[OMP_OFFLOAD_FAILED3:%.*]], label [[OMP_OFFLOAD_CONT4:%.*]]
5220 // CHECK9: omp_offload.failed3:
5221 // CHECK9-NEXT: call void @{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z5tmainIiEiT__l65() #[[ATTR2]]
5222 // CHECK9-NEXT: br label [[OMP_OFFLOAD_CONT4]]
5223 // CHECK9: omp_offload.cont4:
5224 // CHECK9-NEXT: [[TMP30:%.*]] = load i32, ptr [[ARG_ADDR]], align 4
5225 // CHECK9-NEXT: store i32 [[TMP30]], ptr [[ARG_CASTED]], align 4
5226 // CHECK9-NEXT: [[TMP31:%.*]] = load i64, ptr [[ARG_CASTED]], align 8
5227 // CHECK9-NEXT: [[TMP32:%.*]] = getelementptr inbounds [1 x ptr], ptr [[DOTOFFLOAD_BASEPTRS]], i32 0, i32 0
5228 // CHECK9-NEXT: store i64 [[TMP31]], ptr [[TMP32]], align 8
5229 // CHECK9-NEXT: [[TMP33:%.*]] = getelementptr inbounds [1 x ptr], ptr [[DOTOFFLOAD_PTRS]], i32 0, i32 0
5230 // CHECK9-NEXT: store i64 [[TMP31]], ptr [[TMP33]], align 8
5231 // CHECK9-NEXT: [[TMP34:%.*]] = getelementptr inbounds [1 x ptr], ptr [[DOTOFFLOAD_MAPPERS]], i64 0, i64 0
5232 // CHECK9-NEXT: store ptr null, ptr [[TMP34]], align 8
5233 // CHECK9-NEXT: [[TMP35:%.*]] = getelementptr inbounds [1 x ptr], ptr [[DOTOFFLOAD_BASEPTRS]], i32 0, i32 0
5234 // CHECK9-NEXT: [[TMP36:%.*]] = getelementptr inbounds [1 x ptr], ptr [[DOTOFFLOAD_PTRS]], i32 0, i32 0
5235 // CHECK9-NEXT: [[TMP37:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS6]], i32 0, i32 0
5236 // CHECK9-NEXT: store i32 2, ptr [[TMP37]], align 4
5237 // CHECK9-NEXT: [[TMP38:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS6]], i32 0, i32 1
5238 // CHECK9-NEXT: store i32 1, ptr [[TMP38]], align 4
5239 // CHECK9-NEXT: [[TMP39:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS6]], i32 0, i32 2
5240 // CHECK9-NEXT: store ptr [[TMP35]], ptr [[TMP39]], align 8
5241 // CHECK9-NEXT: [[TMP40:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS6]], i32 0, i32 3
5242 // CHECK9-NEXT: store ptr [[TMP36]], ptr [[TMP40]], align 8
5243 // CHECK9-NEXT: [[TMP41:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS6]], i32 0, i32 4
5244 // CHECK9-NEXT: store ptr @.offload_sizes.1, ptr [[TMP41]], align 8
5245 // CHECK9-NEXT: [[TMP42:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS6]], i32 0, i32 5
5246 // CHECK9-NEXT: store ptr @.offload_maptypes.2, ptr [[TMP42]], align 8
5247 // CHECK9-NEXT: [[TMP43:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS6]], i32 0, i32 6
5248 // CHECK9-NEXT: store ptr null, ptr [[TMP43]], align 8
5249 // CHECK9-NEXT: [[TMP44:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS6]], i32 0, i32 7
5250 // CHECK9-NEXT: store ptr null, ptr [[TMP44]], align 8
5251 // CHECK9-NEXT: [[TMP45:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS6]], i32 0, i32 8
5252 // CHECK9-NEXT: store i64 100, ptr [[TMP45]], align 8
5253 // CHECK9-NEXT: [[TMP46:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS6]], i32 0, i32 9
5254 // CHECK9-NEXT: store i64 0, ptr [[TMP46]], align 8
5255 // CHECK9-NEXT: [[TMP47:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS6]], i32 0, i32 10
5256 // CHECK9-NEXT: store [3 x i32] zeroinitializer, ptr [[TMP47]], align 4
5257 // CHECK9-NEXT: [[TMP48:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS6]], i32 0, i32 11
5258 // CHECK9-NEXT: store [3 x i32] zeroinitializer, ptr [[TMP48]], align 4
5259 // CHECK9-NEXT: [[TMP49:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS6]], i32 0, i32 12
5260 // CHECK9-NEXT: store i32 0, ptr [[TMP49]], align 4
5261 // CHECK9-NEXT: [[TMP50:%.*]] = call i32 @__tgt_target_kernel(ptr @[[GLOB3]], i64 -1, i32 0, i32 0, ptr @.{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z5tmainIiEiT__l71.region_id, ptr [[KERNEL_ARGS6]])
5262 // CHECK9-NEXT: [[TMP51:%.*]] = icmp ne i32 [[TMP50]], 0
5263 // CHECK9-NEXT: br i1 [[TMP51]], label [[OMP_OFFLOAD_FAILED7:%.*]], label [[OMP_OFFLOAD_CONT8:%.*]]
5264 // CHECK9: omp_offload.failed7:
5265 // CHECK9-NEXT: call void @{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z5tmainIiEiT__l71(i64 [[TMP31]]) #[[ATTR2]]
5266 // CHECK9-NEXT: br label [[OMP_OFFLOAD_CONT8]]
5267 // CHECK9: omp_offload.cont8:
5268 // CHECK9-NEXT: ret i32 0
5271 // CHECK9-LABEL: define {{[^@]+}}@{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z5tmainIiEiT__l59
5272 // CHECK9-SAME: () #[[ATTR1]] {
5273 // CHECK9-NEXT: entry:
5274 // CHECK9-NEXT: call void (ptr, i32, ptr, ...) @__kmpc_fork_teams(ptr @[[GLOB3]], i32 0, ptr @{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z5tmainIiEiT__l59.omp_outlined)
5275 // CHECK9-NEXT: ret void
5278 // CHECK9-LABEL: define {{[^@]+}}@{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z5tmainIiEiT__l59.omp_outlined
5279 // CHECK9-SAME: (ptr noalias noundef [[DOTGLOBAL_TID_:%.*]], ptr noalias noundef [[DOTBOUND_TID_:%.*]]) #[[ATTR1]] {
5280 // CHECK9-NEXT: entry:
5281 // CHECK9-NEXT: [[DOTGLOBAL_TID__ADDR:%.*]] = alloca ptr, align 8
5282 // CHECK9-NEXT: [[DOTBOUND_TID__ADDR:%.*]] = alloca ptr, align 8
5283 // CHECK9-NEXT: [[DOTOMP_IV:%.*]] = alloca i32, align 4
5284 // CHECK9-NEXT: [[TMP:%.*]] = alloca i32, align 4
5285 // CHECK9-NEXT: [[DOTOMP_COMB_LB:%.*]] = alloca i32, align 4
5286 // CHECK9-NEXT: [[DOTOMP_COMB_UB:%.*]] = alloca i32, align 4
5287 // CHECK9-NEXT: [[DOTOMP_STRIDE:%.*]] = alloca i32, align 4
5288 // CHECK9-NEXT: [[DOTOMP_IS_LAST:%.*]] = alloca i32, align 4
5289 // CHECK9-NEXT: [[I:%.*]] = alloca i32, align 4
5290 // CHECK9-NEXT: store ptr [[DOTGLOBAL_TID_]], ptr [[DOTGLOBAL_TID__ADDR]], align 8
5291 // CHECK9-NEXT: store ptr [[DOTBOUND_TID_]], ptr [[DOTBOUND_TID__ADDR]], align 8
5292 // CHECK9-NEXT: store i32 0, ptr [[DOTOMP_COMB_LB]], align 4
5293 // CHECK9-NEXT: store i32 99, ptr [[DOTOMP_COMB_UB]], align 4
5294 // CHECK9-NEXT: store i32 1, ptr [[DOTOMP_STRIDE]], align 4
5295 // CHECK9-NEXT: store i32 0, ptr [[DOTOMP_IS_LAST]], align 4
5296 // CHECK9-NEXT: [[TMP0:%.*]] = load ptr, ptr [[DOTGLOBAL_TID__ADDR]], align 8
5297 // CHECK9-NEXT: [[TMP1:%.*]] = load i32, ptr [[TMP0]], align 4
5298 // CHECK9-NEXT: call void @__kmpc_for_static_init_4(ptr @[[GLOB1]], i32 [[TMP1]], i32 92, ptr [[DOTOMP_IS_LAST]], ptr [[DOTOMP_COMB_LB]], ptr [[DOTOMP_COMB_UB]], ptr [[DOTOMP_STRIDE]], i32 1, i32 1)
5299 // CHECK9-NEXT: [[TMP2:%.*]] = load i32, ptr [[DOTOMP_COMB_UB]], align 4
5300 // CHECK9-NEXT: [[CMP:%.*]] = icmp sgt i32 [[TMP2]], 99
5301 // CHECK9-NEXT: br i1 [[CMP]], label [[COND_TRUE:%.*]], label [[COND_FALSE:%.*]]
5302 // CHECK9: cond.true:
5303 // CHECK9-NEXT: br label [[COND_END:%.*]]
5304 // CHECK9: cond.false:
5305 // CHECK9-NEXT: [[TMP3:%.*]] = load i32, ptr [[DOTOMP_COMB_UB]], align 4
5306 // CHECK9-NEXT: br label [[COND_END]]
5307 // CHECK9: cond.end:
5308 // CHECK9-NEXT: [[COND:%.*]] = phi i32 [ 99, [[COND_TRUE]] ], [ [[TMP3]], [[COND_FALSE]] ]
5309 // CHECK9-NEXT: store i32 [[COND]], ptr [[DOTOMP_COMB_UB]], align 4
5310 // CHECK9-NEXT: [[TMP4:%.*]] = load i32, ptr [[DOTOMP_COMB_LB]], align 4
5311 // CHECK9-NEXT: store i32 [[TMP4]], ptr [[DOTOMP_IV]], align 4
5312 // CHECK9-NEXT: br label [[OMP_INNER_FOR_COND:%.*]]
5313 // CHECK9: omp.inner.for.cond:
5314 // CHECK9-NEXT: [[TMP5:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP44:![0-9]+]]
5315 // CHECK9-NEXT: [[TMP6:%.*]] = load i32, ptr [[DOTOMP_COMB_UB]], align 4, !llvm.access.group [[ACC_GRP44]]
5316 // CHECK9-NEXT: [[CMP1:%.*]] = icmp sle i32 [[TMP5]], [[TMP6]]
5317 // CHECK9-NEXT: br i1 [[CMP1]], label [[OMP_INNER_FOR_BODY:%.*]], label [[OMP_INNER_FOR_END:%.*]]
5318 // CHECK9: omp.inner.for.body:
5319 // CHECK9-NEXT: [[TMP7:%.*]] = load i32, ptr [[DOTOMP_COMB_LB]], align 4, !llvm.access.group [[ACC_GRP44]]
5320 // CHECK9-NEXT: [[TMP8:%.*]] = zext i32 [[TMP7]] to i64
5321 // CHECK9-NEXT: [[TMP9:%.*]] = load i32, ptr [[DOTOMP_COMB_UB]], align 4, !llvm.access.group [[ACC_GRP44]]
5322 // CHECK9-NEXT: [[TMP10:%.*]] = zext i32 [[TMP9]] to i64
5323 // CHECK9-NEXT: call void (ptr, i32, ptr, ...) @__kmpc_fork_call(ptr @[[GLOB3]], i32 2, ptr @{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z5tmainIiEiT__l59.omp_outlined.omp_outlined, i64 [[TMP8]], i64 [[TMP10]]), !llvm.access.group [[ACC_GRP44]]
5324 // CHECK9-NEXT: br label [[OMP_INNER_FOR_INC:%.*]]
5325 // CHECK9: omp.inner.for.inc:
5326 // CHECK9-NEXT: [[TMP11:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP44]]
5327 // CHECK9-NEXT: [[TMP12:%.*]] = load i32, ptr [[DOTOMP_STRIDE]], align 4, !llvm.access.group [[ACC_GRP44]]
5328 // CHECK9-NEXT: [[ADD:%.*]] = add nsw i32 [[TMP11]], [[TMP12]]
5329 // CHECK9-NEXT: store i32 [[ADD]], ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP44]]
5330 // CHECK9-NEXT: br label [[OMP_INNER_FOR_COND]], !llvm.loop [[LOOP45:![0-9]+]]
5331 // CHECK9: omp.inner.for.end:
5332 // CHECK9-NEXT: br label [[OMP_LOOP_EXIT:%.*]]
5333 // CHECK9: omp.loop.exit:
5334 // CHECK9-NEXT: call void @__kmpc_for_static_fini(ptr @[[GLOB1]], i32 [[TMP1]])
5335 // CHECK9-NEXT: [[TMP13:%.*]] = load i32, ptr [[DOTOMP_IS_LAST]], align 4
5336 // CHECK9-NEXT: [[TMP14:%.*]] = icmp ne i32 [[TMP13]], 0
5337 // CHECK9-NEXT: br i1 [[TMP14]], label [[DOTOMP_FINAL_THEN:%.*]], label [[DOTOMP_FINAL_DONE:%.*]]
5338 // CHECK9: .omp.final.then:
5339 // CHECK9-NEXT: store i32 100, ptr [[I]], align 4
5340 // CHECK9-NEXT: br label [[DOTOMP_FINAL_DONE]]
5341 // CHECK9: .omp.final.done:
5342 // CHECK9-NEXT: ret void
5345 // CHECK9-LABEL: define {{[^@]+}}@{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z5tmainIiEiT__l59.omp_outlined.omp_outlined
5346 // CHECK9-SAME: (ptr noalias noundef [[DOTGLOBAL_TID_:%.*]], ptr noalias noundef [[DOTBOUND_TID_:%.*]], i64 noundef [[DOTPREVIOUS_LB_:%.*]], i64 noundef [[DOTPREVIOUS_UB_:%.*]]) #[[ATTR1]] {
5347 // CHECK9-NEXT: entry:
5348 // CHECK9-NEXT: [[DOTGLOBAL_TID__ADDR:%.*]] = alloca ptr, align 8
5349 // CHECK9-NEXT: [[DOTBOUND_TID__ADDR:%.*]] = alloca ptr, align 8
5350 // CHECK9-NEXT: [[DOTPREVIOUS_LB__ADDR:%.*]] = alloca i64, align 8
5351 // CHECK9-NEXT: [[DOTPREVIOUS_UB__ADDR:%.*]] = alloca i64, align 8
5352 // CHECK9-NEXT: [[DOTOMP_IV:%.*]] = alloca i32, align 4
5353 // CHECK9-NEXT: [[TMP:%.*]] = alloca i32, align 4
5354 // CHECK9-NEXT: [[DOTOMP_LB:%.*]] = alloca i32, align 4
5355 // CHECK9-NEXT: [[DOTOMP_UB:%.*]] = alloca i32, align 4
5356 // CHECK9-NEXT: [[DOTOMP_STRIDE:%.*]] = alloca i32, align 4
5357 // CHECK9-NEXT: [[DOTOMP_IS_LAST:%.*]] = alloca i32, align 4
5358 // CHECK9-NEXT: [[I:%.*]] = alloca i32, align 4
5359 // CHECK9-NEXT: store ptr [[DOTGLOBAL_TID_]], ptr [[DOTGLOBAL_TID__ADDR]], align 8
5360 // CHECK9-NEXT: store ptr [[DOTBOUND_TID_]], ptr [[DOTBOUND_TID__ADDR]], align 8
5361 // CHECK9-NEXT: store i64 [[DOTPREVIOUS_LB_]], ptr [[DOTPREVIOUS_LB__ADDR]], align 8
5362 // CHECK9-NEXT: store i64 [[DOTPREVIOUS_UB_]], ptr [[DOTPREVIOUS_UB__ADDR]], align 8
5363 // CHECK9-NEXT: store i32 0, ptr [[DOTOMP_LB]], align 4
5364 // CHECK9-NEXT: store i32 99, ptr [[DOTOMP_UB]], align 4
5365 // CHECK9-NEXT: [[TMP0:%.*]] = load i64, ptr [[DOTPREVIOUS_LB__ADDR]], align 8
5366 // CHECK9-NEXT: [[CONV:%.*]] = trunc i64 [[TMP0]] to i32
5367 // CHECK9-NEXT: [[TMP1:%.*]] = load i64, ptr [[DOTPREVIOUS_UB__ADDR]], align 8
5368 // CHECK9-NEXT: [[CONV1:%.*]] = trunc i64 [[TMP1]] to i32
5369 // CHECK9-NEXT: store i32 [[CONV]], ptr [[DOTOMP_LB]], align 4
5370 // CHECK9-NEXT: store i32 [[CONV1]], ptr [[DOTOMP_UB]], align 4
5371 // CHECK9-NEXT: store i32 1, ptr [[DOTOMP_STRIDE]], align 4
5372 // CHECK9-NEXT: store i32 0, ptr [[DOTOMP_IS_LAST]], align 4
5373 // CHECK9-NEXT: [[TMP2:%.*]] = load ptr, ptr [[DOTGLOBAL_TID__ADDR]], align 8
5374 // CHECK9-NEXT: [[TMP3:%.*]] = load i32, ptr [[TMP2]], align 4
5375 // CHECK9-NEXT: call void @__kmpc_for_static_init_4(ptr @[[GLOB2]], i32 [[TMP3]], i32 34, ptr [[DOTOMP_IS_LAST]], ptr [[DOTOMP_LB]], ptr [[DOTOMP_UB]], ptr [[DOTOMP_STRIDE]], i32 1, i32 1)
5376 // CHECK9-NEXT: [[TMP4:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4
5377 // CHECK9-NEXT: [[CMP:%.*]] = icmp sgt i32 [[TMP4]], 99
5378 // CHECK9-NEXT: br i1 [[CMP]], label [[COND_TRUE:%.*]], label [[COND_FALSE:%.*]]
5379 // CHECK9: cond.true:
5380 // CHECK9-NEXT: br label [[COND_END:%.*]]
5381 // CHECK9: cond.false:
5382 // CHECK9-NEXT: [[TMP5:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4
5383 // CHECK9-NEXT: br label [[COND_END]]
5384 // CHECK9: cond.end:
5385 // CHECK9-NEXT: [[COND:%.*]] = phi i32 [ 99, [[COND_TRUE]] ], [ [[TMP5]], [[COND_FALSE]] ]
5386 // CHECK9-NEXT: store i32 [[COND]], ptr [[DOTOMP_UB]], align 4
5387 // CHECK9-NEXT: [[TMP6:%.*]] = load i32, ptr [[DOTOMP_LB]], align 4
5388 // CHECK9-NEXT: store i32 [[TMP6]], ptr [[DOTOMP_IV]], align 4
5389 // CHECK9-NEXT: br label [[OMP_INNER_FOR_COND:%.*]]
5390 // CHECK9: omp.inner.for.cond:
5391 // CHECK9-NEXT: [[TMP7:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP47:![0-9]+]]
5392 // CHECK9-NEXT: [[TMP8:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4, !llvm.access.group [[ACC_GRP47]]
5393 // CHECK9-NEXT: [[CMP2:%.*]] = icmp sle i32 [[TMP7]], [[TMP8]]
5394 // CHECK9-NEXT: br i1 [[CMP2]], label [[OMP_INNER_FOR_BODY:%.*]], label [[OMP_INNER_FOR_END:%.*]]
5395 // CHECK9: omp.inner.for.body:
5396 // CHECK9-NEXT: [[TMP9:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP47]]
5397 // CHECK9-NEXT: [[MUL:%.*]] = mul nsw i32 [[TMP9]], 1
5398 // CHECK9-NEXT: [[ADD:%.*]] = add nsw i32 0, [[MUL]]
5399 // CHECK9-NEXT: store i32 [[ADD]], ptr [[I]], align 4, !llvm.access.group [[ACC_GRP47]]
5400 // CHECK9-NEXT: call void @_Z3fn1v(), !llvm.access.group [[ACC_GRP47]]
5401 // CHECK9-NEXT: br label [[OMP_BODY_CONTINUE:%.*]]
5402 // CHECK9: omp.body.continue:
5403 // CHECK9-NEXT: br label [[OMP_INNER_FOR_INC:%.*]]
5404 // CHECK9: omp.inner.for.inc:
5405 // CHECK9-NEXT: [[TMP10:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP47]]
5406 // CHECK9-NEXT: [[ADD3:%.*]] = add nsw i32 [[TMP10]], 1
5407 // CHECK9-NEXT: store i32 [[ADD3]], ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP47]]
5408 // CHECK9-NEXT: br label [[OMP_INNER_FOR_COND]], !llvm.loop [[LOOP48:![0-9]+]]
5409 // CHECK9: omp.inner.for.end:
5410 // CHECK9-NEXT: br label [[OMP_LOOP_EXIT:%.*]]
5411 // CHECK9: omp.loop.exit:
5412 // CHECK9-NEXT: call void @__kmpc_for_static_fini(ptr @[[GLOB1]], i32 [[TMP3]])
5413 // CHECK9-NEXT: [[TMP11:%.*]] = load i32, ptr [[DOTOMP_IS_LAST]], align 4
5414 // CHECK9-NEXT: [[TMP12:%.*]] = icmp ne i32 [[TMP11]], 0
5415 // CHECK9-NEXT: br i1 [[TMP12]], label [[DOTOMP_FINAL_THEN:%.*]], label [[DOTOMP_FINAL_DONE:%.*]]
5416 // CHECK9: .omp.final.then:
5417 // CHECK9-NEXT: store i32 100, ptr [[I]], align 4
5418 // CHECK9-NEXT: br label [[DOTOMP_FINAL_DONE]]
5419 // CHECK9: .omp.final.done:
5420 // CHECK9-NEXT: ret void
5423 // CHECK9-LABEL: define {{[^@]+}}@{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z5tmainIiEiT__l65
5424 // CHECK9-SAME: () #[[ATTR1]] {
5425 // CHECK9-NEXT: entry:
5426 // CHECK9-NEXT: call void (ptr, i32, ptr, ...) @__kmpc_fork_teams(ptr @[[GLOB3]], i32 0, ptr @{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z5tmainIiEiT__l65.omp_outlined)
5427 // CHECK9-NEXT: ret void
5430 // CHECK9-LABEL: define {{[^@]+}}@{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z5tmainIiEiT__l65.omp_outlined
5431 // CHECK9-SAME: (ptr noalias noundef [[DOTGLOBAL_TID_:%.*]], ptr noalias noundef [[DOTBOUND_TID_:%.*]]) #[[ATTR1]] {
5432 // CHECK9-NEXT: entry:
5433 // CHECK9-NEXT: [[DOTGLOBAL_TID__ADDR:%.*]] = alloca ptr, align 8
5434 // CHECK9-NEXT: [[DOTBOUND_TID__ADDR:%.*]] = alloca ptr, align 8
5435 // CHECK9-NEXT: [[DOTOMP_IV:%.*]] = alloca i32, align 4
5436 // CHECK9-NEXT: [[TMP:%.*]] = alloca i32, align 4
5437 // CHECK9-NEXT: [[DOTOMP_COMB_LB:%.*]] = alloca i32, align 4
5438 // CHECK9-NEXT: [[DOTOMP_COMB_UB:%.*]] = alloca i32, align 4
5439 // CHECK9-NEXT: [[DOTOMP_STRIDE:%.*]] = alloca i32, align 4
5440 // CHECK9-NEXT: [[DOTOMP_IS_LAST:%.*]] = alloca i32, align 4
5441 // CHECK9-NEXT: [[I:%.*]] = alloca i32, align 4
5442 // CHECK9-NEXT: [[DOTBOUND_ZERO_ADDR:%.*]] = alloca i32, align 4
5443 // CHECK9-NEXT: store ptr [[DOTGLOBAL_TID_]], ptr [[DOTGLOBAL_TID__ADDR]], align 8
5444 // CHECK9-NEXT: store ptr [[DOTBOUND_TID_]], ptr [[DOTBOUND_TID__ADDR]], align 8
5445 // CHECK9-NEXT: store i32 0, ptr [[DOTOMP_COMB_LB]], align 4
5446 // CHECK9-NEXT: store i32 99, ptr [[DOTOMP_COMB_UB]], align 4
5447 // CHECK9-NEXT: store i32 1, ptr [[DOTOMP_STRIDE]], align 4
5448 // CHECK9-NEXT: store i32 0, ptr [[DOTOMP_IS_LAST]], align 4
5449 // CHECK9-NEXT: [[TMP0:%.*]] = load ptr, ptr [[DOTGLOBAL_TID__ADDR]], align 8
5450 // CHECK9-NEXT: [[TMP1:%.*]] = load i32, ptr [[TMP0]], align 4
5451 // CHECK9-NEXT: call void @__kmpc_for_static_init_4(ptr @[[GLOB1]], i32 [[TMP1]], i32 92, ptr [[DOTOMP_IS_LAST]], ptr [[DOTOMP_COMB_LB]], ptr [[DOTOMP_COMB_UB]], ptr [[DOTOMP_STRIDE]], i32 1, i32 1)
5452 // CHECK9-NEXT: [[TMP2:%.*]] = load i32, ptr [[DOTOMP_COMB_UB]], align 4
5453 // CHECK9-NEXT: [[CMP:%.*]] = icmp sgt i32 [[TMP2]], 99
5454 // CHECK9-NEXT: br i1 [[CMP]], label [[COND_TRUE:%.*]], label [[COND_FALSE:%.*]]
5455 // CHECK9: cond.true:
5456 // CHECK9-NEXT: br label [[COND_END:%.*]]
5457 // CHECK9: cond.false:
5458 // CHECK9-NEXT: [[TMP3:%.*]] = load i32, ptr [[DOTOMP_COMB_UB]], align 4
5459 // CHECK9-NEXT: br label [[COND_END]]
5460 // CHECK9: cond.end:
5461 // CHECK9-NEXT: [[COND:%.*]] = phi i32 [ 99, [[COND_TRUE]] ], [ [[TMP3]], [[COND_FALSE]] ]
5462 // CHECK9-NEXT: store i32 [[COND]], ptr [[DOTOMP_COMB_UB]], align 4
5463 // CHECK9-NEXT: [[TMP4:%.*]] = load i32, ptr [[DOTOMP_COMB_LB]], align 4
5464 // CHECK9-NEXT: store i32 [[TMP4]], ptr [[DOTOMP_IV]], align 4
5465 // CHECK9-NEXT: br label [[OMP_INNER_FOR_COND:%.*]]
5466 // CHECK9: omp.inner.for.cond:
5467 // CHECK9-NEXT: [[TMP5:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP50:![0-9]+]]
5468 // CHECK9-NEXT: [[TMP6:%.*]] = load i32, ptr [[DOTOMP_COMB_UB]], align 4, !llvm.access.group [[ACC_GRP50]]
5469 // CHECK9-NEXT: [[CMP1:%.*]] = icmp sle i32 [[TMP5]], [[TMP6]]
5470 // CHECK9-NEXT: br i1 [[CMP1]], label [[OMP_INNER_FOR_BODY:%.*]], label [[OMP_INNER_FOR_END:%.*]]
5471 // CHECK9: omp.inner.for.body:
5472 // CHECK9-NEXT: [[TMP7:%.*]] = load i32, ptr [[DOTOMP_COMB_LB]], align 4, !llvm.access.group [[ACC_GRP50]]
5473 // CHECK9-NEXT: [[TMP8:%.*]] = zext i32 [[TMP7]] to i64
5474 // CHECK9-NEXT: [[TMP9:%.*]] = load i32, ptr [[DOTOMP_COMB_UB]], align 4, !llvm.access.group [[ACC_GRP50]]
5475 // CHECK9-NEXT: [[TMP10:%.*]] = zext i32 [[TMP9]] to i64
5476 // CHECK9-NEXT: call void @__kmpc_serialized_parallel(ptr @[[GLOB3]], i32 [[TMP1]]), !llvm.access.group [[ACC_GRP50]]
5477 // CHECK9-NEXT: [[TMP11:%.*]] = load ptr, ptr [[DOTGLOBAL_TID__ADDR]], align 8, !llvm.access.group [[ACC_GRP50]]
5478 // CHECK9-NEXT: store i32 0, ptr [[DOTBOUND_ZERO_ADDR]], align 4, !llvm.access.group [[ACC_GRP50]]
5479 // CHECK9-NEXT: call void @{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z5tmainIiEiT__l65.omp_outlined.omp_outlined(ptr [[TMP11]], ptr [[DOTBOUND_ZERO_ADDR]], i64 [[TMP8]], i64 [[TMP10]]) #[[ATTR2]], !llvm.access.group [[ACC_GRP50]]
5480 // CHECK9-NEXT: call void @__kmpc_end_serialized_parallel(ptr @[[GLOB3]], i32 [[TMP1]]), !llvm.access.group [[ACC_GRP50]]
5481 // CHECK9-NEXT: br label [[OMP_INNER_FOR_INC:%.*]]
5482 // CHECK9: omp.inner.for.inc:
5483 // CHECK9-NEXT: [[TMP12:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP50]]
5484 // CHECK9-NEXT: [[TMP13:%.*]] = load i32, ptr [[DOTOMP_STRIDE]], align 4, !llvm.access.group [[ACC_GRP50]]
5485 // CHECK9-NEXT: [[ADD:%.*]] = add nsw i32 [[TMP12]], [[TMP13]]
5486 // CHECK9-NEXT: store i32 [[ADD]], ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP50]]
5487 // CHECK9-NEXT: br label [[OMP_INNER_FOR_COND]], !llvm.loop [[LOOP51:![0-9]+]]
5488 // CHECK9: omp.inner.for.end:
5489 // CHECK9-NEXT: br label [[OMP_LOOP_EXIT:%.*]]
5490 // CHECK9: omp.loop.exit:
5491 // CHECK9-NEXT: call void @__kmpc_for_static_fini(ptr @[[GLOB1]], i32 [[TMP1]])
5492 // CHECK9-NEXT: [[TMP14:%.*]] = load i32, ptr [[DOTOMP_IS_LAST]], align 4
5493 // CHECK9-NEXT: [[TMP15:%.*]] = icmp ne i32 [[TMP14]], 0
5494 // CHECK9-NEXT: br i1 [[TMP15]], label [[DOTOMP_FINAL_THEN:%.*]], label [[DOTOMP_FINAL_DONE:%.*]]
5495 // CHECK9: .omp.final.then:
5496 // CHECK9-NEXT: store i32 100, ptr [[I]], align 4
5497 // CHECK9-NEXT: br label [[DOTOMP_FINAL_DONE]]
5498 // CHECK9: .omp.final.done:
5499 // CHECK9-NEXT: ret void
5502 // CHECK9-LABEL: define {{[^@]+}}@{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z5tmainIiEiT__l65.omp_outlined.omp_outlined
5503 // CHECK9-SAME: (ptr noalias noundef [[DOTGLOBAL_TID_:%.*]], ptr noalias noundef [[DOTBOUND_TID_:%.*]], i64 noundef [[DOTPREVIOUS_LB_:%.*]], i64 noundef [[DOTPREVIOUS_UB_:%.*]]) #[[ATTR1]] {
5504 // CHECK9-NEXT: entry:
5505 // CHECK9-NEXT: [[DOTGLOBAL_TID__ADDR:%.*]] = alloca ptr, align 8
5506 // CHECK9-NEXT: [[DOTBOUND_TID__ADDR:%.*]] = alloca ptr, align 8
5507 // CHECK9-NEXT: [[DOTPREVIOUS_LB__ADDR:%.*]] = alloca i64, align 8
5508 // CHECK9-NEXT: [[DOTPREVIOUS_UB__ADDR:%.*]] = alloca i64, align 8
5509 // CHECK9-NEXT: [[DOTOMP_IV:%.*]] = alloca i32, align 4
5510 // CHECK9-NEXT: [[TMP:%.*]] = alloca i32, align 4
5511 // CHECK9-NEXT: [[DOTOMP_LB:%.*]] = alloca i32, align 4
5512 // CHECK9-NEXT: [[DOTOMP_UB:%.*]] = alloca i32, align 4
5513 // CHECK9-NEXT: [[DOTOMP_STRIDE:%.*]] = alloca i32, align 4
5514 // CHECK9-NEXT: [[DOTOMP_IS_LAST:%.*]] = alloca i32, align 4
5515 // CHECK9-NEXT: [[I:%.*]] = alloca i32, align 4
5516 // CHECK9-NEXT: store ptr [[DOTGLOBAL_TID_]], ptr [[DOTGLOBAL_TID__ADDR]], align 8
5517 // CHECK9-NEXT: store ptr [[DOTBOUND_TID_]], ptr [[DOTBOUND_TID__ADDR]], align 8
5518 // CHECK9-NEXT: store i64 [[DOTPREVIOUS_LB_]], ptr [[DOTPREVIOUS_LB__ADDR]], align 8
5519 // CHECK9-NEXT: store i64 [[DOTPREVIOUS_UB_]], ptr [[DOTPREVIOUS_UB__ADDR]], align 8
5520 // CHECK9-NEXT: store i32 0, ptr [[DOTOMP_LB]], align 4
5521 // CHECK9-NEXT: store i32 99, ptr [[DOTOMP_UB]], align 4
5522 // CHECK9-NEXT: [[TMP0:%.*]] = load i64, ptr [[DOTPREVIOUS_LB__ADDR]], align 8
5523 // CHECK9-NEXT: [[CONV:%.*]] = trunc i64 [[TMP0]] to i32
5524 // CHECK9-NEXT: [[TMP1:%.*]] = load i64, ptr [[DOTPREVIOUS_UB__ADDR]], align 8
5525 // CHECK9-NEXT: [[CONV1:%.*]] = trunc i64 [[TMP1]] to i32
5526 // CHECK9-NEXT: store i32 [[CONV]], ptr [[DOTOMP_LB]], align 4
5527 // CHECK9-NEXT: store i32 [[CONV1]], ptr [[DOTOMP_UB]], align 4
5528 // CHECK9-NEXT: store i32 1, ptr [[DOTOMP_STRIDE]], align 4
5529 // CHECK9-NEXT: store i32 0, ptr [[DOTOMP_IS_LAST]], align 4
5530 // CHECK9-NEXT: [[TMP2:%.*]] = load ptr, ptr [[DOTGLOBAL_TID__ADDR]], align 8
5531 // CHECK9-NEXT: [[TMP3:%.*]] = load i32, ptr [[TMP2]], align 4
5532 // CHECK9-NEXT: call void @__kmpc_for_static_init_4(ptr @[[GLOB2]], i32 [[TMP3]], i32 34, ptr [[DOTOMP_IS_LAST]], ptr [[DOTOMP_LB]], ptr [[DOTOMP_UB]], ptr [[DOTOMP_STRIDE]], i32 1, i32 1)
5533 // CHECK9-NEXT: [[TMP4:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4
5534 // CHECK9-NEXT: [[CMP:%.*]] = icmp sgt i32 [[TMP4]], 99
5535 // CHECK9-NEXT: br i1 [[CMP]], label [[COND_TRUE:%.*]], label [[COND_FALSE:%.*]]
5536 // CHECK9: cond.true:
5537 // CHECK9-NEXT: br label [[COND_END:%.*]]
5538 // CHECK9: cond.false:
5539 // CHECK9-NEXT: [[TMP5:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4
5540 // CHECK9-NEXT: br label [[COND_END]]
5541 // CHECK9: cond.end:
5542 // CHECK9-NEXT: [[COND:%.*]] = phi i32 [ 99, [[COND_TRUE]] ], [ [[TMP5]], [[COND_FALSE]] ]
5543 // CHECK9-NEXT: store i32 [[COND]], ptr [[DOTOMP_UB]], align 4
5544 // CHECK9-NEXT: [[TMP6:%.*]] = load i32, ptr [[DOTOMP_LB]], align 4
5545 // CHECK9-NEXT: store i32 [[TMP6]], ptr [[DOTOMP_IV]], align 4
5546 // CHECK9-NEXT: br label [[OMP_INNER_FOR_COND:%.*]]
5547 // CHECK9: omp.inner.for.cond:
5548 // CHECK9-NEXT: [[TMP7:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP53:![0-9]+]]
5549 // CHECK9-NEXT: [[TMP8:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4, !llvm.access.group [[ACC_GRP53]]
5550 // CHECK9-NEXT: [[CMP2:%.*]] = icmp sle i32 [[TMP7]], [[TMP8]]
5551 // CHECK9-NEXT: br i1 [[CMP2]], label [[OMP_INNER_FOR_BODY:%.*]], label [[OMP_INNER_FOR_END:%.*]]
5552 // CHECK9: omp.inner.for.body:
5553 // CHECK9-NEXT: [[TMP9:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP53]]
5554 // CHECK9-NEXT: [[MUL:%.*]] = mul nsw i32 [[TMP9]], 1
5555 // CHECK9-NEXT: [[ADD:%.*]] = add nsw i32 0, [[MUL]]
5556 // CHECK9-NEXT: store i32 [[ADD]], ptr [[I]], align 4, !llvm.access.group [[ACC_GRP53]]
5557 // CHECK9-NEXT: call void @_Z3fn2v(), !llvm.access.group [[ACC_GRP53]]
5558 // CHECK9-NEXT: br label [[OMP_BODY_CONTINUE:%.*]]
5559 // CHECK9: omp.body.continue:
5560 // CHECK9-NEXT: br label [[OMP_INNER_FOR_INC:%.*]]
5561 // CHECK9: omp.inner.for.inc:
5562 // CHECK9-NEXT: [[TMP10:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP53]]
5563 // CHECK9-NEXT: [[ADD3:%.*]] = add nsw i32 [[TMP10]], 1
5564 // CHECK9-NEXT: store i32 [[ADD3]], ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP53]]
5565 // CHECK9-NEXT: br label [[OMP_INNER_FOR_COND]], !llvm.loop [[LOOP54:![0-9]+]]
5566 // CHECK9: omp.inner.for.end:
5567 // CHECK9-NEXT: br label [[OMP_LOOP_EXIT:%.*]]
5568 // CHECK9: omp.loop.exit:
5569 // CHECK9-NEXT: call void @__kmpc_for_static_fini(ptr @[[GLOB1]], i32 [[TMP3]])
5570 // CHECK9-NEXT: [[TMP11:%.*]] = load i32, ptr [[DOTOMP_IS_LAST]], align 4
5571 // CHECK9-NEXT: [[TMP12:%.*]] = icmp ne i32 [[TMP11]], 0
5572 // CHECK9-NEXT: br i1 [[TMP12]], label [[DOTOMP_FINAL_THEN:%.*]], label [[DOTOMP_FINAL_DONE:%.*]]
5573 // CHECK9: .omp.final.then:
5574 // CHECK9-NEXT: store i32 100, ptr [[I]], align 4
5575 // CHECK9-NEXT: br label [[DOTOMP_FINAL_DONE]]
5576 // CHECK9: .omp.final.done:
5577 // CHECK9-NEXT: ret void
5580 // CHECK9-LABEL: define {{[^@]+}}@{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z5tmainIiEiT__l71
5581 // CHECK9-SAME: (i64 noundef [[ARG:%.*]]) #[[ATTR1]] {
5582 // CHECK9-NEXT: entry:
5583 // CHECK9-NEXT: [[ARG_ADDR:%.*]] = alloca i64, align 8
5584 // CHECK9-NEXT: store i64 [[ARG]], ptr [[ARG_ADDR]], align 8
5585 // CHECK9-NEXT: call void (ptr, i32, ptr, ...) @__kmpc_fork_teams(ptr @[[GLOB3]], i32 1, ptr @{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z5tmainIiEiT__l71.omp_outlined, ptr [[ARG_ADDR]])
5586 // CHECK9-NEXT: ret void
5589 // CHECK9-LABEL: define {{[^@]+}}@{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z5tmainIiEiT__l71.omp_outlined
5590 // CHECK9-SAME: (ptr noalias noundef [[DOTGLOBAL_TID_:%.*]], ptr noalias noundef [[DOTBOUND_TID_:%.*]], ptr noundef nonnull align 4 dereferenceable(4) [[ARG:%.*]]) #[[ATTR1]] {
5591 // CHECK9-NEXT: entry:
5592 // CHECK9-NEXT: [[DOTGLOBAL_TID__ADDR:%.*]] = alloca ptr, align 8
5593 // CHECK9-NEXT: [[DOTBOUND_TID__ADDR:%.*]] = alloca ptr, align 8
5594 // CHECK9-NEXT: [[ARG_ADDR:%.*]] = alloca ptr, align 8
5595 // CHECK9-NEXT: [[DOTOMP_IV:%.*]] = alloca i32, align 4
5596 // CHECK9-NEXT: [[TMP:%.*]] = alloca i32, align 4
5597 // CHECK9-NEXT: [[DOTOMP_COMB_LB:%.*]] = alloca i32, align 4
5598 // CHECK9-NEXT: [[DOTOMP_COMB_UB:%.*]] = alloca i32, align 4
5599 // CHECK9-NEXT: [[DOTOMP_STRIDE:%.*]] = alloca i32, align 4
5600 // CHECK9-NEXT: [[DOTOMP_IS_LAST:%.*]] = alloca i32, align 4
5601 // CHECK9-NEXT: [[I:%.*]] = alloca i32, align 4
5602 // CHECK9-NEXT: [[DOTBOUND_ZERO_ADDR:%.*]] = alloca i32, align 4
5603 // CHECK9-NEXT: store ptr [[DOTGLOBAL_TID_]], ptr [[DOTGLOBAL_TID__ADDR]], align 8
5604 // CHECK9-NEXT: store ptr [[DOTBOUND_TID_]], ptr [[DOTBOUND_TID__ADDR]], align 8
5605 // CHECK9-NEXT: store ptr [[ARG]], ptr [[ARG_ADDR]], align 8
5606 // CHECK9-NEXT: [[TMP0:%.*]] = load ptr, ptr [[ARG_ADDR]], align 8
5607 // CHECK9-NEXT: store i32 0, ptr [[DOTOMP_COMB_LB]], align 4
5608 // CHECK9-NEXT: store i32 99, ptr [[DOTOMP_COMB_UB]], align 4
5609 // CHECK9-NEXT: store i32 1, ptr [[DOTOMP_STRIDE]], align 4
5610 // CHECK9-NEXT: store i32 0, ptr [[DOTOMP_IS_LAST]], align 4
5611 // CHECK9-NEXT: [[TMP1:%.*]] = load ptr, ptr [[DOTGLOBAL_TID__ADDR]], align 8
5612 // CHECK9-NEXT: [[TMP2:%.*]] = load i32, ptr [[TMP1]], align 4
5613 // CHECK9-NEXT: call void @__kmpc_for_static_init_4(ptr @[[GLOB1]], i32 [[TMP2]], i32 92, ptr [[DOTOMP_IS_LAST]], ptr [[DOTOMP_COMB_LB]], ptr [[DOTOMP_COMB_UB]], ptr [[DOTOMP_STRIDE]], i32 1, i32 1)
5614 // CHECK9-NEXT: [[TMP3:%.*]] = load i32, ptr [[DOTOMP_COMB_UB]], align 4
5615 // CHECK9-NEXT: [[CMP:%.*]] = icmp sgt i32 [[TMP3]], 99
5616 // CHECK9-NEXT: br i1 [[CMP]], label [[COND_TRUE:%.*]], label [[COND_FALSE:%.*]]
5617 // CHECK9: cond.true:
5618 // CHECK9-NEXT: br label [[COND_END:%.*]]
5619 // CHECK9: cond.false:
5620 // CHECK9-NEXT: [[TMP4:%.*]] = load i32, ptr [[DOTOMP_COMB_UB]], align 4
5621 // CHECK9-NEXT: br label [[COND_END]]
5622 // CHECK9: cond.end:
5623 // CHECK9-NEXT: [[COND:%.*]] = phi i32 [ 99, [[COND_TRUE]] ], [ [[TMP4]], [[COND_FALSE]] ]
5624 // CHECK9-NEXT: store i32 [[COND]], ptr [[DOTOMP_COMB_UB]], align 4
5625 // CHECK9-NEXT: [[TMP5:%.*]] = load i32, ptr [[DOTOMP_COMB_LB]], align 4
5626 // CHECK9-NEXT: store i32 [[TMP5]], ptr [[DOTOMP_IV]], align 4
5627 // CHECK9-NEXT: br label [[OMP_INNER_FOR_COND:%.*]]
5628 // CHECK9: omp.inner.for.cond:
5629 // CHECK9-NEXT: [[TMP6:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP56:![0-9]+]]
5630 // CHECK9-NEXT: [[TMP7:%.*]] = load i32, ptr [[DOTOMP_COMB_UB]], align 4, !llvm.access.group [[ACC_GRP56]]
5631 // CHECK9-NEXT: [[CMP1:%.*]] = icmp sle i32 [[TMP6]], [[TMP7]]
5632 // CHECK9-NEXT: br i1 [[CMP1]], label [[OMP_INNER_FOR_BODY:%.*]], label [[OMP_INNER_FOR_END:%.*]]
5633 // CHECK9: omp.inner.for.body:
5634 // CHECK9-NEXT: [[TMP8:%.*]] = load i32, ptr [[DOTOMP_COMB_LB]], align 4, !llvm.access.group [[ACC_GRP56]]
5635 // CHECK9-NEXT: [[TMP9:%.*]] = zext i32 [[TMP8]] to i64
5636 // CHECK9-NEXT: [[TMP10:%.*]] = load i32, ptr [[DOTOMP_COMB_UB]], align 4, !llvm.access.group [[ACC_GRP56]]
5637 // CHECK9-NEXT: [[TMP11:%.*]] = zext i32 [[TMP10]] to i64
5638 // CHECK9-NEXT: [[TMP12:%.*]] = load i32, ptr [[TMP0]], align 4, !llvm.access.group [[ACC_GRP56]]
5639 // CHECK9-NEXT: [[TOBOOL:%.*]] = icmp ne i32 [[TMP12]], 0
5640 // CHECK9-NEXT: br i1 [[TOBOOL]], label [[OMP_IF_THEN:%.*]], label [[OMP_IF_ELSE:%.*]]
5641 // CHECK9: omp_if.then:
5642 // CHECK9-NEXT: call void (ptr, i32, ptr, ...) @__kmpc_fork_call(ptr @[[GLOB3]], i32 2, ptr @{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z5tmainIiEiT__l71.omp_outlined.omp_outlined, i64 [[TMP9]], i64 [[TMP11]]), !llvm.access.group [[ACC_GRP56]]
5643 // CHECK9-NEXT: br label [[OMP_IF_END:%.*]]
5644 // CHECK9: omp_if.else:
5645 // CHECK9-NEXT: call void @__kmpc_serialized_parallel(ptr @[[GLOB3]], i32 [[TMP2]]), !llvm.access.group [[ACC_GRP56]]
5646 // CHECK9-NEXT: [[TMP13:%.*]] = load ptr, ptr [[DOTGLOBAL_TID__ADDR]], align 8, !llvm.access.group [[ACC_GRP56]]
5647 // CHECK9-NEXT: store i32 0, ptr [[DOTBOUND_ZERO_ADDR]], align 4, !llvm.access.group [[ACC_GRP56]]
5648 // CHECK9-NEXT: call void @{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z5tmainIiEiT__l71.omp_outlined.omp_outlined(ptr [[TMP13]], ptr [[DOTBOUND_ZERO_ADDR]], i64 [[TMP9]], i64 [[TMP11]]) #[[ATTR2]], !llvm.access.group [[ACC_GRP56]]
5649 // CHECK9-NEXT: call void @__kmpc_end_serialized_parallel(ptr @[[GLOB3]], i32 [[TMP2]]), !llvm.access.group [[ACC_GRP56]]
5650 // CHECK9-NEXT: br label [[OMP_IF_END]]
5651 // CHECK9: omp_if.end:
5652 // CHECK9-NEXT: br label [[OMP_INNER_FOR_INC:%.*]]
5653 // CHECK9: omp.inner.for.inc:
5654 // CHECK9-NEXT: [[TMP14:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP56]]
5655 // CHECK9-NEXT: [[TMP15:%.*]] = load i32, ptr [[DOTOMP_STRIDE]], align 4, !llvm.access.group [[ACC_GRP56]]
5656 // CHECK9-NEXT: [[ADD:%.*]] = add nsw i32 [[TMP14]], [[TMP15]]
5657 // CHECK9-NEXT: store i32 [[ADD]], ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP56]]
5658 // CHECK9-NEXT: br label [[OMP_INNER_FOR_COND]], !llvm.loop [[LOOP57:![0-9]+]]
5659 // CHECK9: omp.inner.for.end:
5660 // CHECK9-NEXT: br label [[OMP_LOOP_EXIT:%.*]]
5661 // CHECK9: omp.loop.exit:
5662 // CHECK9-NEXT: call void @__kmpc_for_static_fini(ptr @[[GLOB1]], i32 [[TMP2]])
5663 // CHECK9-NEXT: [[TMP16:%.*]] = load i32, ptr [[DOTOMP_IS_LAST]], align 4
5664 // CHECK9-NEXT: [[TMP17:%.*]] = icmp ne i32 [[TMP16]], 0
5665 // CHECK9-NEXT: br i1 [[TMP17]], label [[DOTOMP_FINAL_THEN:%.*]], label [[DOTOMP_FINAL_DONE:%.*]]
5666 // CHECK9: .omp.final.then:
5667 // CHECK9-NEXT: store i32 100, ptr [[I]], align 4
5668 // CHECK9-NEXT: br label [[DOTOMP_FINAL_DONE]]
5669 // CHECK9: .omp.final.done:
5670 // CHECK9-NEXT: ret void
5673 // CHECK9-LABEL: define {{[^@]+}}@{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z5tmainIiEiT__l71.omp_outlined.omp_outlined
5674 // CHECK9-SAME: (ptr noalias noundef [[DOTGLOBAL_TID_:%.*]], ptr noalias noundef [[DOTBOUND_TID_:%.*]], i64 noundef [[DOTPREVIOUS_LB_:%.*]], i64 noundef [[DOTPREVIOUS_UB_:%.*]]) #[[ATTR1]] {
5675 // CHECK9-NEXT: entry:
5676 // CHECK9-NEXT: [[DOTGLOBAL_TID__ADDR:%.*]] = alloca ptr, align 8
5677 // CHECK9-NEXT: [[DOTBOUND_TID__ADDR:%.*]] = alloca ptr, align 8
5678 // CHECK9-NEXT: [[DOTPREVIOUS_LB__ADDR:%.*]] = alloca i64, align 8
5679 // CHECK9-NEXT: [[DOTPREVIOUS_UB__ADDR:%.*]] = alloca i64, align 8
5680 // CHECK9-NEXT: [[DOTOMP_IV:%.*]] = alloca i32, align 4
5681 // CHECK9-NEXT: [[TMP:%.*]] = alloca i32, align 4
5682 // CHECK9-NEXT: [[DOTOMP_LB:%.*]] = alloca i32, align 4
5683 // CHECK9-NEXT: [[DOTOMP_UB:%.*]] = alloca i32, align 4
5684 // CHECK9-NEXT: [[DOTOMP_STRIDE:%.*]] = alloca i32, align 4
5685 // CHECK9-NEXT: [[DOTOMP_IS_LAST:%.*]] = alloca i32, align 4
5686 // CHECK9-NEXT: [[I:%.*]] = alloca i32, align 4
5687 // CHECK9-NEXT: store ptr [[DOTGLOBAL_TID_]], ptr [[DOTGLOBAL_TID__ADDR]], align 8
5688 // CHECK9-NEXT: store ptr [[DOTBOUND_TID_]], ptr [[DOTBOUND_TID__ADDR]], align 8
5689 // CHECK9-NEXT: store i64 [[DOTPREVIOUS_LB_]], ptr [[DOTPREVIOUS_LB__ADDR]], align 8
5690 // CHECK9-NEXT: store i64 [[DOTPREVIOUS_UB_]], ptr [[DOTPREVIOUS_UB__ADDR]], align 8
5691 // CHECK9-NEXT: store i32 0, ptr [[DOTOMP_LB]], align 4
5692 // CHECK9-NEXT: store i32 99, ptr [[DOTOMP_UB]], align 4
5693 // CHECK9-NEXT: [[TMP0:%.*]] = load i64, ptr [[DOTPREVIOUS_LB__ADDR]], align 8
5694 // CHECK9-NEXT: [[CONV:%.*]] = trunc i64 [[TMP0]] to i32
5695 // CHECK9-NEXT: [[TMP1:%.*]] = load i64, ptr [[DOTPREVIOUS_UB__ADDR]], align 8
5696 // CHECK9-NEXT: [[CONV1:%.*]] = trunc i64 [[TMP1]] to i32
5697 // CHECK9-NEXT: store i32 [[CONV]], ptr [[DOTOMP_LB]], align 4
5698 // CHECK9-NEXT: store i32 [[CONV1]], ptr [[DOTOMP_UB]], align 4
5699 // CHECK9-NEXT: store i32 1, ptr [[DOTOMP_STRIDE]], align 4
5700 // CHECK9-NEXT: store i32 0, ptr [[DOTOMP_IS_LAST]], align 4
5701 // CHECK9-NEXT: [[TMP2:%.*]] = load ptr, ptr [[DOTGLOBAL_TID__ADDR]], align 8
5702 // CHECK9-NEXT: [[TMP3:%.*]] = load i32, ptr [[TMP2]], align 4
5703 // CHECK9-NEXT: call void @__kmpc_for_static_init_4(ptr @[[GLOB2]], i32 [[TMP3]], i32 34, ptr [[DOTOMP_IS_LAST]], ptr [[DOTOMP_LB]], ptr [[DOTOMP_UB]], ptr [[DOTOMP_STRIDE]], i32 1, i32 1)
5704 // CHECK9-NEXT: [[TMP4:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4
5705 // CHECK9-NEXT: [[CMP:%.*]] = icmp sgt i32 [[TMP4]], 99
5706 // CHECK9-NEXT: br i1 [[CMP]], label [[COND_TRUE:%.*]], label [[COND_FALSE:%.*]]
5707 // CHECK9: cond.true:
5708 // CHECK9-NEXT: br label [[COND_END:%.*]]
5709 // CHECK9: cond.false:
5710 // CHECK9-NEXT: [[TMP5:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4
5711 // CHECK9-NEXT: br label [[COND_END]]
5712 // CHECK9: cond.end:
5713 // CHECK9-NEXT: [[COND:%.*]] = phi i32 [ 99, [[COND_TRUE]] ], [ [[TMP5]], [[COND_FALSE]] ]
5714 // CHECK9-NEXT: store i32 [[COND]], ptr [[DOTOMP_UB]], align 4
5715 // CHECK9-NEXT: [[TMP6:%.*]] = load i32, ptr [[DOTOMP_LB]], align 4
5716 // CHECK9-NEXT: store i32 [[TMP6]], ptr [[DOTOMP_IV]], align 4
5717 // CHECK9-NEXT: br label [[OMP_INNER_FOR_COND:%.*]]
5718 // CHECK9: omp.inner.for.cond:
5719 // CHECK9-NEXT: [[TMP7:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP59:![0-9]+]]
5720 // CHECK9-NEXT: [[TMP8:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4, !llvm.access.group [[ACC_GRP59]]
5721 // CHECK9-NEXT: [[CMP2:%.*]] = icmp sle i32 [[TMP7]], [[TMP8]]
5722 // CHECK9-NEXT: br i1 [[CMP2]], label [[OMP_INNER_FOR_BODY:%.*]], label [[OMP_INNER_FOR_END:%.*]]
5723 // CHECK9: omp.inner.for.body:
5724 // CHECK9-NEXT: [[TMP9:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP59]]
5725 // CHECK9-NEXT: [[MUL:%.*]] = mul nsw i32 [[TMP9]], 1
5726 // CHECK9-NEXT: [[ADD:%.*]] = add nsw i32 0, [[MUL]]
5727 // CHECK9-NEXT: store i32 [[ADD]], ptr [[I]], align 4, !llvm.access.group [[ACC_GRP59]]
5728 // CHECK9-NEXT: call void @_Z3fn3v(), !llvm.access.group [[ACC_GRP59]]
5729 // CHECK9-NEXT: br label [[OMP_BODY_CONTINUE:%.*]]
5730 // CHECK9: omp.body.continue:
5731 // CHECK9-NEXT: br label [[OMP_INNER_FOR_INC:%.*]]
5732 // CHECK9: omp.inner.for.inc:
5733 // CHECK9-NEXT: [[TMP10:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP59]]
5734 // CHECK9-NEXT: [[ADD3:%.*]] = add nsw i32 [[TMP10]], 1
5735 // CHECK9-NEXT: store i32 [[ADD3]], ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP59]]
5736 // CHECK9-NEXT: br label [[OMP_INNER_FOR_COND]], !llvm.loop [[LOOP60:![0-9]+]]
5737 // CHECK9: omp.inner.for.end:
5738 // CHECK9-NEXT: br label [[OMP_LOOP_EXIT:%.*]]
5739 // CHECK9: omp.loop.exit:
5740 // CHECK9-NEXT: call void @__kmpc_for_static_fini(ptr @[[GLOB1]], i32 [[TMP3]])
5741 // CHECK9-NEXT: [[TMP11:%.*]] = load i32, ptr [[DOTOMP_IS_LAST]], align 4
5742 // CHECK9-NEXT: [[TMP12:%.*]] = icmp ne i32 [[TMP11]], 0
5743 // CHECK9-NEXT: br i1 [[TMP12]], label [[DOTOMP_FINAL_THEN:%.*]], label [[DOTOMP_FINAL_DONE:%.*]]
5744 // CHECK9: .omp.final.then:
5745 // CHECK9-NEXT: store i32 100, ptr [[I]], align 4
5746 // CHECK9-NEXT: br label [[DOTOMP_FINAL_DONE]]
5747 // CHECK9: .omp.final.done:
5748 // CHECK9-NEXT: ret void
5751 // CHECK9-LABEL: define {{[^@]+}}@.omp_offloading.requires_reg
5752 // CHECK9-SAME: () #[[ATTR5:[0-9]+]] {
5753 // CHECK9-NEXT: entry:
5754 // CHECK9-NEXT: call void @__tgt_register_requires(i64 1)
5755 // CHECK9-NEXT: ret void
5758 // CHECK11-LABEL: define {{[^@]+}}@_Z9gtid_testv
5759 // CHECK11-SAME: () #[[ATTR0:[0-9]+]] {
5760 // CHECK11-NEXT: entry:
5761 // CHECK11-NEXT: [[TMP:%.*]] = alloca i32, align 4
5762 // CHECK11-NEXT: [[KERNEL_ARGS:%.*]] = alloca [[STRUCT___TGT_KERNEL_ARGUMENTS:%.*]], align 8
5763 // CHECK11-NEXT: [[_TMP1:%.*]] = alloca i32, align 4
5764 // CHECK11-NEXT: [[KERNEL_ARGS2:%.*]] = alloca [[STRUCT___TGT_KERNEL_ARGUMENTS]], align 8
5765 // CHECK11-NEXT: [[TMP0:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 0
5766 // CHECK11-NEXT: store i32 2, ptr [[TMP0]], align 4
5767 // CHECK11-NEXT: [[TMP1:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 1
5768 // CHECK11-NEXT: store i32 0, ptr [[TMP1]], align 4
5769 // CHECK11-NEXT: [[TMP2:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 2
5770 // CHECK11-NEXT: store ptr null, ptr [[TMP2]], align 8
5771 // CHECK11-NEXT: [[TMP3:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 3
5772 // CHECK11-NEXT: store ptr null, ptr [[TMP3]], align 8
5773 // CHECK11-NEXT: [[TMP4:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 4
5774 // CHECK11-NEXT: store ptr null, ptr [[TMP4]], align 8
5775 // CHECK11-NEXT: [[TMP5:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 5
5776 // CHECK11-NEXT: store ptr null, ptr [[TMP5]], align 8
5777 // CHECK11-NEXT: [[TMP6:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 6
5778 // CHECK11-NEXT: store ptr null, ptr [[TMP6]], align 8
5779 // CHECK11-NEXT: [[TMP7:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 7
5780 // CHECK11-NEXT: store ptr null, ptr [[TMP7]], align 8
5781 // CHECK11-NEXT: [[TMP8:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 8
5782 // CHECK11-NEXT: store i64 100, ptr [[TMP8]], align 8
5783 // CHECK11-NEXT: [[TMP9:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 9
5784 // CHECK11-NEXT: store i64 0, ptr [[TMP9]], align 8
5785 // CHECK11-NEXT: [[TMP10:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 10
5786 // CHECK11-NEXT: store [3 x i32] zeroinitializer, ptr [[TMP10]], align 4
5787 // CHECK11-NEXT: [[TMP11:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 11
5788 // CHECK11-NEXT: store [3 x i32] zeroinitializer, ptr [[TMP11]], align 4
5789 // CHECK11-NEXT: [[TMP12:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 12
5790 // CHECK11-NEXT: store i32 0, ptr [[TMP12]], align 4
5791 // CHECK11-NEXT: [[TMP13:%.*]] = call i32 @__tgt_target_kernel(ptr @[[GLOB3:[0-9]+]], i64 -1, i32 0, i32 0, ptr @.{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z9gtid_testv_l43.region_id, ptr [[KERNEL_ARGS]])
5792 // CHECK11-NEXT: [[TMP14:%.*]] = icmp ne i32 [[TMP13]], 0
5793 // CHECK11-NEXT: br i1 [[TMP14]], label [[OMP_OFFLOAD_FAILED:%.*]], label [[OMP_OFFLOAD_CONT:%.*]]
5794 // CHECK11: omp_offload.failed:
5795 // CHECK11-NEXT: call void @{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z9gtid_testv_l43() #[[ATTR2:[0-9]+]]
5796 // CHECK11-NEXT: br label [[OMP_OFFLOAD_CONT]]
5797 // CHECK11: omp_offload.cont:
5798 // CHECK11-NEXT: [[TMP15:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS2]], i32 0, i32 0
5799 // CHECK11-NEXT: store i32 2, ptr [[TMP15]], align 4
5800 // CHECK11-NEXT: [[TMP16:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS2]], i32 0, i32 1
5801 // CHECK11-NEXT: store i32 0, ptr [[TMP16]], align 4
5802 // CHECK11-NEXT: [[TMP17:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS2]], i32 0, i32 2
5803 // CHECK11-NEXT: store ptr null, ptr [[TMP17]], align 8
5804 // CHECK11-NEXT: [[TMP18:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS2]], i32 0, i32 3
5805 // CHECK11-NEXT: store ptr null, ptr [[TMP18]], align 8
5806 // CHECK11-NEXT: [[TMP19:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS2]], i32 0, i32 4
5807 // CHECK11-NEXT: store ptr null, ptr [[TMP19]], align 8
5808 // CHECK11-NEXT: [[TMP20:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS2]], i32 0, i32 5
5809 // CHECK11-NEXT: store ptr null, ptr [[TMP20]], align 8
5810 // CHECK11-NEXT: [[TMP21:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS2]], i32 0, i32 6
5811 // CHECK11-NEXT: store ptr null, ptr [[TMP21]], align 8
5812 // CHECK11-NEXT: [[TMP22:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS2]], i32 0, i32 7
5813 // CHECK11-NEXT: store ptr null, ptr [[TMP22]], align 8
5814 // CHECK11-NEXT: [[TMP23:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS2]], i32 0, i32 8
5815 // CHECK11-NEXT: store i64 100, ptr [[TMP23]], align 8
5816 // CHECK11-NEXT: [[TMP24:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS2]], i32 0, i32 9
5817 // CHECK11-NEXT: store i64 0, ptr [[TMP24]], align 8
5818 // CHECK11-NEXT: [[TMP25:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS2]], i32 0, i32 10
5819 // CHECK11-NEXT: store [3 x i32] zeroinitializer, ptr [[TMP25]], align 4
5820 // CHECK11-NEXT: [[TMP26:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS2]], i32 0, i32 11
5821 // CHECK11-NEXT: store [3 x i32] zeroinitializer, ptr [[TMP26]], align 4
5822 // CHECK11-NEXT: [[TMP27:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS2]], i32 0, i32 12
5823 // CHECK11-NEXT: store i32 0, ptr [[TMP27]], align 4
5824 // CHECK11-NEXT: [[TMP28:%.*]] = call i32 @__tgt_target_kernel(ptr @[[GLOB3]], i64 -1, i32 0, i32 0, ptr @.{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z9gtid_testv_l48.region_id, ptr [[KERNEL_ARGS2]])
5825 // CHECK11-NEXT: [[TMP29:%.*]] = icmp ne i32 [[TMP28]], 0
5826 // CHECK11-NEXT: br i1 [[TMP29]], label [[OMP_OFFLOAD_FAILED3:%.*]], label [[OMP_OFFLOAD_CONT4:%.*]]
5827 // CHECK11: omp_offload.failed3:
5828 // CHECK11-NEXT: call void @{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z9gtid_testv_l48() #[[ATTR2]]
5829 // CHECK11-NEXT: br label [[OMP_OFFLOAD_CONT4]]
5830 // CHECK11: omp_offload.cont4:
5831 // CHECK11-NEXT: ret void
5834 // CHECK11-LABEL: define {{[^@]+}}@{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z9gtid_testv_l43
5835 // CHECK11-SAME: () #[[ATTR1:[0-9]+]] {
5836 // CHECK11-NEXT: entry:
5837 // CHECK11-NEXT: call void (ptr, i32, ptr, ...) @__kmpc_fork_teams(ptr @[[GLOB3]], i32 0, ptr @{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z9gtid_testv_l43.omp_outlined)
5838 // CHECK11-NEXT: ret void
5841 // CHECK11-LABEL: define {{[^@]+}}@{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z9gtid_testv_l43.omp_outlined
5842 // CHECK11-SAME: (ptr noalias noundef [[DOTGLOBAL_TID_:%.*]], ptr noalias noundef [[DOTBOUND_TID_:%.*]]) #[[ATTR1]] {
5843 // CHECK11-NEXT: entry:
5844 // CHECK11-NEXT: [[DOTGLOBAL_TID__ADDR:%.*]] = alloca ptr, align 8
5845 // CHECK11-NEXT: [[DOTBOUND_TID__ADDR:%.*]] = alloca ptr, align 8
5846 // CHECK11-NEXT: [[DOTOMP_IV:%.*]] = alloca i32, align 4
5847 // CHECK11-NEXT: [[TMP:%.*]] = alloca i32, align 4
5848 // CHECK11-NEXT: [[DOTOMP_COMB_LB:%.*]] = alloca i32, align 4
5849 // CHECK11-NEXT: [[DOTOMP_COMB_UB:%.*]] = alloca i32, align 4
5850 // CHECK11-NEXT: [[DOTOMP_STRIDE:%.*]] = alloca i32, align 4
5851 // CHECK11-NEXT: [[DOTOMP_IS_LAST:%.*]] = alloca i32, align 4
5852 // CHECK11-NEXT: [[I:%.*]] = alloca i32, align 4
5853 // CHECK11-NEXT: store ptr [[DOTGLOBAL_TID_]], ptr [[DOTGLOBAL_TID__ADDR]], align 8
5854 // CHECK11-NEXT: store ptr [[DOTBOUND_TID_]], ptr [[DOTBOUND_TID__ADDR]], align 8
5855 // CHECK11-NEXT: store i32 0, ptr [[DOTOMP_COMB_LB]], align 4
5856 // CHECK11-NEXT: store i32 99, ptr [[DOTOMP_COMB_UB]], align 4
5857 // CHECK11-NEXT: store i32 1, ptr [[DOTOMP_STRIDE]], align 4
5858 // CHECK11-NEXT: store i32 0, ptr [[DOTOMP_IS_LAST]], align 4
5859 // CHECK11-NEXT: [[TMP0:%.*]] = load ptr, ptr [[DOTGLOBAL_TID__ADDR]], align 8
5860 // CHECK11-NEXT: [[TMP1:%.*]] = load i32, ptr [[TMP0]], align 4
5861 // CHECK11-NEXT: call void @__kmpc_for_static_init_4(ptr @[[GLOB1:[0-9]+]], i32 [[TMP1]], i32 92, ptr [[DOTOMP_IS_LAST]], ptr [[DOTOMP_COMB_LB]], ptr [[DOTOMP_COMB_UB]], ptr [[DOTOMP_STRIDE]], i32 1, i32 1)
5862 // CHECK11-NEXT: [[TMP2:%.*]] = load i32, ptr [[DOTOMP_COMB_UB]], align 4
5863 // CHECK11-NEXT: [[CMP:%.*]] = icmp sgt i32 [[TMP2]], 99
5864 // CHECK11-NEXT: br i1 [[CMP]], label [[COND_TRUE:%.*]], label [[COND_FALSE:%.*]]
5865 // CHECK11: cond.true:
5866 // CHECK11-NEXT: br label [[COND_END:%.*]]
5867 // CHECK11: cond.false:
5868 // CHECK11-NEXT: [[TMP3:%.*]] = load i32, ptr [[DOTOMP_COMB_UB]], align 4
5869 // CHECK11-NEXT: br label [[COND_END]]
5870 // CHECK11: cond.end:
5871 // CHECK11-NEXT: [[COND:%.*]] = phi i32 [ 99, [[COND_TRUE]] ], [ [[TMP3]], [[COND_FALSE]] ]
5872 // CHECK11-NEXT: store i32 [[COND]], ptr [[DOTOMP_COMB_UB]], align 4
5873 // CHECK11-NEXT: [[TMP4:%.*]] = load i32, ptr [[DOTOMP_COMB_LB]], align 4
5874 // CHECK11-NEXT: store i32 [[TMP4]], ptr [[DOTOMP_IV]], align 4
5875 // CHECK11-NEXT: br label [[OMP_INNER_FOR_COND:%.*]]
5876 // CHECK11: omp.inner.for.cond:
5877 // CHECK11-NEXT: [[TMP5:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP11:![0-9]+]]
5878 // CHECK11-NEXT: [[TMP6:%.*]] = load i32, ptr [[DOTOMP_COMB_UB]], align 4, !llvm.access.group [[ACC_GRP11]]
5879 // CHECK11-NEXT: [[CMP1:%.*]] = icmp sle i32 [[TMP5]], [[TMP6]]
5880 // CHECK11-NEXT: br i1 [[CMP1]], label [[OMP_INNER_FOR_BODY:%.*]], label [[OMP_INNER_FOR_END:%.*]]
5881 // CHECK11: omp.inner.for.body:
5882 // CHECK11-NEXT: [[TMP7:%.*]] = load i32, ptr [[DOTOMP_COMB_LB]], align 4, !llvm.access.group [[ACC_GRP11]]
5883 // CHECK11-NEXT: [[TMP8:%.*]] = zext i32 [[TMP7]] to i64
5884 // CHECK11-NEXT: [[TMP9:%.*]] = load i32, ptr [[DOTOMP_COMB_UB]], align 4, !llvm.access.group [[ACC_GRP11]]
5885 // CHECK11-NEXT: [[TMP10:%.*]] = zext i32 [[TMP9]] to i64
5886 // CHECK11-NEXT: call void (ptr, i32, ptr, ...) @__kmpc_fork_call(ptr @[[GLOB3]], i32 2, ptr @{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z9gtid_testv_l43.omp_outlined.omp_outlined, i64 [[TMP8]], i64 [[TMP10]]), !llvm.access.group [[ACC_GRP11]]
5887 // CHECK11-NEXT: br label [[OMP_INNER_FOR_INC:%.*]]
5888 // CHECK11: omp.inner.for.inc:
5889 // CHECK11-NEXT: [[TMP11:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP11]]
5890 // CHECK11-NEXT: [[TMP12:%.*]] = load i32, ptr [[DOTOMP_STRIDE]], align 4, !llvm.access.group [[ACC_GRP11]]
5891 // CHECK11-NEXT: [[ADD:%.*]] = add nsw i32 [[TMP11]], [[TMP12]]
5892 // CHECK11-NEXT: store i32 [[ADD]], ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP11]]
5893 // CHECK11-NEXT: br label [[OMP_INNER_FOR_COND]], !llvm.loop [[LOOP12:![0-9]+]]
5894 // CHECK11: omp.inner.for.end:
5895 // CHECK11-NEXT: br label [[OMP_LOOP_EXIT:%.*]]
5896 // CHECK11: omp.loop.exit:
5897 // CHECK11-NEXT: call void @__kmpc_for_static_fini(ptr @[[GLOB1]], i32 [[TMP1]])
5898 // CHECK11-NEXT: [[TMP13:%.*]] = load i32, ptr [[DOTOMP_IS_LAST]], align 4
5899 // CHECK11-NEXT: [[TMP14:%.*]] = icmp ne i32 [[TMP13]], 0
5900 // CHECK11-NEXT: br i1 [[TMP14]], label [[DOTOMP_FINAL_THEN:%.*]], label [[DOTOMP_FINAL_DONE:%.*]]
5901 // CHECK11: .omp.final.then:
5902 // CHECK11-NEXT: store i32 100, ptr [[I]], align 4
5903 // CHECK11-NEXT: br label [[DOTOMP_FINAL_DONE]]
5904 // CHECK11: .omp.final.done:
5905 // CHECK11-NEXT: ret void
5908 // CHECK11-LABEL: define {{[^@]+}}@{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z9gtid_testv_l43.omp_outlined.omp_outlined
5909 // CHECK11-SAME: (ptr noalias noundef [[DOTGLOBAL_TID_:%.*]], ptr noalias noundef [[DOTBOUND_TID_:%.*]], i64 noundef [[DOTPREVIOUS_LB_:%.*]], i64 noundef [[DOTPREVIOUS_UB_:%.*]]) #[[ATTR1]] {
5910 // CHECK11-NEXT: entry:
5911 // CHECK11-NEXT: [[DOTGLOBAL_TID__ADDR:%.*]] = alloca ptr, align 8
5912 // CHECK11-NEXT: [[DOTBOUND_TID__ADDR:%.*]] = alloca ptr, align 8
5913 // CHECK11-NEXT: [[DOTPREVIOUS_LB__ADDR:%.*]] = alloca i64, align 8
5914 // CHECK11-NEXT: [[DOTPREVIOUS_UB__ADDR:%.*]] = alloca i64, align 8
5915 // CHECK11-NEXT: [[DOTOMP_IV:%.*]] = alloca i32, align 4
5916 // CHECK11-NEXT: [[TMP:%.*]] = alloca i32, align 4
5917 // CHECK11-NEXT: [[DOTOMP_LB:%.*]] = alloca i32, align 4
5918 // CHECK11-NEXT: [[DOTOMP_UB:%.*]] = alloca i32, align 4
5919 // CHECK11-NEXT: [[DOTOMP_STRIDE:%.*]] = alloca i32, align 4
5920 // CHECK11-NEXT: [[DOTOMP_IS_LAST:%.*]] = alloca i32, align 4
5921 // CHECK11-NEXT: [[I:%.*]] = alloca i32, align 4
5922 // CHECK11-NEXT: store ptr [[DOTGLOBAL_TID_]], ptr [[DOTGLOBAL_TID__ADDR]], align 8
5923 // CHECK11-NEXT: store ptr [[DOTBOUND_TID_]], ptr [[DOTBOUND_TID__ADDR]], align 8
5924 // CHECK11-NEXT: store i64 [[DOTPREVIOUS_LB_]], ptr [[DOTPREVIOUS_LB__ADDR]], align 8
5925 // CHECK11-NEXT: store i64 [[DOTPREVIOUS_UB_]], ptr [[DOTPREVIOUS_UB__ADDR]], align 8
5926 // CHECK11-NEXT: store i32 0, ptr [[DOTOMP_LB]], align 4
5927 // CHECK11-NEXT: store i32 99, ptr [[DOTOMP_UB]], align 4
5928 // CHECK11-NEXT: [[TMP0:%.*]] = load i64, ptr [[DOTPREVIOUS_LB__ADDR]], align 8
5929 // CHECK11-NEXT: [[CONV:%.*]] = trunc i64 [[TMP0]] to i32
5930 // CHECK11-NEXT: [[TMP1:%.*]] = load i64, ptr [[DOTPREVIOUS_UB__ADDR]], align 8
5931 // CHECK11-NEXT: [[CONV1:%.*]] = trunc i64 [[TMP1]] to i32
5932 // CHECK11-NEXT: store i32 [[CONV]], ptr [[DOTOMP_LB]], align 4
5933 // CHECK11-NEXT: store i32 [[CONV1]], ptr [[DOTOMP_UB]], align 4
5934 // CHECK11-NEXT: store i32 1, ptr [[DOTOMP_STRIDE]], align 4
5935 // CHECK11-NEXT: store i32 0, ptr [[DOTOMP_IS_LAST]], align 4
5936 // CHECK11-NEXT: [[TMP2:%.*]] = load ptr, ptr [[DOTGLOBAL_TID__ADDR]], align 8
5937 // CHECK11-NEXT: [[TMP3:%.*]] = load i32, ptr [[TMP2]], align 4
5938 // CHECK11-NEXT: call void @__kmpc_for_static_init_4(ptr @[[GLOB2:[0-9]+]], i32 [[TMP3]], i32 34, ptr [[DOTOMP_IS_LAST]], ptr [[DOTOMP_LB]], ptr [[DOTOMP_UB]], ptr [[DOTOMP_STRIDE]], i32 1, i32 1)
5939 // CHECK11-NEXT: [[TMP4:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4
5940 // CHECK11-NEXT: [[CMP:%.*]] = icmp sgt i32 [[TMP4]], 99
5941 // CHECK11-NEXT: br i1 [[CMP]], label [[COND_TRUE:%.*]], label [[COND_FALSE:%.*]]
5942 // CHECK11: cond.true:
5943 // CHECK11-NEXT: br label [[COND_END:%.*]]
5944 // CHECK11: cond.false:
5945 // CHECK11-NEXT: [[TMP5:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4
5946 // CHECK11-NEXT: br label [[COND_END]]
5947 // CHECK11: cond.end:
5948 // CHECK11-NEXT: [[COND:%.*]] = phi i32 [ 99, [[COND_TRUE]] ], [ [[TMP5]], [[COND_FALSE]] ]
5949 // CHECK11-NEXT: store i32 [[COND]], ptr [[DOTOMP_UB]], align 4
5950 // CHECK11-NEXT: [[TMP6:%.*]] = load i32, ptr [[DOTOMP_LB]], align 4
5951 // CHECK11-NEXT: store i32 [[TMP6]], ptr [[DOTOMP_IV]], align 4
5952 // CHECK11-NEXT: br label [[OMP_INNER_FOR_COND:%.*]]
5953 // CHECK11: omp.inner.for.cond:
5954 // CHECK11-NEXT: [[TMP7:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP15:![0-9]+]]
5955 // CHECK11-NEXT: [[TMP8:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4, !llvm.access.group [[ACC_GRP15]]
5956 // CHECK11-NEXT: [[CMP2:%.*]] = icmp sle i32 [[TMP7]], [[TMP8]]
5957 // CHECK11-NEXT: br i1 [[CMP2]], label [[OMP_INNER_FOR_BODY:%.*]], label [[OMP_INNER_FOR_END:%.*]]
5958 // CHECK11: omp.inner.for.body:
5959 // CHECK11-NEXT: [[TMP9:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP15]]
5960 // CHECK11-NEXT: [[MUL:%.*]] = mul nsw i32 [[TMP9]], 1
5961 // CHECK11-NEXT: [[ADD:%.*]] = add nsw i32 0, [[MUL]]
5962 // CHECK11-NEXT: store i32 [[ADD]], ptr [[I]], align 4, !llvm.access.group [[ACC_GRP15]]
5963 // CHECK11-NEXT: br label [[OMP_BODY_CONTINUE:%.*]]
5964 // CHECK11: omp.body.continue:
5965 // CHECK11-NEXT: br label [[OMP_INNER_FOR_INC:%.*]]
5966 // CHECK11: omp.inner.for.inc:
5967 // CHECK11-NEXT: [[TMP10:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP15]]
5968 // CHECK11-NEXT: [[ADD3:%.*]] = add nsw i32 [[TMP10]], 1
5969 // CHECK11-NEXT: store i32 [[ADD3]], ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP15]]
5970 // CHECK11-NEXT: br label [[OMP_INNER_FOR_COND]], !llvm.loop [[LOOP16:![0-9]+]]
5971 // CHECK11: omp.inner.for.end:
5972 // CHECK11-NEXT: br label [[OMP_LOOP_EXIT:%.*]]
5973 // CHECK11: omp.loop.exit:
5974 // CHECK11-NEXT: call void @__kmpc_for_static_fini(ptr @[[GLOB1]], i32 [[TMP3]])
5975 // CHECK11-NEXT: [[TMP11:%.*]] = load i32, ptr [[DOTOMP_IS_LAST]], align 4
5976 // CHECK11-NEXT: [[TMP12:%.*]] = icmp ne i32 [[TMP11]], 0
5977 // CHECK11-NEXT: br i1 [[TMP12]], label [[DOTOMP_FINAL_THEN:%.*]], label [[DOTOMP_FINAL_DONE:%.*]]
5978 // CHECK11: .omp.final.then:
5979 // CHECK11-NEXT: store i32 100, ptr [[I]], align 4
5980 // CHECK11-NEXT: br label [[DOTOMP_FINAL_DONE]]
5981 // CHECK11: .omp.final.done:
5982 // CHECK11-NEXT: ret void
5985 // CHECK11-LABEL: define {{[^@]+}}@{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z9gtid_testv_l48
5986 // CHECK11-SAME: () #[[ATTR1]] {
5987 // CHECK11-NEXT: entry:
5988 // CHECK11-NEXT: call void (ptr, i32, ptr, ...) @__kmpc_fork_teams(ptr @[[GLOB3]], i32 0, ptr @{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z9gtid_testv_l48.omp_outlined)
5989 // CHECK11-NEXT: ret void
5992 // CHECK11-LABEL: define {{[^@]+}}@{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z9gtid_testv_l48.omp_outlined
5993 // CHECK11-SAME: (ptr noalias noundef [[DOTGLOBAL_TID_:%.*]], ptr noalias noundef [[DOTBOUND_TID_:%.*]]) #[[ATTR1]] {
5994 // CHECK11-NEXT: entry:
5995 // CHECK11-NEXT: [[DOTGLOBAL_TID__ADDR:%.*]] = alloca ptr, align 8
5996 // CHECK11-NEXT: [[DOTBOUND_TID__ADDR:%.*]] = alloca ptr, align 8
5997 // CHECK11-NEXT: [[DOTOMP_IV:%.*]] = alloca i32, align 4
5998 // CHECK11-NEXT: [[TMP:%.*]] = alloca i32, align 4
5999 // CHECK11-NEXT: [[DOTOMP_COMB_LB:%.*]] = alloca i32, align 4
6000 // CHECK11-NEXT: [[DOTOMP_COMB_UB:%.*]] = alloca i32, align 4
6001 // CHECK11-NEXT: [[DOTOMP_STRIDE:%.*]] = alloca i32, align 4
6002 // CHECK11-NEXT: [[DOTOMP_IS_LAST:%.*]] = alloca i32, align 4
6003 // CHECK11-NEXT: [[I:%.*]] = alloca i32, align 4
6004 // CHECK11-NEXT: [[DOTBOUND_ZERO_ADDR:%.*]] = alloca i32, align 4
6005 // CHECK11-NEXT: store ptr [[DOTGLOBAL_TID_]], ptr [[DOTGLOBAL_TID__ADDR]], align 8
6006 // CHECK11-NEXT: store ptr [[DOTBOUND_TID_]], ptr [[DOTBOUND_TID__ADDR]], align 8
6007 // CHECK11-NEXT: store i32 0, ptr [[DOTOMP_COMB_LB]], align 4
6008 // CHECK11-NEXT: store i32 99, ptr [[DOTOMP_COMB_UB]], align 4
6009 // CHECK11-NEXT: store i32 1, ptr [[DOTOMP_STRIDE]], align 4
6010 // CHECK11-NEXT: store i32 0, ptr [[DOTOMP_IS_LAST]], align 4
6011 // CHECK11-NEXT: [[TMP0:%.*]] = load ptr, ptr [[DOTGLOBAL_TID__ADDR]], align 8
6012 // CHECK11-NEXT: [[TMP1:%.*]] = load i32, ptr [[TMP0]], align 4
6013 // CHECK11-NEXT: call void @__kmpc_for_static_init_4(ptr @[[GLOB1]], i32 [[TMP1]], i32 92, ptr [[DOTOMP_IS_LAST]], ptr [[DOTOMP_COMB_LB]], ptr [[DOTOMP_COMB_UB]], ptr [[DOTOMP_STRIDE]], i32 1, i32 1)
6014 // CHECK11-NEXT: [[TMP2:%.*]] = load i32, ptr [[DOTOMP_COMB_UB]], align 4
6015 // CHECK11-NEXT: [[CMP:%.*]] = icmp sgt i32 [[TMP2]], 99
6016 // CHECK11-NEXT: br i1 [[CMP]], label [[COND_TRUE:%.*]], label [[COND_FALSE:%.*]]
6017 // CHECK11: cond.true:
6018 // CHECK11-NEXT: br label [[COND_END:%.*]]
6019 // CHECK11: cond.false:
6020 // CHECK11-NEXT: [[TMP3:%.*]] = load i32, ptr [[DOTOMP_COMB_UB]], align 4
6021 // CHECK11-NEXT: br label [[COND_END]]
6022 // CHECK11: cond.end:
6023 // CHECK11-NEXT: [[COND:%.*]] = phi i32 [ 99, [[COND_TRUE]] ], [ [[TMP3]], [[COND_FALSE]] ]
6024 // CHECK11-NEXT: store i32 [[COND]], ptr [[DOTOMP_COMB_UB]], align 4
6025 // CHECK11-NEXT: [[TMP4:%.*]] = load i32, ptr [[DOTOMP_COMB_LB]], align 4
6026 // CHECK11-NEXT: store i32 [[TMP4]], ptr [[DOTOMP_IV]], align 4
6027 // CHECK11-NEXT: br label [[OMP_INNER_FOR_COND:%.*]]
6028 // CHECK11: omp.inner.for.cond:
6029 // CHECK11-NEXT: [[TMP5:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP20:![0-9]+]]
6030 // CHECK11-NEXT: [[TMP6:%.*]] = load i32, ptr [[DOTOMP_COMB_UB]], align 4, !llvm.access.group [[ACC_GRP20]]
6031 // CHECK11-NEXT: [[CMP1:%.*]] = icmp sle i32 [[TMP5]], [[TMP6]]
6032 // CHECK11-NEXT: br i1 [[CMP1]], label [[OMP_INNER_FOR_BODY:%.*]], label [[OMP_INNER_FOR_END:%.*]]
6033 // CHECK11: omp.inner.for.body:
6034 // CHECK11-NEXT: [[TMP7:%.*]] = load i32, ptr [[DOTOMP_COMB_LB]], align 4, !llvm.access.group [[ACC_GRP20]]
6035 // CHECK11-NEXT: [[TMP8:%.*]] = zext i32 [[TMP7]] to i64
6036 // CHECK11-NEXT: [[TMP9:%.*]] = load i32, ptr [[DOTOMP_COMB_UB]], align 4, !llvm.access.group [[ACC_GRP20]]
6037 // CHECK11-NEXT: [[TMP10:%.*]] = zext i32 [[TMP9]] to i64
6038 // CHECK11-NEXT: call void @__kmpc_serialized_parallel(ptr @[[GLOB3]], i32 [[TMP1]]), !llvm.access.group [[ACC_GRP20]]
6039 // CHECK11-NEXT: [[TMP11:%.*]] = load ptr, ptr [[DOTGLOBAL_TID__ADDR]], align 8, !llvm.access.group [[ACC_GRP20]]
6040 // CHECK11-NEXT: store i32 0, ptr [[DOTBOUND_ZERO_ADDR]], align 4, !llvm.access.group [[ACC_GRP20]]
6041 // CHECK11-NEXT: call void @{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z9gtid_testv_l48.omp_outlined.omp_outlined(ptr [[TMP11]], ptr [[DOTBOUND_ZERO_ADDR]], i64 [[TMP8]], i64 [[TMP10]]) #[[ATTR2]], !llvm.access.group [[ACC_GRP20]]
6042 // CHECK11-NEXT: call void @__kmpc_end_serialized_parallel(ptr @[[GLOB3]], i32 [[TMP1]]), !llvm.access.group [[ACC_GRP20]]
6043 // CHECK11-NEXT: br label [[OMP_INNER_FOR_INC:%.*]]
6044 // CHECK11: omp.inner.for.inc:
6045 // CHECK11-NEXT: [[TMP12:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP20]]
6046 // CHECK11-NEXT: [[TMP13:%.*]] = load i32, ptr [[DOTOMP_STRIDE]], align 4, !llvm.access.group [[ACC_GRP20]]
6047 // CHECK11-NEXT: [[ADD:%.*]] = add nsw i32 [[TMP12]], [[TMP13]]
6048 // CHECK11-NEXT: store i32 [[ADD]], ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP20]]
6049 // CHECK11-NEXT: br label [[OMP_INNER_FOR_COND]], !llvm.loop [[LOOP21:![0-9]+]]
6050 // CHECK11: omp.inner.for.end:
6051 // CHECK11-NEXT: br label [[OMP_LOOP_EXIT:%.*]]
6052 // CHECK11: omp.loop.exit:
6053 // CHECK11-NEXT: call void @__kmpc_for_static_fini(ptr @[[GLOB1]], i32 [[TMP1]])
6054 // CHECK11-NEXT: [[TMP14:%.*]] = load i32, ptr [[DOTOMP_IS_LAST]], align 4
6055 // CHECK11-NEXT: [[TMP15:%.*]] = icmp ne i32 [[TMP14]], 0
6056 // CHECK11-NEXT: br i1 [[TMP15]], label [[DOTOMP_FINAL_THEN:%.*]], label [[DOTOMP_FINAL_DONE:%.*]]
6057 // CHECK11: .omp.final.then:
6058 // CHECK11-NEXT: store i32 100, ptr [[I]], align 4
6059 // CHECK11-NEXT: br label [[DOTOMP_FINAL_DONE]]
6060 // CHECK11: .omp.final.done:
6061 // CHECK11-NEXT: ret void
6064 // CHECK11-LABEL: define {{[^@]+}}@{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z9gtid_testv_l48.omp_outlined.omp_outlined
6065 // CHECK11-SAME: (ptr noalias noundef [[DOTGLOBAL_TID_:%.*]], ptr noalias noundef [[DOTBOUND_TID_:%.*]], i64 noundef [[DOTPREVIOUS_LB_:%.*]], i64 noundef [[DOTPREVIOUS_UB_:%.*]]) #[[ATTR1]] {
6066 // CHECK11-NEXT: entry:
6067 // CHECK11-NEXT: [[DOTGLOBAL_TID__ADDR:%.*]] = alloca ptr, align 8
6068 // CHECK11-NEXT: [[DOTBOUND_TID__ADDR:%.*]] = alloca ptr, align 8
6069 // CHECK11-NEXT: [[DOTPREVIOUS_LB__ADDR:%.*]] = alloca i64, align 8
6070 // CHECK11-NEXT: [[DOTPREVIOUS_UB__ADDR:%.*]] = alloca i64, align 8
6071 // CHECK11-NEXT: [[DOTOMP_IV:%.*]] = alloca i32, align 4
6072 // CHECK11-NEXT: [[TMP:%.*]] = alloca i32, align 4
6073 // CHECK11-NEXT: [[DOTOMP_LB:%.*]] = alloca i32, align 4
6074 // CHECK11-NEXT: [[DOTOMP_UB:%.*]] = alloca i32, align 4
6075 // CHECK11-NEXT: [[DOTOMP_STRIDE:%.*]] = alloca i32, align 4
6076 // CHECK11-NEXT: [[DOTOMP_IS_LAST:%.*]] = alloca i32, align 4
6077 // CHECK11-NEXT: [[I:%.*]] = alloca i32, align 4
6078 // CHECK11-NEXT: store ptr [[DOTGLOBAL_TID_]], ptr [[DOTGLOBAL_TID__ADDR]], align 8
6079 // CHECK11-NEXT: store ptr [[DOTBOUND_TID_]], ptr [[DOTBOUND_TID__ADDR]], align 8
6080 // CHECK11-NEXT: store i64 [[DOTPREVIOUS_LB_]], ptr [[DOTPREVIOUS_LB__ADDR]], align 8
6081 // CHECK11-NEXT: store i64 [[DOTPREVIOUS_UB_]], ptr [[DOTPREVIOUS_UB__ADDR]], align 8
6082 // CHECK11-NEXT: store i32 0, ptr [[DOTOMP_LB]], align 4
6083 // CHECK11-NEXT: store i32 99, ptr [[DOTOMP_UB]], align 4
6084 // CHECK11-NEXT: [[TMP0:%.*]] = load i64, ptr [[DOTPREVIOUS_LB__ADDR]], align 8
6085 // CHECK11-NEXT: [[CONV:%.*]] = trunc i64 [[TMP0]] to i32
6086 // CHECK11-NEXT: [[TMP1:%.*]] = load i64, ptr [[DOTPREVIOUS_UB__ADDR]], align 8
6087 // CHECK11-NEXT: [[CONV1:%.*]] = trunc i64 [[TMP1]] to i32
6088 // CHECK11-NEXT: store i32 [[CONV]], ptr [[DOTOMP_LB]], align 4
6089 // CHECK11-NEXT: store i32 [[CONV1]], ptr [[DOTOMP_UB]], align 4
6090 // CHECK11-NEXT: store i32 1, ptr [[DOTOMP_STRIDE]], align 4
6091 // CHECK11-NEXT: store i32 0, ptr [[DOTOMP_IS_LAST]], align 4
6092 // CHECK11-NEXT: [[TMP2:%.*]] = load ptr, ptr [[DOTGLOBAL_TID__ADDR]], align 8
6093 // CHECK11-NEXT: [[TMP3:%.*]] = load i32, ptr [[TMP2]], align 4
6094 // CHECK11-NEXT: call void @__kmpc_for_static_init_4(ptr @[[GLOB2]], i32 [[TMP3]], i32 34, ptr [[DOTOMP_IS_LAST]], ptr [[DOTOMP_LB]], ptr [[DOTOMP_UB]], ptr [[DOTOMP_STRIDE]], i32 1, i32 1)
6095 // CHECK11-NEXT: [[TMP4:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4
6096 // CHECK11-NEXT: [[CMP:%.*]] = icmp sgt i32 [[TMP4]], 99
6097 // CHECK11-NEXT: br i1 [[CMP]], label [[COND_TRUE:%.*]], label [[COND_FALSE:%.*]]
6098 // CHECK11: cond.true:
6099 // CHECK11-NEXT: br label [[COND_END:%.*]]
6100 // CHECK11: cond.false:
6101 // CHECK11-NEXT: [[TMP5:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4
6102 // CHECK11-NEXT: br label [[COND_END]]
6103 // CHECK11: cond.end:
6104 // CHECK11-NEXT: [[COND:%.*]] = phi i32 [ 99, [[COND_TRUE]] ], [ [[TMP5]], [[COND_FALSE]] ]
6105 // CHECK11-NEXT: store i32 [[COND]], ptr [[DOTOMP_UB]], align 4
6106 // CHECK11-NEXT: [[TMP6:%.*]] = load i32, ptr [[DOTOMP_LB]], align 4
6107 // CHECK11-NEXT: store i32 [[TMP6]], ptr [[DOTOMP_IV]], align 4
6108 // CHECK11-NEXT: br label [[OMP_INNER_FOR_COND:%.*]]
6109 // CHECK11: omp.inner.for.cond:
6110 // CHECK11-NEXT: [[TMP7:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP23:![0-9]+]]
6111 // CHECK11-NEXT: [[TMP8:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4, !llvm.access.group [[ACC_GRP23]]
6112 // CHECK11-NEXT: [[CMP2:%.*]] = icmp sle i32 [[TMP7]], [[TMP8]]
6113 // CHECK11-NEXT: br i1 [[CMP2]], label [[OMP_INNER_FOR_BODY:%.*]], label [[OMP_INNER_FOR_END:%.*]]
6114 // CHECK11: omp.inner.for.body:
6115 // CHECK11-NEXT: [[TMP9:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP23]]
6116 // CHECK11-NEXT: [[MUL:%.*]] = mul nsw i32 [[TMP9]], 1
6117 // CHECK11-NEXT: [[ADD:%.*]] = add nsw i32 0, [[MUL]]
6118 // CHECK11-NEXT: store i32 [[ADD]], ptr [[I]], align 4, !llvm.access.group [[ACC_GRP23]]
6119 // CHECK11-NEXT: call void @_Z9gtid_testv(), !llvm.access.group [[ACC_GRP23]]
6120 // CHECK11-NEXT: br label [[OMP_BODY_CONTINUE:%.*]]
6121 // CHECK11: omp.body.continue:
6122 // CHECK11-NEXT: br label [[OMP_INNER_FOR_INC:%.*]]
6123 // CHECK11: omp.inner.for.inc:
6124 // CHECK11-NEXT: [[TMP10:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP23]]
6125 // CHECK11-NEXT: [[ADD3:%.*]] = add nsw i32 [[TMP10]], 1
6126 // CHECK11-NEXT: store i32 [[ADD3]], ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP23]]
6127 // CHECK11-NEXT: br label [[OMP_INNER_FOR_COND]], !llvm.loop [[LOOP24:![0-9]+]]
6128 // CHECK11: omp.inner.for.end:
6129 // CHECK11-NEXT: br label [[OMP_LOOP_EXIT:%.*]]
6130 // CHECK11: omp.loop.exit:
6131 // CHECK11-NEXT: call void @__kmpc_for_static_fini(ptr @[[GLOB1]], i32 [[TMP3]])
6132 // CHECK11-NEXT: [[TMP11:%.*]] = load i32, ptr [[DOTOMP_IS_LAST]], align 4
6133 // CHECK11-NEXT: [[TMP12:%.*]] = icmp ne i32 [[TMP11]], 0
6134 // CHECK11-NEXT: br i1 [[TMP12]], label [[DOTOMP_FINAL_THEN:%.*]], label [[DOTOMP_FINAL_DONE:%.*]]
6135 // CHECK11: .omp.final.then:
6136 // CHECK11-NEXT: store i32 100, ptr [[I]], align 4
6137 // CHECK11-NEXT: br label [[DOTOMP_FINAL_DONE]]
6138 // CHECK11: .omp.final.done:
6139 // CHECK11-NEXT: ret void
6142 // CHECK11-LABEL: define {{[^@]+}}@main
6143 // CHECK11-SAME: () #[[ATTR3:[0-9]+]] {
6144 // CHECK11-NEXT: entry:
6145 // CHECK11-NEXT: [[RETVAL:%.*]] = alloca i32, align 4
6146 // CHECK11-NEXT: [[TMP:%.*]] = alloca i32, align 4
6147 // CHECK11-NEXT: [[KERNEL_ARGS:%.*]] = alloca [[STRUCT___TGT_KERNEL_ARGUMENTS:%.*]], align 8
6148 // CHECK11-NEXT: [[_TMP1:%.*]] = alloca i32, align 4
6149 // CHECK11-NEXT: [[KERNEL_ARGS2:%.*]] = alloca [[STRUCT___TGT_KERNEL_ARGUMENTS]], align 8
6150 // CHECK11-NEXT: [[ARG_CASTED:%.*]] = alloca i64, align 8
6151 // CHECK11-NEXT: [[DOTOFFLOAD_BASEPTRS:%.*]] = alloca [1 x ptr], align 8
6152 // CHECK11-NEXT: [[DOTOFFLOAD_PTRS:%.*]] = alloca [1 x ptr], align 8
6153 // CHECK11-NEXT: [[DOTOFFLOAD_MAPPERS:%.*]] = alloca [1 x ptr], align 8
6154 // CHECK11-NEXT: [[_TMP5:%.*]] = alloca i32, align 4
6155 // CHECK11-NEXT: [[KERNEL_ARGS6:%.*]] = alloca [[STRUCT___TGT_KERNEL_ARGUMENTS]], align 8
6156 // CHECK11-NEXT: store i32 0, ptr [[RETVAL]], align 4
6157 // CHECK11-NEXT: [[TMP0:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 0
6158 // CHECK11-NEXT: store i32 2, ptr [[TMP0]], align 4
6159 // CHECK11-NEXT: [[TMP1:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 1
6160 // CHECK11-NEXT: store i32 0, ptr [[TMP1]], align 4
6161 // CHECK11-NEXT: [[TMP2:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 2
6162 // CHECK11-NEXT: store ptr null, ptr [[TMP2]], align 8
6163 // CHECK11-NEXT: [[TMP3:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 3
6164 // CHECK11-NEXT: store ptr null, ptr [[TMP3]], align 8
6165 // CHECK11-NEXT: [[TMP4:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 4
6166 // CHECK11-NEXT: store ptr null, ptr [[TMP4]], align 8
6167 // CHECK11-NEXT: [[TMP5:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 5
6168 // CHECK11-NEXT: store ptr null, ptr [[TMP5]], align 8
6169 // CHECK11-NEXT: [[TMP6:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 6
6170 // CHECK11-NEXT: store ptr null, ptr [[TMP6]], align 8
6171 // CHECK11-NEXT: [[TMP7:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 7
6172 // CHECK11-NEXT: store ptr null, ptr [[TMP7]], align 8
6173 // CHECK11-NEXT: [[TMP8:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 8
6174 // CHECK11-NEXT: store i64 100, ptr [[TMP8]], align 8
6175 // CHECK11-NEXT: [[TMP9:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 9
6176 // CHECK11-NEXT: store i64 0, ptr [[TMP9]], align 8
6177 // CHECK11-NEXT: [[TMP10:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 10
6178 // CHECK11-NEXT: store [3 x i32] zeroinitializer, ptr [[TMP10]], align 4
6179 // CHECK11-NEXT: [[TMP11:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 11
6180 // CHECK11-NEXT: store [3 x i32] zeroinitializer, ptr [[TMP11]], align 4
6181 // CHECK11-NEXT: [[TMP12:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 12
6182 // CHECK11-NEXT: store i32 0, ptr [[TMP12]], align 4
6183 // CHECK11-NEXT: [[TMP13:%.*]] = call i32 @__tgt_target_kernel(ptr @[[GLOB3]], i64 -1, i32 0, i32 0, ptr @.{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}_main_l81.region_id, ptr [[KERNEL_ARGS]])
6184 // CHECK11-NEXT: [[TMP14:%.*]] = icmp ne i32 [[TMP13]], 0
6185 // CHECK11-NEXT: br i1 [[TMP14]], label [[OMP_OFFLOAD_FAILED:%.*]], label [[OMP_OFFLOAD_CONT:%.*]]
6186 // CHECK11: omp_offload.failed:
6187 // CHECK11-NEXT: call void @{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}_main_l81() #[[ATTR2]]
6188 // CHECK11-NEXT: br label [[OMP_OFFLOAD_CONT]]
6189 // CHECK11: omp_offload.cont:
6190 // CHECK11-NEXT: [[TMP15:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS2]], i32 0, i32 0
6191 // CHECK11-NEXT: store i32 2, ptr [[TMP15]], align 4
6192 // CHECK11-NEXT: [[TMP16:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS2]], i32 0, i32 1
6193 // CHECK11-NEXT: store i32 0, ptr [[TMP16]], align 4
6194 // CHECK11-NEXT: [[TMP17:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS2]], i32 0, i32 2
6195 // CHECK11-NEXT: store ptr null, ptr [[TMP17]], align 8
6196 // CHECK11-NEXT: [[TMP18:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS2]], i32 0, i32 3
6197 // CHECK11-NEXT: store ptr null, ptr [[TMP18]], align 8
6198 // CHECK11-NEXT: [[TMP19:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS2]], i32 0, i32 4
6199 // CHECK11-NEXT: store ptr null, ptr [[TMP19]], align 8
6200 // CHECK11-NEXT: [[TMP20:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS2]], i32 0, i32 5
6201 // CHECK11-NEXT: store ptr null, ptr [[TMP20]], align 8
6202 // CHECK11-NEXT: [[TMP21:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS2]], i32 0, i32 6
6203 // CHECK11-NEXT: store ptr null, ptr [[TMP21]], align 8
6204 // CHECK11-NEXT: [[TMP22:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS2]], i32 0, i32 7
6205 // CHECK11-NEXT: store ptr null, ptr [[TMP22]], align 8
6206 // CHECK11-NEXT: [[TMP23:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS2]], i32 0, i32 8
6207 // CHECK11-NEXT: store i64 100, ptr [[TMP23]], align 8
6208 // CHECK11-NEXT: [[TMP24:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS2]], i32 0, i32 9
6209 // CHECK11-NEXT: store i64 0, ptr [[TMP24]], align 8
6210 // CHECK11-NEXT: [[TMP25:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS2]], i32 0, i32 10
6211 // CHECK11-NEXT: store [3 x i32] zeroinitializer, ptr [[TMP25]], align 4
6212 // CHECK11-NEXT: [[TMP26:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS2]], i32 0, i32 11
6213 // CHECK11-NEXT: store [3 x i32] zeroinitializer, ptr [[TMP26]], align 4
6214 // CHECK11-NEXT: [[TMP27:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS2]], i32 0, i32 12
6215 // CHECK11-NEXT: store i32 0, ptr [[TMP27]], align 4
6216 // CHECK11-NEXT: [[TMP28:%.*]] = call i32 @__tgt_target_kernel(ptr @[[GLOB3]], i64 -1, i32 0, i32 0, ptr @.{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}_main_l90.region_id, ptr [[KERNEL_ARGS2]])
6217 // CHECK11-NEXT: [[TMP29:%.*]] = icmp ne i32 [[TMP28]], 0
6218 // CHECK11-NEXT: br i1 [[TMP29]], label [[OMP_OFFLOAD_FAILED3:%.*]], label [[OMP_OFFLOAD_CONT4:%.*]]
6219 // CHECK11: omp_offload.failed3:
6220 // CHECK11-NEXT: call void @{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}_main_l90() #[[ATTR2]]
6221 // CHECK11-NEXT: br label [[OMP_OFFLOAD_CONT4]]
6222 // CHECK11: omp_offload.cont4:
6223 // CHECK11-NEXT: [[TMP30:%.*]] = load i32, ptr @Arg, align 4
6224 // CHECK11-NEXT: store i32 [[TMP30]], ptr [[ARG_CASTED]], align 4
6225 // CHECK11-NEXT: [[TMP31:%.*]] = load i64, ptr [[ARG_CASTED]], align 8
6226 // CHECK11-NEXT: [[TMP32:%.*]] = getelementptr inbounds [1 x ptr], ptr [[DOTOFFLOAD_BASEPTRS]], i32 0, i32 0
6227 // CHECK11-NEXT: store i64 [[TMP31]], ptr [[TMP32]], align 8
6228 // CHECK11-NEXT: [[TMP33:%.*]] = getelementptr inbounds [1 x ptr], ptr [[DOTOFFLOAD_PTRS]], i32 0, i32 0
6229 // CHECK11-NEXT: store i64 [[TMP31]], ptr [[TMP33]], align 8
6230 // CHECK11-NEXT: [[TMP34:%.*]] = getelementptr inbounds [1 x ptr], ptr [[DOTOFFLOAD_MAPPERS]], i64 0, i64 0
6231 // CHECK11-NEXT: store ptr null, ptr [[TMP34]], align 8
6232 // CHECK11-NEXT: [[TMP35:%.*]] = getelementptr inbounds [1 x ptr], ptr [[DOTOFFLOAD_BASEPTRS]], i32 0, i32 0
6233 // CHECK11-NEXT: [[TMP36:%.*]] = getelementptr inbounds [1 x ptr], ptr [[DOTOFFLOAD_PTRS]], i32 0, i32 0
6234 // CHECK11-NEXT: [[TMP37:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS6]], i32 0, i32 0
6235 // CHECK11-NEXT: store i32 2, ptr [[TMP37]], align 4
6236 // CHECK11-NEXT: [[TMP38:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS6]], i32 0, i32 1
6237 // CHECK11-NEXT: store i32 1, ptr [[TMP38]], align 4
6238 // CHECK11-NEXT: [[TMP39:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS6]], i32 0, i32 2
6239 // CHECK11-NEXT: store ptr [[TMP35]], ptr [[TMP39]], align 8
6240 // CHECK11-NEXT: [[TMP40:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS6]], i32 0, i32 3
6241 // CHECK11-NEXT: store ptr [[TMP36]], ptr [[TMP40]], align 8
6242 // CHECK11-NEXT: [[TMP41:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS6]], i32 0, i32 4
6243 // CHECK11-NEXT: store ptr @.offload_sizes, ptr [[TMP41]], align 8
6244 // CHECK11-NEXT: [[TMP42:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS6]], i32 0, i32 5
6245 // CHECK11-NEXT: store ptr @.offload_maptypes, ptr [[TMP42]], align 8
6246 // CHECK11-NEXT: [[TMP43:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS6]], i32 0, i32 6
6247 // CHECK11-NEXT: store ptr null, ptr [[TMP43]], align 8
6248 // CHECK11-NEXT: [[TMP44:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS6]], i32 0, i32 7
6249 // CHECK11-NEXT: store ptr null, ptr [[TMP44]], align 8
6250 // CHECK11-NEXT: [[TMP45:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS6]], i32 0, i32 8
6251 // CHECK11-NEXT: store i64 100, ptr [[TMP45]], align 8
6252 // CHECK11-NEXT: [[TMP46:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS6]], i32 0, i32 9
6253 // CHECK11-NEXT: store i64 0, ptr [[TMP46]], align 8
6254 // CHECK11-NEXT: [[TMP47:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS6]], i32 0, i32 10
6255 // CHECK11-NEXT: store [3 x i32] zeroinitializer, ptr [[TMP47]], align 4
6256 // CHECK11-NEXT: [[TMP48:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS6]], i32 0, i32 11
6257 // CHECK11-NEXT: store [3 x i32] zeroinitializer, ptr [[TMP48]], align 4
6258 // CHECK11-NEXT: [[TMP49:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS6]], i32 0, i32 12
6259 // CHECK11-NEXT: store i32 0, ptr [[TMP49]], align 4
6260 // CHECK11-NEXT: [[TMP50:%.*]] = call i32 @__tgt_target_kernel(ptr @[[GLOB3]], i64 -1, i32 0, i32 0, ptr @.{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}_main_l99.region_id, ptr [[KERNEL_ARGS6]])
6261 // CHECK11-NEXT: [[TMP51:%.*]] = icmp ne i32 [[TMP50]], 0
6262 // CHECK11-NEXT: br i1 [[TMP51]], label [[OMP_OFFLOAD_FAILED7:%.*]], label [[OMP_OFFLOAD_CONT8:%.*]]
6263 // CHECK11: omp_offload.failed7:
6264 // CHECK11-NEXT: call void @{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}_main_l99(i64 [[TMP31]]) #[[ATTR2]]
6265 // CHECK11-NEXT: br label [[OMP_OFFLOAD_CONT8]]
6266 // CHECK11: omp_offload.cont8:
6267 // CHECK11-NEXT: [[TMP52:%.*]] = load i32, ptr @Arg, align 4
6268 // CHECK11-NEXT: [[CALL:%.*]] = call noundef i32 @_Z5tmainIiEiT_(i32 noundef [[TMP52]])
6269 // CHECK11-NEXT: ret i32 [[CALL]]
6272 // CHECK11-LABEL: define {{[^@]+}}@{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}_main_l81
6273 // CHECK11-SAME: () #[[ATTR1]] {
6274 // CHECK11-NEXT: entry:
6275 // CHECK11-NEXT: call void (ptr, i32, ptr, ...) @__kmpc_fork_teams(ptr @[[GLOB3]], i32 0, ptr @{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}_main_l81.omp_outlined)
6276 // CHECK11-NEXT: ret void
6279 // CHECK11-LABEL: define {{[^@]+}}@{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}_main_l81.omp_outlined
6280 // CHECK11-SAME: (ptr noalias noundef [[DOTGLOBAL_TID_:%.*]], ptr noalias noundef [[DOTBOUND_TID_:%.*]]) #[[ATTR1]] {
6281 // CHECK11-NEXT: entry:
6282 // CHECK11-NEXT: [[DOTGLOBAL_TID__ADDR:%.*]] = alloca ptr, align 8
6283 // CHECK11-NEXT: [[DOTBOUND_TID__ADDR:%.*]] = alloca ptr, align 8
6284 // CHECK11-NEXT: [[DOTOMP_IV:%.*]] = alloca i32, align 4
6285 // CHECK11-NEXT: [[TMP:%.*]] = alloca i32, align 4
6286 // CHECK11-NEXT: [[DOTOMP_COMB_LB:%.*]] = alloca i32, align 4
6287 // CHECK11-NEXT: [[DOTOMP_COMB_UB:%.*]] = alloca i32, align 4
6288 // CHECK11-NEXT: [[DOTOMP_STRIDE:%.*]] = alloca i32, align 4
6289 // CHECK11-NEXT: [[DOTOMP_IS_LAST:%.*]] = alloca i32, align 4
6290 // CHECK11-NEXT: [[I:%.*]] = alloca i32, align 4
6291 // CHECK11-NEXT: store ptr [[DOTGLOBAL_TID_]], ptr [[DOTGLOBAL_TID__ADDR]], align 8
6292 // CHECK11-NEXT: store ptr [[DOTBOUND_TID_]], ptr [[DOTBOUND_TID__ADDR]], align 8
6293 // CHECK11-NEXT: store i32 0, ptr [[DOTOMP_COMB_LB]], align 4
6294 // CHECK11-NEXT: store i32 99, ptr [[DOTOMP_COMB_UB]], align 4
6295 // CHECK11-NEXT: store i32 1, ptr [[DOTOMP_STRIDE]], align 4
6296 // CHECK11-NEXT: store i32 0, ptr [[DOTOMP_IS_LAST]], align 4
6297 // CHECK11-NEXT: [[TMP0:%.*]] = load ptr, ptr [[DOTGLOBAL_TID__ADDR]], align 8
6298 // CHECK11-NEXT: [[TMP1:%.*]] = load i32, ptr [[TMP0]], align 4
6299 // CHECK11-NEXT: call void @__kmpc_for_static_init_4(ptr @[[GLOB1]], i32 [[TMP1]], i32 92, ptr [[DOTOMP_IS_LAST]], ptr [[DOTOMP_COMB_LB]], ptr [[DOTOMP_COMB_UB]], ptr [[DOTOMP_STRIDE]], i32 1, i32 1)
6300 // CHECK11-NEXT: [[TMP2:%.*]] = load i32, ptr [[DOTOMP_COMB_UB]], align 4
6301 // CHECK11-NEXT: [[CMP:%.*]] = icmp sgt i32 [[TMP2]], 99
6302 // CHECK11-NEXT: br i1 [[CMP]], label [[COND_TRUE:%.*]], label [[COND_FALSE:%.*]]
6303 // CHECK11: cond.true:
6304 // CHECK11-NEXT: br label [[COND_END:%.*]]
6305 // CHECK11: cond.false:
6306 // CHECK11-NEXT: [[TMP3:%.*]] = load i32, ptr [[DOTOMP_COMB_UB]], align 4
6307 // CHECK11-NEXT: br label [[COND_END]]
6308 // CHECK11: cond.end:
6309 // CHECK11-NEXT: [[COND:%.*]] = phi i32 [ 99, [[COND_TRUE]] ], [ [[TMP3]], [[COND_FALSE]] ]
6310 // CHECK11-NEXT: store i32 [[COND]], ptr [[DOTOMP_COMB_UB]], align 4
6311 // CHECK11-NEXT: [[TMP4:%.*]] = load i32, ptr [[DOTOMP_COMB_LB]], align 4
6312 // CHECK11-NEXT: store i32 [[TMP4]], ptr [[DOTOMP_IV]], align 4
6313 // CHECK11-NEXT: br label [[OMP_INNER_FOR_COND:%.*]]
6314 // CHECK11: omp.inner.for.cond:
6315 // CHECK11-NEXT: [[TMP5:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP26:![0-9]+]]
6316 // CHECK11-NEXT: [[TMP6:%.*]] = load i32, ptr [[DOTOMP_COMB_UB]], align 4, !llvm.access.group [[ACC_GRP26]]
6317 // CHECK11-NEXT: [[CMP1:%.*]] = icmp sle i32 [[TMP5]], [[TMP6]]
6318 // CHECK11-NEXT: br i1 [[CMP1]], label [[OMP_INNER_FOR_BODY:%.*]], label [[OMP_INNER_FOR_END:%.*]]
6319 // CHECK11: omp.inner.for.body:
6320 // CHECK11-NEXT: [[TMP7:%.*]] = load i32, ptr [[DOTOMP_COMB_LB]], align 4, !llvm.access.group [[ACC_GRP26]]
6321 // CHECK11-NEXT: [[TMP8:%.*]] = zext i32 [[TMP7]] to i64
6322 // CHECK11-NEXT: [[TMP9:%.*]] = load i32, ptr [[DOTOMP_COMB_UB]], align 4, !llvm.access.group [[ACC_GRP26]]
6323 // CHECK11-NEXT: [[TMP10:%.*]] = zext i32 [[TMP9]] to i64
6324 // CHECK11-NEXT: call void (ptr, i32, ptr, ...) @__kmpc_fork_call(ptr @[[GLOB3]], i32 2, ptr @{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}_main_l81.omp_outlined.omp_outlined, i64 [[TMP8]], i64 [[TMP10]]), !llvm.access.group [[ACC_GRP26]]
6325 // CHECK11-NEXT: br label [[OMP_INNER_FOR_INC:%.*]]
6326 // CHECK11: omp.inner.for.inc:
6327 // CHECK11-NEXT: [[TMP11:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP26]]
6328 // CHECK11-NEXT: [[TMP12:%.*]] = load i32, ptr [[DOTOMP_STRIDE]], align 4, !llvm.access.group [[ACC_GRP26]]
6329 // CHECK11-NEXT: [[ADD:%.*]] = add nsw i32 [[TMP11]], [[TMP12]]
6330 // CHECK11-NEXT: store i32 [[ADD]], ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP26]]
6331 // CHECK11-NEXT: br label [[OMP_INNER_FOR_COND]], !llvm.loop [[LOOP27:![0-9]+]]
6332 // CHECK11: omp.inner.for.end:
6333 // CHECK11-NEXT: br label [[OMP_LOOP_EXIT:%.*]]
6334 // CHECK11: omp.loop.exit:
6335 // CHECK11-NEXT: call void @__kmpc_for_static_fini(ptr @[[GLOB1]], i32 [[TMP1]])
6336 // CHECK11-NEXT: [[TMP13:%.*]] = load i32, ptr [[DOTOMP_IS_LAST]], align 4
6337 // CHECK11-NEXT: [[TMP14:%.*]] = icmp ne i32 [[TMP13]], 0
6338 // CHECK11-NEXT: br i1 [[TMP14]], label [[DOTOMP_FINAL_THEN:%.*]], label [[DOTOMP_FINAL_DONE:%.*]]
6339 // CHECK11: .omp.final.then:
6340 // CHECK11-NEXT: store i32 100, ptr [[I]], align 4
6341 // CHECK11-NEXT: br label [[DOTOMP_FINAL_DONE]]
6342 // CHECK11: .omp.final.done:
6343 // CHECK11-NEXT: ret void
6346 // CHECK11-LABEL: define {{[^@]+}}@{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}_main_l81.omp_outlined.omp_outlined
6347 // CHECK11-SAME: (ptr noalias noundef [[DOTGLOBAL_TID_:%.*]], ptr noalias noundef [[DOTBOUND_TID_:%.*]], i64 noundef [[DOTPREVIOUS_LB_:%.*]], i64 noundef [[DOTPREVIOUS_UB_:%.*]]) #[[ATTR1]] {
6348 // CHECK11-NEXT: entry:
6349 // CHECK11-NEXT: [[DOTGLOBAL_TID__ADDR:%.*]] = alloca ptr, align 8
6350 // CHECK11-NEXT: [[DOTBOUND_TID__ADDR:%.*]] = alloca ptr, align 8
6351 // CHECK11-NEXT: [[DOTPREVIOUS_LB__ADDR:%.*]] = alloca i64, align 8
6352 // CHECK11-NEXT: [[DOTPREVIOUS_UB__ADDR:%.*]] = alloca i64, align 8
6353 // CHECK11-NEXT: [[DOTOMP_IV:%.*]] = alloca i32, align 4
6354 // CHECK11-NEXT: [[TMP:%.*]] = alloca i32, align 4
6355 // CHECK11-NEXT: [[DOTOMP_LB:%.*]] = alloca i32, align 4
6356 // CHECK11-NEXT: [[DOTOMP_UB:%.*]] = alloca i32, align 4
6357 // CHECK11-NEXT: [[DOTOMP_STRIDE:%.*]] = alloca i32, align 4
6358 // CHECK11-NEXT: [[DOTOMP_IS_LAST:%.*]] = alloca i32, align 4
6359 // CHECK11-NEXT: [[I:%.*]] = alloca i32, align 4
6360 // CHECK11-NEXT: store ptr [[DOTGLOBAL_TID_]], ptr [[DOTGLOBAL_TID__ADDR]], align 8
6361 // CHECK11-NEXT: store ptr [[DOTBOUND_TID_]], ptr [[DOTBOUND_TID__ADDR]], align 8
6362 // CHECK11-NEXT: store i64 [[DOTPREVIOUS_LB_]], ptr [[DOTPREVIOUS_LB__ADDR]], align 8
6363 // CHECK11-NEXT: store i64 [[DOTPREVIOUS_UB_]], ptr [[DOTPREVIOUS_UB__ADDR]], align 8
6364 // CHECK11-NEXT: store i32 0, ptr [[DOTOMP_LB]], align 4
6365 // CHECK11-NEXT: store i32 99, ptr [[DOTOMP_UB]], align 4
6366 // CHECK11-NEXT: [[TMP0:%.*]] = load i64, ptr [[DOTPREVIOUS_LB__ADDR]], align 8
6367 // CHECK11-NEXT: [[CONV:%.*]] = trunc i64 [[TMP0]] to i32
6368 // CHECK11-NEXT: [[TMP1:%.*]] = load i64, ptr [[DOTPREVIOUS_UB__ADDR]], align 8
6369 // CHECK11-NEXT: [[CONV1:%.*]] = trunc i64 [[TMP1]] to i32
6370 // CHECK11-NEXT: store i32 [[CONV]], ptr [[DOTOMP_LB]], align 4
6371 // CHECK11-NEXT: store i32 [[CONV1]], ptr [[DOTOMP_UB]], align 4
6372 // CHECK11-NEXT: store i32 1, ptr [[DOTOMP_STRIDE]], align 4
6373 // CHECK11-NEXT: store i32 0, ptr [[DOTOMP_IS_LAST]], align 4
6374 // CHECK11-NEXT: [[TMP2:%.*]] = load ptr, ptr [[DOTGLOBAL_TID__ADDR]], align 8
6375 // CHECK11-NEXT: [[TMP3:%.*]] = load i32, ptr [[TMP2]], align 4
6376 // CHECK11-NEXT: call void @__kmpc_for_static_init_4(ptr @[[GLOB2]], i32 [[TMP3]], i32 34, ptr [[DOTOMP_IS_LAST]], ptr [[DOTOMP_LB]], ptr [[DOTOMP_UB]], ptr [[DOTOMP_STRIDE]], i32 1, i32 1)
6377 // CHECK11-NEXT: [[TMP4:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4
6378 // CHECK11-NEXT: [[CMP:%.*]] = icmp sgt i32 [[TMP4]], 99
6379 // CHECK11-NEXT: br i1 [[CMP]], label [[COND_TRUE:%.*]], label [[COND_FALSE:%.*]]
6380 // CHECK11: cond.true:
6381 // CHECK11-NEXT: br label [[COND_END:%.*]]
6382 // CHECK11: cond.false:
6383 // CHECK11-NEXT: [[TMP5:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4
6384 // CHECK11-NEXT: br label [[COND_END]]
6385 // CHECK11: cond.end:
6386 // CHECK11-NEXT: [[COND:%.*]] = phi i32 [ 99, [[COND_TRUE]] ], [ [[TMP5]], [[COND_FALSE]] ]
6387 // CHECK11-NEXT: store i32 [[COND]], ptr [[DOTOMP_UB]], align 4
6388 // CHECK11-NEXT: [[TMP6:%.*]] = load i32, ptr [[DOTOMP_LB]], align 4
6389 // CHECK11-NEXT: store i32 [[TMP6]], ptr [[DOTOMP_IV]], align 4
6390 // CHECK11-NEXT: br label [[OMP_INNER_FOR_COND:%.*]]
6391 // CHECK11: omp.inner.for.cond:
6392 // CHECK11-NEXT: [[TMP7:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP29:![0-9]+]]
6393 // CHECK11-NEXT: [[TMP8:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4, !llvm.access.group [[ACC_GRP29]]
6394 // CHECK11-NEXT: [[CMP2:%.*]] = icmp sle i32 [[TMP7]], [[TMP8]]
6395 // CHECK11-NEXT: br i1 [[CMP2]], label [[OMP_INNER_FOR_BODY:%.*]], label [[OMP_INNER_FOR_END:%.*]]
6396 // CHECK11: omp.inner.for.body:
6397 // CHECK11-NEXT: [[TMP9:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP29]]
6398 // CHECK11-NEXT: [[MUL:%.*]] = mul nsw i32 [[TMP9]], 1
6399 // CHECK11-NEXT: [[ADD:%.*]] = add nsw i32 0, [[MUL]]
6400 // CHECK11-NEXT: store i32 [[ADD]], ptr [[I]], align 4, !llvm.access.group [[ACC_GRP29]]
6401 // CHECK11-NEXT: call void @_Z3fn4v(), !llvm.access.group [[ACC_GRP29]]
6402 // CHECK11-NEXT: br label [[OMP_BODY_CONTINUE:%.*]]
6403 // CHECK11: omp.body.continue:
6404 // CHECK11-NEXT: br label [[OMP_INNER_FOR_INC:%.*]]
6405 // CHECK11: omp.inner.for.inc:
6406 // CHECK11-NEXT: [[TMP10:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP29]]
6407 // CHECK11-NEXT: [[ADD3:%.*]] = add nsw i32 [[TMP10]], 1
6408 // CHECK11-NEXT: store i32 [[ADD3]], ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP29]]
6409 // CHECK11-NEXT: br label [[OMP_INNER_FOR_COND]], !llvm.loop [[LOOP30:![0-9]+]]
6410 // CHECK11: omp.inner.for.end:
6411 // CHECK11-NEXT: br label [[OMP_LOOP_EXIT:%.*]]
6412 // CHECK11: omp.loop.exit:
6413 // CHECK11-NEXT: call void @__kmpc_for_static_fini(ptr @[[GLOB1]], i32 [[TMP3]])
6414 // CHECK11-NEXT: [[TMP11:%.*]] = load i32, ptr [[DOTOMP_IS_LAST]], align 4
6415 // CHECK11-NEXT: [[TMP12:%.*]] = icmp ne i32 [[TMP11]], 0
6416 // CHECK11-NEXT: br i1 [[TMP12]], label [[DOTOMP_FINAL_THEN:%.*]], label [[DOTOMP_FINAL_DONE:%.*]]
6417 // CHECK11: .omp.final.then:
6418 // CHECK11-NEXT: store i32 100, ptr [[I]], align 4
6419 // CHECK11-NEXT: br label [[DOTOMP_FINAL_DONE]]
6420 // CHECK11: .omp.final.done:
6421 // CHECK11-NEXT: ret void
6424 // CHECK11-LABEL: define {{[^@]+}}@{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}_main_l90
6425 // CHECK11-SAME: () #[[ATTR1]] {
6426 // CHECK11-NEXT: entry:
6427 // CHECK11-NEXT: call void (ptr, i32, ptr, ...) @__kmpc_fork_teams(ptr @[[GLOB3]], i32 0, ptr @{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}_main_l90.omp_outlined)
6428 // CHECK11-NEXT: ret void
6431 // CHECK11-LABEL: define {{[^@]+}}@{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}_main_l90.omp_outlined
6432 // CHECK11-SAME: (ptr noalias noundef [[DOTGLOBAL_TID_:%.*]], ptr noalias noundef [[DOTBOUND_TID_:%.*]]) #[[ATTR1]] {
6433 // CHECK11-NEXT: entry:
6434 // CHECK11-NEXT: [[DOTGLOBAL_TID__ADDR:%.*]] = alloca ptr, align 8
6435 // CHECK11-NEXT: [[DOTBOUND_TID__ADDR:%.*]] = alloca ptr, align 8
6436 // CHECK11-NEXT: [[DOTOMP_IV:%.*]] = alloca i32, align 4
6437 // CHECK11-NEXT: [[TMP:%.*]] = alloca i32, align 4
6438 // CHECK11-NEXT: [[DOTOMP_COMB_LB:%.*]] = alloca i32, align 4
6439 // CHECK11-NEXT: [[DOTOMP_COMB_UB:%.*]] = alloca i32, align 4
6440 // CHECK11-NEXT: [[DOTOMP_STRIDE:%.*]] = alloca i32, align 4
6441 // CHECK11-NEXT: [[DOTOMP_IS_LAST:%.*]] = alloca i32, align 4
6442 // CHECK11-NEXT: [[I:%.*]] = alloca i32, align 4
6443 // CHECK11-NEXT: [[DOTBOUND_ZERO_ADDR:%.*]] = alloca i32, align 4
6444 // CHECK11-NEXT: store ptr [[DOTGLOBAL_TID_]], ptr [[DOTGLOBAL_TID__ADDR]], align 8
6445 // CHECK11-NEXT: store ptr [[DOTBOUND_TID_]], ptr [[DOTBOUND_TID__ADDR]], align 8
6446 // CHECK11-NEXT: store i32 0, ptr [[DOTOMP_COMB_LB]], align 4
6447 // CHECK11-NEXT: store i32 99, ptr [[DOTOMP_COMB_UB]], align 4
6448 // CHECK11-NEXT: store i32 1, ptr [[DOTOMP_STRIDE]], align 4
6449 // CHECK11-NEXT: store i32 0, ptr [[DOTOMP_IS_LAST]], align 4
6450 // CHECK11-NEXT: [[TMP0:%.*]] = load ptr, ptr [[DOTGLOBAL_TID__ADDR]], align 8
6451 // CHECK11-NEXT: [[TMP1:%.*]] = load i32, ptr [[TMP0]], align 4
6452 // CHECK11-NEXT: call void @__kmpc_for_static_init_4(ptr @[[GLOB1]], i32 [[TMP1]], i32 92, ptr [[DOTOMP_IS_LAST]], ptr [[DOTOMP_COMB_LB]], ptr [[DOTOMP_COMB_UB]], ptr [[DOTOMP_STRIDE]], i32 1, i32 1)
6453 // CHECK11-NEXT: [[TMP2:%.*]] = load i32, ptr [[DOTOMP_COMB_UB]], align 4
6454 // CHECK11-NEXT: [[CMP:%.*]] = icmp sgt i32 [[TMP2]], 99
6455 // CHECK11-NEXT: br i1 [[CMP]], label [[COND_TRUE:%.*]], label [[COND_FALSE:%.*]]
6456 // CHECK11: cond.true:
6457 // CHECK11-NEXT: br label [[COND_END:%.*]]
6458 // CHECK11: cond.false:
6459 // CHECK11-NEXT: [[TMP3:%.*]] = load i32, ptr [[DOTOMP_COMB_UB]], align 4
6460 // CHECK11-NEXT: br label [[COND_END]]
6461 // CHECK11: cond.end:
6462 // CHECK11-NEXT: [[COND:%.*]] = phi i32 [ 99, [[COND_TRUE]] ], [ [[TMP3]], [[COND_FALSE]] ]
6463 // CHECK11-NEXT: store i32 [[COND]], ptr [[DOTOMP_COMB_UB]], align 4
6464 // CHECK11-NEXT: [[TMP4:%.*]] = load i32, ptr [[DOTOMP_COMB_LB]], align 4
6465 // CHECK11-NEXT: store i32 [[TMP4]], ptr [[DOTOMP_IV]], align 4
6466 // CHECK11-NEXT: br label [[OMP_INNER_FOR_COND:%.*]]
6467 // CHECK11: omp.inner.for.cond:
6468 // CHECK11-NEXT: [[TMP5:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4
6469 // CHECK11-NEXT: [[TMP6:%.*]] = load i32, ptr [[DOTOMP_COMB_UB]], align 4
6470 // CHECK11-NEXT: [[CMP1:%.*]] = icmp sle i32 [[TMP5]], [[TMP6]]
6471 // CHECK11-NEXT: br i1 [[CMP1]], label [[OMP_INNER_FOR_BODY:%.*]], label [[OMP_INNER_FOR_END:%.*]]
6472 // CHECK11: omp.inner.for.body:
6473 // CHECK11-NEXT: [[TMP7:%.*]] = load i32, ptr [[DOTOMP_COMB_LB]], align 4
6474 // CHECK11-NEXT: [[TMP8:%.*]] = zext i32 [[TMP7]] to i64
6475 // CHECK11-NEXT: [[TMP9:%.*]] = load i32, ptr [[DOTOMP_COMB_UB]], align 4
6476 // CHECK11-NEXT: [[TMP10:%.*]] = zext i32 [[TMP9]] to i64
6477 // CHECK11-NEXT: call void @__kmpc_serialized_parallel(ptr @[[GLOB3]], i32 [[TMP1]])
6478 // CHECK11-NEXT: [[TMP11:%.*]] = load ptr, ptr [[DOTGLOBAL_TID__ADDR]], align 8
6479 // CHECK11-NEXT: store i32 0, ptr [[DOTBOUND_ZERO_ADDR]], align 4
6480 // CHECK11-NEXT: call void @{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}_main_l90.omp_outlined.omp_outlined(ptr [[TMP11]], ptr [[DOTBOUND_ZERO_ADDR]], i64 [[TMP8]], i64 [[TMP10]]) #[[ATTR2]]
6481 // CHECK11-NEXT: call void @__kmpc_end_serialized_parallel(ptr @[[GLOB3]], i32 [[TMP1]])
6482 // CHECK11-NEXT: br label [[OMP_INNER_FOR_INC:%.*]]
6483 // CHECK11: omp.inner.for.inc:
6484 // CHECK11-NEXT: [[TMP12:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4
6485 // CHECK11-NEXT: [[TMP13:%.*]] = load i32, ptr [[DOTOMP_STRIDE]], align 4
6486 // CHECK11-NEXT: [[ADD:%.*]] = add nsw i32 [[TMP12]], [[TMP13]]
6487 // CHECK11-NEXT: store i32 [[ADD]], ptr [[DOTOMP_IV]], align 4
6488 // CHECK11-NEXT: br label [[OMP_INNER_FOR_COND]], !llvm.loop [[LOOP32:![0-9]+]]
6489 // CHECK11: omp.inner.for.end:
6490 // CHECK11-NEXT: br label [[OMP_LOOP_EXIT:%.*]]
6491 // CHECK11: omp.loop.exit:
6492 // CHECK11-NEXT: call void @__kmpc_for_static_fini(ptr @[[GLOB1]], i32 [[TMP1]])
6493 // CHECK11-NEXT: [[TMP14:%.*]] = load i32, ptr [[DOTOMP_IS_LAST]], align 4
6494 // CHECK11-NEXT: [[TMP15:%.*]] = icmp ne i32 [[TMP14]], 0
6495 // CHECK11-NEXT: br i1 [[TMP15]], label [[DOTOMP_FINAL_THEN:%.*]], label [[DOTOMP_FINAL_DONE:%.*]]
6496 // CHECK11: .omp.final.then:
6497 // CHECK11-NEXT: store i32 100, ptr [[I]], align 4
6498 // CHECK11-NEXT: br label [[DOTOMP_FINAL_DONE]]
6499 // CHECK11: .omp.final.done:
6500 // CHECK11-NEXT: ret void
6503 // CHECK11-LABEL: define {{[^@]+}}@{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}_main_l90.omp_outlined.omp_outlined
6504 // CHECK11-SAME: (ptr noalias noundef [[DOTGLOBAL_TID_:%.*]], ptr noalias noundef [[DOTBOUND_TID_:%.*]], i64 noundef [[DOTPREVIOUS_LB_:%.*]], i64 noundef [[DOTPREVIOUS_UB_:%.*]]) #[[ATTR1]] {
6505 // CHECK11-NEXT: entry:
6506 // CHECK11-NEXT: [[DOTGLOBAL_TID__ADDR:%.*]] = alloca ptr, align 8
6507 // CHECK11-NEXT: [[DOTBOUND_TID__ADDR:%.*]] = alloca ptr, align 8
6508 // CHECK11-NEXT: [[DOTPREVIOUS_LB__ADDR:%.*]] = alloca i64, align 8
6509 // CHECK11-NEXT: [[DOTPREVIOUS_UB__ADDR:%.*]] = alloca i64, align 8
6510 // CHECK11-NEXT: [[DOTOMP_IV:%.*]] = alloca i32, align 4
6511 // CHECK11-NEXT: [[TMP:%.*]] = alloca i32, align 4
6512 // CHECK11-NEXT: [[DOTOMP_LB:%.*]] = alloca i32, align 4
6513 // CHECK11-NEXT: [[DOTOMP_UB:%.*]] = alloca i32, align 4
6514 // CHECK11-NEXT: [[DOTOMP_STRIDE:%.*]] = alloca i32, align 4
6515 // CHECK11-NEXT: [[DOTOMP_IS_LAST:%.*]] = alloca i32, align 4
6516 // CHECK11-NEXT: [[I:%.*]] = alloca i32, align 4
6517 // CHECK11-NEXT: store ptr [[DOTGLOBAL_TID_]], ptr [[DOTGLOBAL_TID__ADDR]], align 8
6518 // CHECK11-NEXT: store ptr [[DOTBOUND_TID_]], ptr [[DOTBOUND_TID__ADDR]], align 8
6519 // CHECK11-NEXT: store i64 [[DOTPREVIOUS_LB_]], ptr [[DOTPREVIOUS_LB__ADDR]], align 8
6520 // CHECK11-NEXT: store i64 [[DOTPREVIOUS_UB_]], ptr [[DOTPREVIOUS_UB__ADDR]], align 8
6521 // CHECK11-NEXT: store i32 0, ptr [[DOTOMP_LB]], align 4
6522 // CHECK11-NEXT: store i32 99, ptr [[DOTOMP_UB]], align 4
6523 // CHECK11-NEXT: [[TMP0:%.*]] = load i64, ptr [[DOTPREVIOUS_LB__ADDR]], align 8
6524 // CHECK11-NEXT: [[CONV:%.*]] = trunc i64 [[TMP0]] to i32
6525 // CHECK11-NEXT: [[TMP1:%.*]] = load i64, ptr [[DOTPREVIOUS_UB__ADDR]], align 8
6526 // CHECK11-NEXT: [[CONV1:%.*]] = trunc i64 [[TMP1]] to i32
6527 // CHECK11-NEXT: store i32 [[CONV]], ptr [[DOTOMP_LB]], align 4
6528 // CHECK11-NEXT: store i32 [[CONV1]], ptr [[DOTOMP_UB]], align 4
6529 // CHECK11-NEXT: store i32 1, ptr [[DOTOMP_STRIDE]], align 4
6530 // CHECK11-NEXT: store i32 0, ptr [[DOTOMP_IS_LAST]], align 4
6531 // CHECK11-NEXT: [[TMP2:%.*]] = load ptr, ptr [[DOTGLOBAL_TID__ADDR]], align 8
6532 // CHECK11-NEXT: [[TMP3:%.*]] = load i32, ptr [[TMP2]], align 4
6533 // CHECK11-NEXT: call void @__kmpc_for_static_init_4(ptr @[[GLOB2]], i32 [[TMP3]], i32 34, ptr [[DOTOMP_IS_LAST]], ptr [[DOTOMP_LB]], ptr [[DOTOMP_UB]], ptr [[DOTOMP_STRIDE]], i32 1, i32 1)
6534 // CHECK11-NEXT: [[TMP4:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4
6535 // CHECK11-NEXT: [[CMP:%.*]] = icmp sgt i32 [[TMP4]], 99
6536 // CHECK11-NEXT: br i1 [[CMP]], label [[COND_TRUE:%.*]], label [[COND_FALSE:%.*]]
6537 // CHECK11: cond.true:
6538 // CHECK11-NEXT: br label [[COND_END:%.*]]
6539 // CHECK11: cond.false:
6540 // CHECK11-NEXT: [[TMP5:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4
6541 // CHECK11-NEXT: br label [[COND_END]]
6542 // CHECK11: cond.end:
6543 // CHECK11-NEXT: [[COND:%.*]] = phi i32 [ 99, [[COND_TRUE]] ], [ [[TMP5]], [[COND_FALSE]] ]
6544 // CHECK11-NEXT: store i32 [[COND]], ptr [[DOTOMP_UB]], align 4
6545 // CHECK11-NEXT: [[TMP6:%.*]] = load i32, ptr [[DOTOMP_LB]], align 4
6546 // CHECK11-NEXT: store i32 [[TMP6]], ptr [[DOTOMP_IV]], align 4
6547 // CHECK11-NEXT: br label [[OMP_INNER_FOR_COND:%.*]]
6548 // CHECK11: omp.inner.for.cond:
6549 // CHECK11-NEXT: [[TMP7:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4
6550 // CHECK11-NEXT: [[TMP8:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4
6551 // CHECK11-NEXT: [[CMP2:%.*]] = icmp sle i32 [[TMP7]], [[TMP8]]
6552 // CHECK11-NEXT: br i1 [[CMP2]], label [[OMP_INNER_FOR_BODY:%.*]], label [[OMP_INNER_FOR_END:%.*]]
6553 // CHECK11: omp.inner.for.body:
6554 // CHECK11-NEXT: [[TMP9:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4
6555 // CHECK11-NEXT: [[MUL:%.*]] = mul nsw i32 [[TMP9]], 1
6556 // CHECK11-NEXT: [[ADD:%.*]] = add nsw i32 0, [[MUL]]
6557 // CHECK11-NEXT: store i32 [[ADD]], ptr [[I]], align 4
6558 // CHECK11-NEXT: call void @_Z3fn5v()
6559 // CHECK11-NEXT: br label [[OMP_BODY_CONTINUE:%.*]]
6560 // CHECK11: omp.body.continue:
6561 // CHECK11-NEXT: br label [[OMP_INNER_FOR_INC:%.*]]
6562 // CHECK11: omp.inner.for.inc:
6563 // CHECK11-NEXT: [[TMP10:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4
6564 // CHECK11-NEXT: [[ADD3:%.*]] = add nsw i32 [[TMP10]], 1
6565 // CHECK11-NEXT: store i32 [[ADD3]], ptr [[DOTOMP_IV]], align 4
6566 // CHECK11-NEXT: br label [[OMP_INNER_FOR_COND]], !llvm.loop [[LOOP34:![0-9]+]]
6567 // CHECK11: omp.inner.for.end:
6568 // CHECK11-NEXT: br label [[OMP_LOOP_EXIT:%.*]]
6569 // CHECK11: omp.loop.exit:
6570 // CHECK11-NEXT: call void @__kmpc_for_static_fini(ptr @[[GLOB1]], i32 [[TMP3]])
6571 // CHECK11-NEXT: [[TMP11:%.*]] = load i32, ptr [[DOTOMP_IS_LAST]], align 4
6572 // CHECK11-NEXT: [[TMP12:%.*]] = icmp ne i32 [[TMP11]], 0
6573 // CHECK11-NEXT: br i1 [[TMP12]], label [[DOTOMP_FINAL_THEN:%.*]], label [[DOTOMP_FINAL_DONE:%.*]]
6574 // CHECK11: .omp.final.then:
6575 // CHECK11-NEXT: store i32 100, ptr [[I]], align 4
6576 // CHECK11-NEXT: br label [[DOTOMP_FINAL_DONE]]
6577 // CHECK11: .omp.final.done:
6578 // CHECK11-NEXT: ret void
6581 // CHECK11-LABEL: define {{[^@]+}}@{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}_main_l99
6582 // CHECK11-SAME: (i64 noundef [[ARG:%.*]]) #[[ATTR1]] {
6583 // CHECK11-NEXT: entry:
6584 // CHECK11-NEXT: [[ARG_ADDR:%.*]] = alloca i64, align 8
6585 // CHECK11-NEXT: store i64 [[ARG]], ptr [[ARG_ADDR]], align 8
6586 // CHECK11-NEXT: call void (ptr, i32, ptr, ...) @__kmpc_fork_teams(ptr @[[GLOB3]], i32 1, ptr @{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}_main_l99.omp_outlined, ptr [[ARG_ADDR]])
6587 // CHECK11-NEXT: ret void
6590 // CHECK11-LABEL: define {{[^@]+}}@{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}_main_l99.omp_outlined
6591 // CHECK11-SAME: (ptr noalias noundef [[DOTGLOBAL_TID_:%.*]], ptr noalias noundef [[DOTBOUND_TID_:%.*]], ptr noundef nonnull align 4 dereferenceable(4) [[ARG:%.*]]) #[[ATTR1]] {
6592 // CHECK11-NEXT: entry:
6593 // CHECK11-NEXT: [[DOTGLOBAL_TID__ADDR:%.*]] = alloca ptr, align 8
6594 // CHECK11-NEXT: [[DOTBOUND_TID__ADDR:%.*]] = alloca ptr, align 8
6595 // CHECK11-NEXT: [[ARG_ADDR:%.*]] = alloca ptr, align 8
6596 // CHECK11-NEXT: [[DOTCAPTURE_EXPR_:%.*]] = alloca i8, align 1
6597 // CHECK11-NEXT: [[DOTOMP_IV:%.*]] = alloca i32, align 4
6598 // CHECK11-NEXT: [[TMP:%.*]] = alloca i32, align 4
6599 // CHECK11-NEXT: [[DOTOMP_COMB_LB:%.*]] = alloca i32, align 4
6600 // CHECK11-NEXT: [[DOTOMP_COMB_UB:%.*]] = alloca i32, align 4
6601 // CHECK11-NEXT: [[DOTOMP_STRIDE:%.*]] = alloca i32, align 4
6602 // CHECK11-NEXT: [[DOTOMP_IS_LAST:%.*]] = alloca i32, align 4
6603 // CHECK11-NEXT: [[I:%.*]] = alloca i32, align 4
6604 // CHECK11-NEXT: [[DOTCAPTURE_EXPR__CASTED:%.*]] = alloca i64, align 8
6605 // CHECK11-NEXT: [[DOTBOUND_ZERO_ADDR:%.*]] = alloca i32, align 4
6606 // CHECK11-NEXT: [[DOTCAPTURE_EXPR__CASTED12:%.*]] = alloca i64, align 8
6607 // CHECK11-NEXT: [[DOTBOUND_ZERO_ADDR17:%.*]] = alloca i32, align 4
6608 // CHECK11-NEXT: store ptr [[DOTGLOBAL_TID_]], ptr [[DOTGLOBAL_TID__ADDR]], align 8
6609 // CHECK11-NEXT: store ptr [[DOTBOUND_TID_]], ptr [[DOTBOUND_TID__ADDR]], align 8
6610 // CHECK11-NEXT: store ptr [[ARG]], ptr [[ARG_ADDR]], align 8
6611 // CHECK11-NEXT: [[TMP0:%.*]] = load ptr, ptr [[ARG_ADDR]], align 8
6612 // CHECK11-NEXT: [[TMP1:%.*]] = load i32, ptr [[TMP0]], align 4
6613 // CHECK11-NEXT: [[TOBOOL:%.*]] = icmp ne i32 [[TMP1]], 0
6614 // CHECK11-NEXT: [[FROMBOOL:%.*]] = zext i1 [[TOBOOL]] to i8
6615 // CHECK11-NEXT: store i8 [[FROMBOOL]], ptr [[DOTCAPTURE_EXPR_]], align 1
6616 // CHECK11-NEXT: store i32 0, ptr [[DOTOMP_COMB_LB]], align 4
6617 // CHECK11-NEXT: store i32 99, ptr [[DOTOMP_COMB_UB]], align 4
6618 // CHECK11-NEXT: store i32 1, ptr [[DOTOMP_STRIDE]], align 4
6619 // CHECK11-NEXT: store i32 0, ptr [[DOTOMP_IS_LAST]], align 4
6620 // CHECK11-NEXT: [[TMP2:%.*]] = load ptr, ptr [[DOTGLOBAL_TID__ADDR]], align 8
6621 // CHECK11-NEXT: [[TMP3:%.*]] = load i32, ptr [[TMP2]], align 4
6622 // CHECK11-NEXT: call void @__kmpc_for_static_init_4(ptr @[[GLOB1]], i32 [[TMP3]], i32 92, ptr [[DOTOMP_IS_LAST]], ptr [[DOTOMP_COMB_LB]], ptr [[DOTOMP_COMB_UB]], ptr [[DOTOMP_STRIDE]], i32 1, i32 1)
6623 // CHECK11-NEXT: [[TMP4:%.*]] = load i32, ptr [[DOTOMP_COMB_UB]], align 4
6624 // CHECK11-NEXT: [[CMP:%.*]] = icmp sgt i32 [[TMP4]], 99
6625 // CHECK11-NEXT: br i1 [[CMP]], label [[COND_TRUE:%.*]], label [[COND_FALSE:%.*]]
6626 // CHECK11: cond.true:
6627 // CHECK11-NEXT: br label [[COND_END:%.*]]
6628 // CHECK11: cond.false:
6629 // CHECK11-NEXT: [[TMP5:%.*]] = load i32, ptr [[DOTOMP_COMB_UB]], align 4
6630 // CHECK11-NEXT: br label [[COND_END]]
6631 // CHECK11: cond.end:
6632 // CHECK11-NEXT: [[COND:%.*]] = phi i32 [ 99, [[COND_TRUE]] ], [ [[TMP5]], [[COND_FALSE]] ]
6633 // CHECK11-NEXT: store i32 [[COND]], ptr [[DOTOMP_COMB_UB]], align 4
6634 // CHECK11-NEXT: [[TMP6:%.*]] = load i32, ptr [[DOTOMP_COMB_LB]], align 4
6635 // CHECK11-NEXT: store i32 [[TMP6]], ptr [[DOTOMP_IV]], align 4
6636 // CHECK11-NEXT: [[TMP7:%.*]] = load i8, ptr [[DOTCAPTURE_EXPR_]], align 1
6637 // CHECK11-NEXT: [[TOBOOL1:%.*]] = trunc i8 [[TMP7]] to i1
6638 // CHECK11-NEXT: br i1 [[TOBOOL1]], label [[OMP_IF_THEN:%.*]], label [[OMP_IF_ELSE7:%.*]]
6639 // CHECK11: omp_if.then:
6640 // CHECK11-NEXT: br label [[OMP_INNER_FOR_COND:%.*]]
6641 // CHECK11: omp.inner.for.cond:
6642 // CHECK11-NEXT: [[TMP8:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP35:![0-9]+]]
6643 // CHECK11-NEXT: [[TMP9:%.*]] = load i32, ptr [[DOTOMP_COMB_UB]], align 4, !llvm.access.group [[ACC_GRP35]]
6644 // CHECK11-NEXT: [[CMP2:%.*]] = icmp sle i32 [[TMP8]], [[TMP9]]
6645 // CHECK11-NEXT: br i1 [[CMP2]], label [[OMP_INNER_FOR_BODY:%.*]], label [[OMP_INNER_FOR_END:%.*]]
6646 // CHECK11: omp.inner.for.body:
6647 // CHECK11-NEXT: [[TMP10:%.*]] = load i32, ptr [[DOTOMP_COMB_LB]], align 4, !llvm.access.group [[ACC_GRP35]]
6648 // CHECK11-NEXT: [[TMP11:%.*]] = zext i32 [[TMP10]] to i64
6649 // CHECK11-NEXT: [[TMP12:%.*]] = load i32, ptr [[DOTOMP_COMB_UB]], align 4, !llvm.access.group [[ACC_GRP35]]
6650 // CHECK11-NEXT: [[TMP13:%.*]] = zext i32 [[TMP12]] to i64
6651 // CHECK11-NEXT: [[TMP14:%.*]] = load i8, ptr [[DOTCAPTURE_EXPR_]], align 1, !llvm.access.group [[ACC_GRP35]]
6652 // CHECK11-NEXT: [[TOBOOL3:%.*]] = trunc i8 [[TMP14]] to i1
6653 // CHECK11-NEXT: [[FROMBOOL4:%.*]] = zext i1 [[TOBOOL3]] to i8
6654 // CHECK11-NEXT: store i8 [[FROMBOOL4]], ptr [[DOTCAPTURE_EXPR__CASTED]], align 1, !llvm.access.group [[ACC_GRP35]]
6655 // CHECK11-NEXT: [[TMP15:%.*]] = load i64, ptr [[DOTCAPTURE_EXPR__CASTED]], align 8, !llvm.access.group [[ACC_GRP35]]
6656 // CHECK11-NEXT: [[TMP16:%.*]] = load i8, ptr [[DOTCAPTURE_EXPR_]], align 1, !llvm.access.group [[ACC_GRP35]]
6657 // CHECK11-NEXT: [[TOBOOL5:%.*]] = trunc i8 [[TMP16]] to i1
6658 // CHECK11-NEXT: br i1 [[TOBOOL5]], label [[OMP_IF_THEN6:%.*]], label [[OMP_IF_ELSE:%.*]]
6659 // CHECK11: omp_if.then6:
6660 // CHECK11-NEXT: call void (ptr, i32, ptr, ...) @__kmpc_fork_call(ptr @[[GLOB3]], i32 3, ptr @{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}_main_l99.omp_outlined.omp_outlined, i64 [[TMP11]], i64 [[TMP13]], i64 [[TMP15]]), !llvm.access.group [[ACC_GRP35]]
6661 // CHECK11-NEXT: br label [[OMP_IF_END:%.*]]
6662 // CHECK11: omp_if.else:
6663 // CHECK11-NEXT: call void @__kmpc_serialized_parallel(ptr @[[GLOB3]], i32 [[TMP3]]), !llvm.access.group [[ACC_GRP35]]
6664 // CHECK11-NEXT: [[TMP17:%.*]] = load ptr, ptr [[DOTGLOBAL_TID__ADDR]], align 8, !llvm.access.group [[ACC_GRP35]]
6665 // CHECK11-NEXT: store i32 0, ptr [[DOTBOUND_ZERO_ADDR]], align 4, !llvm.access.group [[ACC_GRP35]]
6666 // CHECK11-NEXT: call void @{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}_main_l99.omp_outlined.omp_outlined(ptr [[TMP17]], ptr [[DOTBOUND_ZERO_ADDR]], i64 [[TMP11]], i64 [[TMP13]], i64 [[TMP15]]) #[[ATTR2]], !llvm.access.group [[ACC_GRP35]]
6667 // CHECK11-NEXT: call void @__kmpc_end_serialized_parallel(ptr @[[GLOB3]], i32 [[TMP3]]), !llvm.access.group [[ACC_GRP35]]
6668 // CHECK11-NEXT: br label [[OMP_IF_END]]
6669 // CHECK11: omp_if.end:
6670 // CHECK11-NEXT: br label [[OMP_INNER_FOR_INC:%.*]]
6671 // CHECK11: omp.inner.for.inc:
6672 // CHECK11-NEXT: [[TMP18:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP35]]
6673 // CHECK11-NEXT: [[TMP19:%.*]] = load i32, ptr [[DOTOMP_STRIDE]], align 4, !llvm.access.group [[ACC_GRP35]]
6674 // CHECK11-NEXT: [[ADD:%.*]] = add nsw i32 [[TMP18]], [[TMP19]]
6675 // CHECK11-NEXT: store i32 [[ADD]], ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP35]]
6676 // CHECK11-NEXT: br label [[OMP_INNER_FOR_COND]], !llvm.loop [[LOOP36:![0-9]+]]
6677 // CHECK11: omp.inner.for.end:
6678 // CHECK11-NEXT: br label [[OMP_IF_END22:%.*]]
6679 // CHECK11: omp_if.else7:
6680 // CHECK11-NEXT: br label [[OMP_INNER_FOR_COND8:%.*]]
6681 // CHECK11: omp.inner.for.cond8:
6682 // CHECK11-NEXT: [[TMP20:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4
6683 // CHECK11-NEXT: [[TMP21:%.*]] = load i32, ptr [[DOTOMP_COMB_UB]], align 4
6684 // CHECK11-NEXT: [[CMP9:%.*]] = icmp sle i32 [[TMP20]], [[TMP21]]
6685 // CHECK11-NEXT: br i1 [[CMP9]], label [[OMP_INNER_FOR_BODY10:%.*]], label [[OMP_INNER_FOR_END21:%.*]]
6686 // CHECK11: omp.inner.for.body10:
6687 // CHECK11-NEXT: [[TMP22:%.*]] = load i32, ptr [[DOTOMP_COMB_LB]], align 4
6688 // CHECK11-NEXT: [[TMP23:%.*]] = zext i32 [[TMP22]] to i64
6689 // CHECK11-NEXT: [[TMP24:%.*]] = load i32, ptr [[DOTOMP_COMB_UB]], align 4
6690 // CHECK11-NEXT: [[TMP25:%.*]] = zext i32 [[TMP24]] to i64
6691 // CHECK11-NEXT: [[TMP26:%.*]] = load i8, ptr [[DOTCAPTURE_EXPR_]], align 1
6692 // CHECK11-NEXT: [[TOBOOL11:%.*]] = trunc i8 [[TMP26]] to i1
6693 // CHECK11-NEXT: [[FROMBOOL13:%.*]] = zext i1 [[TOBOOL11]] to i8
6694 // CHECK11-NEXT: store i8 [[FROMBOOL13]], ptr [[DOTCAPTURE_EXPR__CASTED12]], align 1
6695 // CHECK11-NEXT: [[TMP27:%.*]] = load i64, ptr [[DOTCAPTURE_EXPR__CASTED12]], align 8
6696 // CHECK11-NEXT: [[TMP28:%.*]] = load i8, ptr [[DOTCAPTURE_EXPR_]], align 1
6697 // CHECK11-NEXT: [[TOBOOL14:%.*]] = trunc i8 [[TMP28]] to i1
6698 // CHECK11-NEXT: br i1 [[TOBOOL14]], label [[OMP_IF_THEN15:%.*]], label [[OMP_IF_ELSE16:%.*]]
6699 // CHECK11: omp_if.then15:
6700 // CHECK11-NEXT: call void (ptr, i32, ptr, ...) @__kmpc_fork_call(ptr @[[GLOB3]], i32 3, ptr @{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}_main_l99.omp_outlined.omp_outlined.1, i64 [[TMP23]], i64 [[TMP25]], i64 [[TMP27]])
6701 // CHECK11-NEXT: br label [[OMP_IF_END18:%.*]]
6702 // CHECK11: omp_if.else16:
6703 // CHECK11-NEXT: call void @__kmpc_serialized_parallel(ptr @[[GLOB3]], i32 [[TMP3]])
6704 // CHECK11-NEXT: [[TMP29:%.*]] = load ptr, ptr [[DOTGLOBAL_TID__ADDR]], align 8
6705 // CHECK11-NEXT: store i32 0, ptr [[DOTBOUND_ZERO_ADDR17]], align 4
6706 // CHECK11-NEXT: call void @{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}_main_l99.omp_outlined.omp_outlined.1(ptr [[TMP29]], ptr [[DOTBOUND_ZERO_ADDR17]], i64 [[TMP23]], i64 [[TMP25]], i64 [[TMP27]]) #[[ATTR2]]
6707 // CHECK11-NEXT: call void @__kmpc_end_serialized_parallel(ptr @[[GLOB3]], i32 [[TMP3]])
6708 // CHECK11-NEXT: br label [[OMP_IF_END18]]
6709 // CHECK11: omp_if.end18:
6710 // CHECK11-NEXT: br label [[OMP_INNER_FOR_INC19:%.*]]
6711 // CHECK11: omp.inner.for.inc19:
6712 // CHECK11-NEXT: [[TMP30:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4
6713 // CHECK11-NEXT: [[TMP31:%.*]] = load i32, ptr [[DOTOMP_STRIDE]], align 4
6714 // CHECK11-NEXT: [[ADD20:%.*]] = add nsw i32 [[TMP30]], [[TMP31]]
6715 // CHECK11-NEXT: store i32 [[ADD20]], ptr [[DOTOMP_IV]], align 4
6716 // CHECK11-NEXT: br label [[OMP_INNER_FOR_COND8]], !llvm.loop [[LOOP38:![0-9]+]]
6717 // CHECK11: omp.inner.for.end21:
6718 // CHECK11-NEXT: br label [[OMP_IF_END22]]
6719 // CHECK11: omp_if.end22:
6720 // CHECK11-NEXT: br label [[OMP_LOOP_EXIT:%.*]]
6721 // CHECK11: omp.loop.exit:
6722 // CHECK11-NEXT: call void @__kmpc_for_static_fini(ptr @[[GLOB1]], i32 [[TMP3]])
6723 // CHECK11-NEXT: [[TMP32:%.*]] = load i32, ptr [[DOTOMP_IS_LAST]], align 4
6724 // CHECK11-NEXT: [[TMP33:%.*]] = icmp ne i32 [[TMP32]], 0
6725 // CHECK11-NEXT: br i1 [[TMP33]], label [[DOTOMP_FINAL_THEN:%.*]], label [[DOTOMP_FINAL_DONE:%.*]]
6726 // CHECK11: .omp.final.then:
6727 // CHECK11-NEXT: store i32 100, ptr [[I]], align 4
6728 // CHECK11-NEXT: br label [[DOTOMP_FINAL_DONE]]
6729 // CHECK11: .omp.final.done:
6730 // CHECK11-NEXT: ret void
6733 // CHECK11-LABEL: define {{[^@]+}}@{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}_main_l99.omp_outlined.omp_outlined
6734 // CHECK11-SAME: (ptr noalias noundef [[DOTGLOBAL_TID_:%.*]], ptr noalias noundef [[DOTBOUND_TID_:%.*]], i64 noundef [[DOTPREVIOUS_LB_:%.*]], i64 noundef [[DOTPREVIOUS_UB_:%.*]], i64 noundef [[DOTCAPTURE_EXPR_:%.*]]) #[[ATTR1]] {
6735 // CHECK11-NEXT: entry:
6736 // CHECK11-NEXT: [[DOTGLOBAL_TID__ADDR:%.*]] = alloca ptr, align 8
6737 // CHECK11-NEXT: [[DOTBOUND_TID__ADDR:%.*]] = alloca ptr, align 8
6738 // CHECK11-NEXT: [[DOTPREVIOUS_LB__ADDR:%.*]] = alloca i64, align 8
6739 // CHECK11-NEXT: [[DOTPREVIOUS_UB__ADDR:%.*]] = alloca i64, align 8
6740 // CHECK11-NEXT: [[DOTCAPTURE_EXPR__ADDR:%.*]] = alloca i64, align 8
6741 // CHECK11-NEXT: [[DOTOMP_IV:%.*]] = alloca i32, align 4
6742 // CHECK11-NEXT: [[TMP:%.*]] = alloca i32, align 4
6743 // CHECK11-NEXT: [[DOTOMP_LB:%.*]] = alloca i32, align 4
6744 // CHECK11-NEXT: [[DOTOMP_UB:%.*]] = alloca i32, align 4
6745 // CHECK11-NEXT: [[DOTOMP_STRIDE:%.*]] = alloca i32, align 4
6746 // CHECK11-NEXT: [[DOTOMP_IS_LAST:%.*]] = alloca i32, align 4
6747 // CHECK11-NEXT: [[I:%.*]] = alloca i32, align 4
6748 // CHECK11-NEXT: store ptr [[DOTGLOBAL_TID_]], ptr [[DOTGLOBAL_TID__ADDR]], align 8
6749 // CHECK11-NEXT: store ptr [[DOTBOUND_TID_]], ptr [[DOTBOUND_TID__ADDR]], align 8
6750 // CHECK11-NEXT: store i64 [[DOTPREVIOUS_LB_]], ptr [[DOTPREVIOUS_LB__ADDR]], align 8
6751 // CHECK11-NEXT: store i64 [[DOTPREVIOUS_UB_]], ptr [[DOTPREVIOUS_UB__ADDR]], align 8
6752 // CHECK11-NEXT: store i64 [[DOTCAPTURE_EXPR_]], ptr [[DOTCAPTURE_EXPR__ADDR]], align 8
6753 // CHECK11-NEXT: store i32 0, ptr [[DOTOMP_LB]], align 4
6754 // CHECK11-NEXT: store i32 99, ptr [[DOTOMP_UB]], align 4
6755 // CHECK11-NEXT: [[TMP0:%.*]] = load i64, ptr [[DOTPREVIOUS_LB__ADDR]], align 8
6756 // CHECK11-NEXT: [[CONV:%.*]] = trunc i64 [[TMP0]] to i32
6757 // CHECK11-NEXT: [[TMP1:%.*]] = load i64, ptr [[DOTPREVIOUS_UB__ADDR]], align 8
6758 // CHECK11-NEXT: [[CONV1:%.*]] = trunc i64 [[TMP1]] to i32
6759 // CHECK11-NEXT: store i32 [[CONV]], ptr [[DOTOMP_LB]], align 4
6760 // CHECK11-NEXT: store i32 [[CONV1]], ptr [[DOTOMP_UB]], align 4
6761 // CHECK11-NEXT: store i32 1, ptr [[DOTOMP_STRIDE]], align 4
6762 // CHECK11-NEXT: store i32 0, ptr [[DOTOMP_IS_LAST]], align 4
6763 // CHECK11-NEXT: [[TMP2:%.*]] = load i8, ptr [[DOTCAPTURE_EXPR__ADDR]], align 1
6764 // CHECK11-NEXT: [[TOBOOL:%.*]] = trunc i8 [[TMP2]] to i1
6765 // CHECK11-NEXT: br i1 [[TOBOOL]], label [[OMP_IF_THEN:%.*]], label [[OMP_IF_ELSE:%.*]]
6766 // CHECK11: omp_if.then:
6767 // CHECK11-NEXT: [[TMP3:%.*]] = load ptr, ptr [[DOTGLOBAL_TID__ADDR]], align 8
6768 // CHECK11-NEXT: [[TMP4:%.*]] = load i32, ptr [[TMP3]], align 4
6769 // CHECK11-NEXT: call void @__kmpc_for_static_init_4(ptr @[[GLOB2]], i32 [[TMP4]], i32 34, ptr [[DOTOMP_IS_LAST]], ptr [[DOTOMP_LB]], ptr [[DOTOMP_UB]], ptr [[DOTOMP_STRIDE]], i32 1, i32 1)
6770 // CHECK11-NEXT: [[TMP5:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4
6771 // CHECK11-NEXT: [[CMP:%.*]] = icmp sgt i32 [[TMP5]], 99
6772 // CHECK11-NEXT: br i1 [[CMP]], label [[COND_TRUE:%.*]], label [[COND_FALSE:%.*]]
6773 // CHECK11: cond.true:
6774 // CHECK11-NEXT: br label [[COND_END:%.*]]
6775 // CHECK11: cond.false:
6776 // CHECK11-NEXT: [[TMP6:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4
6777 // CHECK11-NEXT: br label [[COND_END]]
6778 // CHECK11: cond.end:
6779 // CHECK11-NEXT: [[COND:%.*]] = phi i32 [ 99, [[COND_TRUE]] ], [ [[TMP6]], [[COND_FALSE]] ]
6780 // CHECK11-NEXT: store i32 [[COND]], ptr [[DOTOMP_UB]], align 4
6781 // CHECK11-NEXT: [[TMP7:%.*]] = load i32, ptr [[DOTOMP_LB]], align 4
6782 // CHECK11-NEXT: store i32 [[TMP7]], ptr [[DOTOMP_IV]], align 4
6783 // CHECK11-NEXT: br label [[OMP_INNER_FOR_COND:%.*]]
6784 // CHECK11: omp.inner.for.cond:
6785 // CHECK11-NEXT: [[TMP8:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP39:![0-9]+]]
6786 // CHECK11-NEXT: [[TMP9:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4, !llvm.access.group [[ACC_GRP39]]
6787 // CHECK11-NEXT: [[CMP2:%.*]] = icmp sle i32 [[TMP8]], [[TMP9]]
6788 // CHECK11-NEXT: br i1 [[CMP2]], label [[OMP_INNER_FOR_BODY:%.*]], label [[OMP_INNER_FOR_END:%.*]]
6789 // CHECK11: omp.inner.for.body:
6790 // CHECK11-NEXT: [[TMP10:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP39]]
6791 // CHECK11-NEXT: [[MUL:%.*]] = mul nsw i32 [[TMP10]], 1
6792 // CHECK11-NEXT: [[ADD:%.*]] = add nsw i32 0, [[MUL]]
6793 // CHECK11-NEXT: store i32 [[ADD]], ptr [[I]], align 4, !llvm.access.group [[ACC_GRP39]]
6794 // CHECK11-NEXT: call void @_Z3fn6v(), !llvm.access.group [[ACC_GRP39]]
6795 // CHECK11-NEXT: br label [[OMP_BODY_CONTINUE:%.*]]
6796 // CHECK11: omp.body.continue:
6797 // CHECK11-NEXT: br label [[OMP_INNER_FOR_INC:%.*]]
6798 // CHECK11: omp.inner.for.inc:
6799 // CHECK11-NEXT: [[TMP11:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP39]]
6800 // CHECK11-NEXT: [[ADD3:%.*]] = add nsw i32 [[TMP11]], 1
6801 // CHECK11-NEXT: store i32 [[ADD3]], ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP39]]
6802 // CHECK11-NEXT: br label [[OMP_INNER_FOR_COND]], !llvm.loop [[LOOP40:![0-9]+]]
6803 // CHECK11: omp.inner.for.end:
6804 // CHECK11-NEXT: br label [[OMP_IF_END:%.*]]
6805 // CHECK11: omp_if.else:
6806 // CHECK11-NEXT: [[TMP12:%.*]] = load ptr, ptr [[DOTGLOBAL_TID__ADDR]], align 8
6807 // CHECK11-NEXT: [[TMP13:%.*]] = load i32, ptr [[TMP12]], align 4
6808 // CHECK11-NEXT: call void @__kmpc_for_static_init_4(ptr @[[GLOB2]], i32 [[TMP13]], i32 34, ptr [[DOTOMP_IS_LAST]], ptr [[DOTOMP_LB]], ptr [[DOTOMP_UB]], ptr [[DOTOMP_STRIDE]], i32 1, i32 1)
6809 // CHECK11-NEXT: [[TMP14:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4
6810 // CHECK11-NEXT: [[CMP4:%.*]] = icmp sgt i32 [[TMP14]], 99
6811 // CHECK11-NEXT: br i1 [[CMP4]], label [[COND_TRUE5:%.*]], label [[COND_FALSE6:%.*]]
6812 // CHECK11: cond.true5:
6813 // CHECK11-NEXT: br label [[COND_END7:%.*]]
6814 // CHECK11: cond.false6:
6815 // CHECK11-NEXT: [[TMP15:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4
6816 // CHECK11-NEXT: br label [[COND_END7]]
6817 // CHECK11: cond.end7:
6818 // CHECK11-NEXT: [[COND8:%.*]] = phi i32 [ 99, [[COND_TRUE5]] ], [ [[TMP15]], [[COND_FALSE6]] ]
6819 // CHECK11-NEXT: store i32 [[COND8]], ptr [[DOTOMP_UB]], align 4
6820 // CHECK11-NEXT: [[TMP16:%.*]] = load i32, ptr [[DOTOMP_LB]], align 4
6821 // CHECK11-NEXT: store i32 [[TMP16]], ptr [[DOTOMP_IV]], align 4
6822 // CHECK11-NEXT: br label [[OMP_INNER_FOR_COND9:%.*]]
6823 // CHECK11: omp.inner.for.cond9:
6824 // CHECK11-NEXT: [[TMP17:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4
6825 // CHECK11-NEXT: [[TMP18:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4
6826 // CHECK11-NEXT: [[CMP10:%.*]] = icmp sle i32 [[TMP17]], [[TMP18]]
6827 // CHECK11-NEXT: br i1 [[CMP10]], label [[OMP_INNER_FOR_BODY11:%.*]], label [[OMP_INNER_FOR_END17:%.*]]
6828 // CHECK11: omp.inner.for.body11:
6829 // CHECK11-NEXT: [[TMP19:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4
6830 // CHECK11-NEXT: [[MUL12:%.*]] = mul nsw i32 [[TMP19]], 1
6831 // CHECK11-NEXT: [[ADD13:%.*]] = add nsw i32 0, [[MUL12]]
6832 // CHECK11-NEXT: store i32 [[ADD13]], ptr [[I]], align 4
6833 // CHECK11-NEXT: call void @_Z3fn6v()
6834 // CHECK11-NEXT: br label [[OMP_BODY_CONTINUE14:%.*]]
6835 // CHECK11: omp.body.continue14:
6836 // CHECK11-NEXT: br label [[OMP_INNER_FOR_INC15:%.*]]
6837 // CHECK11: omp.inner.for.inc15:
6838 // CHECK11-NEXT: [[TMP20:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4
6839 // CHECK11-NEXT: [[ADD16:%.*]] = add nsw i32 [[TMP20]], 1
6840 // CHECK11-NEXT: store i32 [[ADD16]], ptr [[DOTOMP_IV]], align 4
6841 // CHECK11-NEXT: br label [[OMP_INNER_FOR_COND9]], !llvm.loop [[LOOP42:![0-9]+]]
6842 // CHECK11: omp.inner.for.end17:
6843 // CHECK11-NEXT: br label [[OMP_IF_END]]
6844 // CHECK11: omp_if.end:
6845 // CHECK11-NEXT: br label [[OMP_LOOP_EXIT:%.*]]
6846 // CHECK11: omp.loop.exit:
6847 // CHECK11-NEXT: [[TMP21:%.*]] = load ptr, ptr [[DOTGLOBAL_TID__ADDR]], align 8
6848 // CHECK11-NEXT: [[TMP22:%.*]] = load i32, ptr [[TMP21]], align 4
6849 // CHECK11-NEXT: call void @__kmpc_for_static_fini(ptr @[[GLOB1]], i32 [[TMP22]])
6850 // CHECK11-NEXT: [[TMP23:%.*]] = load i32, ptr [[DOTOMP_IS_LAST]], align 4
6851 // CHECK11-NEXT: [[TMP24:%.*]] = icmp ne i32 [[TMP23]], 0
6852 // CHECK11-NEXT: br i1 [[TMP24]], label [[DOTOMP_FINAL_THEN:%.*]], label [[DOTOMP_FINAL_DONE:%.*]]
6853 // CHECK11: .omp.final.then:
6854 // CHECK11-NEXT: store i32 100, ptr [[I]], align 4
6855 // CHECK11-NEXT: br label [[DOTOMP_FINAL_DONE]]
6856 // CHECK11: .omp.final.done:
6857 // CHECK11-NEXT: ret void
6860 // CHECK11-LABEL: define {{[^@]+}}@{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}_main_l99.omp_outlined.omp_outlined.1
6861 // CHECK11-SAME: (ptr noalias noundef [[DOTGLOBAL_TID_:%.*]], ptr noalias noundef [[DOTBOUND_TID_:%.*]], i64 noundef [[DOTPREVIOUS_LB_:%.*]], i64 noundef [[DOTPREVIOUS_UB_:%.*]], i64 noundef [[DOTCAPTURE_EXPR_:%.*]]) #[[ATTR1]] {
6862 // CHECK11-NEXT: entry:
6863 // CHECK11-NEXT: [[DOTGLOBAL_TID__ADDR:%.*]] = alloca ptr, align 8
6864 // CHECK11-NEXT: [[DOTBOUND_TID__ADDR:%.*]] = alloca ptr, align 8
6865 // CHECK11-NEXT: [[DOTPREVIOUS_LB__ADDR:%.*]] = alloca i64, align 8
6866 // CHECK11-NEXT: [[DOTPREVIOUS_UB__ADDR:%.*]] = alloca i64, align 8
6867 // CHECK11-NEXT: [[DOTCAPTURE_EXPR__ADDR:%.*]] = alloca i64, align 8
6868 // CHECK11-NEXT: [[DOTOMP_IV:%.*]] = alloca i32, align 4
6869 // CHECK11-NEXT: [[TMP:%.*]] = alloca i32, align 4
6870 // CHECK11-NEXT: [[DOTOMP_LB:%.*]] = alloca i32, align 4
6871 // CHECK11-NEXT: [[DOTOMP_UB:%.*]] = alloca i32, align 4
6872 // CHECK11-NEXT: [[DOTOMP_STRIDE:%.*]] = alloca i32, align 4
6873 // CHECK11-NEXT: [[DOTOMP_IS_LAST:%.*]] = alloca i32, align 4
6874 // CHECK11-NEXT: [[I:%.*]] = alloca i32, align 4
6875 // CHECK11-NEXT: store ptr [[DOTGLOBAL_TID_]], ptr [[DOTGLOBAL_TID__ADDR]], align 8
6876 // CHECK11-NEXT: store ptr [[DOTBOUND_TID_]], ptr [[DOTBOUND_TID__ADDR]], align 8
6877 // CHECK11-NEXT: store i64 [[DOTPREVIOUS_LB_]], ptr [[DOTPREVIOUS_LB__ADDR]], align 8
6878 // CHECK11-NEXT: store i64 [[DOTPREVIOUS_UB_]], ptr [[DOTPREVIOUS_UB__ADDR]], align 8
6879 // CHECK11-NEXT: store i64 [[DOTCAPTURE_EXPR_]], ptr [[DOTCAPTURE_EXPR__ADDR]], align 8
6880 // CHECK11-NEXT: store i32 0, ptr [[DOTOMP_LB]], align 4
6881 // CHECK11-NEXT: store i32 99, ptr [[DOTOMP_UB]], align 4
6882 // CHECK11-NEXT: [[TMP0:%.*]] = load i64, ptr [[DOTPREVIOUS_LB__ADDR]], align 8
6883 // CHECK11-NEXT: [[CONV:%.*]] = trunc i64 [[TMP0]] to i32
6884 // CHECK11-NEXT: [[TMP1:%.*]] = load i64, ptr [[DOTPREVIOUS_UB__ADDR]], align 8
6885 // CHECK11-NEXT: [[CONV1:%.*]] = trunc i64 [[TMP1]] to i32
6886 // CHECK11-NEXT: store i32 [[CONV]], ptr [[DOTOMP_LB]], align 4
6887 // CHECK11-NEXT: store i32 [[CONV1]], ptr [[DOTOMP_UB]], align 4
6888 // CHECK11-NEXT: store i32 1, ptr [[DOTOMP_STRIDE]], align 4
6889 // CHECK11-NEXT: store i32 0, ptr [[DOTOMP_IS_LAST]], align 4
6890 // CHECK11-NEXT: [[TMP2:%.*]] = load i8, ptr [[DOTCAPTURE_EXPR__ADDR]], align 1
6891 // CHECK11-NEXT: [[TOBOOL:%.*]] = trunc i8 [[TMP2]] to i1
6892 // CHECK11-NEXT: br i1 [[TOBOOL]], label [[OMP_IF_THEN:%.*]], label [[OMP_IF_ELSE:%.*]]
6893 // CHECK11: omp_if.then:
6894 // CHECK11-NEXT: [[TMP3:%.*]] = load ptr, ptr [[DOTGLOBAL_TID__ADDR]], align 8
6895 // CHECK11-NEXT: [[TMP4:%.*]] = load i32, ptr [[TMP3]], align 4
6896 // CHECK11-NEXT: call void @__kmpc_for_static_init_4(ptr @[[GLOB2]], i32 [[TMP4]], i32 34, ptr [[DOTOMP_IS_LAST]], ptr [[DOTOMP_LB]], ptr [[DOTOMP_UB]], ptr [[DOTOMP_STRIDE]], i32 1, i32 1)
6897 // CHECK11-NEXT: [[TMP5:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4
6898 // CHECK11-NEXT: [[CMP:%.*]] = icmp sgt i32 [[TMP5]], 99
6899 // CHECK11-NEXT: br i1 [[CMP]], label [[COND_TRUE:%.*]], label [[COND_FALSE:%.*]]
6900 // CHECK11: cond.true:
6901 // CHECK11-NEXT: br label [[COND_END:%.*]]
6902 // CHECK11: cond.false:
6903 // CHECK11-NEXT: [[TMP6:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4
6904 // CHECK11-NEXT: br label [[COND_END]]
6905 // CHECK11: cond.end:
6906 // CHECK11-NEXT: [[COND:%.*]] = phi i32 [ 99, [[COND_TRUE]] ], [ [[TMP6]], [[COND_FALSE]] ]
6907 // CHECK11-NEXT: store i32 [[COND]], ptr [[DOTOMP_UB]], align 4
6908 // CHECK11-NEXT: [[TMP7:%.*]] = load i32, ptr [[DOTOMP_LB]], align 4
6909 // CHECK11-NEXT: store i32 [[TMP7]], ptr [[DOTOMP_IV]], align 4
6910 // CHECK11-NEXT: br label [[OMP_INNER_FOR_COND:%.*]]
6911 // CHECK11: omp.inner.for.cond:
6912 // CHECK11-NEXT: [[TMP8:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP43:![0-9]+]]
6913 // CHECK11-NEXT: [[TMP9:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4, !llvm.access.group [[ACC_GRP43]]
6914 // CHECK11-NEXT: [[CMP2:%.*]] = icmp sle i32 [[TMP8]], [[TMP9]]
6915 // CHECK11-NEXT: br i1 [[CMP2]], label [[OMP_INNER_FOR_BODY:%.*]], label [[OMP_INNER_FOR_END:%.*]]
6916 // CHECK11: omp.inner.for.body:
6917 // CHECK11-NEXT: [[TMP10:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP43]]
6918 // CHECK11-NEXT: [[MUL:%.*]] = mul nsw i32 [[TMP10]], 1
6919 // CHECK11-NEXT: [[ADD:%.*]] = add nsw i32 0, [[MUL]]
6920 // CHECK11-NEXT: store i32 [[ADD]], ptr [[I]], align 4, !llvm.access.group [[ACC_GRP43]]
6921 // CHECK11-NEXT: call void @_Z3fn6v(), !llvm.access.group [[ACC_GRP43]]
6922 // CHECK11-NEXT: br label [[OMP_BODY_CONTINUE:%.*]]
6923 // CHECK11: omp.body.continue:
6924 // CHECK11-NEXT: br label [[OMP_INNER_FOR_INC:%.*]]
6925 // CHECK11: omp.inner.for.inc:
6926 // CHECK11-NEXT: [[TMP11:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP43]]
6927 // CHECK11-NEXT: [[ADD3:%.*]] = add nsw i32 [[TMP11]], 1
6928 // CHECK11-NEXT: store i32 [[ADD3]], ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP43]]
6929 // CHECK11-NEXT: br label [[OMP_INNER_FOR_COND]], !llvm.loop [[LOOP44:![0-9]+]]
6930 // CHECK11: omp.inner.for.end:
6931 // CHECK11-NEXT: br label [[OMP_IF_END:%.*]]
6932 // CHECK11: omp_if.else:
6933 // CHECK11-NEXT: [[TMP12:%.*]] = load ptr, ptr [[DOTGLOBAL_TID__ADDR]], align 8
6934 // CHECK11-NEXT: [[TMP13:%.*]] = load i32, ptr [[TMP12]], align 4
6935 // CHECK11-NEXT: call void @__kmpc_for_static_init_4(ptr @[[GLOB2]], i32 [[TMP13]], i32 34, ptr [[DOTOMP_IS_LAST]], ptr [[DOTOMP_LB]], ptr [[DOTOMP_UB]], ptr [[DOTOMP_STRIDE]], i32 1, i32 1)
6936 // CHECK11-NEXT: [[TMP14:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4
6937 // CHECK11-NEXT: [[CMP4:%.*]] = icmp sgt i32 [[TMP14]], 99
6938 // CHECK11-NEXT: br i1 [[CMP4]], label [[COND_TRUE5:%.*]], label [[COND_FALSE6:%.*]]
6939 // CHECK11: cond.true5:
6940 // CHECK11-NEXT: br label [[COND_END7:%.*]]
6941 // CHECK11: cond.false6:
6942 // CHECK11-NEXT: [[TMP15:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4
6943 // CHECK11-NEXT: br label [[COND_END7]]
6944 // CHECK11: cond.end7:
6945 // CHECK11-NEXT: [[COND8:%.*]] = phi i32 [ 99, [[COND_TRUE5]] ], [ [[TMP15]], [[COND_FALSE6]] ]
6946 // CHECK11-NEXT: store i32 [[COND8]], ptr [[DOTOMP_UB]], align 4
6947 // CHECK11-NEXT: [[TMP16:%.*]] = load i32, ptr [[DOTOMP_LB]], align 4
6948 // CHECK11-NEXT: store i32 [[TMP16]], ptr [[DOTOMP_IV]], align 4
6949 // CHECK11-NEXT: br label [[OMP_INNER_FOR_COND9:%.*]]
6950 // CHECK11: omp.inner.for.cond9:
6951 // CHECK11-NEXT: [[TMP17:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4
6952 // CHECK11-NEXT: [[TMP18:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4
6953 // CHECK11-NEXT: [[CMP10:%.*]] = icmp sle i32 [[TMP17]], [[TMP18]]
6954 // CHECK11-NEXT: br i1 [[CMP10]], label [[OMP_INNER_FOR_BODY11:%.*]], label [[OMP_INNER_FOR_END17:%.*]]
6955 // CHECK11: omp.inner.for.body11:
6956 // CHECK11-NEXT: [[TMP19:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4
6957 // CHECK11-NEXT: [[MUL12:%.*]] = mul nsw i32 [[TMP19]], 1
6958 // CHECK11-NEXT: [[ADD13:%.*]] = add nsw i32 0, [[MUL12]]
6959 // CHECK11-NEXT: store i32 [[ADD13]], ptr [[I]], align 4
6960 // CHECK11-NEXT: call void @_Z3fn6v()
6961 // CHECK11-NEXT: br label [[OMP_BODY_CONTINUE14:%.*]]
6962 // CHECK11: omp.body.continue14:
6963 // CHECK11-NEXT: br label [[OMP_INNER_FOR_INC15:%.*]]
6964 // CHECK11: omp.inner.for.inc15:
6965 // CHECK11-NEXT: [[TMP20:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4
6966 // CHECK11-NEXT: [[ADD16:%.*]] = add nsw i32 [[TMP20]], 1
6967 // CHECK11-NEXT: store i32 [[ADD16]], ptr [[DOTOMP_IV]], align 4
6968 // CHECK11-NEXT: br label [[OMP_INNER_FOR_COND9]], !llvm.loop [[LOOP46:![0-9]+]]
6969 // CHECK11: omp.inner.for.end17:
6970 // CHECK11-NEXT: br label [[OMP_IF_END]]
6971 // CHECK11: omp_if.end:
6972 // CHECK11-NEXT: br label [[OMP_LOOP_EXIT:%.*]]
6973 // CHECK11: omp.loop.exit:
6974 // CHECK11-NEXT: [[TMP21:%.*]] = load ptr, ptr [[DOTGLOBAL_TID__ADDR]], align 8
6975 // CHECK11-NEXT: [[TMP22:%.*]] = load i32, ptr [[TMP21]], align 4
6976 // CHECK11-NEXT: call void @__kmpc_for_static_fini(ptr @[[GLOB1]], i32 [[TMP22]])
6977 // CHECK11-NEXT: [[TMP23:%.*]] = load i32, ptr [[DOTOMP_IS_LAST]], align 4
6978 // CHECK11-NEXT: [[TMP24:%.*]] = icmp ne i32 [[TMP23]], 0
6979 // CHECK11-NEXT: br i1 [[TMP24]], label [[DOTOMP_FINAL_THEN:%.*]], label [[DOTOMP_FINAL_DONE:%.*]]
6980 // CHECK11: .omp.final.then:
6981 // CHECK11-NEXT: store i32 100, ptr [[I]], align 4
6982 // CHECK11-NEXT: br label [[DOTOMP_FINAL_DONE]]
6983 // CHECK11: .omp.final.done:
6984 // CHECK11-NEXT: ret void
6987 // CHECK11-LABEL: define {{[^@]+}}@_Z5tmainIiEiT_
6988 // CHECK11-SAME: (i32 noundef [[ARG:%.*]]) #[[ATTR0]] comdat {
6989 // CHECK11-NEXT: entry:
6990 // CHECK11-NEXT: [[ARG_ADDR:%.*]] = alloca i32, align 4
6991 // CHECK11-NEXT: [[TMP:%.*]] = alloca i32, align 4
6992 // CHECK11-NEXT: [[KERNEL_ARGS:%.*]] = alloca [[STRUCT___TGT_KERNEL_ARGUMENTS:%.*]], align 8
6993 // CHECK11-NEXT: [[_TMP1:%.*]] = alloca i32, align 4
6994 // CHECK11-NEXT: [[KERNEL_ARGS2:%.*]] = alloca [[STRUCT___TGT_KERNEL_ARGUMENTS]], align 8
6995 // CHECK11-NEXT: [[ARG_CASTED:%.*]] = alloca i64, align 8
6996 // CHECK11-NEXT: [[DOTOFFLOAD_BASEPTRS:%.*]] = alloca [1 x ptr], align 8
6997 // CHECK11-NEXT: [[DOTOFFLOAD_PTRS:%.*]] = alloca [1 x ptr], align 8
6998 // CHECK11-NEXT: [[DOTOFFLOAD_MAPPERS:%.*]] = alloca [1 x ptr], align 8
6999 // CHECK11-NEXT: [[_TMP5:%.*]] = alloca i32, align 4
7000 // CHECK11-NEXT: [[KERNEL_ARGS6:%.*]] = alloca [[STRUCT___TGT_KERNEL_ARGUMENTS]], align 8
7001 // CHECK11-NEXT: store i32 [[ARG]], ptr [[ARG_ADDR]], align 4
7002 // CHECK11-NEXT: [[TMP0:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 0
7003 // CHECK11-NEXT: store i32 2, ptr [[TMP0]], align 4
7004 // CHECK11-NEXT: [[TMP1:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 1
7005 // CHECK11-NEXT: store i32 0, ptr [[TMP1]], align 4
7006 // CHECK11-NEXT: [[TMP2:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 2
7007 // CHECK11-NEXT: store ptr null, ptr [[TMP2]], align 8
7008 // CHECK11-NEXT: [[TMP3:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 3
7009 // CHECK11-NEXT: store ptr null, ptr [[TMP3]], align 8
7010 // CHECK11-NEXT: [[TMP4:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 4
7011 // CHECK11-NEXT: store ptr null, ptr [[TMP4]], align 8
7012 // CHECK11-NEXT: [[TMP5:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 5
7013 // CHECK11-NEXT: store ptr null, ptr [[TMP5]], align 8
7014 // CHECK11-NEXT: [[TMP6:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 6
7015 // CHECK11-NEXT: store ptr null, ptr [[TMP6]], align 8
7016 // CHECK11-NEXT: [[TMP7:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 7
7017 // CHECK11-NEXT: store ptr null, ptr [[TMP7]], align 8
7018 // CHECK11-NEXT: [[TMP8:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 8
7019 // CHECK11-NEXT: store i64 100, ptr [[TMP8]], align 8
7020 // CHECK11-NEXT: [[TMP9:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 9
7021 // CHECK11-NEXT: store i64 0, ptr [[TMP9]], align 8
7022 // CHECK11-NEXT: [[TMP10:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 10
7023 // CHECK11-NEXT: store [3 x i32] zeroinitializer, ptr [[TMP10]], align 4
7024 // CHECK11-NEXT: [[TMP11:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 11
7025 // CHECK11-NEXT: store [3 x i32] zeroinitializer, ptr [[TMP11]], align 4
7026 // CHECK11-NEXT: [[TMP12:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 12
7027 // CHECK11-NEXT: store i32 0, ptr [[TMP12]], align 4
7028 // CHECK11-NEXT: [[TMP13:%.*]] = call i32 @__tgt_target_kernel(ptr @[[GLOB3]], i64 -1, i32 0, i32 0, ptr @.{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z5tmainIiEiT__l59.region_id, ptr [[KERNEL_ARGS]])
7029 // CHECK11-NEXT: [[TMP14:%.*]] = icmp ne i32 [[TMP13]], 0
7030 // CHECK11-NEXT: br i1 [[TMP14]], label [[OMP_OFFLOAD_FAILED:%.*]], label [[OMP_OFFLOAD_CONT:%.*]]
7031 // CHECK11: omp_offload.failed:
7032 // CHECK11-NEXT: call void @{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z5tmainIiEiT__l59() #[[ATTR2]]
7033 // CHECK11-NEXT: br label [[OMP_OFFLOAD_CONT]]
7034 // CHECK11: omp_offload.cont:
7035 // CHECK11-NEXT: [[TMP15:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS2]], i32 0, i32 0
7036 // CHECK11-NEXT: store i32 2, ptr [[TMP15]], align 4
7037 // CHECK11-NEXT: [[TMP16:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS2]], i32 0, i32 1
7038 // CHECK11-NEXT: store i32 0, ptr [[TMP16]], align 4
7039 // CHECK11-NEXT: [[TMP17:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS2]], i32 0, i32 2
7040 // CHECK11-NEXT: store ptr null, ptr [[TMP17]], align 8
7041 // CHECK11-NEXT: [[TMP18:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS2]], i32 0, i32 3
7042 // CHECK11-NEXT: store ptr null, ptr [[TMP18]], align 8
7043 // CHECK11-NEXT: [[TMP19:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS2]], i32 0, i32 4
7044 // CHECK11-NEXT: store ptr null, ptr [[TMP19]], align 8
7045 // CHECK11-NEXT: [[TMP20:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS2]], i32 0, i32 5
7046 // CHECK11-NEXT: store ptr null, ptr [[TMP20]], align 8
7047 // CHECK11-NEXT: [[TMP21:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS2]], i32 0, i32 6
7048 // CHECK11-NEXT: store ptr null, ptr [[TMP21]], align 8
7049 // CHECK11-NEXT: [[TMP22:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS2]], i32 0, i32 7
7050 // CHECK11-NEXT: store ptr null, ptr [[TMP22]], align 8
7051 // CHECK11-NEXT: [[TMP23:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS2]], i32 0, i32 8
7052 // CHECK11-NEXT: store i64 100, ptr [[TMP23]], align 8
7053 // CHECK11-NEXT: [[TMP24:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS2]], i32 0, i32 9
7054 // CHECK11-NEXT: store i64 0, ptr [[TMP24]], align 8
7055 // CHECK11-NEXT: [[TMP25:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS2]], i32 0, i32 10
7056 // CHECK11-NEXT: store [3 x i32] zeroinitializer, ptr [[TMP25]], align 4
7057 // CHECK11-NEXT: [[TMP26:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS2]], i32 0, i32 11
7058 // CHECK11-NEXT: store [3 x i32] zeroinitializer, ptr [[TMP26]], align 4
7059 // CHECK11-NEXT: [[TMP27:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS2]], i32 0, i32 12
7060 // CHECK11-NEXT: store i32 0, ptr [[TMP27]], align 4
7061 // CHECK11-NEXT: [[TMP28:%.*]] = call i32 @__tgt_target_kernel(ptr @[[GLOB3]], i64 -1, i32 0, i32 0, ptr @.{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z5tmainIiEiT__l65.region_id, ptr [[KERNEL_ARGS2]])
7062 // CHECK11-NEXT: [[TMP29:%.*]] = icmp ne i32 [[TMP28]], 0
7063 // CHECK11-NEXT: br i1 [[TMP29]], label [[OMP_OFFLOAD_FAILED3:%.*]], label [[OMP_OFFLOAD_CONT4:%.*]]
7064 // CHECK11: omp_offload.failed3:
7065 // CHECK11-NEXT: call void @{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z5tmainIiEiT__l65() #[[ATTR2]]
7066 // CHECK11-NEXT: br label [[OMP_OFFLOAD_CONT4]]
7067 // CHECK11: omp_offload.cont4:
7068 // CHECK11-NEXT: [[TMP30:%.*]] = load i32, ptr [[ARG_ADDR]], align 4
7069 // CHECK11-NEXT: store i32 [[TMP30]], ptr [[ARG_CASTED]], align 4
7070 // CHECK11-NEXT: [[TMP31:%.*]] = load i64, ptr [[ARG_CASTED]], align 8
7071 // CHECK11-NEXT: [[TMP32:%.*]] = getelementptr inbounds [1 x ptr], ptr [[DOTOFFLOAD_BASEPTRS]], i32 0, i32 0
7072 // CHECK11-NEXT: store i64 [[TMP31]], ptr [[TMP32]], align 8
7073 // CHECK11-NEXT: [[TMP33:%.*]] = getelementptr inbounds [1 x ptr], ptr [[DOTOFFLOAD_PTRS]], i32 0, i32 0
7074 // CHECK11-NEXT: store i64 [[TMP31]], ptr [[TMP33]], align 8
7075 // CHECK11-NEXT: [[TMP34:%.*]] = getelementptr inbounds [1 x ptr], ptr [[DOTOFFLOAD_MAPPERS]], i64 0, i64 0
7076 // CHECK11-NEXT: store ptr null, ptr [[TMP34]], align 8
7077 // CHECK11-NEXT: [[TMP35:%.*]] = getelementptr inbounds [1 x ptr], ptr [[DOTOFFLOAD_BASEPTRS]], i32 0, i32 0
7078 // CHECK11-NEXT: [[TMP36:%.*]] = getelementptr inbounds [1 x ptr], ptr [[DOTOFFLOAD_PTRS]], i32 0, i32 0
7079 // CHECK11-NEXT: [[TMP37:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS6]], i32 0, i32 0
7080 // CHECK11-NEXT: store i32 2, ptr [[TMP37]], align 4
7081 // CHECK11-NEXT: [[TMP38:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS6]], i32 0, i32 1
7082 // CHECK11-NEXT: store i32 1, ptr [[TMP38]], align 4
7083 // CHECK11-NEXT: [[TMP39:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS6]], i32 0, i32 2
7084 // CHECK11-NEXT: store ptr [[TMP35]], ptr [[TMP39]], align 8
7085 // CHECK11-NEXT: [[TMP40:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS6]], i32 0, i32 3
7086 // CHECK11-NEXT: store ptr [[TMP36]], ptr [[TMP40]], align 8
7087 // CHECK11-NEXT: [[TMP41:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS6]], i32 0, i32 4
7088 // CHECK11-NEXT: store ptr @.offload_sizes.2, ptr [[TMP41]], align 8
7089 // CHECK11-NEXT: [[TMP42:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS6]], i32 0, i32 5
7090 // CHECK11-NEXT: store ptr @.offload_maptypes.3, ptr [[TMP42]], align 8
7091 // CHECK11-NEXT: [[TMP43:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS6]], i32 0, i32 6
7092 // CHECK11-NEXT: store ptr null, ptr [[TMP43]], align 8
7093 // CHECK11-NEXT: [[TMP44:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS6]], i32 0, i32 7
7094 // CHECK11-NEXT: store ptr null, ptr [[TMP44]], align 8
7095 // CHECK11-NEXT: [[TMP45:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS6]], i32 0, i32 8
7096 // CHECK11-NEXT: store i64 100, ptr [[TMP45]], align 8
7097 // CHECK11-NEXT: [[TMP46:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS6]], i32 0, i32 9
7098 // CHECK11-NEXT: store i64 0, ptr [[TMP46]], align 8
7099 // CHECK11-NEXT: [[TMP47:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS6]], i32 0, i32 10
7100 // CHECK11-NEXT: store [3 x i32] zeroinitializer, ptr [[TMP47]], align 4
7101 // CHECK11-NEXT: [[TMP48:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS6]], i32 0, i32 11
7102 // CHECK11-NEXT: store [3 x i32] zeroinitializer, ptr [[TMP48]], align 4
7103 // CHECK11-NEXT: [[TMP49:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS6]], i32 0, i32 12
7104 // CHECK11-NEXT: store i32 0, ptr [[TMP49]], align 4
7105 // CHECK11-NEXT: [[TMP50:%.*]] = call i32 @__tgt_target_kernel(ptr @[[GLOB3]], i64 -1, i32 0, i32 0, ptr @.{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z5tmainIiEiT__l71.region_id, ptr [[KERNEL_ARGS6]])
7106 // CHECK11-NEXT: [[TMP51:%.*]] = icmp ne i32 [[TMP50]], 0
7107 // CHECK11-NEXT: br i1 [[TMP51]], label [[OMP_OFFLOAD_FAILED7:%.*]], label [[OMP_OFFLOAD_CONT8:%.*]]
7108 // CHECK11: omp_offload.failed7:
7109 // CHECK11-NEXT: call void @{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z5tmainIiEiT__l71(i64 [[TMP31]]) #[[ATTR2]]
7110 // CHECK11-NEXT: br label [[OMP_OFFLOAD_CONT8]]
7111 // CHECK11: omp_offload.cont8:
7112 // CHECK11-NEXT: ret i32 0
7115 // CHECK11-LABEL: define {{[^@]+}}@{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z5tmainIiEiT__l59
7116 // CHECK11-SAME: () #[[ATTR1]] {
7117 // CHECK11-NEXT: entry:
7118 // CHECK11-NEXT: call void (ptr, i32, ptr, ...) @__kmpc_fork_teams(ptr @[[GLOB3]], i32 0, ptr @{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z5tmainIiEiT__l59.omp_outlined)
7119 // CHECK11-NEXT: ret void
7122 // CHECK11-LABEL: define {{[^@]+}}@{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z5tmainIiEiT__l59.omp_outlined
7123 // CHECK11-SAME: (ptr noalias noundef [[DOTGLOBAL_TID_:%.*]], ptr noalias noundef [[DOTBOUND_TID_:%.*]]) #[[ATTR1]] {
7124 // CHECK11-NEXT: entry:
7125 // CHECK11-NEXT: [[DOTGLOBAL_TID__ADDR:%.*]] = alloca ptr, align 8
7126 // CHECK11-NEXT: [[DOTBOUND_TID__ADDR:%.*]] = alloca ptr, align 8
7127 // CHECK11-NEXT: [[DOTOMP_IV:%.*]] = alloca i32, align 4
7128 // CHECK11-NEXT: [[TMP:%.*]] = alloca i32, align 4
7129 // CHECK11-NEXT: [[DOTOMP_COMB_LB:%.*]] = alloca i32, align 4
7130 // CHECK11-NEXT: [[DOTOMP_COMB_UB:%.*]] = alloca i32, align 4
7131 // CHECK11-NEXT: [[DOTOMP_STRIDE:%.*]] = alloca i32, align 4
7132 // CHECK11-NEXT: [[DOTOMP_IS_LAST:%.*]] = alloca i32, align 4
7133 // CHECK11-NEXT: [[I:%.*]] = alloca i32, align 4
7134 // CHECK11-NEXT: store ptr [[DOTGLOBAL_TID_]], ptr [[DOTGLOBAL_TID__ADDR]], align 8
7135 // CHECK11-NEXT: store ptr [[DOTBOUND_TID_]], ptr [[DOTBOUND_TID__ADDR]], align 8
7136 // CHECK11-NEXT: store i32 0, ptr [[DOTOMP_COMB_LB]], align 4
7137 // CHECK11-NEXT: store i32 99, ptr [[DOTOMP_COMB_UB]], align 4
7138 // CHECK11-NEXT: store i32 1, ptr [[DOTOMP_STRIDE]], align 4
7139 // CHECK11-NEXT: store i32 0, ptr [[DOTOMP_IS_LAST]], align 4
7140 // CHECK11-NEXT: [[TMP0:%.*]] = load ptr, ptr [[DOTGLOBAL_TID__ADDR]], align 8
7141 // CHECK11-NEXT: [[TMP1:%.*]] = load i32, ptr [[TMP0]], align 4
7142 // CHECK11-NEXT: call void @__kmpc_for_static_init_4(ptr @[[GLOB1]], i32 [[TMP1]], i32 92, ptr [[DOTOMP_IS_LAST]], ptr [[DOTOMP_COMB_LB]], ptr [[DOTOMP_COMB_UB]], ptr [[DOTOMP_STRIDE]], i32 1, i32 1)
7143 // CHECK11-NEXT: [[TMP2:%.*]] = load i32, ptr [[DOTOMP_COMB_UB]], align 4
7144 // CHECK11-NEXT: [[CMP:%.*]] = icmp sgt i32 [[TMP2]], 99
7145 // CHECK11-NEXT: br i1 [[CMP]], label [[COND_TRUE:%.*]], label [[COND_FALSE:%.*]]
7146 // CHECK11: cond.true:
7147 // CHECK11-NEXT: br label [[COND_END:%.*]]
7148 // CHECK11: cond.false:
7149 // CHECK11-NEXT: [[TMP3:%.*]] = load i32, ptr [[DOTOMP_COMB_UB]], align 4
7150 // CHECK11-NEXT: br label [[COND_END]]
7151 // CHECK11: cond.end:
7152 // CHECK11-NEXT: [[COND:%.*]] = phi i32 [ 99, [[COND_TRUE]] ], [ [[TMP3]], [[COND_FALSE]] ]
7153 // CHECK11-NEXT: store i32 [[COND]], ptr [[DOTOMP_COMB_UB]], align 4
7154 // CHECK11-NEXT: [[TMP4:%.*]] = load i32, ptr [[DOTOMP_COMB_LB]], align 4
7155 // CHECK11-NEXT: store i32 [[TMP4]], ptr [[DOTOMP_IV]], align 4
7156 // CHECK11-NEXT: br label [[OMP_INNER_FOR_COND:%.*]]
7157 // CHECK11: omp.inner.for.cond:
7158 // CHECK11-NEXT: [[TMP5:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP47:![0-9]+]]
7159 // CHECK11-NEXT: [[TMP6:%.*]] = load i32, ptr [[DOTOMP_COMB_UB]], align 4, !llvm.access.group [[ACC_GRP47]]
7160 // CHECK11-NEXT: [[CMP1:%.*]] = icmp sle i32 [[TMP5]], [[TMP6]]
7161 // CHECK11-NEXT: br i1 [[CMP1]], label [[OMP_INNER_FOR_BODY:%.*]], label [[OMP_INNER_FOR_END:%.*]]
7162 // CHECK11: omp.inner.for.body:
7163 // CHECK11-NEXT: [[TMP7:%.*]] = load i32, ptr [[DOTOMP_COMB_LB]], align 4, !llvm.access.group [[ACC_GRP47]]
7164 // CHECK11-NEXT: [[TMP8:%.*]] = zext i32 [[TMP7]] to i64
7165 // CHECK11-NEXT: [[TMP9:%.*]] = load i32, ptr [[DOTOMP_COMB_UB]], align 4, !llvm.access.group [[ACC_GRP47]]
7166 // CHECK11-NEXT: [[TMP10:%.*]] = zext i32 [[TMP9]] to i64
7167 // CHECK11-NEXT: call void (ptr, i32, ptr, ...) @__kmpc_fork_call(ptr @[[GLOB3]], i32 2, ptr @{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z5tmainIiEiT__l59.omp_outlined.omp_outlined, i64 [[TMP8]], i64 [[TMP10]]), !llvm.access.group [[ACC_GRP47]]
7168 // CHECK11-NEXT: br label [[OMP_INNER_FOR_INC:%.*]]
7169 // CHECK11: omp.inner.for.inc:
7170 // CHECK11-NEXT: [[TMP11:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP47]]
7171 // CHECK11-NEXT: [[TMP12:%.*]] = load i32, ptr [[DOTOMP_STRIDE]], align 4, !llvm.access.group [[ACC_GRP47]]
7172 // CHECK11-NEXT: [[ADD:%.*]] = add nsw i32 [[TMP11]], [[TMP12]]
7173 // CHECK11-NEXT: store i32 [[ADD]], ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP47]]
7174 // CHECK11-NEXT: br label [[OMP_INNER_FOR_COND]], !llvm.loop [[LOOP48:![0-9]+]]
7175 // CHECK11: omp.inner.for.end:
7176 // CHECK11-NEXT: br label [[OMP_LOOP_EXIT:%.*]]
7177 // CHECK11: omp.loop.exit:
7178 // CHECK11-NEXT: call void @__kmpc_for_static_fini(ptr @[[GLOB1]], i32 [[TMP1]])
7179 // CHECK11-NEXT: [[TMP13:%.*]] = load i32, ptr [[DOTOMP_IS_LAST]], align 4
7180 // CHECK11-NEXT: [[TMP14:%.*]] = icmp ne i32 [[TMP13]], 0
7181 // CHECK11-NEXT: br i1 [[TMP14]], label [[DOTOMP_FINAL_THEN:%.*]], label [[DOTOMP_FINAL_DONE:%.*]]
7182 // CHECK11: .omp.final.then:
7183 // CHECK11-NEXT: store i32 100, ptr [[I]], align 4
7184 // CHECK11-NEXT: br label [[DOTOMP_FINAL_DONE]]
7185 // CHECK11: .omp.final.done:
7186 // CHECK11-NEXT: ret void
7189 // CHECK11-LABEL: define {{[^@]+}}@{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z5tmainIiEiT__l59.omp_outlined.omp_outlined
7190 // CHECK11-SAME: (ptr noalias noundef [[DOTGLOBAL_TID_:%.*]], ptr noalias noundef [[DOTBOUND_TID_:%.*]], i64 noundef [[DOTPREVIOUS_LB_:%.*]], i64 noundef [[DOTPREVIOUS_UB_:%.*]]) #[[ATTR1]] {
7191 // CHECK11-NEXT: entry:
7192 // CHECK11-NEXT: [[DOTGLOBAL_TID__ADDR:%.*]] = alloca ptr, align 8
7193 // CHECK11-NEXT: [[DOTBOUND_TID__ADDR:%.*]] = alloca ptr, align 8
7194 // CHECK11-NEXT: [[DOTPREVIOUS_LB__ADDR:%.*]] = alloca i64, align 8
7195 // CHECK11-NEXT: [[DOTPREVIOUS_UB__ADDR:%.*]] = alloca i64, align 8
7196 // CHECK11-NEXT: [[DOTOMP_IV:%.*]] = alloca i32, align 4
7197 // CHECK11-NEXT: [[TMP:%.*]] = alloca i32, align 4
7198 // CHECK11-NEXT: [[DOTOMP_LB:%.*]] = alloca i32, align 4
7199 // CHECK11-NEXT: [[DOTOMP_UB:%.*]] = alloca i32, align 4
7200 // CHECK11-NEXT: [[DOTOMP_STRIDE:%.*]] = alloca i32, align 4
7201 // CHECK11-NEXT: [[DOTOMP_IS_LAST:%.*]] = alloca i32, align 4
7202 // CHECK11-NEXT: [[I:%.*]] = alloca i32, align 4
7203 // CHECK11-NEXT: store ptr [[DOTGLOBAL_TID_]], ptr [[DOTGLOBAL_TID__ADDR]], align 8
7204 // CHECK11-NEXT: store ptr [[DOTBOUND_TID_]], ptr [[DOTBOUND_TID__ADDR]], align 8
7205 // CHECK11-NEXT: store i64 [[DOTPREVIOUS_LB_]], ptr [[DOTPREVIOUS_LB__ADDR]], align 8
7206 // CHECK11-NEXT: store i64 [[DOTPREVIOUS_UB_]], ptr [[DOTPREVIOUS_UB__ADDR]], align 8
7207 // CHECK11-NEXT: store i32 0, ptr [[DOTOMP_LB]], align 4
7208 // CHECK11-NEXT: store i32 99, ptr [[DOTOMP_UB]], align 4
7209 // CHECK11-NEXT: [[TMP0:%.*]] = load i64, ptr [[DOTPREVIOUS_LB__ADDR]], align 8
7210 // CHECK11-NEXT: [[CONV:%.*]] = trunc i64 [[TMP0]] to i32
7211 // CHECK11-NEXT: [[TMP1:%.*]] = load i64, ptr [[DOTPREVIOUS_UB__ADDR]], align 8
7212 // CHECK11-NEXT: [[CONV1:%.*]] = trunc i64 [[TMP1]] to i32
7213 // CHECK11-NEXT: store i32 [[CONV]], ptr [[DOTOMP_LB]], align 4
7214 // CHECK11-NEXT: store i32 [[CONV1]], ptr [[DOTOMP_UB]], align 4
7215 // CHECK11-NEXT: store i32 1, ptr [[DOTOMP_STRIDE]], align 4
7216 // CHECK11-NEXT: store i32 0, ptr [[DOTOMP_IS_LAST]], align 4
7217 // CHECK11-NEXT: [[TMP2:%.*]] = load ptr, ptr [[DOTGLOBAL_TID__ADDR]], align 8
7218 // CHECK11-NEXT: [[TMP3:%.*]] = load i32, ptr [[TMP2]], align 4
7219 // CHECK11-NEXT: call void @__kmpc_for_static_init_4(ptr @[[GLOB2]], i32 [[TMP3]], i32 34, ptr [[DOTOMP_IS_LAST]], ptr [[DOTOMP_LB]], ptr [[DOTOMP_UB]], ptr [[DOTOMP_STRIDE]], i32 1, i32 1)
7220 // CHECK11-NEXT: [[TMP4:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4
7221 // CHECK11-NEXT: [[CMP:%.*]] = icmp sgt i32 [[TMP4]], 99
7222 // CHECK11-NEXT: br i1 [[CMP]], label [[COND_TRUE:%.*]], label [[COND_FALSE:%.*]]
7223 // CHECK11: cond.true:
7224 // CHECK11-NEXT: br label [[COND_END:%.*]]
7225 // CHECK11: cond.false:
7226 // CHECK11-NEXT: [[TMP5:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4
7227 // CHECK11-NEXT: br label [[COND_END]]
7228 // CHECK11: cond.end:
7229 // CHECK11-NEXT: [[COND:%.*]] = phi i32 [ 99, [[COND_TRUE]] ], [ [[TMP5]], [[COND_FALSE]] ]
7230 // CHECK11-NEXT: store i32 [[COND]], ptr [[DOTOMP_UB]], align 4
7231 // CHECK11-NEXT: [[TMP6:%.*]] = load i32, ptr [[DOTOMP_LB]], align 4
7232 // CHECK11-NEXT: store i32 [[TMP6]], ptr [[DOTOMP_IV]], align 4
7233 // CHECK11-NEXT: br label [[OMP_INNER_FOR_COND:%.*]]
7234 // CHECK11: omp.inner.for.cond:
7235 // CHECK11-NEXT: [[TMP7:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP50:![0-9]+]]
7236 // CHECK11-NEXT: [[TMP8:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4, !llvm.access.group [[ACC_GRP50]]
7237 // CHECK11-NEXT: [[CMP2:%.*]] = icmp sle i32 [[TMP7]], [[TMP8]]
7238 // CHECK11-NEXT: br i1 [[CMP2]], label [[OMP_INNER_FOR_BODY:%.*]], label [[OMP_INNER_FOR_END:%.*]]
7239 // CHECK11: omp.inner.for.body:
7240 // CHECK11-NEXT: [[TMP9:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP50]]
7241 // CHECK11-NEXT: [[MUL:%.*]] = mul nsw i32 [[TMP9]], 1
7242 // CHECK11-NEXT: [[ADD:%.*]] = add nsw i32 0, [[MUL]]
7243 // CHECK11-NEXT: store i32 [[ADD]], ptr [[I]], align 4, !llvm.access.group [[ACC_GRP50]]
7244 // CHECK11-NEXT: call void @_Z3fn1v(), !llvm.access.group [[ACC_GRP50]]
7245 // CHECK11-NEXT: br label [[OMP_BODY_CONTINUE:%.*]]
7246 // CHECK11: omp.body.continue:
7247 // CHECK11-NEXT: br label [[OMP_INNER_FOR_INC:%.*]]
7248 // CHECK11: omp.inner.for.inc:
7249 // CHECK11-NEXT: [[TMP10:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP50]]
7250 // CHECK11-NEXT: [[ADD3:%.*]] = add nsw i32 [[TMP10]], 1
7251 // CHECK11-NEXT: store i32 [[ADD3]], ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP50]]
7252 // CHECK11-NEXT: br label [[OMP_INNER_FOR_COND]], !llvm.loop [[LOOP51:![0-9]+]]
7253 // CHECK11: omp.inner.for.end:
7254 // CHECK11-NEXT: br label [[OMP_LOOP_EXIT:%.*]]
7255 // CHECK11: omp.loop.exit:
7256 // CHECK11-NEXT: call void @__kmpc_for_static_fini(ptr @[[GLOB1]], i32 [[TMP3]])
7257 // CHECK11-NEXT: [[TMP11:%.*]] = load i32, ptr [[DOTOMP_IS_LAST]], align 4
7258 // CHECK11-NEXT: [[TMP12:%.*]] = icmp ne i32 [[TMP11]], 0
7259 // CHECK11-NEXT: br i1 [[TMP12]], label [[DOTOMP_FINAL_THEN:%.*]], label [[DOTOMP_FINAL_DONE:%.*]]
7260 // CHECK11: .omp.final.then:
7261 // CHECK11-NEXT: store i32 100, ptr [[I]], align 4
7262 // CHECK11-NEXT: br label [[DOTOMP_FINAL_DONE]]
7263 // CHECK11: .omp.final.done:
7264 // CHECK11-NEXT: ret void
7267 // CHECK11-LABEL: define {{[^@]+}}@{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z5tmainIiEiT__l65
7268 // CHECK11-SAME: () #[[ATTR1]] {
7269 // CHECK11-NEXT: entry:
7270 // CHECK11-NEXT: call void (ptr, i32, ptr, ...) @__kmpc_fork_teams(ptr @[[GLOB3]], i32 0, ptr @{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z5tmainIiEiT__l65.omp_outlined)
7271 // CHECK11-NEXT: ret void
7274 // CHECK11-LABEL: define {{[^@]+}}@{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z5tmainIiEiT__l65.omp_outlined
7275 // CHECK11-SAME: (ptr noalias noundef [[DOTGLOBAL_TID_:%.*]], ptr noalias noundef [[DOTBOUND_TID_:%.*]]) #[[ATTR1]] {
7276 // CHECK11-NEXT: entry:
7277 // CHECK11-NEXT: [[DOTGLOBAL_TID__ADDR:%.*]] = alloca ptr, align 8
7278 // CHECK11-NEXT: [[DOTBOUND_TID__ADDR:%.*]] = alloca ptr, align 8
7279 // CHECK11-NEXT: [[DOTOMP_IV:%.*]] = alloca i32, align 4
7280 // CHECK11-NEXT: [[TMP:%.*]] = alloca i32, align 4
7281 // CHECK11-NEXT: [[DOTOMP_COMB_LB:%.*]] = alloca i32, align 4
7282 // CHECK11-NEXT: [[DOTOMP_COMB_UB:%.*]] = alloca i32, align 4
7283 // CHECK11-NEXT: [[DOTOMP_STRIDE:%.*]] = alloca i32, align 4
7284 // CHECK11-NEXT: [[DOTOMP_IS_LAST:%.*]] = alloca i32, align 4
7285 // CHECK11-NEXT: [[I:%.*]] = alloca i32, align 4
7286 // CHECK11-NEXT: [[DOTBOUND_ZERO_ADDR:%.*]] = alloca i32, align 4
7287 // CHECK11-NEXT: store ptr [[DOTGLOBAL_TID_]], ptr [[DOTGLOBAL_TID__ADDR]], align 8
7288 // CHECK11-NEXT: store ptr [[DOTBOUND_TID_]], ptr [[DOTBOUND_TID__ADDR]], align 8
7289 // CHECK11-NEXT: store i32 0, ptr [[DOTOMP_COMB_LB]], align 4
7290 // CHECK11-NEXT: store i32 99, ptr [[DOTOMP_COMB_UB]], align 4
7291 // CHECK11-NEXT: store i32 1, ptr [[DOTOMP_STRIDE]], align 4
7292 // CHECK11-NEXT: store i32 0, ptr [[DOTOMP_IS_LAST]], align 4
7293 // CHECK11-NEXT: [[TMP0:%.*]] = load ptr, ptr [[DOTGLOBAL_TID__ADDR]], align 8
7294 // CHECK11-NEXT: [[TMP1:%.*]] = load i32, ptr [[TMP0]], align 4
7295 // CHECK11-NEXT: call void @__kmpc_for_static_init_4(ptr @[[GLOB1]], i32 [[TMP1]], i32 92, ptr [[DOTOMP_IS_LAST]], ptr [[DOTOMP_COMB_LB]], ptr [[DOTOMP_COMB_UB]], ptr [[DOTOMP_STRIDE]], i32 1, i32 1)
7296 // CHECK11-NEXT: [[TMP2:%.*]] = load i32, ptr [[DOTOMP_COMB_UB]], align 4
7297 // CHECK11-NEXT: [[CMP:%.*]] = icmp sgt i32 [[TMP2]], 99
7298 // CHECK11-NEXT: br i1 [[CMP]], label [[COND_TRUE:%.*]], label [[COND_FALSE:%.*]]
7299 // CHECK11: cond.true:
7300 // CHECK11-NEXT: br label [[COND_END:%.*]]
7301 // CHECK11: cond.false:
7302 // CHECK11-NEXT: [[TMP3:%.*]] = load i32, ptr [[DOTOMP_COMB_UB]], align 4
7303 // CHECK11-NEXT: br label [[COND_END]]
7304 // CHECK11: cond.end:
7305 // CHECK11-NEXT: [[COND:%.*]] = phi i32 [ 99, [[COND_TRUE]] ], [ [[TMP3]], [[COND_FALSE]] ]
7306 // CHECK11-NEXT: store i32 [[COND]], ptr [[DOTOMP_COMB_UB]], align 4
7307 // CHECK11-NEXT: [[TMP4:%.*]] = load i32, ptr [[DOTOMP_COMB_LB]], align 4
7308 // CHECK11-NEXT: store i32 [[TMP4]], ptr [[DOTOMP_IV]], align 4
7309 // CHECK11-NEXT: br label [[OMP_INNER_FOR_COND:%.*]]
7310 // CHECK11: omp.inner.for.cond:
7311 // CHECK11-NEXT: [[TMP5:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4
7312 // CHECK11-NEXT: [[TMP6:%.*]] = load i32, ptr [[DOTOMP_COMB_UB]], align 4
7313 // CHECK11-NEXT: [[CMP1:%.*]] = icmp sle i32 [[TMP5]], [[TMP6]]
7314 // CHECK11-NEXT: br i1 [[CMP1]], label [[OMP_INNER_FOR_BODY:%.*]], label [[OMP_INNER_FOR_END:%.*]]
7315 // CHECK11: omp.inner.for.body:
7316 // CHECK11-NEXT: [[TMP7:%.*]] = load i32, ptr [[DOTOMP_COMB_LB]], align 4
7317 // CHECK11-NEXT: [[TMP8:%.*]] = zext i32 [[TMP7]] to i64
7318 // CHECK11-NEXT: [[TMP9:%.*]] = load i32, ptr [[DOTOMP_COMB_UB]], align 4
7319 // CHECK11-NEXT: [[TMP10:%.*]] = zext i32 [[TMP9]] to i64
7320 // CHECK11-NEXT: call void @__kmpc_serialized_parallel(ptr @[[GLOB3]], i32 [[TMP1]])
7321 // CHECK11-NEXT: [[TMP11:%.*]] = load ptr, ptr [[DOTGLOBAL_TID__ADDR]], align 8
7322 // CHECK11-NEXT: store i32 0, ptr [[DOTBOUND_ZERO_ADDR]], align 4
7323 // CHECK11-NEXT: call void @{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z5tmainIiEiT__l65.omp_outlined.omp_outlined(ptr [[TMP11]], ptr [[DOTBOUND_ZERO_ADDR]], i64 [[TMP8]], i64 [[TMP10]]) #[[ATTR2]]
7324 // CHECK11-NEXT: call void @__kmpc_end_serialized_parallel(ptr @[[GLOB3]], i32 [[TMP1]])
7325 // CHECK11-NEXT: br label [[OMP_INNER_FOR_INC:%.*]]
7326 // CHECK11: omp.inner.for.inc:
7327 // CHECK11-NEXT: [[TMP12:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4
7328 // CHECK11-NEXT: [[TMP13:%.*]] = load i32, ptr [[DOTOMP_STRIDE]], align 4
7329 // CHECK11-NEXT: [[ADD:%.*]] = add nsw i32 [[TMP12]], [[TMP13]]
7330 // CHECK11-NEXT: store i32 [[ADD]], ptr [[DOTOMP_IV]], align 4
7331 // CHECK11-NEXT: br label [[OMP_INNER_FOR_COND]], !llvm.loop [[LOOP53:![0-9]+]]
7332 // CHECK11: omp.inner.for.end:
7333 // CHECK11-NEXT: br label [[OMP_LOOP_EXIT:%.*]]
7334 // CHECK11: omp.loop.exit:
7335 // CHECK11-NEXT: call void @__kmpc_for_static_fini(ptr @[[GLOB1]], i32 [[TMP1]])
7336 // CHECK11-NEXT: [[TMP14:%.*]] = load i32, ptr [[DOTOMP_IS_LAST]], align 4
7337 // CHECK11-NEXT: [[TMP15:%.*]] = icmp ne i32 [[TMP14]], 0
7338 // CHECK11-NEXT: br i1 [[TMP15]], label [[DOTOMP_FINAL_THEN:%.*]], label [[DOTOMP_FINAL_DONE:%.*]]
7339 // CHECK11: .omp.final.then:
7340 // CHECK11-NEXT: store i32 100, ptr [[I]], align 4
7341 // CHECK11-NEXT: br label [[DOTOMP_FINAL_DONE]]
7342 // CHECK11: .omp.final.done:
7343 // CHECK11-NEXT: ret void
7346 // CHECK11-LABEL: define {{[^@]+}}@{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z5tmainIiEiT__l65.omp_outlined.omp_outlined
7347 // CHECK11-SAME: (ptr noalias noundef [[DOTGLOBAL_TID_:%.*]], ptr noalias noundef [[DOTBOUND_TID_:%.*]], i64 noundef [[DOTPREVIOUS_LB_:%.*]], i64 noundef [[DOTPREVIOUS_UB_:%.*]]) #[[ATTR1]] {
7348 // CHECK11-NEXT: entry:
7349 // CHECK11-NEXT: [[DOTGLOBAL_TID__ADDR:%.*]] = alloca ptr, align 8
7350 // CHECK11-NEXT: [[DOTBOUND_TID__ADDR:%.*]] = alloca ptr, align 8
7351 // CHECK11-NEXT: [[DOTPREVIOUS_LB__ADDR:%.*]] = alloca i64, align 8
7352 // CHECK11-NEXT: [[DOTPREVIOUS_UB__ADDR:%.*]] = alloca i64, align 8
7353 // CHECK11-NEXT: [[DOTOMP_IV:%.*]] = alloca i32, align 4
7354 // CHECK11-NEXT: [[TMP:%.*]] = alloca i32, align 4
7355 // CHECK11-NEXT: [[DOTOMP_LB:%.*]] = alloca i32, align 4
7356 // CHECK11-NEXT: [[DOTOMP_UB:%.*]] = alloca i32, align 4
7357 // CHECK11-NEXT: [[DOTOMP_STRIDE:%.*]] = alloca i32, align 4
7358 // CHECK11-NEXT: [[DOTOMP_IS_LAST:%.*]] = alloca i32, align 4
7359 // CHECK11-NEXT: [[I:%.*]] = alloca i32, align 4
7360 // CHECK11-NEXT: store ptr [[DOTGLOBAL_TID_]], ptr [[DOTGLOBAL_TID__ADDR]], align 8
7361 // CHECK11-NEXT: store ptr [[DOTBOUND_TID_]], ptr [[DOTBOUND_TID__ADDR]], align 8
7362 // CHECK11-NEXT: store i64 [[DOTPREVIOUS_LB_]], ptr [[DOTPREVIOUS_LB__ADDR]], align 8
7363 // CHECK11-NEXT: store i64 [[DOTPREVIOUS_UB_]], ptr [[DOTPREVIOUS_UB__ADDR]], align 8
7364 // CHECK11-NEXT: store i32 0, ptr [[DOTOMP_LB]], align 4
7365 // CHECK11-NEXT: store i32 99, ptr [[DOTOMP_UB]], align 4
7366 // CHECK11-NEXT: [[TMP0:%.*]] = load i64, ptr [[DOTPREVIOUS_LB__ADDR]], align 8
7367 // CHECK11-NEXT: [[CONV:%.*]] = trunc i64 [[TMP0]] to i32
7368 // CHECK11-NEXT: [[TMP1:%.*]] = load i64, ptr [[DOTPREVIOUS_UB__ADDR]], align 8
7369 // CHECK11-NEXT: [[CONV1:%.*]] = trunc i64 [[TMP1]] to i32
7370 // CHECK11-NEXT: store i32 [[CONV]], ptr [[DOTOMP_LB]], align 4
7371 // CHECK11-NEXT: store i32 [[CONV1]], ptr [[DOTOMP_UB]], align 4
7372 // CHECK11-NEXT: store i32 1, ptr [[DOTOMP_STRIDE]], align 4
7373 // CHECK11-NEXT: store i32 0, ptr [[DOTOMP_IS_LAST]], align 4
7374 // CHECK11-NEXT: [[TMP2:%.*]] = load ptr, ptr [[DOTGLOBAL_TID__ADDR]], align 8
7375 // CHECK11-NEXT: [[TMP3:%.*]] = load i32, ptr [[TMP2]], align 4
7376 // CHECK11-NEXT: call void @__kmpc_for_static_init_4(ptr @[[GLOB2]], i32 [[TMP3]], i32 34, ptr [[DOTOMP_IS_LAST]], ptr [[DOTOMP_LB]], ptr [[DOTOMP_UB]], ptr [[DOTOMP_STRIDE]], i32 1, i32 1)
7377 // CHECK11-NEXT: [[TMP4:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4
7378 // CHECK11-NEXT: [[CMP:%.*]] = icmp sgt i32 [[TMP4]], 99
7379 // CHECK11-NEXT: br i1 [[CMP]], label [[COND_TRUE:%.*]], label [[COND_FALSE:%.*]]
7380 // CHECK11: cond.true:
7381 // CHECK11-NEXT: br label [[COND_END:%.*]]
7382 // CHECK11: cond.false:
7383 // CHECK11-NEXT: [[TMP5:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4
7384 // CHECK11-NEXT: br label [[COND_END]]
7385 // CHECK11: cond.end:
7386 // CHECK11-NEXT: [[COND:%.*]] = phi i32 [ 99, [[COND_TRUE]] ], [ [[TMP5]], [[COND_FALSE]] ]
7387 // CHECK11-NEXT: store i32 [[COND]], ptr [[DOTOMP_UB]], align 4
7388 // CHECK11-NEXT: [[TMP6:%.*]] = load i32, ptr [[DOTOMP_LB]], align 4
7389 // CHECK11-NEXT: store i32 [[TMP6]], ptr [[DOTOMP_IV]], align 4
7390 // CHECK11-NEXT: br label [[OMP_INNER_FOR_COND:%.*]]
7391 // CHECK11: omp.inner.for.cond:
7392 // CHECK11-NEXT: [[TMP7:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4
7393 // CHECK11-NEXT: [[TMP8:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4
7394 // CHECK11-NEXT: [[CMP2:%.*]] = icmp sle i32 [[TMP7]], [[TMP8]]
7395 // CHECK11-NEXT: br i1 [[CMP2]], label [[OMP_INNER_FOR_BODY:%.*]], label [[OMP_INNER_FOR_END:%.*]]
7396 // CHECK11: omp.inner.for.body:
7397 // CHECK11-NEXT: [[TMP9:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4
7398 // CHECK11-NEXT: [[MUL:%.*]] = mul nsw i32 [[TMP9]], 1
7399 // CHECK11-NEXT: [[ADD:%.*]] = add nsw i32 0, [[MUL]]
7400 // CHECK11-NEXT: store i32 [[ADD]], ptr [[I]], align 4
7401 // CHECK11-NEXT: call void @_Z3fn2v()
7402 // CHECK11-NEXT: br label [[OMP_BODY_CONTINUE:%.*]]
7403 // CHECK11: omp.body.continue:
7404 // CHECK11-NEXT: br label [[OMP_INNER_FOR_INC:%.*]]
7405 // CHECK11: omp.inner.for.inc:
7406 // CHECK11-NEXT: [[TMP10:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4
7407 // CHECK11-NEXT: [[ADD3:%.*]] = add nsw i32 [[TMP10]], 1
7408 // CHECK11-NEXT: store i32 [[ADD3]], ptr [[DOTOMP_IV]], align 4
7409 // CHECK11-NEXT: br label [[OMP_INNER_FOR_COND]], !llvm.loop [[LOOP54:![0-9]+]]
7410 // CHECK11: omp.inner.for.end:
7411 // CHECK11-NEXT: br label [[OMP_LOOP_EXIT:%.*]]
7412 // CHECK11: omp.loop.exit:
7413 // CHECK11-NEXT: call void @__kmpc_for_static_fini(ptr @[[GLOB1]], i32 [[TMP3]])
7414 // CHECK11-NEXT: [[TMP11:%.*]] = load i32, ptr [[DOTOMP_IS_LAST]], align 4
7415 // CHECK11-NEXT: [[TMP12:%.*]] = icmp ne i32 [[TMP11]], 0
7416 // CHECK11-NEXT: br i1 [[TMP12]], label [[DOTOMP_FINAL_THEN:%.*]], label [[DOTOMP_FINAL_DONE:%.*]]
7417 // CHECK11: .omp.final.then:
7418 // CHECK11-NEXT: store i32 100, ptr [[I]], align 4
7419 // CHECK11-NEXT: br label [[DOTOMP_FINAL_DONE]]
7420 // CHECK11: .omp.final.done:
7421 // CHECK11-NEXT: ret void
7424 // CHECK11-LABEL: define {{[^@]+}}@{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z5tmainIiEiT__l71
7425 // CHECK11-SAME: (i64 noundef [[ARG:%.*]]) #[[ATTR1]] {
7426 // CHECK11-NEXT: entry:
7427 // CHECK11-NEXT: [[ARG_ADDR:%.*]] = alloca i64, align 8
7428 // CHECK11-NEXT: store i64 [[ARG]], ptr [[ARG_ADDR]], align 8
7429 // CHECK11-NEXT: call void (ptr, i32, ptr, ...) @__kmpc_fork_teams(ptr @[[GLOB3]], i32 1, ptr @{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z5tmainIiEiT__l71.omp_outlined, ptr [[ARG_ADDR]])
7430 // CHECK11-NEXT: ret void
7433 // CHECK11-LABEL: define {{[^@]+}}@{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z5tmainIiEiT__l71.omp_outlined
7434 // CHECK11-SAME: (ptr noalias noundef [[DOTGLOBAL_TID_:%.*]], ptr noalias noundef [[DOTBOUND_TID_:%.*]], ptr noundef nonnull align 4 dereferenceable(4) [[ARG:%.*]]) #[[ATTR1]] {
7435 // CHECK11-NEXT: entry:
7436 // CHECK11-NEXT: [[DOTGLOBAL_TID__ADDR:%.*]] = alloca ptr, align 8
7437 // CHECK11-NEXT: [[DOTBOUND_TID__ADDR:%.*]] = alloca ptr, align 8
7438 // CHECK11-NEXT: [[ARG_ADDR:%.*]] = alloca ptr, align 8
7439 // CHECK11-NEXT: [[DOTOMP_IV:%.*]] = alloca i32, align 4
7440 // CHECK11-NEXT: [[TMP:%.*]] = alloca i32, align 4
7441 // CHECK11-NEXT: [[DOTOMP_COMB_LB:%.*]] = alloca i32, align 4
7442 // CHECK11-NEXT: [[DOTOMP_COMB_UB:%.*]] = alloca i32, align 4
7443 // CHECK11-NEXT: [[DOTOMP_STRIDE:%.*]] = alloca i32, align 4
7444 // CHECK11-NEXT: [[DOTOMP_IS_LAST:%.*]] = alloca i32, align 4
7445 // CHECK11-NEXT: [[I:%.*]] = alloca i32, align 4
7446 // CHECK11-NEXT: [[DOTBOUND_ZERO_ADDR:%.*]] = alloca i32, align 4
7447 // CHECK11-NEXT: store ptr [[DOTGLOBAL_TID_]], ptr [[DOTGLOBAL_TID__ADDR]], align 8
7448 // CHECK11-NEXT: store ptr [[DOTBOUND_TID_]], ptr [[DOTBOUND_TID__ADDR]], align 8
7449 // CHECK11-NEXT: store ptr [[ARG]], ptr [[ARG_ADDR]], align 8
7450 // CHECK11-NEXT: [[TMP0:%.*]] = load ptr, ptr [[ARG_ADDR]], align 8
7451 // CHECK11-NEXT: store i32 0, ptr [[DOTOMP_COMB_LB]], align 4
7452 // CHECK11-NEXT: store i32 99, ptr [[DOTOMP_COMB_UB]], align 4
7453 // CHECK11-NEXT: store i32 1, ptr [[DOTOMP_STRIDE]], align 4
7454 // CHECK11-NEXT: store i32 0, ptr [[DOTOMP_IS_LAST]], align 4
7455 // CHECK11-NEXT: [[TMP1:%.*]] = load ptr, ptr [[DOTGLOBAL_TID__ADDR]], align 8
7456 // CHECK11-NEXT: [[TMP2:%.*]] = load i32, ptr [[TMP1]], align 4
7457 // CHECK11-NEXT: call void @__kmpc_for_static_init_4(ptr @[[GLOB1]], i32 [[TMP2]], i32 92, ptr [[DOTOMP_IS_LAST]], ptr [[DOTOMP_COMB_LB]], ptr [[DOTOMP_COMB_UB]], ptr [[DOTOMP_STRIDE]], i32 1, i32 1)
7458 // CHECK11-NEXT: [[TMP3:%.*]] = load i32, ptr [[DOTOMP_COMB_UB]], align 4
7459 // CHECK11-NEXT: [[CMP:%.*]] = icmp sgt i32 [[TMP3]], 99
7460 // CHECK11-NEXT: br i1 [[CMP]], label [[COND_TRUE:%.*]], label [[COND_FALSE:%.*]]
7461 // CHECK11: cond.true:
7462 // CHECK11-NEXT: br label [[COND_END:%.*]]
7463 // CHECK11: cond.false:
7464 // CHECK11-NEXT: [[TMP4:%.*]] = load i32, ptr [[DOTOMP_COMB_UB]], align 4
7465 // CHECK11-NEXT: br label [[COND_END]]
7466 // CHECK11: cond.end:
7467 // CHECK11-NEXT: [[COND:%.*]] = phi i32 [ 99, [[COND_TRUE]] ], [ [[TMP4]], [[COND_FALSE]] ]
7468 // CHECK11-NEXT: store i32 [[COND]], ptr [[DOTOMP_COMB_UB]], align 4
7469 // CHECK11-NEXT: [[TMP5:%.*]] = load i32, ptr [[DOTOMP_COMB_LB]], align 4
7470 // CHECK11-NEXT: store i32 [[TMP5]], ptr [[DOTOMP_IV]], align 4
7471 // CHECK11-NEXT: br label [[OMP_INNER_FOR_COND:%.*]]
7472 // CHECK11: omp.inner.for.cond:
7473 // CHECK11-NEXT: [[TMP6:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP55:![0-9]+]]
7474 // CHECK11-NEXT: [[TMP7:%.*]] = load i32, ptr [[DOTOMP_COMB_UB]], align 4, !llvm.access.group [[ACC_GRP55]]
7475 // CHECK11-NEXT: [[CMP1:%.*]] = icmp sle i32 [[TMP6]], [[TMP7]]
7476 // CHECK11-NEXT: br i1 [[CMP1]], label [[OMP_INNER_FOR_BODY:%.*]], label [[OMP_INNER_FOR_END:%.*]]
7477 // CHECK11: omp.inner.for.body:
7478 // CHECK11-NEXT: [[TMP8:%.*]] = load i32, ptr [[DOTOMP_COMB_LB]], align 4, !llvm.access.group [[ACC_GRP55]]
7479 // CHECK11-NEXT: [[TMP9:%.*]] = zext i32 [[TMP8]] to i64
7480 // CHECK11-NEXT: [[TMP10:%.*]] = load i32, ptr [[DOTOMP_COMB_UB]], align 4, !llvm.access.group [[ACC_GRP55]]
7481 // CHECK11-NEXT: [[TMP11:%.*]] = zext i32 [[TMP10]] to i64
7482 // CHECK11-NEXT: [[TMP12:%.*]] = load i32, ptr [[TMP0]], align 4, !llvm.access.group [[ACC_GRP55]]
7483 // CHECK11-NEXT: [[TOBOOL:%.*]] = icmp ne i32 [[TMP12]], 0
7484 // CHECK11-NEXT: br i1 [[TOBOOL]], label [[OMP_IF_THEN:%.*]], label [[OMP_IF_ELSE:%.*]]
7485 // CHECK11: omp_if.then:
7486 // CHECK11-NEXT: call void (ptr, i32, ptr, ...) @__kmpc_fork_call(ptr @[[GLOB3]], i32 2, ptr @{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z5tmainIiEiT__l71.omp_outlined.omp_outlined, i64 [[TMP9]], i64 [[TMP11]]), !llvm.access.group [[ACC_GRP55]]
7487 // CHECK11-NEXT: br label [[OMP_IF_END:%.*]]
7488 // CHECK11: omp_if.else:
7489 // CHECK11-NEXT: call void @__kmpc_serialized_parallel(ptr @[[GLOB3]], i32 [[TMP2]]), !llvm.access.group [[ACC_GRP55]]
7490 // CHECK11-NEXT: [[TMP13:%.*]] = load ptr, ptr [[DOTGLOBAL_TID__ADDR]], align 8, !llvm.access.group [[ACC_GRP55]]
7491 // CHECK11-NEXT: store i32 0, ptr [[DOTBOUND_ZERO_ADDR]], align 4, !llvm.access.group [[ACC_GRP55]]
7492 // CHECK11-NEXT: call void @{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z5tmainIiEiT__l71.omp_outlined.omp_outlined(ptr [[TMP13]], ptr [[DOTBOUND_ZERO_ADDR]], i64 [[TMP9]], i64 [[TMP11]]) #[[ATTR2]], !llvm.access.group [[ACC_GRP55]]
7493 // CHECK11-NEXT: call void @__kmpc_end_serialized_parallel(ptr @[[GLOB3]], i32 [[TMP2]]), !llvm.access.group [[ACC_GRP55]]
7494 // CHECK11-NEXT: br label [[OMP_IF_END]]
7495 // CHECK11: omp_if.end:
7496 // CHECK11-NEXT: br label [[OMP_INNER_FOR_INC:%.*]]
7497 // CHECK11: omp.inner.for.inc:
7498 // CHECK11-NEXT: [[TMP14:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP55]]
7499 // CHECK11-NEXT: [[TMP15:%.*]] = load i32, ptr [[DOTOMP_STRIDE]], align 4, !llvm.access.group [[ACC_GRP55]]
7500 // CHECK11-NEXT: [[ADD:%.*]] = add nsw i32 [[TMP14]], [[TMP15]]
7501 // CHECK11-NEXT: store i32 [[ADD]], ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP55]]
7502 // CHECK11-NEXT: br label [[OMP_INNER_FOR_COND]], !llvm.loop [[LOOP56:![0-9]+]]
7503 // CHECK11: omp.inner.for.end:
7504 // CHECK11-NEXT: br label [[OMP_LOOP_EXIT:%.*]]
7505 // CHECK11: omp.loop.exit:
7506 // CHECK11-NEXT: call void @__kmpc_for_static_fini(ptr @[[GLOB1]], i32 [[TMP2]])
7507 // CHECK11-NEXT: [[TMP16:%.*]] = load i32, ptr [[DOTOMP_IS_LAST]], align 4
7508 // CHECK11-NEXT: [[TMP17:%.*]] = icmp ne i32 [[TMP16]], 0
7509 // CHECK11-NEXT: br i1 [[TMP17]], label [[DOTOMP_FINAL_THEN:%.*]], label [[DOTOMP_FINAL_DONE:%.*]]
7510 // CHECK11: .omp.final.then:
7511 // CHECK11-NEXT: store i32 100, ptr [[I]], align 4
7512 // CHECK11-NEXT: br label [[DOTOMP_FINAL_DONE]]
7513 // CHECK11: .omp.final.done:
7514 // CHECK11-NEXT: ret void
7517 // CHECK11-LABEL: define {{[^@]+}}@{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z5tmainIiEiT__l71.omp_outlined.omp_outlined
7518 // CHECK11-SAME: (ptr noalias noundef [[DOTGLOBAL_TID_:%.*]], ptr noalias noundef [[DOTBOUND_TID_:%.*]], i64 noundef [[DOTPREVIOUS_LB_:%.*]], i64 noundef [[DOTPREVIOUS_UB_:%.*]]) #[[ATTR1]] {
7519 // CHECK11-NEXT: entry:
7520 // CHECK11-NEXT: [[DOTGLOBAL_TID__ADDR:%.*]] = alloca ptr, align 8
7521 // CHECK11-NEXT: [[DOTBOUND_TID__ADDR:%.*]] = alloca ptr, align 8
7522 // CHECK11-NEXT: [[DOTPREVIOUS_LB__ADDR:%.*]] = alloca i64, align 8
7523 // CHECK11-NEXT: [[DOTPREVIOUS_UB__ADDR:%.*]] = alloca i64, align 8
7524 // CHECK11-NEXT: [[DOTOMP_IV:%.*]] = alloca i32, align 4
7525 // CHECK11-NEXT: [[TMP:%.*]] = alloca i32, align 4
7526 // CHECK11-NEXT: [[DOTOMP_LB:%.*]] = alloca i32, align 4
7527 // CHECK11-NEXT: [[DOTOMP_UB:%.*]] = alloca i32, align 4
7528 // CHECK11-NEXT: [[DOTOMP_STRIDE:%.*]] = alloca i32, align 4
7529 // CHECK11-NEXT: [[DOTOMP_IS_LAST:%.*]] = alloca i32, align 4
7530 // CHECK11-NEXT: [[I:%.*]] = alloca i32, align 4
7531 // CHECK11-NEXT: store ptr [[DOTGLOBAL_TID_]], ptr [[DOTGLOBAL_TID__ADDR]], align 8
7532 // CHECK11-NEXT: store ptr [[DOTBOUND_TID_]], ptr [[DOTBOUND_TID__ADDR]], align 8
7533 // CHECK11-NEXT: store i64 [[DOTPREVIOUS_LB_]], ptr [[DOTPREVIOUS_LB__ADDR]], align 8
7534 // CHECK11-NEXT: store i64 [[DOTPREVIOUS_UB_]], ptr [[DOTPREVIOUS_UB__ADDR]], align 8
7535 // CHECK11-NEXT: store i32 0, ptr [[DOTOMP_LB]], align 4
7536 // CHECK11-NEXT: store i32 99, ptr [[DOTOMP_UB]], align 4
7537 // CHECK11-NEXT: [[TMP0:%.*]] = load i64, ptr [[DOTPREVIOUS_LB__ADDR]], align 8
7538 // CHECK11-NEXT: [[CONV:%.*]] = trunc i64 [[TMP0]] to i32
7539 // CHECK11-NEXT: [[TMP1:%.*]] = load i64, ptr [[DOTPREVIOUS_UB__ADDR]], align 8
7540 // CHECK11-NEXT: [[CONV1:%.*]] = trunc i64 [[TMP1]] to i32
7541 // CHECK11-NEXT: store i32 [[CONV]], ptr [[DOTOMP_LB]], align 4
7542 // CHECK11-NEXT: store i32 [[CONV1]], ptr [[DOTOMP_UB]], align 4
7543 // CHECK11-NEXT: store i32 1, ptr [[DOTOMP_STRIDE]], align 4
7544 // CHECK11-NEXT: store i32 0, ptr [[DOTOMP_IS_LAST]], align 4
7545 // CHECK11-NEXT: [[TMP2:%.*]] = load ptr, ptr [[DOTGLOBAL_TID__ADDR]], align 8
7546 // CHECK11-NEXT: [[TMP3:%.*]] = load i32, ptr [[TMP2]], align 4
7547 // CHECK11-NEXT: call void @__kmpc_for_static_init_4(ptr @[[GLOB2]], i32 [[TMP3]], i32 34, ptr [[DOTOMP_IS_LAST]], ptr [[DOTOMP_LB]], ptr [[DOTOMP_UB]], ptr [[DOTOMP_STRIDE]], i32 1, i32 1)
7548 // CHECK11-NEXT: [[TMP4:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4
7549 // CHECK11-NEXT: [[CMP:%.*]] = icmp sgt i32 [[TMP4]], 99
7550 // CHECK11-NEXT: br i1 [[CMP]], label [[COND_TRUE:%.*]], label [[COND_FALSE:%.*]]
7551 // CHECK11: cond.true:
7552 // CHECK11-NEXT: br label [[COND_END:%.*]]
7553 // CHECK11: cond.false:
7554 // CHECK11-NEXT: [[TMP5:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4
7555 // CHECK11-NEXT: br label [[COND_END]]
7556 // CHECK11: cond.end:
7557 // CHECK11-NEXT: [[COND:%.*]] = phi i32 [ 99, [[COND_TRUE]] ], [ [[TMP5]], [[COND_FALSE]] ]
7558 // CHECK11-NEXT: store i32 [[COND]], ptr [[DOTOMP_UB]], align 4
7559 // CHECK11-NEXT: [[TMP6:%.*]] = load i32, ptr [[DOTOMP_LB]], align 4
7560 // CHECK11-NEXT: store i32 [[TMP6]], ptr [[DOTOMP_IV]], align 4
7561 // CHECK11-NEXT: br label [[OMP_INNER_FOR_COND:%.*]]
7562 // CHECK11: omp.inner.for.cond:
7563 // CHECK11-NEXT: [[TMP7:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP58:![0-9]+]]
7564 // CHECK11-NEXT: [[TMP8:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4, !llvm.access.group [[ACC_GRP58]]
7565 // CHECK11-NEXT: [[CMP2:%.*]] = icmp sle i32 [[TMP7]], [[TMP8]]
7566 // CHECK11-NEXT: br i1 [[CMP2]], label [[OMP_INNER_FOR_BODY:%.*]], label [[OMP_INNER_FOR_END:%.*]]
7567 // CHECK11: omp.inner.for.body:
7568 // CHECK11-NEXT: [[TMP9:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP58]]
7569 // CHECK11-NEXT: [[MUL:%.*]] = mul nsw i32 [[TMP9]], 1
7570 // CHECK11-NEXT: [[ADD:%.*]] = add nsw i32 0, [[MUL]]
7571 // CHECK11-NEXT: store i32 [[ADD]], ptr [[I]], align 4, !llvm.access.group [[ACC_GRP58]]
7572 // CHECK11-NEXT: call void @_Z3fn3v(), !llvm.access.group [[ACC_GRP58]]
7573 // CHECK11-NEXT: br label [[OMP_BODY_CONTINUE:%.*]]
7574 // CHECK11: omp.body.continue:
7575 // CHECK11-NEXT: br label [[OMP_INNER_FOR_INC:%.*]]
7576 // CHECK11: omp.inner.for.inc:
7577 // CHECK11-NEXT: [[TMP10:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP58]]
7578 // CHECK11-NEXT: [[ADD3:%.*]] = add nsw i32 [[TMP10]], 1
7579 // CHECK11-NEXT: store i32 [[ADD3]], ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP58]]
7580 // CHECK11-NEXT: br label [[OMP_INNER_FOR_COND]], !llvm.loop [[LOOP59:![0-9]+]]
7581 // CHECK11: omp.inner.for.end:
7582 // CHECK11-NEXT: br label [[OMP_LOOP_EXIT:%.*]]
7583 // CHECK11: omp.loop.exit:
7584 // CHECK11-NEXT: call void @__kmpc_for_static_fini(ptr @[[GLOB1]], i32 [[TMP3]])
7585 // CHECK11-NEXT: [[TMP11:%.*]] = load i32, ptr [[DOTOMP_IS_LAST]], align 4
7586 // CHECK11-NEXT: [[TMP12:%.*]] = icmp ne i32 [[TMP11]], 0
7587 // CHECK11-NEXT: br i1 [[TMP12]], label [[DOTOMP_FINAL_THEN:%.*]], label [[DOTOMP_FINAL_DONE:%.*]]
7588 // CHECK11: .omp.final.then:
7589 // CHECK11-NEXT: store i32 100, ptr [[I]], align 4
7590 // CHECK11-NEXT: br label [[DOTOMP_FINAL_DONE]]
7591 // CHECK11: .omp.final.done:
7592 // CHECK11-NEXT: ret void
7595 // CHECK11-LABEL: define {{[^@]+}}@.omp_offloading.requires_reg
7596 // CHECK11-SAME: () #[[ATTR5:[0-9]+]] {
7597 // CHECK11-NEXT: entry:
7598 // CHECK11-NEXT: call void @__tgt_register_requires(i64 1)
7599 // CHECK11-NEXT: ret void
7602 // CHECK13-LABEL: define {{[^@]+}}@_Z9gtid_testv
7603 // CHECK13-SAME: () #[[ATTR0:[0-9]+]] {
7604 // CHECK13-NEXT: entry:
7605 // CHECK13-NEXT: [[TMP:%.*]] = alloca i32, align 4
7606 // CHECK13-NEXT: [[DOTOMP_LB:%.*]] = alloca i32, align 4
7607 // CHECK13-NEXT: [[DOTOMP_UB:%.*]] = alloca i32, align 4
7608 // CHECK13-NEXT: [[DOTOMP_IV:%.*]] = alloca i32, align 4
7609 // CHECK13-NEXT: [[I:%.*]] = alloca i32, align 4
7610 // CHECK13-NEXT: [[_TMP2:%.*]] = alloca i32, align 4
7611 // CHECK13-NEXT: [[DOTOMP_LB3:%.*]] = alloca i32, align 4
7612 // CHECK13-NEXT: [[DOTOMP_UB4:%.*]] = alloca i32, align 4
7613 // CHECK13-NEXT: [[DOTOMP_IV5:%.*]] = alloca i32, align 4
7614 // CHECK13-NEXT: [[I6:%.*]] = alloca i32, align 4
7615 // CHECK13-NEXT: store i32 0, ptr [[DOTOMP_LB]], align 4
7616 // CHECK13-NEXT: store i32 99, ptr [[DOTOMP_UB]], align 4
7617 // CHECK13-NEXT: [[TMP0:%.*]] = load i32, ptr [[DOTOMP_LB]], align 4
7618 // CHECK13-NEXT: store i32 [[TMP0]], ptr [[DOTOMP_IV]], align 4
7619 // CHECK13-NEXT: br label [[OMP_INNER_FOR_COND:%.*]]
7620 // CHECK13: omp.inner.for.cond:
7621 // CHECK13-NEXT: [[TMP1:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP2:![0-9]+]]
7622 // CHECK13-NEXT: [[TMP2:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4, !llvm.access.group [[ACC_GRP2]]
7623 // CHECK13-NEXT: [[CMP:%.*]] = icmp sle i32 [[TMP1]], [[TMP2]]
7624 // CHECK13-NEXT: br i1 [[CMP]], label [[OMP_INNER_FOR_BODY:%.*]], label [[OMP_INNER_FOR_END:%.*]]
7625 // CHECK13: omp.inner.for.body:
7626 // CHECK13-NEXT: [[TMP3:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP2]]
7627 // CHECK13-NEXT: [[MUL:%.*]] = mul nsw i32 [[TMP3]], 1
7628 // CHECK13-NEXT: [[ADD:%.*]] = add nsw i32 0, [[MUL]]
7629 // CHECK13-NEXT: store i32 [[ADD]], ptr [[I]], align 4, !llvm.access.group [[ACC_GRP2]]
7630 // CHECK13-NEXT: br label [[OMP_BODY_CONTINUE:%.*]]
7631 // CHECK13: omp.body.continue:
7632 // CHECK13-NEXT: br label [[OMP_INNER_FOR_INC:%.*]]
7633 // CHECK13: omp.inner.for.inc:
7634 // CHECK13-NEXT: [[TMP4:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP2]]
7635 // CHECK13-NEXT: [[ADD1:%.*]] = add nsw i32 [[TMP4]], 1
7636 // CHECK13-NEXT: store i32 [[ADD1]], ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP2]]
7637 // CHECK13-NEXT: br label [[OMP_INNER_FOR_COND]], !llvm.loop [[LOOP3:![0-9]+]]
7638 // CHECK13: omp.inner.for.end:
7639 // CHECK13-NEXT: store i32 100, ptr [[I]], align 4
7640 // CHECK13-NEXT: store i32 0, ptr [[DOTOMP_LB3]], align 4
7641 // CHECK13-NEXT: store i32 99, ptr [[DOTOMP_UB4]], align 4
7642 // CHECK13-NEXT: [[TMP5:%.*]] = load i32, ptr [[DOTOMP_LB3]], align 4
7643 // CHECK13-NEXT: store i32 [[TMP5]], ptr [[DOTOMP_IV5]], align 4
7644 // CHECK13-NEXT: br label [[OMP_INNER_FOR_COND7:%.*]]
7645 // CHECK13: omp.inner.for.cond7:
7646 // CHECK13-NEXT: [[TMP6:%.*]] = load i32, ptr [[DOTOMP_IV5]], align 4, !llvm.access.group [[ACC_GRP6:![0-9]+]]
7647 // CHECK13-NEXT: [[TMP7:%.*]] = load i32, ptr [[DOTOMP_UB4]], align 4, !llvm.access.group [[ACC_GRP6]]
7648 // CHECK13-NEXT: [[CMP8:%.*]] = icmp sle i32 [[TMP6]], [[TMP7]]
7649 // CHECK13-NEXT: br i1 [[CMP8]], label [[OMP_INNER_FOR_BODY9:%.*]], label [[OMP_INNER_FOR_END15:%.*]]
7650 // CHECK13: omp.inner.for.body9:
7651 // CHECK13-NEXT: [[TMP8:%.*]] = load i32, ptr [[DOTOMP_IV5]], align 4, !llvm.access.group [[ACC_GRP6]]
7652 // CHECK13-NEXT: [[MUL10:%.*]] = mul nsw i32 [[TMP8]], 1
7653 // CHECK13-NEXT: [[ADD11:%.*]] = add nsw i32 0, [[MUL10]]
7654 // CHECK13-NEXT: store i32 [[ADD11]], ptr [[I6]], align 4, !llvm.access.group [[ACC_GRP6]]
7655 // CHECK13-NEXT: call void @_Z9gtid_testv(), !llvm.access.group [[ACC_GRP6]]
7656 // CHECK13-NEXT: br label [[OMP_BODY_CONTINUE12:%.*]]
7657 // CHECK13: omp.body.continue12:
7658 // CHECK13-NEXT: br label [[OMP_INNER_FOR_INC13:%.*]]
7659 // CHECK13: omp.inner.for.inc13:
7660 // CHECK13-NEXT: [[TMP9:%.*]] = load i32, ptr [[DOTOMP_IV5]], align 4, !llvm.access.group [[ACC_GRP6]]
7661 // CHECK13-NEXT: [[ADD14:%.*]] = add nsw i32 [[TMP9]], 1
7662 // CHECK13-NEXT: store i32 [[ADD14]], ptr [[DOTOMP_IV5]], align 4, !llvm.access.group [[ACC_GRP6]]
7663 // CHECK13-NEXT: br label [[OMP_INNER_FOR_COND7]], !llvm.loop [[LOOP7:![0-9]+]]
7664 // CHECK13: omp.inner.for.end15:
7665 // CHECK13-NEXT: store i32 100, ptr [[I6]], align 4
7666 // CHECK13-NEXT: ret void
7669 // CHECK13-LABEL: define {{[^@]+}}@main
7670 // CHECK13-SAME: () #[[ATTR1:[0-9]+]] {
7671 // CHECK13-NEXT: entry:
7672 // CHECK13-NEXT: [[RETVAL:%.*]] = alloca i32, align 4
7673 // CHECK13-NEXT: [[TMP:%.*]] = alloca i32, align 4
7674 // CHECK13-NEXT: [[DOTOMP_LB:%.*]] = alloca i32, align 4
7675 // CHECK13-NEXT: [[DOTOMP_UB:%.*]] = alloca i32, align 4
7676 // CHECK13-NEXT: [[DOTOMP_IV:%.*]] = alloca i32, align 4
7677 // CHECK13-NEXT: [[I:%.*]] = alloca i32, align 4
7678 // CHECK13-NEXT: [[_TMP2:%.*]] = alloca i32, align 4
7679 // CHECK13-NEXT: [[DOTOMP_LB3:%.*]] = alloca i32, align 4
7680 // CHECK13-NEXT: [[DOTOMP_UB4:%.*]] = alloca i32, align 4
7681 // CHECK13-NEXT: [[DOTOMP_IV5:%.*]] = alloca i32, align 4
7682 // CHECK13-NEXT: [[I6:%.*]] = alloca i32, align 4
7683 // CHECK13-NEXT: [[_TMP16:%.*]] = alloca i32, align 4
7684 // CHECK13-NEXT: [[DOTOMP_LB17:%.*]] = alloca i32, align 4
7685 // CHECK13-NEXT: [[DOTOMP_UB18:%.*]] = alloca i32, align 4
7686 // CHECK13-NEXT: [[DOTOMP_IV19:%.*]] = alloca i32, align 4
7687 // CHECK13-NEXT: [[I20:%.*]] = alloca i32, align 4
7688 // CHECK13-NEXT: store i32 0, ptr [[RETVAL]], align 4
7689 // CHECK13-NEXT: store i32 0, ptr [[DOTOMP_LB]], align 4
7690 // CHECK13-NEXT: store i32 99, ptr [[DOTOMP_UB]], align 4
7691 // CHECK13-NEXT: [[TMP0:%.*]] = load i32, ptr [[DOTOMP_LB]], align 4
7692 // CHECK13-NEXT: store i32 [[TMP0]], ptr [[DOTOMP_IV]], align 4
7693 // CHECK13-NEXT: br label [[OMP_INNER_FOR_COND:%.*]]
7694 // CHECK13: omp.inner.for.cond:
7695 // CHECK13-NEXT: [[TMP1:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP9:![0-9]+]]
7696 // CHECK13-NEXT: [[TMP2:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4, !llvm.access.group [[ACC_GRP9]]
7697 // CHECK13-NEXT: [[CMP:%.*]] = icmp sle i32 [[TMP1]], [[TMP2]]
7698 // CHECK13-NEXT: br i1 [[CMP]], label [[OMP_INNER_FOR_BODY:%.*]], label [[OMP_INNER_FOR_END:%.*]]
7699 // CHECK13: omp.inner.for.body:
7700 // CHECK13-NEXT: [[TMP3:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP9]]
7701 // CHECK13-NEXT: [[MUL:%.*]] = mul nsw i32 [[TMP3]], 1
7702 // CHECK13-NEXT: [[ADD:%.*]] = add nsw i32 0, [[MUL]]
7703 // CHECK13-NEXT: store i32 [[ADD]], ptr [[I]], align 4, !llvm.access.group [[ACC_GRP9]]
7704 // CHECK13-NEXT: call void @_Z3fn4v(), !llvm.access.group [[ACC_GRP9]]
7705 // CHECK13-NEXT: br label [[OMP_BODY_CONTINUE:%.*]]
7706 // CHECK13: omp.body.continue:
7707 // CHECK13-NEXT: br label [[OMP_INNER_FOR_INC:%.*]]
7708 // CHECK13: omp.inner.for.inc:
7709 // CHECK13-NEXT: [[TMP4:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP9]]
7710 // CHECK13-NEXT: [[ADD1:%.*]] = add nsw i32 [[TMP4]], 1
7711 // CHECK13-NEXT: store i32 [[ADD1]], ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP9]]
7712 // CHECK13-NEXT: br label [[OMP_INNER_FOR_COND]], !llvm.loop [[LOOP10:![0-9]+]]
7713 // CHECK13: omp.inner.for.end:
7714 // CHECK13-NEXT: store i32 100, ptr [[I]], align 4
7715 // CHECK13-NEXT: store i32 0, ptr [[DOTOMP_LB3]], align 4
7716 // CHECK13-NEXT: store i32 99, ptr [[DOTOMP_UB4]], align 4
7717 // CHECK13-NEXT: [[TMP5:%.*]] = load i32, ptr [[DOTOMP_LB3]], align 4
7718 // CHECK13-NEXT: store i32 [[TMP5]], ptr [[DOTOMP_IV5]], align 4
7719 // CHECK13-NEXT: br label [[OMP_INNER_FOR_COND7:%.*]]
7720 // CHECK13: omp.inner.for.cond7:
7721 // CHECK13-NEXT: [[TMP6:%.*]] = load i32, ptr [[DOTOMP_IV5]], align 4, !llvm.access.group [[ACC_GRP12:![0-9]+]]
7722 // CHECK13-NEXT: [[TMP7:%.*]] = load i32, ptr [[DOTOMP_UB4]], align 4, !llvm.access.group [[ACC_GRP12]]
7723 // CHECK13-NEXT: [[CMP8:%.*]] = icmp sle i32 [[TMP6]], [[TMP7]]
7724 // CHECK13-NEXT: br i1 [[CMP8]], label [[OMP_INNER_FOR_BODY9:%.*]], label [[OMP_INNER_FOR_END15:%.*]]
7725 // CHECK13: omp.inner.for.body9:
7726 // CHECK13-NEXT: [[TMP8:%.*]] = load i32, ptr [[DOTOMP_IV5]], align 4, !llvm.access.group [[ACC_GRP12]]
7727 // CHECK13-NEXT: [[MUL10:%.*]] = mul nsw i32 [[TMP8]], 1
7728 // CHECK13-NEXT: [[ADD11:%.*]] = add nsw i32 0, [[MUL10]]
7729 // CHECK13-NEXT: store i32 [[ADD11]], ptr [[I6]], align 4, !llvm.access.group [[ACC_GRP12]]
7730 // CHECK13-NEXT: call void @_Z3fn5v(), !llvm.access.group [[ACC_GRP12]]
7731 // CHECK13-NEXT: br label [[OMP_BODY_CONTINUE12:%.*]]
7732 // CHECK13: omp.body.continue12:
7733 // CHECK13-NEXT: br label [[OMP_INNER_FOR_INC13:%.*]]
7734 // CHECK13: omp.inner.for.inc13:
7735 // CHECK13-NEXT: [[TMP9:%.*]] = load i32, ptr [[DOTOMP_IV5]], align 4, !llvm.access.group [[ACC_GRP12]]
7736 // CHECK13-NEXT: [[ADD14:%.*]] = add nsw i32 [[TMP9]], 1
7737 // CHECK13-NEXT: store i32 [[ADD14]], ptr [[DOTOMP_IV5]], align 4, !llvm.access.group [[ACC_GRP12]]
7738 // CHECK13-NEXT: br label [[OMP_INNER_FOR_COND7]], !llvm.loop [[LOOP13:![0-9]+]]
7739 // CHECK13: omp.inner.for.end15:
7740 // CHECK13-NEXT: store i32 100, ptr [[I6]], align 4
7741 // CHECK13-NEXT: store i32 0, ptr [[DOTOMP_LB17]], align 4
7742 // CHECK13-NEXT: store i32 99, ptr [[DOTOMP_UB18]], align 4
7743 // CHECK13-NEXT: [[TMP10:%.*]] = load i32, ptr [[DOTOMP_LB17]], align 4
7744 // CHECK13-NEXT: store i32 [[TMP10]], ptr [[DOTOMP_IV19]], align 4
7745 // CHECK13-NEXT: br label [[OMP_INNER_FOR_COND21:%.*]]
7746 // CHECK13: omp.inner.for.cond21:
7747 // CHECK13-NEXT: [[TMP11:%.*]] = load i32, ptr [[DOTOMP_IV19]], align 4, !llvm.access.group [[ACC_GRP15:![0-9]+]]
7748 // CHECK13-NEXT: [[TMP12:%.*]] = load i32, ptr [[DOTOMP_UB18]], align 4, !llvm.access.group [[ACC_GRP15]]
7749 // CHECK13-NEXT: [[CMP22:%.*]] = icmp sle i32 [[TMP11]], [[TMP12]]
7750 // CHECK13-NEXT: br i1 [[CMP22]], label [[OMP_INNER_FOR_BODY23:%.*]], label [[OMP_INNER_FOR_END29:%.*]]
7751 // CHECK13: omp.inner.for.body23:
7752 // CHECK13-NEXT: [[TMP13:%.*]] = load i32, ptr [[DOTOMP_IV19]], align 4, !llvm.access.group [[ACC_GRP15]]
7753 // CHECK13-NEXT: [[MUL24:%.*]] = mul nsw i32 [[TMP13]], 1
7754 // CHECK13-NEXT: [[ADD25:%.*]] = add nsw i32 0, [[MUL24]]
7755 // CHECK13-NEXT: store i32 [[ADD25]], ptr [[I20]], align 4, !llvm.access.group [[ACC_GRP15]]
7756 // CHECK13-NEXT: call void @_Z3fn6v(), !llvm.access.group [[ACC_GRP15]]
7757 // CHECK13-NEXT: br label [[OMP_BODY_CONTINUE26:%.*]]
7758 // CHECK13: omp.body.continue26:
7759 // CHECK13-NEXT: br label [[OMP_INNER_FOR_INC27:%.*]]
7760 // CHECK13: omp.inner.for.inc27:
7761 // CHECK13-NEXT: [[TMP14:%.*]] = load i32, ptr [[DOTOMP_IV19]], align 4, !llvm.access.group [[ACC_GRP15]]
7762 // CHECK13-NEXT: [[ADD28:%.*]] = add nsw i32 [[TMP14]], 1
7763 // CHECK13-NEXT: store i32 [[ADD28]], ptr [[DOTOMP_IV19]], align 4, !llvm.access.group [[ACC_GRP15]]
7764 // CHECK13-NEXT: br label [[OMP_INNER_FOR_COND21]], !llvm.loop [[LOOP16:![0-9]+]]
7765 // CHECK13: omp.inner.for.end29:
7766 // CHECK13-NEXT: store i32 100, ptr [[I20]], align 4
7767 // CHECK13-NEXT: [[TMP15:%.*]] = load i32, ptr @Arg, align 4
7768 // CHECK13-NEXT: [[CALL:%.*]] = call noundef i32 @_Z5tmainIiEiT_(i32 noundef [[TMP15]])
7769 // CHECK13-NEXT: ret i32 [[CALL]]
7772 // CHECK13-LABEL: define {{[^@]+}}@_Z5tmainIiEiT_
7773 // CHECK13-SAME: (i32 noundef [[ARG:%.*]]) #[[ATTR0]] comdat {
7774 // CHECK13-NEXT: entry:
7775 // CHECK13-NEXT: [[ARG_ADDR:%.*]] = alloca i32, align 4
7776 // CHECK13-NEXT: [[TMP:%.*]] = alloca i32, align 4
7777 // CHECK13-NEXT: [[DOTOMP_LB:%.*]] = alloca i32, align 4
7778 // CHECK13-NEXT: [[DOTOMP_UB:%.*]] = alloca i32, align 4
7779 // CHECK13-NEXT: [[DOTOMP_IV:%.*]] = alloca i32, align 4
7780 // CHECK13-NEXT: [[I:%.*]] = alloca i32, align 4
7781 // CHECK13-NEXT: [[_TMP2:%.*]] = alloca i32, align 4
7782 // CHECK13-NEXT: [[DOTOMP_LB3:%.*]] = alloca i32, align 4
7783 // CHECK13-NEXT: [[DOTOMP_UB4:%.*]] = alloca i32, align 4
7784 // CHECK13-NEXT: [[DOTOMP_IV5:%.*]] = alloca i32, align 4
7785 // CHECK13-NEXT: [[I6:%.*]] = alloca i32, align 4
7786 // CHECK13-NEXT: [[_TMP16:%.*]] = alloca i32, align 4
7787 // CHECK13-NEXT: [[DOTOMP_LB17:%.*]] = alloca i32, align 4
7788 // CHECK13-NEXT: [[DOTOMP_UB18:%.*]] = alloca i32, align 4
7789 // CHECK13-NEXT: [[DOTOMP_IV19:%.*]] = alloca i32, align 4
7790 // CHECK13-NEXT: [[I20:%.*]] = alloca i32, align 4
7791 // CHECK13-NEXT: store i32 [[ARG]], ptr [[ARG_ADDR]], align 4
7792 // CHECK13-NEXT: store i32 0, ptr [[DOTOMP_LB]], align 4
7793 // CHECK13-NEXT: store i32 99, ptr [[DOTOMP_UB]], align 4
7794 // CHECK13-NEXT: [[TMP0:%.*]] = load i32, ptr [[DOTOMP_LB]], align 4
7795 // CHECK13-NEXT: store i32 [[TMP0]], ptr [[DOTOMP_IV]], align 4
7796 // CHECK13-NEXT: br label [[OMP_INNER_FOR_COND:%.*]]
7797 // CHECK13: omp.inner.for.cond:
7798 // CHECK13-NEXT: [[TMP1:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP18:![0-9]+]]
7799 // CHECK13-NEXT: [[TMP2:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4, !llvm.access.group [[ACC_GRP18]]
7800 // CHECK13-NEXT: [[CMP:%.*]] = icmp sle i32 [[TMP1]], [[TMP2]]
7801 // CHECK13-NEXT: br i1 [[CMP]], label [[OMP_INNER_FOR_BODY:%.*]], label [[OMP_INNER_FOR_END:%.*]]
7802 // CHECK13: omp.inner.for.body:
7803 // CHECK13-NEXT: [[TMP3:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP18]]
7804 // CHECK13-NEXT: [[MUL:%.*]] = mul nsw i32 [[TMP3]], 1
7805 // CHECK13-NEXT: [[ADD:%.*]] = add nsw i32 0, [[MUL]]
7806 // CHECK13-NEXT: store i32 [[ADD]], ptr [[I]], align 4, !llvm.access.group [[ACC_GRP18]]
7807 // CHECK13-NEXT: call void @_Z3fn1v(), !llvm.access.group [[ACC_GRP18]]
7808 // CHECK13-NEXT: br label [[OMP_BODY_CONTINUE:%.*]]
7809 // CHECK13: omp.body.continue:
7810 // CHECK13-NEXT: br label [[OMP_INNER_FOR_INC:%.*]]
7811 // CHECK13: omp.inner.for.inc:
7812 // CHECK13-NEXT: [[TMP4:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP18]]
7813 // CHECK13-NEXT: [[ADD1:%.*]] = add nsw i32 [[TMP4]], 1
7814 // CHECK13-NEXT: store i32 [[ADD1]], ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP18]]
7815 // CHECK13-NEXT: br label [[OMP_INNER_FOR_COND]], !llvm.loop [[LOOP19:![0-9]+]]
7816 // CHECK13: omp.inner.for.end:
7817 // CHECK13-NEXT: store i32 100, ptr [[I]], align 4
7818 // CHECK13-NEXT: store i32 0, ptr [[DOTOMP_LB3]], align 4
7819 // CHECK13-NEXT: store i32 99, ptr [[DOTOMP_UB4]], align 4
7820 // CHECK13-NEXT: [[TMP5:%.*]] = load i32, ptr [[DOTOMP_LB3]], align 4
7821 // CHECK13-NEXT: store i32 [[TMP5]], ptr [[DOTOMP_IV5]], align 4
7822 // CHECK13-NEXT: br label [[OMP_INNER_FOR_COND7:%.*]]
7823 // CHECK13: omp.inner.for.cond7:
7824 // CHECK13-NEXT: [[TMP6:%.*]] = load i32, ptr [[DOTOMP_IV5]], align 4, !llvm.access.group [[ACC_GRP21:![0-9]+]]
7825 // CHECK13-NEXT: [[TMP7:%.*]] = load i32, ptr [[DOTOMP_UB4]], align 4, !llvm.access.group [[ACC_GRP21]]
7826 // CHECK13-NEXT: [[CMP8:%.*]] = icmp sle i32 [[TMP6]], [[TMP7]]
7827 // CHECK13-NEXT: br i1 [[CMP8]], label [[OMP_INNER_FOR_BODY9:%.*]], label [[OMP_INNER_FOR_END15:%.*]]
7828 // CHECK13: omp.inner.for.body9:
7829 // CHECK13-NEXT: [[TMP8:%.*]] = load i32, ptr [[DOTOMP_IV5]], align 4, !llvm.access.group [[ACC_GRP21]]
7830 // CHECK13-NEXT: [[MUL10:%.*]] = mul nsw i32 [[TMP8]], 1
7831 // CHECK13-NEXT: [[ADD11:%.*]] = add nsw i32 0, [[MUL10]]
7832 // CHECK13-NEXT: store i32 [[ADD11]], ptr [[I6]], align 4, !llvm.access.group [[ACC_GRP21]]
7833 // CHECK13-NEXT: call void @_Z3fn2v(), !llvm.access.group [[ACC_GRP21]]
7834 // CHECK13-NEXT: br label [[OMP_BODY_CONTINUE12:%.*]]
7835 // CHECK13: omp.body.continue12:
7836 // CHECK13-NEXT: br label [[OMP_INNER_FOR_INC13:%.*]]
7837 // CHECK13: omp.inner.for.inc13:
7838 // CHECK13-NEXT: [[TMP9:%.*]] = load i32, ptr [[DOTOMP_IV5]], align 4, !llvm.access.group [[ACC_GRP21]]
7839 // CHECK13-NEXT: [[ADD14:%.*]] = add nsw i32 [[TMP9]], 1
7840 // CHECK13-NEXT: store i32 [[ADD14]], ptr [[DOTOMP_IV5]], align 4, !llvm.access.group [[ACC_GRP21]]
7841 // CHECK13-NEXT: br label [[OMP_INNER_FOR_COND7]], !llvm.loop [[LOOP22:![0-9]+]]
7842 // CHECK13: omp.inner.for.end15:
7843 // CHECK13-NEXT: store i32 100, ptr [[I6]], align 4
7844 // CHECK13-NEXT: store i32 0, ptr [[DOTOMP_LB17]], align 4
7845 // CHECK13-NEXT: store i32 99, ptr [[DOTOMP_UB18]], align 4
7846 // CHECK13-NEXT: [[TMP10:%.*]] = load i32, ptr [[DOTOMP_LB17]], align 4
7847 // CHECK13-NEXT: store i32 [[TMP10]], ptr [[DOTOMP_IV19]], align 4
7848 // CHECK13-NEXT: br label [[OMP_INNER_FOR_COND21:%.*]]
7849 // CHECK13: omp.inner.for.cond21:
7850 // CHECK13-NEXT: [[TMP11:%.*]] = load i32, ptr [[DOTOMP_IV19]], align 4, !llvm.access.group [[ACC_GRP24:![0-9]+]]
7851 // CHECK13-NEXT: [[TMP12:%.*]] = load i32, ptr [[DOTOMP_UB18]], align 4, !llvm.access.group [[ACC_GRP24]]
7852 // CHECK13-NEXT: [[CMP22:%.*]] = icmp sle i32 [[TMP11]], [[TMP12]]
7853 // CHECK13-NEXT: br i1 [[CMP22]], label [[OMP_INNER_FOR_BODY23:%.*]], label [[OMP_INNER_FOR_END29:%.*]]
7854 // CHECK13: omp.inner.for.body23:
7855 // CHECK13-NEXT: [[TMP13:%.*]] = load i32, ptr [[DOTOMP_IV19]], align 4, !llvm.access.group [[ACC_GRP24]]
7856 // CHECK13-NEXT: [[MUL24:%.*]] = mul nsw i32 [[TMP13]], 1
7857 // CHECK13-NEXT: [[ADD25:%.*]] = add nsw i32 0, [[MUL24]]
7858 // CHECK13-NEXT: store i32 [[ADD25]], ptr [[I20]], align 4, !llvm.access.group [[ACC_GRP24]]
7859 // CHECK13-NEXT: call void @_Z3fn3v(), !llvm.access.group [[ACC_GRP24]]
7860 // CHECK13-NEXT: br label [[OMP_BODY_CONTINUE26:%.*]]
7861 // CHECK13: omp.body.continue26:
7862 // CHECK13-NEXT: br label [[OMP_INNER_FOR_INC27:%.*]]
7863 // CHECK13: omp.inner.for.inc27:
7864 // CHECK13-NEXT: [[TMP14:%.*]] = load i32, ptr [[DOTOMP_IV19]], align 4, !llvm.access.group [[ACC_GRP24]]
7865 // CHECK13-NEXT: [[ADD28:%.*]] = add nsw i32 [[TMP14]], 1
7866 // CHECK13-NEXT: store i32 [[ADD28]], ptr [[DOTOMP_IV19]], align 4, !llvm.access.group [[ACC_GRP24]]
7867 // CHECK13-NEXT: br label [[OMP_INNER_FOR_COND21]], !llvm.loop [[LOOP25:![0-9]+]]
7868 // CHECK13: omp.inner.for.end29:
7869 // CHECK13-NEXT: store i32 100, ptr [[I20]], align 4
7870 // CHECK13-NEXT: ret i32 0
7873 // CHECK15-LABEL: define {{[^@]+}}@_Z9gtid_testv
7874 // CHECK15-SAME: () #[[ATTR0:[0-9]+]] {
7875 // CHECK15-NEXT: entry:
7876 // CHECK15-NEXT: [[TMP:%.*]] = alloca i32, align 4
7877 // CHECK15-NEXT: [[DOTOMP_LB:%.*]] = alloca i32, align 4
7878 // CHECK15-NEXT: [[DOTOMP_UB:%.*]] = alloca i32, align 4
7879 // CHECK15-NEXT: [[DOTOMP_IV:%.*]] = alloca i32, align 4
7880 // CHECK15-NEXT: [[I:%.*]] = alloca i32, align 4
7881 // CHECK15-NEXT: [[_TMP2:%.*]] = alloca i32, align 4
7882 // CHECK15-NEXT: [[DOTOMP_LB3:%.*]] = alloca i32, align 4
7883 // CHECK15-NEXT: [[DOTOMP_UB4:%.*]] = alloca i32, align 4
7884 // CHECK15-NEXT: [[DOTOMP_IV5:%.*]] = alloca i32, align 4
7885 // CHECK15-NEXT: [[I6:%.*]] = alloca i32, align 4
7886 // CHECK15-NEXT: store i32 0, ptr [[DOTOMP_LB]], align 4
7887 // CHECK15-NEXT: store i32 99, ptr [[DOTOMP_UB]], align 4
7888 // CHECK15-NEXT: [[TMP0:%.*]] = load i32, ptr [[DOTOMP_LB]], align 4
7889 // CHECK15-NEXT: store i32 [[TMP0]], ptr [[DOTOMP_IV]], align 4
7890 // CHECK15-NEXT: br label [[OMP_INNER_FOR_COND:%.*]]
7891 // CHECK15: omp.inner.for.cond:
7892 // CHECK15-NEXT: [[TMP1:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP2:![0-9]+]]
7893 // CHECK15-NEXT: [[TMP2:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4, !llvm.access.group [[ACC_GRP2]]
7894 // CHECK15-NEXT: [[CMP:%.*]] = icmp sle i32 [[TMP1]], [[TMP2]]
7895 // CHECK15-NEXT: br i1 [[CMP]], label [[OMP_INNER_FOR_BODY:%.*]], label [[OMP_INNER_FOR_END:%.*]]
7896 // CHECK15: omp.inner.for.body:
7897 // CHECK15-NEXT: [[TMP3:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP2]]
7898 // CHECK15-NEXT: [[MUL:%.*]] = mul nsw i32 [[TMP3]], 1
7899 // CHECK15-NEXT: [[ADD:%.*]] = add nsw i32 0, [[MUL]]
7900 // CHECK15-NEXT: store i32 [[ADD]], ptr [[I]], align 4, !llvm.access.group [[ACC_GRP2]]
7901 // CHECK15-NEXT: br label [[OMP_BODY_CONTINUE:%.*]]
7902 // CHECK15: omp.body.continue:
7903 // CHECK15-NEXT: br label [[OMP_INNER_FOR_INC:%.*]]
7904 // CHECK15: omp.inner.for.inc:
7905 // CHECK15-NEXT: [[TMP4:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP2]]
7906 // CHECK15-NEXT: [[ADD1:%.*]] = add nsw i32 [[TMP4]], 1
7907 // CHECK15-NEXT: store i32 [[ADD1]], ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP2]]
7908 // CHECK15-NEXT: br label [[OMP_INNER_FOR_COND]], !llvm.loop [[LOOP3:![0-9]+]]
7909 // CHECK15: omp.inner.for.end:
7910 // CHECK15-NEXT: store i32 100, ptr [[I]], align 4
7911 // CHECK15-NEXT: store i32 0, ptr [[DOTOMP_LB3]], align 4
7912 // CHECK15-NEXT: store i32 99, ptr [[DOTOMP_UB4]], align 4
7913 // CHECK15-NEXT: [[TMP5:%.*]] = load i32, ptr [[DOTOMP_LB3]], align 4
7914 // CHECK15-NEXT: store i32 [[TMP5]], ptr [[DOTOMP_IV5]], align 4
7915 // CHECK15-NEXT: br label [[OMP_INNER_FOR_COND7:%.*]]
7916 // CHECK15: omp.inner.for.cond7:
7917 // CHECK15-NEXT: [[TMP6:%.*]] = load i32, ptr [[DOTOMP_IV5]], align 4, !llvm.access.group [[ACC_GRP6:![0-9]+]]
7918 // CHECK15-NEXT: [[TMP7:%.*]] = load i32, ptr [[DOTOMP_UB4]], align 4, !llvm.access.group [[ACC_GRP6]]
7919 // CHECK15-NEXT: [[CMP8:%.*]] = icmp sle i32 [[TMP6]], [[TMP7]]
7920 // CHECK15-NEXT: br i1 [[CMP8]], label [[OMP_INNER_FOR_BODY9:%.*]], label [[OMP_INNER_FOR_END15:%.*]]
7921 // CHECK15: omp.inner.for.body9:
7922 // CHECK15-NEXT: [[TMP8:%.*]] = load i32, ptr [[DOTOMP_IV5]], align 4, !llvm.access.group [[ACC_GRP6]]
7923 // CHECK15-NEXT: [[MUL10:%.*]] = mul nsw i32 [[TMP8]], 1
7924 // CHECK15-NEXT: [[ADD11:%.*]] = add nsw i32 0, [[MUL10]]
7925 // CHECK15-NEXT: store i32 [[ADD11]], ptr [[I6]], align 4, !llvm.access.group [[ACC_GRP6]]
7926 // CHECK15-NEXT: call void @_Z9gtid_testv(), !llvm.access.group [[ACC_GRP6]]
7927 // CHECK15-NEXT: br label [[OMP_BODY_CONTINUE12:%.*]]
7928 // CHECK15: omp.body.continue12:
7929 // CHECK15-NEXT: br label [[OMP_INNER_FOR_INC13:%.*]]
7930 // CHECK15: omp.inner.for.inc13:
7931 // CHECK15-NEXT: [[TMP9:%.*]] = load i32, ptr [[DOTOMP_IV5]], align 4, !llvm.access.group [[ACC_GRP6]]
7932 // CHECK15-NEXT: [[ADD14:%.*]] = add nsw i32 [[TMP9]], 1
7933 // CHECK15-NEXT: store i32 [[ADD14]], ptr [[DOTOMP_IV5]], align 4, !llvm.access.group [[ACC_GRP6]]
7934 // CHECK15-NEXT: br label [[OMP_INNER_FOR_COND7]], !llvm.loop [[LOOP7:![0-9]+]]
7935 // CHECK15: omp.inner.for.end15:
7936 // CHECK15-NEXT: store i32 100, ptr [[I6]], align 4
7937 // CHECK15-NEXT: ret void
7940 // CHECK15-LABEL: define {{[^@]+}}@main
7941 // CHECK15-SAME: () #[[ATTR1:[0-9]+]] {
7942 // CHECK15-NEXT: entry:
7943 // CHECK15-NEXT: [[RETVAL:%.*]] = alloca i32, align 4
7944 // CHECK15-NEXT: [[TMP:%.*]] = alloca i32, align 4
7945 // CHECK15-NEXT: [[DOTOMP_LB:%.*]] = alloca i32, align 4
7946 // CHECK15-NEXT: [[DOTOMP_UB:%.*]] = alloca i32, align 4
7947 // CHECK15-NEXT: [[DOTOMP_IV:%.*]] = alloca i32, align 4
7948 // CHECK15-NEXT: [[I:%.*]] = alloca i32, align 4
7949 // CHECK15-NEXT: [[_TMP2:%.*]] = alloca i32, align 4
7950 // CHECK15-NEXT: [[DOTOMP_LB3:%.*]] = alloca i32, align 4
7951 // CHECK15-NEXT: [[DOTOMP_UB4:%.*]] = alloca i32, align 4
7952 // CHECK15-NEXT: [[DOTOMP_IV5:%.*]] = alloca i32, align 4
7953 // CHECK15-NEXT: [[I6:%.*]] = alloca i32, align 4
7954 // CHECK15-NEXT: [[DOTCAPTURE_EXPR_:%.*]] = alloca i8, align 1
7955 // CHECK15-NEXT: [[_TMP16:%.*]] = alloca i32, align 4
7956 // CHECK15-NEXT: [[DOTOMP_LB17:%.*]] = alloca i32, align 4
7957 // CHECK15-NEXT: [[DOTOMP_UB18:%.*]] = alloca i32, align 4
7958 // CHECK15-NEXT: [[DOTOMP_IV19:%.*]] = alloca i32, align 4
7959 // CHECK15-NEXT: [[I20:%.*]] = alloca i32, align 4
7960 // CHECK15-NEXT: store i32 0, ptr [[RETVAL]], align 4
7961 // CHECK15-NEXT: store i32 0, ptr [[DOTOMP_LB]], align 4
7962 // CHECK15-NEXT: store i32 99, ptr [[DOTOMP_UB]], align 4
7963 // CHECK15-NEXT: [[TMP0:%.*]] = load i32, ptr [[DOTOMP_LB]], align 4
7964 // CHECK15-NEXT: store i32 [[TMP0]], ptr [[DOTOMP_IV]], align 4
7965 // CHECK15-NEXT: br label [[OMP_INNER_FOR_COND:%.*]]
7966 // CHECK15: omp.inner.for.cond:
7967 // CHECK15-NEXT: [[TMP1:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP9:![0-9]+]]
7968 // CHECK15-NEXT: [[TMP2:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4, !llvm.access.group [[ACC_GRP9]]
7969 // CHECK15-NEXT: [[CMP:%.*]] = icmp sle i32 [[TMP1]], [[TMP2]]
7970 // CHECK15-NEXT: br i1 [[CMP]], label [[OMP_INNER_FOR_BODY:%.*]], label [[OMP_INNER_FOR_END:%.*]]
7971 // CHECK15: omp.inner.for.body:
7972 // CHECK15-NEXT: [[TMP3:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP9]]
7973 // CHECK15-NEXT: [[MUL:%.*]] = mul nsw i32 [[TMP3]], 1
7974 // CHECK15-NEXT: [[ADD:%.*]] = add nsw i32 0, [[MUL]]
7975 // CHECK15-NEXT: store i32 [[ADD]], ptr [[I]], align 4, !llvm.access.group [[ACC_GRP9]]
7976 // CHECK15-NEXT: call void @_Z3fn4v(), !llvm.access.group [[ACC_GRP9]]
7977 // CHECK15-NEXT: br label [[OMP_BODY_CONTINUE:%.*]]
7978 // CHECK15: omp.body.continue:
7979 // CHECK15-NEXT: br label [[OMP_INNER_FOR_INC:%.*]]
7980 // CHECK15: omp.inner.for.inc:
7981 // CHECK15-NEXT: [[TMP4:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP9]]
7982 // CHECK15-NEXT: [[ADD1:%.*]] = add nsw i32 [[TMP4]], 1
7983 // CHECK15-NEXT: store i32 [[ADD1]], ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP9]]
7984 // CHECK15-NEXT: br label [[OMP_INNER_FOR_COND]], !llvm.loop [[LOOP10:![0-9]+]]
7985 // CHECK15: omp.inner.for.end:
7986 // CHECK15-NEXT: store i32 100, ptr [[I]], align 4
7987 // CHECK15-NEXT: store i32 0, ptr [[DOTOMP_LB3]], align 4
7988 // CHECK15-NEXT: store i32 99, ptr [[DOTOMP_UB4]], align 4
7989 // CHECK15-NEXT: [[TMP5:%.*]] = load i32, ptr [[DOTOMP_LB3]], align 4
7990 // CHECK15-NEXT: store i32 [[TMP5]], ptr [[DOTOMP_IV5]], align 4
7991 // CHECK15-NEXT: br label [[OMP_INNER_FOR_COND7:%.*]]
7992 // CHECK15: omp.inner.for.cond7:
7993 // CHECK15-NEXT: [[TMP6:%.*]] = load i32, ptr [[DOTOMP_IV5]], align 4
7994 // CHECK15-NEXT: [[TMP7:%.*]] = load i32, ptr [[DOTOMP_UB4]], align 4
7995 // CHECK15-NEXT: [[CMP8:%.*]] = icmp sle i32 [[TMP6]], [[TMP7]]
7996 // CHECK15-NEXT: br i1 [[CMP8]], label [[OMP_INNER_FOR_BODY9:%.*]], label [[OMP_INNER_FOR_END15:%.*]]
7997 // CHECK15: omp.inner.for.body9:
7998 // CHECK15-NEXT: [[TMP8:%.*]] = load i32, ptr [[DOTOMP_IV5]], align 4
7999 // CHECK15-NEXT: [[MUL10:%.*]] = mul nsw i32 [[TMP8]], 1
8000 // CHECK15-NEXT: [[ADD11:%.*]] = add nsw i32 0, [[MUL10]]
8001 // CHECK15-NEXT: store i32 [[ADD11]], ptr [[I6]], align 4
8002 // CHECK15-NEXT: call void @_Z3fn5v()
8003 // CHECK15-NEXT: br label [[OMP_BODY_CONTINUE12:%.*]]
8004 // CHECK15: omp.body.continue12:
8005 // CHECK15-NEXT: br label [[OMP_INNER_FOR_INC13:%.*]]
8006 // CHECK15: omp.inner.for.inc13:
8007 // CHECK15-NEXT: [[TMP9:%.*]] = load i32, ptr [[DOTOMP_IV5]], align 4
8008 // CHECK15-NEXT: [[ADD14:%.*]] = add nsw i32 [[TMP9]], 1
8009 // CHECK15-NEXT: store i32 [[ADD14]], ptr [[DOTOMP_IV5]], align 4
8010 // CHECK15-NEXT: br label [[OMP_INNER_FOR_COND7]], !llvm.loop [[LOOP12:![0-9]+]]
8011 // CHECK15: omp.inner.for.end15:
8012 // CHECK15-NEXT: store i32 100, ptr [[I6]], align 4
8013 // CHECK15-NEXT: [[TMP10:%.*]] = load i32, ptr @Arg, align 4
8014 // CHECK15-NEXT: [[TOBOOL:%.*]] = icmp ne i32 [[TMP10]], 0
8015 // CHECK15-NEXT: [[FROMBOOL:%.*]] = zext i1 [[TOBOOL]] to i8
8016 // CHECK15-NEXT: store i8 [[FROMBOOL]], ptr [[DOTCAPTURE_EXPR_]], align 1
8017 // CHECK15-NEXT: store i32 0, ptr [[DOTOMP_LB17]], align 4
8018 // CHECK15-NEXT: store i32 99, ptr [[DOTOMP_UB18]], align 4
8019 // CHECK15-NEXT: [[TMP11:%.*]] = load i32, ptr [[DOTOMP_LB17]], align 4
8020 // CHECK15-NEXT: store i32 [[TMP11]], ptr [[DOTOMP_IV19]], align 4
8021 // CHECK15-NEXT: [[TMP12:%.*]] = load i8, ptr [[DOTCAPTURE_EXPR_]], align 1
8022 // CHECK15-NEXT: [[TOBOOL21:%.*]] = trunc i8 [[TMP12]] to i1
8023 // CHECK15-NEXT: br i1 [[TOBOOL21]], label [[OMP_IF_THEN:%.*]], label [[OMP_IF_ELSE:%.*]]
8024 // CHECK15: omp_if.then:
8025 // CHECK15-NEXT: br label [[OMP_INNER_FOR_COND22:%.*]]
8026 // CHECK15: omp.inner.for.cond22:
8027 // CHECK15-NEXT: [[TMP13:%.*]] = load i32, ptr [[DOTOMP_IV19]], align 4, !llvm.access.group [[ACC_GRP14:![0-9]+]]
8028 // CHECK15-NEXT: [[TMP14:%.*]] = load i32, ptr [[DOTOMP_UB18]], align 4, !llvm.access.group [[ACC_GRP14]]
8029 // CHECK15-NEXT: [[CMP23:%.*]] = icmp sle i32 [[TMP13]], [[TMP14]]
8030 // CHECK15-NEXT: br i1 [[CMP23]], label [[OMP_INNER_FOR_BODY24:%.*]], label [[OMP_INNER_FOR_END30:%.*]]
8031 // CHECK15: omp.inner.for.body24:
8032 // CHECK15-NEXT: [[TMP15:%.*]] = load i32, ptr [[DOTOMP_IV19]], align 4, !llvm.access.group [[ACC_GRP14]]
8033 // CHECK15-NEXT: [[MUL25:%.*]] = mul nsw i32 [[TMP15]], 1
8034 // CHECK15-NEXT: [[ADD26:%.*]] = add nsw i32 0, [[MUL25]]
8035 // CHECK15-NEXT: store i32 [[ADD26]], ptr [[I20]], align 4, !llvm.access.group [[ACC_GRP14]]
8036 // CHECK15-NEXT: call void @_Z3fn6v(), !llvm.access.group [[ACC_GRP14]]
8037 // CHECK15-NEXT: br label [[OMP_BODY_CONTINUE27:%.*]]
8038 // CHECK15: omp.body.continue27:
8039 // CHECK15-NEXT: br label [[OMP_INNER_FOR_INC28:%.*]]
8040 // CHECK15: omp.inner.for.inc28:
8041 // CHECK15-NEXT: [[TMP16:%.*]] = load i32, ptr [[DOTOMP_IV19]], align 4, !llvm.access.group [[ACC_GRP14]]
8042 // CHECK15-NEXT: [[ADD29:%.*]] = add nsw i32 [[TMP16]], 1
8043 // CHECK15-NEXT: store i32 [[ADD29]], ptr [[DOTOMP_IV19]], align 4, !llvm.access.group [[ACC_GRP14]]
8044 // CHECK15-NEXT: br label [[OMP_INNER_FOR_COND22]], !llvm.loop [[LOOP15:![0-9]+]]
8045 // CHECK15: omp.inner.for.end30:
8046 // CHECK15-NEXT: br label [[OMP_IF_END:%.*]]
8047 // CHECK15: omp_if.else:
8048 // CHECK15-NEXT: br label [[OMP_INNER_FOR_COND31:%.*]]
8049 // CHECK15: omp.inner.for.cond31:
8050 // CHECK15-NEXT: [[TMP17:%.*]] = load i32, ptr [[DOTOMP_IV19]], align 4
8051 // CHECK15-NEXT: [[TMP18:%.*]] = load i32, ptr [[DOTOMP_UB18]], align 4
8052 // CHECK15-NEXT: [[CMP32:%.*]] = icmp sle i32 [[TMP17]], [[TMP18]]
8053 // CHECK15-NEXT: br i1 [[CMP32]], label [[OMP_INNER_FOR_BODY33:%.*]], label [[OMP_INNER_FOR_END39:%.*]]
8054 // CHECK15: omp.inner.for.body33:
8055 // CHECK15-NEXT: [[TMP19:%.*]] = load i32, ptr [[DOTOMP_IV19]], align 4
8056 // CHECK15-NEXT: [[MUL34:%.*]] = mul nsw i32 [[TMP19]], 1
8057 // CHECK15-NEXT: [[ADD35:%.*]] = add nsw i32 0, [[MUL34]]
8058 // CHECK15-NEXT: store i32 [[ADD35]], ptr [[I20]], align 4
8059 // CHECK15-NEXT: call void @_Z3fn6v()
8060 // CHECK15-NEXT: br label [[OMP_BODY_CONTINUE36:%.*]]
8061 // CHECK15: omp.body.continue36:
8062 // CHECK15-NEXT: br label [[OMP_INNER_FOR_INC37:%.*]]
8063 // CHECK15: omp.inner.for.inc37:
8064 // CHECK15-NEXT: [[TMP20:%.*]] = load i32, ptr [[DOTOMP_IV19]], align 4
8065 // CHECK15-NEXT: [[ADD38:%.*]] = add nsw i32 [[TMP20]], 1
8066 // CHECK15-NEXT: store i32 [[ADD38]], ptr [[DOTOMP_IV19]], align 4
8067 // CHECK15-NEXT: br label [[OMP_INNER_FOR_COND31]], !llvm.loop [[LOOP17:![0-9]+]]
8068 // CHECK15: omp.inner.for.end39:
8069 // CHECK15-NEXT: br label [[OMP_IF_END]]
8070 // CHECK15: omp_if.end:
8071 // CHECK15-NEXT: store i32 100, ptr [[I20]], align 4
8072 // CHECK15-NEXT: [[TMP21:%.*]] = load i32, ptr @Arg, align 4
8073 // CHECK15-NEXT: [[CALL:%.*]] = call noundef i32 @_Z5tmainIiEiT_(i32 noundef [[TMP21]])
8074 // CHECK15-NEXT: ret i32 [[CALL]]
8077 // CHECK15-LABEL: define {{[^@]+}}@_Z5tmainIiEiT_
8078 // CHECK15-SAME: (i32 noundef [[ARG:%.*]]) #[[ATTR0]] comdat {
8079 // CHECK15-NEXT: entry:
8080 // CHECK15-NEXT: [[ARG_ADDR:%.*]] = alloca i32, align 4
8081 // CHECK15-NEXT: [[TMP:%.*]] = alloca i32, align 4
8082 // CHECK15-NEXT: [[DOTOMP_LB:%.*]] = alloca i32, align 4
8083 // CHECK15-NEXT: [[DOTOMP_UB:%.*]] = alloca i32, align 4
8084 // CHECK15-NEXT: [[DOTOMP_IV:%.*]] = alloca i32, align 4
8085 // CHECK15-NEXT: [[I:%.*]] = alloca i32, align 4
8086 // CHECK15-NEXT: [[_TMP2:%.*]] = alloca i32, align 4
8087 // CHECK15-NEXT: [[DOTOMP_LB3:%.*]] = alloca i32, align 4
8088 // CHECK15-NEXT: [[DOTOMP_UB4:%.*]] = alloca i32, align 4
8089 // CHECK15-NEXT: [[DOTOMP_IV5:%.*]] = alloca i32, align 4
8090 // CHECK15-NEXT: [[I6:%.*]] = alloca i32, align 4
8091 // CHECK15-NEXT: [[_TMP16:%.*]] = alloca i32, align 4
8092 // CHECK15-NEXT: [[DOTOMP_LB17:%.*]] = alloca i32, align 4
8093 // CHECK15-NEXT: [[DOTOMP_UB18:%.*]] = alloca i32, align 4
8094 // CHECK15-NEXT: [[DOTOMP_IV19:%.*]] = alloca i32, align 4
8095 // CHECK15-NEXT: [[I20:%.*]] = alloca i32, align 4
8096 // CHECK15-NEXT: store i32 [[ARG]], ptr [[ARG_ADDR]], align 4
8097 // CHECK15-NEXT: store i32 0, ptr [[DOTOMP_LB]], align 4
8098 // CHECK15-NEXT: store i32 99, ptr [[DOTOMP_UB]], align 4
8099 // CHECK15-NEXT: [[TMP0:%.*]] = load i32, ptr [[DOTOMP_LB]], align 4
8100 // CHECK15-NEXT: store i32 [[TMP0]], ptr [[DOTOMP_IV]], align 4
8101 // CHECK15-NEXT: br label [[OMP_INNER_FOR_COND:%.*]]
8102 // CHECK15: omp.inner.for.cond:
8103 // CHECK15-NEXT: [[TMP1:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP18:![0-9]+]]
8104 // CHECK15-NEXT: [[TMP2:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4, !llvm.access.group [[ACC_GRP18]]
8105 // CHECK15-NEXT: [[CMP:%.*]] = icmp sle i32 [[TMP1]], [[TMP2]]
8106 // CHECK15-NEXT: br i1 [[CMP]], label [[OMP_INNER_FOR_BODY:%.*]], label [[OMP_INNER_FOR_END:%.*]]
8107 // CHECK15: omp.inner.for.body:
8108 // CHECK15-NEXT: [[TMP3:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP18]]
8109 // CHECK15-NEXT: [[MUL:%.*]] = mul nsw i32 [[TMP3]], 1
8110 // CHECK15-NEXT: [[ADD:%.*]] = add nsw i32 0, [[MUL]]
8111 // CHECK15-NEXT: store i32 [[ADD]], ptr [[I]], align 4, !llvm.access.group [[ACC_GRP18]]
8112 // CHECK15-NEXT: call void @_Z3fn1v(), !llvm.access.group [[ACC_GRP18]]
8113 // CHECK15-NEXT: br label [[OMP_BODY_CONTINUE:%.*]]
8114 // CHECK15: omp.body.continue:
8115 // CHECK15-NEXT: br label [[OMP_INNER_FOR_INC:%.*]]
8116 // CHECK15: omp.inner.for.inc:
8117 // CHECK15-NEXT: [[TMP4:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP18]]
8118 // CHECK15-NEXT: [[ADD1:%.*]] = add nsw i32 [[TMP4]], 1
8119 // CHECK15-NEXT: store i32 [[ADD1]], ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP18]]
8120 // CHECK15-NEXT: br label [[OMP_INNER_FOR_COND]], !llvm.loop [[LOOP19:![0-9]+]]
8121 // CHECK15: omp.inner.for.end:
8122 // CHECK15-NEXT: store i32 100, ptr [[I]], align 4
8123 // CHECK15-NEXT: store i32 0, ptr [[DOTOMP_LB3]], align 4
8124 // CHECK15-NEXT: store i32 99, ptr [[DOTOMP_UB4]], align 4
8125 // CHECK15-NEXT: [[TMP5:%.*]] = load i32, ptr [[DOTOMP_LB3]], align 4
8126 // CHECK15-NEXT: store i32 [[TMP5]], ptr [[DOTOMP_IV5]], align 4
8127 // CHECK15-NEXT: br label [[OMP_INNER_FOR_COND7:%.*]]
8128 // CHECK15: omp.inner.for.cond7:
8129 // CHECK15-NEXT: [[TMP6:%.*]] = load i32, ptr [[DOTOMP_IV5]], align 4
8130 // CHECK15-NEXT: [[TMP7:%.*]] = load i32, ptr [[DOTOMP_UB4]], align 4
8131 // CHECK15-NEXT: [[CMP8:%.*]] = icmp sle i32 [[TMP6]], [[TMP7]]
8132 // CHECK15-NEXT: br i1 [[CMP8]], label [[OMP_INNER_FOR_BODY9:%.*]], label [[OMP_INNER_FOR_END15:%.*]]
8133 // CHECK15: omp.inner.for.body9:
8134 // CHECK15-NEXT: [[TMP8:%.*]] = load i32, ptr [[DOTOMP_IV5]], align 4
8135 // CHECK15-NEXT: [[MUL10:%.*]] = mul nsw i32 [[TMP8]], 1
8136 // CHECK15-NEXT: [[ADD11:%.*]] = add nsw i32 0, [[MUL10]]
8137 // CHECK15-NEXT: store i32 [[ADD11]], ptr [[I6]], align 4
8138 // CHECK15-NEXT: call void @_Z3fn2v()
8139 // CHECK15-NEXT: br label [[OMP_BODY_CONTINUE12:%.*]]
8140 // CHECK15: omp.body.continue12:
8141 // CHECK15-NEXT: br label [[OMP_INNER_FOR_INC13:%.*]]
8142 // CHECK15: omp.inner.for.inc13:
8143 // CHECK15-NEXT: [[TMP9:%.*]] = load i32, ptr [[DOTOMP_IV5]], align 4
8144 // CHECK15-NEXT: [[ADD14:%.*]] = add nsw i32 [[TMP9]], 1
8145 // CHECK15-NEXT: store i32 [[ADD14]], ptr [[DOTOMP_IV5]], align 4
8146 // CHECK15-NEXT: br label [[OMP_INNER_FOR_COND7]], !llvm.loop [[LOOP21:![0-9]+]]
8147 // CHECK15: omp.inner.for.end15:
8148 // CHECK15-NEXT: store i32 100, ptr [[I6]], align 4
8149 // CHECK15-NEXT: store i32 0, ptr [[DOTOMP_LB17]], align 4
8150 // CHECK15-NEXT: store i32 99, ptr [[DOTOMP_UB18]], align 4
8151 // CHECK15-NEXT: [[TMP10:%.*]] = load i32, ptr [[DOTOMP_LB17]], align 4
8152 // CHECK15-NEXT: store i32 [[TMP10]], ptr [[DOTOMP_IV19]], align 4
8153 // CHECK15-NEXT: br label [[OMP_INNER_FOR_COND21:%.*]]
8154 // CHECK15: omp.inner.for.cond21:
8155 // CHECK15-NEXT: [[TMP11:%.*]] = load i32, ptr [[DOTOMP_IV19]], align 4, !llvm.access.group [[ACC_GRP22:![0-9]+]]
8156 // CHECK15-NEXT: [[TMP12:%.*]] = load i32, ptr [[DOTOMP_UB18]], align 4, !llvm.access.group [[ACC_GRP22]]
8157 // CHECK15-NEXT: [[CMP22:%.*]] = icmp sle i32 [[TMP11]], [[TMP12]]
8158 // CHECK15-NEXT: br i1 [[CMP22]], label [[OMP_INNER_FOR_BODY23:%.*]], label [[OMP_INNER_FOR_END29:%.*]]
8159 // CHECK15: omp.inner.for.body23:
8160 // CHECK15-NEXT: [[TMP13:%.*]] = load i32, ptr [[DOTOMP_IV19]], align 4, !llvm.access.group [[ACC_GRP22]]
8161 // CHECK15-NEXT: [[MUL24:%.*]] = mul nsw i32 [[TMP13]], 1
8162 // CHECK15-NEXT: [[ADD25:%.*]] = add nsw i32 0, [[MUL24]]
8163 // CHECK15-NEXT: store i32 [[ADD25]], ptr [[I20]], align 4, !llvm.access.group [[ACC_GRP22]]
8164 // CHECK15-NEXT: call void @_Z3fn3v(), !llvm.access.group [[ACC_GRP22]]
8165 // CHECK15-NEXT: br label [[OMP_BODY_CONTINUE26:%.*]]
8166 // CHECK15: omp.body.continue26:
8167 // CHECK15-NEXT: br label [[OMP_INNER_FOR_INC27:%.*]]
8168 // CHECK15: omp.inner.for.inc27:
8169 // CHECK15-NEXT: [[TMP14:%.*]] = load i32, ptr [[DOTOMP_IV19]], align 4, !llvm.access.group [[ACC_GRP22]]
8170 // CHECK15-NEXT: [[ADD28:%.*]] = add nsw i32 [[TMP14]], 1
8171 // CHECK15-NEXT: store i32 [[ADD28]], ptr [[DOTOMP_IV19]], align 4, !llvm.access.group [[ACC_GRP22]]
8172 // CHECK15-NEXT: br label [[OMP_INNER_FOR_COND21]], !llvm.loop [[LOOP23:![0-9]+]]
8173 // CHECK15: omp.inner.for.end29:
8174 // CHECK15-NEXT: store i32 100, ptr [[I20]], align 4
8175 // CHECK15-NEXT: ret i32 0