Run DCE after a LoopFlatten test to reduce spurious output [nfc]
[llvm-project.git] / clang / test / OpenMP / teams_distribute_parallel_for_simd_if_codegen.cpp
blob6236b7ee57e99a99932e60fc178753f1d9861677
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 -DOMP5 -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 -DOMP5 -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 -DOMP5 -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 -DOMP5 -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 -DOMP5 -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 -DOMP5 -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 -DOMP5 -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 -DOMP5 -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 -DOMP5 -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 -DOMP5 -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 -DOMP5 -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 -DOMP5 -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 distribute parallel for simd
45 for(int i = 0 ; i < 100; i++) {}
47 #pragma omp target
48 #pragma omp teams distribute parallel for simd if (parallel: false)
49 for(int i = 0 ; i < 100; i++) {
50 gtid_test();
55 template <typename T>
56 int tmain(T Arg) {
57 #pragma omp target
58 #pragma omp teams distribute parallel for simd if (true)
59 for(int i = 0 ; i < 100; i++) {
60 fn1();
62 #pragma omp target
63 #pragma omp teams distribute parallel for simd if (false)
64 for(int i = 0 ; i < 100; i++) {
65 fn2();
67 #pragma omp target
68 #pragma omp teams distribute parallel for simd if (parallel: Arg)
69 for(int i = 0 ; i < 100; i++) {
70 fn3();
72 return 0;
75 int main() {
76 #pragma omp target
77 #pragma omp teams distribute parallel for simd if (true)
78 for(int i = 0 ; i < 100; i++) {
81 fn4();
84 #pragma omp target
85 #pragma omp teams distribute parallel for simd if (false)
86 for(int i = 0 ; i < 100; i++) {
89 fn5();
92 #pragma omp target
93 #pragma omp teams distribute parallel for simd if (Arg)
94 for(int i = 0 ; i < 100; i++) {
97 fn6();
100 return tmain(Arg);
108 // call void [[T_OUTLINE_FUN_3:@.+]](
112 #endif
113 // CHECK1-LABEL: define {{[^@]+}}@_Z9gtid_testv
114 // CHECK1-SAME: () #[[ATTR0:[0-9]+]] {
115 // CHECK1-NEXT: entry:
116 // CHECK1-NEXT: [[TMP:%.*]] = alloca i32, align 4
117 // CHECK1-NEXT: [[KERNEL_ARGS:%.*]] = alloca [[STRUCT___TGT_KERNEL_ARGUMENTS:%.*]], align 8
118 // CHECK1-NEXT: [[_TMP1:%.*]] = alloca i32, align 4
119 // CHECK1-NEXT: [[KERNEL_ARGS2:%.*]] = alloca [[STRUCT___TGT_KERNEL_ARGUMENTS]], align 8
120 // CHECK1-NEXT: [[TMP0:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 0
121 // CHECK1-NEXT: store i32 2, ptr [[TMP0]], align 4
122 // CHECK1-NEXT: [[TMP1:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 1
123 // CHECK1-NEXT: store i32 0, ptr [[TMP1]], align 4
124 // CHECK1-NEXT: [[TMP2:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 2
125 // CHECK1-NEXT: store ptr null, ptr [[TMP2]], align 8
126 // CHECK1-NEXT: [[TMP3:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 3
127 // CHECK1-NEXT: store ptr null, ptr [[TMP3]], align 8
128 // CHECK1-NEXT: [[TMP4:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 4
129 // CHECK1-NEXT: store ptr null, ptr [[TMP4]], align 8
130 // CHECK1-NEXT: [[TMP5:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 5
131 // CHECK1-NEXT: store ptr null, ptr [[TMP5]], align 8
132 // CHECK1-NEXT: [[TMP6:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 6
133 // CHECK1-NEXT: store ptr null, ptr [[TMP6]], align 8
134 // CHECK1-NEXT: [[TMP7:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 7
135 // CHECK1-NEXT: store ptr null, ptr [[TMP7]], align 8
136 // CHECK1-NEXT: [[TMP8:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 8
137 // CHECK1-NEXT: store i64 100, ptr [[TMP8]], align 8
138 // CHECK1-NEXT: [[TMP9:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 9
139 // CHECK1-NEXT: store i64 0, ptr [[TMP9]], align 8
140 // CHECK1-NEXT: [[TMP10:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 10
141 // CHECK1-NEXT: store [3 x i32] zeroinitializer, ptr [[TMP10]], align 4
142 // CHECK1-NEXT: [[TMP11:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 11
143 // CHECK1-NEXT: store [3 x i32] zeroinitializer, ptr [[TMP11]], align 4
144 // CHECK1-NEXT: [[TMP12:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 12
145 // CHECK1-NEXT: store i32 0, ptr [[TMP12]], align 4
146 // 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]])
147 // CHECK1-NEXT: [[TMP14:%.*]] = icmp ne i32 [[TMP13]], 0
148 // CHECK1-NEXT: br i1 [[TMP14]], label [[OMP_OFFLOAD_FAILED:%.*]], label [[OMP_OFFLOAD_CONT:%.*]]
149 // CHECK1: omp_offload.failed:
150 // CHECK1-NEXT: call void @{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z9gtid_testv_l43() #[[ATTR3:[0-9]+]]
151 // CHECK1-NEXT: br label [[OMP_OFFLOAD_CONT]]
152 // CHECK1: omp_offload.cont:
153 // CHECK1-NEXT: [[TMP15:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS2]], i32 0, i32 0
154 // CHECK1-NEXT: store i32 2, ptr [[TMP15]], align 4
155 // CHECK1-NEXT: [[TMP16:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS2]], i32 0, i32 1
156 // CHECK1-NEXT: store i32 0, ptr [[TMP16]], align 4
157 // CHECK1-NEXT: [[TMP17:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS2]], i32 0, i32 2
158 // CHECK1-NEXT: store ptr null, ptr [[TMP17]], align 8
159 // CHECK1-NEXT: [[TMP18:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS2]], i32 0, i32 3
160 // CHECK1-NEXT: store ptr null, ptr [[TMP18]], align 8
161 // CHECK1-NEXT: [[TMP19:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS2]], i32 0, i32 4
162 // CHECK1-NEXT: store ptr null, ptr [[TMP19]], align 8
163 // CHECK1-NEXT: [[TMP20:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS2]], i32 0, i32 5
164 // CHECK1-NEXT: store ptr null, ptr [[TMP20]], align 8
165 // CHECK1-NEXT: [[TMP21:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS2]], i32 0, i32 6
166 // CHECK1-NEXT: store ptr null, ptr [[TMP21]], align 8
167 // CHECK1-NEXT: [[TMP22:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS2]], i32 0, i32 7
168 // CHECK1-NEXT: store ptr null, ptr [[TMP22]], align 8
169 // CHECK1-NEXT: [[TMP23:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS2]], i32 0, i32 8
170 // CHECK1-NEXT: store i64 100, ptr [[TMP23]], align 8
171 // CHECK1-NEXT: [[TMP24:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS2]], i32 0, i32 9
172 // CHECK1-NEXT: store i64 0, ptr [[TMP24]], align 8
173 // CHECK1-NEXT: [[TMP25:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS2]], i32 0, i32 10
174 // CHECK1-NEXT: store [3 x i32] zeroinitializer, ptr [[TMP25]], align 4
175 // CHECK1-NEXT: [[TMP26:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS2]], i32 0, i32 11
176 // CHECK1-NEXT: store [3 x i32] [i32 1, i32 0, i32 0], ptr [[TMP26]], align 4
177 // CHECK1-NEXT: [[TMP27:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS2]], i32 0, i32 12
178 // CHECK1-NEXT: store i32 0, ptr [[TMP27]], align 4
179 // CHECK1-NEXT: [[TMP28:%.*]] = call i32 @__tgt_target_kernel(ptr @[[GLOB3]], i64 -1, i32 0, i32 1, ptr @.{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z9gtid_testv_l47.region_id, ptr [[KERNEL_ARGS2]])
180 // CHECK1-NEXT: [[TMP29:%.*]] = icmp ne i32 [[TMP28]], 0
181 // CHECK1-NEXT: br i1 [[TMP29]], label [[OMP_OFFLOAD_FAILED3:%.*]], label [[OMP_OFFLOAD_CONT4:%.*]]
182 // CHECK1: omp_offload.failed3:
183 // CHECK1-NEXT: call void @{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z9gtid_testv_l47() #[[ATTR3]]
184 // CHECK1-NEXT: br label [[OMP_OFFLOAD_CONT4]]
185 // CHECK1: omp_offload.cont4:
186 // CHECK1-NEXT: ret void
189 // CHECK1-LABEL: define {{[^@]+}}@{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z9gtid_testv_l43
190 // CHECK1-SAME: () #[[ATTR1:[0-9]+]] {
191 // CHECK1-NEXT: entry:
192 // 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)
193 // CHECK1-NEXT: ret void
196 // CHECK1-LABEL: define {{[^@]+}}@{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z9gtid_testv_l43.omp_outlined
197 // CHECK1-SAME: (ptr noalias noundef [[DOTGLOBAL_TID_:%.*]], ptr noalias noundef [[DOTBOUND_TID_:%.*]]) #[[ATTR2:[0-9]+]] {
198 // CHECK1-NEXT: entry:
199 // CHECK1-NEXT: [[DOTGLOBAL_TID__ADDR:%.*]] = alloca ptr, align 8
200 // CHECK1-NEXT: [[DOTBOUND_TID__ADDR:%.*]] = alloca ptr, align 8
201 // CHECK1-NEXT: [[DOTOMP_IV:%.*]] = alloca i32, align 4
202 // CHECK1-NEXT: [[TMP:%.*]] = alloca i32, align 4
203 // CHECK1-NEXT: [[DOTOMP_COMB_LB:%.*]] = alloca i32, align 4
204 // CHECK1-NEXT: [[DOTOMP_COMB_UB:%.*]] = alloca i32, align 4
205 // CHECK1-NEXT: [[DOTOMP_STRIDE:%.*]] = alloca i32, align 4
206 // CHECK1-NEXT: [[DOTOMP_IS_LAST:%.*]] = alloca i32, align 4
207 // CHECK1-NEXT: [[I:%.*]] = alloca i32, align 4
208 // CHECK1-NEXT: store ptr [[DOTGLOBAL_TID_]], ptr [[DOTGLOBAL_TID__ADDR]], align 8
209 // CHECK1-NEXT: store ptr [[DOTBOUND_TID_]], ptr [[DOTBOUND_TID__ADDR]], align 8
210 // CHECK1-NEXT: store i32 0, ptr [[DOTOMP_COMB_LB]], align 4
211 // CHECK1-NEXT: store i32 99, ptr [[DOTOMP_COMB_UB]], align 4
212 // CHECK1-NEXT: store i32 1, ptr [[DOTOMP_STRIDE]], align 4
213 // CHECK1-NEXT: store i32 0, ptr [[DOTOMP_IS_LAST]], align 4
214 // CHECK1-NEXT: [[TMP0:%.*]] = load ptr, ptr [[DOTGLOBAL_TID__ADDR]], align 8
215 // CHECK1-NEXT: [[TMP1:%.*]] = load i32, ptr [[TMP0]], align 4
216 // 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)
217 // CHECK1-NEXT: [[TMP2:%.*]] = load i32, ptr [[DOTOMP_COMB_UB]], align 4
218 // CHECK1-NEXT: [[CMP:%.*]] = icmp sgt i32 [[TMP2]], 99
219 // CHECK1-NEXT: br i1 [[CMP]], label [[COND_TRUE:%.*]], label [[COND_FALSE:%.*]]
220 // CHECK1: cond.true:
221 // CHECK1-NEXT: br label [[COND_END:%.*]]
222 // CHECK1: cond.false:
223 // CHECK1-NEXT: [[TMP3:%.*]] = load i32, ptr [[DOTOMP_COMB_UB]], align 4
224 // CHECK1-NEXT: br label [[COND_END]]
225 // CHECK1: cond.end:
226 // CHECK1-NEXT: [[COND:%.*]] = phi i32 [ 99, [[COND_TRUE]] ], [ [[TMP3]], [[COND_FALSE]] ]
227 // CHECK1-NEXT: store i32 [[COND]], ptr [[DOTOMP_COMB_UB]], align 4
228 // CHECK1-NEXT: [[TMP4:%.*]] = load i32, ptr [[DOTOMP_COMB_LB]], align 4
229 // CHECK1-NEXT: store i32 [[TMP4]], ptr [[DOTOMP_IV]], align 4
230 // CHECK1-NEXT: br label [[OMP_INNER_FOR_COND:%.*]]
231 // CHECK1: omp.inner.for.cond:
232 // CHECK1-NEXT: [[TMP5:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP11:![0-9]+]]
233 // CHECK1-NEXT: [[TMP6:%.*]] = load i32, ptr [[DOTOMP_COMB_UB]], align 4, !llvm.access.group [[ACC_GRP11]]
234 // CHECK1-NEXT: [[CMP1:%.*]] = icmp sle i32 [[TMP5]], [[TMP6]]
235 // CHECK1-NEXT: br i1 [[CMP1]], label [[OMP_INNER_FOR_BODY:%.*]], label [[OMP_INNER_FOR_END:%.*]]
236 // CHECK1: omp.inner.for.body:
237 // CHECK1-NEXT: [[TMP7:%.*]] = load i32, ptr [[DOTOMP_COMB_LB]], align 4, !llvm.access.group [[ACC_GRP11]]
238 // CHECK1-NEXT: [[TMP8:%.*]] = zext i32 [[TMP7]] to i64
239 // CHECK1-NEXT: [[TMP9:%.*]] = load i32, ptr [[DOTOMP_COMB_UB]], align 4, !llvm.access.group [[ACC_GRP11]]
240 // CHECK1-NEXT: [[TMP10:%.*]] = zext i32 [[TMP9]] to i64
241 // 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]]
242 // CHECK1-NEXT: br label [[OMP_INNER_FOR_INC:%.*]]
243 // CHECK1: omp.inner.for.inc:
244 // CHECK1-NEXT: [[TMP11:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP11]]
245 // CHECK1-NEXT: [[TMP12:%.*]] = load i32, ptr [[DOTOMP_STRIDE]], align 4, !llvm.access.group [[ACC_GRP11]]
246 // CHECK1-NEXT: [[ADD:%.*]] = add nsw i32 [[TMP11]], [[TMP12]]
247 // CHECK1-NEXT: store i32 [[ADD]], ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP11]]
248 // CHECK1-NEXT: br label [[OMP_INNER_FOR_COND]], !llvm.loop [[LOOP12:![0-9]+]]
249 // CHECK1: omp.inner.for.end:
250 // CHECK1-NEXT: br label [[OMP_LOOP_EXIT:%.*]]
251 // CHECK1: omp.loop.exit:
252 // CHECK1-NEXT: call void @__kmpc_for_static_fini(ptr @[[GLOB1]], i32 [[TMP1]])
253 // CHECK1-NEXT: [[TMP13:%.*]] = load i32, ptr [[DOTOMP_IS_LAST]], align 4
254 // CHECK1-NEXT: [[TMP14:%.*]] = icmp ne i32 [[TMP13]], 0
255 // CHECK1-NEXT: br i1 [[TMP14]], label [[DOTOMP_FINAL_THEN:%.*]], label [[DOTOMP_FINAL_DONE:%.*]]
256 // CHECK1: .omp.final.then:
257 // CHECK1-NEXT: store i32 100, ptr [[I]], align 4
258 // CHECK1-NEXT: br label [[DOTOMP_FINAL_DONE]]
259 // CHECK1: .omp.final.done:
260 // CHECK1-NEXT: ret void
263 // CHECK1-LABEL: define {{[^@]+}}@{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z9gtid_testv_l43.omp_outlined.omp_outlined
264 // CHECK1-SAME: (ptr noalias noundef [[DOTGLOBAL_TID_:%.*]], ptr noalias noundef [[DOTBOUND_TID_:%.*]], i64 noundef [[DOTPREVIOUS_LB_:%.*]], i64 noundef [[DOTPREVIOUS_UB_:%.*]]) #[[ATTR2]] {
265 // CHECK1-NEXT: entry:
266 // CHECK1-NEXT: [[DOTGLOBAL_TID__ADDR:%.*]] = alloca ptr, align 8
267 // CHECK1-NEXT: [[DOTBOUND_TID__ADDR:%.*]] = alloca ptr, align 8
268 // CHECK1-NEXT: [[DOTPREVIOUS_LB__ADDR:%.*]] = alloca i64, align 8
269 // CHECK1-NEXT: [[DOTPREVIOUS_UB__ADDR:%.*]] = alloca i64, align 8
270 // CHECK1-NEXT: [[DOTOMP_IV:%.*]] = alloca i32, align 4
271 // CHECK1-NEXT: [[TMP:%.*]] = alloca i32, align 4
272 // CHECK1-NEXT: [[DOTOMP_LB:%.*]] = alloca i32, align 4
273 // CHECK1-NEXT: [[DOTOMP_UB:%.*]] = alloca i32, align 4
274 // CHECK1-NEXT: [[DOTOMP_STRIDE:%.*]] = alloca i32, align 4
275 // CHECK1-NEXT: [[DOTOMP_IS_LAST:%.*]] = alloca i32, align 4
276 // CHECK1-NEXT: [[I:%.*]] = alloca i32, align 4
277 // CHECK1-NEXT: store ptr [[DOTGLOBAL_TID_]], ptr [[DOTGLOBAL_TID__ADDR]], align 8
278 // CHECK1-NEXT: store ptr [[DOTBOUND_TID_]], ptr [[DOTBOUND_TID__ADDR]], align 8
279 // CHECK1-NEXT: store i64 [[DOTPREVIOUS_LB_]], ptr [[DOTPREVIOUS_LB__ADDR]], align 8
280 // CHECK1-NEXT: store i64 [[DOTPREVIOUS_UB_]], ptr [[DOTPREVIOUS_UB__ADDR]], align 8
281 // CHECK1-NEXT: store i32 0, ptr [[DOTOMP_LB]], align 4
282 // CHECK1-NEXT: store i32 99, ptr [[DOTOMP_UB]], align 4
283 // CHECK1-NEXT: [[TMP0:%.*]] = load i64, ptr [[DOTPREVIOUS_LB__ADDR]], align 8
284 // CHECK1-NEXT: [[CONV:%.*]] = trunc i64 [[TMP0]] to i32
285 // CHECK1-NEXT: [[TMP1:%.*]] = load i64, ptr [[DOTPREVIOUS_UB__ADDR]], align 8
286 // CHECK1-NEXT: [[CONV1:%.*]] = trunc i64 [[TMP1]] to i32
287 // CHECK1-NEXT: store i32 [[CONV]], ptr [[DOTOMP_LB]], align 4
288 // CHECK1-NEXT: store i32 [[CONV1]], ptr [[DOTOMP_UB]], align 4
289 // CHECK1-NEXT: store i32 1, ptr [[DOTOMP_STRIDE]], align 4
290 // CHECK1-NEXT: store i32 0, ptr [[DOTOMP_IS_LAST]], align 4
291 // CHECK1-NEXT: [[TMP2:%.*]] = load ptr, ptr [[DOTGLOBAL_TID__ADDR]], align 8
292 // CHECK1-NEXT: [[TMP3:%.*]] = load i32, ptr [[TMP2]], align 4
293 // 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)
294 // CHECK1-NEXT: [[TMP4:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4
295 // CHECK1-NEXT: [[CMP:%.*]] = icmp sgt i32 [[TMP4]], 99
296 // CHECK1-NEXT: br i1 [[CMP]], label [[COND_TRUE:%.*]], label [[COND_FALSE:%.*]]
297 // CHECK1: cond.true:
298 // CHECK1-NEXT: br label [[COND_END:%.*]]
299 // CHECK1: cond.false:
300 // CHECK1-NEXT: [[TMP5:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4
301 // CHECK1-NEXT: br label [[COND_END]]
302 // CHECK1: cond.end:
303 // CHECK1-NEXT: [[COND:%.*]] = phi i32 [ 99, [[COND_TRUE]] ], [ [[TMP5]], [[COND_FALSE]] ]
304 // CHECK1-NEXT: store i32 [[COND]], ptr [[DOTOMP_UB]], align 4
305 // CHECK1-NEXT: [[TMP6:%.*]] = load i32, ptr [[DOTOMP_LB]], align 4
306 // CHECK1-NEXT: store i32 [[TMP6]], ptr [[DOTOMP_IV]], align 4
307 // CHECK1-NEXT: br label [[OMP_INNER_FOR_COND:%.*]]
308 // CHECK1: omp.inner.for.cond:
309 // CHECK1-NEXT: [[TMP7:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP15:![0-9]+]]
310 // CHECK1-NEXT: [[TMP8:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4, !llvm.access.group [[ACC_GRP15]]
311 // CHECK1-NEXT: [[CMP2:%.*]] = icmp sle i32 [[TMP7]], [[TMP8]]
312 // CHECK1-NEXT: br i1 [[CMP2]], label [[OMP_INNER_FOR_BODY:%.*]], label [[OMP_INNER_FOR_END:%.*]]
313 // CHECK1: omp.inner.for.body:
314 // CHECK1-NEXT: [[TMP9:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP15]]
315 // CHECK1-NEXT: [[MUL:%.*]] = mul nsw i32 [[TMP9]], 1
316 // CHECK1-NEXT: [[ADD:%.*]] = add nsw i32 0, [[MUL]]
317 // CHECK1-NEXT: store i32 [[ADD]], ptr [[I]], align 4, !llvm.access.group [[ACC_GRP15]]
318 // CHECK1-NEXT: br label [[OMP_BODY_CONTINUE:%.*]]
319 // CHECK1: omp.body.continue:
320 // CHECK1-NEXT: br label [[OMP_INNER_FOR_INC:%.*]]
321 // CHECK1: omp.inner.for.inc:
322 // CHECK1-NEXT: [[TMP10:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP15]]
323 // CHECK1-NEXT: [[ADD3:%.*]] = add nsw i32 [[TMP10]], 1
324 // CHECK1-NEXT: store i32 [[ADD3]], ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP15]]
325 // CHECK1-NEXT: br label [[OMP_INNER_FOR_COND]], !llvm.loop [[LOOP16:![0-9]+]]
326 // CHECK1: omp.inner.for.end:
327 // CHECK1-NEXT: br label [[OMP_LOOP_EXIT:%.*]]
328 // CHECK1: omp.loop.exit:
329 // CHECK1-NEXT: call void @__kmpc_for_static_fini(ptr @[[GLOB1]], i32 [[TMP3]])
330 // CHECK1-NEXT: [[TMP11:%.*]] = load i32, ptr [[DOTOMP_IS_LAST]], align 4
331 // CHECK1-NEXT: [[TMP12:%.*]] = icmp ne i32 [[TMP11]], 0
332 // CHECK1-NEXT: br i1 [[TMP12]], label [[DOTOMP_FINAL_THEN:%.*]], label [[DOTOMP_FINAL_DONE:%.*]]
333 // CHECK1: .omp.final.then:
334 // CHECK1-NEXT: store i32 100, ptr [[I]], align 4
335 // CHECK1-NEXT: br label [[DOTOMP_FINAL_DONE]]
336 // CHECK1: .omp.final.done:
337 // CHECK1-NEXT: ret void
340 // CHECK1-LABEL: define {{[^@]+}}@{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z9gtid_testv_l47
341 // CHECK1-SAME: () #[[ATTR1]] {
342 // CHECK1-NEXT: entry:
343 // 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_l47.omp_outlined)
344 // CHECK1-NEXT: ret void
347 // CHECK1-LABEL: define {{[^@]+}}@{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z9gtid_testv_l47.omp_outlined
348 // CHECK1-SAME: (ptr noalias noundef [[DOTGLOBAL_TID_:%.*]], ptr noalias noundef [[DOTBOUND_TID_:%.*]]) #[[ATTR2]] {
349 // CHECK1-NEXT: entry:
350 // CHECK1-NEXT: [[DOTGLOBAL_TID__ADDR:%.*]] = alloca ptr, align 8
351 // CHECK1-NEXT: [[DOTBOUND_TID__ADDR:%.*]] = alloca ptr, align 8
352 // CHECK1-NEXT: [[DOTOMP_IV:%.*]] = alloca i32, align 4
353 // CHECK1-NEXT: [[TMP:%.*]] = alloca i32, align 4
354 // CHECK1-NEXT: [[DOTOMP_COMB_LB:%.*]] = alloca i32, align 4
355 // CHECK1-NEXT: [[DOTOMP_COMB_UB:%.*]] = alloca i32, align 4
356 // CHECK1-NEXT: [[DOTOMP_STRIDE:%.*]] = alloca i32, align 4
357 // CHECK1-NEXT: [[DOTOMP_IS_LAST:%.*]] = alloca i32, align 4
358 // CHECK1-NEXT: [[I:%.*]] = alloca i32, align 4
359 // CHECK1-NEXT: [[DOTBOUND_ZERO_ADDR:%.*]] = alloca i32, align 4
360 // CHECK1-NEXT: store ptr [[DOTGLOBAL_TID_]], ptr [[DOTGLOBAL_TID__ADDR]], align 8
361 // CHECK1-NEXT: store ptr [[DOTBOUND_TID_]], ptr [[DOTBOUND_TID__ADDR]], align 8
362 // CHECK1-NEXT: store i32 0, ptr [[DOTOMP_COMB_LB]], align 4
363 // CHECK1-NEXT: store i32 99, ptr [[DOTOMP_COMB_UB]], align 4
364 // CHECK1-NEXT: store i32 1, ptr [[DOTOMP_STRIDE]], align 4
365 // CHECK1-NEXT: store i32 0, ptr [[DOTOMP_IS_LAST]], align 4
366 // CHECK1-NEXT: [[TMP0:%.*]] = load ptr, ptr [[DOTGLOBAL_TID__ADDR]], align 8
367 // CHECK1-NEXT: [[TMP1:%.*]] = load i32, ptr [[TMP0]], align 4
368 // 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)
369 // CHECK1-NEXT: [[TMP2:%.*]] = load i32, ptr [[DOTOMP_COMB_UB]], align 4
370 // CHECK1-NEXT: [[CMP:%.*]] = icmp sgt i32 [[TMP2]], 99
371 // CHECK1-NEXT: br i1 [[CMP]], label [[COND_TRUE:%.*]], label [[COND_FALSE:%.*]]
372 // CHECK1: cond.true:
373 // CHECK1-NEXT: br label [[COND_END:%.*]]
374 // CHECK1: cond.false:
375 // CHECK1-NEXT: [[TMP3:%.*]] = load i32, ptr [[DOTOMP_COMB_UB]], align 4
376 // CHECK1-NEXT: br label [[COND_END]]
377 // CHECK1: cond.end:
378 // CHECK1-NEXT: [[COND:%.*]] = phi i32 [ 99, [[COND_TRUE]] ], [ [[TMP3]], [[COND_FALSE]] ]
379 // CHECK1-NEXT: store i32 [[COND]], ptr [[DOTOMP_COMB_UB]], align 4
380 // CHECK1-NEXT: [[TMP4:%.*]] = load i32, ptr [[DOTOMP_COMB_LB]], align 4
381 // CHECK1-NEXT: store i32 [[TMP4]], ptr [[DOTOMP_IV]], align 4
382 // CHECK1-NEXT: br label [[OMP_INNER_FOR_COND:%.*]]
383 // CHECK1: omp.inner.for.cond:
384 // CHECK1-NEXT: [[TMP5:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP20:![0-9]+]]
385 // CHECK1-NEXT: [[TMP6:%.*]] = load i32, ptr [[DOTOMP_COMB_UB]], align 4, !llvm.access.group [[ACC_GRP20]]
386 // CHECK1-NEXT: [[CMP1:%.*]] = icmp sle i32 [[TMP5]], [[TMP6]]
387 // CHECK1-NEXT: br i1 [[CMP1]], label [[OMP_INNER_FOR_BODY:%.*]], label [[OMP_INNER_FOR_END:%.*]]
388 // CHECK1: omp.inner.for.body:
389 // CHECK1-NEXT: [[TMP7:%.*]] = load i32, ptr [[DOTOMP_COMB_LB]], align 4, !llvm.access.group [[ACC_GRP20]]
390 // CHECK1-NEXT: [[TMP8:%.*]] = zext i32 [[TMP7]] to i64
391 // CHECK1-NEXT: [[TMP9:%.*]] = load i32, ptr [[DOTOMP_COMB_UB]], align 4, !llvm.access.group [[ACC_GRP20]]
392 // CHECK1-NEXT: [[TMP10:%.*]] = zext i32 [[TMP9]] to i64
393 // CHECK1-NEXT: call void @__kmpc_serialized_parallel(ptr @[[GLOB3]], i32 [[TMP1]]), !llvm.access.group [[ACC_GRP20]]
394 // CHECK1-NEXT: [[TMP11:%.*]] = load ptr, ptr [[DOTGLOBAL_TID__ADDR]], align 8, !llvm.access.group [[ACC_GRP20]]
395 // CHECK1-NEXT: store i32 0, ptr [[DOTBOUND_ZERO_ADDR]], align 4, !llvm.access.group [[ACC_GRP20]]
396 // CHECK1-NEXT: call void @{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z9gtid_testv_l47.omp_outlined.omp_outlined(ptr [[TMP11]], ptr [[DOTBOUND_ZERO_ADDR]], i64 [[TMP8]], i64 [[TMP10]]) #[[ATTR3]], !llvm.access.group [[ACC_GRP20]]
397 // CHECK1-NEXT: call void @__kmpc_end_serialized_parallel(ptr @[[GLOB3]], i32 [[TMP1]]), !llvm.access.group [[ACC_GRP20]]
398 // CHECK1-NEXT: br label [[OMP_INNER_FOR_INC:%.*]]
399 // CHECK1: omp.inner.for.inc:
400 // CHECK1-NEXT: [[TMP12:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP20]]
401 // CHECK1-NEXT: [[TMP13:%.*]] = load i32, ptr [[DOTOMP_STRIDE]], align 4, !llvm.access.group [[ACC_GRP20]]
402 // CHECK1-NEXT: [[ADD:%.*]] = add nsw i32 [[TMP12]], [[TMP13]]
403 // CHECK1-NEXT: store i32 [[ADD]], ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP20]]
404 // CHECK1-NEXT: br label [[OMP_INNER_FOR_COND]], !llvm.loop [[LOOP21:![0-9]+]]
405 // CHECK1: omp.inner.for.end:
406 // CHECK1-NEXT: br label [[OMP_LOOP_EXIT:%.*]]
407 // CHECK1: omp.loop.exit:
408 // CHECK1-NEXT: call void @__kmpc_for_static_fini(ptr @[[GLOB1]], i32 [[TMP1]])
409 // CHECK1-NEXT: [[TMP14:%.*]] = load i32, ptr [[DOTOMP_IS_LAST]], align 4
410 // CHECK1-NEXT: [[TMP15:%.*]] = icmp ne i32 [[TMP14]], 0
411 // CHECK1-NEXT: br i1 [[TMP15]], label [[DOTOMP_FINAL_THEN:%.*]], label [[DOTOMP_FINAL_DONE:%.*]]
412 // CHECK1: .omp.final.then:
413 // CHECK1-NEXT: store i32 100, ptr [[I]], align 4
414 // CHECK1-NEXT: br label [[DOTOMP_FINAL_DONE]]
415 // CHECK1: .omp.final.done:
416 // CHECK1-NEXT: ret void
419 // CHECK1-LABEL: define {{[^@]+}}@{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z9gtid_testv_l47.omp_outlined.omp_outlined
420 // CHECK1-SAME: (ptr noalias noundef [[DOTGLOBAL_TID_:%.*]], ptr noalias noundef [[DOTBOUND_TID_:%.*]], i64 noundef [[DOTPREVIOUS_LB_:%.*]], i64 noundef [[DOTPREVIOUS_UB_:%.*]]) #[[ATTR2]] {
421 // CHECK1-NEXT: entry:
422 // CHECK1-NEXT: [[DOTGLOBAL_TID__ADDR:%.*]] = alloca ptr, align 8
423 // CHECK1-NEXT: [[DOTBOUND_TID__ADDR:%.*]] = alloca ptr, align 8
424 // CHECK1-NEXT: [[DOTPREVIOUS_LB__ADDR:%.*]] = alloca i64, align 8
425 // CHECK1-NEXT: [[DOTPREVIOUS_UB__ADDR:%.*]] = alloca i64, align 8
426 // CHECK1-NEXT: [[DOTOMP_IV:%.*]] = alloca i32, align 4
427 // CHECK1-NEXT: [[TMP:%.*]] = alloca i32, align 4
428 // CHECK1-NEXT: [[DOTOMP_LB:%.*]] = alloca i32, align 4
429 // CHECK1-NEXT: [[DOTOMP_UB:%.*]] = alloca i32, align 4
430 // CHECK1-NEXT: [[DOTOMP_STRIDE:%.*]] = alloca i32, align 4
431 // CHECK1-NEXT: [[DOTOMP_IS_LAST:%.*]] = alloca i32, align 4
432 // CHECK1-NEXT: [[I:%.*]] = alloca i32, align 4
433 // CHECK1-NEXT: store ptr [[DOTGLOBAL_TID_]], ptr [[DOTGLOBAL_TID__ADDR]], align 8
434 // CHECK1-NEXT: store ptr [[DOTBOUND_TID_]], ptr [[DOTBOUND_TID__ADDR]], align 8
435 // CHECK1-NEXT: store i64 [[DOTPREVIOUS_LB_]], ptr [[DOTPREVIOUS_LB__ADDR]], align 8
436 // CHECK1-NEXT: store i64 [[DOTPREVIOUS_UB_]], ptr [[DOTPREVIOUS_UB__ADDR]], align 8
437 // CHECK1-NEXT: store i32 0, ptr [[DOTOMP_LB]], align 4
438 // CHECK1-NEXT: store i32 99, ptr [[DOTOMP_UB]], align 4
439 // CHECK1-NEXT: [[TMP0:%.*]] = load i64, ptr [[DOTPREVIOUS_LB__ADDR]], align 8
440 // CHECK1-NEXT: [[CONV:%.*]] = trunc i64 [[TMP0]] to i32
441 // CHECK1-NEXT: [[TMP1:%.*]] = load i64, ptr [[DOTPREVIOUS_UB__ADDR]], align 8
442 // CHECK1-NEXT: [[CONV1:%.*]] = trunc i64 [[TMP1]] to i32
443 // CHECK1-NEXT: store i32 [[CONV]], ptr [[DOTOMP_LB]], align 4
444 // CHECK1-NEXT: store i32 [[CONV1]], ptr [[DOTOMP_UB]], align 4
445 // CHECK1-NEXT: store i32 1, ptr [[DOTOMP_STRIDE]], align 4
446 // CHECK1-NEXT: store i32 0, ptr [[DOTOMP_IS_LAST]], align 4
447 // CHECK1-NEXT: [[TMP2:%.*]] = load ptr, ptr [[DOTGLOBAL_TID__ADDR]], align 8
448 // CHECK1-NEXT: [[TMP3:%.*]] = load i32, ptr [[TMP2]], align 4
449 // 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)
450 // CHECK1-NEXT: [[TMP4:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4
451 // CHECK1-NEXT: [[CMP:%.*]] = icmp sgt i32 [[TMP4]], 99
452 // CHECK1-NEXT: br i1 [[CMP]], label [[COND_TRUE:%.*]], label [[COND_FALSE:%.*]]
453 // CHECK1: cond.true:
454 // CHECK1-NEXT: br label [[COND_END:%.*]]
455 // CHECK1: cond.false:
456 // CHECK1-NEXT: [[TMP5:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4
457 // CHECK1-NEXT: br label [[COND_END]]
458 // CHECK1: cond.end:
459 // CHECK1-NEXT: [[COND:%.*]] = phi i32 [ 99, [[COND_TRUE]] ], [ [[TMP5]], [[COND_FALSE]] ]
460 // CHECK1-NEXT: store i32 [[COND]], ptr [[DOTOMP_UB]], align 4
461 // CHECK1-NEXT: [[TMP6:%.*]] = load i32, ptr [[DOTOMP_LB]], align 4
462 // CHECK1-NEXT: store i32 [[TMP6]], ptr [[DOTOMP_IV]], align 4
463 // CHECK1-NEXT: br label [[OMP_INNER_FOR_COND:%.*]]
464 // CHECK1: omp.inner.for.cond:
465 // CHECK1-NEXT: [[TMP7:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP23:![0-9]+]]
466 // CHECK1-NEXT: [[TMP8:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4, !llvm.access.group [[ACC_GRP23]]
467 // CHECK1-NEXT: [[CMP2:%.*]] = icmp sle i32 [[TMP7]], [[TMP8]]
468 // CHECK1-NEXT: br i1 [[CMP2]], label [[OMP_INNER_FOR_BODY:%.*]], label [[OMP_INNER_FOR_END:%.*]]
469 // CHECK1: omp.inner.for.body:
470 // CHECK1-NEXT: [[TMP9:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP23]]
471 // CHECK1-NEXT: [[MUL:%.*]] = mul nsw i32 [[TMP9]], 1
472 // CHECK1-NEXT: [[ADD:%.*]] = add nsw i32 0, [[MUL]]
473 // CHECK1-NEXT: store i32 [[ADD]], ptr [[I]], align 4, !llvm.access.group [[ACC_GRP23]]
474 // CHECK1-NEXT: call void @_Z9gtid_testv(), !llvm.access.group [[ACC_GRP23]]
475 // CHECK1-NEXT: br label [[OMP_BODY_CONTINUE:%.*]]
476 // CHECK1: omp.body.continue:
477 // CHECK1-NEXT: br label [[OMP_INNER_FOR_INC:%.*]]
478 // CHECK1: omp.inner.for.inc:
479 // CHECK1-NEXT: [[TMP10:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP23]]
480 // CHECK1-NEXT: [[ADD3:%.*]] = add nsw i32 [[TMP10]], 1
481 // CHECK1-NEXT: store i32 [[ADD3]], ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP23]]
482 // CHECK1-NEXT: br label [[OMP_INNER_FOR_COND]], !llvm.loop [[LOOP24:![0-9]+]]
483 // CHECK1: omp.inner.for.end:
484 // CHECK1-NEXT: br label [[OMP_LOOP_EXIT:%.*]]
485 // CHECK1: omp.loop.exit:
486 // CHECK1-NEXT: call void @__kmpc_for_static_fini(ptr @[[GLOB1]], i32 [[TMP3]])
487 // CHECK1-NEXT: [[TMP11:%.*]] = load i32, ptr [[DOTOMP_IS_LAST]], align 4
488 // CHECK1-NEXT: [[TMP12:%.*]] = icmp ne i32 [[TMP11]], 0
489 // CHECK1-NEXT: br i1 [[TMP12]], label [[DOTOMP_FINAL_THEN:%.*]], label [[DOTOMP_FINAL_DONE:%.*]]
490 // CHECK1: .omp.final.then:
491 // CHECK1-NEXT: store i32 100, ptr [[I]], align 4
492 // CHECK1-NEXT: br label [[DOTOMP_FINAL_DONE]]
493 // CHECK1: .omp.final.done:
494 // CHECK1-NEXT: ret void
497 // CHECK1-LABEL: define {{[^@]+}}@main
498 // CHECK1-SAME: () #[[ATTR4:[0-9]+]] {
499 // CHECK1-NEXT: entry:
500 // CHECK1-NEXT: [[RETVAL:%.*]] = alloca i32, align 4
501 // CHECK1-NEXT: [[TMP:%.*]] = alloca i32, align 4
502 // CHECK1-NEXT: [[KERNEL_ARGS:%.*]] = alloca [[STRUCT___TGT_KERNEL_ARGUMENTS:%.*]], align 8
503 // CHECK1-NEXT: [[_TMP1:%.*]] = alloca i32, align 4
504 // CHECK1-NEXT: [[KERNEL_ARGS2:%.*]] = alloca [[STRUCT___TGT_KERNEL_ARGUMENTS]], align 8
505 // CHECK1-NEXT: [[ARG_CASTED:%.*]] = alloca i64, align 8
506 // CHECK1-NEXT: [[DOTOFFLOAD_BASEPTRS:%.*]] = alloca [1 x ptr], align 8
507 // CHECK1-NEXT: [[DOTOFFLOAD_PTRS:%.*]] = alloca [1 x ptr], align 8
508 // CHECK1-NEXT: [[DOTOFFLOAD_MAPPERS:%.*]] = alloca [1 x ptr], align 8
509 // CHECK1-NEXT: [[DOTCAPTURE_EXPR_:%.*]] = alloca i8, align 1
510 // CHECK1-NEXT: [[_TMP6:%.*]] = alloca i32, align 4
511 // CHECK1-NEXT: [[KERNEL_ARGS7:%.*]] = alloca [[STRUCT___TGT_KERNEL_ARGUMENTS]], align 8
512 // CHECK1-NEXT: store i32 0, ptr [[RETVAL]], align 4
513 // CHECK1-NEXT: [[TMP0:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 0
514 // CHECK1-NEXT: store i32 2, ptr [[TMP0]], align 4
515 // CHECK1-NEXT: [[TMP1:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 1
516 // CHECK1-NEXT: store i32 0, ptr [[TMP1]], align 4
517 // CHECK1-NEXT: [[TMP2:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 2
518 // CHECK1-NEXT: store ptr null, ptr [[TMP2]], align 8
519 // CHECK1-NEXT: [[TMP3:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 3
520 // CHECK1-NEXT: store ptr null, ptr [[TMP3]], align 8
521 // CHECK1-NEXT: [[TMP4:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 4
522 // CHECK1-NEXT: store ptr null, ptr [[TMP4]], align 8
523 // CHECK1-NEXT: [[TMP5:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 5
524 // CHECK1-NEXT: store ptr null, ptr [[TMP5]], align 8
525 // CHECK1-NEXT: [[TMP6:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 6
526 // CHECK1-NEXT: store ptr null, ptr [[TMP6]], align 8
527 // CHECK1-NEXT: [[TMP7:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 7
528 // CHECK1-NEXT: store ptr null, ptr [[TMP7]], align 8
529 // CHECK1-NEXT: [[TMP8:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 8
530 // CHECK1-NEXT: store i64 100, ptr [[TMP8]], align 8
531 // CHECK1-NEXT: [[TMP9:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 9
532 // CHECK1-NEXT: store i64 0, ptr [[TMP9]], align 8
533 // CHECK1-NEXT: [[TMP10:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 10
534 // CHECK1-NEXT: store [3 x i32] zeroinitializer, ptr [[TMP10]], align 4
535 // CHECK1-NEXT: [[TMP11:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 11
536 // CHECK1-NEXT: store [3 x i32] zeroinitializer, ptr [[TMP11]], align 4
537 // CHECK1-NEXT: [[TMP12:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 12
538 // CHECK1-NEXT: store i32 0, ptr [[TMP12]], align 4
539 // 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_l76.region_id, ptr [[KERNEL_ARGS]])
540 // CHECK1-NEXT: [[TMP14:%.*]] = icmp ne i32 [[TMP13]], 0
541 // CHECK1-NEXT: br i1 [[TMP14]], label [[OMP_OFFLOAD_FAILED:%.*]], label [[OMP_OFFLOAD_CONT:%.*]]
542 // CHECK1: omp_offload.failed:
543 // CHECK1-NEXT: call void @{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}_main_l76() #[[ATTR3]]
544 // CHECK1-NEXT: br label [[OMP_OFFLOAD_CONT]]
545 // CHECK1: omp_offload.cont:
546 // CHECK1-NEXT: [[TMP15:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS2]], i32 0, i32 0
547 // CHECK1-NEXT: store i32 2, ptr [[TMP15]], align 4
548 // CHECK1-NEXT: [[TMP16:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS2]], i32 0, i32 1
549 // CHECK1-NEXT: store i32 0, ptr [[TMP16]], align 4
550 // CHECK1-NEXT: [[TMP17:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS2]], i32 0, i32 2
551 // CHECK1-NEXT: store ptr null, ptr [[TMP17]], align 8
552 // CHECK1-NEXT: [[TMP18:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS2]], i32 0, i32 3
553 // CHECK1-NEXT: store ptr null, ptr [[TMP18]], align 8
554 // CHECK1-NEXT: [[TMP19:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS2]], i32 0, i32 4
555 // CHECK1-NEXT: store ptr null, ptr [[TMP19]], align 8
556 // CHECK1-NEXT: [[TMP20:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS2]], i32 0, i32 5
557 // CHECK1-NEXT: store ptr null, ptr [[TMP20]], align 8
558 // CHECK1-NEXT: [[TMP21:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS2]], i32 0, i32 6
559 // CHECK1-NEXT: store ptr null, ptr [[TMP21]], align 8
560 // CHECK1-NEXT: [[TMP22:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS2]], i32 0, i32 7
561 // CHECK1-NEXT: store ptr null, ptr [[TMP22]], align 8
562 // CHECK1-NEXT: [[TMP23:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS2]], i32 0, i32 8
563 // CHECK1-NEXT: store i64 100, ptr [[TMP23]], align 8
564 // CHECK1-NEXT: [[TMP24:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS2]], i32 0, i32 9
565 // CHECK1-NEXT: store i64 0, ptr [[TMP24]], align 8
566 // CHECK1-NEXT: [[TMP25:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS2]], i32 0, i32 10
567 // CHECK1-NEXT: store [3 x i32] zeroinitializer, ptr [[TMP25]], align 4
568 // CHECK1-NEXT: [[TMP26:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS2]], i32 0, i32 11
569 // CHECK1-NEXT: store [3 x i32] [i32 1, i32 0, i32 0], ptr [[TMP26]], align 4
570 // CHECK1-NEXT: [[TMP27:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS2]], i32 0, i32 12
571 // CHECK1-NEXT: store i32 0, ptr [[TMP27]], align 4
572 // CHECK1-NEXT: [[TMP28:%.*]] = call i32 @__tgt_target_kernel(ptr @[[GLOB3]], i64 -1, i32 0, i32 1, ptr @.{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}_main_l84.region_id, ptr [[KERNEL_ARGS2]])
573 // CHECK1-NEXT: [[TMP29:%.*]] = icmp ne i32 [[TMP28]], 0
574 // CHECK1-NEXT: br i1 [[TMP29]], label [[OMP_OFFLOAD_FAILED3:%.*]], label [[OMP_OFFLOAD_CONT4:%.*]]
575 // CHECK1: omp_offload.failed3:
576 // CHECK1-NEXT: call void @{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}_main_l84() #[[ATTR3]]
577 // CHECK1-NEXT: br label [[OMP_OFFLOAD_CONT4]]
578 // CHECK1: omp_offload.cont4:
579 // CHECK1-NEXT: [[TMP30:%.*]] = load i32, ptr @Arg, align 4
580 // CHECK1-NEXT: store i32 [[TMP30]], ptr [[ARG_CASTED]], align 4
581 // CHECK1-NEXT: [[TMP31:%.*]] = load i64, ptr [[ARG_CASTED]], align 8
582 // CHECK1-NEXT: [[TMP32:%.*]] = getelementptr inbounds [1 x ptr], ptr [[DOTOFFLOAD_BASEPTRS]], i32 0, i32 0
583 // CHECK1-NEXT: store i64 [[TMP31]], ptr [[TMP32]], align 8
584 // CHECK1-NEXT: [[TMP33:%.*]] = getelementptr inbounds [1 x ptr], ptr [[DOTOFFLOAD_PTRS]], i32 0, i32 0
585 // CHECK1-NEXT: store i64 [[TMP31]], ptr [[TMP33]], align 8
586 // CHECK1-NEXT: [[TMP34:%.*]] = getelementptr inbounds [1 x ptr], ptr [[DOTOFFLOAD_MAPPERS]], i64 0, i64 0
587 // CHECK1-NEXT: store ptr null, ptr [[TMP34]], align 8
588 // CHECK1-NEXT: [[TMP35:%.*]] = getelementptr inbounds [1 x ptr], ptr [[DOTOFFLOAD_BASEPTRS]], i32 0, i32 0
589 // CHECK1-NEXT: [[TMP36:%.*]] = getelementptr inbounds [1 x ptr], ptr [[DOTOFFLOAD_PTRS]], i32 0, i32 0
590 // CHECK1-NEXT: [[TMP37:%.*]] = load i32, ptr @Arg, align 4
591 // CHECK1-NEXT: [[TOBOOL:%.*]] = icmp ne i32 [[TMP37]], 0
592 // CHECK1-NEXT: [[FROMBOOL:%.*]] = zext i1 [[TOBOOL]] to i8
593 // CHECK1-NEXT: store i8 [[FROMBOOL]], ptr [[DOTCAPTURE_EXPR_]], align 1
594 // CHECK1-NEXT: [[TMP38:%.*]] = load i8, ptr [[DOTCAPTURE_EXPR_]], align 1
595 // CHECK1-NEXT: [[TOBOOL5:%.*]] = trunc i8 [[TMP38]] to i1
596 // CHECK1-NEXT: [[TMP39:%.*]] = select i1 [[TOBOOL5]], i32 0, i32 1
597 // CHECK1-NEXT: [[TMP40:%.*]] = insertvalue [3 x i32] zeroinitializer, i32 [[TMP39]], 0
598 // CHECK1-NEXT: [[TMP41:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS7]], i32 0, i32 0
599 // CHECK1-NEXT: store i32 2, ptr [[TMP41]], align 4
600 // CHECK1-NEXT: [[TMP42:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS7]], i32 0, i32 1
601 // CHECK1-NEXT: store i32 1, ptr [[TMP42]], align 4
602 // CHECK1-NEXT: [[TMP43:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS7]], i32 0, i32 2
603 // CHECK1-NEXT: store ptr [[TMP35]], ptr [[TMP43]], align 8
604 // CHECK1-NEXT: [[TMP44:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS7]], i32 0, i32 3
605 // CHECK1-NEXT: store ptr [[TMP36]], ptr [[TMP44]], align 8
606 // CHECK1-NEXT: [[TMP45:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS7]], i32 0, i32 4
607 // CHECK1-NEXT: store ptr @.offload_sizes, ptr [[TMP45]], align 8
608 // CHECK1-NEXT: [[TMP46:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS7]], i32 0, i32 5
609 // CHECK1-NEXT: store ptr @.offload_maptypes, ptr [[TMP46]], align 8
610 // CHECK1-NEXT: [[TMP47:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS7]], i32 0, i32 6
611 // CHECK1-NEXT: store ptr null, ptr [[TMP47]], align 8
612 // CHECK1-NEXT: [[TMP48:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS7]], i32 0, i32 7
613 // CHECK1-NEXT: store ptr null, ptr [[TMP48]], align 8
614 // CHECK1-NEXT: [[TMP49:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS7]], i32 0, i32 8
615 // CHECK1-NEXT: store i64 100, ptr [[TMP49]], align 8
616 // CHECK1-NEXT: [[TMP50:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS7]], i32 0, i32 9
617 // CHECK1-NEXT: store i64 0, ptr [[TMP50]], align 8
618 // CHECK1-NEXT: [[TMP51:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS7]], i32 0, i32 10
619 // CHECK1-NEXT: store [3 x i32] zeroinitializer, ptr [[TMP51]], align 4
620 // CHECK1-NEXT: [[TMP52:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS7]], i32 0, i32 11
621 // CHECK1-NEXT: store [3 x i32] [[TMP40]], ptr [[TMP52]], align 4
622 // CHECK1-NEXT: [[TMP53:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS7]], i32 0, i32 12
623 // CHECK1-NEXT: store i32 0, ptr [[TMP53]], align 4
624 // CHECK1-NEXT: [[TMP54:%.*]] = call i32 @__tgt_target_kernel(ptr @[[GLOB3]], i64 -1, i32 0, i32 [[TMP39]], ptr @.{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}_main_l92.region_id, ptr [[KERNEL_ARGS7]])
625 // CHECK1-NEXT: [[TMP55:%.*]] = icmp ne i32 [[TMP54]], 0
626 // CHECK1-NEXT: br i1 [[TMP55]], label [[OMP_OFFLOAD_FAILED8:%.*]], label [[OMP_OFFLOAD_CONT9:%.*]]
627 // CHECK1: omp_offload.failed8:
628 // CHECK1-NEXT: call void @{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}_main_l92(i64 [[TMP31]]) #[[ATTR3]]
629 // CHECK1-NEXT: br label [[OMP_OFFLOAD_CONT9]]
630 // CHECK1: omp_offload.cont9:
631 // CHECK1-NEXT: [[TMP56:%.*]] = load i32, ptr @Arg, align 4
632 // CHECK1-NEXT: [[CALL:%.*]] = call noundef i32 @_Z5tmainIiEiT_(i32 noundef [[TMP56]])
633 // CHECK1-NEXT: ret i32 [[CALL]]
636 // CHECK1-LABEL: define {{[^@]+}}@{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}_main_l76
637 // CHECK1-SAME: () #[[ATTR1]] {
638 // CHECK1-NEXT: entry:
639 // CHECK1-NEXT: call void (ptr, i32, ptr, ...) @__kmpc_fork_teams(ptr @[[GLOB3]], i32 0, ptr @{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}_main_l76.omp_outlined)
640 // CHECK1-NEXT: ret void
643 // CHECK1-LABEL: define {{[^@]+}}@{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}_main_l76.omp_outlined
644 // CHECK1-SAME: (ptr noalias noundef [[DOTGLOBAL_TID_:%.*]], ptr noalias noundef [[DOTBOUND_TID_:%.*]]) #[[ATTR2]] {
645 // CHECK1-NEXT: entry:
646 // CHECK1-NEXT: [[DOTGLOBAL_TID__ADDR:%.*]] = alloca ptr, align 8
647 // CHECK1-NEXT: [[DOTBOUND_TID__ADDR:%.*]] = alloca ptr, align 8
648 // CHECK1-NEXT: [[DOTOMP_IV:%.*]] = alloca i32, align 4
649 // CHECK1-NEXT: [[TMP:%.*]] = alloca i32, align 4
650 // CHECK1-NEXT: [[DOTOMP_COMB_LB:%.*]] = alloca i32, align 4
651 // CHECK1-NEXT: [[DOTOMP_COMB_UB:%.*]] = alloca i32, align 4
652 // CHECK1-NEXT: [[DOTOMP_STRIDE:%.*]] = alloca i32, align 4
653 // CHECK1-NEXT: [[DOTOMP_IS_LAST:%.*]] = alloca i32, align 4
654 // CHECK1-NEXT: [[I:%.*]] = alloca i32, align 4
655 // CHECK1-NEXT: store ptr [[DOTGLOBAL_TID_]], ptr [[DOTGLOBAL_TID__ADDR]], align 8
656 // CHECK1-NEXT: store ptr [[DOTBOUND_TID_]], ptr [[DOTBOUND_TID__ADDR]], align 8
657 // CHECK1-NEXT: store i32 0, ptr [[DOTOMP_COMB_LB]], align 4
658 // CHECK1-NEXT: store i32 99, ptr [[DOTOMP_COMB_UB]], align 4
659 // CHECK1-NEXT: store i32 1, ptr [[DOTOMP_STRIDE]], align 4
660 // CHECK1-NEXT: store i32 0, ptr [[DOTOMP_IS_LAST]], align 4
661 // CHECK1-NEXT: [[TMP0:%.*]] = load ptr, ptr [[DOTGLOBAL_TID__ADDR]], align 8
662 // CHECK1-NEXT: [[TMP1:%.*]] = load i32, ptr [[TMP0]], align 4
663 // 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)
664 // CHECK1-NEXT: [[TMP2:%.*]] = load i32, ptr [[DOTOMP_COMB_UB]], align 4
665 // CHECK1-NEXT: [[CMP:%.*]] = icmp sgt i32 [[TMP2]], 99
666 // CHECK1-NEXT: br i1 [[CMP]], label [[COND_TRUE:%.*]], label [[COND_FALSE:%.*]]
667 // CHECK1: cond.true:
668 // CHECK1-NEXT: br label [[COND_END:%.*]]
669 // CHECK1: cond.false:
670 // CHECK1-NEXT: [[TMP3:%.*]] = load i32, ptr [[DOTOMP_COMB_UB]], align 4
671 // CHECK1-NEXT: br label [[COND_END]]
672 // CHECK1: cond.end:
673 // CHECK1-NEXT: [[COND:%.*]] = phi i32 [ 99, [[COND_TRUE]] ], [ [[TMP3]], [[COND_FALSE]] ]
674 // CHECK1-NEXT: store i32 [[COND]], ptr [[DOTOMP_COMB_UB]], align 4
675 // CHECK1-NEXT: [[TMP4:%.*]] = load i32, ptr [[DOTOMP_COMB_LB]], align 4
676 // CHECK1-NEXT: store i32 [[TMP4]], ptr [[DOTOMP_IV]], align 4
677 // CHECK1-NEXT: br label [[OMP_INNER_FOR_COND:%.*]]
678 // CHECK1: omp.inner.for.cond:
679 // CHECK1-NEXT: [[TMP5:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP26:![0-9]+]]
680 // CHECK1-NEXT: [[TMP6:%.*]] = load i32, ptr [[DOTOMP_COMB_UB]], align 4, !llvm.access.group [[ACC_GRP26]]
681 // CHECK1-NEXT: [[CMP1:%.*]] = icmp sle i32 [[TMP5]], [[TMP6]]
682 // CHECK1-NEXT: br i1 [[CMP1]], label [[OMP_INNER_FOR_BODY:%.*]], label [[OMP_INNER_FOR_END:%.*]]
683 // CHECK1: omp.inner.for.body:
684 // CHECK1-NEXT: [[TMP7:%.*]] = load i32, ptr [[DOTOMP_COMB_LB]], align 4, !llvm.access.group [[ACC_GRP26]]
685 // CHECK1-NEXT: [[TMP8:%.*]] = zext i32 [[TMP7]] to i64
686 // CHECK1-NEXT: [[TMP9:%.*]] = load i32, ptr [[DOTOMP_COMB_UB]], align 4, !llvm.access.group [[ACC_GRP26]]
687 // CHECK1-NEXT: [[TMP10:%.*]] = zext i32 [[TMP9]] to i64
688 // CHECK1-NEXT: call void (ptr, i32, ptr, ...) @__kmpc_fork_call(ptr @[[GLOB3]], i32 2, ptr @{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}_main_l76.omp_outlined.omp_outlined, i64 [[TMP8]], i64 [[TMP10]]), !llvm.access.group [[ACC_GRP26]]
689 // CHECK1-NEXT: br label [[OMP_INNER_FOR_INC:%.*]]
690 // CHECK1: omp.inner.for.inc:
691 // CHECK1-NEXT: [[TMP11:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP26]]
692 // CHECK1-NEXT: [[TMP12:%.*]] = load i32, ptr [[DOTOMP_STRIDE]], align 4, !llvm.access.group [[ACC_GRP26]]
693 // CHECK1-NEXT: [[ADD:%.*]] = add nsw i32 [[TMP11]], [[TMP12]]
694 // CHECK1-NEXT: store i32 [[ADD]], ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP26]]
695 // CHECK1-NEXT: br label [[OMP_INNER_FOR_COND]], !llvm.loop [[LOOP27:![0-9]+]]
696 // CHECK1: omp.inner.for.end:
697 // CHECK1-NEXT: br label [[OMP_LOOP_EXIT:%.*]]
698 // CHECK1: omp.loop.exit:
699 // CHECK1-NEXT: call void @__kmpc_for_static_fini(ptr @[[GLOB1]], i32 [[TMP1]])
700 // CHECK1-NEXT: [[TMP13:%.*]] = load i32, ptr [[DOTOMP_IS_LAST]], align 4
701 // CHECK1-NEXT: [[TMP14:%.*]] = icmp ne i32 [[TMP13]], 0
702 // CHECK1-NEXT: br i1 [[TMP14]], label [[DOTOMP_FINAL_THEN:%.*]], label [[DOTOMP_FINAL_DONE:%.*]]
703 // CHECK1: .omp.final.then:
704 // CHECK1-NEXT: store i32 100, ptr [[I]], align 4
705 // CHECK1-NEXT: br label [[DOTOMP_FINAL_DONE]]
706 // CHECK1: .omp.final.done:
707 // CHECK1-NEXT: ret void
710 // CHECK1-LABEL: define {{[^@]+}}@{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}_main_l76.omp_outlined.omp_outlined
711 // CHECK1-SAME: (ptr noalias noundef [[DOTGLOBAL_TID_:%.*]], ptr noalias noundef [[DOTBOUND_TID_:%.*]], i64 noundef [[DOTPREVIOUS_LB_:%.*]], i64 noundef [[DOTPREVIOUS_UB_:%.*]]) #[[ATTR2]] {
712 // CHECK1-NEXT: entry:
713 // CHECK1-NEXT: [[DOTGLOBAL_TID__ADDR:%.*]] = alloca ptr, align 8
714 // CHECK1-NEXT: [[DOTBOUND_TID__ADDR:%.*]] = alloca ptr, align 8
715 // CHECK1-NEXT: [[DOTPREVIOUS_LB__ADDR:%.*]] = alloca i64, align 8
716 // CHECK1-NEXT: [[DOTPREVIOUS_UB__ADDR:%.*]] = alloca i64, align 8
717 // CHECK1-NEXT: [[DOTOMP_IV:%.*]] = alloca i32, align 4
718 // CHECK1-NEXT: [[TMP:%.*]] = alloca i32, align 4
719 // CHECK1-NEXT: [[DOTOMP_LB:%.*]] = alloca i32, align 4
720 // CHECK1-NEXT: [[DOTOMP_UB:%.*]] = alloca i32, align 4
721 // CHECK1-NEXT: [[DOTOMP_STRIDE:%.*]] = alloca i32, align 4
722 // CHECK1-NEXT: [[DOTOMP_IS_LAST:%.*]] = alloca i32, align 4
723 // CHECK1-NEXT: [[I:%.*]] = alloca i32, align 4
724 // CHECK1-NEXT: store ptr [[DOTGLOBAL_TID_]], ptr [[DOTGLOBAL_TID__ADDR]], align 8
725 // CHECK1-NEXT: store ptr [[DOTBOUND_TID_]], ptr [[DOTBOUND_TID__ADDR]], align 8
726 // CHECK1-NEXT: store i64 [[DOTPREVIOUS_LB_]], ptr [[DOTPREVIOUS_LB__ADDR]], align 8
727 // CHECK1-NEXT: store i64 [[DOTPREVIOUS_UB_]], ptr [[DOTPREVIOUS_UB__ADDR]], align 8
728 // CHECK1-NEXT: store i32 0, ptr [[DOTOMP_LB]], align 4
729 // CHECK1-NEXT: store i32 99, ptr [[DOTOMP_UB]], align 4
730 // CHECK1-NEXT: [[TMP0:%.*]] = load i64, ptr [[DOTPREVIOUS_LB__ADDR]], align 8
731 // CHECK1-NEXT: [[CONV:%.*]] = trunc i64 [[TMP0]] to i32
732 // CHECK1-NEXT: [[TMP1:%.*]] = load i64, ptr [[DOTPREVIOUS_UB__ADDR]], align 8
733 // CHECK1-NEXT: [[CONV1:%.*]] = trunc i64 [[TMP1]] to i32
734 // CHECK1-NEXT: store i32 [[CONV]], ptr [[DOTOMP_LB]], align 4
735 // CHECK1-NEXT: store i32 [[CONV1]], ptr [[DOTOMP_UB]], align 4
736 // CHECK1-NEXT: store i32 1, ptr [[DOTOMP_STRIDE]], align 4
737 // CHECK1-NEXT: store i32 0, ptr [[DOTOMP_IS_LAST]], align 4
738 // CHECK1-NEXT: [[TMP2:%.*]] = load ptr, ptr [[DOTGLOBAL_TID__ADDR]], align 8
739 // CHECK1-NEXT: [[TMP3:%.*]] = load i32, ptr [[TMP2]], align 4
740 // 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)
741 // CHECK1-NEXT: [[TMP4:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4
742 // CHECK1-NEXT: [[CMP:%.*]] = icmp sgt i32 [[TMP4]], 99
743 // CHECK1-NEXT: br i1 [[CMP]], label [[COND_TRUE:%.*]], label [[COND_FALSE:%.*]]
744 // CHECK1: cond.true:
745 // CHECK1-NEXT: br label [[COND_END:%.*]]
746 // CHECK1: cond.false:
747 // CHECK1-NEXT: [[TMP5:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4
748 // CHECK1-NEXT: br label [[COND_END]]
749 // CHECK1: cond.end:
750 // CHECK1-NEXT: [[COND:%.*]] = phi i32 [ 99, [[COND_TRUE]] ], [ [[TMP5]], [[COND_FALSE]] ]
751 // CHECK1-NEXT: store i32 [[COND]], ptr [[DOTOMP_UB]], align 4
752 // CHECK1-NEXT: [[TMP6:%.*]] = load i32, ptr [[DOTOMP_LB]], align 4
753 // CHECK1-NEXT: store i32 [[TMP6]], ptr [[DOTOMP_IV]], align 4
754 // CHECK1-NEXT: br label [[OMP_INNER_FOR_COND:%.*]]
755 // CHECK1: omp.inner.for.cond:
756 // CHECK1-NEXT: [[TMP7:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP29:![0-9]+]]
757 // CHECK1-NEXT: [[TMP8:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4, !llvm.access.group [[ACC_GRP29]]
758 // CHECK1-NEXT: [[CMP2:%.*]] = icmp sle i32 [[TMP7]], [[TMP8]]
759 // CHECK1-NEXT: br i1 [[CMP2]], label [[OMP_INNER_FOR_BODY:%.*]], label [[OMP_INNER_FOR_END:%.*]]
760 // CHECK1: omp.inner.for.body:
761 // CHECK1-NEXT: [[TMP9:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP29]]
762 // CHECK1-NEXT: [[MUL:%.*]] = mul nsw i32 [[TMP9]], 1
763 // CHECK1-NEXT: [[ADD:%.*]] = add nsw i32 0, [[MUL]]
764 // CHECK1-NEXT: store i32 [[ADD]], ptr [[I]], align 4, !llvm.access.group [[ACC_GRP29]]
765 // CHECK1-NEXT: call void @_Z3fn4v(), !llvm.access.group [[ACC_GRP29]]
766 // CHECK1-NEXT: br label [[OMP_BODY_CONTINUE:%.*]]
767 // CHECK1: omp.body.continue:
768 // CHECK1-NEXT: br label [[OMP_INNER_FOR_INC:%.*]]
769 // CHECK1: omp.inner.for.inc:
770 // CHECK1-NEXT: [[TMP10:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP29]]
771 // CHECK1-NEXT: [[ADD3:%.*]] = add nsw i32 [[TMP10]], 1
772 // CHECK1-NEXT: store i32 [[ADD3]], ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP29]]
773 // CHECK1-NEXT: br label [[OMP_INNER_FOR_COND]], !llvm.loop [[LOOP30:![0-9]+]]
774 // CHECK1: omp.inner.for.end:
775 // CHECK1-NEXT: br label [[OMP_LOOP_EXIT:%.*]]
776 // CHECK1: omp.loop.exit:
777 // CHECK1-NEXT: call void @__kmpc_for_static_fini(ptr @[[GLOB1]], i32 [[TMP3]])
778 // CHECK1-NEXT: [[TMP11:%.*]] = load i32, ptr [[DOTOMP_IS_LAST]], align 4
779 // CHECK1-NEXT: [[TMP12:%.*]] = icmp ne i32 [[TMP11]], 0
780 // CHECK1-NEXT: br i1 [[TMP12]], label [[DOTOMP_FINAL_THEN:%.*]], label [[DOTOMP_FINAL_DONE:%.*]]
781 // CHECK1: .omp.final.then:
782 // CHECK1-NEXT: store i32 100, ptr [[I]], align 4
783 // CHECK1-NEXT: br label [[DOTOMP_FINAL_DONE]]
784 // CHECK1: .omp.final.done:
785 // CHECK1-NEXT: ret void
788 // CHECK1-LABEL: define {{[^@]+}}@{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}_main_l84
789 // CHECK1-SAME: () #[[ATTR1]] {
790 // CHECK1-NEXT: entry:
791 // CHECK1-NEXT: call void (ptr, i32, ptr, ...) @__kmpc_fork_teams(ptr @[[GLOB3]], i32 0, ptr @{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}_main_l84.omp_outlined)
792 // CHECK1-NEXT: ret void
795 // CHECK1-LABEL: define {{[^@]+}}@{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}_main_l84.omp_outlined
796 // CHECK1-SAME: (ptr noalias noundef [[DOTGLOBAL_TID_:%.*]], ptr noalias noundef [[DOTBOUND_TID_:%.*]]) #[[ATTR2]] {
797 // CHECK1-NEXT: entry:
798 // CHECK1-NEXT: [[DOTGLOBAL_TID__ADDR:%.*]] = alloca ptr, align 8
799 // CHECK1-NEXT: [[DOTBOUND_TID__ADDR:%.*]] = alloca ptr, align 8
800 // CHECK1-NEXT: [[DOTOMP_IV:%.*]] = alloca i32, align 4
801 // CHECK1-NEXT: [[TMP:%.*]] = alloca i32, align 4
802 // CHECK1-NEXT: [[DOTOMP_COMB_LB:%.*]] = alloca i32, align 4
803 // CHECK1-NEXT: [[DOTOMP_COMB_UB:%.*]] = alloca i32, align 4
804 // CHECK1-NEXT: [[DOTOMP_STRIDE:%.*]] = alloca i32, align 4
805 // CHECK1-NEXT: [[DOTOMP_IS_LAST:%.*]] = alloca i32, align 4
806 // CHECK1-NEXT: [[I:%.*]] = alloca i32, align 4
807 // CHECK1-NEXT: [[DOTBOUND_ZERO_ADDR:%.*]] = alloca i32, align 4
808 // CHECK1-NEXT: store ptr [[DOTGLOBAL_TID_]], ptr [[DOTGLOBAL_TID__ADDR]], align 8
809 // CHECK1-NEXT: store ptr [[DOTBOUND_TID_]], ptr [[DOTBOUND_TID__ADDR]], align 8
810 // CHECK1-NEXT: store i32 0, ptr [[DOTOMP_COMB_LB]], align 4
811 // CHECK1-NEXT: store i32 99, ptr [[DOTOMP_COMB_UB]], align 4
812 // CHECK1-NEXT: store i32 1, ptr [[DOTOMP_STRIDE]], align 4
813 // CHECK1-NEXT: store i32 0, ptr [[DOTOMP_IS_LAST]], align 4
814 // CHECK1-NEXT: [[TMP0:%.*]] = load ptr, ptr [[DOTGLOBAL_TID__ADDR]], align 8
815 // CHECK1-NEXT: [[TMP1:%.*]] = load i32, ptr [[TMP0]], align 4
816 // 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)
817 // CHECK1-NEXT: [[TMP2:%.*]] = load i32, ptr [[DOTOMP_COMB_UB]], align 4
818 // CHECK1-NEXT: [[CMP:%.*]] = icmp sgt i32 [[TMP2]], 99
819 // CHECK1-NEXT: br i1 [[CMP]], label [[COND_TRUE:%.*]], label [[COND_FALSE:%.*]]
820 // CHECK1: cond.true:
821 // CHECK1-NEXT: br label [[COND_END:%.*]]
822 // CHECK1: cond.false:
823 // CHECK1-NEXT: [[TMP3:%.*]] = load i32, ptr [[DOTOMP_COMB_UB]], align 4
824 // CHECK1-NEXT: br label [[COND_END]]
825 // CHECK1: cond.end:
826 // CHECK1-NEXT: [[COND:%.*]] = phi i32 [ 99, [[COND_TRUE]] ], [ [[TMP3]], [[COND_FALSE]] ]
827 // CHECK1-NEXT: store i32 [[COND]], ptr [[DOTOMP_COMB_UB]], align 4
828 // CHECK1-NEXT: [[TMP4:%.*]] = load i32, ptr [[DOTOMP_COMB_LB]], align 4
829 // CHECK1-NEXT: store i32 [[TMP4]], ptr [[DOTOMP_IV]], align 4
830 // CHECK1-NEXT: br label [[OMP_INNER_FOR_COND:%.*]]
831 // CHECK1: omp.inner.for.cond:
832 // CHECK1-NEXT: [[TMP5:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP32:![0-9]+]]
833 // CHECK1-NEXT: [[TMP6:%.*]] = load i32, ptr [[DOTOMP_COMB_UB]], align 4, !llvm.access.group [[ACC_GRP32]]
834 // CHECK1-NEXT: [[CMP1:%.*]] = icmp sle i32 [[TMP5]], [[TMP6]]
835 // CHECK1-NEXT: br i1 [[CMP1]], label [[OMP_INNER_FOR_BODY:%.*]], label [[OMP_INNER_FOR_END:%.*]]
836 // CHECK1: omp.inner.for.body:
837 // CHECK1-NEXT: [[TMP7:%.*]] = load i32, ptr [[DOTOMP_COMB_LB]], align 4, !llvm.access.group [[ACC_GRP32]]
838 // CHECK1-NEXT: [[TMP8:%.*]] = zext i32 [[TMP7]] to i64
839 // CHECK1-NEXT: [[TMP9:%.*]] = load i32, ptr [[DOTOMP_COMB_UB]], align 4, !llvm.access.group [[ACC_GRP32]]
840 // CHECK1-NEXT: [[TMP10:%.*]] = zext i32 [[TMP9]] to i64
841 // CHECK1-NEXT: call void @__kmpc_serialized_parallel(ptr @[[GLOB3]], i32 [[TMP1]]), !llvm.access.group [[ACC_GRP32]]
842 // CHECK1-NEXT: [[TMP11:%.*]] = load ptr, ptr [[DOTGLOBAL_TID__ADDR]], align 8, !llvm.access.group [[ACC_GRP32]]
843 // CHECK1-NEXT: store i32 0, ptr [[DOTBOUND_ZERO_ADDR]], align 4, !llvm.access.group [[ACC_GRP32]]
844 // CHECK1-NEXT: call void @{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}_main_l84.omp_outlined.omp_outlined(ptr [[TMP11]], ptr [[DOTBOUND_ZERO_ADDR]], i64 [[TMP8]], i64 [[TMP10]]) #[[ATTR3]], !llvm.access.group [[ACC_GRP32]]
845 // CHECK1-NEXT: call void @__kmpc_end_serialized_parallel(ptr @[[GLOB3]], i32 [[TMP1]]), !llvm.access.group [[ACC_GRP32]]
846 // CHECK1-NEXT: br label [[OMP_INNER_FOR_INC:%.*]]
847 // CHECK1: omp.inner.for.inc:
848 // CHECK1-NEXT: [[TMP12:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP32]]
849 // CHECK1-NEXT: [[TMP13:%.*]] = load i32, ptr [[DOTOMP_STRIDE]], align 4, !llvm.access.group [[ACC_GRP32]]
850 // CHECK1-NEXT: [[ADD:%.*]] = add nsw i32 [[TMP12]], [[TMP13]]
851 // CHECK1-NEXT: store i32 [[ADD]], ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP32]]
852 // CHECK1-NEXT: br label [[OMP_INNER_FOR_COND]], !llvm.loop [[LOOP33:![0-9]+]]
853 // CHECK1: omp.inner.for.end:
854 // CHECK1-NEXT: br label [[OMP_LOOP_EXIT:%.*]]
855 // CHECK1: omp.loop.exit:
856 // CHECK1-NEXT: call void @__kmpc_for_static_fini(ptr @[[GLOB1]], i32 [[TMP1]])
857 // CHECK1-NEXT: [[TMP14:%.*]] = load i32, ptr [[DOTOMP_IS_LAST]], align 4
858 // CHECK1-NEXT: [[TMP15:%.*]] = icmp ne i32 [[TMP14]], 0
859 // CHECK1-NEXT: br i1 [[TMP15]], label [[DOTOMP_FINAL_THEN:%.*]], label [[DOTOMP_FINAL_DONE:%.*]]
860 // CHECK1: .omp.final.then:
861 // CHECK1-NEXT: store i32 100, ptr [[I]], align 4
862 // CHECK1-NEXT: br label [[DOTOMP_FINAL_DONE]]
863 // CHECK1: .omp.final.done:
864 // CHECK1-NEXT: ret void
867 // CHECK1-LABEL: define {{[^@]+}}@{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}_main_l84.omp_outlined.omp_outlined
868 // CHECK1-SAME: (ptr noalias noundef [[DOTGLOBAL_TID_:%.*]], ptr noalias noundef [[DOTBOUND_TID_:%.*]], i64 noundef [[DOTPREVIOUS_LB_:%.*]], i64 noundef [[DOTPREVIOUS_UB_:%.*]]) #[[ATTR2]] {
869 // CHECK1-NEXT: entry:
870 // CHECK1-NEXT: [[DOTGLOBAL_TID__ADDR:%.*]] = alloca ptr, align 8
871 // CHECK1-NEXT: [[DOTBOUND_TID__ADDR:%.*]] = alloca ptr, align 8
872 // CHECK1-NEXT: [[DOTPREVIOUS_LB__ADDR:%.*]] = alloca i64, align 8
873 // CHECK1-NEXT: [[DOTPREVIOUS_UB__ADDR:%.*]] = alloca i64, align 8
874 // CHECK1-NEXT: [[DOTOMP_IV:%.*]] = alloca i32, align 4
875 // CHECK1-NEXT: [[TMP:%.*]] = alloca i32, align 4
876 // CHECK1-NEXT: [[DOTOMP_LB:%.*]] = alloca i32, align 4
877 // CHECK1-NEXT: [[DOTOMP_UB:%.*]] = alloca i32, align 4
878 // CHECK1-NEXT: [[DOTOMP_STRIDE:%.*]] = alloca i32, align 4
879 // CHECK1-NEXT: [[DOTOMP_IS_LAST:%.*]] = alloca i32, align 4
880 // CHECK1-NEXT: [[I:%.*]] = alloca i32, align 4
881 // CHECK1-NEXT: store ptr [[DOTGLOBAL_TID_]], ptr [[DOTGLOBAL_TID__ADDR]], align 8
882 // CHECK1-NEXT: store ptr [[DOTBOUND_TID_]], ptr [[DOTBOUND_TID__ADDR]], align 8
883 // CHECK1-NEXT: store i64 [[DOTPREVIOUS_LB_]], ptr [[DOTPREVIOUS_LB__ADDR]], align 8
884 // CHECK1-NEXT: store i64 [[DOTPREVIOUS_UB_]], ptr [[DOTPREVIOUS_UB__ADDR]], align 8
885 // CHECK1-NEXT: store i32 0, ptr [[DOTOMP_LB]], align 4
886 // CHECK1-NEXT: store i32 99, ptr [[DOTOMP_UB]], align 4
887 // CHECK1-NEXT: [[TMP0:%.*]] = load i64, ptr [[DOTPREVIOUS_LB__ADDR]], align 8
888 // CHECK1-NEXT: [[CONV:%.*]] = trunc i64 [[TMP0]] to i32
889 // CHECK1-NEXT: [[TMP1:%.*]] = load i64, ptr [[DOTPREVIOUS_UB__ADDR]], align 8
890 // CHECK1-NEXT: [[CONV1:%.*]] = trunc i64 [[TMP1]] to i32
891 // CHECK1-NEXT: store i32 [[CONV]], ptr [[DOTOMP_LB]], align 4
892 // CHECK1-NEXT: store i32 [[CONV1]], ptr [[DOTOMP_UB]], align 4
893 // CHECK1-NEXT: store i32 1, ptr [[DOTOMP_STRIDE]], align 4
894 // CHECK1-NEXT: store i32 0, ptr [[DOTOMP_IS_LAST]], align 4
895 // CHECK1-NEXT: [[TMP2:%.*]] = load ptr, ptr [[DOTGLOBAL_TID__ADDR]], align 8
896 // CHECK1-NEXT: [[TMP3:%.*]] = load i32, ptr [[TMP2]], align 4
897 // 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)
898 // CHECK1-NEXT: [[TMP4:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4
899 // CHECK1-NEXT: [[CMP:%.*]] = icmp sgt i32 [[TMP4]], 99
900 // CHECK1-NEXT: br i1 [[CMP]], label [[COND_TRUE:%.*]], label [[COND_FALSE:%.*]]
901 // CHECK1: cond.true:
902 // CHECK1-NEXT: br label [[COND_END:%.*]]
903 // CHECK1: cond.false:
904 // CHECK1-NEXT: [[TMP5:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4
905 // CHECK1-NEXT: br label [[COND_END]]
906 // CHECK1: cond.end:
907 // CHECK1-NEXT: [[COND:%.*]] = phi i32 [ 99, [[COND_TRUE]] ], [ [[TMP5]], [[COND_FALSE]] ]
908 // CHECK1-NEXT: store i32 [[COND]], ptr [[DOTOMP_UB]], align 4
909 // CHECK1-NEXT: [[TMP6:%.*]] = load i32, ptr [[DOTOMP_LB]], align 4
910 // CHECK1-NEXT: store i32 [[TMP6]], ptr [[DOTOMP_IV]], align 4
911 // CHECK1-NEXT: br label [[OMP_INNER_FOR_COND:%.*]]
912 // CHECK1: omp.inner.for.cond:
913 // CHECK1-NEXT: [[TMP7:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP35:![0-9]+]]
914 // CHECK1-NEXT: [[TMP8:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4, !llvm.access.group [[ACC_GRP35]]
915 // CHECK1-NEXT: [[CMP2:%.*]] = icmp sle i32 [[TMP7]], [[TMP8]]
916 // CHECK1-NEXT: br i1 [[CMP2]], label [[OMP_INNER_FOR_BODY:%.*]], label [[OMP_INNER_FOR_END:%.*]]
917 // CHECK1: omp.inner.for.body:
918 // CHECK1-NEXT: [[TMP9:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP35]]
919 // CHECK1-NEXT: [[MUL:%.*]] = mul nsw i32 [[TMP9]], 1
920 // CHECK1-NEXT: [[ADD:%.*]] = add nsw i32 0, [[MUL]]
921 // CHECK1-NEXT: store i32 [[ADD]], ptr [[I]], align 4, !llvm.access.group [[ACC_GRP35]]
922 // CHECK1-NEXT: call void @_Z3fn5v(), !llvm.access.group [[ACC_GRP35]]
923 // CHECK1-NEXT: br label [[OMP_BODY_CONTINUE:%.*]]
924 // CHECK1: omp.body.continue:
925 // CHECK1-NEXT: br label [[OMP_INNER_FOR_INC:%.*]]
926 // CHECK1: omp.inner.for.inc:
927 // CHECK1-NEXT: [[TMP10:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP35]]
928 // CHECK1-NEXT: [[ADD3:%.*]] = add nsw i32 [[TMP10]], 1
929 // CHECK1-NEXT: store i32 [[ADD3]], ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP35]]
930 // CHECK1-NEXT: br label [[OMP_INNER_FOR_COND]], !llvm.loop [[LOOP36:![0-9]+]]
931 // CHECK1: omp.inner.for.end:
932 // CHECK1-NEXT: br label [[OMP_LOOP_EXIT:%.*]]
933 // CHECK1: omp.loop.exit:
934 // CHECK1-NEXT: call void @__kmpc_for_static_fini(ptr @[[GLOB1]], i32 [[TMP3]])
935 // CHECK1-NEXT: [[TMP11:%.*]] = load i32, ptr [[DOTOMP_IS_LAST]], align 4
936 // CHECK1-NEXT: [[TMP12:%.*]] = icmp ne i32 [[TMP11]], 0
937 // CHECK1-NEXT: br i1 [[TMP12]], label [[DOTOMP_FINAL_THEN:%.*]], label [[DOTOMP_FINAL_DONE:%.*]]
938 // CHECK1: .omp.final.then:
939 // CHECK1-NEXT: store i32 100, ptr [[I]], align 4
940 // CHECK1-NEXT: br label [[DOTOMP_FINAL_DONE]]
941 // CHECK1: .omp.final.done:
942 // CHECK1-NEXT: ret void
945 // CHECK1-LABEL: define {{[^@]+}}@{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}_main_l92
946 // CHECK1-SAME: (i64 noundef [[ARG:%.*]]) #[[ATTR1]] {
947 // CHECK1-NEXT: entry:
948 // CHECK1-NEXT: [[ARG_ADDR:%.*]] = alloca i64, align 8
949 // CHECK1-NEXT: [[DOTCAPTURE_EXPR_:%.*]] = alloca i8, align 1
950 // CHECK1-NEXT: [[DOTCAPTURE_EXPR__CASTED:%.*]] = alloca i64, align 8
951 // CHECK1-NEXT: store i64 [[ARG]], ptr [[ARG_ADDR]], align 8
952 // CHECK1-NEXT: [[TMP0:%.*]] = load i32, ptr [[ARG_ADDR]], align 4
953 // CHECK1-NEXT: [[TOBOOL:%.*]] = icmp ne i32 [[TMP0]], 0
954 // CHECK1-NEXT: [[FROMBOOL:%.*]] = zext i1 [[TOBOOL]] to i8
955 // CHECK1-NEXT: store i8 [[FROMBOOL]], ptr [[DOTCAPTURE_EXPR_]], align 1
956 // CHECK1-NEXT: [[TMP1:%.*]] = load i8, ptr [[DOTCAPTURE_EXPR_]], align 1
957 // CHECK1-NEXT: [[TOBOOL1:%.*]] = trunc i8 [[TMP1]] to i1
958 // CHECK1-NEXT: [[FROMBOOL2:%.*]] = zext i1 [[TOBOOL1]] to i8
959 // CHECK1-NEXT: store i8 [[FROMBOOL2]], ptr [[DOTCAPTURE_EXPR__CASTED]], align 1
960 // CHECK1-NEXT: [[TMP2:%.*]] = load i64, ptr [[DOTCAPTURE_EXPR__CASTED]], align 8
961 // CHECK1-NEXT: call void (ptr, i32, ptr, ...) @__kmpc_fork_teams(ptr @[[GLOB3]], i32 1, ptr @{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}_main_l92.omp_outlined, i64 [[TMP2]])
962 // CHECK1-NEXT: ret void
965 // CHECK1-LABEL: define {{[^@]+}}@{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}_main_l92.omp_outlined
966 // CHECK1-SAME: (ptr noalias noundef [[DOTGLOBAL_TID_:%.*]], ptr noalias noundef [[DOTBOUND_TID_:%.*]], i64 noundef [[DOTCAPTURE_EXPR_:%.*]]) #[[ATTR2]] {
967 // CHECK1-NEXT: entry:
968 // CHECK1-NEXT: [[DOTGLOBAL_TID__ADDR:%.*]] = alloca ptr, align 8
969 // CHECK1-NEXT: [[DOTBOUND_TID__ADDR:%.*]] = alloca ptr, align 8
970 // CHECK1-NEXT: [[DOTCAPTURE_EXPR__ADDR:%.*]] = alloca i64, align 8
971 // CHECK1-NEXT: [[DOTOMP_IV:%.*]] = alloca i32, align 4
972 // CHECK1-NEXT: [[TMP:%.*]] = alloca i32, align 4
973 // CHECK1-NEXT: [[DOTOMP_COMB_LB:%.*]] = alloca i32, align 4
974 // CHECK1-NEXT: [[DOTOMP_COMB_UB:%.*]] = alloca i32, align 4
975 // CHECK1-NEXT: [[DOTOMP_STRIDE:%.*]] = alloca i32, align 4
976 // CHECK1-NEXT: [[DOTOMP_IS_LAST:%.*]] = alloca i32, align 4
977 // CHECK1-NEXT: [[I:%.*]] = alloca i32, align 4
978 // CHECK1-NEXT: [[DOTBOUND_ZERO_ADDR:%.*]] = alloca i32, align 4
979 // CHECK1-NEXT: store ptr [[DOTGLOBAL_TID_]], ptr [[DOTGLOBAL_TID__ADDR]], align 8
980 // CHECK1-NEXT: store ptr [[DOTBOUND_TID_]], ptr [[DOTBOUND_TID__ADDR]], align 8
981 // CHECK1-NEXT: store i64 [[DOTCAPTURE_EXPR_]], ptr [[DOTCAPTURE_EXPR__ADDR]], align 8
982 // CHECK1-NEXT: store i32 0, ptr [[DOTOMP_COMB_LB]], align 4
983 // CHECK1-NEXT: store i32 99, ptr [[DOTOMP_COMB_UB]], align 4
984 // CHECK1-NEXT: store i32 1, ptr [[DOTOMP_STRIDE]], align 4
985 // CHECK1-NEXT: store i32 0, ptr [[DOTOMP_IS_LAST]], align 4
986 // CHECK1-NEXT: [[TMP0:%.*]] = load ptr, ptr [[DOTGLOBAL_TID__ADDR]], align 8
987 // CHECK1-NEXT: [[TMP1:%.*]] = load i32, ptr [[TMP0]], align 4
988 // 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)
989 // CHECK1-NEXT: [[TMP2:%.*]] = load i32, ptr [[DOTOMP_COMB_UB]], align 4
990 // CHECK1-NEXT: [[CMP:%.*]] = icmp sgt i32 [[TMP2]], 99
991 // CHECK1-NEXT: br i1 [[CMP]], label [[COND_TRUE:%.*]], label [[COND_FALSE:%.*]]
992 // CHECK1: cond.true:
993 // CHECK1-NEXT: br label [[COND_END:%.*]]
994 // CHECK1: cond.false:
995 // CHECK1-NEXT: [[TMP3:%.*]] = load i32, ptr [[DOTOMP_COMB_UB]], align 4
996 // CHECK1-NEXT: br label [[COND_END]]
997 // CHECK1: cond.end:
998 // CHECK1-NEXT: [[COND:%.*]] = phi i32 [ 99, [[COND_TRUE]] ], [ [[TMP3]], [[COND_FALSE]] ]
999 // CHECK1-NEXT: store i32 [[COND]], ptr [[DOTOMP_COMB_UB]], align 4
1000 // CHECK1-NEXT: [[TMP4:%.*]] = load i32, ptr [[DOTOMP_COMB_LB]], align 4
1001 // CHECK1-NEXT: store i32 [[TMP4]], ptr [[DOTOMP_IV]], align 4
1002 // CHECK1-NEXT: br label [[OMP_INNER_FOR_COND:%.*]]
1003 // CHECK1: omp.inner.for.cond:
1004 // CHECK1-NEXT: [[TMP5:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP38:![0-9]+]]
1005 // CHECK1-NEXT: [[TMP6:%.*]] = load i32, ptr [[DOTOMP_COMB_UB]], align 4, !llvm.access.group [[ACC_GRP38]]
1006 // CHECK1-NEXT: [[CMP1:%.*]] = icmp sle i32 [[TMP5]], [[TMP6]]
1007 // CHECK1-NEXT: br i1 [[CMP1]], label [[OMP_INNER_FOR_BODY:%.*]], label [[OMP_INNER_FOR_END:%.*]]
1008 // CHECK1: omp.inner.for.body:
1009 // CHECK1-NEXT: [[TMP7:%.*]] = load i32, ptr [[DOTOMP_COMB_LB]], align 4, !llvm.access.group [[ACC_GRP38]]
1010 // CHECK1-NEXT: [[TMP8:%.*]] = zext i32 [[TMP7]] to i64
1011 // CHECK1-NEXT: [[TMP9:%.*]] = load i32, ptr [[DOTOMP_COMB_UB]], align 4, !llvm.access.group [[ACC_GRP38]]
1012 // CHECK1-NEXT: [[TMP10:%.*]] = zext i32 [[TMP9]] to i64
1013 // CHECK1-NEXT: [[TMP11:%.*]] = load i8, ptr [[DOTCAPTURE_EXPR__ADDR]], align 1, !llvm.access.group [[ACC_GRP38]]
1014 // CHECK1-NEXT: [[TOBOOL:%.*]] = trunc i8 [[TMP11]] to i1
1015 // CHECK1-NEXT: br i1 [[TOBOOL]], label [[OMP_IF_THEN:%.*]], label [[OMP_IF_ELSE:%.*]]
1016 // CHECK1: omp_if.then:
1017 // CHECK1-NEXT: call void (ptr, i32, ptr, ...) @__kmpc_fork_call(ptr @[[GLOB3]], i32 2, ptr @{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}_main_l92.omp_outlined.omp_outlined, i64 [[TMP8]], i64 [[TMP10]]), !llvm.access.group [[ACC_GRP38]]
1018 // CHECK1-NEXT: br label [[OMP_IF_END:%.*]]
1019 // CHECK1: omp_if.else:
1020 // CHECK1-NEXT: call void @__kmpc_serialized_parallel(ptr @[[GLOB3]], i32 [[TMP1]]), !llvm.access.group [[ACC_GRP38]]
1021 // CHECK1-NEXT: [[TMP12:%.*]] = load ptr, ptr [[DOTGLOBAL_TID__ADDR]], align 8, !llvm.access.group [[ACC_GRP38]]
1022 // CHECK1-NEXT: store i32 0, ptr [[DOTBOUND_ZERO_ADDR]], align 4, !llvm.access.group [[ACC_GRP38]]
1023 // CHECK1-NEXT: call void @{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}_main_l92.omp_outlined.omp_outlined(ptr [[TMP12]], ptr [[DOTBOUND_ZERO_ADDR]], i64 [[TMP8]], i64 [[TMP10]]) #[[ATTR3]], !llvm.access.group [[ACC_GRP38]]
1024 // CHECK1-NEXT: call void @__kmpc_end_serialized_parallel(ptr @[[GLOB3]], i32 [[TMP1]]), !llvm.access.group [[ACC_GRP38]]
1025 // CHECK1-NEXT: br label [[OMP_IF_END]]
1026 // CHECK1: omp_if.end:
1027 // CHECK1-NEXT: br label [[OMP_INNER_FOR_INC:%.*]]
1028 // CHECK1: omp.inner.for.inc:
1029 // CHECK1-NEXT: [[TMP13:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP38]]
1030 // CHECK1-NEXT: [[TMP14:%.*]] = load i32, ptr [[DOTOMP_STRIDE]], align 4, !llvm.access.group [[ACC_GRP38]]
1031 // CHECK1-NEXT: [[ADD:%.*]] = add nsw i32 [[TMP13]], [[TMP14]]
1032 // CHECK1-NEXT: store i32 [[ADD]], ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP38]]
1033 // CHECK1-NEXT: br label [[OMP_INNER_FOR_COND]], !llvm.loop [[LOOP39:![0-9]+]]
1034 // CHECK1: omp.inner.for.end:
1035 // CHECK1-NEXT: br label [[OMP_LOOP_EXIT:%.*]]
1036 // CHECK1: omp.loop.exit:
1037 // CHECK1-NEXT: call void @__kmpc_for_static_fini(ptr @[[GLOB1]], i32 [[TMP1]])
1038 // CHECK1-NEXT: [[TMP15:%.*]] = load i32, ptr [[DOTOMP_IS_LAST]], align 4
1039 // CHECK1-NEXT: [[TMP16:%.*]] = icmp ne i32 [[TMP15]], 0
1040 // CHECK1-NEXT: br i1 [[TMP16]], label [[DOTOMP_FINAL_THEN:%.*]], label [[DOTOMP_FINAL_DONE:%.*]]
1041 // CHECK1: .omp.final.then:
1042 // CHECK1-NEXT: store i32 100, ptr [[I]], align 4
1043 // CHECK1-NEXT: br label [[DOTOMP_FINAL_DONE]]
1044 // CHECK1: .omp.final.done:
1045 // CHECK1-NEXT: ret void
1048 // CHECK1-LABEL: define {{[^@]+}}@{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}_main_l92.omp_outlined.omp_outlined
1049 // CHECK1-SAME: (ptr noalias noundef [[DOTGLOBAL_TID_:%.*]], ptr noalias noundef [[DOTBOUND_TID_:%.*]], i64 noundef [[DOTPREVIOUS_LB_:%.*]], i64 noundef [[DOTPREVIOUS_UB_:%.*]]) #[[ATTR2]] {
1050 // CHECK1-NEXT: entry:
1051 // CHECK1-NEXT: [[DOTGLOBAL_TID__ADDR:%.*]] = alloca ptr, align 8
1052 // CHECK1-NEXT: [[DOTBOUND_TID__ADDR:%.*]] = alloca ptr, align 8
1053 // CHECK1-NEXT: [[DOTPREVIOUS_LB__ADDR:%.*]] = alloca i64, align 8
1054 // CHECK1-NEXT: [[DOTPREVIOUS_UB__ADDR:%.*]] = alloca i64, align 8
1055 // CHECK1-NEXT: [[DOTOMP_IV:%.*]] = alloca i32, align 4
1056 // CHECK1-NEXT: [[TMP:%.*]] = alloca i32, align 4
1057 // CHECK1-NEXT: [[DOTOMP_LB:%.*]] = alloca i32, align 4
1058 // CHECK1-NEXT: [[DOTOMP_UB:%.*]] = alloca i32, align 4
1059 // CHECK1-NEXT: [[DOTOMP_STRIDE:%.*]] = alloca i32, align 4
1060 // CHECK1-NEXT: [[DOTOMP_IS_LAST:%.*]] = alloca i32, align 4
1061 // CHECK1-NEXT: [[I:%.*]] = alloca i32, align 4
1062 // CHECK1-NEXT: store ptr [[DOTGLOBAL_TID_]], ptr [[DOTGLOBAL_TID__ADDR]], align 8
1063 // CHECK1-NEXT: store ptr [[DOTBOUND_TID_]], ptr [[DOTBOUND_TID__ADDR]], align 8
1064 // CHECK1-NEXT: store i64 [[DOTPREVIOUS_LB_]], ptr [[DOTPREVIOUS_LB__ADDR]], align 8
1065 // CHECK1-NEXT: store i64 [[DOTPREVIOUS_UB_]], ptr [[DOTPREVIOUS_UB__ADDR]], align 8
1066 // CHECK1-NEXT: store i32 0, ptr [[DOTOMP_LB]], align 4
1067 // CHECK1-NEXT: store i32 99, ptr [[DOTOMP_UB]], align 4
1068 // CHECK1-NEXT: [[TMP0:%.*]] = load i64, ptr [[DOTPREVIOUS_LB__ADDR]], align 8
1069 // CHECK1-NEXT: [[CONV:%.*]] = trunc i64 [[TMP0]] to i32
1070 // CHECK1-NEXT: [[TMP1:%.*]] = load i64, ptr [[DOTPREVIOUS_UB__ADDR]], align 8
1071 // CHECK1-NEXT: [[CONV1:%.*]] = trunc i64 [[TMP1]] to i32
1072 // CHECK1-NEXT: store i32 [[CONV]], ptr [[DOTOMP_LB]], align 4
1073 // CHECK1-NEXT: store i32 [[CONV1]], ptr [[DOTOMP_UB]], align 4
1074 // CHECK1-NEXT: store i32 1, ptr [[DOTOMP_STRIDE]], align 4
1075 // CHECK1-NEXT: store i32 0, ptr [[DOTOMP_IS_LAST]], align 4
1076 // CHECK1-NEXT: [[TMP2:%.*]] = load ptr, ptr [[DOTGLOBAL_TID__ADDR]], align 8
1077 // CHECK1-NEXT: [[TMP3:%.*]] = load i32, ptr [[TMP2]], align 4
1078 // 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)
1079 // CHECK1-NEXT: [[TMP4:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4
1080 // CHECK1-NEXT: [[CMP:%.*]] = icmp sgt i32 [[TMP4]], 99
1081 // CHECK1-NEXT: br i1 [[CMP]], label [[COND_TRUE:%.*]], label [[COND_FALSE:%.*]]
1082 // CHECK1: cond.true:
1083 // CHECK1-NEXT: br label [[COND_END:%.*]]
1084 // CHECK1: cond.false:
1085 // CHECK1-NEXT: [[TMP5:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4
1086 // CHECK1-NEXT: br label [[COND_END]]
1087 // CHECK1: cond.end:
1088 // CHECK1-NEXT: [[COND:%.*]] = phi i32 [ 99, [[COND_TRUE]] ], [ [[TMP5]], [[COND_FALSE]] ]
1089 // CHECK1-NEXT: store i32 [[COND]], ptr [[DOTOMP_UB]], align 4
1090 // CHECK1-NEXT: [[TMP6:%.*]] = load i32, ptr [[DOTOMP_LB]], align 4
1091 // CHECK1-NEXT: store i32 [[TMP6]], ptr [[DOTOMP_IV]], align 4
1092 // CHECK1-NEXT: br label [[OMP_INNER_FOR_COND:%.*]]
1093 // CHECK1: omp.inner.for.cond:
1094 // CHECK1-NEXT: [[TMP7:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP41:![0-9]+]]
1095 // CHECK1-NEXT: [[TMP8:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4, !llvm.access.group [[ACC_GRP41]]
1096 // CHECK1-NEXT: [[CMP2:%.*]] = icmp sle i32 [[TMP7]], [[TMP8]]
1097 // CHECK1-NEXT: br i1 [[CMP2]], label [[OMP_INNER_FOR_BODY:%.*]], label [[OMP_INNER_FOR_END:%.*]]
1098 // CHECK1: omp.inner.for.body:
1099 // CHECK1-NEXT: [[TMP9:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP41]]
1100 // CHECK1-NEXT: [[MUL:%.*]] = mul nsw i32 [[TMP9]], 1
1101 // CHECK1-NEXT: [[ADD:%.*]] = add nsw i32 0, [[MUL]]
1102 // CHECK1-NEXT: store i32 [[ADD]], ptr [[I]], align 4, !llvm.access.group [[ACC_GRP41]]
1103 // CHECK1-NEXT: call void @_Z3fn6v(), !llvm.access.group [[ACC_GRP41]]
1104 // CHECK1-NEXT: br label [[OMP_BODY_CONTINUE:%.*]]
1105 // CHECK1: omp.body.continue:
1106 // CHECK1-NEXT: br label [[OMP_INNER_FOR_INC:%.*]]
1107 // CHECK1: omp.inner.for.inc:
1108 // CHECK1-NEXT: [[TMP10:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP41]]
1109 // CHECK1-NEXT: [[ADD3:%.*]] = add nsw i32 [[TMP10]], 1
1110 // CHECK1-NEXT: store i32 [[ADD3]], ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP41]]
1111 // CHECK1-NEXT: br label [[OMP_INNER_FOR_COND]], !llvm.loop [[LOOP42:![0-9]+]]
1112 // CHECK1: omp.inner.for.end:
1113 // CHECK1-NEXT: br label [[OMP_LOOP_EXIT:%.*]]
1114 // CHECK1: omp.loop.exit:
1115 // CHECK1-NEXT: call void @__kmpc_for_static_fini(ptr @[[GLOB1]], i32 [[TMP3]])
1116 // CHECK1-NEXT: [[TMP11:%.*]] = load i32, ptr [[DOTOMP_IS_LAST]], align 4
1117 // CHECK1-NEXT: [[TMP12:%.*]] = icmp ne i32 [[TMP11]], 0
1118 // CHECK1-NEXT: br i1 [[TMP12]], label [[DOTOMP_FINAL_THEN:%.*]], label [[DOTOMP_FINAL_DONE:%.*]]
1119 // CHECK1: .omp.final.then:
1120 // CHECK1-NEXT: store i32 100, ptr [[I]], align 4
1121 // CHECK1-NEXT: br label [[DOTOMP_FINAL_DONE]]
1122 // CHECK1: .omp.final.done:
1123 // CHECK1-NEXT: ret void
1126 // CHECK1-LABEL: define {{[^@]+}}@_Z5tmainIiEiT_
1127 // CHECK1-SAME: (i32 noundef [[ARG:%.*]]) #[[ATTR0]] comdat {
1128 // CHECK1-NEXT: entry:
1129 // CHECK1-NEXT: [[ARG_ADDR:%.*]] = alloca i32, align 4
1130 // CHECK1-NEXT: [[TMP:%.*]] = alloca i32, align 4
1131 // CHECK1-NEXT: [[KERNEL_ARGS:%.*]] = alloca [[STRUCT___TGT_KERNEL_ARGUMENTS:%.*]], align 8
1132 // CHECK1-NEXT: [[_TMP1:%.*]] = alloca i32, align 4
1133 // CHECK1-NEXT: [[KERNEL_ARGS2:%.*]] = alloca [[STRUCT___TGT_KERNEL_ARGUMENTS]], align 8
1134 // CHECK1-NEXT: [[ARG_CASTED:%.*]] = alloca i64, align 8
1135 // CHECK1-NEXT: [[DOTOFFLOAD_BASEPTRS:%.*]] = alloca [1 x ptr], align 8
1136 // CHECK1-NEXT: [[DOTOFFLOAD_PTRS:%.*]] = alloca [1 x ptr], align 8
1137 // CHECK1-NEXT: [[DOTOFFLOAD_MAPPERS:%.*]] = alloca [1 x ptr], align 8
1138 // CHECK1-NEXT: [[DOTCAPTURE_EXPR_:%.*]] = alloca i8, align 1
1139 // CHECK1-NEXT: [[_TMP6:%.*]] = alloca i32, align 4
1140 // CHECK1-NEXT: [[KERNEL_ARGS7:%.*]] = alloca [[STRUCT___TGT_KERNEL_ARGUMENTS]], align 8
1141 // CHECK1-NEXT: store i32 [[ARG]], ptr [[ARG_ADDR]], align 4
1142 // CHECK1-NEXT: [[TMP0:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 0
1143 // CHECK1-NEXT: store i32 2, ptr [[TMP0]], align 4
1144 // CHECK1-NEXT: [[TMP1:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 1
1145 // CHECK1-NEXT: store i32 0, ptr [[TMP1]], align 4
1146 // CHECK1-NEXT: [[TMP2:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 2
1147 // CHECK1-NEXT: store ptr null, ptr [[TMP2]], align 8
1148 // CHECK1-NEXT: [[TMP3:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 3
1149 // CHECK1-NEXT: store ptr null, ptr [[TMP3]], align 8
1150 // CHECK1-NEXT: [[TMP4:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 4
1151 // CHECK1-NEXT: store ptr null, ptr [[TMP4]], align 8
1152 // CHECK1-NEXT: [[TMP5:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 5
1153 // CHECK1-NEXT: store ptr null, ptr [[TMP5]], align 8
1154 // CHECK1-NEXT: [[TMP6:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 6
1155 // CHECK1-NEXT: store ptr null, ptr [[TMP6]], align 8
1156 // CHECK1-NEXT: [[TMP7:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 7
1157 // CHECK1-NEXT: store ptr null, ptr [[TMP7]], align 8
1158 // CHECK1-NEXT: [[TMP8:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 8
1159 // CHECK1-NEXT: store i64 100, ptr [[TMP8]], align 8
1160 // CHECK1-NEXT: [[TMP9:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 9
1161 // CHECK1-NEXT: store i64 0, ptr [[TMP9]], align 8
1162 // CHECK1-NEXT: [[TMP10:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 10
1163 // CHECK1-NEXT: store [3 x i32] zeroinitializer, ptr [[TMP10]], align 4
1164 // CHECK1-NEXT: [[TMP11:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 11
1165 // CHECK1-NEXT: store [3 x i32] zeroinitializer, ptr [[TMP11]], align 4
1166 // CHECK1-NEXT: [[TMP12:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 12
1167 // CHECK1-NEXT: store i32 0, ptr [[TMP12]], align 4
1168 // 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__l57.region_id, ptr [[KERNEL_ARGS]])
1169 // CHECK1-NEXT: [[TMP14:%.*]] = icmp ne i32 [[TMP13]], 0
1170 // CHECK1-NEXT: br i1 [[TMP14]], label [[OMP_OFFLOAD_FAILED:%.*]], label [[OMP_OFFLOAD_CONT:%.*]]
1171 // CHECK1: omp_offload.failed:
1172 // CHECK1-NEXT: call void @{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z5tmainIiEiT__l57() #[[ATTR3]]
1173 // CHECK1-NEXT: br label [[OMP_OFFLOAD_CONT]]
1174 // CHECK1: omp_offload.cont:
1175 // CHECK1-NEXT: [[TMP15:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS2]], i32 0, i32 0
1176 // CHECK1-NEXT: store i32 2, ptr [[TMP15]], align 4
1177 // CHECK1-NEXT: [[TMP16:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS2]], i32 0, i32 1
1178 // CHECK1-NEXT: store i32 0, ptr [[TMP16]], align 4
1179 // CHECK1-NEXT: [[TMP17:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS2]], i32 0, i32 2
1180 // CHECK1-NEXT: store ptr null, ptr [[TMP17]], align 8
1181 // CHECK1-NEXT: [[TMP18:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS2]], i32 0, i32 3
1182 // CHECK1-NEXT: store ptr null, ptr [[TMP18]], align 8
1183 // CHECK1-NEXT: [[TMP19:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS2]], i32 0, i32 4
1184 // CHECK1-NEXT: store ptr null, ptr [[TMP19]], align 8
1185 // CHECK1-NEXT: [[TMP20:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS2]], i32 0, i32 5
1186 // CHECK1-NEXT: store ptr null, ptr [[TMP20]], align 8
1187 // CHECK1-NEXT: [[TMP21:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS2]], i32 0, i32 6
1188 // CHECK1-NEXT: store ptr null, ptr [[TMP21]], align 8
1189 // CHECK1-NEXT: [[TMP22:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS2]], i32 0, i32 7
1190 // CHECK1-NEXT: store ptr null, ptr [[TMP22]], align 8
1191 // CHECK1-NEXT: [[TMP23:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS2]], i32 0, i32 8
1192 // CHECK1-NEXT: store i64 100, ptr [[TMP23]], align 8
1193 // CHECK1-NEXT: [[TMP24:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS2]], i32 0, i32 9
1194 // CHECK1-NEXT: store i64 0, ptr [[TMP24]], align 8
1195 // CHECK1-NEXT: [[TMP25:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS2]], i32 0, i32 10
1196 // CHECK1-NEXT: store [3 x i32] zeroinitializer, ptr [[TMP25]], align 4
1197 // CHECK1-NEXT: [[TMP26:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS2]], i32 0, i32 11
1198 // CHECK1-NEXT: store [3 x i32] [i32 1, i32 0, i32 0], ptr [[TMP26]], align 4
1199 // CHECK1-NEXT: [[TMP27:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS2]], i32 0, i32 12
1200 // CHECK1-NEXT: store i32 0, ptr [[TMP27]], align 4
1201 // CHECK1-NEXT: [[TMP28:%.*]] = call i32 @__tgt_target_kernel(ptr @[[GLOB3]], i64 -1, i32 0, i32 1, ptr @.{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z5tmainIiEiT__l62.region_id, ptr [[KERNEL_ARGS2]])
1202 // CHECK1-NEXT: [[TMP29:%.*]] = icmp ne i32 [[TMP28]], 0
1203 // CHECK1-NEXT: br i1 [[TMP29]], label [[OMP_OFFLOAD_FAILED3:%.*]], label [[OMP_OFFLOAD_CONT4:%.*]]
1204 // CHECK1: omp_offload.failed3:
1205 // CHECK1-NEXT: call void @{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z5tmainIiEiT__l62() #[[ATTR3]]
1206 // CHECK1-NEXT: br label [[OMP_OFFLOAD_CONT4]]
1207 // CHECK1: omp_offload.cont4:
1208 // CHECK1-NEXT: [[TMP30:%.*]] = load i32, ptr [[ARG_ADDR]], align 4
1209 // CHECK1-NEXT: store i32 [[TMP30]], ptr [[ARG_CASTED]], align 4
1210 // CHECK1-NEXT: [[TMP31:%.*]] = load i64, ptr [[ARG_CASTED]], align 8
1211 // CHECK1-NEXT: [[TMP32:%.*]] = getelementptr inbounds [1 x ptr], ptr [[DOTOFFLOAD_BASEPTRS]], i32 0, i32 0
1212 // CHECK1-NEXT: store i64 [[TMP31]], ptr [[TMP32]], align 8
1213 // CHECK1-NEXT: [[TMP33:%.*]] = getelementptr inbounds [1 x ptr], ptr [[DOTOFFLOAD_PTRS]], i32 0, i32 0
1214 // CHECK1-NEXT: store i64 [[TMP31]], ptr [[TMP33]], align 8
1215 // CHECK1-NEXT: [[TMP34:%.*]] = getelementptr inbounds [1 x ptr], ptr [[DOTOFFLOAD_MAPPERS]], i64 0, i64 0
1216 // CHECK1-NEXT: store ptr null, ptr [[TMP34]], align 8
1217 // CHECK1-NEXT: [[TMP35:%.*]] = getelementptr inbounds [1 x ptr], ptr [[DOTOFFLOAD_BASEPTRS]], i32 0, i32 0
1218 // CHECK1-NEXT: [[TMP36:%.*]] = getelementptr inbounds [1 x ptr], ptr [[DOTOFFLOAD_PTRS]], i32 0, i32 0
1219 // CHECK1-NEXT: [[TMP37:%.*]] = load i32, ptr [[ARG_ADDR]], align 4
1220 // CHECK1-NEXT: [[TOBOOL:%.*]] = icmp ne i32 [[TMP37]], 0
1221 // CHECK1-NEXT: [[FROMBOOL:%.*]] = zext i1 [[TOBOOL]] to i8
1222 // CHECK1-NEXT: store i8 [[FROMBOOL]], ptr [[DOTCAPTURE_EXPR_]], align 1
1223 // CHECK1-NEXT: [[TMP38:%.*]] = load i8, ptr [[DOTCAPTURE_EXPR_]], align 1
1224 // CHECK1-NEXT: [[TOBOOL5:%.*]] = trunc i8 [[TMP38]] to i1
1225 // CHECK1-NEXT: [[TMP39:%.*]] = select i1 [[TOBOOL5]], i32 0, i32 1
1226 // CHECK1-NEXT: [[TMP40:%.*]] = insertvalue [3 x i32] zeroinitializer, i32 [[TMP39]], 0
1227 // CHECK1-NEXT: [[TMP41:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS7]], i32 0, i32 0
1228 // CHECK1-NEXT: store i32 2, ptr [[TMP41]], align 4
1229 // CHECK1-NEXT: [[TMP42:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS7]], i32 0, i32 1
1230 // CHECK1-NEXT: store i32 1, ptr [[TMP42]], align 4
1231 // CHECK1-NEXT: [[TMP43:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS7]], i32 0, i32 2
1232 // CHECK1-NEXT: store ptr [[TMP35]], ptr [[TMP43]], align 8
1233 // CHECK1-NEXT: [[TMP44:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS7]], i32 0, i32 3
1234 // CHECK1-NEXT: store ptr [[TMP36]], ptr [[TMP44]], align 8
1235 // CHECK1-NEXT: [[TMP45:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS7]], i32 0, i32 4
1236 // CHECK1-NEXT: store ptr @.offload_sizes.1, ptr [[TMP45]], align 8
1237 // CHECK1-NEXT: [[TMP46:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS7]], i32 0, i32 5
1238 // CHECK1-NEXT: store ptr @.offload_maptypes.2, ptr [[TMP46]], align 8
1239 // CHECK1-NEXT: [[TMP47:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS7]], i32 0, i32 6
1240 // CHECK1-NEXT: store ptr null, ptr [[TMP47]], align 8
1241 // CHECK1-NEXT: [[TMP48:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS7]], i32 0, i32 7
1242 // CHECK1-NEXT: store ptr null, ptr [[TMP48]], align 8
1243 // CHECK1-NEXT: [[TMP49:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS7]], i32 0, i32 8
1244 // CHECK1-NEXT: store i64 100, ptr [[TMP49]], align 8
1245 // CHECK1-NEXT: [[TMP50:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS7]], i32 0, i32 9
1246 // CHECK1-NEXT: store i64 0, ptr [[TMP50]], align 8
1247 // CHECK1-NEXT: [[TMP51:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS7]], i32 0, i32 10
1248 // CHECK1-NEXT: store [3 x i32] zeroinitializer, ptr [[TMP51]], align 4
1249 // CHECK1-NEXT: [[TMP52:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS7]], i32 0, i32 11
1250 // CHECK1-NEXT: store [3 x i32] [[TMP40]], ptr [[TMP52]], align 4
1251 // CHECK1-NEXT: [[TMP53:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS7]], i32 0, i32 12
1252 // CHECK1-NEXT: store i32 0, ptr [[TMP53]], align 4
1253 // CHECK1-NEXT: [[TMP54:%.*]] = call i32 @__tgt_target_kernel(ptr @[[GLOB3]], i64 -1, i32 0, i32 [[TMP39]], ptr @.{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z5tmainIiEiT__l67.region_id, ptr [[KERNEL_ARGS7]])
1254 // CHECK1-NEXT: [[TMP55:%.*]] = icmp ne i32 [[TMP54]], 0
1255 // CHECK1-NEXT: br i1 [[TMP55]], label [[OMP_OFFLOAD_FAILED8:%.*]], label [[OMP_OFFLOAD_CONT9:%.*]]
1256 // CHECK1: omp_offload.failed8:
1257 // CHECK1-NEXT: call void @{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z5tmainIiEiT__l67(i64 [[TMP31]]) #[[ATTR3]]
1258 // CHECK1-NEXT: br label [[OMP_OFFLOAD_CONT9]]
1259 // CHECK1: omp_offload.cont9:
1260 // CHECK1-NEXT: ret i32 0
1263 // CHECK1-LABEL: define {{[^@]+}}@{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z5tmainIiEiT__l57
1264 // CHECK1-SAME: () #[[ATTR1]] {
1265 // CHECK1-NEXT: entry:
1266 // CHECK1-NEXT: call void (ptr, i32, ptr, ...) @__kmpc_fork_teams(ptr @[[GLOB3]], i32 0, ptr @{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z5tmainIiEiT__l57.omp_outlined)
1267 // CHECK1-NEXT: ret void
1270 // CHECK1-LABEL: define {{[^@]+}}@{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z5tmainIiEiT__l57.omp_outlined
1271 // CHECK1-SAME: (ptr noalias noundef [[DOTGLOBAL_TID_:%.*]], ptr noalias noundef [[DOTBOUND_TID_:%.*]]) #[[ATTR2]] {
1272 // CHECK1-NEXT: entry:
1273 // CHECK1-NEXT: [[DOTGLOBAL_TID__ADDR:%.*]] = alloca ptr, align 8
1274 // CHECK1-NEXT: [[DOTBOUND_TID__ADDR:%.*]] = alloca ptr, align 8
1275 // CHECK1-NEXT: [[DOTOMP_IV:%.*]] = alloca i32, align 4
1276 // CHECK1-NEXT: [[TMP:%.*]] = alloca i32, align 4
1277 // CHECK1-NEXT: [[DOTOMP_COMB_LB:%.*]] = alloca i32, align 4
1278 // CHECK1-NEXT: [[DOTOMP_COMB_UB:%.*]] = alloca i32, align 4
1279 // CHECK1-NEXT: [[DOTOMP_STRIDE:%.*]] = alloca i32, align 4
1280 // CHECK1-NEXT: [[DOTOMP_IS_LAST:%.*]] = alloca i32, align 4
1281 // CHECK1-NEXT: [[I:%.*]] = alloca i32, align 4
1282 // CHECK1-NEXT: store ptr [[DOTGLOBAL_TID_]], ptr [[DOTGLOBAL_TID__ADDR]], align 8
1283 // CHECK1-NEXT: store ptr [[DOTBOUND_TID_]], ptr [[DOTBOUND_TID__ADDR]], align 8
1284 // CHECK1-NEXT: store i32 0, ptr [[DOTOMP_COMB_LB]], align 4
1285 // CHECK1-NEXT: store i32 99, ptr [[DOTOMP_COMB_UB]], align 4
1286 // CHECK1-NEXT: store i32 1, ptr [[DOTOMP_STRIDE]], align 4
1287 // CHECK1-NEXT: store i32 0, ptr [[DOTOMP_IS_LAST]], align 4
1288 // CHECK1-NEXT: [[TMP0:%.*]] = load ptr, ptr [[DOTGLOBAL_TID__ADDR]], align 8
1289 // CHECK1-NEXT: [[TMP1:%.*]] = load i32, ptr [[TMP0]], align 4
1290 // 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)
1291 // CHECK1-NEXT: [[TMP2:%.*]] = load i32, ptr [[DOTOMP_COMB_UB]], align 4
1292 // CHECK1-NEXT: [[CMP:%.*]] = icmp sgt i32 [[TMP2]], 99
1293 // CHECK1-NEXT: br i1 [[CMP]], label [[COND_TRUE:%.*]], label [[COND_FALSE:%.*]]
1294 // CHECK1: cond.true:
1295 // CHECK1-NEXT: br label [[COND_END:%.*]]
1296 // CHECK1: cond.false:
1297 // CHECK1-NEXT: [[TMP3:%.*]] = load i32, ptr [[DOTOMP_COMB_UB]], align 4
1298 // CHECK1-NEXT: br label [[COND_END]]
1299 // CHECK1: cond.end:
1300 // CHECK1-NEXT: [[COND:%.*]] = phi i32 [ 99, [[COND_TRUE]] ], [ [[TMP3]], [[COND_FALSE]] ]
1301 // CHECK1-NEXT: store i32 [[COND]], ptr [[DOTOMP_COMB_UB]], align 4
1302 // CHECK1-NEXT: [[TMP4:%.*]] = load i32, ptr [[DOTOMP_COMB_LB]], align 4
1303 // CHECK1-NEXT: store i32 [[TMP4]], ptr [[DOTOMP_IV]], align 4
1304 // CHECK1-NEXT: br label [[OMP_INNER_FOR_COND:%.*]]
1305 // CHECK1: omp.inner.for.cond:
1306 // CHECK1-NEXT: [[TMP5:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP44:![0-9]+]]
1307 // CHECK1-NEXT: [[TMP6:%.*]] = load i32, ptr [[DOTOMP_COMB_UB]], align 4, !llvm.access.group [[ACC_GRP44]]
1308 // CHECK1-NEXT: [[CMP1:%.*]] = icmp sle i32 [[TMP5]], [[TMP6]]
1309 // CHECK1-NEXT: br i1 [[CMP1]], label [[OMP_INNER_FOR_BODY:%.*]], label [[OMP_INNER_FOR_END:%.*]]
1310 // CHECK1: omp.inner.for.body:
1311 // CHECK1-NEXT: [[TMP7:%.*]] = load i32, ptr [[DOTOMP_COMB_LB]], align 4, !llvm.access.group [[ACC_GRP44]]
1312 // CHECK1-NEXT: [[TMP8:%.*]] = zext i32 [[TMP7]] to i64
1313 // CHECK1-NEXT: [[TMP9:%.*]] = load i32, ptr [[DOTOMP_COMB_UB]], align 4, !llvm.access.group [[ACC_GRP44]]
1314 // CHECK1-NEXT: [[TMP10:%.*]] = zext i32 [[TMP9]] to i64
1315 // CHECK1-NEXT: call void (ptr, i32, ptr, ...) @__kmpc_fork_call(ptr @[[GLOB3]], i32 2, ptr @{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z5tmainIiEiT__l57.omp_outlined.omp_outlined, i64 [[TMP8]], i64 [[TMP10]]), !llvm.access.group [[ACC_GRP44]]
1316 // CHECK1-NEXT: br label [[OMP_INNER_FOR_INC:%.*]]
1317 // CHECK1: omp.inner.for.inc:
1318 // CHECK1-NEXT: [[TMP11:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP44]]
1319 // CHECK1-NEXT: [[TMP12:%.*]] = load i32, ptr [[DOTOMP_STRIDE]], align 4, !llvm.access.group [[ACC_GRP44]]
1320 // CHECK1-NEXT: [[ADD:%.*]] = add nsw i32 [[TMP11]], [[TMP12]]
1321 // CHECK1-NEXT: store i32 [[ADD]], ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP44]]
1322 // CHECK1-NEXT: br label [[OMP_INNER_FOR_COND]], !llvm.loop [[LOOP45:![0-9]+]]
1323 // CHECK1: omp.inner.for.end:
1324 // CHECK1-NEXT: br label [[OMP_LOOP_EXIT:%.*]]
1325 // CHECK1: omp.loop.exit:
1326 // CHECK1-NEXT: call void @__kmpc_for_static_fini(ptr @[[GLOB1]], i32 [[TMP1]])
1327 // CHECK1-NEXT: [[TMP13:%.*]] = load i32, ptr [[DOTOMP_IS_LAST]], align 4
1328 // CHECK1-NEXT: [[TMP14:%.*]] = icmp ne i32 [[TMP13]], 0
1329 // CHECK1-NEXT: br i1 [[TMP14]], label [[DOTOMP_FINAL_THEN:%.*]], label [[DOTOMP_FINAL_DONE:%.*]]
1330 // CHECK1: .omp.final.then:
1331 // CHECK1-NEXT: store i32 100, ptr [[I]], align 4
1332 // CHECK1-NEXT: br label [[DOTOMP_FINAL_DONE]]
1333 // CHECK1: .omp.final.done:
1334 // CHECK1-NEXT: ret void
1337 // CHECK1-LABEL: define {{[^@]+}}@{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z5tmainIiEiT__l57.omp_outlined.omp_outlined
1338 // CHECK1-SAME: (ptr noalias noundef [[DOTGLOBAL_TID_:%.*]], ptr noalias noundef [[DOTBOUND_TID_:%.*]], i64 noundef [[DOTPREVIOUS_LB_:%.*]], i64 noundef [[DOTPREVIOUS_UB_:%.*]]) #[[ATTR2]] {
1339 // CHECK1-NEXT: entry:
1340 // CHECK1-NEXT: [[DOTGLOBAL_TID__ADDR:%.*]] = alloca ptr, align 8
1341 // CHECK1-NEXT: [[DOTBOUND_TID__ADDR:%.*]] = alloca ptr, align 8
1342 // CHECK1-NEXT: [[DOTPREVIOUS_LB__ADDR:%.*]] = alloca i64, align 8
1343 // CHECK1-NEXT: [[DOTPREVIOUS_UB__ADDR:%.*]] = alloca i64, align 8
1344 // CHECK1-NEXT: [[DOTOMP_IV:%.*]] = alloca i32, align 4
1345 // CHECK1-NEXT: [[TMP:%.*]] = alloca i32, align 4
1346 // CHECK1-NEXT: [[DOTOMP_LB:%.*]] = alloca i32, align 4
1347 // CHECK1-NEXT: [[DOTOMP_UB:%.*]] = alloca i32, align 4
1348 // CHECK1-NEXT: [[DOTOMP_STRIDE:%.*]] = alloca i32, align 4
1349 // CHECK1-NEXT: [[DOTOMP_IS_LAST:%.*]] = alloca i32, align 4
1350 // CHECK1-NEXT: [[I:%.*]] = alloca i32, align 4
1351 // CHECK1-NEXT: store ptr [[DOTGLOBAL_TID_]], ptr [[DOTGLOBAL_TID__ADDR]], align 8
1352 // CHECK1-NEXT: store ptr [[DOTBOUND_TID_]], ptr [[DOTBOUND_TID__ADDR]], align 8
1353 // CHECK1-NEXT: store i64 [[DOTPREVIOUS_LB_]], ptr [[DOTPREVIOUS_LB__ADDR]], align 8
1354 // CHECK1-NEXT: store i64 [[DOTPREVIOUS_UB_]], ptr [[DOTPREVIOUS_UB__ADDR]], align 8
1355 // CHECK1-NEXT: store i32 0, ptr [[DOTOMP_LB]], align 4
1356 // CHECK1-NEXT: store i32 99, ptr [[DOTOMP_UB]], align 4
1357 // CHECK1-NEXT: [[TMP0:%.*]] = load i64, ptr [[DOTPREVIOUS_LB__ADDR]], align 8
1358 // CHECK1-NEXT: [[CONV:%.*]] = trunc i64 [[TMP0]] to i32
1359 // CHECK1-NEXT: [[TMP1:%.*]] = load i64, ptr [[DOTPREVIOUS_UB__ADDR]], align 8
1360 // CHECK1-NEXT: [[CONV1:%.*]] = trunc i64 [[TMP1]] to i32
1361 // CHECK1-NEXT: store i32 [[CONV]], ptr [[DOTOMP_LB]], align 4
1362 // CHECK1-NEXT: store i32 [[CONV1]], ptr [[DOTOMP_UB]], align 4
1363 // CHECK1-NEXT: store i32 1, ptr [[DOTOMP_STRIDE]], align 4
1364 // CHECK1-NEXT: store i32 0, ptr [[DOTOMP_IS_LAST]], align 4
1365 // CHECK1-NEXT: [[TMP2:%.*]] = load ptr, ptr [[DOTGLOBAL_TID__ADDR]], align 8
1366 // CHECK1-NEXT: [[TMP3:%.*]] = load i32, ptr [[TMP2]], align 4
1367 // 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)
1368 // CHECK1-NEXT: [[TMP4:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4
1369 // CHECK1-NEXT: [[CMP:%.*]] = icmp sgt i32 [[TMP4]], 99
1370 // CHECK1-NEXT: br i1 [[CMP]], label [[COND_TRUE:%.*]], label [[COND_FALSE:%.*]]
1371 // CHECK1: cond.true:
1372 // CHECK1-NEXT: br label [[COND_END:%.*]]
1373 // CHECK1: cond.false:
1374 // CHECK1-NEXT: [[TMP5:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4
1375 // CHECK1-NEXT: br label [[COND_END]]
1376 // CHECK1: cond.end:
1377 // CHECK1-NEXT: [[COND:%.*]] = phi i32 [ 99, [[COND_TRUE]] ], [ [[TMP5]], [[COND_FALSE]] ]
1378 // CHECK1-NEXT: store i32 [[COND]], ptr [[DOTOMP_UB]], align 4
1379 // CHECK1-NEXT: [[TMP6:%.*]] = load i32, ptr [[DOTOMP_LB]], align 4
1380 // CHECK1-NEXT: store i32 [[TMP6]], ptr [[DOTOMP_IV]], align 4
1381 // CHECK1-NEXT: br label [[OMP_INNER_FOR_COND:%.*]]
1382 // CHECK1: omp.inner.for.cond:
1383 // CHECK1-NEXT: [[TMP7:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP47:![0-9]+]]
1384 // CHECK1-NEXT: [[TMP8:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4, !llvm.access.group [[ACC_GRP47]]
1385 // CHECK1-NEXT: [[CMP2:%.*]] = icmp sle i32 [[TMP7]], [[TMP8]]
1386 // CHECK1-NEXT: br i1 [[CMP2]], label [[OMP_INNER_FOR_BODY:%.*]], label [[OMP_INNER_FOR_END:%.*]]
1387 // CHECK1: omp.inner.for.body:
1388 // CHECK1-NEXT: [[TMP9:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP47]]
1389 // CHECK1-NEXT: [[MUL:%.*]] = mul nsw i32 [[TMP9]], 1
1390 // CHECK1-NEXT: [[ADD:%.*]] = add nsw i32 0, [[MUL]]
1391 // CHECK1-NEXT: store i32 [[ADD]], ptr [[I]], align 4, !llvm.access.group [[ACC_GRP47]]
1392 // CHECK1-NEXT: call void @_Z3fn1v(), !llvm.access.group [[ACC_GRP47]]
1393 // CHECK1-NEXT: br label [[OMP_BODY_CONTINUE:%.*]]
1394 // CHECK1: omp.body.continue:
1395 // CHECK1-NEXT: br label [[OMP_INNER_FOR_INC:%.*]]
1396 // CHECK1: omp.inner.for.inc:
1397 // CHECK1-NEXT: [[TMP10:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP47]]
1398 // CHECK1-NEXT: [[ADD3:%.*]] = add nsw i32 [[TMP10]], 1
1399 // CHECK1-NEXT: store i32 [[ADD3]], ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP47]]
1400 // CHECK1-NEXT: br label [[OMP_INNER_FOR_COND]], !llvm.loop [[LOOP48:![0-9]+]]
1401 // CHECK1: omp.inner.for.end:
1402 // CHECK1-NEXT: br label [[OMP_LOOP_EXIT:%.*]]
1403 // CHECK1: omp.loop.exit:
1404 // CHECK1-NEXT: call void @__kmpc_for_static_fini(ptr @[[GLOB1]], i32 [[TMP3]])
1405 // CHECK1-NEXT: [[TMP11:%.*]] = load i32, ptr [[DOTOMP_IS_LAST]], align 4
1406 // CHECK1-NEXT: [[TMP12:%.*]] = icmp ne i32 [[TMP11]], 0
1407 // CHECK1-NEXT: br i1 [[TMP12]], label [[DOTOMP_FINAL_THEN:%.*]], label [[DOTOMP_FINAL_DONE:%.*]]
1408 // CHECK1: .omp.final.then:
1409 // CHECK1-NEXT: store i32 100, ptr [[I]], align 4
1410 // CHECK1-NEXT: br label [[DOTOMP_FINAL_DONE]]
1411 // CHECK1: .omp.final.done:
1412 // CHECK1-NEXT: ret void
1415 // CHECK1-LABEL: define {{[^@]+}}@{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z5tmainIiEiT__l62
1416 // CHECK1-SAME: () #[[ATTR1]] {
1417 // CHECK1-NEXT: entry:
1418 // CHECK1-NEXT: call void (ptr, i32, ptr, ...) @__kmpc_fork_teams(ptr @[[GLOB3]], i32 0, ptr @{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z5tmainIiEiT__l62.omp_outlined)
1419 // CHECK1-NEXT: ret void
1422 // CHECK1-LABEL: define {{[^@]+}}@{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z5tmainIiEiT__l62.omp_outlined
1423 // CHECK1-SAME: (ptr noalias noundef [[DOTGLOBAL_TID_:%.*]], ptr noalias noundef [[DOTBOUND_TID_:%.*]]) #[[ATTR2]] {
1424 // CHECK1-NEXT: entry:
1425 // CHECK1-NEXT: [[DOTGLOBAL_TID__ADDR:%.*]] = alloca ptr, align 8
1426 // CHECK1-NEXT: [[DOTBOUND_TID__ADDR:%.*]] = alloca ptr, align 8
1427 // CHECK1-NEXT: [[DOTOMP_IV:%.*]] = alloca i32, align 4
1428 // CHECK1-NEXT: [[TMP:%.*]] = alloca i32, align 4
1429 // CHECK1-NEXT: [[DOTOMP_COMB_LB:%.*]] = alloca i32, align 4
1430 // CHECK1-NEXT: [[DOTOMP_COMB_UB:%.*]] = alloca i32, align 4
1431 // CHECK1-NEXT: [[DOTOMP_STRIDE:%.*]] = alloca i32, align 4
1432 // CHECK1-NEXT: [[DOTOMP_IS_LAST:%.*]] = alloca i32, align 4
1433 // CHECK1-NEXT: [[I:%.*]] = alloca i32, align 4
1434 // CHECK1-NEXT: [[DOTBOUND_ZERO_ADDR:%.*]] = alloca i32, align 4
1435 // CHECK1-NEXT: store ptr [[DOTGLOBAL_TID_]], ptr [[DOTGLOBAL_TID__ADDR]], align 8
1436 // CHECK1-NEXT: store ptr [[DOTBOUND_TID_]], ptr [[DOTBOUND_TID__ADDR]], align 8
1437 // CHECK1-NEXT: store i32 0, ptr [[DOTOMP_COMB_LB]], align 4
1438 // CHECK1-NEXT: store i32 99, ptr [[DOTOMP_COMB_UB]], align 4
1439 // CHECK1-NEXT: store i32 1, ptr [[DOTOMP_STRIDE]], align 4
1440 // CHECK1-NEXT: store i32 0, ptr [[DOTOMP_IS_LAST]], align 4
1441 // CHECK1-NEXT: [[TMP0:%.*]] = load ptr, ptr [[DOTGLOBAL_TID__ADDR]], align 8
1442 // CHECK1-NEXT: [[TMP1:%.*]] = load i32, ptr [[TMP0]], align 4
1443 // 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)
1444 // CHECK1-NEXT: [[TMP2:%.*]] = load i32, ptr [[DOTOMP_COMB_UB]], align 4
1445 // CHECK1-NEXT: [[CMP:%.*]] = icmp sgt i32 [[TMP2]], 99
1446 // CHECK1-NEXT: br i1 [[CMP]], label [[COND_TRUE:%.*]], label [[COND_FALSE:%.*]]
1447 // CHECK1: cond.true:
1448 // CHECK1-NEXT: br label [[COND_END:%.*]]
1449 // CHECK1: cond.false:
1450 // CHECK1-NEXT: [[TMP3:%.*]] = load i32, ptr [[DOTOMP_COMB_UB]], align 4
1451 // CHECK1-NEXT: br label [[COND_END]]
1452 // CHECK1: cond.end:
1453 // CHECK1-NEXT: [[COND:%.*]] = phi i32 [ 99, [[COND_TRUE]] ], [ [[TMP3]], [[COND_FALSE]] ]
1454 // CHECK1-NEXT: store i32 [[COND]], ptr [[DOTOMP_COMB_UB]], align 4
1455 // CHECK1-NEXT: [[TMP4:%.*]] = load i32, ptr [[DOTOMP_COMB_LB]], align 4
1456 // CHECK1-NEXT: store i32 [[TMP4]], ptr [[DOTOMP_IV]], align 4
1457 // CHECK1-NEXT: br label [[OMP_INNER_FOR_COND:%.*]]
1458 // CHECK1: omp.inner.for.cond:
1459 // CHECK1-NEXT: [[TMP5:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP50:![0-9]+]]
1460 // CHECK1-NEXT: [[TMP6:%.*]] = load i32, ptr [[DOTOMP_COMB_UB]], align 4, !llvm.access.group [[ACC_GRP50]]
1461 // CHECK1-NEXT: [[CMP1:%.*]] = icmp sle i32 [[TMP5]], [[TMP6]]
1462 // CHECK1-NEXT: br i1 [[CMP1]], label [[OMP_INNER_FOR_BODY:%.*]], label [[OMP_INNER_FOR_END:%.*]]
1463 // CHECK1: omp.inner.for.body:
1464 // CHECK1-NEXT: [[TMP7:%.*]] = load i32, ptr [[DOTOMP_COMB_LB]], align 4, !llvm.access.group [[ACC_GRP50]]
1465 // CHECK1-NEXT: [[TMP8:%.*]] = zext i32 [[TMP7]] to i64
1466 // CHECK1-NEXT: [[TMP9:%.*]] = load i32, ptr [[DOTOMP_COMB_UB]], align 4, !llvm.access.group [[ACC_GRP50]]
1467 // CHECK1-NEXT: [[TMP10:%.*]] = zext i32 [[TMP9]] to i64
1468 // CHECK1-NEXT: call void @__kmpc_serialized_parallel(ptr @[[GLOB3]], i32 [[TMP1]]), !llvm.access.group [[ACC_GRP50]]
1469 // CHECK1-NEXT: [[TMP11:%.*]] = load ptr, ptr [[DOTGLOBAL_TID__ADDR]], align 8, !llvm.access.group [[ACC_GRP50]]
1470 // CHECK1-NEXT: store i32 0, ptr [[DOTBOUND_ZERO_ADDR]], align 4, !llvm.access.group [[ACC_GRP50]]
1471 // CHECK1-NEXT: call void @{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z5tmainIiEiT__l62.omp_outlined.omp_outlined(ptr [[TMP11]], ptr [[DOTBOUND_ZERO_ADDR]], i64 [[TMP8]], i64 [[TMP10]]) #[[ATTR3]], !llvm.access.group [[ACC_GRP50]]
1472 // CHECK1-NEXT: call void @__kmpc_end_serialized_parallel(ptr @[[GLOB3]], i32 [[TMP1]]), !llvm.access.group [[ACC_GRP50]]
1473 // CHECK1-NEXT: br label [[OMP_INNER_FOR_INC:%.*]]
1474 // CHECK1: omp.inner.for.inc:
1475 // CHECK1-NEXT: [[TMP12:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP50]]
1476 // CHECK1-NEXT: [[TMP13:%.*]] = load i32, ptr [[DOTOMP_STRIDE]], align 4, !llvm.access.group [[ACC_GRP50]]
1477 // CHECK1-NEXT: [[ADD:%.*]] = add nsw i32 [[TMP12]], [[TMP13]]
1478 // CHECK1-NEXT: store i32 [[ADD]], ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP50]]
1479 // CHECK1-NEXT: br label [[OMP_INNER_FOR_COND]], !llvm.loop [[LOOP51:![0-9]+]]
1480 // CHECK1: omp.inner.for.end:
1481 // CHECK1-NEXT: br label [[OMP_LOOP_EXIT:%.*]]
1482 // CHECK1: omp.loop.exit:
1483 // CHECK1-NEXT: call void @__kmpc_for_static_fini(ptr @[[GLOB1]], i32 [[TMP1]])
1484 // CHECK1-NEXT: [[TMP14:%.*]] = load i32, ptr [[DOTOMP_IS_LAST]], align 4
1485 // CHECK1-NEXT: [[TMP15:%.*]] = icmp ne i32 [[TMP14]], 0
1486 // CHECK1-NEXT: br i1 [[TMP15]], label [[DOTOMP_FINAL_THEN:%.*]], label [[DOTOMP_FINAL_DONE:%.*]]
1487 // CHECK1: .omp.final.then:
1488 // CHECK1-NEXT: store i32 100, ptr [[I]], align 4
1489 // CHECK1-NEXT: br label [[DOTOMP_FINAL_DONE]]
1490 // CHECK1: .omp.final.done:
1491 // CHECK1-NEXT: ret void
1494 // CHECK1-LABEL: define {{[^@]+}}@{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z5tmainIiEiT__l62.omp_outlined.omp_outlined
1495 // CHECK1-SAME: (ptr noalias noundef [[DOTGLOBAL_TID_:%.*]], ptr noalias noundef [[DOTBOUND_TID_:%.*]], i64 noundef [[DOTPREVIOUS_LB_:%.*]], i64 noundef [[DOTPREVIOUS_UB_:%.*]]) #[[ATTR2]] {
1496 // CHECK1-NEXT: entry:
1497 // CHECK1-NEXT: [[DOTGLOBAL_TID__ADDR:%.*]] = alloca ptr, align 8
1498 // CHECK1-NEXT: [[DOTBOUND_TID__ADDR:%.*]] = alloca ptr, align 8
1499 // CHECK1-NEXT: [[DOTPREVIOUS_LB__ADDR:%.*]] = alloca i64, align 8
1500 // CHECK1-NEXT: [[DOTPREVIOUS_UB__ADDR:%.*]] = alloca i64, align 8
1501 // CHECK1-NEXT: [[DOTOMP_IV:%.*]] = alloca i32, align 4
1502 // CHECK1-NEXT: [[TMP:%.*]] = alloca i32, align 4
1503 // CHECK1-NEXT: [[DOTOMP_LB:%.*]] = alloca i32, align 4
1504 // CHECK1-NEXT: [[DOTOMP_UB:%.*]] = alloca i32, align 4
1505 // CHECK1-NEXT: [[DOTOMP_STRIDE:%.*]] = alloca i32, align 4
1506 // CHECK1-NEXT: [[DOTOMP_IS_LAST:%.*]] = alloca i32, align 4
1507 // CHECK1-NEXT: [[I:%.*]] = alloca i32, align 4
1508 // CHECK1-NEXT: store ptr [[DOTGLOBAL_TID_]], ptr [[DOTGLOBAL_TID__ADDR]], align 8
1509 // CHECK1-NEXT: store ptr [[DOTBOUND_TID_]], ptr [[DOTBOUND_TID__ADDR]], align 8
1510 // CHECK1-NEXT: store i64 [[DOTPREVIOUS_LB_]], ptr [[DOTPREVIOUS_LB__ADDR]], align 8
1511 // CHECK1-NEXT: store i64 [[DOTPREVIOUS_UB_]], ptr [[DOTPREVIOUS_UB__ADDR]], align 8
1512 // CHECK1-NEXT: store i32 0, ptr [[DOTOMP_LB]], align 4
1513 // CHECK1-NEXT: store i32 99, ptr [[DOTOMP_UB]], align 4
1514 // CHECK1-NEXT: [[TMP0:%.*]] = load i64, ptr [[DOTPREVIOUS_LB__ADDR]], align 8
1515 // CHECK1-NEXT: [[CONV:%.*]] = trunc i64 [[TMP0]] to i32
1516 // CHECK1-NEXT: [[TMP1:%.*]] = load i64, ptr [[DOTPREVIOUS_UB__ADDR]], align 8
1517 // CHECK1-NEXT: [[CONV1:%.*]] = trunc i64 [[TMP1]] to i32
1518 // CHECK1-NEXT: store i32 [[CONV]], ptr [[DOTOMP_LB]], align 4
1519 // CHECK1-NEXT: store i32 [[CONV1]], ptr [[DOTOMP_UB]], align 4
1520 // CHECK1-NEXT: store i32 1, ptr [[DOTOMP_STRIDE]], align 4
1521 // CHECK1-NEXT: store i32 0, ptr [[DOTOMP_IS_LAST]], align 4
1522 // CHECK1-NEXT: [[TMP2:%.*]] = load ptr, ptr [[DOTGLOBAL_TID__ADDR]], align 8
1523 // CHECK1-NEXT: [[TMP3:%.*]] = load i32, ptr [[TMP2]], align 4
1524 // 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)
1525 // CHECK1-NEXT: [[TMP4:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4
1526 // CHECK1-NEXT: [[CMP:%.*]] = icmp sgt i32 [[TMP4]], 99
1527 // CHECK1-NEXT: br i1 [[CMP]], label [[COND_TRUE:%.*]], label [[COND_FALSE:%.*]]
1528 // CHECK1: cond.true:
1529 // CHECK1-NEXT: br label [[COND_END:%.*]]
1530 // CHECK1: cond.false:
1531 // CHECK1-NEXT: [[TMP5:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4
1532 // CHECK1-NEXT: br label [[COND_END]]
1533 // CHECK1: cond.end:
1534 // CHECK1-NEXT: [[COND:%.*]] = phi i32 [ 99, [[COND_TRUE]] ], [ [[TMP5]], [[COND_FALSE]] ]
1535 // CHECK1-NEXT: store i32 [[COND]], ptr [[DOTOMP_UB]], align 4
1536 // CHECK1-NEXT: [[TMP6:%.*]] = load i32, ptr [[DOTOMP_LB]], align 4
1537 // CHECK1-NEXT: store i32 [[TMP6]], ptr [[DOTOMP_IV]], align 4
1538 // CHECK1-NEXT: br label [[OMP_INNER_FOR_COND:%.*]]
1539 // CHECK1: omp.inner.for.cond:
1540 // CHECK1-NEXT: [[TMP7:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP53:![0-9]+]]
1541 // CHECK1-NEXT: [[TMP8:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4, !llvm.access.group [[ACC_GRP53]]
1542 // CHECK1-NEXT: [[CMP2:%.*]] = icmp sle i32 [[TMP7]], [[TMP8]]
1543 // CHECK1-NEXT: br i1 [[CMP2]], label [[OMP_INNER_FOR_BODY:%.*]], label [[OMP_INNER_FOR_END:%.*]]
1544 // CHECK1: omp.inner.for.body:
1545 // CHECK1-NEXT: [[TMP9:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP53]]
1546 // CHECK1-NEXT: [[MUL:%.*]] = mul nsw i32 [[TMP9]], 1
1547 // CHECK1-NEXT: [[ADD:%.*]] = add nsw i32 0, [[MUL]]
1548 // CHECK1-NEXT: store i32 [[ADD]], ptr [[I]], align 4, !llvm.access.group [[ACC_GRP53]]
1549 // CHECK1-NEXT: call void @_Z3fn2v(), !llvm.access.group [[ACC_GRP53]]
1550 // CHECK1-NEXT: br label [[OMP_BODY_CONTINUE:%.*]]
1551 // CHECK1: omp.body.continue:
1552 // CHECK1-NEXT: br label [[OMP_INNER_FOR_INC:%.*]]
1553 // CHECK1: omp.inner.for.inc:
1554 // CHECK1-NEXT: [[TMP10:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP53]]
1555 // CHECK1-NEXT: [[ADD3:%.*]] = add nsw i32 [[TMP10]], 1
1556 // CHECK1-NEXT: store i32 [[ADD3]], ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP53]]
1557 // CHECK1-NEXT: br label [[OMP_INNER_FOR_COND]], !llvm.loop [[LOOP54:![0-9]+]]
1558 // CHECK1: omp.inner.for.end:
1559 // CHECK1-NEXT: br label [[OMP_LOOP_EXIT:%.*]]
1560 // CHECK1: omp.loop.exit:
1561 // CHECK1-NEXT: call void @__kmpc_for_static_fini(ptr @[[GLOB1]], i32 [[TMP3]])
1562 // CHECK1-NEXT: [[TMP11:%.*]] = load i32, ptr [[DOTOMP_IS_LAST]], align 4
1563 // CHECK1-NEXT: [[TMP12:%.*]] = icmp ne i32 [[TMP11]], 0
1564 // CHECK1-NEXT: br i1 [[TMP12]], label [[DOTOMP_FINAL_THEN:%.*]], label [[DOTOMP_FINAL_DONE:%.*]]
1565 // CHECK1: .omp.final.then:
1566 // CHECK1-NEXT: store i32 100, ptr [[I]], align 4
1567 // CHECK1-NEXT: br label [[DOTOMP_FINAL_DONE]]
1568 // CHECK1: .omp.final.done:
1569 // CHECK1-NEXT: ret void
1572 // CHECK1-LABEL: define {{[^@]+}}@{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z5tmainIiEiT__l67
1573 // CHECK1-SAME: (i64 noundef [[ARG:%.*]]) #[[ATTR1]] {
1574 // CHECK1-NEXT: entry:
1575 // CHECK1-NEXT: [[ARG_ADDR:%.*]] = alloca i64, align 8
1576 // CHECK1-NEXT: [[DOTCAPTURE_EXPR_:%.*]] = alloca i8, align 1
1577 // CHECK1-NEXT: [[DOTCAPTURE_EXPR__CASTED:%.*]] = alloca i64, align 8
1578 // CHECK1-NEXT: store i64 [[ARG]], ptr [[ARG_ADDR]], align 8
1579 // CHECK1-NEXT: [[TMP0:%.*]] = load i32, ptr [[ARG_ADDR]], align 4
1580 // CHECK1-NEXT: [[TOBOOL:%.*]] = icmp ne i32 [[TMP0]], 0
1581 // CHECK1-NEXT: [[FROMBOOL:%.*]] = zext i1 [[TOBOOL]] to i8
1582 // CHECK1-NEXT: store i8 [[FROMBOOL]], ptr [[DOTCAPTURE_EXPR_]], align 1
1583 // CHECK1-NEXT: [[TMP1:%.*]] = load i8, ptr [[DOTCAPTURE_EXPR_]], align 1
1584 // CHECK1-NEXT: [[TOBOOL1:%.*]] = trunc i8 [[TMP1]] to i1
1585 // CHECK1-NEXT: [[FROMBOOL2:%.*]] = zext i1 [[TOBOOL1]] to i8
1586 // CHECK1-NEXT: store i8 [[FROMBOOL2]], ptr [[DOTCAPTURE_EXPR__CASTED]], align 1
1587 // CHECK1-NEXT: [[TMP2:%.*]] = load i64, ptr [[DOTCAPTURE_EXPR__CASTED]], align 8
1588 // CHECK1-NEXT: call void (ptr, i32, ptr, ...) @__kmpc_fork_teams(ptr @[[GLOB3]], i32 1, ptr @{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z5tmainIiEiT__l67.omp_outlined, i64 [[TMP2]])
1589 // CHECK1-NEXT: ret void
1592 // CHECK1-LABEL: define {{[^@]+}}@{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z5tmainIiEiT__l67.omp_outlined
1593 // CHECK1-SAME: (ptr noalias noundef [[DOTGLOBAL_TID_:%.*]], ptr noalias noundef [[DOTBOUND_TID_:%.*]], i64 noundef [[DOTCAPTURE_EXPR_:%.*]]) #[[ATTR2]] {
1594 // CHECK1-NEXT: entry:
1595 // CHECK1-NEXT: [[DOTGLOBAL_TID__ADDR:%.*]] = alloca ptr, align 8
1596 // CHECK1-NEXT: [[DOTBOUND_TID__ADDR:%.*]] = alloca ptr, align 8
1597 // CHECK1-NEXT: [[DOTCAPTURE_EXPR__ADDR:%.*]] = alloca i64, align 8
1598 // CHECK1-NEXT: [[DOTOMP_IV:%.*]] = alloca i32, align 4
1599 // CHECK1-NEXT: [[TMP:%.*]] = alloca i32, align 4
1600 // CHECK1-NEXT: [[DOTOMP_COMB_LB:%.*]] = alloca i32, align 4
1601 // CHECK1-NEXT: [[DOTOMP_COMB_UB:%.*]] = alloca i32, align 4
1602 // CHECK1-NEXT: [[DOTOMP_STRIDE:%.*]] = alloca i32, align 4
1603 // CHECK1-NEXT: [[DOTOMP_IS_LAST:%.*]] = alloca i32, align 4
1604 // CHECK1-NEXT: [[I:%.*]] = alloca i32, align 4
1605 // CHECK1-NEXT: [[DOTBOUND_ZERO_ADDR:%.*]] = alloca i32, align 4
1606 // CHECK1-NEXT: store ptr [[DOTGLOBAL_TID_]], ptr [[DOTGLOBAL_TID__ADDR]], align 8
1607 // CHECK1-NEXT: store ptr [[DOTBOUND_TID_]], ptr [[DOTBOUND_TID__ADDR]], align 8
1608 // CHECK1-NEXT: store i64 [[DOTCAPTURE_EXPR_]], ptr [[DOTCAPTURE_EXPR__ADDR]], align 8
1609 // CHECK1-NEXT: store i32 0, ptr [[DOTOMP_COMB_LB]], align 4
1610 // CHECK1-NEXT: store i32 99, ptr [[DOTOMP_COMB_UB]], align 4
1611 // CHECK1-NEXT: store i32 1, ptr [[DOTOMP_STRIDE]], align 4
1612 // CHECK1-NEXT: store i32 0, ptr [[DOTOMP_IS_LAST]], align 4
1613 // CHECK1-NEXT: [[TMP0:%.*]] = load ptr, ptr [[DOTGLOBAL_TID__ADDR]], align 8
1614 // CHECK1-NEXT: [[TMP1:%.*]] = load i32, ptr [[TMP0]], align 4
1615 // 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)
1616 // CHECK1-NEXT: [[TMP2:%.*]] = load i32, ptr [[DOTOMP_COMB_UB]], align 4
1617 // CHECK1-NEXT: [[CMP:%.*]] = icmp sgt i32 [[TMP2]], 99
1618 // CHECK1-NEXT: br i1 [[CMP]], label [[COND_TRUE:%.*]], label [[COND_FALSE:%.*]]
1619 // CHECK1: cond.true:
1620 // CHECK1-NEXT: br label [[COND_END:%.*]]
1621 // CHECK1: cond.false:
1622 // CHECK1-NEXT: [[TMP3:%.*]] = load i32, ptr [[DOTOMP_COMB_UB]], align 4
1623 // CHECK1-NEXT: br label [[COND_END]]
1624 // CHECK1: cond.end:
1625 // CHECK1-NEXT: [[COND:%.*]] = phi i32 [ 99, [[COND_TRUE]] ], [ [[TMP3]], [[COND_FALSE]] ]
1626 // CHECK1-NEXT: store i32 [[COND]], ptr [[DOTOMP_COMB_UB]], align 4
1627 // CHECK1-NEXT: [[TMP4:%.*]] = load i32, ptr [[DOTOMP_COMB_LB]], align 4
1628 // CHECK1-NEXT: store i32 [[TMP4]], ptr [[DOTOMP_IV]], align 4
1629 // CHECK1-NEXT: br label [[OMP_INNER_FOR_COND:%.*]]
1630 // CHECK1: omp.inner.for.cond:
1631 // CHECK1-NEXT: [[TMP5:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP56:![0-9]+]]
1632 // CHECK1-NEXT: [[TMP6:%.*]] = load i32, ptr [[DOTOMP_COMB_UB]], align 4, !llvm.access.group [[ACC_GRP56]]
1633 // CHECK1-NEXT: [[CMP1:%.*]] = icmp sle i32 [[TMP5]], [[TMP6]]
1634 // CHECK1-NEXT: br i1 [[CMP1]], label [[OMP_INNER_FOR_BODY:%.*]], label [[OMP_INNER_FOR_END:%.*]]
1635 // CHECK1: omp.inner.for.body:
1636 // CHECK1-NEXT: [[TMP7:%.*]] = load i32, ptr [[DOTOMP_COMB_LB]], align 4, !llvm.access.group [[ACC_GRP56]]
1637 // CHECK1-NEXT: [[TMP8:%.*]] = zext i32 [[TMP7]] to i64
1638 // CHECK1-NEXT: [[TMP9:%.*]] = load i32, ptr [[DOTOMP_COMB_UB]], align 4, !llvm.access.group [[ACC_GRP56]]
1639 // CHECK1-NEXT: [[TMP10:%.*]] = zext i32 [[TMP9]] to i64
1640 // CHECK1-NEXT: [[TMP11:%.*]] = load i8, ptr [[DOTCAPTURE_EXPR__ADDR]], align 1, !llvm.access.group [[ACC_GRP56]]
1641 // CHECK1-NEXT: [[TOBOOL:%.*]] = trunc i8 [[TMP11]] to i1
1642 // CHECK1-NEXT: br i1 [[TOBOOL]], label [[OMP_IF_THEN:%.*]], label [[OMP_IF_ELSE:%.*]]
1643 // CHECK1: omp_if.then:
1644 // CHECK1-NEXT: call void (ptr, i32, ptr, ...) @__kmpc_fork_call(ptr @[[GLOB3]], i32 2, ptr @{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z5tmainIiEiT__l67.omp_outlined.omp_outlined, i64 [[TMP8]], i64 [[TMP10]]), !llvm.access.group [[ACC_GRP56]]
1645 // CHECK1-NEXT: br label [[OMP_IF_END:%.*]]
1646 // CHECK1: omp_if.else:
1647 // CHECK1-NEXT: call void @__kmpc_serialized_parallel(ptr @[[GLOB3]], i32 [[TMP1]]), !llvm.access.group [[ACC_GRP56]]
1648 // CHECK1-NEXT: [[TMP12:%.*]] = load ptr, ptr [[DOTGLOBAL_TID__ADDR]], align 8, !llvm.access.group [[ACC_GRP56]]
1649 // CHECK1-NEXT: store i32 0, ptr [[DOTBOUND_ZERO_ADDR]], align 4, !llvm.access.group [[ACC_GRP56]]
1650 // CHECK1-NEXT: call void @{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z5tmainIiEiT__l67.omp_outlined.omp_outlined(ptr [[TMP12]], ptr [[DOTBOUND_ZERO_ADDR]], i64 [[TMP8]], i64 [[TMP10]]) #[[ATTR3]], !llvm.access.group [[ACC_GRP56]]
1651 // CHECK1-NEXT: call void @__kmpc_end_serialized_parallel(ptr @[[GLOB3]], i32 [[TMP1]]), !llvm.access.group [[ACC_GRP56]]
1652 // CHECK1-NEXT: br label [[OMP_IF_END]]
1653 // CHECK1: omp_if.end:
1654 // CHECK1-NEXT: br label [[OMP_INNER_FOR_INC:%.*]]
1655 // CHECK1: omp.inner.for.inc:
1656 // CHECK1-NEXT: [[TMP13:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP56]]
1657 // CHECK1-NEXT: [[TMP14:%.*]] = load i32, ptr [[DOTOMP_STRIDE]], align 4, !llvm.access.group [[ACC_GRP56]]
1658 // CHECK1-NEXT: [[ADD:%.*]] = add nsw i32 [[TMP13]], [[TMP14]]
1659 // CHECK1-NEXT: store i32 [[ADD]], ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP56]]
1660 // CHECK1-NEXT: br label [[OMP_INNER_FOR_COND]], !llvm.loop [[LOOP57:![0-9]+]]
1661 // CHECK1: omp.inner.for.end:
1662 // CHECK1-NEXT: br label [[OMP_LOOP_EXIT:%.*]]
1663 // CHECK1: omp.loop.exit:
1664 // CHECK1-NEXT: call void @__kmpc_for_static_fini(ptr @[[GLOB1]], i32 [[TMP1]])
1665 // CHECK1-NEXT: [[TMP15:%.*]] = load i32, ptr [[DOTOMP_IS_LAST]], align 4
1666 // CHECK1-NEXT: [[TMP16:%.*]] = icmp ne i32 [[TMP15]], 0
1667 // CHECK1-NEXT: br i1 [[TMP16]], label [[DOTOMP_FINAL_THEN:%.*]], label [[DOTOMP_FINAL_DONE:%.*]]
1668 // CHECK1: .omp.final.then:
1669 // CHECK1-NEXT: store i32 100, ptr [[I]], align 4
1670 // CHECK1-NEXT: br label [[DOTOMP_FINAL_DONE]]
1671 // CHECK1: .omp.final.done:
1672 // CHECK1-NEXT: ret void
1675 // CHECK1-LABEL: define {{[^@]+}}@{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z5tmainIiEiT__l67.omp_outlined.omp_outlined
1676 // CHECK1-SAME: (ptr noalias noundef [[DOTGLOBAL_TID_:%.*]], ptr noalias noundef [[DOTBOUND_TID_:%.*]], i64 noundef [[DOTPREVIOUS_LB_:%.*]], i64 noundef [[DOTPREVIOUS_UB_:%.*]]) #[[ATTR2]] {
1677 // CHECK1-NEXT: entry:
1678 // CHECK1-NEXT: [[DOTGLOBAL_TID__ADDR:%.*]] = alloca ptr, align 8
1679 // CHECK1-NEXT: [[DOTBOUND_TID__ADDR:%.*]] = alloca ptr, align 8
1680 // CHECK1-NEXT: [[DOTPREVIOUS_LB__ADDR:%.*]] = alloca i64, align 8
1681 // CHECK1-NEXT: [[DOTPREVIOUS_UB__ADDR:%.*]] = alloca i64, align 8
1682 // CHECK1-NEXT: [[DOTOMP_IV:%.*]] = alloca i32, align 4
1683 // CHECK1-NEXT: [[TMP:%.*]] = alloca i32, align 4
1684 // CHECK1-NEXT: [[DOTOMP_LB:%.*]] = alloca i32, align 4
1685 // CHECK1-NEXT: [[DOTOMP_UB:%.*]] = alloca i32, align 4
1686 // CHECK1-NEXT: [[DOTOMP_STRIDE:%.*]] = alloca i32, align 4
1687 // CHECK1-NEXT: [[DOTOMP_IS_LAST:%.*]] = alloca i32, align 4
1688 // CHECK1-NEXT: [[I:%.*]] = alloca i32, align 4
1689 // CHECK1-NEXT: store ptr [[DOTGLOBAL_TID_]], ptr [[DOTGLOBAL_TID__ADDR]], align 8
1690 // CHECK1-NEXT: store ptr [[DOTBOUND_TID_]], ptr [[DOTBOUND_TID__ADDR]], align 8
1691 // CHECK1-NEXT: store i64 [[DOTPREVIOUS_LB_]], ptr [[DOTPREVIOUS_LB__ADDR]], align 8
1692 // CHECK1-NEXT: store i64 [[DOTPREVIOUS_UB_]], ptr [[DOTPREVIOUS_UB__ADDR]], align 8
1693 // CHECK1-NEXT: store i32 0, ptr [[DOTOMP_LB]], align 4
1694 // CHECK1-NEXT: store i32 99, ptr [[DOTOMP_UB]], align 4
1695 // CHECK1-NEXT: [[TMP0:%.*]] = load i64, ptr [[DOTPREVIOUS_LB__ADDR]], align 8
1696 // CHECK1-NEXT: [[CONV:%.*]] = trunc i64 [[TMP0]] to i32
1697 // CHECK1-NEXT: [[TMP1:%.*]] = load i64, ptr [[DOTPREVIOUS_UB__ADDR]], align 8
1698 // CHECK1-NEXT: [[CONV1:%.*]] = trunc i64 [[TMP1]] to i32
1699 // CHECK1-NEXT: store i32 [[CONV]], ptr [[DOTOMP_LB]], align 4
1700 // CHECK1-NEXT: store i32 [[CONV1]], ptr [[DOTOMP_UB]], align 4
1701 // CHECK1-NEXT: store i32 1, ptr [[DOTOMP_STRIDE]], align 4
1702 // CHECK1-NEXT: store i32 0, ptr [[DOTOMP_IS_LAST]], align 4
1703 // CHECK1-NEXT: [[TMP2:%.*]] = load ptr, ptr [[DOTGLOBAL_TID__ADDR]], align 8
1704 // CHECK1-NEXT: [[TMP3:%.*]] = load i32, ptr [[TMP2]], align 4
1705 // 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)
1706 // CHECK1-NEXT: [[TMP4:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4
1707 // CHECK1-NEXT: [[CMP:%.*]] = icmp sgt i32 [[TMP4]], 99
1708 // CHECK1-NEXT: br i1 [[CMP]], label [[COND_TRUE:%.*]], label [[COND_FALSE:%.*]]
1709 // CHECK1: cond.true:
1710 // CHECK1-NEXT: br label [[COND_END:%.*]]
1711 // CHECK1: cond.false:
1712 // CHECK1-NEXT: [[TMP5:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4
1713 // CHECK1-NEXT: br label [[COND_END]]
1714 // CHECK1: cond.end:
1715 // CHECK1-NEXT: [[COND:%.*]] = phi i32 [ 99, [[COND_TRUE]] ], [ [[TMP5]], [[COND_FALSE]] ]
1716 // CHECK1-NEXT: store i32 [[COND]], ptr [[DOTOMP_UB]], align 4
1717 // CHECK1-NEXT: [[TMP6:%.*]] = load i32, ptr [[DOTOMP_LB]], align 4
1718 // CHECK1-NEXT: store i32 [[TMP6]], ptr [[DOTOMP_IV]], align 4
1719 // CHECK1-NEXT: br label [[OMP_INNER_FOR_COND:%.*]]
1720 // CHECK1: omp.inner.for.cond:
1721 // CHECK1-NEXT: [[TMP7:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP59:![0-9]+]]
1722 // CHECK1-NEXT: [[TMP8:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4, !llvm.access.group [[ACC_GRP59]]
1723 // CHECK1-NEXT: [[CMP2:%.*]] = icmp sle i32 [[TMP7]], [[TMP8]]
1724 // CHECK1-NEXT: br i1 [[CMP2]], label [[OMP_INNER_FOR_BODY:%.*]], label [[OMP_INNER_FOR_END:%.*]]
1725 // CHECK1: omp.inner.for.body:
1726 // CHECK1-NEXT: [[TMP9:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP59]]
1727 // CHECK1-NEXT: [[MUL:%.*]] = mul nsw i32 [[TMP9]], 1
1728 // CHECK1-NEXT: [[ADD:%.*]] = add nsw i32 0, [[MUL]]
1729 // CHECK1-NEXT: store i32 [[ADD]], ptr [[I]], align 4, !llvm.access.group [[ACC_GRP59]]
1730 // CHECK1-NEXT: call void @_Z3fn3v(), !llvm.access.group [[ACC_GRP59]]
1731 // CHECK1-NEXT: br label [[OMP_BODY_CONTINUE:%.*]]
1732 // CHECK1: omp.body.continue:
1733 // CHECK1-NEXT: br label [[OMP_INNER_FOR_INC:%.*]]
1734 // CHECK1: omp.inner.for.inc:
1735 // CHECK1-NEXT: [[TMP10:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP59]]
1736 // CHECK1-NEXT: [[ADD3:%.*]] = add nsw i32 [[TMP10]], 1
1737 // CHECK1-NEXT: store i32 [[ADD3]], ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP59]]
1738 // CHECK1-NEXT: br label [[OMP_INNER_FOR_COND]], !llvm.loop [[LOOP60:![0-9]+]]
1739 // CHECK1: omp.inner.for.end:
1740 // CHECK1-NEXT: br label [[OMP_LOOP_EXIT:%.*]]
1741 // CHECK1: omp.loop.exit:
1742 // CHECK1-NEXT: call void @__kmpc_for_static_fini(ptr @[[GLOB1]], i32 [[TMP3]])
1743 // CHECK1-NEXT: [[TMP11:%.*]] = load i32, ptr [[DOTOMP_IS_LAST]], align 4
1744 // CHECK1-NEXT: [[TMP12:%.*]] = icmp ne i32 [[TMP11]], 0
1745 // CHECK1-NEXT: br i1 [[TMP12]], label [[DOTOMP_FINAL_THEN:%.*]], label [[DOTOMP_FINAL_DONE:%.*]]
1746 // CHECK1: .omp.final.then:
1747 // CHECK1-NEXT: store i32 100, ptr [[I]], align 4
1748 // CHECK1-NEXT: br label [[DOTOMP_FINAL_DONE]]
1749 // CHECK1: .omp.final.done:
1750 // CHECK1-NEXT: ret void
1753 // CHECK1-LABEL: define {{[^@]+}}@.omp_offloading.requires_reg
1754 // CHECK1-SAME: () #[[ATTR6:[0-9]+]] {
1755 // CHECK1-NEXT: entry:
1756 // CHECK1-NEXT: call void @__tgt_register_requires(i64 1)
1757 // CHECK1-NEXT: ret void
1760 // CHECK3-LABEL: define {{[^@]+}}@_Z9gtid_testv
1761 // CHECK3-SAME: () #[[ATTR0:[0-9]+]] {
1762 // CHECK3-NEXT: entry:
1763 // CHECK3-NEXT: [[TMP:%.*]] = alloca i32, align 4
1764 // CHECK3-NEXT: [[KERNEL_ARGS:%.*]] = alloca [[STRUCT___TGT_KERNEL_ARGUMENTS:%.*]], align 8
1765 // CHECK3-NEXT: [[_TMP1:%.*]] = alloca i32, align 4
1766 // CHECK3-NEXT: [[KERNEL_ARGS2:%.*]] = alloca [[STRUCT___TGT_KERNEL_ARGUMENTS]], align 8
1767 // CHECK3-NEXT: [[TMP0:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 0
1768 // CHECK3-NEXT: store i32 2, ptr [[TMP0]], align 4
1769 // CHECK3-NEXT: [[TMP1:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 1
1770 // CHECK3-NEXT: store i32 0, ptr [[TMP1]], align 4
1771 // CHECK3-NEXT: [[TMP2:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 2
1772 // CHECK3-NEXT: store ptr null, ptr [[TMP2]], align 8
1773 // CHECK3-NEXT: [[TMP3:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 3
1774 // CHECK3-NEXT: store ptr null, ptr [[TMP3]], align 8
1775 // CHECK3-NEXT: [[TMP4:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 4
1776 // CHECK3-NEXT: store ptr null, ptr [[TMP4]], align 8
1777 // CHECK3-NEXT: [[TMP5:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 5
1778 // CHECK3-NEXT: store ptr null, ptr [[TMP5]], align 8
1779 // CHECK3-NEXT: [[TMP6:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 6
1780 // CHECK3-NEXT: store ptr null, ptr [[TMP6]], align 8
1781 // CHECK3-NEXT: [[TMP7:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 7
1782 // CHECK3-NEXT: store ptr null, ptr [[TMP7]], align 8
1783 // CHECK3-NEXT: [[TMP8:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 8
1784 // CHECK3-NEXT: store i64 100, ptr [[TMP8]], align 8
1785 // CHECK3-NEXT: [[TMP9:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 9
1786 // CHECK3-NEXT: store i64 0, ptr [[TMP9]], align 8
1787 // CHECK3-NEXT: [[TMP10:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 10
1788 // CHECK3-NEXT: store [3 x i32] zeroinitializer, ptr [[TMP10]], align 4
1789 // CHECK3-NEXT: [[TMP11:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 11
1790 // CHECK3-NEXT: store [3 x i32] zeroinitializer, ptr [[TMP11]], align 4
1791 // CHECK3-NEXT: [[TMP12:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 12
1792 // CHECK3-NEXT: store i32 0, ptr [[TMP12]], align 4
1793 // 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]])
1794 // CHECK3-NEXT: [[TMP14:%.*]] = icmp ne i32 [[TMP13]], 0
1795 // CHECK3-NEXT: br i1 [[TMP14]], label [[OMP_OFFLOAD_FAILED:%.*]], label [[OMP_OFFLOAD_CONT:%.*]]
1796 // CHECK3: omp_offload.failed:
1797 // CHECK3-NEXT: call void @{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z9gtid_testv_l43() #[[ATTR3:[0-9]+]]
1798 // CHECK3-NEXT: br label [[OMP_OFFLOAD_CONT]]
1799 // CHECK3: omp_offload.cont:
1800 // CHECK3-NEXT: [[TMP15:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS2]], i32 0, i32 0
1801 // CHECK3-NEXT: store i32 2, ptr [[TMP15]], align 4
1802 // CHECK3-NEXT: [[TMP16:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS2]], i32 0, i32 1
1803 // CHECK3-NEXT: store i32 0, ptr [[TMP16]], align 4
1804 // CHECK3-NEXT: [[TMP17:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS2]], i32 0, i32 2
1805 // CHECK3-NEXT: store ptr null, ptr [[TMP17]], align 8
1806 // CHECK3-NEXT: [[TMP18:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS2]], i32 0, i32 3
1807 // CHECK3-NEXT: store ptr null, ptr [[TMP18]], align 8
1808 // CHECK3-NEXT: [[TMP19:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS2]], i32 0, i32 4
1809 // CHECK3-NEXT: store ptr null, ptr [[TMP19]], align 8
1810 // CHECK3-NEXT: [[TMP20:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS2]], i32 0, i32 5
1811 // CHECK3-NEXT: store ptr null, ptr [[TMP20]], align 8
1812 // CHECK3-NEXT: [[TMP21:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS2]], i32 0, i32 6
1813 // CHECK3-NEXT: store ptr null, ptr [[TMP21]], align 8
1814 // CHECK3-NEXT: [[TMP22:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS2]], i32 0, i32 7
1815 // CHECK3-NEXT: store ptr null, ptr [[TMP22]], align 8
1816 // CHECK3-NEXT: [[TMP23:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS2]], i32 0, i32 8
1817 // CHECK3-NEXT: store i64 100, ptr [[TMP23]], align 8
1818 // CHECK3-NEXT: [[TMP24:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS2]], i32 0, i32 9
1819 // CHECK3-NEXT: store i64 0, ptr [[TMP24]], align 8
1820 // CHECK3-NEXT: [[TMP25:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS2]], i32 0, i32 10
1821 // CHECK3-NEXT: store [3 x i32] zeroinitializer, ptr [[TMP25]], align 4
1822 // CHECK3-NEXT: [[TMP26:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS2]], i32 0, i32 11
1823 // CHECK3-NEXT: store [3 x i32] [i32 1, i32 0, i32 0], ptr [[TMP26]], align 4
1824 // CHECK3-NEXT: [[TMP27:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS2]], i32 0, i32 12
1825 // CHECK3-NEXT: store i32 0, ptr [[TMP27]], align 4
1826 // CHECK3-NEXT: [[TMP28:%.*]] = call i32 @__tgt_target_kernel(ptr @[[GLOB3]], i64 -1, i32 0, i32 1, ptr @.{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z9gtid_testv_l47.region_id, ptr [[KERNEL_ARGS2]])
1827 // CHECK3-NEXT: [[TMP29:%.*]] = icmp ne i32 [[TMP28]], 0
1828 // CHECK3-NEXT: br i1 [[TMP29]], label [[OMP_OFFLOAD_FAILED3:%.*]], label [[OMP_OFFLOAD_CONT4:%.*]]
1829 // CHECK3: omp_offload.failed3:
1830 // CHECK3-NEXT: call void @{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z9gtid_testv_l47() #[[ATTR3]]
1831 // CHECK3-NEXT: br label [[OMP_OFFLOAD_CONT4]]
1832 // CHECK3: omp_offload.cont4:
1833 // CHECK3-NEXT: ret void
1836 // CHECK3-LABEL: define {{[^@]+}}@{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z9gtid_testv_l43
1837 // CHECK3-SAME: () #[[ATTR1:[0-9]+]] {
1838 // CHECK3-NEXT: entry:
1839 // 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)
1840 // CHECK3-NEXT: ret void
1843 // CHECK3-LABEL: define {{[^@]+}}@{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z9gtid_testv_l43.omp_outlined
1844 // CHECK3-SAME: (ptr noalias noundef [[DOTGLOBAL_TID_:%.*]], ptr noalias noundef [[DOTBOUND_TID_:%.*]]) #[[ATTR2:[0-9]+]] {
1845 // CHECK3-NEXT: entry:
1846 // CHECK3-NEXT: [[DOTGLOBAL_TID__ADDR:%.*]] = alloca ptr, align 8
1847 // CHECK3-NEXT: [[DOTBOUND_TID__ADDR:%.*]] = alloca ptr, align 8
1848 // CHECK3-NEXT: [[DOTOMP_IV:%.*]] = alloca i32, align 4
1849 // CHECK3-NEXT: [[TMP:%.*]] = alloca i32, align 4
1850 // CHECK3-NEXT: [[DOTOMP_COMB_LB:%.*]] = alloca i32, align 4
1851 // CHECK3-NEXT: [[DOTOMP_COMB_UB:%.*]] = alloca i32, align 4
1852 // CHECK3-NEXT: [[DOTOMP_STRIDE:%.*]] = alloca i32, align 4
1853 // CHECK3-NEXT: [[DOTOMP_IS_LAST:%.*]] = alloca i32, align 4
1854 // CHECK3-NEXT: [[I:%.*]] = alloca i32, align 4
1855 // CHECK3-NEXT: store ptr [[DOTGLOBAL_TID_]], ptr [[DOTGLOBAL_TID__ADDR]], align 8
1856 // CHECK3-NEXT: store ptr [[DOTBOUND_TID_]], ptr [[DOTBOUND_TID__ADDR]], align 8
1857 // CHECK3-NEXT: store i32 0, ptr [[DOTOMP_COMB_LB]], align 4
1858 // CHECK3-NEXT: store i32 99, ptr [[DOTOMP_COMB_UB]], align 4
1859 // CHECK3-NEXT: store i32 1, ptr [[DOTOMP_STRIDE]], align 4
1860 // CHECK3-NEXT: store i32 0, ptr [[DOTOMP_IS_LAST]], align 4
1861 // CHECK3-NEXT: [[TMP0:%.*]] = load ptr, ptr [[DOTGLOBAL_TID__ADDR]], align 8
1862 // CHECK3-NEXT: [[TMP1:%.*]] = load i32, ptr [[TMP0]], align 4
1863 // 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)
1864 // CHECK3-NEXT: [[TMP2:%.*]] = load i32, ptr [[DOTOMP_COMB_UB]], align 4
1865 // CHECK3-NEXT: [[CMP:%.*]] = icmp sgt i32 [[TMP2]], 99
1866 // CHECK3-NEXT: br i1 [[CMP]], label [[COND_TRUE:%.*]], label [[COND_FALSE:%.*]]
1867 // CHECK3: cond.true:
1868 // CHECK3-NEXT: br label [[COND_END:%.*]]
1869 // CHECK3: cond.false:
1870 // CHECK3-NEXT: [[TMP3:%.*]] = load i32, ptr [[DOTOMP_COMB_UB]], align 4
1871 // CHECK3-NEXT: br label [[COND_END]]
1872 // CHECK3: cond.end:
1873 // CHECK3-NEXT: [[COND:%.*]] = phi i32 [ 99, [[COND_TRUE]] ], [ [[TMP3]], [[COND_FALSE]] ]
1874 // CHECK3-NEXT: store i32 [[COND]], ptr [[DOTOMP_COMB_UB]], align 4
1875 // CHECK3-NEXT: [[TMP4:%.*]] = load i32, ptr [[DOTOMP_COMB_LB]], align 4
1876 // CHECK3-NEXT: store i32 [[TMP4]], ptr [[DOTOMP_IV]], align 4
1877 // CHECK3-NEXT: br label [[OMP_INNER_FOR_COND:%.*]]
1878 // CHECK3: omp.inner.for.cond:
1879 // CHECK3-NEXT: [[TMP5:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP11:![0-9]+]]
1880 // CHECK3-NEXT: [[TMP6:%.*]] = load i32, ptr [[DOTOMP_COMB_UB]], align 4, !llvm.access.group [[ACC_GRP11]]
1881 // CHECK3-NEXT: [[CMP1:%.*]] = icmp sle i32 [[TMP5]], [[TMP6]]
1882 // CHECK3-NEXT: br i1 [[CMP1]], label [[OMP_INNER_FOR_BODY:%.*]], label [[OMP_INNER_FOR_END:%.*]]
1883 // CHECK3: omp.inner.for.body:
1884 // CHECK3-NEXT: [[TMP7:%.*]] = load i32, ptr [[DOTOMP_COMB_LB]], align 4, !llvm.access.group [[ACC_GRP11]]
1885 // CHECK3-NEXT: [[TMP8:%.*]] = zext i32 [[TMP7]] to i64
1886 // CHECK3-NEXT: [[TMP9:%.*]] = load i32, ptr [[DOTOMP_COMB_UB]], align 4, !llvm.access.group [[ACC_GRP11]]
1887 // CHECK3-NEXT: [[TMP10:%.*]] = zext i32 [[TMP9]] to i64
1888 // 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]]
1889 // CHECK3-NEXT: br label [[OMP_INNER_FOR_INC:%.*]]
1890 // CHECK3: omp.inner.for.inc:
1891 // CHECK3-NEXT: [[TMP11:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP11]]
1892 // CHECK3-NEXT: [[TMP12:%.*]] = load i32, ptr [[DOTOMP_STRIDE]], align 4, !llvm.access.group [[ACC_GRP11]]
1893 // CHECK3-NEXT: [[ADD:%.*]] = add nsw i32 [[TMP11]], [[TMP12]]
1894 // CHECK3-NEXT: store i32 [[ADD]], ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP11]]
1895 // CHECK3-NEXT: br label [[OMP_INNER_FOR_COND]], !llvm.loop [[LOOP12:![0-9]+]]
1896 // CHECK3: omp.inner.for.end:
1897 // CHECK3-NEXT: br label [[OMP_LOOP_EXIT:%.*]]
1898 // CHECK3: omp.loop.exit:
1899 // CHECK3-NEXT: call void @__kmpc_for_static_fini(ptr @[[GLOB1]], i32 [[TMP1]])
1900 // CHECK3-NEXT: [[TMP13:%.*]] = load i32, ptr [[DOTOMP_IS_LAST]], align 4
1901 // CHECK3-NEXT: [[TMP14:%.*]] = icmp ne i32 [[TMP13]], 0
1902 // CHECK3-NEXT: br i1 [[TMP14]], label [[DOTOMP_FINAL_THEN:%.*]], label [[DOTOMP_FINAL_DONE:%.*]]
1903 // CHECK3: .omp.final.then:
1904 // CHECK3-NEXT: store i32 100, ptr [[I]], align 4
1905 // CHECK3-NEXT: br label [[DOTOMP_FINAL_DONE]]
1906 // CHECK3: .omp.final.done:
1907 // CHECK3-NEXT: ret void
1910 // CHECK3-LABEL: define {{[^@]+}}@{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z9gtid_testv_l43.omp_outlined.omp_outlined
1911 // CHECK3-SAME: (ptr noalias noundef [[DOTGLOBAL_TID_:%.*]], ptr noalias noundef [[DOTBOUND_TID_:%.*]], i64 noundef [[DOTPREVIOUS_LB_:%.*]], i64 noundef [[DOTPREVIOUS_UB_:%.*]]) #[[ATTR2]] {
1912 // CHECK3-NEXT: entry:
1913 // CHECK3-NEXT: [[DOTGLOBAL_TID__ADDR:%.*]] = alloca ptr, align 8
1914 // CHECK3-NEXT: [[DOTBOUND_TID__ADDR:%.*]] = alloca ptr, align 8
1915 // CHECK3-NEXT: [[DOTPREVIOUS_LB__ADDR:%.*]] = alloca i64, align 8
1916 // CHECK3-NEXT: [[DOTPREVIOUS_UB__ADDR:%.*]] = alloca i64, align 8
1917 // CHECK3-NEXT: [[DOTOMP_IV:%.*]] = alloca i32, align 4
1918 // CHECK3-NEXT: [[TMP:%.*]] = alloca i32, align 4
1919 // CHECK3-NEXT: [[DOTOMP_LB:%.*]] = alloca i32, align 4
1920 // CHECK3-NEXT: [[DOTOMP_UB:%.*]] = alloca i32, align 4
1921 // CHECK3-NEXT: [[DOTOMP_STRIDE:%.*]] = alloca i32, align 4
1922 // CHECK3-NEXT: [[DOTOMP_IS_LAST:%.*]] = alloca i32, align 4
1923 // CHECK3-NEXT: [[I:%.*]] = alloca i32, align 4
1924 // CHECK3-NEXT: store ptr [[DOTGLOBAL_TID_]], ptr [[DOTGLOBAL_TID__ADDR]], align 8
1925 // CHECK3-NEXT: store ptr [[DOTBOUND_TID_]], ptr [[DOTBOUND_TID__ADDR]], align 8
1926 // CHECK3-NEXT: store i64 [[DOTPREVIOUS_LB_]], ptr [[DOTPREVIOUS_LB__ADDR]], align 8
1927 // CHECK3-NEXT: store i64 [[DOTPREVIOUS_UB_]], ptr [[DOTPREVIOUS_UB__ADDR]], align 8
1928 // CHECK3-NEXT: store i32 0, ptr [[DOTOMP_LB]], align 4
1929 // CHECK3-NEXT: store i32 99, ptr [[DOTOMP_UB]], align 4
1930 // CHECK3-NEXT: [[TMP0:%.*]] = load i64, ptr [[DOTPREVIOUS_LB__ADDR]], align 8
1931 // CHECK3-NEXT: [[CONV:%.*]] = trunc i64 [[TMP0]] to i32
1932 // CHECK3-NEXT: [[TMP1:%.*]] = load i64, ptr [[DOTPREVIOUS_UB__ADDR]], align 8
1933 // CHECK3-NEXT: [[CONV1:%.*]] = trunc i64 [[TMP1]] to i32
1934 // CHECK3-NEXT: store i32 [[CONV]], ptr [[DOTOMP_LB]], align 4
1935 // CHECK3-NEXT: store i32 [[CONV1]], ptr [[DOTOMP_UB]], align 4
1936 // CHECK3-NEXT: store i32 1, ptr [[DOTOMP_STRIDE]], align 4
1937 // CHECK3-NEXT: store i32 0, ptr [[DOTOMP_IS_LAST]], align 4
1938 // CHECK3-NEXT: [[TMP2:%.*]] = load ptr, ptr [[DOTGLOBAL_TID__ADDR]], align 8
1939 // CHECK3-NEXT: [[TMP3:%.*]] = load i32, ptr [[TMP2]], align 4
1940 // 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)
1941 // CHECK3-NEXT: [[TMP4:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4
1942 // CHECK3-NEXT: [[CMP:%.*]] = icmp sgt i32 [[TMP4]], 99
1943 // CHECK3-NEXT: br i1 [[CMP]], label [[COND_TRUE:%.*]], label [[COND_FALSE:%.*]]
1944 // CHECK3: cond.true:
1945 // CHECK3-NEXT: br label [[COND_END:%.*]]
1946 // CHECK3: cond.false:
1947 // CHECK3-NEXT: [[TMP5:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4
1948 // CHECK3-NEXT: br label [[COND_END]]
1949 // CHECK3: cond.end:
1950 // CHECK3-NEXT: [[COND:%.*]] = phi i32 [ 99, [[COND_TRUE]] ], [ [[TMP5]], [[COND_FALSE]] ]
1951 // CHECK3-NEXT: store i32 [[COND]], ptr [[DOTOMP_UB]], align 4
1952 // CHECK3-NEXT: [[TMP6:%.*]] = load i32, ptr [[DOTOMP_LB]], align 4
1953 // CHECK3-NEXT: store i32 [[TMP6]], ptr [[DOTOMP_IV]], align 4
1954 // CHECK3-NEXT: br label [[OMP_INNER_FOR_COND:%.*]]
1955 // CHECK3: omp.inner.for.cond:
1956 // CHECK3-NEXT: [[TMP7:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP15:![0-9]+]]
1957 // CHECK3-NEXT: [[TMP8:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4, !llvm.access.group [[ACC_GRP15]]
1958 // CHECK3-NEXT: [[CMP2:%.*]] = icmp sle i32 [[TMP7]], [[TMP8]]
1959 // CHECK3-NEXT: br i1 [[CMP2]], label [[OMP_INNER_FOR_BODY:%.*]], label [[OMP_INNER_FOR_END:%.*]]
1960 // CHECK3: omp.inner.for.body:
1961 // CHECK3-NEXT: [[TMP9:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP15]]
1962 // CHECK3-NEXT: [[MUL:%.*]] = mul nsw i32 [[TMP9]], 1
1963 // CHECK3-NEXT: [[ADD:%.*]] = add nsw i32 0, [[MUL]]
1964 // CHECK3-NEXT: store i32 [[ADD]], ptr [[I]], align 4, !llvm.access.group [[ACC_GRP15]]
1965 // CHECK3-NEXT: br label [[OMP_BODY_CONTINUE:%.*]]
1966 // CHECK3: omp.body.continue:
1967 // CHECK3-NEXT: br label [[OMP_INNER_FOR_INC:%.*]]
1968 // CHECK3: omp.inner.for.inc:
1969 // CHECK3-NEXT: [[TMP10:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP15]]
1970 // CHECK3-NEXT: [[ADD3:%.*]] = add nsw i32 [[TMP10]], 1
1971 // CHECK3-NEXT: store i32 [[ADD3]], ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP15]]
1972 // CHECK3-NEXT: br label [[OMP_INNER_FOR_COND]], !llvm.loop [[LOOP16:![0-9]+]]
1973 // CHECK3: omp.inner.for.end:
1974 // CHECK3-NEXT: br label [[OMP_LOOP_EXIT:%.*]]
1975 // CHECK3: omp.loop.exit:
1976 // CHECK3-NEXT: call void @__kmpc_for_static_fini(ptr @[[GLOB1]], i32 [[TMP3]])
1977 // CHECK3-NEXT: [[TMP11:%.*]] = load i32, ptr [[DOTOMP_IS_LAST]], align 4
1978 // CHECK3-NEXT: [[TMP12:%.*]] = icmp ne i32 [[TMP11]], 0
1979 // CHECK3-NEXT: br i1 [[TMP12]], label [[DOTOMP_FINAL_THEN:%.*]], label [[DOTOMP_FINAL_DONE:%.*]]
1980 // CHECK3: .omp.final.then:
1981 // CHECK3-NEXT: store i32 100, ptr [[I]], align 4
1982 // CHECK3-NEXT: br label [[DOTOMP_FINAL_DONE]]
1983 // CHECK3: .omp.final.done:
1984 // CHECK3-NEXT: ret void
1987 // CHECK3-LABEL: define {{[^@]+}}@{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z9gtid_testv_l47
1988 // CHECK3-SAME: () #[[ATTR1]] {
1989 // CHECK3-NEXT: entry:
1990 // 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_l47.omp_outlined)
1991 // CHECK3-NEXT: ret void
1994 // CHECK3-LABEL: define {{[^@]+}}@{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z9gtid_testv_l47.omp_outlined
1995 // CHECK3-SAME: (ptr noalias noundef [[DOTGLOBAL_TID_:%.*]], ptr noalias noundef [[DOTBOUND_TID_:%.*]]) #[[ATTR2]] {
1996 // CHECK3-NEXT: entry:
1997 // CHECK3-NEXT: [[DOTGLOBAL_TID__ADDR:%.*]] = alloca ptr, align 8
1998 // CHECK3-NEXT: [[DOTBOUND_TID__ADDR:%.*]] = alloca ptr, align 8
1999 // CHECK3-NEXT: [[DOTOMP_IV:%.*]] = alloca i32, align 4
2000 // CHECK3-NEXT: [[TMP:%.*]] = alloca i32, align 4
2001 // CHECK3-NEXT: [[DOTOMP_COMB_LB:%.*]] = alloca i32, align 4
2002 // CHECK3-NEXT: [[DOTOMP_COMB_UB:%.*]] = alloca i32, align 4
2003 // CHECK3-NEXT: [[DOTOMP_STRIDE:%.*]] = alloca i32, align 4
2004 // CHECK3-NEXT: [[DOTOMP_IS_LAST:%.*]] = alloca i32, align 4
2005 // CHECK3-NEXT: [[I:%.*]] = alloca i32, align 4
2006 // CHECK3-NEXT: [[DOTBOUND_ZERO_ADDR:%.*]] = alloca i32, align 4
2007 // CHECK3-NEXT: store ptr [[DOTGLOBAL_TID_]], ptr [[DOTGLOBAL_TID__ADDR]], align 8
2008 // CHECK3-NEXT: store ptr [[DOTBOUND_TID_]], ptr [[DOTBOUND_TID__ADDR]], align 8
2009 // CHECK3-NEXT: store i32 0, ptr [[DOTOMP_COMB_LB]], align 4
2010 // CHECK3-NEXT: store i32 99, ptr [[DOTOMP_COMB_UB]], align 4
2011 // CHECK3-NEXT: store i32 1, ptr [[DOTOMP_STRIDE]], align 4
2012 // CHECK3-NEXT: store i32 0, ptr [[DOTOMP_IS_LAST]], align 4
2013 // CHECK3-NEXT: [[TMP0:%.*]] = load ptr, ptr [[DOTGLOBAL_TID__ADDR]], align 8
2014 // CHECK3-NEXT: [[TMP1:%.*]] = load i32, ptr [[TMP0]], align 4
2015 // 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)
2016 // CHECK3-NEXT: [[TMP2:%.*]] = load i32, ptr [[DOTOMP_COMB_UB]], align 4
2017 // CHECK3-NEXT: [[CMP:%.*]] = icmp sgt i32 [[TMP2]], 99
2018 // CHECK3-NEXT: br i1 [[CMP]], label [[COND_TRUE:%.*]], label [[COND_FALSE:%.*]]
2019 // CHECK3: cond.true:
2020 // CHECK3-NEXT: br label [[COND_END:%.*]]
2021 // CHECK3: cond.false:
2022 // CHECK3-NEXT: [[TMP3:%.*]] = load i32, ptr [[DOTOMP_COMB_UB]], align 4
2023 // CHECK3-NEXT: br label [[COND_END]]
2024 // CHECK3: cond.end:
2025 // CHECK3-NEXT: [[COND:%.*]] = phi i32 [ 99, [[COND_TRUE]] ], [ [[TMP3]], [[COND_FALSE]] ]
2026 // CHECK3-NEXT: store i32 [[COND]], ptr [[DOTOMP_COMB_UB]], align 4
2027 // CHECK3-NEXT: [[TMP4:%.*]] = load i32, ptr [[DOTOMP_COMB_LB]], align 4
2028 // CHECK3-NEXT: store i32 [[TMP4]], ptr [[DOTOMP_IV]], align 4
2029 // CHECK3-NEXT: br label [[OMP_INNER_FOR_COND:%.*]]
2030 // CHECK3: omp.inner.for.cond:
2031 // CHECK3-NEXT: [[TMP5:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP20:![0-9]+]]
2032 // CHECK3-NEXT: [[TMP6:%.*]] = load i32, ptr [[DOTOMP_COMB_UB]], align 4, !llvm.access.group [[ACC_GRP20]]
2033 // CHECK3-NEXT: [[CMP1:%.*]] = icmp sle i32 [[TMP5]], [[TMP6]]
2034 // CHECK3-NEXT: br i1 [[CMP1]], label [[OMP_INNER_FOR_BODY:%.*]], label [[OMP_INNER_FOR_END:%.*]]
2035 // CHECK3: omp.inner.for.body:
2036 // CHECK3-NEXT: [[TMP7:%.*]] = load i32, ptr [[DOTOMP_COMB_LB]], align 4, !llvm.access.group [[ACC_GRP20]]
2037 // CHECK3-NEXT: [[TMP8:%.*]] = zext i32 [[TMP7]] to i64
2038 // CHECK3-NEXT: [[TMP9:%.*]] = load i32, ptr [[DOTOMP_COMB_UB]], align 4, !llvm.access.group [[ACC_GRP20]]
2039 // CHECK3-NEXT: [[TMP10:%.*]] = zext i32 [[TMP9]] to i64
2040 // CHECK3-NEXT: call void @__kmpc_serialized_parallel(ptr @[[GLOB3]], i32 [[TMP1]]), !llvm.access.group [[ACC_GRP20]]
2041 // CHECK3-NEXT: [[TMP11:%.*]] = load ptr, ptr [[DOTGLOBAL_TID__ADDR]], align 8, !llvm.access.group [[ACC_GRP20]]
2042 // CHECK3-NEXT: store i32 0, ptr [[DOTBOUND_ZERO_ADDR]], align 4, !llvm.access.group [[ACC_GRP20]]
2043 // CHECK3-NEXT: call void @{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z9gtid_testv_l47.omp_outlined.omp_outlined(ptr [[TMP11]], ptr [[DOTBOUND_ZERO_ADDR]], i64 [[TMP8]], i64 [[TMP10]]) #[[ATTR3]], !llvm.access.group [[ACC_GRP20]]
2044 // CHECK3-NEXT: call void @__kmpc_end_serialized_parallel(ptr @[[GLOB3]], i32 [[TMP1]]), !llvm.access.group [[ACC_GRP20]]
2045 // CHECK3-NEXT: br label [[OMP_INNER_FOR_INC:%.*]]
2046 // CHECK3: omp.inner.for.inc:
2047 // CHECK3-NEXT: [[TMP12:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP20]]
2048 // CHECK3-NEXT: [[TMP13:%.*]] = load i32, ptr [[DOTOMP_STRIDE]], align 4, !llvm.access.group [[ACC_GRP20]]
2049 // CHECK3-NEXT: [[ADD:%.*]] = add nsw i32 [[TMP12]], [[TMP13]]
2050 // CHECK3-NEXT: store i32 [[ADD]], ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP20]]
2051 // CHECK3-NEXT: br label [[OMP_INNER_FOR_COND]], !llvm.loop [[LOOP21:![0-9]+]]
2052 // CHECK3: omp.inner.for.end:
2053 // CHECK3-NEXT: br label [[OMP_LOOP_EXIT:%.*]]
2054 // CHECK3: omp.loop.exit:
2055 // CHECK3-NEXT: call void @__kmpc_for_static_fini(ptr @[[GLOB1]], i32 [[TMP1]])
2056 // CHECK3-NEXT: [[TMP14:%.*]] = load i32, ptr [[DOTOMP_IS_LAST]], align 4
2057 // CHECK3-NEXT: [[TMP15:%.*]] = icmp ne i32 [[TMP14]], 0
2058 // CHECK3-NEXT: br i1 [[TMP15]], label [[DOTOMP_FINAL_THEN:%.*]], label [[DOTOMP_FINAL_DONE:%.*]]
2059 // CHECK3: .omp.final.then:
2060 // CHECK3-NEXT: store i32 100, ptr [[I]], align 4
2061 // CHECK3-NEXT: br label [[DOTOMP_FINAL_DONE]]
2062 // CHECK3: .omp.final.done:
2063 // CHECK3-NEXT: ret void
2066 // CHECK3-LABEL: define {{[^@]+}}@{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z9gtid_testv_l47.omp_outlined.omp_outlined
2067 // CHECK3-SAME: (ptr noalias noundef [[DOTGLOBAL_TID_:%.*]], ptr noalias noundef [[DOTBOUND_TID_:%.*]], i64 noundef [[DOTPREVIOUS_LB_:%.*]], i64 noundef [[DOTPREVIOUS_UB_:%.*]]) #[[ATTR2]] {
2068 // CHECK3-NEXT: entry:
2069 // CHECK3-NEXT: [[DOTGLOBAL_TID__ADDR:%.*]] = alloca ptr, align 8
2070 // CHECK3-NEXT: [[DOTBOUND_TID__ADDR:%.*]] = alloca ptr, align 8
2071 // CHECK3-NEXT: [[DOTPREVIOUS_LB__ADDR:%.*]] = alloca i64, align 8
2072 // CHECK3-NEXT: [[DOTPREVIOUS_UB__ADDR:%.*]] = alloca i64, align 8
2073 // CHECK3-NEXT: [[DOTOMP_IV:%.*]] = alloca i32, align 4
2074 // CHECK3-NEXT: [[TMP:%.*]] = alloca i32, align 4
2075 // CHECK3-NEXT: [[DOTOMP_LB:%.*]] = alloca i32, align 4
2076 // CHECK3-NEXT: [[DOTOMP_UB:%.*]] = alloca i32, align 4
2077 // CHECK3-NEXT: [[DOTOMP_STRIDE:%.*]] = alloca i32, align 4
2078 // CHECK3-NEXT: [[DOTOMP_IS_LAST:%.*]] = alloca i32, align 4
2079 // CHECK3-NEXT: [[I:%.*]] = alloca i32, align 4
2080 // CHECK3-NEXT: store ptr [[DOTGLOBAL_TID_]], ptr [[DOTGLOBAL_TID__ADDR]], align 8
2081 // CHECK3-NEXT: store ptr [[DOTBOUND_TID_]], ptr [[DOTBOUND_TID__ADDR]], align 8
2082 // CHECK3-NEXT: store i64 [[DOTPREVIOUS_LB_]], ptr [[DOTPREVIOUS_LB__ADDR]], align 8
2083 // CHECK3-NEXT: store i64 [[DOTPREVIOUS_UB_]], ptr [[DOTPREVIOUS_UB__ADDR]], align 8
2084 // CHECK3-NEXT: store i32 0, ptr [[DOTOMP_LB]], align 4
2085 // CHECK3-NEXT: store i32 99, ptr [[DOTOMP_UB]], align 4
2086 // CHECK3-NEXT: [[TMP0:%.*]] = load i64, ptr [[DOTPREVIOUS_LB__ADDR]], align 8
2087 // CHECK3-NEXT: [[CONV:%.*]] = trunc i64 [[TMP0]] to i32
2088 // CHECK3-NEXT: [[TMP1:%.*]] = load i64, ptr [[DOTPREVIOUS_UB__ADDR]], align 8
2089 // CHECK3-NEXT: [[CONV1:%.*]] = trunc i64 [[TMP1]] to i32
2090 // CHECK3-NEXT: store i32 [[CONV]], ptr [[DOTOMP_LB]], align 4
2091 // CHECK3-NEXT: store i32 [[CONV1]], ptr [[DOTOMP_UB]], align 4
2092 // CHECK3-NEXT: store i32 1, ptr [[DOTOMP_STRIDE]], align 4
2093 // CHECK3-NEXT: store i32 0, ptr [[DOTOMP_IS_LAST]], align 4
2094 // CHECK3-NEXT: [[TMP2:%.*]] = load ptr, ptr [[DOTGLOBAL_TID__ADDR]], align 8
2095 // CHECK3-NEXT: [[TMP3:%.*]] = load i32, ptr [[TMP2]], align 4
2096 // 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)
2097 // CHECK3-NEXT: [[TMP4:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4
2098 // CHECK3-NEXT: [[CMP:%.*]] = icmp sgt i32 [[TMP4]], 99
2099 // CHECK3-NEXT: br i1 [[CMP]], label [[COND_TRUE:%.*]], label [[COND_FALSE:%.*]]
2100 // CHECK3: cond.true:
2101 // CHECK3-NEXT: br label [[COND_END:%.*]]
2102 // CHECK3: cond.false:
2103 // CHECK3-NEXT: [[TMP5:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4
2104 // CHECK3-NEXT: br label [[COND_END]]
2105 // CHECK3: cond.end:
2106 // CHECK3-NEXT: [[COND:%.*]] = phi i32 [ 99, [[COND_TRUE]] ], [ [[TMP5]], [[COND_FALSE]] ]
2107 // CHECK3-NEXT: store i32 [[COND]], ptr [[DOTOMP_UB]], align 4
2108 // CHECK3-NEXT: [[TMP6:%.*]] = load i32, ptr [[DOTOMP_LB]], align 4
2109 // CHECK3-NEXT: store i32 [[TMP6]], ptr [[DOTOMP_IV]], align 4
2110 // CHECK3-NEXT: br label [[OMP_INNER_FOR_COND:%.*]]
2111 // CHECK3: omp.inner.for.cond:
2112 // CHECK3-NEXT: [[TMP7:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP23:![0-9]+]]
2113 // CHECK3-NEXT: [[TMP8:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4, !llvm.access.group [[ACC_GRP23]]
2114 // CHECK3-NEXT: [[CMP2:%.*]] = icmp sle i32 [[TMP7]], [[TMP8]]
2115 // CHECK3-NEXT: br i1 [[CMP2]], label [[OMP_INNER_FOR_BODY:%.*]], label [[OMP_INNER_FOR_END:%.*]]
2116 // CHECK3: omp.inner.for.body:
2117 // CHECK3-NEXT: [[TMP9:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP23]]
2118 // CHECK3-NEXT: [[MUL:%.*]] = mul nsw i32 [[TMP9]], 1
2119 // CHECK3-NEXT: [[ADD:%.*]] = add nsw i32 0, [[MUL]]
2120 // CHECK3-NEXT: store i32 [[ADD]], ptr [[I]], align 4, !llvm.access.group [[ACC_GRP23]]
2121 // CHECK3-NEXT: call void @_Z9gtid_testv(), !llvm.access.group [[ACC_GRP23]]
2122 // CHECK3-NEXT: br label [[OMP_BODY_CONTINUE:%.*]]
2123 // CHECK3: omp.body.continue:
2124 // CHECK3-NEXT: br label [[OMP_INNER_FOR_INC:%.*]]
2125 // CHECK3: omp.inner.for.inc:
2126 // CHECK3-NEXT: [[TMP10:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP23]]
2127 // CHECK3-NEXT: [[ADD3:%.*]] = add nsw i32 [[TMP10]], 1
2128 // CHECK3-NEXT: store i32 [[ADD3]], ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP23]]
2129 // CHECK3-NEXT: br label [[OMP_INNER_FOR_COND]], !llvm.loop [[LOOP24:![0-9]+]]
2130 // CHECK3: omp.inner.for.end:
2131 // CHECK3-NEXT: br label [[OMP_LOOP_EXIT:%.*]]
2132 // CHECK3: omp.loop.exit:
2133 // CHECK3-NEXT: call void @__kmpc_for_static_fini(ptr @[[GLOB1]], i32 [[TMP3]])
2134 // CHECK3-NEXT: [[TMP11:%.*]] = load i32, ptr [[DOTOMP_IS_LAST]], align 4
2135 // CHECK3-NEXT: [[TMP12:%.*]] = icmp ne i32 [[TMP11]], 0
2136 // CHECK3-NEXT: br i1 [[TMP12]], label [[DOTOMP_FINAL_THEN:%.*]], label [[DOTOMP_FINAL_DONE:%.*]]
2137 // CHECK3: .omp.final.then:
2138 // CHECK3-NEXT: store i32 100, ptr [[I]], align 4
2139 // CHECK3-NEXT: br label [[DOTOMP_FINAL_DONE]]
2140 // CHECK3: .omp.final.done:
2141 // CHECK3-NEXT: ret void
2144 // CHECK3-LABEL: define {{[^@]+}}@main
2145 // CHECK3-SAME: () #[[ATTR4:[0-9]+]] {
2146 // CHECK3-NEXT: entry:
2147 // CHECK3-NEXT: [[RETVAL:%.*]] = alloca i32, align 4
2148 // CHECK3-NEXT: [[TMP:%.*]] = alloca i32, align 4
2149 // CHECK3-NEXT: [[KERNEL_ARGS:%.*]] = alloca [[STRUCT___TGT_KERNEL_ARGUMENTS:%.*]], align 8
2150 // CHECK3-NEXT: [[_TMP1:%.*]] = alloca i32, align 4
2151 // CHECK3-NEXT: [[KERNEL_ARGS2:%.*]] = alloca [[STRUCT___TGT_KERNEL_ARGUMENTS]], align 8
2152 // CHECK3-NEXT: [[ARG_CASTED:%.*]] = alloca i64, align 8
2153 // CHECK3-NEXT: [[DOTOFFLOAD_BASEPTRS:%.*]] = alloca [1 x ptr], align 8
2154 // CHECK3-NEXT: [[DOTOFFLOAD_PTRS:%.*]] = alloca [1 x ptr], align 8
2155 // CHECK3-NEXT: [[DOTOFFLOAD_MAPPERS:%.*]] = alloca [1 x ptr], align 8
2156 // CHECK3-NEXT: [[DOTCAPTURE_EXPR_:%.*]] = alloca i8, align 1
2157 // CHECK3-NEXT: [[_TMP6:%.*]] = alloca i32, align 4
2158 // CHECK3-NEXT: [[KERNEL_ARGS7:%.*]] = alloca [[STRUCT___TGT_KERNEL_ARGUMENTS]], align 8
2159 // CHECK3-NEXT: store i32 0, ptr [[RETVAL]], align 4
2160 // CHECK3-NEXT: [[TMP0:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 0
2161 // CHECK3-NEXT: store i32 2, ptr [[TMP0]], align 4
2162 // CHECK3-NEXT: [[TMP1:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 1
2163 // CHECK3-NEXT: store i32 0, ptr [[TMP1]], align 4
2164 // CHECK3-NEXT: [[TMP2:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 2
2165 // CHECK3-NEXT: store ptr null, ptr [[TMP2]], align 8
2166 // CHECK3-NEXT: [[TMP3:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 3
2167 // CHECK3-NEXT: store ptr null, ptr [[TMP3]], align 8
2168 // CHECK3-NEXT: [[TMP4:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 4
2169 // CHECK3-NEXT: store ptr null, ptr [[TMP4]], align 8
2170 // CHECK3-NEXT: [[TMP5:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 5
2171 // CHECK3-NEXT: store ptr null, ptr [[TMP5]], align 8
2172 // CHECK3-NEXT: [[TMP6:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 6
2173 // CHECK3-NEXT: store ptr null, ptr [[TMP6]], align 8
2174 // CHECK3-NEXT: [[TMP7:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 7
2175 // CHECK3-NEXT: store ptr null, ptr [[TMP7]], align 8
2176 // CHECK3-NEXT: [[TMP8:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 8
2177 // CHECK3-NEXT: store i64 100, ptr [[TMP8]], align 8
2178 // CHECK3-NEXT: [[TMP9:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 9
2179 // CHECK3-NEXT: store i64 0, ptr [[TMP9]], align 8
2180 // CHECK3-NEXT: [[TMP10:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 10
2181 // CHECK3-NEXT: store [3 x i32] zeroinitializer, ptr [[TMP10]], align 4
2182 // CHECK3-NEXT: [[TMP11:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 11
2183 // CHECK3-NEXT: store [3 x i32] zeroinitializer, ptr [[TMP11]], align 4
2184 // CHECK3-NEXT: [[TMP12:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 12
2185 // CHECK3-NEXT: store i32 0, ptr [[TMP12]], align 4
2186 // 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_l76.region_id, ptr [[KERNEL_ARGS]])
2187 // CHECK3-NEXT: [[TMP14:%.*]] = icmp ne i32 [[TMP13]], 0
2188 // CHECK3-NEXT: br i1 [[TMP14]], label [[OMP_OFFLOAD_FAILED:%.*]], label [[OMP_OFFLOAD_CONT:%.*]]
2189 // CHECK3: omp_offload.failed:
2190 // CHECK3-NEXT: call void @{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}_main_l76() #[[ATTR3]]
2191 // CHECK3-NEXT: br label [[OMP_OFFLOAD_CONT]]
2192 // CHECK3: omp_offload.cont:
2193 // CHECK3-NEXT: [[TMP15:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS2]], i32 0, i32 0
2194 // CHECK3-NEXT: store i32 2, ptr [[TMP15]], align 4
2195 // CHECK3-NEXT: [[TMP16:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS2]], i32 0, i32 1
2196 // CHECK3-NEXT: store i32 0, ptr [[TMP16]], align 4
2197 // CHECK3-NEXT: [[TMP17:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS2]], i32 0, i32 2
2198 // CHECK3-NEXT: store ptr null, ptr [[TMP17]], align 8
2199 // CHECK3-NEXT: [[TMP18:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS2]], i32 0, i32 3
2200 // CHECK3-NEXT: store ptr null, ptr [[TMP18]], align 8
2201 // CHECK3-NEXT: [[TMP19:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS2]], i32 0, i32 4
2202 // CHECK3-NEXT: store ptr null, ptr [[TMP19]], align 8
2203 // CHECK3-NEXT: [[TMP20:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS2]], i32 0, i32 5
2204 // CHECK3-NEXT: store ptr null, ptr [[TMP20]], align 8
2205 // CHECK3-NEXT: [[TMP21:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS2]], i32 0, i32 6
2206 // CHECK3-NEXT: store ptr null, ptr [[TMP21]], align 8
2207 // CHECK3-NEXT: [[TMP22:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS2]], i32 0, i32 7
2208 // CHECK3-NEXT: store ptr null, ptr [[TMP22]], align 8
2209 // CHECK3-NEXT: [[TMP23:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS2]], i32 0, i32 8
2210 // CHECK3-NEXT: store i64 100, ptr [[TMP23]], align 8
2211 // CHECK3-NEXT: [[TMP24:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS2]], i32 0, i32 9
2212 // CHECK3-NEXT: store i64 0, ptr [[TMP24]], align 8
2213 // CHECK3-NEXT: [[TMP25:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS2]], i32 0, i32 10
2214 // CHECK3-NEXT: store [3 x i32] zeroinitializer, ptr [[TMP25]], align 4
2215 // CHECK3-NEXT: [[TMP26:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS2]], i32 0, i32 11
2216 // CHECK3-NEXT: store [3 x i32] [i32 1, i32 0, i32 0], ptr [[TMP26]], align 4
2217 // CHECK3-NEXT: [[TMP27:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS2]], i32 0, i32 12
2218 // CHECK3-NEXT: store i32 0, ptr [[TMP27]], align 4
2219 // CHECK3-NEXT: [[TMP28:%.*]] = call i32 @__tgt_target_kernel(ptr @[[GLOB3]], i64 -1, i32 0, i32 1, ptr @.{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}_main_l84.region_id, ptr [[KERNEL_ARGS2]])
2220 // CHECK3-NEXT: [[TMP29:%.*]] = icmp ne i32 [[TMP28]], 0
2221 // CHECK3-NEXT: br i1 [[TMP29]], label [[OMP_OFFLOAD_FAILED3:%.*]], label [[OMP_OFFLOAD_CONT4:%.*]]
2222 // CHECK3: omp_offload.failed3:
2223 // CHECK3-NEXT: call void @{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}_main_l84() #[[ATTR3]]
2224 // CHECK3-NEXT: br label [[OMP_OFFLOAD_CONT4]]
2225 // CHECK3: omp_offload.cont4:
2226 // CHECK3-NEXT: [[TMP30:%.*]] = load i32, ptr @Arg, align 4
2227 // CHECK3-NEXT: store i32 [[TMP30]], ptr [[ARG_CASTED]], align 4
2228 // CHECK3-NEXT: [[TMP31:%.*]] = load i64, ptr [[ARG_CASTED]], align 8
2229 // CHECK3-NEXT: [[TMP32:%.*]] = getelementptr inbounds [1 x ptr], ptr [[DOTOFFLOAD_BASEPTRS]], i32 0, i32 0
2230 // CHECK3-NEXT: store i64 [[TMP31]], ptr [[TMP32]], align 8
2231 // CHECK3-NEXT: [[TMP33:%.*]] = getelementptr inbounds [1 x ptr], ptr [[DOTOFFLOAD_PTRS]], i32 0, i32 0
2232 // CHECK3-NEXT: store i64 [[TMP31]], ptr [[TMP33]], align 8
2233 // CHECK3-NEXT: [[TMP34:%.*]] = getelementptr inbounds [1 x ptr], ptr [[DOTOFFLOAD_MAPPERS]], i64 0, i64 0
2234 // CHECK3-NEXT: store ptr null, ptr [[TMP34]], align 8
2235 // CHECK3-NEXT: [[TMP35:%.*]] = getelementptr inbounds [1 x ptr], ptr [[DOTOFFLOAD_BASEPTRS]], i32 0, i32 0
2236 // CHECK3-NEXT: [[TMP36:%.*]] = getelementptr inbounds [1 x ptr], ptr [[DOTOFFLOAD_PTRS]], i32 0, i32 0
2237 // CHECK3-NEXT: [[TMP37:%.*]] = load i32, ptr @Arg, align 4
2238 // CHECK3-NEXT: [[TOBOOL:%.*]] = icmp ne i32 [[TMP37]], 0
2239 // CHECK3-NEXT: [[FROMBOOL:%.*]] = zext i1 [[TOBOOL]] to i8
2240 // CHECK3-NEXT: store i8 [[FROMBOOL]], ptr [[DOTCAPTURE_EXPR_]], align 1
2241 // CHECK3-NEXT: [[TMP38:%.*]] = load i8, ptr [[DOTCAPTURE_EXPR_]], align 1
2242 // CHECK3-NEXT: [[TOBOOL5:%.*]] = trunc i8 [[TMP38]] to i1
2243 // CHECK3-NEXT: [[TMP39:%.*]] = select i1 [[TOBOOL5]], i32 0, i32 1
2244 // CHECK3-NEXT: [[TMP40:%.*]] = insertvalue [3 x i32] zeroinitializer, i32 [[TMP39]], 0
2245 // CHECK3-NEXT: [[TMP41:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS7]], i32 0, i32 0
2246 // CHECK3-NEXT: store i32 2, ptr [[TMP41]], align 4
2247 // CHECK3-NEXT: [[TMP42:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS7]], i32 0, i32 1
2248 // CHECK3-NEXT: store i32 1, ptr [[TMP42]], align 4
2249 // CHECK3-NEXT: [[TMP43:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS7]], i32 0, i32 2
2250 // CHECK3-NEXT: store ptr [[TMP35]], ptr [[TMP43]], align 8
2251 // CHECK3-NEXT: [[TMP44:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS7]], i32 0, i32 3
2252 // CHECK3-NEXT: store ptr [[TMP36]], ptr [[TMP44]], align 8
2253 // CHECK3-NEXT: [[TMP45:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS7]], i32 0, i32 4
2254 // CHECK3-NEXT: store ptr @.offload_sizes, ptr [[TMP45]], align 8
2255 // CHECK3-NEXT: [[TMP46:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS7]], i32 0, i32 5
2256 // CHECK3-NEXT: store ptr @.offload_maptypes, ptr [[TMP46]], align 8
2257 // CHECK3-NEXT: [[TMP47:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS7]], i32 0, i32 6
2258 // CHECK3-NEXT: store ptr null, ptr [[TMP47]], align 8
2259 // CHECK3-NEXT: [[TMP48:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS7]], i32 0, i32 7
2260 // CHECK3-NEXT: store ptr null, ptr [[TMP48]], align 8
2261 // CHECK3-NEXT: [[TMP49:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS7]], i32 0, i32 8
2262 // CHECK3-NEXT: store i64 100, ptr [[TMP49]], align 8
2263 // CHECK3-NEXT: [[TMP50:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS7]], i32 0, i32 9
2264 // CHECK3-NEXT: store i64 0, ptr [[TMP50]], align 8
2265 // CHECK3-NEXT: [[TMP51:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS7]], i32 0, i32 10
2266 // CHECK3-NEXT: store [3 x i32] zeroinitializer, ptr [[TMP51]], align 4
2267 // CHECK3-NEXT: [[TMP52:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS7]], i32 0, i32 11
2268 // CHECK3-NEXT: store [3 x i32] [[TMP40]], ptr [[TMP52]], align 4
2269 // CHECK3-NEXT: [[TMP53:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS7]], i32 0, i32 12
2270 // CHECK3-NEXT: store i32 0, ptr [[TMP53]], align 4
2271 // CHECK3-NEXT: [[TMP54:%.*]] = call i32 @__tgt_target_kernel(ptr @[[GLOB3]], i64 -1, i32 0, i32 [[TMP39]], ptr @.{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}_main_l92.region_id, ptr [[KERNEL_ARGS7]])
2272 // CHECK3-NEXT: [[TMP55:%.*]] = icmp ne i32 [[TMP54]], 0
2273 // CHECK3-NEXT: br i1 [[TMP55]], label [[OMP_OFFLOAD_FAILED8:%.*]], label [[OMP_OFFLOAD_CONT9:%.*]]
2274 // CHECK3: omp_offload.failed8:
2275 // CHECK3-NEXT: call void @{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}_main_l92(i64 [[TMP31]]) #[[ATTR3]]
2276 // CHECK3-NEXT: br label [[OMP_OFFLOAD_CONT9]]
2277 // CHECK3: omp_offload.cont9:
2278 // CHECK3-NEXT: [[TMP56:%.*]] = load i32, ptr @Arg, align 4
2279 // CHECK3-NEXT: [[CALL:%.*]] = call noundef i32 @_Z5tmainIiEiT_(i32 noundef [[TMP56]])
2280 // CHECK3-NEXT: ret i32 [[CALL]]
2283 // CHECK3-LABEL: define {{[^@]+}}@{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}_main_l76
2284 // CHECK3-SAME: () #[[ATTR1]] {
2285 // CHECK3-NEXT: entry:
2286 // CHECK3-NEXT: call void (ptr, i32, ptr, ...) @__kmpc_fork_teams(ptr @[[GLOB3]], i32 0, ptr @{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}_main_l76.omp_outlined)
2287 // CHECK3-NEXT: ret void
2290 // CHECK3-LABEL: define {{[^@]+}}@{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}_main_l76.omp_outlined
2291 // CHECK3-SAME: (ptr noalias noundef [[DOTGLOBAL_TID_:%.*]], ptr noalias noundef [[DOTBOUND_TID_:%.*]]) #[[ATTR2]] {
2292 // CHECK3-NEXT: entry:
2293 // CHECK3-NEXT: [[DOTGLOBAL_TID__ADDR:%.*]] = alloca ptr, align 8
2294 // CHECK3-NEXT: [[DOTBOUND_TID__ADDR:%.*]] = alloca ptr, align 8
2295 // CHECK3-NEXT: [[DOTOMP_IV:%.*]] = alloca i32, align 4
2296 // CHECK3-NEXT: [[TMP:%.*]] = alloca i32, align 4
2297 // CHECK3-NEXT: [[DOTOMP_COMB_LB:%.*]] = alloca i32, align 4
2298 // CHECK3-NEXT: [[DOTOMP_COMB_UB:%.*]] = alloca i32, align 4
2299 // CHECK3-NEXT: [[DOTOMP_STRIDE:%.*]] = alloca i32, align 4
2300 // CHECK3-NEXT: [[DOTOMP_IS_LAST:%.*]] = alloca i32, align 4
2301 // CHECK3-NEXT: [[I:%.*]] = alloca i32, align 4
2302 // CHECK3-NEXT: store ptr [[DOTGLOBAL_TID_]], ptr [[DOTGLOBAL_TID__ADDR]], align 8
2303 // CHECK3-NEXT: store ptr [[DOTBOUND_TID_]], ptr [[DOTBOUND_TID__ADDR]], align 8
2304 // CHECK3-NEXT: store i32 0, ptr [[DOTOMP_COMB_LB]], align 4
2305 // CHECK3-NEXT: store i32 99, ptr [[DOTOMP_COMB_UB]], align 4
2306 // CHECK3-NEXT: store i32 1, ptr [[DOTOMP_STRIDE]], align 4
2307 // CHECK3-NEXT: store i32 0, ptr [[DOTOMP_IS_LAST]], align 4
2308 // CHECK3-NEXT: [[TMP0:%.*]] = load ptr, ptr [[DOTGLOBAL_TID__ADDR]], align 8
2309 // CHECK3-NEXT: [[TMP1:%.*]] = load i32, ptr [[TMP0]], align 4
2310 // 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)
2311 // CHECK3-NEXT: [[TMP2:%.*]] = load i32, ptr [[DOTOMP_COMB_UB]], align 4
2312 // CHECK3-NEXT: [[CMP:%.*]] = icmp sgt i32 [[TMP2]], 99
2313 // CHECK3-NEXT: br i1 [[CMP]], label [[COND_TRUE:%.*]], label [[COND_FALSE:%.*]]
2314 // CHECK3: cond.true:
2315 // CHECK3-NEXT: br label [[COND_END:%.*]]
2316 // CHECK3: cond.false:
2317 // CHECK3-NEXT: [[TMP3:%.*]] = load i32, ptr [[DOTOMP_COMB_UB]], align 4
2318 // CHECK3-NEXT: br label [[COND_END]]
2319 // CHECK3: cond.end:
2320 // CHECK3-NEXT: [[COND:%.*]] = phi i32 [ 99, [[COND_TRUE]] ], [ [[TMP3]], [[COND_FALSE]] ]
2321 // CHECK3-NEXT: store i32 [[COND]], ptr [[DOTOMP_COMB_UB]], align 4
2322 // CHECK3-NEXT: [[TMP4:%.*]] = load i32, ptr [[DOTOMP_COMB_LB]], align 4
2323 // CHECK3-NEXT: store i32 [[TMP4]], ptr [[DOTOMP_IV]], align 4
2324 // CHECK3-NEXT: br label [[OMP_INNER_FOR_COND:%.*]]
2325 // CHECK3: omp.inner.for.cond:
2326 // CHECK3-NEXT: [[TMP5:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP26:![0-9]+]]
2327 // CHECK3-NEXT: [[TMP6:%.*]] = load i32, ptr [[DOTOMP_COMB_UB]], align 4, !llvm.access.group [[ACC_GRP26]]
2328 // CHECK3-NEXT: [[CMP1:%.*]] = icmp sle i32 [[TMP5]], [[TMP6]]
2329 // CHECK3-NEXT: br i1 [[CMP1]], label [[OMP_INNER_FOR_BODY:%.*]], label [[OMP_INNER_FOR_END:%.*]]
2330 // CHECK3: omp.inner.for.body:
2331 // CHECK3-NEXT: [[TMP7:%.*]] = load i32, ptr [[DOTOMP_COMB_LB]], align 4, !llvm.access.group [[ACC_GRP26]]
2332 // CHECK3-NEXT: [[TMP8:%.*]] = zext i32 [[TMP7]] to i64
2333 // CHECK3-NEXT: [[TMP9:%.*]] = load i32, ptr [[DOTOMP_COMB_UB]], align 4, !llvm.access.group [[ACC_GRP26]]
2334 // CHECK3-NEXT: [[TMP10:%.*]] = zext i32 [[TMP9]] to i64
2335 // CHECK3-NEXT: call void (ptr, i32, ptr, ...) @__kmpc_fork_call(ptr @[[GLOB3]], i32 2, ptr @{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}_main_l76.omp_outlined.omp_outlined, i64 [[TMP8]], i64 [[TMP10]]), !llvm.access.group [[ACC_GRP26]]
2336 // CHECK3-NEXT: br label [[OMP_INNER_FOR_INC:%.*]]
2337 // CHECK3: omp.inner.for.inc:
2338 // CHECK3-NEXT: [[TMP11:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP26]]
2339 // CHECK3-NEXT: [[TMP12:%.*]] = load i32, ptr [[DOTOMP_STRIDE]], align 4, !llvm.access.group [[ACC_GRP26]]
2340 // CHECK3-NEXT: [[ADD:%.*]] = add nsw i32 [[TMP11]], [[TMP12]]
2341 // CHECK3-NEXT: store i32 [[ADD]], ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP26]]
2342 // CHECK3-NEXT: br label [[OMP_INNER_FOR_COND]], !llvm.loop [[LOOP27:![0-9]+]]
2343 // CHECK3: omp.inner.for.end:
2344 // CHECK3-NEXT: br label [[OMP_LOOP_EXIT:%.*]]
2345 // CHECK3: omp.loop.exit:
2346 // CHECK3-NEXT: call void @__kmpc_for_static_fini(ptr @[[GLOB1]], i32 [[TMP1]])
2347 // CHECK3-NEXT: [[TMP13:%.*]] = load i32, ptr [[DOTOMP_IS_LAST]], align 4
2348 // CHECK3-NEXT: [[TMP14:%.*]] = icmp ne i32 [[TMP13]], 0
2349 // CHECK3-NEXT: br i1 [[TMP14]], label [[DOTOMP_FINAL_THEN:%.*]], label [[DOTOMP_FINAL_DONE:%.*]]
2350 // CHECK3: .omp.final.then:
2351 // CHECK3-NEXT: store i32 100, ptr [[I]], align 4
2352 // CHECK3-NEXT: br label [[DOTOMP_FINAL_DONE]]
2353 // CHECK3: .omp.final.done:
2354 // CHECK3-NEXT: ret void
2357 // CHECK3-LABEL: define {{[^@]+}}@{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}_main_l76.omp_outlined.omp_outlined
2358 // CHECK3-SAME: (ptr noalias noundef [[DOTGLOBAL_TID_:%.*]], ptr noalias noundef [[DOTBOUND_TID_:%.*]], i64 noundef [[DOTPREVIOUS_LB_:%.*]], i64 noundef [[DOTPREVIOUS_UB_:%.*]]) #[[ATTR2]] {
2359 // CHECK3-NEXT: entry:
2360 // CHECK3-NEXT: [[DOTGLOBAL_TID__ADDR:%.*]] = alloca ptr, align 8
2361 // CHECK3-NEXT: [[DOTBOUND_TID__ADDR:%.*]] = alloca ptr, align 8
2362 // CHECK3-NEXT: [[DOTPREVIOUS_LB__ADDR:%.*]] = alloca i64, align 8
2363 // CHECK3-NEXT: [[DOTPREVIOUS_UB__ADDR:%.*]] = alloca i64, align 8
2364 // CHECK3-NEXT: [[DOTOMP_IV:%.*]] = alloca i32, align 4
2365 // CHECK3-NEXT: [[TMP:%.*]] = alloca i32, align 4
2366 // CHECK3-NEXT: [[DOTOMP_LB:%.*]] = alloca i32, align 4
2367 // CHECK3-NEXT: [[DOTOMP_UB:%.*]] = alloca i32, align 4
2368 // CHECK3-NEXT: [[DOTOMP_STRIDE:%.*]] = alloca i32, align 4
2369 // CHECK3-NEXT: [[DOTOMP_IS_LAST:%.*]] = alloca i32, align 4
2370 // CHECK3-NEXT: [[I:%.*]] = alloca i32, align 4
2371 // CHECK3-NEXT: store ptr [[DOTGLOBAL_TID_]], ptr [[DOTGLOBAL_TID__ADDR]], align 8
2372 // CHECK3-NEXT: store ptr [[DOTBOUND_TID_]], ptr [[DOTBOUND_TID__ADDR]], align 8
2373 // CHECK3-NEXT: store i64 [[DOTPREVIOUS_LB_]], ptr [[DOTPREVIOUS_LB__ADDR]], align 8
2374 // CHECK3-NEXT: store i64 [[DOTPREVIOUS_UB_]], ptr [[DOTPREVIOUS_UB__ADDR]], align 8
2375 // CHECK3-NEXT: store i32 0, ptr [[DOTOMP_LB]], align 4
2376 // CHECK3-NEXT: store i32 99, ptr [[DOTOMP_UB]], align 4
2377 // CHECK3-NEXT: [[TMP0:%.*]] = load i64, ptr [[DOTPREVIOUS_LB__ADDR]], align 8
2378 // CHECK3-NEXT: [[CONV:%.*]] = trunc i64 [[TMP0]] to i32
2379 // CHECK3-NEXT: [[TMP1:%.*]] = load i64, ptr [[DOTPREVIOUS_UB__ADDR]], align 8
2380 // CHECK3-NEXT: [[CONV1:%.*]] = trunc i64 [[TMP1]] to i32
2381 // CHECK3-NEXT: store i32 [[CONV]], ptr [[DOTOMP_LB]], align 4
2382 // CHECK3-NEXT: store i32 [[CONV1]], ptr [[DOTOMP_UB]], align 4
2383 // CHECK3-NEXT: store i32 1, ptr [[DOTOMP_STRIDE]], align 4
2384 // CHECK3-NEXT: store i32 0, ptr [[DOTOMP_IS_LAST]], align 4
2385 // CHECK3-NEXT: [[TMP2:%.*]] = load ptr, ptr [[DOTGLOBAL_TID__ADDR]], align 8
2386 // CHECK3-NEXT: [[TMP3:%.*]] = load i32, ptr [[TMP2]], align 4
2387 // 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)
2388 // CHECK3-NEXT: [[TMP4:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4
2389 // CHECK3-NEXT: [[CMP:%.*]] = icmp sgt i32 [[TMP4]], 99
2390 // CHECK3-NEXT: br i1 [[CMP]], label [[COND_TRUE:%.*]], label [[COND_FALSE:%.*]]
2391 // CHECK3: cond.true:
2392 // CHECK3-NEXT: br label [[COND_END:%.*]]
2393 // CHECK3: cond.false:
2394 // CHECK3-NEXT: [[TMP5:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4
2395 // CHECK3-NEXT: br label [[COND_END]]
2396 // CHECK3: cond.end:
2397 // CHECK3-NEXT: [[COND:%.*]] = phi i32 [ 99, [[COND_TRUE]] ], [ [[TMP5]], [[COND_FALSE]] ]
2398 // CHECK3-NEXT: store i32 [[COND]], ptr [[DOTOMP_UB]], align 4
2399 // CHECK3-NEXT: [[TMP6:%.*]] = load i32, ptr [[DOTOMP_LB]], align 4
2400 // CHECK3-NEXT: store i32 [[TMP6]], ptr [[DOTOMP_IV]], align 4
2401 // CHECK3-NEXT: br label [[OMP_INNER_FOR_COND:%.*]]
2402 // CHECK3: omp.inner.for.cond:
2403 // CHECK3-NEXT: [[TMP7:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP29:![0-9]+]]
2404 // CHECK3-NEXT: [[TMP8:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4, !llvm.access.group [[ACC_GRP29]]
2405 // CHECK3-NEXT: [[CMP2:%.*]] = icmp sle i32 [[TMP7]], [[TMP8]]
2406 // CHECK3-NEXT: br i1 [[CMP2]], label [[OMP_INNER_FOR_BODY:%.*]], label [[OMP_INNER_FOR_END:%.*]]
2407 // CHECK3: omp.inner.for.body:
2408 // CHECK3-NEXT: [[TMP9:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP29]]
2409 // CHECK3-NEXT: [[MUL:%.*]] = mul nsw i32 [[TMP9]], 1
2410 // CHECK3-NEXT: [[ADD:%.*]] = add nsw i32 0, [[MUL]]
2411 // CHECK3-NEXT: store i32 [[ADD]], ptr [[I]], align 4, !llvm.access.group [[ACC_GRP29]]
2412 // CHECK3-NEXT: call void @_Z3fn4v(), !llvm.access.group [[ACC_GRP29]]
2413 // CHECK3-NEXT: br label [[OMP_BODY_CONTINUE:%.*]]
2414 // CHECK3: omp.body.continue:
2415 // CHECK3-NEXT: br label [[OMP_INNER_FOR_INC:%.*]]
2416 // CHECK3: omp.inner.for.inc:
2417 // CHECK3-NEXT: [[TMP10:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP29]]
2418 // CHECK3-NEXT: [[ADD3:%.*]] = add nsw i32 [[TMP10]], 1
2419 // CHECK3-NEXT: store i32 [[ADD3]], ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP29]]
2420 // CHECK3-NEXT: br label [[OMP_INNER_FOR_COND]], !llvm.loop [[LOOP30:![0-9]+]]
2421 // CHECK3: omp.inner.for.end:
2422 // CHECK3-NEXT: br label [[OMP_LOOP_EXIT:%.*]]
2423 // CHECK3: omp.loop.exit:
2424 // CHECK3-NEXT: call void @__kmpc_for_static_fini(ptr @[[GLOB1]], i32 [[TMP3]])
2425 // CHECK3-NEXT: [[TMP11:%.*]] = load i32, ptr [[DOTOMP_IS_LAST]], align 4
2426 // CHECK3-NEXT: [[TMP12:%.*]] = icmp ne i32 [[TMP11]], 0
2427 // CHECK3-NEXT: br i1 [[TMP12]], label [[DOTOMP_FINAL_THEN:%.*]], label [[DOTOMP_FINAL_DONE:%.*]]
2428 // CHECK3: .omp.final.then:
2429 // CHECK3-NEXT: store i32 100, ptr [[I]], align 4
2430 // CHECK3-NEXT: br label [[DOTOMP_FINAL_DONE]]
2431 // CHECK3: .omp.final.done:
2432 // CHECK3-NEXT: ret void
2435 // CHECK3-LABEL: define {{[^@]+}}@{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}_main_l84
2436 // CHECK3-SAME: () #[[ATTR1]] {
2437 // CHECK3-NEXT: entry:
2438 // CHECK3-NEXT: call void (ptr, i32, ptr, ...) @__kmpc_fork_teams(ptr @[[GLOB3]], i32 0, ptr @{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}_main_l84.omp_outlined)
2439 // CHECK3-NEXT: ret void
2442 // CHECK3-LABEL: define {{[^@]+}}@{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}_main_l84.omp_outlined
2443 // CHECK3-SAME: (ptr noalias noundef [[DOTGLOBAL_TID_:%.*]], ptr noalias noundef [[DOTBOUND_TID_:%.*]]) #[[ATTR2]] {
2444 // CHECK3-NEXT: entry:
2445 // CHECK3-NEXT: [[DOTGLOBAL_TID__ADDR:%.*]] = alloca ptr, align 8
2446 // CHECK3-NEXT: [[DOTBOUND_TID__ADDR:%.*]] = alloca ptr, align 8
2447 // CHECK3-NEXT: [[DOTOMP_IV:%.*]] = alloca i32, align 4
2448 // CHECK3-NEXT: [[TMP:%.*]] = alloca i32, align 4
2449 // CHECK3-NEXT: [[DOTOMP_COMB_LB:%.*]] = alloca i32, align 4
2450 // CHECK3-NEXT: [[DOTOMP_COMB_UB:%.*]] = alloca i32, align 4
2451 // CHECK3-NEXT: [[DOTOMP_STRIDE:%.*]] = alloca i32, align 4
2452 // CHECK3-NEXT: [[DOTOMP_IS_LAST:%.*]] = alloca i32, align 4
2453 // CHECK3-NEXT: [[I:%.*]] = alloca i32, align 4
2454 // CHECK3-NEXT: [[DOTBOUND_ZERO_ADDR:%.*]] = alloca i32, align 4
2455 // CHECK3-NEXT: store ptr [[DOTGLOBAL_TID_]], ptr [[DOTGLOBAL_TID__ADDR]], align 8
2456 // CHECK3-NEXT: store ptr [[DOTBOUND_TID_]], ptr [[DOTBOUND_TID__ADDR]], align 8
2457 // CHECK3-NEXT: store i32 0, ptr [[DOTOMP_COMB_LB]], align 4
2458 // CHECK3-NEXT: store i32 99, ptr [[DOTOMP_COMB_UB]], align 4
2459 // CHECK3-NEXT: store i32 1, ptr [[DOTOMP_STRIDE]], align 4
2460 // CHECK3-NEXT: store i32 0, ptr [[DOTOMP_IS_LAST]], align 4
2461 // CHECK3-NEXT: [[TMP0:%.*]] = load ptr, ptr [[DOTGLOBAL_TID__ADDR]], align 8
2462 // CHECK3-NEXT: [[TMP1:%.*]] = load i32, ptr [[TMP0]], align 4
2463 // 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)
2464 // CHECK3-NEXT: [[TMP2:%.*]] = load i32, ptr [[DOTOMP_COMB_UB]], align 4
2465 // CHECK3-NEXT: [[CMP:%.*]] = icmp sgt i32 [[TMP2]], 99
2466 // CHECK3-NEXT: br i1 [[CMP]], label [[COND_TRUE:%.*]], label [[COND_FALSE:%.*]]
2467 // CHECK3: cond.true:
2468 // CHECK3-NEXT: br label [[COND_END:%.*]]
2469 // CHECK3: cond.false:
2470 // CHECK3-NEXT: [[TMP3:%.*]] = load i32, ptr [[DOTOMP_COMB_UB]], align 4
2471 // CHECK3-NEXT: br label [[COND_END]]
2472 // CHECK3: cond.end:
2473 // CHECK3-NEXT: [[COND:%.*]] = phi i32 [ 99, [[COND_TRUE]] ], [ [[TMP3]], [[COND_FALSE]] ]
2474 // CHECK3-NEXT: store i32 [[COND]], ptr [[DOTOMP_COMB_UB]], align 4
2475 // CHECK3-NEXT: [[TMP4:%.*]] = load i32, ptr [[DOTOMP_COMB_LB]], align 4
2476 // CHECK3-NEXT: store i32 [[TMP4]], ptr [[DOTOMP_IV]], align 4
2477 // CHECK3-NEXT: br label [[OMP_INNER_FOR_COND:%.*]]
2478 // CHECK3: omp.inner.for.cond:
2479 // CHECK3-NEXT: [[TMP5:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4
2480 // CHECK3-NEXT: [[TMP6:%.*]] = load i32, ptr [[DOTOMP_COMB_UB]], align 4
2481 // CHECK3-NEXT: [[CMP1:%.*]] = icmp sle i32 [[TMP5]], [[TMP6]]
2482 // CHECK3-NEXT: br i1 [[CMP1]], label [[OMP_INNER_FOR_BODY:%.*]], label [[OMP_INNER_FOR_END:%.*]]
2483 // CHECK3: omp.inner.for.body:
2484 // CHECK3-NEXT: [[TMP7:%.*]] = load i32, ptr [[DOTOMP_COMB_LB]], align 4
2485 // CHECK3-NEXT: [[TMP8:%.*]] = zext i32 [[TMP7]] to i64
2486 // CHECK3-NEXT: [[TMP9:%.*]] = load i32, ptr [[DOTOMP_COMB_UB]], align 4
2487 // CHECK3-NEXT: [[TMP10:%.*]] = zext i32 [[TMP9]] to i64
2488 // CHECK3-NEXT: call void @__kmpc_serialized_parallel(ptr @[[GLOB3]], i32 [[TMP1]])
2489 // CHECK3-NEXT: [[TMP11:%.*]] = load ptr, ptr [[DOTGLOBAL_TID__ADDR]], align 8
2490 // CHECK3-NEXT: store i32 0, ptr [[DOTBOUND_ZERO_ADDR]], align 4
2491 // CHECK3-NEXT: call void @{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}_main_l84.omp_outlined.omp_outlined(ptr [[TMP11]], ptr [[DOTBOUND_ZERO_ADDR]], i64 [[TMP8]], i64 [[TMP10]]) #[[ATTR3]]
2492 // CHECK3-NEXT: call void @__kmpc_end_serialized_parallel(ptr @[[GLOB3]], i32 [[TMP1]])
2493 // CHECK3-NEXT: br label [[OMP_INNER_FOR_INC:%.*]]
2494 // CHECK3: omp.inner.for.inc:
2495 // CHECK3-NEXT: [[TMP12:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4
2496 // CHECK3-NEXT: [[TMP13:%.*]] = load i32, ptr [[DOTOMP_STRIDE]], align 4
2497 // CHECK3-NEXT: [[ADD:%.*]] = add nsw i32 [[TMP12]], [[TMP13]]
2498 // CHECK3-NEXT: store i32 [[ADD]], ptr [[DOTOMP_IV]], align 4
2499 // CHECK3-NEXT: br label [[OMP_INNER_FOR_COND]], !llvm.loop [[LOOP32:![0-9]+]]
2500 // CHECK3: omp.inner.for.end:
2501 // CHECK3-NEXT: br label [[OMP_LOOP_EXIT:%.*]]
2502 // CHECK3: omp.loop.exit:
2503 // CHECK3-NEXT: call void @__kmpc_for_static_fini(ptr @[[GLOB1]], i32 [[TMP1]])
2504 // CHECK3-NEXT: [[TMP14:%.*]] = load i32, ptr [[DOTOMP_IS_LAST]], align 4
2505 // CHECK3-NEXT: [[TMP15:%.*]] = icmp ne i32 [[TMP14]], 0
2506 // CHECK3-NEXT: br i1 [[TMP15]], label [[DOTOMP_FINAL_THEN:%.*]], label [[DOTOMP_FINAL_DONE:%.*]]
2507 // CHECK3: .omp.final.then:
2508 // CHECK3-NEXT: store i32 100, ptr [[I]], align 4
2509 // CHECK3-NEXT: br label [[DOTOMP_FINAL_DONE]]
2510 // CHECK3: .omp.final.done:
2511 // CHECK3-NEXT: ret void
2514 // CHECK3-LABEL: define {{[^@]+}}@{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}_main_l84.omp_outlined.omp_outlined
2515 // CHECK3-SAME: (ptr noalias noundef [[DOTGLOBAL_TID_:%.*]], ptr noalias noundef [[DOTBOUND_TID_:%.*]], i64 noundef [[DOTPREVIOUS_LB_:%.*]], i64 noundef [[DOTPREVIOUS_UB_:%.*]]) #[[ATTR2]] {
2516 // CHECK3-NEXT: entry:
2517 // CHECK3-NEXT: [[DOTGLOBAL_TID__ADDR:%.*]] = alloca ptr, align 8
2518 // CHECK3-NEXT: [[DOTBOUND_TID__ADDR:%.*]] = alloca ptr, align 8
2519 // CHECK3-NEXT: [[DOTPREVIOUS_LB__ADDR:%.*]] = alloca i64, align 8
2520 // CHECK3-NEXT: [[DOTPREVIOUS_UB__ADDR:%.*]] = alloca i64, align 8
2521 // CHECK3-NEXT: [[DOTOMP_IV:%.*]] = alloca i32, align 4
2522 // CHECK3-NEXT: [[TMP:%.*]] = alloca i32, align 4
2523 // CHECK3-NEXT: [[DOTOMP_LB:%.*]] = alloca i32, align 4
2524 // CHECK3-NEXT: [[DOTOMP_UB:%.*]] = alloca i32, align 4
2525 // CHECK3-NEXT: [[DOTOMP_STRIDE:%.*]] = alloca i32, align 4
2526 // CHECK3-NEXT: [[DOTOMP_IS_LAST:%.*]] = alloca i32, align 4
2527 // CHECK3-NEXT: [[I:%.*]] = alloca i32, align 4
2528 // CHECK3-NEXT: store ptr [[DOTGLOBAL_TID_]], ptr [[DOTGLOBAL_TID__ADDR]], align 8
2529 // CHECK3-NEXT: store ptr [[DOTBOUND_TID_]], ptr [[DOTBOUND_TID__ADDR]], align 8
2530 // CHECK3-NEXT: store i64 [[DOTPREVIOUS_LB_]], ptr [[DOTPREVIOUS_LB__ADDR]], align 8
2531 // CHECK3-NEXT: store i64 [[DOTPREVIOUS_UB_]], ptr [[DOTPREVIOUS_UB__ADDR]], align 8
2532 // CHECK3-NEXT: store i32 0, ptr [[DOTOMP_LB]], align 4
2533 // CHECK3-NEXT: store i32 99, ptr [[DOTOMP_UB]], align 4
2534 // CHECK3-NEXT: [[TMP0:%.*]] = load i64, ptr [[DOTPREVIOUS_LB__ADDR]], align 8
2535 // CHECK3-NEXT: [[CONV:%.*]] = trunc i64 [[TMP0]] to i32
2536 // CHECK3-NEXT: [[TMP1:%.*]] = load i64, ptr [[DOTPREVIOUS_UB__ADDR]], align 8
2537 // CHECK3-NEXT: [[CONV1:%.*]] = trunc i64 [[TMP1]] to i32
2538 // CHECK3-NEXT: store i32 [[CONV]], ptr [[DOTOMP_LB]], align 4
2539 // CHECK3-NEXT: store i32 [[CONV1]], ptr [[DOTOMP_UB]], align 4
2540 // CHECK3-NEXT: store i32 1, ptr [[DOTOMP_STRIDE]], align 4
2541 // CHECK3-NEXT: store i32 0, ptr [[DOTOMP_IS_LAST]], align 4
2542 // CHECK3-NEXT: [[TMP2:%.*]] = load ptr, ptr [[DOTGLOBAL_TID__ADDR]], align 8
2543 // CHECK3-NEXT: [[TMP3:%.*]] = load i32, ptr [[TMP2]], align 4
2544 // 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)
2545 // CHECK3-NEXT: [[TMP4:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4
2546 // CHECK3-NEXT: [[CMP:%.*]] = icmp sgt i32 [[TMP4]], 99
2547 // CHECK3-NEXT: br i1 [[CMP]], label [[COND_TRUE:%.*]], label [[COND_FALSE:%.*]]
2548 // CHECK3: cond.true:
2549 // CHECK3-NEXT: br label [[COND_END:%.*]]
2550 // CHECK3: cond.false:
2551 // CHECK3-NEXT: [[TMP5:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4
2552 // CHECK3-NEXT: br label [[COND_END]]
2553 // CHECK3: cond.end:
2554 // CHECK3-NEXT: [[COND:%.*]] = phi i32 [ 99, [[COND_TRUE]] ], [ [[TMP5]], [[COND_FALSE]] ]
2555 // CHECK3-NEXT: store i32 [[COND]], ptr [[DOTOMP_UB]], align 4
2556 // CHECK3-NEXT: [[TMP6:%.*]] = load i32, ptr [[DOTOMP_LB]], align 4
2557 // CHECK3-NEXT: store i32 [[TMP6]], ptr [[DOTOMP_IV]], align 4
2558 // CHECK3-NEXT: br label [[OMP_INNER_FOR_COND:%.*]]
2559 // CHECK3: omp.inner.for.cond:
2560 // CHECK3-NEXT: [[TMP7:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4
2561 // CHECK3-NEXT: [[TMP8:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4
2562 // CHECK3-NEXT: [[CMP2:%.*]] = icmp sle i32 [[TMP7]], [[TMP8]]
2563 // CHECK3-NEXT: br i1 [[CMP2]], label [[OMP_INNER_FOR_BODY:%.*]], label [[OMP_INNER_FOR_END:%.*]]
2564 // CHECK3: omp.inner.for.body:
2565 // CHECK3-NEXT: [[TMP9:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4
2566 // CHECK3-NEXT: [[MUL:%.*]] = mul nsw i32 [[TMP9]], 1
2567 // CHECK3-NEXT: [[ADD:%.*]] = add nsw i32 0, [[MUL]]
2568 // CHECK3-NEXT: store i32 [[ADD]], ptr [[I]], align 4
2569 // CHECK3-NEXT: call void @_Z3fn5v()
2570 // CHECK3-NEXT: br label [[OMP_BODY_CONTINUE:%.*]]
2571 // CHECK3: omp.body.continue:
2572 // CHECK3-NEXT: br label [[OMP_INNER_FOR_INC:%.*]]
2573 // CHECK3: omp.inner.for.inc:
2574 // CHECK3-NEXT: [[TMP10:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4
2575 // CHECK3-NEXT: [[ADD3:%.*]] = add nsw i32 [[TMP10]], 1
2576 // CHECK3-NEXT: store i32 [[ADD3]], ptr [[DOTOMP_IV]], align 4
2577 // CHECK3-NEXT: br label [[OMP_INNER_FOR_COND]], !llvm.loop [[LOOP34:![0-9]+]]
2578 // CHECK3: omp.inner.for.end:
2579 // CHECK3-NEXT: br label [[OMP_LOOP_EXIT:%.*]]
2580 // CHECK3: omp.loop.exit:
2581 // CHECK3-NEXT: call void @__kmpc_for_static_fini(ptr @[[GLOB1]], i32 [[TMP3]])
2582 // CHECK3-NEXT: [[TMP11:%.*]] = load i32, ptr [[DOTOMP_IS_LAST]], align 4
2583 // CHECK3-NEXT: [[TMP12:%.*]] = icmp ne i32 [[TMP11]], 0
2584 // CHECK3-NEXT: br i1 [[TMP12]], label [[DOTOMP_FINAL_THEN:%.*]], label [[DOTOMP_FINAL_DONE:%.*]]
2585 // CHECK3: .omp.final.then:
2586 // CHECK3-NEXT: store i32 100, ptr [[I]], align 4
2587 // CHECK3-NEXT: br label [[DOTOMP_FINAL_DONE]]
2588 // CHECK3: .omp.final.done:
2589 // CHECK3-NEXT: ret void
2592 // CHECK3-LABEL: define {{[^@]+}}@{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}_main_l92
2593 // CHECK3-SAME: (i64 noundef [[ARG:%.*]]) #[[ATTR1]] {
2594 // CHECK3-NEXT: entry:
2595 // CHECK3-NEXT: [[ARG_ADDR:%.*]] = alloca i64, align 8
2596 // CHECK3-NEXT: [[DOTCAPTURE_EXPR_:%.*]] = alloca i8, align 1
2597 // CHECK3-NEXT: [[DOTCAPTURE_EXPR__CASTED:%.*]] = alloca i64, align 8
2598 // CHECK3-NEXT: store i64 [[ARG]], ptr [[ARG_ADDR]], align 8
2599 // CHECK3-NEXT: [[TMP0:%.*]] = load i32, ptr [[ARG_ADDR]], align 4
2600 // CHECK3-NEXT: [[TOBOOL:%.*]] = icmp ne i32 [[TMP0]], 0
2601 // CHECK3-NEXT: [[FROMBOOL:%.*]] = zext i1 [[TOBOOL]] to i8
2602 // CHECK3-NEXT: store i8 [[FROMBOOL]], ptr [[DOTCAPTURE_EXPR_]], align 1
2603 // CHECK3-NEXT: [[TMP1:%.*]] = load i8, ptr [[DOTCAPTURE_EXPR_]], align 1
2604 // CHECK3-NEXT: [[TOBOOL1:%.*]] = trunc i8 [[TMP1]] to i1
2605 // CHECK3-NEXT: [[FROMBOOL2:%.*]] = zext i1 [[TOBOOL1]] to i8
2606 // CHECK3-NEXT: store i8 [[FROMBOOL2]], ptr [[DOTCAPTURE_EXPR__CASTED]], align 1
2607 // CHECK3-NEXT: [[TMP2:%.*]] = load i64, ptr [[DOTCAPTURE_EXPR__CASTED]], align 8
2608 // CHECK3-NEXT: call void (ptr, i32, ptr, ...) @__kmpc_fork_teams(ptr @[[GLOB3]], i32 1, ptr @{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}_main_l92.omp_outlined, i64 [[TMP2]])
2609 // CHECK3-NEXT: ret void
2612 // CHECK3-LABEL: define {{[^@]+}}@{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}_main_l92.omp_outlined
2613 // CHECK3-SAME: (ptr noalias noundef [[DOTGLOBAL_TID_:%.*]], ptr noalias noundef [[DOTBOUND_TID_:%.*]], i64 noundef [[DOTCAPTURE_EXPR_:%.*]]) #[[ATTR2]] {
2614 // CHECK3-NEXT: entry:
2615 // CHECK3-NEXT: [[DOTGLOBAL_TID__ADDR:%.*]] = alloca ptr, align 8
2616 // CHECK3-NEXT: [[DOTBOUND_TID__ADDR:%.*]] = alloca ptr, align 8
2617 // CHECK3-NEXT: [[DOTCAPTURE_EXPR__ADDR:%.*]] = alloca i64, align 8
2618 // CHECK3-NEXT: [[DOTOMP_IV:%.*]] = alloca i32, align 4
2619 // CHECK3-NEXT: [[TMP:%.*]] = alloca i32, align 4
2620 // CHECK3-NEXT: [[DOTOMP_COMB_LB:%.*]] = alloca i32, align 4
2621 // CHECK3-NEXT: [[DOTOMP_COMB_UB:%.*]] = alloca i32, align 4
2622 // CHECK3-NEXT: [[DOTOMP_STRIDE:%.*]] = alloca i32, align 4
2623 // CHECK3-NEXT: [[DOTOMP_IS_LAST:%.*]] = alloca i32, align 4
2624 // CHECK3-NEXT: [[I:%.*]] = alloca i32, align 4
2625 // CHECK3-NEXT: [[DOTCAPTURE_EXPR__CASTED:%.*]] = alloca i64, align 8
2626 // CHECK3-NEXT: [[DOTBOUND_ZERO_ADDR:%.*]] = alloca i32, align 4
2627 // CHECK3-NEXT: [[DOTCAPTURE_EXPR__CASTED10:%.*]] = alloca i64, align 8
2628 // CHECK3-NEXT: [[DOTBOUND_ZERO_ADDR15:%.*]] = alloca i32, align 4
2629 // CHECK3-NEXT: store ptr [[DOTGLOBAL_TID_]], ptr [[DOTGLOBAL_TID__ADDR]], align 8
2630 // CHECK3-NEXT: store ptr [[DOTBOUND_TID_]], ptr [[DOTBOUND_TID__ADDR]], align 8
2631 // CHECK3-NEXT: store i64 [[DOTCAPTURE_EXPR_]], ptr [[DOTCAPTURE_EXPR__ADDR]], align 8
2632 // CHECK3-NEXT: store i32 0, ptr [[DOTOMP_COMB_LB]], align 4
2633 // CHECK3-NEXT: store i32 99, ptr [[DOTOMP_COMB_UB]], align 4
2634 // CHECK3-NEXT: store i32 1, ptr [[DOTOMP_STRIDE]], align 4
2635 // CHECK3-NEXT: store i32 0, ptr [[DOTOMP_IS_LAST]], align 4
2636 // CHECK3-NEXT: [[TMP0:%.*]] = load ptr, ptr [[DOTGLOBAL_TID__ADDR]], align 8
2637 // CHECK3-NEXT: [[TMP1:%.*]] = load i32, ptr [[TMP0]], align 4
2638 // 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)
2639 // CHECK3-NEXT: [[TMP2:%.*]] = load i32, ptr [[DOTOMP_COMB_UB]], align 4
2640 // CHECK3-NEXT: [[CMP:%.*]] = icmp sgt i32 [[TMP2]], 99
2641 // CHECK3-NEXT: br i1 [[CMP]], label [[COND_TRUE:%.*]], label [[COND_FALSE:%.*]]
2642 // CHECK3: cond.true:
2643 // CHECK3-NEXT: br label [[COND_END:%.*]]
2644 // CHECK3: cond.false:
2645 // CHECK3-NEXT: [[TMP3:%.*]] = load i32, ptr [[DOTOMP_COMB_UB]], align 4
2646 // CHECK3-NEXT: br label [[COND_END]]
2647 // CHECK3: cond.end:
2648 // CHECK3-NEXT: [[COND:%.*]] = phi i32 [ 99, [[COND_TRUE]] ], [ [[TMP3]], [[COND_FALSE]] ]
2649 // CHECK3-NEXT: store i32 [[COND]], ptr [[DOTOMP_COMB_UB]], align 4
2650 // CHECK3-NEXT: [[TMP4:%.*]] = load i32, ptr [[DOTOMP_COMB_LB]], align 4
2651 // CHECK3-NEXT: store i32 [[TMP4]], ptr [[DOTOMP_IV]], align 4
2652 // CHECK3-NEXT: [[TMP5:%.*]] = load i8, ptr [[DOTCAPTURE_EXPR__ADDR]], align 1
2653 // CHECK3-NEXT: [[TOBOOL:%.*]] = trunc i8 [[TMP5]] to i1
2654 // CHECK3-NEXT: br i1 [[TOBOOL]], label [[OMP_IF_THEN:%.*]], label [[OMP_IF_ELSE5:%.*]]
2655 // CHECK3: omp_if.then:
2656 // CHECK3-NEXT: br label [[OMP_INNER_FOR_COND:%.*]]
2657 // CHECK3: omp.inner.for.cond:
2658 // CHECK3-NEXT: [[TMP6:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP35:![0-9]+]]
2659 // CHECK3-NEXT: [[TMP7:%.*]] = load i32, ptr [[DOTOMP_COMB_UB]], align 4, !llvm.access.group [[ACC_GRP35]]
2660 // CHECK3-NEXT: [[CMP1:%.*]] = icmp sle i32 [[TMP6]], [[TMP7]]
2661 // CHECK3-NEXT: br i1 [[CMP1]], label [[OMP_INNER_FOR_BODY:%.*]], label [[OMP_INNER_FOR_END:%.*]]
2662 // CHECK3: omp.inner.for.body:
2663 // CHECK3-NEXT: [[TMP8:%.*]] = load i32, ptr [[DOTOMP_COMB_LB]], align 4, !llvm.access.group [[ACC_GRP35]]
2664 // CHECK3-NEXT: [[TMP9:%.*]] = zext i32 [[TMP8]] to i64
2665 // CHECK3-NEXT: [[TMP10:%.*]] = load i32, ptr [[DOTOMP_COMB_UB]], align 4, !llvm.access.group [[ACC_GRP35]]
2666 // CHECK3-NEXT: [[TMP11:%.*]] = zext i32 [[TMP10]] to i64
2667 // CHECK3-NEXT: [[TMP12:%.*]] = load i8, ptr [[DOTCAPTURE_EXPR__ADDR]], align 1, !llvm.access.group [[ACC_GRP35]]
2668 // CHECK3-NEXT: [[TOBOOL2:%.*]] = trunc i8 [[TMP12]] to i1
2669 // CHECK3-NEXT: [[FROMBOOL:%.*]] = zext i1 [[TOBOOL2]] to i8
2670 // CHECK3-NEXT: store i8 [[FROMBOOL]], ptr [[DOTCAPTURE_EXPR__CASTED]], align 1, !llvm.access.group [[ACC_GRP35]]
2671 // CHECK3-NEXT: [[TMP13:%.*]] = load i64, ptr [[DOTCAPTURE_EXPR__CASTED]], align 8, !llvm.access.group [[ACC_GRP35]]
2672 // CHECK3-NEXT: [[TMP14:%.*]] = load i8, ptr [[DOTCAPTURE_EXPR__ADDR]], align 1, !llvm.access.group [[ACC_GRP35]]
2673 // CHECK3-NEXT: [[TOBOOL3:%.*]] = trunc i8 [[TMP14]] to i1
2674 // CHECK3-NEXT: br i1 [[TOBOOL3]], label [[OMP_IF_THEN4:%.*]], label [[OMP_IF_ELSE:%.*]]
2675 // CHECK3: omp_if.then4:
2676 // CHECK3-NEXT: call void (ptr, i32, ptr, ...) @__kmpc_fork_call(ptr @[[GLOB3]], i32 3, ptr @{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}_main_l92.omp_outlined.omp_outlined, i64 [[TMP9]], i64 [[TMP11]], i64 [[TMP13]]), !llvm.access.group [[ACC_GRP35]]
2677 // CHECK3-NEXT: br label [[OMP_IF_END:%.*]]
2678 // CHECK3: omp_if.else:
2679 // CHECK3-NEXT: call void @__kmpc_serialized_parallel(ptr @[[GLOB3]], i32 [[TMP1]]), !llvm.access.group [[ACC_GRP35]]
2680 // CHECK3-NEXT: [[TMP15:%.*]] = load ptr, ptr [[DOTGLOBAL_TID__ADDR]], align 8, !llvm.access.group [[ACC_GRP35]]
2681 // CHECK3-NEXT: store i32 0, ptr [[DOTBOUND_ZERO_ADDR]], align 4, !llvm.access.group [[ACC_GRP35]]
2682 // CHECK3-NEXT: call void @{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}_main_l92.omp_outlined.omp_outlined(ptr [[TMP15]], ptr [[DOTBOUND_ZERO_ADDR]], i64 [[TMP9]], i64 [[TMP11]], i64 [[TMP13]]) #[[ATTR3]], !llvm.access.group [[ACC_GRP35]]
2683 // CHECK3-NEXT: call void @__kmpc_end_serialized_parallel(ptr @[[GLOB3]], i32 [[TMP1]]), !llvm.access.group [[ACC_GRP35]]
2684 // CHECK3-NEXT: br label [[OMP_IF_END]]
2685 // CHECK3: omp_if.end:
2686 // CHECK3-NEXT: br label [[OMP_INNER_FOR_INC:%.*]]
2687 // CHECK3: omp.inner.for.inc:
2688 // CHECK3-NEXT: [[TMP16:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP35]]
2689 // CHECK3-NEXT: [[TMP17:%.*]] = load i32, ptr [[DOTOMP_STRIDE]], align 4, !llvm.access.group [[ACC_GRP35]]
2690 // CHECK3-NEXT: [[ADD:%.*]] = add nsw i32 [[TMP16]], [[TMP17]]
2691 // CHECK3-NEXT: store i32 [[ADD]], ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP35]]
2692 // CHECK3-NEXT: br label [[OMP_INNER_FOR_COND]], !llvm.loop [[LOOP36:![0-9]+]]
2693 // CHECK3: omp.inner.for.end:
2694 // CHECK3-NEXT: br label [[OMP_IF_END20:%.*]]
2695 // CHECK3: omp_if.else5:
2696 // CHECK3-NEXT: br label [[OMP_INNER_FOR_COND6:%.*]]
2697 // CHECK3: omp.inner.for.cond6:
2698 // CHECK3-NEXT: [[TMP18:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4
2699 // CHECK3-NEXT: [[TMP19:%.*]] = load i32, ptr [[DOTOMP_COMB_UB]], align 4
2700 // CHECK3-NEXT: [[CMP7:%.*]] = icmp sle i32 [[TMP18]], [[TMP19]]
2701 // CHECK3-NEXT: br i1 [[CMP7]], label [[OMP_INNER_FOR_BODY8:%.*]], label [[OMP_INNER_FOR_END19:%.*]]
2702 // CHECK3: omp.inner.for.body8:
2703 // CHECK3-NEXT: [[TMP20:%.*]] = load i32, ptr [[DOTOMP_COMB_LB]], align 4
2704 // CHECK3-NEXT: [[TMP21:%.*]] = zext i32 [[TMP20]] to i64
2705 // CHECK3-NEXT: [[TMP22:%.*]] = load i32, ptr [[DOTOMP_COMB_UB]], align 4
2706 // CHECK3-NEXT: [[TMP23:%.*]] = zext i32 [[TMP22]] to i64
2707 // CHECK3-NEXT: [[TMP24:%.*]] = load i8, ptr [[DOTCAPTURE_EXPR__ADDR]], align 1
2708 // CHECK3-NEXT: [[TOBOOL9:%.*]] = trunc i8 [[TMP24]] to i1
2709 // CHECK3-NEXT: [[FROMBOOL11:%.*]] = zext i1 [[TOBOOL9]] to i8
2710 // CHECK3-NEXT: store i8 [[FROMBOOL11]], ptr [[DOTCAPTURE_EXPR__CASTED10]], align 1
2711 // CHECK3-NEXT: [[TMP25:%.*]] = load i64, ptr [[DOTCAPTURE_EXPR__CASTED10]], align 8
2712 // CHECK3-NEXT: [[TMP26:%.*]] = load i8, ptr [[DOTCAPTURE_EXPR__ADDR]], align 1
2713 // CHECK3-NEXT: [[TOBOOL12:%.*]] = trunc i8 [[TMP26]] to i1
2714 // CHECK3-NEXT: br i1 [[TOBOOL12]], label [[OMP_IF_THEN13:%.*]], label [[OMP_IF_ELSE14:%.*]]
2715 // CHECK3: omp_if.then13:
2716 // CHECK3-NEXT: call void (ptr, i32, ptr, ...) @__kmpc_fork_call(ptr @[[GLOB3]], i32 3, ptr @{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}_main_l92.omp_outlined.omp_outlined.1, i64 [[TMP21]], i64 [[TMP23]], i64 [[TMP25]])
2717 // CHECK3-NEXT: br label [[OMP_IF_END16:%.*]]
2718 // CHECK3: omp_if.else14:
2719 // CHECK3-NEXT: call void @__kmpc_serialized_parallel(ptr @[[GLOB3]], i32 [[TMP1]])
2720 // CHECK3-NEXT: [[TMP27:%.*]] = load ptr, ptr [[DOTGLOBAL_TID__ADDR]], align 8
2721 // CHECK3-NEXT: store i32 0, ptr [[DOTBOUND_ZERO_ADDR15]], align 4
2722 // CHECK3-NEXT: call void @{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}_main_l92.omp_outlined.omp_outlined.1(ptr [[TMP27]], ptr [[DOTBOUND_ZERO_ADDR15]], i64 [[TMP21]], i64 [[TMP23]], i64 [[TMP25]]) #[[ATTR3]]
2723 // CHECK3-NEXT: call void @__kmpc_end_serialized_parallel(ptr @[[GLOB3]], i32 [[TMP1]])
2724 // CHECK3-NEXT: br label [[OMP_IF_END16]]
2725 // CHECK3: omp_if.end16:
2726 // CHECK3-NEXT: br label [[OMP_INNER_FOR_INC17:%.*]]
2727 // CHECK3: omp.inner.for.inc17:
2728 // CHECK3-NEXT: [[TMP28:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4
2729 // CHECK3-NEXT: [[TMP29:%.*]] = load i32, ptr [[DOTOMP_STRIDE]], align 4
2730 // CHECK3-NEXT: [[ADD18:%.*]] = add nsw i32 [[TMP28]], [[TMP29]]
2731 // CHECK3-NEXT: store i32 [[ADD18]], ptr [[DOTOMP_IV]], align 4
2732 // CHECK3-NEXT: br label [[OMP_INNER_FOR_COND6]], !llvm.loop [[LOOP38:![0-9]+]]
2733 // CHECK3: omp.inner.for.end19:
2734 // CHECK3-NEXT: br label [[OMP_IF_END20]]
2735 // CHECK3: omp_if.end20:
2736 // CHECK3-NEXT: br label [[OMP_LOOP_EXIT:%.*]]
2737 // CHECK3: omp.loop.exit:
2738 // CHECK3-NEXT: call void @__kmpc_for_static_fini(ptr @[[GLOB1]], i32 [[TMP1]])
2739 // CHECK3-NEXT: [[TMP30:%.*]] = load i32, ptr [[DOTOMP_IS_LAST]], align 4
2740 // CHECK3-NEXT: [[TMP31:%.*]] = icmp ne i32 [[TMP30]], 0
2741 // CHECK3-NEXT: br i1 [[TMP31]], label [[DOTOMP_FINAL_THEN:%.*]], label [[DOTOMP_FINAL_DONE:%.*]]
2742 // CHECK3: .omp.final.then:
2743 // CHECK3-NEXT: store i32 100, ptr [[I]], align 4
2744 // CHECK3-NEXT: br label [[DOTOMP_FINAL_DONE]]
2745 // CHECK3: .omp.final.done:
2746 // CHECK3-NEXT: ret void
2749 // CHECK3-LABEL: define {{[^@]+}}@{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}_main_l92.omp_outlined.omp_outlined
2750 // CHECK3-SAME: (ptr noalias noundef [[DOTGLOBAL_TID_:%.*]], ptr noalias noundef [[DOTBOUND_TID_:%.*]], i64 noundef [[DOTPREVIOUS_LB_:%.*]], i64 noundef [[DOTPREVIOUS_UB_:%.*]], i64 noundef [[DOTCAPTURE_EXPR_:%.*]]) #[[ATTR2]] {
2751 // CHECK3-NEXT: entry:
2752 // CHECK3-NEXT: [[DOTGLOBAL_TID__ADDR:%.*]] = alloca ptr, align 8
2753 // CHECK3-NEXT: [[DOTBOUND_TID__ADDR:%.*]] = alloca ptr, align 8
2754 // CHECK3-NEXT: [[DOTPREVIOUS_LB__ADDR:%.*]] = alloca i64, align 8
2755 // CHECK3-NEXT: [[DOTPREVIOUS_UB__ADDR:%.*]] = alloca i64, align 8
2756 // CHECK3-NEXT: [[DOTCAPTURE_EXPR__ADDR:%.*]] = alloca i64, align 8
2757 // CHECK3-NEXT: [[DOTOMP_IV:%.*]] = alloca i32, align 4
2758 // CHECK3-NEXT: [[TMP:%.*]] = alloca i32, align 4
2759 // CHECK3-NEXT: [[DOTOMP_LB:%.*]] = alloca i32, align 4
2760 // CHECK3-NEXT: [[DOTOMP_UB:%.*]] = alloca i32, align 4
2761 // CHECK3-NEXT: [[DOTOMP_STRIDE:%.*]] = alloca i32, align 4
2762 // CHECK3-NEXT: [[DOTOMP_IS_LAST:%.*]] = alloca i32, align 4
2763 // CHECK3-NEXT: [[I:%.*]] = alloca i32, align 4
2764 // CHECK3-NEXT: store ptr [[DOTGLOBAL_TID_]], ptr [[DOTGLOBAL_TID__ADDR]], align 8
2765 // CHECK3-NEXT: store ptr [[DOTBOUND_TID_]], ptr [[DOTBOUND_TID__ADDR]], align 8
2766 // CHECK3-NEXT: store i64 [[DOTPREVIOUS_LB_]], ptr [[DOTPREVIOUS_LB__ADDR]], align 8
2767 // CHECK3-NEXT: store i64 [[DOTPREVIOUS_UB_]], ptr [[DOTPREVIOUS_UB__ADDR]], align 8
2768 // CHECK3-NEXT: store i64 [[DOTCAPTURE_EXPR_]], ptr [[DOTCAPTURE_EXPR__ADDR]], align 8
2769 // CHECK3-NEXT: store i32 0, ptr [[DOTOMP_LB]], align 4
2770 // CHECK3-NEXT: store i32 99, ptr [[DOTOMP_UB]], align 4
2771 // CHECK3-NEXT: [[TMP0:%.*]] = load i64, ptr [[DOTPREVIOUS_LB__ADDR]], align 8
2772 // CHECK3-NEXT: [[CONV:%.*]] = trunc i64 [[TMP0]] to i32
2773 // CHECK3-NEXT: [[TMP1:%.*]] = load i64, ptr [[DOTPREVIOUS_UB__ADDR]], align 8
2774 // CHECK3-NEXT: [[CONV1:%.*]] = trunc i64 [[TMP1]] to i32
2775 // CHECK3-NEXT: store i32 [[CONV]], ptr [[DOTOMP_LB]], align 4
2776 // CHECK3-NEXT: store i32 [[CONV1]], ptr [[DOTOMP_UB]], align 4
2777 // CHECK3-NEXT: store i32 1, ptr [[DOTOMP_STRIDE]], align 4
2778 // CHECK3-NEXT: store i32 0, ptr [[DOTOMP_IS_LAST]], align 4
2779 // CHECK3-NEXT: [[TMP2:%.*]] = load i8, ptr [[DOTCAPTURE_EXPR__ADDR]], align 1
2780 // CHECK3-NEXT: [[TOBOOL:%.*]] = trunc i8 [[TMP2]] to i1
2781 // CHECK3-NEXT: br i1 [[TOBOOL]], label [[OMP_IF_THEN:%.*]], label [[OMP_IF_ELSE:%.*]]
2782 // CHECK3: omp_if.then:
2783 // CHECK3-NEXT: [[TMP3:%.*]] = load ptr, ptr [[DOTGLOBAL_TID__ADDR]], align 8
2784 // CHECK3-NEXT: [[TMP4:%.*]] = load i32, ptr [[TMP3]], align 4
2785 // 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)
2786 // CHECK3-NEXT: [[TMP5:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4
2787 // CHECK3-NEXT: [[CMP:%.*]] = icmp sgt i32 [[TMP5]], 99
2788 // CHECK3-NEXT: br i1 [[CMP]], label [[COND_TRUE:%.*]], label [[COND_FALSE:%.*]]
2789 // CHECK3: cond.true:
2790 // CHECK3-NEXT: br label [[COND_END:%.*]]
2791 // CHECK3: cond.false:
2792 // CHECK3-NEXT: [[TMP6:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4
2793 // CHECK3-NEXT: br label [[COND_END]]
2794 // CHECK3: cond.end:
2795 // CHECK3-NEXT: [[COND:%.*]] = phi i32 [ 99, [[COND_TRUE]] ], [ [[TMP6]], [[COND_FALSE]] ]
2796 // CHECK3-NEXT: store i32 [[COND]], ptr [[DOTOMP_UB]], align 4
2797 // CHECK3-NEXT: [[TMP7:%.*]] = load i32, ptr [[DOTOMP_LB]], align 4
2798 // CHECK3-NEXT: store i32 [[TMP7]], ptr [[DOTOMP_IV]], align 4
2799 // CHECK3-NEXT: br label [[OMP_INNER_FOR_COND:%.*]]
2800 // CHECK3: omp.inner.for.cond:
2801 // CHECK3-NEXT: [[TMP8:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP39:![0-9]+]]
2802 // CHECK3-NEXT: [[TMP9:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4, !llvm.access.group [[ACC_GRP39]]
2803 // CHECK3-NEXT: [[CMP2:%.*]] = icmp sle i32 [[TMP8]], [[TMP9]]
2804 // CHECK3-NEXT: br i1 [[CMP2]], label [[OMP_INNER_FOR_BODY:%.*]], label [[OMP_INNER_FOR_END:%.*]]
2805 // CHECK3: omp.inner.for.body:
2806 // CHECK3-NEXT: [[TMP10:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP39]]
2807 // CHECK3-NEXT: [[MUL:%.*]] = mul nsw i32 [[TMP10]], 1
2808 // CHECK3-NEXT: [[ADD:%.*]] = add nsw i32 0, [[MUL]]
2809 // CHECK3-NEXT: store i32 [[ADD]], ptr [[I]], align 4, !llvm.access.group [[ACC_GRP39]]
2810 // CHECK3-NEXT: call void @_Z3fn6v(), !llvm.access.group [[ACC_GRP39]]
2811 // CHECK3-NEXT: br label [[OMP_BODY_CONTINUE:%.*]]
2812 // CHECK3: omp.body.continue:
2813 // CHECK3-NEXT: br label [[OMP_INNER_FOR_INC:%.*]]
2814 // CHECK3: omp.inner.for.inc:
2815 // CHECK3-NEXT: [[TMP11:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP39]]
2816 // CHECK3-NEXT: [[ADD3:%.*]] = add nsw i32 [[TMP11]], 1
2817 // CHECK3-NEXT: store i32 [[ADD3]], ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP39]]
2818 // CHECK3-NEXT: br label [[OMP_INNER_FOR_COND]], !llvm.loop [[LOOP40:![0-9]+]]
2819 // CHECK3: omp.inner.for.end:
2820 // CHECK3-NEXT: br label [[OMP_IF_END:%.*]]
2821 // CHECK3: omp_if.else:
2822 // CHECK3-NEXT: [[TMP12:%.*]] = load ptr, ptr [[DOTGLOBAL_TID__ADDR]], align 8
2823 // CHECK3-NEXT: [[TMP13:%.*]] = load i32, ptr [[TMP12]], align 4
2824 // 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)
2825 // CHECK3-NEXT: [[TMP14:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4
2826 // CHECK3-NEXT: [[CMP4:%.*]] = icmp sgt i32 [[TMP14]], 99
2827 // CHECK3-NEXT: br i1 [[CMP4]], label [[COND_TRUE5:%.*]], label [[COND_FALSE6:%.*]]
2828 // CHECK3: cond.true5:
2829 // CHECK3-NEXT: br label [[COND_END7:%.*]]
2830 // CHECK3: cond.false6:
2831 // CHECK3-NEXT: [[TMP15:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4
2832 // CHECK3-NEXT: br label [[COND_END7]]
2833 // CHECK3: cond.end7:
2834 // CHECK3-NEXT: [[COND8:%.*]] = phi i32 [ 99, [[COND_TRUE5]] ], [ [[TMP15]], [[COND_FALSE6]] ]
2835 // CHECK3-NEXT: store i32 [[COND8]], ptr [[DOTOMP_UB]], align 4
2836 // CHECK3-NEXT: [[TMP16:%.*]] = load i32, ptr [[DOTOMP_LB]], align 4
2837 // CHECK3-NEXT: store i32 [[TMP16]], ptr [[DOTOMP_IV]], align 4
2838 // CHECK3-NEXT: br label [[OMP_INNER_FOR_COND9:%.*]]
2839 // CHECK3: omp.inner.for.cond9:
2840 // CHECK3-NEXT: [[TMP17:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4
2841 // CHECK3-NEXT: [[TMP18:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4
2842 // CHECK3-NEXT: [[CMP10:%.*]] = icmp sle i32 [[TMP17]], [[TMP18]]
2843 // CHECK3-NEXT: br i1 [[CMP10]], label [[OMP_INNER_FOR_BODY11:%.*]], label [[OMP_INNER_FOR_END17:%.*]]
2844 // CHECK3: omp.inner.for.body11:
2845 // CHECK3-NEXT: [[TMP19:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4
2846 // CHECK3-NEXT: [[MUL12:%.*]] = mul nsw i32 [[TMP19]], 1
2847 // CHECK3-NEXT: [[ADD13:%.*]] = add nsw i32 0, [[MUL12]]
2848 // CHECK3-NEXT: store i32 [[ADD13]], ptr [[I]], align 4
2849 // CHECK3-NEXT: call void @_Z3fn6v()
2850 // CHECK3-NEXT: br label [[OMP_BODY_CONTINUE14:%.*]]
2851 // CHECK3: omp.body.continue14:
2852 // CHECK3-NEXT: br label [[OMP_INNER_FOR_INC15:%.*]]
2853 // CHECK3: omp.inner.for.inc15:
2854 // CHECK3-NEXT: [[TMP20:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4
2855 // CHECK3-NEXT: [[ADD16:%.*]] = add nsw i32 [[TMP20]], 1
2856 // CHECK3-NEXT: store i32 [[ADD16]], ptr [[DOTOMP_IV]], align 4
2857 // CHECK3-NEXT: br label [[OMP_INNER_FOR_COND9]], !llvm.loop [[LOOP42:![0-9]+]]
2858 // CHECK3: omp.inner.for.end17:
2859 // CHECK3-NEXT: br label [[OMP_IF_END]]
2860 // CHECK3: omp_if.end:
2861 // CHECK3-NEXT: br label [[OMP_LOOP_EXIT:%.*]]
2862 // CHECK3: omp.loop.exit:
2863 // CHECK3-NEXT: [[TMP21:%.*]] = load ptr, ptr [[DOTGLOBAL_TID__ADDR]], align 8
2864 // CHECK3-NEXT: [[TMP22:%.*]] = load i32, ptr [[TMP21]], align 4
2865 // CHECK3-NEXT: call void @__kmpc_for_static_fini(ptr @[[GLOB1]], i32 [[TMP22]])
2866 // CHECK3-NEXT: [[TMP23:%.*]] = load i32, ptr [[DOTOMP_IS_LAST]], align 4
2867 // CHECK3-NEXT: [[TMP24:%.*]] = icmp ne i32 [[TMP23]], 0
2868 // CHECK3-NEXT: br i1 [[TMP24]], label [[DOTOMP_FINAL_THEN:%.*]], label [[DOTOMP_FINAL_DONE:%.*]]
2869 // CHECK3: .omp.final.then:
2870 // CHECK3-NEXT: store i32 100, ptr [[I]], align 4
2871 // CHECK3-NEXT: br label [[DOTOMP_FINAL_DONE]]
2872 // CHECK3: .omp.final.done:
2873 // CHECK3-NEXT: ret void
2876 // CHECK3-LABEL: define {{[^@]+}}@{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}_main_l92.omp_outlined.omp_outlined.1
2877 // CHECK3-SAME: (ptr noalias noundef [[DOTGLOBAL_TID_:%.*]], ptr noalias noundef [[DOTBOUND_TID_:%.*]], i64 noundef [[DOTPREVIOUS_LB_:%.*]], i64 noundef [[DOTPREVIOUS_UB_:%.*]], i64 noundef [[DOTCAPTURE_EXPR_:%.*]]) #[[ATTR2]] {
2878 // CHECK3-NEXT: entry:
2879 // CHECK3-NEXT: [[DOTGLOBAL_TID__ADDR:%.*]] = alloca ptr, align 8
2880 // CHECK3-NEXT: [[DOTBOUND_TID__ADDR:%.*]] = alloca ptr, align 8
2881 // CHECK3-NEXT: [[DOTPREVIOUS_LB__ADDR:%.*]] = alloca i64, align 8
2882 // CHECK3-NEXT: [[DOTPREVIOUS_UB__ADDR:%.*]] = alloca i64, align 8
2883 // CHECK3-NEXT: [[DOTCAPTURE_EXPR__ADDR:%.*]] = alloca i64, align 8
2884 // CHECK3-NEXT: [[DOTOMP_IV:%.*]] = alloca i32, align 4
2885 // CHECK3-NEXT: [[TMP:%.*]] = alloca i32, align 4
2886 // CHECK3-NEXT: [[DOTOMP_LB:%.*]] = alloca i32, align 4
2887 // CHECK3-NEXT: [[DOTOMP_UB:%.*]] = alloca i32, align 4
2888 // CHECK3-NEXT: [[DOTOMP_STRIDE:%.*]] = alloca i32, align 4
2889 // CHECK3-NEXT: [[DOTOMP_IS_LAST:%.*]] = alloca i32, align 4
2890 // CHECK3-NEXT: [[I:%.*]] = alloca i32, align 4
2891 // CHECK3-NEXT: store ptr [[DOTGLOBAL_TID_]], ptr [[DOTGLOBAL_TID__ADDR]], align 8
2892 // CHECK3-NEXT: store ptr [[DOTBOUND_TID_]], ptr [[DOTBOUND_TID__ADDR]], align 8
2893 // CHECK3-NEXT: store i64 [[DOTPREVIOUS_LB_]], ptr [[DOTPREVIOUS_LB__ADDR]], align 8
2894 // CHECK3-NEXT: store i64 [[DOTPREVIOUS_UB_]], ptr [[DOTPREVIOUS_UB__ADDR]], align 8
2895 // CHECK3-NEXT: store i64 [[DOTCAPTURE_EXPR_]], ptr [[DOTCAPTURE_EXPR__ADDR]], align 8
2896 // CHECK3-NEXT: store i32 0, ptr [[DOTOMP_LB]], align 4
2897 // CHECK3-NEXT: store i32 99, ptr [[DOTOMP_UB]], align 4
2898 // CHECK3-NEXT: [[TMP0:%.*]] = load i64, ptr [[DOTPREVIOUS_LB__ADDR]], align 8
2899 // CHECK3-NEXT: [[CONV:%.*]] = trunc i64 [[TMP0]] to i32
2900 // CHECK3-NEXT: [[TMP1:%.*]] = load i64, ptr [[DOTPREVIOUS_UB__ADDR]], align 8
2901 // CHECK3-NEXT: [[CONV1:%.*]] = trunc i64 [[TMP1]] to i32
2902 // CHECK3-NEXT: store i32 [[CONV]], ptr [[DOTOMP_LB]], align 4
2903 // CHECK3-NEXT: store i32 [[CONV1]], ptr [[DOTOMP_UB]], align 4
2904 // CHECK3-NEXT: store i32 1, ptr [[DOTOMP_STRIDE]], align 4
2905 // CHECK3-NEXT: store i32 0, ptr [[DOTOMP_IS_LAST]], align 4
2906 // CHECK3-NEXT: [[TMP2:%.*]] = load i8, ptr [[DOTCAPTURE_EXPR__ADDR]], align 1
2907 // CHECK3-NEXT: [[TOBOOL:%.*]] = trunc i8 [[TMP2]] to i1
2908 // CHECK3-NEXT: br i1 [[TOBOOL]], label [[OMP_IF_THEN:%.*]], label [[OMP_IF_ELSE:%.*]]
2909 // CHECK3: omp_if.then:
2910 // CHECK3-NEXT: [[TMP3:%.*]] = load ptr, ptr [[DOTGLOBAL_TID__ADDR]], align 8
2911 // CHECK3-NEXT: [[TMP4:%.*]] = load i32, ptr [[TMP3]], align 4
2912 // 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)
2913 // CHECK3-NEXT: [[TMP5:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4
2914 // CHECK3-NEXT: [[CMP:%.*]] = icmp sgt i32 [[TMP5]], 99
2915 // CHECK3-NEXT: br i1 [[CMP]], label [[COND_TRUE:%.*]], label [[COND_FALSE:%.*]]
2916 // CHECK3: cond.true:
2917 // CHECK3-NEXT: br label [[COND_END:%.*]]
2918 // CHECK3: cond.false:
2919 // CHECK3-NEXT: [[TMP6:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4
2920 // CHECK3-NEXT: br label [[COND_END]]
2921 // CHECK3: cond.end:
2922 // CHECK3-NEXT: [[COND:%.*]] = phi i32 [ 99, [[COND_TRUE]] ], [ [[TMP6]], [[COND_FALSE]] ]
2923 // CHECK3-NEXT: store i32 [[COND]], ptr [[DOTOMP_UB]], align 4
2924 // CHECK3-NEXT: [[TMP7:%.*]] = load i32, ptr [[DOTOMP_LB]], align 4
2925 // CHECK3-NEXT: store i32 [[TMP7]], ptr [[DOTOMP_IV]], align 4
2926 // CHECK3-NEXT: br label [[OMP_INNER_FOR_COND:%.*]]
2927 // CHECK3: omp.inner.for.cond:
2928 // CHECK3-NEXT: [[TMP8:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP43:![0-9]+]]
2929 // CHECK3-NEXT: [[TMP9:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4, !llvm.access.group [[ACC_GRP43]]
2930 // CHECK3-NEXT: [[CMP2:%.*]] = icmp sle i32 [[TMP8]], [[TMP9]]
2931 // CHECK3-NEXT: br i1 [[CMP2]], label [[OMP_INNER_FOR_BODY:%.*]], label [[OMP_INNER_FOR_END:%.*]]
2932 // CHECK3: omp.inner.for.body:
2933 // CHECK3-NEXT: [[TMP10:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP43]]
2934 // CHECK3-NEXT: [[MUL:%.*]] = mul nsw i32 [[TMP10]], 1
2935 // CHECK3-NEXT: [[ADD:%.*]] = add nsw i32 0, [[MUL]]
2936 // CHECK3-NEXT: store i32 [[ADD]], ptr [[I]], align 4, !llvm.access.group [[ACC_GRP43]]
2937 // CHECK3-NEXT: call void @_Z3fn6v(), !llvm.access.group [[ACC_GRP43]]
2938 // CHECK3-NEXT: br label [[OMP_BODY_CONTINUE:%.*]]
2939 // CHECK3: omp.body.continue:
2940 // CHECK3-NEXT: br label [[OMP_INNER_FOR_INC:%.*]]
2941 // CHECK3: omp.inner.for.inc:
2942 // CHECK3-NEXT: [[TMP11:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP43]]
2943 // CHECK3-NEXT: [[ADD3:%.*]] = add nsw i32 [[TMP11]], 1
2944 // CHECK3-NEXT: store i32 [[ADD3]], ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP43]]
2945 // CHECK3-NEXT: br label [[OMP_INNER_FOR_COND]], !llvm.loop [[LOOP44:![0-9]+]]
2946 // CHECK3: omp.inner.for.end:
2947 // CHECK3-NEXT: br label [[OMP_IF_END:%.*]]
2948 // CHECK3: omp_if.else:
2949 // CHECK3-NEXT: [[TMP12:%.*]] = load ptr, ptr [[DOTGLOBAL_TID__ADDR]], align 8
2950 // CHECK3-NEXT: [[TMP13:%.*]] = load i32, ptr [[TMP12]], align 4
2951 // 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)
2952 // CHECK3-NEXT: [[TMP14:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4
2953 // CHECK3-NEXT: [[CMP4:%.*]] = icmp sgt i32 [[TMP14]], 99
2954 // CHECK3-NEXT: br i1 [[CMP4]], label [[COND_TRUE5:%.*]], label [[COND_FALSE6:%.*]]
2955 // CHECK3: cond.true5:
2956 // CHECK3-NEXT: br label [[COND_END7:%.*]]
2957 // CHECK3: cond.false6:
2958 // CHECK3-NEXT: [[TMP15:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4
2959 // CHECK3-NEXT: br label [[COND_END7]]
2960 // CHECK3: cond.end7:
2961 // CHECK3-NEXT: [[COND8:%.*]] = phi i32 [ 99, [[COND_TRUE5]] ], [ [[TMP15]], [[COND_FALSE6]] ]
2962 // CHECK3-NEXT: store i32 [[COND8]], ptr [[DOTOMP_UB]], align 4
2963 // CHECK3-NEXT: [[TMP16:%.*]] = load i32, ptr [[DOTOMP_LB]], align 4
2964 // CHECK3-NEXT: store i32 [[TMP16]], ptr [[DOTOMP_IV]], align 4
2965 // CHECK3-NEXT: br label [[OMP_INNER_FOR_COND9:%.*]]
2966 // CHECK3: omp.inner.for.cond9:
2967 // CHECK3-NEXT: [[TMP17:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4
2968 // CHECK3-NEXT: [[TMP18:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4
2969 // CHECK3-NEXT: [[CMP10:%.*]] = icmp sle i32 [[TMP17]], [[TMP18]]
2970 // CHECK3-NEXT: br i1 [[CMP10]], label [[OMP_INNER_FOR_BODY11:%.*]], label [[OMP_INNER_FOR_END17:%.*]]
2971 // CHECK3: omp.inner.for.body11:
2972 // CHECK3-NEXT: [[TMP19:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4
2973 // CHECK3-NEXT: [[MUL12:%.*]] = mul nsw i32 [[TMP19]], 1
2974 // CHECK3-NEXT: [[ADD13:%.*]] = add nsw i32 0, [[MUL12]]
2975 // CHECK3-NEXT: store i32 [[ADD13]], ptr [[I]], align 4
2976 // CHECK3-NEXT: call void @_Z3fn6v()
2977 // CHECK3-NEXT: br label [[OMP_BODY_CONTINUE14:%.*]]
2978 // CHECK3: omp.body.continue14:
2979 // CHECK3-NEXT: br label [[OMP_INNER_FOR_INC15:%.*]]
2980 // CHECK3: omp.inner.for.inc15:
2981 // CHECK3-NEXT: [[TMP20:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4
2982 // CHECK3-NEXT: [[ADD16:%.*]] = add nsw i32 [[TMP20]], 1
2983 // CHECK3-NEXT: store i32 [[ADD16]], ptr [[DOTOMP_IV]], align 4
2984 // CHECK3-NEXT: br label [[OMP_INNER_FOR_COND9]], !llvm.loop [[LOOP46:![0-9]+]]
2985 // CHECK3: omp.inner.for.end17:
2986 // CHECK3-NEXT: br label [[OMP_IF_END]]
2987 // CHECK3: omp_if.end:
2988 // CHECK3-NEXT: br label [[OMP_LOOP_EXIT:%.*]]
2989 // CHECK3: omp.loop.exit:
2990 // CHECK3-NEXT: [[TMP21:%.*]] = load ptr, ptr [[DOTGLOBAL_TID__ADDR]], align 8
2991 // CHECK3-NEXT: [[TMP22:%.*]] = load i32, ptr [[TMP21]], align 4
2992 // CHECK3-NEXT: call void @__kmpc_for_static_fini(ptr @[[GLOB1]], i32 [[TMP22]])
2993 // CHECK3-NEXT: [[TMP23:%.*]] = load i32, ptr [[DOTOMP_IS_LAST]], align 4
2994 // CHECK3-NEXT: [[TMP24:%.*]] = icmp ne i32 [[TMP23]], 0
2995 // CHECK3-NEXT: br i1 [[TMP24]], label [[DOTOMP_FINAL_THEN:%.*]], label [[DOTOMP_FINAL_DONE:%.*]]
2996 // CHECK3: .omp.final.then:
2997 // CHECK3-NEXT: store i32 100, ptr [[I]], align 4
2998 // CHECK3-NEXT: br label [[DOTOMP_FINAL_DONE]]
2999 // CHECK3: .omp.final.done:
3000 // CHECK3-NEXT: ret void
3003 // CHECK3-LABEL: define {{[^@]+}}@_Z5tmainIiEiT_
3004 // CHECK3-SAME: (i32 noundef [[ARG:%.*]]) #[[ATTR0]] comdat {
3005 // CHECK3-NEXT: entry:
3006 // CHECK3-NEXT: [[ARG_ADDR:%.*]] = alloca i32, align 4
3007 // CHECK3-NEXT: [[TMP:%.*]] = alloca i32, align 4
3008 // CHECK3-NEXT: [[KERNEL_ARGS:%.*]] = alloca [[STRUCT___TGT_KERNEL_ARGUMENTS:%.*]], align 8
3009 // CHECK3-NEXT: [[_TMP1:%.*]] = alloca i32, align 4
3010 // CHECK3-NEXT: [[KERNEL_ARGS2:%.*]] = alloca [[STRUCT___TGT_KERNEL_ARGUMENTS]], align 8
3011 // CHECK3-NEXT: [[ARG_CASTED:%.*]] = alloca i64, align 8
3012 // CHECK3-NEXT: [[DOTOFFLOAD_BASEPTRS:%.*]] = alloca [1 x ptr], align 8
3013 // CHECK3-NEXT: [[DOTOFFLOAD_PTRS:%.*]] = alloca [1 x ptr], align 8
3014 // CHECK3-NEXT: [[DOTOFFLOAD_MAPPERS:%.*]] = alloca [1 x ptr], align 8
3015 // CHECK3-NEXT: [[DOTCAPTURE_EXPR_:%.*]] = alloca i8, align 1
3016 // CHECK3-NEXT: [[_TMP6:%.*]] = alloca i32, align 4
3017 // CHECK3-NEXT: [[KERNEL_ARGS7:%.*]] = alloca [[STRUCT___TGT_KERNEL_ARGUMENTS]], align 8
3018 // CHECK3-NEXT: store i32 [[ARG]], ptr [[ARG_ADDR]], align 4
3019 // CHECK3-NEXT: [[TMP0:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 0
3020 // CHECK3-NEXT: store i32 2, ptr [[TMP0]], align 4
3021 // CHECK3-NEXT: [[TMP1:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 1
3022 // CHECK3-NEXT: store i32 0, ptr [[TMP1]], align 4
3023 // CHECK3-NEXT: [[TMP2:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 2
3024 // CHECK3-NEXT: store ptr null, ptr [[TMP2]], align 8
3025 // CHECK3-NEXT: [[TMP3:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 3
3026 // CHECK3-NEXT: store ptr null, ptr [[TMP3]], align 8
3027 // CHECK3-NEXT: [[TMP4:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 4
3028 // CHECK3-NEXT: store ptr null, ptr [[TMP4]], align 8
3029 // CHECK3-NEXT: [[TMP5:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 5
3030 // CHECK3-NEXT: store ptr null, ptr [[TMP5]], align 8
3031 // CHECK3-NEXT: [[TMP6:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 6
3032 // CHECK3-NEXT: store ptr null, ptr [[TMP6]], align 8
3033 // CHECK3-NEXT: [[TMP7:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 7
3034 // CHECK3-NEXT: store ptr null, ptr [[TMP7]], align 8
3035 // CHECK3-NEXT: [[TMP8:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 8
3036 // CHECK3-NEXT: store i64 100, ptr [[TMP8]], align 8
3037 // CHECK3-NEXT: [[TMP9:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 9
3038 // CHECK3-NEXT: store i64 0, ptr [[TMP9]], align 8
3039 // CHECK3-NEXT: [[TMP10:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 10
3040 // CHECK3-NEXT: store [3 x i32] zeroinitializer, ptr [[TMP10]], align 4
3041 // CHECK3-NEXT: [[TMP11:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 11
3042 // CHECK3-NEXT: store [3 x i32] zeroinitializer, ptr [[TMP11]], align 4
3043 // CHECK3-NEXT: [[TMP12:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 12
3044 // CHECK3-NEXT: store i32 0, ptr [[TMP12]], align 4
3045 // 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__l57.region_id, ptr [[KERNEL_ARGS]])
3046 // CHECK3-NEXT: [[TMP14:%.*]] = icmp ne i32 [[TMP13]], 0
3047 // CHECK3-NEXT: br i1 [[TMP14]], label [[OMP_OFFLOAD_FAILED:%.*]], label [[OMP_OFFLOAD_CONT:%.*]]
3048 // CHECK3: omp_offload.failed:
3049 // CHECK3-NEXT: call void @{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z5tmainIiEiT__l57() #[[ATTR3]]
3050 // CHECK3-NEXT: br label [[OMP_OFFLOAD_CONT]]
3051 // CHECK3: omp_offload.cont:
3052 // CHECK3-NEXT: [[TMP15:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS2]], i32 0, i32 0
3053 // CHECK3-NEXT: store i32 2, ptr [[TMP15]], align 4
3054 // CHECK3-NEXT: [[TMP16:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS2]], i32 0, i32 1
3055 // CHECK3-NEXT: store i32 0, ptr [[TMP16]], align 4
3056 // CHECK3-NEXT: [[TMP17:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS2]], i32 0, i32 2
3057 // CHECK3-NEXT: store ptr null, ptr [[TMP17]], align 8
3058 // CHECK3-NEXT: [[TMP18:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS2]], i32 0, i32 3
3059 // CHECK3-NEXT: store ptr null, ptr [[TMP18]], align 8
3060 // CHECK3-NEXT: [[TMP19:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS2]], i32 0, i32 4
3061 // CHECK3-NEXT: store ptr null, ptr [[TMP19]], align 8
3062 // CHECK3-NEXT: [[TMP20:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS2]], i32 0, i32 5
3063 // CHECK3-NEXT: store ptr null, ptr [[TMP20]], align 8
3064 // CHECK3-NEXT: [[TMP21:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS2]], i32 0, i32 6
3065 // CHECK3-NEXT: store ptr null, ptr [[TMP21]], align 8
3066 // CHECK3-NEXT: [[TMP22:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS2]], i32 0, i32 7
3067 // CHECK3-NEXT: store ptr null, ptr [[TMP22]], align 8
3068 // CHECK3-NEXT: [[TMP23:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS2]], i32 0, i32 8
3069 // CHECK3-NEXT: store i64 100, ptr [[TMP23]], align 8
3070 // CHECK3-NEXT: [[TMP24:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS2]], i32 0, i32 9
3071 // CHECK3-NEXT: store i64 0, ptr [[TMP24]], align 8
3072 // CHECK3-NEXT: [[TMP25:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS2]], i32 0, i32 10
3073 // CHECK3-NEXT: store [3 x i32] zeroinitializer, ptr [[TMP25]], align 4
3074 // CHECK3-NEXT: [[TMP26:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS2]], i32 0, i32 11
3075 // CHECK3-NEXT: store [3 x i32] [i32 1, i32 0, i32 0], ptr [[TMP26]], align 4
3076 // CHECK3-NEXT: [[TMP27:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS2]], i32 0, i32 12
3077 // CHECK3-NEXT: store i32 0, ptr [[TMP27]], align 4
3078 // CHECK3-NEXT: [[TMP28:%.*]] = call i32 @__tgt_target_kernel(ptr @[[GLOB3]], i64 -1, i32 0, i32 1, ptr @.{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z5tmainIiEiT__l62.region_id, ptr [[KERNEL_ARGS2]])
3079 // CHECK3-NEXT: [[TMP29:%.*]] = icmp ne i32 [[TMP28]], 0
3080 // CHECK3-NEXT: br i1 [[TMP29]], label [[OMP_OFFLOAD_FAILED3:%.*]], label [[OMP_OFFLOAD_CONT4:%.*]]
3081 // CHECK3: omp_offload.failed3:
3082 // CHECK3-NEXT: call void @{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z5tmainIiEiT__l62() #[[ATTR3]]
3083 // CHECK3-NEXT: br label [[OMP_OFFLOAD_CONT4]]
3084 // CHECK3: omp_offload.cont4:
3085 // CHECK3-NEXT: [[TMP30:%.*]] = load i32, ptr [[ARG_ADDR]], align 4
3086 // CHECK3-NEXT: store i32 [[TMP30]], ptr [[ARG_CASTED]], align 4
3087 // CHECK3-NEXT: [[TMP31:%.*]] = load i64, ptr [[ARG_CASTED]], align 8
3088 // CHECK3-NEXT: [[TMP32:%.*]] = getelementptr inbounds [1 x ptr], ptr [[DOTOFFLOAD_BASEPTRS]], i32 0, i32 0
3089 // CHECK3-NEXT: store i64 [[TMP31]], ptr [[TMP32]], align 8
3090 // CHECK3-NEXT: [[TMP33:%.*]] = getelementptr inbounds [1 x ptr], ptr [[DOTOFFLOAD_PTRS]], i32 0, i32 0
3091 // CHECK3-NEXT: store i64 [[TMP31]], ptr [[TMP33]], align 8
3092 // CHECK3-NEXT: [[TMP34:%.*]] = getelementptr inbounds [1 x ptr], ptr [[DOTOFFLOAD_MAPPERS]], i64 0, i64 0
3093 // CHECK3-NEXT: store ptr null, ptr [[TMP34]], align 8
3094 // CHECK3-NEXT: [[TMP35:%.*]] = getelementptr inbounds [1 x ptr], ptr [[DOTOFFLOAD_BASEPTRS]], i32 0, i32 0
3095 // CHECK3-NEXT: [[TMP36:%.*]] = getelementptr inbounds [1 x ptr], ptr [[DOTOFFLOAD_PTRS]], i32 0, i32 0
3096 // CHECK3-NEXT: [[TMP37:%.*]] = load i32, ptr [[ARG_ADDR]], align 4
3097 // CHECK3-NEXT: [[TOBOOL:%.*]] = icmp ne i32 [[TMP37]], 0
3098 // CHECK3-NEXT: [[FROMBOOL:%.*]] = zext i1 [[TOBOOL]] to i8
3099 // CHECK3-NEXT: store i8 [[FROMBOOL]], ptr [[DOTCAPTURE_EXPR_]], align 1
3100 // CHECK3-NEXT: [[TMP38:%.*]] = load i8, ptr [[DOTCAPTURE_EXPR_]], align 1
3101 // CHECK3-NEXT: [[TOBOOL5:%.*]] = trunc i8 [[TMP38]] to i1
3102 // CHECK3-NEXT: [[TMP39:%.*]] = select i1 [[TOBOOL5]], i32 0, i32 1
3103 // CHECK3-NEXT: [[TMP40:%.*]] = insertvalue [3 x i32] zeroinitializer, i32 [[TMP39]], 0
3104 // CHECK3-NEXT: [[TMP41:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS7]], i32 0, i32 0
3105 // CHECK3-NEXT: store i32 2, ptr [[TMP41]], align 4
3106 // CHECK3-NEXT: [[TMP42:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS7]], i32 0, i32 1
3107 // CHECK3-NEXT: store i32 1, ptr [[TMP42]], align 4
3108 // CHECK3-NEXT: [[TMP43:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS7]], i32 0, i32 2
3109 // CHECK3-NEXT: store ptr [[TMP35]], ptr [[TMP43]], align 8
3110 // CHECK3-NEXT: [[TMP44:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS7]], i32 0, i32 3
3111 // CHECK3-NEXT: store ptr [[TMP36]], ptr [[TMP44]], align 8
3112 // CHECK3-NEXT: [[TMP45:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS7]], i32 0, i32 4
3113 // CHECK3-NEXT: store ptr @.offload_sizes.2, ptr [[TMP45]], align 8
3114 // CHECK3-NEXT: [[TMP46:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS7]], i32 0, i32 5
3115 // CHECK3-NEXT: store ptr @.offload_maptypes.3, ptr [[TMP46]], align 8
3116 // CHECK3-NEXT: [[TMP47:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS7]], i32 0, i32 6
3117 // CHECK3-NEXT: store ptr null, ptr [[TMP47]], align 8
3118 // CHECK3-NEXT: [[TMP48:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS7]], i32 0, i32 7
3119 // CHECK3-NEXT: store ptr null, ptr [[TMP48]], align 8
3120 // CHECK3-NEXT: [[TMP49:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS7]], i32 0, i32 8
3121 // CHECK3-NEXT: store i64 100, ptr [[TMP49]], align 8
3122 // CHECK3-NEXT: [[TMP50:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS7]], i32 0, i32 9
3123 // CHECK3-NEXT: store i64 0, ptr [[TMP50]], align 8
3124 // CHECK3-NEXT: [[TMP51:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS7]], i32 0, i32 10
3125 // CHECK3-NEXT: store [3 x i32] zeroinitializer, ptr [[TMP51]], align 4
3126 // CHECK3-NEXT: [[TMP52:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS7]], i32 0, i32 11
3127 // CHECK3-NEXT: store [3 x i32] [[TMP40]], ptr [[TMP52]], align 4
3128 // CHECK3-NEXT: [[TMP53:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS7]], i32 0, i32 12
3129 // CHECK3-NEXT: store i32 0, ptr [[TMP53]], align 4
3130 // CHECK3-NEXT: [[TMP54:%.*]] = call i32 @__tgt_target_kernel(ptr @[[GLOB3]], i64 -1, i32 0, i32 [[TMP39]], ptr @.{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z5tmainIiEiT__l67.region_id, ptr [[KERNEL_ARGS7]])
3131 // CHECK3-NEXT: [[TMP55:%.*]] = icmp ne i32 [[TMP54]], 0
3132 // CHECK3-NEXT: br i1 [[TMP55]], label [[OMP_OFFLOAD_FAILED8:%.*]], label [[OMP_OFFLOAD_CONT9:%.*]]
3133 // CHECK3: omp_offload.failed8:
3134 // CHECK3-NEXT: call void @{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z5tmainIiEiT__l67(i64 [[TMP31]]) #[[ATTR3]]
3135 // CHECK3-NEXT: br label [[OMP_OFFLOAD_CONT9]]
3136 // CHECK3: omp_offload.cont9:
3137 // CHECK3-NEXT: ret i32 0
3140 // CHECK3-LABEL: define {{[^@]+}}@{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z5tmainIiEiT__l57
3141 // CHECK3-SAME: () #[[ATTR1]] {
3142 // CHECK3-NEXT: entry:
3143 // CHECK3-NEXT: call void (ptr, i32, ptr, ...) @__kmpc_fork_teams(ptr @[[GLOB3]], i32 0, ptr @{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z5tmainIiEiT__l57.omp_outlined)
3144 // CHECK3-NEXT: ret void
3147 // CHECK3-LABEL: define {{[^@]+}}@{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z5tmainIiEiT__l57.omp_outlined
3148 // CHECK3-SAME: (ptr noalias noundef [[DOTGLOBAL_TID_:%.*]], ptr noalias noundef [[DOTBOUND_TID_:%.*]]) #[[ATTR2]] {
3149 // CHECK3-NEXT: entry:
3150 // CHECK3-NEXT: [[DOTGLOBAL_TID__ADDR:%.*]] = alloca ptr, align 8
3151 // CHECK3-NEXT: [[DOTBOUND_TID__ADDR:%.*]] = alloca ptr, align 8
3152 // CHECK3-NEXT: [[DOTOMP_IV:%.*]] = alloca i32, align 4
3153 // CHECK3-NEXT: [[TMP:%.*]] = alloca i32, align 4
3154 // CHECK3-NEXT: [[DOTOMP_COMB_LB:%.*]] = alloca i32, align 4
3155 // CHECK3-NEXT: [[DOTOMP_COMB_UB:%.*]] = alloca i32, align 4
3156 // CHECK3-NEXT: [[DOTOMP_STRIDE:%.*]] = alloca i32, align 4
3157 // CHECK3-NEXT: [[DOTOMP_IS_LAST:%.*]] = alloca i32, align 4
3158 // CHECK3-NEXT: [[I:%.*]] = alloca i32, align 4
3159 // CHECK3-NEXT: store ptr [[DOTGLOBAL_TID_]], ptr [[DOTGLOBAL_TID__ADDR]], align 8
3160 // CHECK3-NEXT: store ptr [[DOTBOUND_TID_]], ptr [[DOTBOUND_TID__ADDR]], align 8
3161 // CHECK3-NEXT: store i32 0, ptr [[DOTOMP_COMB_LB]], align 4
3162 // CHECK3-NEXT: store i32 99, ptr [[DOTOMP_COMB_UB]], align 4
3163 // CHECK3-NEXT: store i32 1, ptr [[DOTOMP_STRIDE]], align 4
3164 // CHECK3-NEXT: store i32 0, ptr [[DOTOMP_IS_LAST]], align 4
3165 // CHECK3-NEXT: [[TMP0:%.*]] = load ptr, ptr [[DOTGLOBAL_TID__ADDR]], align 8
3166 // CHECK3-NEXT: [[TMP1:%.*]] = load i32, ptr [[TMP0]], align 4
3167 // 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)
3168 // CHECK3-NEXT: [[TMP2:%.*]] = load i32, ptr [[DOTOMP_COMB_UB]], align 4
3169 // CHECK3-NEXT: [[CMP:%.*]] = icmp sgt i32 [[TMP2]], 99
3170 // CHECK3-NEXT: br i1 [[CMP]], label [[COND_TRUE:%.*]], label [[COND_FALSE:%.*]]
3171 // CHECK3: cond.true:
3172 // CHECK3-NEXT: br label [[COND_END:%.*]]
3173 // CHECK3: cond.false:
3174 // CHECK3-NEXT: [[TMP3:%.*]] = load i32, ptr [[DOTOMP_COMB_UB]], align 4
3175 // CHECK3-NEXT: br label [[COND_END]]
3176 // CHECK3: cond.end:
3177 // CHECK3-NEXT: [[COND:%.*]] = phi i32 [ 99, [[COND_TRUE]] ], [ [[TMP3]], [[COND_FALSE]] ]
3178 // CHECK3-NEXT: store i32 [[COND]], ptr [[DOTOMP_COMB_UB]], align 4
3179 // CHECK3-NEXT: [[TMP4:%.*]] = load i32, ptr [[DOTOMP_COMB_LB]], align 4
3180 // CHECK3-NEXT: store i32 [[TMP4]], ptr [[DOTOMP_IV]], align 4
3181 // CHECK3-NEXT: br label [[OMP_INNER_FOR_COND:%.*]]
3182 // CHECK3: omp.inner.for.cond:
3183 // CHECK3-NEXT: [[TMP5:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP47:![0-9]+]]
3184 // CHECK3-NEXT: [[TMP6:%.*]] = load i32, ptr [[DOTOMP_COMB_UB]], align 4, !llvm.access.group [[ACC_GRP47]]
3185 // CHECK3-NEXT: [[CMP1:%.*]] = icmp sle i32 [[TMP5]], [[TMP6]]
3186 // CHECK3-NEXT: br i1 [[CMP1]], label [[OMP_INNER_FOR_BODY:%.*]], label [[OMP_INNER_FOR_END:%.*]]
3187 // CHECK3: omp.inner.for.body:
3188 // CHECK3-NEXT: [[TMP7:%.*]] = load i32, ptr [[DOTOMP_COMB_LB]], align 4, !llvm.access.group [[ACC_GRP47]]
3189 // CHECK3-NEXT: [[TMP8:%.*]] = zext i32 [[TMP7]] to i64
3190 // CHECK3-NEXT: [[TMP9:%.*]] = load i32, ptr [[DOTOMP_COMB_UB]], align 4, !llvm.access.group [[ACC_GRP47]]
3191 // CHECK3-NEXT: [[TMP10:%.*]] = zext i32 [[TMP9]] to i64
3192 // CHECK3-NEXT: call void (ptr, i32, ptr, ...) @__kmpc_fork_call(ptr @[[GLOB3]], i32 2, ptr @{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z5tmainIiEiT__l57.omp_outlined.omp_outlined, i64 [[TMP8]], i64 [[TMP10]]), !llvm.access.group [[ACC_GRP47]]
3193 // CHECK3-NEXT: br label [[OMP_INNER_FOR_INC:%.*]]
3194 // CHECK3: omp.inner.for.inc:
3195 // CHECK3-NEXT: [[TMP11:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP47]]
3196 // CHECK3-NEXT: [[TMP12:%.*]] = load i32, ptr [[DOTOMP_STRIDE]], align 4, !llvm.access.group [[ACC_GRP47]]
3197 // CHECK3-NEXT: [[ADD:%.*]] = add nsw i32 [[TMP11]], [[TMP12]]
3198 // CHECK3-NEXT: store i32 [[ADD]], ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP47]]
3199 // CHECK3-NEXT: br label [[OMP_INNER_FOR_COND]], !llvm.loop [[LOOP48:![0-9]+]]
3200 // CHECK3: omp.inner.for.end:
3201 // CHECK3-NEXT: br label [[OMP_LOOP_EXIT:%.*]]
3202 // CHECK3: omp.loop.exit:
3203 // CHECK3-NEXT: call void @__kmpc_for_static_fini(ptr @[[GLOB1]], i32 [[TMP1]])
3204 // CHECK3-NEXT: [[TMP13:%.*]] = load i32, ptr [[DOTOMP_IS_LAST]], align 4
3205 // CHECK3-NEXT: [[TMP14:%.*]] = icmp ne i32 [[TMP13]], 0
3206 // CHECK3-NEXT: br i1 [[TMP14]], label [[DOTOMP_FINAL_THEN:%.*]], label [[DOTOMP_FINAL_DONE:%.*]]
3207 // CHECK3: .omp.final.then:
3208 // CHECK3-NEXT: store i32 100, ptr [[I]], align 4
3209 // CHECK3-NEXT: br label [[DOTOMP_FINAL_DONE]]
3210 // CHECK3: .omp.final.done:
3211 // CHECK3-NEXT: ret void
3214 // CHECK3-LABEL: define {{[^@]+}}@{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z5tmainIiEiT__l57.omp_outlined.omp_outlined
3215 // CHECK3-SAME: (ptr noalias noundef [[DOTGLOBAL_TID_:%.*]], ptr noalias noundef [[DOTBOUND_TID_:%.*]], i64 noundef [[DOTPREVIOUS_LB_:%.*]], i64 noundef [[DOTPREVIOUS_UB_:%.*]]) #[[ATTR2]] {
3216 // CHECK3-NEXT: entry:
3217 // CHECK3-NEXT: [[DOTGLOBAL_TID__ADDR:%.*]] = alloca ptr, align 8
3218 // CHECK3-NEXT: [[DOTBOUND_TID__ADDR:%.*]] = alloca ptr, align 8
3219 // CHECK3-NEXT: [[DOTPREVIOUS_LB__ADDR:%.*]] = alloca i64, align 8
3220 // CHECK3-NEXT: [[DOTPREVIOUS_UB__ADDR:%.*]] = alloca i64, align 8
3221 // CHECK3-NEXT: [[DOTOMP_IV:%.*]] = alloca i32, align 4
3222 // CHECK3-NEXT: [[TMP:%.*]] = alloca i32, align 4
3223 // CHECK3-NEXT: [[DOTOMP_LB:%.*]] = alloca i32, align 4
3224 // CHECK3-NEXT: [[DOTOMP_UB:%.*]] = alloca i32, align 4
3225 // CHECK3-NEXT: [[DOTOMP_STRIDE:%.*]] = alloca i32, align 4
3226 // CHECK3-NEXT: [[DOTOMP_IS_LAST:%.*]] = alloca i32, align 4
3227 // CHECK3-NEXT: [[I:%.*]] = alloca i32, align 4
3228 // CHECK3-NEXT: store ptr [[DOTGLOBAL_TID_]], ptr [[DOTGLOBAL_TID__ADDR]], align 8
3229 // CHECK3-NEXT: store ptr [[DOTBOUND_TID_]], ptr [[DOTBOUND_TID__ADDR]], align 8
3230 // CHECK3-NEXT: store i64 [[DOTPREVIOUS_LB_]], ptr [[DOTPREVIOUS_LB__ADDR]], align 8
3231 // CHECK3-NEXT: store i64 [[DOTPREVIOUS_UB_]], ptr [[DOTPREVIOUS_UB__ADDR]], align 8
3232 // CHECK3-NEXT: store i32 0, ptr [[DOTOMP_LB]], align 4
3233 // CHECK3-NEXT: store i32 99, ptr [[DOTOMP_UB]], align 4
3234 // CHECK3-NEXT: [[TMP0:%.*]] = load i64, ptr [[DOTPREVIOUS_LB__ADDR]], align 8
3235 // CHECK3-NEXT: [[CONV:%.*]] = trunc i64 [[TMP0]] to i32
3236 // CHECK3-NEXT: [[TMP1:%.*]] = load i64, ptr [[DOTPREVIOUS_UB__ADDR]], align 8
3237 // CHECK3-NEXT: [[CONV1:%.*]] = trunc i64 [[TMP1]] to i32
3238 // CHECK3-NEXT: store i32 [[CONV]], ptr [[DOTOMP_LB]], align 4
3239 // CHECK3-NEXT: store i32 [[CONV1]], ptr [[DOTOMP_UB]], align 4
3240 // CHECK3-NEXT: store i32 1, ptr [[DOTOMP_STRIDE]], align 4
3241 // CHECK3-NEXT: store i32 0, ptr [[DOTOMP_IS_LAST]], align 4
3242 // CHECK3-NEXT: [[TMP2:%.*]] = load ptr, ptr [[DOTGLOBAL_TID__ADDR]], align 8
3243 // CHECK3-NEXT: [[TMP3:%.*]] = load i32, ptr [[TMP2]], align 4
3244 // 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)
3245 // CHECK3-NEXT: [[TMP4:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4
3246 // CHECK3-NEXT: [[CMP:%.*]] = icmp sgt i32 [[TMP4]], 99
3247 // CHECK3-NEXT: br i1 [[CMP]], label [[COND_TRUE:%.*]], label [[COND_FALSE:%.*]]
3248 // CHECK3: cond.true:
3249 // CHECK3-NEXT: br label [[COND_END:%.*]]
3250 // CHECK3: cond.false:
3251 // CHECK3-NEXT: [[TMP5:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4
3252 // CHECK3-NEXT: br label [[COND_END]]
3253 // CHECK3: cond.end:
3254 // CHECK3-NEXT: [[COND:%.*]] = phi i32 [ 99, [[COND_TRUE]] ], [ [[TMP5]], [[COND_FALSE]] ]
3255 // CHECK3-NEXT: store i32 [[COND]], ptr [[DOTOMP_UB]], align 4
3256 // CHECK3-NEXT: [[TMP6:%.*]] = load i32, ptr [[DOTOMP_LB]], align 4
3257 // CHECK3-NEXT: store i32 [[TMP6]], ptr [[DOTOMP_IV]], align 4
3258 // CHECK3-NEXT: br label [[OMP_INNER_FOR_COND:%.*]]
3259 // CHECK3: omp.inner.for.cond:
3260 // CHECK3-NEXT: [[TMP7:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP50:![0-9]+]]
3261 // CHECK3-NEXT: [[TMP8:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4, !llvm.access.group [[ACC_GRP50]]
3262 // CHECK3-NEXT: [[CMP2:%.*]] = icmp sle i32 [[TMP7]], [[TMP8]]
3263 // CHECK3-NEXT: br i1 [[CMP2]], label [[OMP_INNER_FOR_BODY:%.*]], label [[OMP_INNER_FOR_END:%.*]]
3264 // CHECK3: omp.inner.for.body:
3265 // CHECK3-NEXT: [[TMP9:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP50]]
3266 // CHECK3-NEXT: [[MUL:%.*]] = mul nsw i32 [[TMP9]], 1
3267 // CHECK3-NEXT: [[ADD:%.*]] = add nsw i32 0, [[MUL]]
3268 // CHECK3-NEXT: store i32 [[ADD]], ptr [[I]], align 4, !llvm.access.group [[ACC_GRP50]]
3269 // CHECK3-NEXT: call void @_Z3fn1v(), !llvm.access.group [[ACC_GRP50]]
3270 // CHECK3-NEXT: br label [[OMP_BODY_CONTINUE:%.*]]
3271 // CHECK3: omp.body.continue:
3272 // CHECK3-NEXT: br label [[OMP_INNER_FOR_INC:%.*]]
3273 // CHECK3: omp.inner.for.inc:
3274 // CHECK3-NEXT: [[TMP10:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP50]]
3275 // CHECK3-NEXT: [[ADD3:%.*]] = add nsw i32 [[TMP10]], 1
3276 // CHECK3-NEXT: store i32 [[ADD3]], ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP50]]
3277 // CHECK3-NEXT: br label [[OMP_INNER_FOR_COND]], !llvm.loop [[LOOP51:![0-9]+]]
3278 // CHECK3: omp.inner.for.end:
3279 // CHECK3-NEXT: br label [[OMP_LOOP_EXIT:%.*]]
3280 // CHECK3: omp.loop.exit:
3281 // CHECK3-NEXT: call void @__kmpc_for_static_fini(ptr @[[GLOB1]], i32 [[TMP3]])
3282 // CHECK3-NEXT: [[TMP11:%.*]] = load i32, ptr [[DOTOMP_IS_LAST]], align 4
3283 // CHECK3-NEXT: [[TMP12:%.*]] = icmp ne i32 [[TMP11]], 0
3284 // CHECK3-NEXT: br i1 [[TMP12]], label [[DOTOMP_FINAL_THEN:%.*]], label [[DOTOMP_FINAL_DONE:%.*]]
3285 // CHECK3: .omp.final.then:
3286 // CHECK3-NEXT: store i32 100, ptr [[I]], align 4
3287 // CHECK3-NEXT: br label [[DOTOMP_FINAL_DONE]]
3288 // CHECK3: .omp.final.done:
3289 // CHECK3-NEXT: ret void
3292 // CHECK3-LABEL: define {{[^@]+}}@{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z5tmainIiEiT__l62
3293 // CHECK3-SAME: () #[[ATTR1]] {
3294 // CHECK3-NEXT: entry:
3295 // CHECK3-NEXT: call void (ptr, i32, ptr, ...) @__kmpc_fork_teams(ptr @[[GLOB3]], i32 0, ptr @{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z5tmainIiEiT__l62.omp_outlined)
3296 // CHECK3-NEXT: ret void
3299 // CHECK3-LABEL: define {{[^@]+}}@{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z5tmainIiEiT__l62.omp_outlined
3300 // CHECK3-SAME: (ptr noalias noundef [[DOTGLOBAL_TID_:%.*]], ptr noalias noundef [[DOTBOUND_TID_:%.*]]) #[[ATTR2]] {
3301 // CHECK3-NEXT: entry:
3302 // CHECK3-NEXT: [[DOTGLOBAL_TID__ADDR:%.*]] = alloca ptr, align 8
3303 // CHECK3-NEXT: [[DOTBOUND_TID__ADDR:%.*]] = alloca ptr, align 8
3304 // CHECK3-NEXT: [[DOTOMP_IV:%.*]] = alloca i32, align 4
3305 // CHECK3-NEXT: [[TMP:%.*]] = alloca i32, align 4
3306 // CHECK3-NEXT: [[DOTOMP_COMB_LB:%.*]] = alloca i32, align 4
3307 // CHECK3-NEXT: [[DOTOMP_COMB_UB:%.*]] = alloca i32, align 4
3308 // CHECK3-NEXT: [[DOTOMP_STRIDE:%.*]] = alloca i32, align 4
3309 // CHECK3-NEXT: [[DOTOMP_IS_LAST:%.*]] = alloca i32, align 4
3310 // CHECK3-NEXT: [[I:%.*]] = alloca i32, align 4
3311 // CHECK3-NEXT: [[DOTBOUND_ZERO_ADDR:%.*]] = alloca i32, align 4
3312 // CHECK3-NEXT: store ptr [[DOTGLOBAL_TID_]], ptr [[DOTGLOBAL_TID__ADDR]], align 8
3313 // CHECK3-NEXT: store ptr [[DOTBOUND_TID_]], ptr [[DOTBOUND_TID__ADDR]], align 8
3314 // CHECK3-NEXT: store i32 0, ptr [[DOTOMP_COMB_LB]], align 4
3315 // CHECK3-NEXT: store i32 99, ptr [[DOTOMP_COMB_UB]], align 4
3316 // CHECK3-NEXT: store i32 1, ptr [[DOTOMP_STRIDE]], align 4
3317 // CHECK3-NEXT: store i32 0, ptr [[DOTOMP_IS_LAST]], align 4
3318 // CHECK3-NEXT: [[TMP0:%.*]] = load ptr, ptr [[DOTGLOBAL_TID__ADDR]], align 8
3319 // CHECK3-NEXT: [[TMP1:%.*]] = load i32, ptr [[TMP0]], align 4
3320 // 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)
3321 // CHECK3-NEXT: [[TMP2:%.*]] = load i32, ptr [[DOTOMP_COMB_UB]], align 4
3322 // CHECK3-NEXT: [[CMP:%.*]] = icmp sgt i32 [[TMP2]], 99
3323 // CHECK3-NEXT: br i1 [[CMP]], label [[COND_TRUE:%.*]], label [[COND_FALSE:%.*]]
3324 // CHECK3: cond.true:
3325 // CHECK3-NEXT: br label [[COND_END:%.*]]
3326 // CHECK3: cond.false:
3327 // CHECK3-NEXT: [[TMP3:%.*]] = load i32, ptr [[DOTOMP_COMB_UB]], align 4
3328 // CHECK3-NEXT: br label [[COND_END]]
3329 // CHECK3: cond.end:
3330 // CHECK3-NEXT: [[COND:%.*]] = phi i32 [ 99, [[COND_TRUE]] ], [ [[TMP3]], [[COND_FALSE]] ]
3331 // CHECK3-NEXT: store i32 [[COND]], ptr [[DOTOMP_COMB_UB]], align 4
3332 // CHECK3-NEXT: [[TMP4:%.*]] = load i32, ptr [[DOTOMP_COMB_LB]], align 4
3333 // CHECK3-NEXT: store i32 [[TMP4]], ptr [[DOTOMP_IV]], align 4
3334 // CHECK3-NEXT: br label [[OMP_INNER_FOR_COND:%.*]]
3335 // CHECK3: omp.inner.for.cond:
3336 // CHECK3-NEXT: [[TMP5:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4
3337 // CHECK3-NEXT: [[TMP6:%.*]] = load i32, ptr [[DOTOMP_COMB_UB]], align 4
3338 // CHECK3-NEXT: [[CMP1:%.*]] = icmp sle i32 [[TMP5]], [[TMP6]]
3339 // CHECK3-NEXT: br i1 [[CMP1]], label [[OMP_INNER_FOR_BODY:%.*]], label [[OMP_INNER_FOR_END:%.*]]
3340 // CHECK3: omp.inner.for.body:
3341 // CHECK3-NEXT: [[TMP7:%.*]] = load i32, ptr [[DOTOMP_COMB_LB]], align 4
3342 // CHECK3-NEXT: [[TMP8:%.*]] = zext i32 [[TMP7]] to i64
3343 // CHECK3-NEXT: [[TMP9:%.*]] = load i32, ptr [[DOTOMP_COMB_UB]], align 4
3344 // CHECK3-NEXT: [[TMP10:%.*]] = zext i32 [[TMP9]] to i64
3345 // CHECK3-NEXT: call void @__kmpc_serialized_parallel(ptr @[[GLOB3]], i32 [[TMP1]])
3346 // CHECK3-NEXT: [[TMP11:%.*]] = load ptr, ptr [[DOTGLOBAL_TID__ADDR]], align 8
3347 // CHECK3-NEXT: store i32 0, ptr [[DOTBOUND_ZERO_ADDR]], align 4
3348 // CHECK3-NEXT: call void @{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z5tmainIiEiT__l62.omp_outlined.omp_outlined(ptr [[TMP11]], ptr [[DOTBOUND_ZERO_ADDR]], i64 [[TMP8]], i64 [[TMP10]]) #[[ATTR3]]
3349 // CHECK3-NEXT: call void @__kmpc_end_serialized_parallel(ptr @[[GLOB3]], i32 [[TMP1]])
3350 // CHECK3-NEXT: br label [[OMP_INNER_FOR_INC:%.*]]
3351 // CHECK3: omp.inner.for.inc:
3352 // CHECK3-NEXT: [[TMP12:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4
3353 // CHECK3-NEXT: [[TMP13:%.*]] = load i32, ptr [[DOTOMP_STRIDE]], align 4
3354 // CHECK3-NEXT: [[ADD:%.*]] = add nsw i32 [[TMP12]], [[TMP13]]
3355 // CHECK3-NEXT: store i32 [[ADD]], ptr [[DOTOMP_IV]], align 4
3356 // CHECK3-NEXT: br label [[OMP_INNER_FOR_COND]], !llvm.loop [[LOOP53:![0-9]+]]
3357 // CHECK3: omp.inner.for.end:
3358 // CHECK3-NEXT: br label [[OMP_LOOP_EXIT:%.*]]
3359 // CHECK3: omp.loop.exit:
3360 // CHECK3-NEXT: call void @__kmpc_for_static_fini(ptr @[[GLOB1]], i32 [[TMP1]])
3361 // CHECK3-NEXT: [[TMP14:%.*]] = load i32, ptr [[DOTOMP_IS_LAST]], align 4
3362 // CHECK3-NEXT: [[TMP15:%.*]] = icmp ne i32 [[TMP14]], 0
3363 // CHECK3-NEXT: br i1 [[TMP15]], label [[DOTOMP_FINAL_THEN:%.*]], label [[DOTOMP_FINAL_DONE:%.*]]
3364 // CHECK3: .omp.final.then:
3365 // CHECK3-NEXT: store i32 100, ptr [[I]], align 4
3366 // CHECK3-NEXT: br label [[DOTOMP_FINAL_DONE]]
3367 // CHECK3: .omp.final.done:
3368 // CHECK3-NEXT: ret void
3371 // CHECK3-LABEL: define {{[^@]+}}@{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z5tmainIiEiT__l62.omp_outlined.omp_outlined
3372 // CHECK3-SAME: (ptr noalias noundef [[DOTGLOBAL_TID_:%.*]], ptr noalias noundef [[DOTBOUND_TID_:%.*]], i64 noundef [[DOTPREVIOUS_LB_:%.*]], i64 noundef [[DOTPREVIOUS_UB_:%.*]]) #[[ATTR2]] {
3373 // CHECK3-NEXT: entry:
3374 // CHECK3-NEXT: [[DOTGLOBAL_TID__ADDR:%.*]] = alloca ptr, align 8
3375 // CHECK3-NEXT: [[DOTBOUND_TID__ADDR:%.*]] = alloca ptr, align 8
3376 // CHECK3-NEXT: [[DOTPREVIOUS_LB__ADDR:%.*]] = alloca i64, align 8
3377 // CHECK3-NEXT: [[DOTPREVIOUS_UB__ADDR:%.*]] = alloca i64, align 8
3378 // CHECK3-NEXT: [[DOTOMP_IV:%.*]] = alloca i32, align 4
3379 // CHECK3-NEXT: [[TMP:%.*]] = alloca i32, align 4
3380 // CHECK3-NEXT: [[DOTOMP_LB:%.*]] = alloca i32, align 4
3381 // CHECK3-NEXT: [[DOTOMP_UB:%.*]] = alloca i32, align 4
3382 // CHECK3-NEXT: [[DOTOMP_STRIDE:%.*]] = alloca i32, align 4
3383 // CHECK3-NEXT: [[DOTOMP_IS_LAST:%.*]] = alloca i32, align 4
3384 // CHECK3-NEXT: [[I:%.*]] = alloca i32, align 4
3385 // CHECK3-NEXT: store ptr [[DOTGLOBAL_TID_]], ptr [[DOTGLOBAL_TID__ADDR]], align 8
3386 // CHECK3-NEXT: store ptr [[DOTBOUND_TID_]], ptr [[DOTBOUND_TID__ADDR]], align 8
3387 // CHECK3-NEXT: store i64 [[DOTPREVIOUS_LB_]], ptr [[DOTPREVIOUS_LB__ADDR]], align 8
3388 // CHECK3-NEXT: store i64 [[DOTPREVIOUS_UB_]], ptr [[DOTPREVIOUS_UB__ADDR]], align 8
3389 // CHECK3-NEXT: store i32 0, ptr [[DOTOMP_LB]], align 4
3390 // CHECK3-NEXT: store i32 99, ptr [[DOTOMP_UB]], align 4
3391 // CHECK3-NEXT: [[TMP0:%.*]] = load i64, ptr [[DOTPREVIOUS_LB__ADDR]], align 8
3392 // CHECK3-NEXT: [[CONV:%.*]] = trunc i64 [[TMP0]] to i32
3393 // CHECK3-NEXT: [[TMP1:%.*]] = load i64, ptr [[DOTPREVIOUS_UB__ADDR]], align 8
3394 // CHECK3-NEXT: [[CONV1:%.*]] = trunc i64 [[TMP1]] to i32
3395 // CHECK3-NEXT: store i32 [[CONV]], ptr [[DOTOMP_LB]], align 4
3396 // CHECK3-NEXT: store i32 [[CONV1]], ptr [[DOTOMP_UB]], align 4
3397 // CHECK3-NEXT: store i32 1, ptr [[DOTOMP_STRIDE]], align 4
3398 // CHECK3-NEXT: store i32 0, ptr [[DOTOMP_IS_LAST]], align 4
3399 // CHECK3-NEXT: [[TMP2:%.*]] = load ptr, ptr [[DOTGLOBAL_TID__ADDR]], align 8
3400 // CHECK3-NEXT: [[TMP3:%.*]] = load i32, ptr [[TMP2]], align 4
3401 // 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)
3402 // CHECK3-NEXT: [[TMP4:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4
3403 // CHECK3-NEXT: [[CMP:%.*]] = icmp sgt i32 [[TMP4]], 99
3404 // CHECK3-NEXT: br i1 [[CMP]], label [[COND_TRUE:%.*]], label [[COND_FALSE:%.*]]
3405 // CHECK3: cond.true:
3406 // CHECK3-NEXT: br label [[COND_END:%.*]]
3407 // CHECK3: cond.false:
3408 // CHECK3-NEXT: [[TMP5:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4
3409 // CHECK3-NEXT: br label [[COND_END]]
3410 // CHECK3: cond.end:
3411 // CHECK3-NEXT: [[COND:%.*]] = phi i32 [ 99, [[COND_TRUE]] ], [ [[TMP5]], [[COND_FALSE]] ]
3412 // CHECK3-NEXT: store i32 [[COND]], ptr [[DOTOMP_UB]], align 4
3413 // CHECK3-NEXT: [[TMP6:%.*]] = load i32, ptr [[DOTOMP_LB]], align 4
3414 // CHECK3-NEXT: store i32 [[TMP6]], ptr [[DOTOMP_IV]], align 4
3415 // CHECK3-NEXT: br label [[OMP_INNER_FOR_COND:%.*]]
3416 // CHECK3: omp.inner.for.cond:
3417 // CHECK3-NEXT: [[TMP7:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4
3418 // CHECK3-NEXT: [[TMP8:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4
3419 // CHECK3-NEXT: [[CMP2:%.*]] = icmp sle i32 [[TMP7]], [[TMP8]]
3420 // CHECK3-NEXT: br i1 [[CMP2]], label [[OMP_INNER_FOR_BODY:%.*]], label [[OMP_INNER_FOR_END:%.*]]
3421 // CHECK3: omp.inner.for.body:
3422 // CHECK3-NEXT: [[TMP9:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4
3423 // CHECK3-NEXT: [[MUL:%.*]] = mul nsw i32 [[TMP9]], 1
3424 // CHECK3-NEXT: [[ADD:%.*]] = add nsw i32 0, [[MUL]]
3425 // CHECK3-NEXT: store i32 [[ADD]], ptr [[I]], align 4
3426 // CHECK3-NEXT: call void @_Z3fn2v()
3427 // CHECK3-NEXT: br label [[OMP_BODY_CONTINUE:%.*]]
3428 // CHECK3: omp.body.continue:
3429 // CHECK3-NEXT: br label [[OMP_INNER_FOR_INC:%.*]]
3430 // CHECK3: omp.inner.for.inc:
3431 // CHECK3-NEXT: [[TMP10:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4
3432 // CHECK3-NEXT: [[ADD3:%.*]] = add nsw i32 [[TMP10]], 1
3433 // CHECK3-NEXT: store i32 [[ADD3]], ptr [[DOTOMP_IV]], align 4
3434 // CHECK3-NEXT: br label [[OMP_INNER_FOR_COND]], !llvm.loop [[LOOP54:![0-9]+]]
3435 // CHECK3: omp.inner.for.end:
3436 // CHECK3-NEXT: br label [[OMP_LOOP_EXIT:%.*]]
3437 // CHECK3: omp.loop.exit:
3438 // CHECK3-NEXT: call void @__kmpc_for_static_fini(ptr @[[GLOB1]], i32 [[TMP3]])
3439 // CHECK3-NEXT: [[TMP11:%.*]] = load i32, ptr [[DOTOMP_IS_LAST]], align 4
3440 // CHECK3-NEXT: [[TMP12:%.*]] = icmp ne i32 [[TMP11]], 0
3441 // CHECK3-NEXT: br i1 [[TMP12]], label [[DOTOMP_FINAL_THEN:%.*]], label [[DOTOMP_FINAL_DONE:%.*]]
3442 // CHECK3: .omp.final.then:
3443 // CHECK3-NEXT: store i32 100, ptr [[I]], align 4
3444 // CHECK3-NEXT: br label [[DOTOMP_FINAL_DONE]]
3445 // CHECK3: .omp.final.done:
3446 // CHECK3-NEXT: ret void
3449 // CHECK3-LABEL: define {{[^@]+}}@{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z5tmainIiEiT__l67
3450 // CHECK3-SAME: (i64 noundef [[ARG:%.*]]) #[[ATTR1]] {
3451 // CHECK3-NEXT: entry:
3452 // CHECK3-NEXT: [[ARG_ADDR:%.*]] = alloca i64, align 8
3453 // CHECK3-NEXT: [[DOTCAPTURE_EXPR_:%.*]] = alloca i8, align 1
3454 // CHECK3-NEXT: [[DOTCAPTURE_EXPR__CASTED:%.*]] = alloca i64, align 8
3455 // CHECK3-NEXT: store i64 [[ARG]], ptr [[ARG_ADDR]], align 8
3456 // CHECK3-NEXT: [[TMP0:%.*]] = load i32, ptr [[ARG_ADDR]], align 4
3457 // CHECK3-NEXT: [[TOBOOL:%.*]] = icmp ne i32 [[TMP0]], 0
3458 // CHECK3-NEXT: [[FROMBOOL:%.*]] = zext i1 [[TOBOOL]] to i8
3459 // CHECK3-NEXT: store i8 [[FROMBOOL]], ptr [[DOTCAPTURE_EXPR_]], align 1
3460 // CHECK3-NEXT: [[TMP1:%.*]] = load i8, ptr [[DOTCAPTURE_EXPR_]], align 1
3461 // CHECK3-NEXT: [[TOBOOL1:%.*]] = trunc i8 [[TMP1]] to i1
3462 // CHECK3-NEXT: [[FROMBOOL2:%.*]] = zext i1 [[TOBOOL1]] to i8
3463 // CHECK3-NEXT: store i8 [[FROMBOOL2]], ptr [[DOTCAPTURE_EXPR__CASTED]], align 1
3464 // CHECK3-NEXT: [[TMP2:%.*]] = load i64, ptr [[DOTCAPTURE_EXPR__CASTED]], align 8
3465 // CHECK3-NEXT: call void (ptr, i32, ptr, ...) @__kmpc_fork_teams(ptr @[[GLOB3]], i32 1, ptr @{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z5tmainIiEiT__l67.omp_outlined, i64 [[TMP2]])
3466 // CHECK3-NEXT: ret void
3469 // CHECK3-LABEL: define {{[^@]+}}@{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z5tmainIiEiT__l67.omp_outlined
3470 // CHECK3-SAME: (ptr noalias noundef [[DOTGLOBAL_TID_:%.*]], ptr noalias noundef [[DOTBOUND_TID_:%.*]], i64 noundef [[DOTCAPTURE_EXPR_:%.*]]) #[[ATTR2]] {
3471 // CHECK3-NEXT: entry:
3472 // CHECK3-NEXT: [[DOTGLOBAL_TID__ADDR:%.*]] = alloca ptr, align 8
3473 // CHECK3-NEXT: [[DOTBOUND_TID__ADDR:%.*]] = alloca ptr, align 8
3474 // CHECK3-NEXT: [[DOTCAPTURE_EXPR__ADDR:%.*]] = alloca i64, align 8
3475 // CHECK3-NEXT: [[DOTOMP_IV:%.*]] = alloca i32, align 4
3476 // CHECK3-NEXT: [[TMP:%.*]] = alloca i32, align 4
3477 // CHECK3-NEXT: [[DOTOMP_COMB_LB:%.*]] = alloca i32, align 4
3478 // CHECK3-NEXT: [[DOTOMP_COMB_UB:%.*]] = alloca i32, align 4
3479 // CHECK3-NEXT: [[DOTOMP_STRIDE:%.*]] = alloca i32, align 4
3480 // CHECK3-NEXT: [[DOTOMP_IS_LAST:%.*]] = alloca i32, align 4
3481 // CHECK3-NEXT: [[I:%.*]] = alloca i32, align 4
3482 // CHECK3-NEXT: [[DOTBOUND_ZERO_ADDR:%.*]] = alloca i32, align 4
3483 // CHECK3-NEXT: store ptr [[DOTGLOBAL_TID_]], ptr [[DOTGLOBAL_TID__ADDR]], align 8
3484 // CHECK3-NEXT: store ptr [[DOTBOUND_TID_]], ptr [[DOTBOUND_TID__ADDR]], align 8
3485 // CHECK3-NEXT: store i64 [[DOTCAPTURE_EXPR_]], ptr [[DOTCAPTURE_EXPR__ADDR]], align 8
3486 // CHECK3-NEXT: store i32 0, ptr [[DOTOMP_COMB_LB]], align 4
3487 // CHECK3-NEXT: store i32 99, ptr [[DOTOMP_COMB_UB]], align 4
3488 // CHECK3-NEXT: store i32 1, ptr [[DOTOMP_STRIDE]], align 4
3489 // CHECK3-NEXT: store i32 0, ptr [[DOTOMP_IS_LAST]], align 4
3490 // CHECK3-NEXT: [[TMP0:%.*]] = load ptr, ptr [[DOTGLOBAL_TID__ADDR]], align 8
3491 // CHECK3-NEXT: [[TMP1:%.*]] = load i32, ptr [[TMP0]], align 4
3492 // 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)
3493 // CHECK3-NEXT: [[TMP2:%.*]] = load i32, ptr [[DOTOMP_COMB_UB]], align 4
3494 // CHECK3-NEXT: [[CMP:%.*]] = icmp sgt i32 [[TMP2]], 99
3495 // CHECK3-NEXT: br i1 [[CMP]], label [[COND_TRUE:%.*]], label [[COND_FALSE:%.*]]
3496 // CHECK3: cond.true:
3497 // CHECK3-NEXT: br label [[COND_END:%.*]]
3498 // CHECK3: cond.false:
3499 // CHECK3-NEXT: [[TMP3:%.*]] = load i32, ptr [[DOTOMP_COMB_UB]], align 4
3500 // CHECK3-NEXT: br label [[COND_END]]
3501 // CHECK3: cond.end:
3502 // CHECK3-NEXT: [[COND:%.*]] = phi i32 [ 99, [[COND_TRUE]] ], [ [[TMP3]], [[COND_FALSE]] ]
3503 // CHECK3-NEXT: store i32 [[COND]], ptr [[DOTOMP_COMB_UB]], align 4
3504 // CHECK3-NEXT: [[TMP4:%.*]] = load i32, ptr [[DOTOMP_COMB_LB]], align 4
3505 // CHECK3-NEXT: store i32 [[TMP4]], ptr [[DOTOMP_IV]], align 4
3506 // CHECK3-NEXT: br label [[OMP_INNER_FOR_COND:%.*]]
3507 // CHECK3: omp.inner.for.cond:
3508 // CHECK3-NEXT: [[TMP5:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP55:![0-9]+]]
3509 // CHECK3-NEXT: [[TMP6:%.*]] = load i32, ptr [[DOTOMP_COMB_UB]], align 4, !llvm.access.group [[ACC_GRP55]]
3510 // CHECK3-NEXT: [[CMP1:%.*]] = icmp sle i32 [[TMP5]], [[TMP6]]
3511 // CHECK3-NEXT: br i1 [[CMP1]], label [[OMP_INNER_FOR_BODY:%.*]], label [[OMP_INNER_FOR_END:%.*]]
3512 // CHECK3: omp.inner.for.body:
3513 // CHECK3-NEXT: [[TMP7:%.*]] = load i32, ptr [[DOTOMP_COMB_LB]], align 4, !llvm.access.group [[ACC_GRP55]]
3514 // CHECK3-NEXT: [[TMP8:%.*]] = zext i32 [[TMP7]] to i64
3515 // CHECK3-NEXT: [[TMP9:%.*]] = load i32, ptr [[DOTOMP_COMB_UB]], align 4, !llvm.access.group [[ACC_GRP55]]
3516 // CHECK3-NEXT: [[TMP10:%.*]] = zext i32 [[TMP9]] to i64
3517 // CHECK3-NEXT: [[TMP11:%.*]] = load i8, ptr [[DOTCAPTURE_EXPR__ADDR]], align 1, !llvm.access.group [[ACC_GRP55]]
3518 // CHECK3-NEXT: [[TOBOOL:%.*]] = trunc i8 [[TMP11]] to i1
3519 // CHECK3-NEXT: br i1 [[TOBOOL]], label [[OMP_IF_THEN:%.*]], label [[OMP_IF_ELSE:%.*]]
3520 // CHECK3: omp_if.then:
3521 // CHECK3-NEXT: call void (ptr, i32, ptr, ...) @__kmpc_fork_call(ptr @[[GLOB3]], i32 2, ptr @{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z5tmainIiEiT__l67.omp_outlined.omp_outlined, i64 [[TMP8]], i64 [[TMP10]]), !llvm.access.group [[ACC_GRP55]]
3522 // CHECK3-NEXT: br label [[OMP_IF_END:%.*]]
3523 // CHECK3: omp_if.else:
3524 // CHECK3-NEXT: call void @__kmpc_serialized_parallel(ptr @[[GLOB3]], i32 [[TMP1]]), !llvm.access.group [[ACC_GRP55]]
3525 // CHECK3-NEXT: [[TMP12:%.*]] = load ptr, ptr [[DOTGLOBAL_TID__ADDR]], align 8, !llvm.access.group [[ACC_GRP55]]
3526 // CHECK3-NEXT: store i32 0, ptr [[DOTBOUND_ZERO_ADDR]], align 4, !llvm.access.group [[ACC_GRP55]]
3527 // CHECK3-NEXT: call void @{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z5tmainIiEiT__l67.omp_outlined.omp_outlined(ptr [[TMP12]], ptr [[DOTBOUND_ZERO_ADDR]], i64 [[TMP8]], i64 [[TMP10]]) #[[ATTR3]], !llvm.access.group [[ACC_GRP55]]
3528 // CHECK3-NEXT: call void @__kmpc_end_serialized_parallel(ptr @[[GLOB3]], i32 [[TMP1]]), !llvm.access.group [[ACC_GRP55]]
3529 // CHECK3-NEXT: br label [[OMP_IF_END]]
3530 // CHECK3: omp_if.end:
3531 // CHECK3-NEXT: br label [[OMP_INNER_FOR_INC:%.*]]
3532 // CHECK3: omp.inner.for.inc:
3533 // CHECK3-NEXT: [[TMP13:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP55]]
3534 // CHECK3-NEXT: [[TMP14:%.*]] = load i32, ptr [[DOTOMP_STRIDE]], align 4, !llvm.access.group [[ACC_GRP55]]
3535 // CHECK3-NEXT: [[ADD:%.*]] = add nsw i32 [[TMP13]], [[TMP14]]
3536 // CHECK3-NEXT: store i32 [[ADD]], ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP55]]
3537 // CHECK3-NEXT: br label [[OMP_INNER_FOR_COND]], !llvm.loop [[LOOP56:![0-9]+]]
3538 // CHECK3: omp.inner.for.end:
3539 // CHECK3-NEXT: br label [[OMP_LOOP_EXIT:%.*]]
3540 // CHECK3: omp.loop.exit:
3541 // CHECK3-NEXT: call void @__kmpc_for_static_fini(ptr @[[GLOB1]], i32 [[TMP1]])
3542 // CHECK3-NEXT: [[TMP15:%.*]] = load i32, ptr [[DOTOMP_IS_LAST]], align 4
3543 // CHECK3-NEXT: [[TMP16:%.*]] = icmp ne i32 [[TMP15]], 0
3544 // CHECK3-NEXT: br i1 [[TMP16]], label [[DOTOMP_FINAL_THEN:%.*]], label [[DOTOMP_FINAL_DONE:%.*]]
3545 // CHECK3: .omp.final.then:
3546 // CHECK3-NEXT: store i32 100, ptr [[I]], align 4
3547 // CHECK3-NEXT: br label [[DOTOMP_FINAL_DONE]]
3548 // CHECK3: .omp.final.done:
3549 // CHECK3-NEXT: ret void
3552 // CHECK3-LABEL: define {{[^@]+}}@{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z5tmainIiEiT__l67.omp_outlined.omp_outlined
3553 // CHECK3-SAME: (ptr noalias noundef [[DOTGLOBAL_TID_:%.*]], ptr noalias noundef [[DOTBOUND_TID_:%.*]], i64 noundef [[DOTPREVIOUS_LB_:%.*]], i64 noundef [[DOTPREVIOUS_UB_:%.*]]) #[[ATTR2]] {
3554 // CHECK3-NEXT: entry:
3555 // CHECK3-NEXT: [[DOTGLOBAL_TID__ADDR:%.*]] = alloca ptr, align 8
3556 // CHECK3-NEXT: [[DOTBOUND_TID__ADDR:%.*]] = alloca ptr, align 8
3557 // CHECK3-NEXT: [[DOTPREVIOUS_LB__ADDR:%.*]] = alloca i64, align 8
3558 // CHECK3-NEXT: [[DOTPREVIOUS_UB__ADDR:%.*]] = alloca i64, align 8
3559 // CHECK3-NEXT: [[DOTOMP_IV:%.*]] = alloca i32, align 4
3560 // CHECK3-NEXT: [[TMP:%.*]] = alloca i32, align 4
3561 // CHECK3-NEXT: [[DOTOMP_LB:%.*]] = alloca i32, align 4
3562 // CHECK3-NEXT: [[DOTOMP_UB:%.*]] = alloca i32, align 4
3563 // CHECK3-NEXT: [[DOTOMP_STRIDE:%.*]] = alloca i32, align 4
3564 // CHECK3-NEXT: [[DOTOMP_IS_LAST:%.*]] = alloca i32, align 4
3565 // CHECK3-NEXT: [[I:%.*]] = alloca i32, align 4
3566 // CHECK3-NEXT: store ptr [[DOTGLOBAL_TID_]], ptr [[DOTGLOBAL_TID__ADDR]], align 8
3567 // CHECK3-NEXT: store ptr [[DOTBOUND_TID_]], ptr [[DOTBOUND_TID__ADDR]], align 8
3568 // CHECK3-NEXT: store i64 [[DOTPREVIOUS_LB_]], ptr [[DOTPREVIOUS_LB__ADDR]], align 8
3569 // CHECK3-NEXT: store i64 [[DOTPREVIOUS_UB_]], ptr [[DOTPREVIOUS_UB__ADDR]], align 8
3570 // CHECK3-NEXT: store i32 0, ptr [[DOTOMP_LB]], align 4
3571 // CHECK3-NEXT: store i32 99, ptr [[DOTOMP_UB]], align 4
3572 // CHECK3-NEXT: [[TMP0:%.*]] = load i64, ptr [[DOTPREVIOUS_LB__ADDR]], align 8
3573 // CHECK3-NEXT: [[CONV:%.*]] = trunc i64 [[TMP0]] to i32
3574 // CHECK3-NEXT: [[TMP1:%.*]] = load i64, ptr [[DOTPREVIOUS_UB__ADDR]], align 8
3575 // CHECK3-NEXT: [[CONV1:%.*]] = trunc i64 [[TMP1]] to i32
3576 // CHECK3-NEXT: store i32 [[CONV]], ptr [[DOTOMP_LB]], align 4
3577 // CHECK3-NEXT: store i32 [[CONV1]], ptr [[DOTOMP_UB]], align 4
3578 // CHECK3-NEXT: store i32 1, ptr [[DOTOMP_STRIDE]], align 4
3579 // CHECK3-NEXT: store i32 0, ptr [[DOTOMP_IS_LAST]], align 4
3580 // CHECK3-NEXT: [[TMP2:%.*]] = load ptr, ptr [[DOTGLOBAL_TID__ADDR]], align 8
3581 // CHECK3-NEXT: [[TMP3:%.*]] = load i32, ptr [[TMP2]], align 4
3582 // 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)
3583 // CHECK3-NEXT: [[TMP4:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4
3584 // CHECK3-NEXT: [[CMP:%.*]] = icmp sgt i32 [[TMP4]], 99
3585 // CHECK3-NEXT: br i1 [[CMP]], label [[COND_TRUE:%.*]], label [[COND_FALSE:%.*]]
3586 // CHECK3: cond.true:
3587 // CHECK3-NEXT: br label [[COND_END:%.*]]
3588 // CHECK3: cond.false:
3589 // CHECK3-NEXT: [[TMP5:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4
3590 // CHECK3-NEXT: br label [[COND_END]]
3591 // CHECK3: cond.end:
3592 // CHECK3-NEXT: [[COND:%.*]] = phi i32 [ 99, [[COND_TRUE]] ], [ [[TMP5]], [[COND_FALSE]] ]
3593 // CHECK3-NEXT: store i32 [[COND]], ptr [[DOTOMP_UB]], align 4
3594 // CHECK3-NEXT: [[TMP6:%.*]] = load i32, ptr [[DOTOMP_LB]], align 4
3595 // CHECK3-NEXT: store i32 [[TMP6]], ptr [[DOTOMP_IV]], align 4
3596 // CHECK3-NEXT: br label [[OMP_INNER_FOR_COND:%.*]]
3597 // CHECK3: omp.inner.for.cond:
3598 // CHECK3-NEXT: [[TMP7:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP58:![0-9]+]]
3599 // CHECK3-NEXT: [[TMP8:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4, !llvm.access.group [[ACC_GRP58]]
3600 // CHECK3-NEXT: [[CMP2:%.*]] = icmp sle i32 [[TMP7]], [[TMP8]]
3601 // CHECK3-NEXT: br i1 [[CMP2]], label [[OMP_INNER_FOR_BODY:%.*]], label [[OMP_INNER_FOR_END:%.*]]
3602 // CHECK3: omp.inner.for.body:
3603 // CHECK3-NEXT: [[TMP9:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP58]]
3604 // CHECK3-NEXT: [[MUL:%.*]] = mul nsw i32 [[TMP9]], 1
3605 // CHECK3-NEXT: [[ADD:%.*]] = add nsw i32 0, [[MUL]]
3606 // CHECK3-NEXT: store i32 [[ADD]], ptr [[I]], align 4, !llvm.access.group [[ACC_GRP58]]
3607 // CHECK3-NEXT: call void @_Z3fn3v(), !llvm.access.group [[ACC_GRP58]]
3608 // CHECK3-NEXT: br label [[OMP_BODY_CONTINUE:%.*]]
3609 // CHECK3: omp.body.continue:
3610 // CHECK3-NEXT: br label [[OMP_INNER_FOR_INC:%.*]]
3611 // CHECK3: omp.inner.for.inc:
3612 // CHECK3-NEXT: [[TMP10:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP58]]
3613 // CHECK3-NEXT: [[ADD3:%.*]] = add nsw i32 [[TMP10]], 1
3614 // CHECK3-NEXT: store i32 [[ADD3]], ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP58]]
3615 // CHECK3-NEXT: br label [[OMP_INNER_FOR_COND]], !llvm.loop [[LOOP59:![0-9]+]]
3616 // CHECK3: omp.inner.for.end:
3617 // CHECK3-NEXT: br label [[OMP_LOOP_EXIT:%.*]]
3618 // CHECK3: omp.loop.exit:
3619 // CHECK3-NEXT: call void @__kmpc_for_static_fini(ptr @[[GLOB1]], i32 [[TMP3]])
3620 // CHECK3-NEXT: [[TMP11:%.*]] = load i32, ptr [[DOTOMP_IS_LAST]], align 4
3621 // CHECK3-NEXT: [[TMP12:%.*]] = icmp ne i32 [[TMP11]], 0
3622 // CHECK3-NEXT: br i1 [[TMP12]], label [[DOTOMP_FINAL_THEN:%.*]], label [[DOTOMP_FINAL_DONE:%.*]]
3623 // CHECK3: .omp.final.then:
3624 // CHECK3-NEXT: store i32 100, ptr [[I]], align 4
3625 // CHECK3-NEXT: br label [[DOTOMP_FINAL_DONE]]
3626 // CHECK3: .omp.final.done:
3627 // CHECK3-NEXT: ret void
3630 // CHECK3-LABEL: define {{[^@]+}}@.omp_offloading.requires_reg
3631 // CHECK3-SAME: () #[[ATTR6:[0-9]+]] {
3632 // CHECK3-NEXT: entry:
3633 // CHECK3-NEXT: call void @__tgt_register_requires(i64 1)
3634 // CHECK3-NEXT: ret void
3637 // CHECK5-LABEL: define {{[^@]+}}@_Z9gtid_testv
3638 // CHECK5-SAME: () #[[ATTR0:[0-9]+]] {
3639 // CHECK5-NEXT: entry:
3640 // CHECK5-NEXT: [[TMP:%.*]] = alloca i32, align 4
3641 // CHECK5-NEXT: [[DOTOMP_LB:%.*]] = alloca i32, align 4
3642 // CHECK5-NEXT: [[DOTOMP_UB:%.*]] = alloca i32, align 4
3643 // CHECK5-NEXT: [[DOTOMP_IV:%.*]] = alloca i32, align 4
3644 // CHECK5-NEXT: [[I:%.*]] = alloca i32, align 4
3645 // CHECK5-NEXT: [[_TMP2:%.*]] = alloca i32, align 4
3646 // CHECK5-NEXT: [[DOTOMP_LB3:%.*]] = alloca i32, align 4
3647 // CHECK5-NEXT: [[DOTOMP_UB4:%.*]] = alloca i32, align 4
3648 // CHECK5-NEXT: [[DOTOMP_IV5:%.*]] = alloca i32, align 4
3649 // CHECK5-NEXT: [[I6:%.*]] = alloca i32, align 4
3650 // CHECK5-NEXT: store i32 0, ptr [[DOTOMP_LB]], align 4
3651 // CHECK5-NEXT: store i32 99, ptr [[DOTOMP_UB]], align 4
3652 // CHECK5-NEXT: [[TMP0:%.*]] = load i32, ptr [[DOTOMP_LB]], align 4
3653 // CHECK5-NEXT: store i32 [[TMP0]], ptr [[DOTOMP_IV]], align 4
3654 // CHECK5-NEXT: br label [[OMP_INNER_FOR_COND:%.*]]
3655 // CHECK5: omp.inner.for.cond:
3656 // CHECK5-NEXT: [[TMP1:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP2:![0-9]+]]
3657 // CHECK5-NEXT: [[TMP2:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4, !llvm.access.group [[ACC_GRP2]]
3658 // CHECK5-NEXT: [[CMP:%.*]] = icmp sle i32 [[TMP1]], [[TMP2]]
3659 // CHECK5-NEXT: br i1 [[CMP]], label [[OMP_INNER_FOR_BODY:%.*]], label [[OMP_INNER_FOR_END:%.*]]
3660 // CHECK5: omp.inner.for.body:
3661 // CHECK5-NEXT: [[TMP3:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP2]]
3662 // CHECK5-NEXT: [[MUL:%.*]] = mul nsw i32 [[TMP3]], 1
3663 // CHECK5-NEXT: [[ADD:%.*]] = add nsw i32 0, [[MUL]]
3664 // CHECK5-NEXT: store i32 [[ADD]], ptr [[I]], align 4, !llvm.access.group [[ACC_GRP2]]
3665 // CHECK5-NEXT: br label [[OMP_BODY_CONTINUE:%.*]]
3666 // CHECK5: omp.body.continue:
3667 // CHECK5-NEXT: br label [[OMP_INNER_FOR_INC:%.*]]
3668 // CHECK5: omp.inner.for.inc:
3669 // CHECK5-NEXT: [[TMP4:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP2]]
3670 // CHECK5-NEXT: [[ADD1:%.*]] = add nsw i32 [[TMP4]], 1
3671 // CHECK5-NEXT: store i32 [[ADD1]], ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP2]]
3672 // CHECK5-NEXT: br label [[OMP_INNER_FOR_COND]], !llvm.loop [[LOOP3:![0-9]+]]
3673 // CHECK5: omp.inner.for.end:
3674 // CHECK5-NEXT: store i32 100, ptr [[I]], align 4
3675 // CHECK5-NEXT: store i32 0, ptr [[DOTOMP_LB3]], align 4
3676 // CHECK5-NEXT: store i32 99, ptr [[DOTOMP_UB4]], align 4
3677 // CHECK5-NEXT: [[TMP5:%.*]] = load i32, ptr [[DOTOMP_LB3]], align 4
3678 // CHECK5-NEXT: store i32 [[TMP5]], ptr [[DOTOMP_IV5]], align 4
3679 // CHECK5-NEXT: br label [[OMP_INNER_FOR_COND7:%.*]]
3680 // CHECK5: omp.inner.for.cond7:
3681 // CHECK5-NEXT: [[TMP6:%.*]] = load i32, ptr [[DOTOMP_IV5]], align 4, !llvm.access.group [[ACC_GRP6:![0-9]+]]
3682 // CHECK5-NEXT: [[TMP7:%.*]] = load i32, ptr [[DOTOMP_UB4]], align 4, !llvm.access.group [[ACC_GRP6]]
3683 // CHECK5-NEXT: [[CMP8:%.*]] = icmp sle i32 [[TMP6]], [[TMP7]]
3684 // CHECK5-NEXT: br i1 [[CMP8]], label [[OMP_INNER_FOR_BODY9:%.*]], label [[OMP_INNER_FOR_END15:%.*]]
3685 // CHECK5: omp.inner.for.body9:
3686 // CHECK5-NEXT: [[TMP8:%.*]] = load i32, ptr [[DOTOMP_IV5]], align 4, !llvm.access.group [[ACC_GRP6]]
3687 // CHECK5-NEXT: [[MUL10:%.*]] = mul nsw i32 [[TMP8]], 1
3688 // CHECK5-NEXT: [[ADD11:%.*]] = add nsw i32 0, [[MUL10]]
3689 // CHECK5-NEXT: store i32 [[ADD11]], ptr [[I6]], align 4, !llvm.access.group [[ACC_GRP6]]
3690 // CHECK5-NEXT: call void @_Z9gtid_testv(), !llvm.access.group [[ACC_GRP6]]
3691 // CHECK5-NEXT: br label [[OMP_BODY_CONTINUE12:%.*]]
3692 // CHECK5: omp.body.continue12:
3693 // CHECK5-NEXT: br label [[OMP_INNER_FOR_INC13:%.*]]
3694 // CHECK5: omp.inner.for.inc13:
3695 // CHECK5-NEXT: [[TMP9:%.*]] = load i32, ptr [[DOTOMP_IV5]], align 4, !llvm.access.group [[ACC_GRP6]]
3696 // CHECK5-NEXT: [[ADD14:%.*]] = add nsw i32 [[TMP9]], 1
3697 // CHECK5-NEXT: store i32 [[ADD14]], ptr [[DOTOMP_IV5]], align 4, !llvm.access.group [[ACC_GRP6]]
3698 // CHECK5-NEXT: br label [[OMP_INNER_FOR_COND7]], !llvm.loop [[LOOP7:![0-9]+]]
3699 // CHECK5: omp.inner.for.end15:
3700 // CHECK5-NEXT: store i32 100, ptr [[I6]], align 4
3701 // CHECK5-NEXT: ret void
3704 // CHECK5-LABEL: define {{[^@]+}}@main
3705 // CHECK5-SAME: () #[[ATTR1:[0-9]+]] {
3706 // CHECK5-NEXT: entry:
3707 // CHECK5-NEXT: [[RETVAL:%.*]] = alloca i32, align 4
3708 // CHECK5-NEXT: [[TMP:%.*]] = alloca i32, align 4
3709 // CHECK5-NEXT: [[DOTOMP_LB:%.*]] = alloca i32, align 4
3710 // CHECK5-NEXT: [[DOTOMP_UB:%.*]] = alloca i32, align 4
3711 // CHECK5-NEXT: [[DOTOMP_IV:%.*]] = alloca i32, align 4
3712 // CHECK5-NEXT: [[I:%.*]] = alloca i32, align 4
3713 // CHECK5-NEXT: [[_TMP2:%.*]] = alloca i32, align 4
3714 // CHECK5-NEXT: [[DOTOMP_LB3:%.*]] = alloca i32, align 4
3715 // CHECK5-NEXT: [[DOTOMP_UB4:%.*]] = alloca i32, align 4
3716 // CHECK5-NEXT: [[DOTOMP_IV5:%.*]] = alloca i32, align 4
3717 // CHECK5-NEXT: [[I6:%.*]] = alloca i32, align 4
3718 // CHECK5-NEXT: [[DOTCAPTURE_EXPR_:%.*]] = alloca i8, align 1
3719 // CHECK5-NEXT: [[_TMP16:%.*]] = alloca i32, align 4
3720 // CHECK5-NEXT: [[DOTOMP_LB17:%.*]] = alloca i32, align 4
3721 // CHECK5-NEXT: [[DOTOMP_UB18:%.*]] = alloca i32, align 4
3722 // CHECK5-NEXT: [[DOTOMP_IV19:%.*]] = alloca i32, align 4
3723 // CHECK5-NEXT: [[I20:%.*]] = alloca i32, align 4
3724 // CHECK5-NEXT: store i32 0, ptr [[RETVAL]], align 4
3725 // CHECK5-NEXT: store i32 0, ptr [[DOTOMP_LB]], align 4
3726 // CHECK5-NEXT: store i32 99, ptr [[DOTOMP_UB]], align 4
3727 // CHECK5-NEXT: [[TMP0:%.*]] = load i32, ptr [[DOTOMP_LB]], align 4
3728 // CHECK5-NEXT: store i32 [[TMP0]], ptr [[DOTOMP_IV]], align 4
3729 // CHECK5-NEXT: br label [[OMP_INNER_FOR_COND:%.*]]
3730 // CHECK5: omp.inner.for.cond:
3731 // CHECK5-NEXT: [[TMP1:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP9:![0-9]+]]
3732 // CHECK5-NEXT: [[TMP2:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4, !llvm.access.group [[ACC_GRP9]]
3733 // CHECK5-NEXT: [[CMP:%.*]] = icmp sle i32 [[TMP1]], [[TMP2]]
3734 // CHECK5-NEXT: br i1 [[CMP]], label [[OMP_INNER_FOR_BODY:%.*]], label [[OMP_INNER_FOR_END:%.*]]
3735 // CHECK5: omp.inner.for.body:
3736 // CHECK5-NEXT: [[TMP3:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP9]]
3737 // CHECK5-NEXT: [[MUL:%.*]] = mul nsw i32 [[TMP3]], 1
3738 // CHECK5-NEXT: [[ADD:%.*]] = add nsw i32 0, [[MUL]]
3739 // CHECK5-NEXT: store i32 [[ADD]], ptr [[I]], align 4, !llvm.access.group [[ACC_GRP9]]
3740 // CHECK5-NEXT: call void @_Z3fn4v(), !llvm.access.group [[ACC_GRP9]]
3741 // CHECK5-NEXT: br label [[OMP_BODY_CONTINUE:%.*]]
3742 // CHECK5: omp.body.continue:
3743 // CHECK5-NEXT: br label [[OMP_INNER_FOR_INC:%.*]]
3744 // CHECK5: omp.inner.for.inc:
3745 // CHECK5-NEXT: [[TMP4:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP9]]
3746 // CHECK5-NEXT: [[ADD1:%.*]] = add nsw i32 [[TMP4]], 1
3747 // CHECK5-NEXT: store i32 [[ADD1]], ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP9]]
3748 // CHECK5-NEXT: br label [[OMP_INNER_FOR_COND]], !llvm.loop [[LOOP10:![0-9]+]]
3749 // CHECK5: omp.inner.for.end:
3750 // CHECK5-NEXT: store i32 100, ptr [[I]], align 4
3751 // CHECK5-NEXT: store i32 0, ptr [[DOTOMP_LB3]], align 4
3752 // CHECK5-NEXT: store i32 99, ptr [[DOTOMP_UB4]], align 4
3753 // CHECK5-NEXT: [[TMP5:%.*]] = load i32, ptr [[DOTOMP_LB3]], align 4
3754 // CHECK5-NEXT: store i32 [[TMP5]], ptr [[DOTOMP_IV5]], align 4
3755 // CHECK5-NEXT: br label [[OMP_INNER_FOR_COND7:%.*]]
3756 // CHECK5: omp.inner.for.cond7:
3757 // CHECK5-NEXT: [[TMP6:%.*]] = load i32, ptr [[DOTOMP_IV5]], align 4, !llvm.access.group [[ACC_GRP12:![0-9]+]]
3758 // CHECK5-NEXT: [[TMP7:%.*]] = load i32, ptr [[DOTOMP_UB4]], align 4, !llvm.access.group [[ACC_GRP12]]
3759 // CHECK5-NEXT: [[CMP8:%.*]] = icmp sle i32 [[TMP6]], [[TMP7]]
3760 // CHECK5-NEXT: br i1 [[CMP8]], label [[OMP_INNER_FOR_BODY9:%.*]], label [[OMP_INNER_FOR_END15:%.*]]
3761 // CHECK5: omp.inner.for.body9:
3762 // CHECK5-NEXT: [[TMP8:%.*]] = load i32, ptr [[DOTOMP_IV5]], align 4, !llvm.access.group [[ACC_GRP12]]
3763 // CHECK5-NEXT: [[MUL10:%.*]] = mul nsw i32 [[TMP8]], 1
3764 // CHECK5-NEXT: [[ADD11:%.*]] = add nsw i32 0, [[MUL10]]
3765 // CHECK5-NEXT: store i32 [[ADD11]], ptr [[I6]], align 4, !llvm.access.group [[ACC_GRP12]]
3766 // CHECK5-NEXT: call void @_Z3fn5v(), !llvm.access.group [[ACC_GRP12]]
3767 // CHECK5-NEXT: br label [[OMP_BODY_CONTINUE12:%.*]]
3768 // CHECK5: omp.body.continue12:
3769 // CHECK5-NEXT: br label [[OMP_INNER_FOR_INC13:%.*]]
3770 // CHECK5: omp.inner.for.inc13:
3771 // CHECK5-NEXT: [[TMP9:%.*]] = load i32, ptr [[DOTOMP_IV5]], align 4, !llvm.access.group [[ACC_GRP12]]
3772 // CHECK5-NEXT: [[ADD14:%.*]] = add nsw i32 [[TMP9]], 1
3773 // CHECK5-NEXT: store i32 [[ADD14]], ptr [[DOTOMP_IV5]], align 4, !llvm.access.group [[ACC_GRP12]]
3774 // CHECK5-NEXT: br label [[OMP_INNER_FOR_COND7]], !llvm.loop [[LOOP13:![0-9]+]]
3775 // CHECK5: omp.inner.for.end15:
3776 // CHECK5-NEXT: store i32 100, ptr [[I6]], align 4
3777 // CHECK5-NEXT: [[TMP10:%.*]] = load i32, ptr @Arg, align 4
3778 // CHECK5-NEXT: [[TOBOOL:%.*]] = icmp ne i32 [[TMP10]], 0
3779 // CHECK5-NEXT: [[FROMBOOL:%.*]] = zext i1 [[TOBOOL]] to i8
3780 // CHECK5-NEXT: store i8 [[FROMBOOL]], ptr [[DOTCAPTURE_EXPR_]], align 1
3781 // CHECK5-NEXT: store i32 0, ptr [[DOTOMP_LB17]], align 4
3782 // CHECK5-NEXT: store i32 99, ptr [[DOTOMP_UB18]], align 4
3783 // CHECK5-NEXT: [[TMP11:%.*]] = load i32, ptr [[DOTOMP_LB17]], align 4
3784 // CHECK5-NEXT: store i32 [[TMP11]], ptr [[DOTOMP_IV19]], align 4
3785 // CHECK5-NEXT: br label [[OMP_INNER_FOR_COND21:%.*]]
3786 // CHECK5: omp.inner.for.cond21:
3787 // CHECK5-NEXT: [[TMP12:%.*]] = load i32, ptr [[DOTOMP_IV19]], align 4, !llvm.access.group [[ACC_GRP15:![0-9]+]]
3788 // CHECK5-NEXT: [[TMP13:%.*]] = load i32, ptr [[DOTOMP_UB18]], align 4, !llvm.access.group [[ACC_GRP15]]
3789 // CHECK5-NEXT: [[CMP22:%.*]] = icmp sle i32 [[TMP12]], [[TMP13]]
3790 // CHECK5-NEXT: br i1 [[CMP22]], label [[OMP_INNER_FOR_BODY23:%.*]], label [[OMP_INNER_FOR_END29:%.*]]
3791 // CHECK5: omp.inner.for.body23:
3792 // CHECK5-NEXT: [[TMP14:%.*]] = load i32, ptr [[DOTOMP_IV19]], align 4, !llvm.access.group [[ACC_GRP15]]
3793 // CHECK5-NEXT: [[MUL24:%.*]] = mul nsw i32 [[TMP14]], 1
3794 // CHECK5-NEXT: [[ADD25:%.*]] = add nsw i32 0, [[MUL24]]
3795 // CHECK5-NEXT: store i32 [[ADD25]], ptr [[I20]], align 4, !llvm.access.group [[ACC_GRP15]]
3796 // CHECK5-NEXT: call void @_Z3fn6v(), !llvm.access.group [[ACC_GRP15]]
3797 // CHECK5-NEXT: br label [[OMP_BODY_CONTINUE26:%.*]]
3798 // CHECK5: omp.body.continue26:
3799 // CHECK5-NEXT: br label [[OMP_INNER_FOR_INC27:%.*]]
3800 // CHECK5: omp.inner.for.inc27:
3801 // CHECK5-NEXT: [[TMP15:%.*]] = load i32, ptr [[DOTOMP_IV19]], align 4, !llvm.access.group [[ACC_GRP15]]
3802 // CHECK5-NEXT: [[ADD28:%.*]] = add nsw i32 [[TMP15]], 1
3803 // CHECK5-NEXT: store i32 [[ADD28]], ptr [[DOTOMP_IV19]], align 4, !llvm.access.group [[ACC_GRP15]]
3804 // CHECK5-NEXT: br label [[OMP_INNER_FOR_COND21]], !llvm.loop [[LOOP16:![0-9]+]]
3805 // CHECK5: omp.inner.for.end29:
3806 // CHECK5-NEXT: store i32 100, ptr [[I20]], align 4
3807 // CHECK5-NEXT: [[TMP16:%.*]] = load i32, ptr @Arg, align 4
3808 // CHECK5-NEXT: [[CALL:%.*]] = call noundef i32 @_Z5tmainIiEiT_(i32 noundef [[TMP16]])
3809 // CHECK5-NEXT: ret i32 [[CALL]]
3812 // CHECK5-LABEL: define {{[^@]+}}@_Z5tmainIiEiT_
3813 // CHECK5-SAME: (i32 noundef [[ARG:%.*]]) #[[ATTR0]] comdat {
3814 // CHECK5-NEXT: entry:
3815 // CHECK5-NEXT: [[ARG_ADDR:%.*]] = alloca i32, align 4
3816 // CHECK5-NEXT: [[TMP:%.*]] = alloca i32, align 4
3817 // CHECK5-NEXT: [[DOTOMP_LB:%.*]] = alloca i32, align 4
3818 // CHECK5-NEXT: [[DOTOMP_UB:%.*]] = alloca i32, align 4
3819 // CHECK5-NEXT: [[DOTOMP_IV:%.*]] = alloca i32, align 4
3820 // CHECK5-NEXT: [[I:%.*]] = alloca i32, align 4
3821 // CHECK5-NEXT: [[_TMP2:%.*]] = alloca i32, align 4
3822 // CHECK5-NEXT: [[DOTOMP_LB3:%.*]] = alloca i32, align 4
3823 // CHECK5-NEXT: [[DOTOMP_UB4:%.*]] = alloca i32, align 4
3824 // CHECK5-NEXT: [[DOTOMP_IV5:%.*]] = alloca i32, align 4
3825 // CHECK5-NEXT: [[I6:%.*]] = alloca i32, align 4
3826 // CHECK5-NEXT: [[DOTCAPTURE_EXPR_:%.*]] = alloca i8, align 1
3827 // CHECK5-NEXT: [[_TMP16:%.*]] = alloca i32, align 4
3828 // CHECK5-NEXT: [[DOTOMP_LB17:%.*]] = alloca i32, align 4
3829 // CHECK5-NEXT: [[DOTOMP_UB18:%.*]] = alloca i32, align 4
3830 // CHECK5-NEXT: [[DOTOMP_IV19:%.*]] = alloca i32, align 4
3831 // CHECK5-NEXT: [[I20:%.*]] = alloca i32, align 4
3832 // CHECK5-NEXT: store i32 [[ARG]], ptr [[ARG_ADDR]], align 4
3833 // CHECK5-NEXT: store i32 0, ptr [[DOTOMP_LB]], align 4
3834 // CHECK5-NEXT: store i32 99, ptr [[DOTOMP_UB]], align 4
3835 // CHECK5-NEXT: [[TMP0:%.*]] = load i32, ptr [[DOTOMP_LB]], align 4
3836 // CHECK5-NEXT: store i32 [[TMP0]], ptr [[DOTOMP_IV]], align 4
3837 // CHECK5-NEXT: br label [[OMP_INNER_FOR_COND:%.*]]
3838 // CHECK5: omp.inner.for.cond:
3839 // CHECK5-NEXT: [[TMP1:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP18:![0-9]+]]
3840 // CHECK5-NEXT: [[TMP2:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4, !llvm.access.group [[ACC_GRP18]]
3841 // CHECK5-NEXT: [[CMP:%.*]] = icmp sle i32 [[TMP1]], [[TMP2]]
3842 // CHECK5-NEXT: br i1 [[CMP]], label [[OMP_INNER_FOR_BODY:%.*]], label [[OMP_INNER_FOR_END:%.*]]
3843 // CHECK5: omp.inner.for.body:
3844 // CHECK5-NEXT: [[TMP3:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP18]]
3845 // CHECK5-NEXT: [[MUL:%.*]] = mul nsw i32 [[TMP3]], 1
3846 // CHECK5-NEXT: [[ADD:%.*]] = add nsw i32 0, [[MUL]]
3847 // CHECK5-NEXT: store i32 [[ADD]], ptr [[I]], align 4, !llvm.access.group [[ACC_GRP18]]
3848 // CHECK5-NEXT: call void @_Z3fn1v(), !llvm.access.group [[ACC_GRP18]]
3849 // CHECK5-NEXT: br label [[OMP_BODY_CONTINUE:%.*]]
3850 // CHECK5: omp.body.continue:
3851 // CHECK5-NEXT: br label [[OMP_INNER_FOR_INC:%.*]]
3852 // CHECK5: omp.inner.for.inc:
3853 // CHECK5-NEXT: [[TMP4:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP18]]
3854 // CHECK5-NEXT: [[ADD1:%.*]] = add nsw i32 [[TMP4]], 1
3855 // CHECK5-NEXT: store i32 [[ADD1]], ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP18]]
3856 // CHECK5-NEXT: br label [[OMP_INNER_FOR_COND]], !llvm.loop [[LOOP19:![0-9]+]]
3857 // CHECK5: omp.inner.for.end:
3858 // CHECK5-NEXT: store i32 100, ptr [[I]], align 4
3859 // CHECK5-NEXT: store i32 0, ptr [[DOTOMP_LB3]], align 4
3860 // CHECK5-NEXT: store i32 99, ptr [[DOTOMP_UB4]], align 4
3861 // CHECK5-NEXT: [[TMP5:%.*]] = load i32, ptr [[DOTOMP_LB3]], align 4
3862 // CHECK5-NEXT: store i32 [[TMP5]], ptr [[DOTOMP_IV5]], align 4
3863 // CHECK5-NEXT: br label [[OMP_INNER_FOR_COND7:%.*]]
3864 // CHECK5: omp.inner.for.cond7:
3865 // CHECK5-NEXT: [[TMP6:%.*]] = load i32, ptr [[DOTOMP_IV5]], align 4, !llvm.access.group [[ACC_GRP21:![0-9]+]]
3866 // CHECK5-NEXT: [[TMP7:%.*]] = load i32, ptr [[DOTOMP_UB4]], align 4, !llvm.access.group [[ACC_GRP21]]
3867 // CHECK5-NEXT: [[CMP8:%.*]] = icmp sle i32 [[TMP6]], [[TMP7]]
3868 // CHECK5-NEXT: br i1 [[CMP8]], label [[OMP_INNER_FOR_BODY9:%.*]], label [[OMP_INNER_FOR_END15:%.*]]
3869 // CHECK5: omp.inner.for.body9:
3870 // CHECK5-NEXT: [[TMP8:%.*]] = load i32, ptr [[DOTOMP_IV5]], align 4, !llvm.access.group [[ACC_GRP21]]
3871 // CHECK5-NEXT: [[MUL10:%.*]] = mul nsw i32 [[TMP8]], 1
3872 // CHECK5-NEXT: [[ADD11:%.*]] = add nsw i32 0, [[MUL10]]
3873 // CHECK5-NEXT: store i32 [[ADD11]], ptr [[I6]], align 4, !llvm.access.group [[ACC_GRP21]]
3874 // CHECK5-NEXT: call void @_Z3fn2v(), !llvm.access.group [[ACC_GRP21]]
3875 // CHECK5-NEXT: br label [[OMP_BODY_CONTINUE12:%.*]]
3876 // CHECK5: omp.body.continue12:
3877 // CHECK5-NEXT: br label [[OMP_INNER_FOR_INC13:%.*]]
3878 // CHECK5: omp.inner.for.inc13:
3879 // CHECK5-NEXT: [[TMP9:%.*]] = load i32, ptr [[DOTOMP_IV5]], align 4, !llvm.access.group [[ACC_GRP21]]
3880 // CHECK5-NEXT: [[ADD14:%.*]] = add nsw i32 [[TMP9]], 1
3881 // CHECK5-NEXT: store i32 [[ADD14]], ptr [[DOTOMP_IV5]], align 4, !llvm.access.group [[ACC_GRP21]]
3882 // CHECK5-NEXT: br label [[OMP_INNER_FOR_COND7]], !llvm.loop [[LOOP22:![0-9]+]]
3883 // CHECK5: omp.inner.for.end15:
3884 // CHECK5-NEXT: store i32 100, ptr [[I6]], align 4
3885 // CHECK5-NEXT: [[TMP10:%.*]] = load i32, ptr [[ARG_ADDR]], align 4
3886 // CHECK5-NEXT: [[TOBOOL:%.*]] = icmp ne i32 [[TMP10]], 0
3887 // CHECK5-NEXT: [[FROMBOOL:%.*]] = zext i1 [[TOBOOL]] to i8
3888 // CHECK5-NEXT: store i8 [[FROMBOOL]], ptr [[DOTCAPTURE_EXPR_]], align 1
3889 // CHECK5-NEXT: store i32 0, ptr [[DOTOMP_LB17]], align 4
3890 // CHECK5-NEXT: store i32 99, ptr [[DOTOMP_UB18]], align 4
3891 // CHECK5-NEXT: [[TMP11:%.*]] = load i32, ptr [[DOTOMP_LB17]], align 4
3892 // CHECK5-NEXT: store i32 [[TMP11]], ptr [[DOTOMP_IV19]], align 4
3893 // CHECK5-NEXT: br label [[OMP_INNER_FOR_COND21:%.*]]
3894 // CHECK5: omp.inner.for.cond21:
3895 // CHECK5-NEXT: [[TMP12:%.*]] = load i32, ptr [[DOTOMP_IV19]], align 4, !llvm.access.group [[ACC_GRP24:![0-9]+]]
3896 // CHECK5-NEXT: [[TMP13:%.*]] = load i32, ptr [[DOTOMP_UB18]], align 4, !llvm.access.group [[ACC_GRP24]]
3897 // CHECK5-NEXT: [[CMP22:%.*]] = icmp sle i32 [[TMP12]], [[TMP13]]
3898 // CHECK5-NEXT: br i1 [[CMP22]], label [[OMP_INNER_FOR_BODY23:%.*]], label [[OMP_INNER_FOR_END29:%.*]]
3899 // CHECK5: omp.inner.for.body23:
3900 // CHECK5-NEXT: [[TMP14:%.*]] = load i32, ptr [[DOTOMP_IV19]], align 4, !llvm.access.group [[ACC_GRP24]]
3901 // CHECK5-NEXT: [[MUL24:%.*]] = mul nsw i32 [[TMP14]], 1
3902 // CHECK5-NEXT: [[ADD25:%.*]] = add nsw i32 0, [[MUL24]]
3903 // CHECK5-NEXT: store i32 [[ADD25]], ptr [[I20]], align 4, !llvm.access.group [[ACC_GRP24]]
3904 // CHECK5-NEXT: call void @_Z3fn3v(), !llvm.access.group [[ACC_GRP24]]
3905 // CHECK5-NEXT: br label [[OMP_BODY_CONTINUE26:%.*]]
3906 // CHECK5: omp.body.continue26:
3907 // CHECK5-NEXT: br label [[OMP_INNER_FOR_INC27:%.*]]
3908 // CHECK5: omp.inner.for.inc27:
3909 // CHECK5-NEXT: [[TMP15:%.*]] = load i32, ptr [[DOTOMP_IV19]], align 4, !llvm.access.group [[ACC_GRP24]]
3910 // CHECK5-NEXT: [[ADD28:%.*]] = add nsw i32 [[TMP15]], 1
3911 // CHECK5-NEXT: store i32 [[ADD28]], ptr [[DOTOMP_IV19]], align 4, !llvm.access.group [[ACC_GRP24]]
3912 // CHECK5-NEXT: br label [[OMP_INNER_FOR_COND21]], !llvm.loop [[LOOP25:![0-9]+]]
3913 // CHECK5: omp.inner.for.end29:
3914 // CHECK5-NEXT: store i32 100, ptr [[I20]], align 4
3915 // CHECK5-NEXT: ret i32 0
3918 // CHECK7-LABEL: define {{[^@]+}}@_Z9gtid_testv
3919 // CHECK7-SAME: () #[[ATTR0:[0-9]+]] {
3920 // CHECK7-NEXT: entry:
3921 // CHECK7-NEXT: [[TMP:%.*]] = alloca i32, align 4
3922 // CHECK7-NEXT: [[DOTOMP_LB:%.*]] = alloca i32, align 4
3923 // CHECK7-NEXT: [[DOTOMP_UB:%.*]] = alloca i32, align 4
3924 // CHECK7-NEXT: [[DOTOMP_IV:%.*]] = alloca i32, align 4
3925 // CHECK7-NEXT: [[I:%.*]] = alloca i32, align 4
3926 // CHECK7-NEXT: [[_TMP2:%.*]] = alloca i32, align 4
3927 // CHECK7-NEXT: [[DOTOMP_LB3:%.*]] = alloca i32, align 4
3928 // CHECK7-NEXT: [[DOTOMP_UB4:%.*]] = alloca i32, align 4
3929 // CHECK7-NEXT: [[DOTOMP_IV5:%.*]] = alloca i32, align 4
3930 // CHECK7-NEXT: [[I6:%.*]] = alloca i32, align 4
3931 // CHECK7-NEXT: store i32 0, ptr [[DOTOMP_LB]], align 4
3932 // CHECK7-NEXT: store i32 99, ptr [[DOTOMP_UB]], align 4
3933 // CHECK7-NEXT: [[TMP0:%.*]] = load i32, ptr [[DOTOMP_LB]], align 4
3934 // CHECK7-NEXT: store i32 [[TMP0]], ptr [[DOTOMP_IV]], align 4
3935 // CHECK7-NEXT: br label [[OMP_INNER_FOR_COND:%.*]]
3936 // CHECK7: omp.inner.for.cond:
3937 // CHECK7-NEXT: [[TMP1:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP2:![0-9]+]]
3938 // CHECK7-NEXT: [[TMP2:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4, !llvm.access.group [[ACC_GRP2]]
3939 // CHECK7-NEXT: [[CMP:%.*]] = icmp sle i32 [[TMP1]], [[TMP2]]
3940 // CHECK7-NEXT: br i1 [[CMP]], label [[OMP_INNER_FOR_BODY:%.*]], label [[OMP_INNER_FOR_END:%.*]]
3941 // CHECK7: omp.inner.for.body:
3942 // CHECK7-NEXT: [[TMP3:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP2]]
3943 // CHECK7-NEXT: [[MUL:%.*]] = mul nsw i32 [[TMP3]], 1
3944 // CHECK7-NEXT: [[ADD:%.*]] = add nsw i32 0, [[MUL]]
3945 // CHECK7-NEXT: store i32 [[ADD]], ptr [[I]], align 4, !llvm.access.group [[ACC_GRP2]]
3946 // CHECK7-NEXT: br label [[OMP_BODY_CONTINUE:%.*]]
3947 // CHECK7: omp.body.continue:
3948 // CHECK7-NEXT: br label [[OMP_INNER_FOR_INC:%.*]]
3949 // CHECK7: omp.inner.for.inc:
3950 // CHECK7-NEXT: [[TMP4:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP2]]
3951 // CHECK7-NEXT: [[ADD1:%.*]] = add nsw i32 [[TMP4]], 1
3952 // CHECK7-NEXT: store i32 [[ADD1]], ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP2]]
3953 // CHECK7-NEXT: br label [[OMP_INNER_FOR_COND]], !llvm.loop [[LOOP3:![0-9]+]]
3954 // CHECK7: omp.inner.for.end:
3955 // CHECK7-NEXT: store i32 100, ptr [[I]], align 4
3956 // CHECK7-NEXT: store i32 0, ptr [[DOTOMP_LB3]], align 4
3957 // CHECK7-NEXT: store i32 99, ptr [[DOTOMP_UB4]], align 4
3958 // CHECK7-NEXT: [[TMP5:%.*]] = load i32, ptr [[DOTOMP_LB3]], align 4
3959 // CHECK7-NEXT: store i32 [[TMP5]], ptr [[DOTOMP_IV5]], align 4
3960 // CHECK7-NEXT: br label [[OMP_INNER_FOR_COND7:%.*]]
3961 // CHECK7: omp.inner.for.cond7:
3962 // CHECK7-NEXT: [[TMP6:%.*]] = load i32, ptr [[DOTOMP_IV5]], align 4, !llvm.access.group [[ACC_GRP6:![0-9]+]]
3963 // CHECK7-NEXT: [[TMP7:%.*]] = load i32, ptr [[DOTOMP_UB4]], align 4, !llvm.access.group [[ACC_GRP6]]
3964 // CHECK7-NEXT: [[CMP8:%.*]] = icmp sle i32 [[TMP6]], [[TMP7]]
3965 // CHECK7-NEXT: br i1 [[CMP8]], label [[OMP_INNER_FOR_BODY9:%.*]], label [[OMP_INNER_FOR_END15:%.*]]
3966 // CHECK7: omp.inner.for.body9:
3967 // CHECK7-NEXT: [[TMP8:%.*]] = load i32, ptr [[DOTOMP_IV5]], align 4, !llvm.access.group [[ACC_GRP6]]
3968 // CHECK7-NEXT: [[MUL10:%.*]] = mul nsw i32 [[TMP8]], 1
3969 // CHECK7-NEXT: [[ADD11:%.*]] = add nsw i32 0, [[MUL10]]
3970 // CHECK7-NEXT: store i32 [[ADD11]], ptr [[I6]], align 4, !llvm.access.group [[ACC_GRP6]]
3971 // CHECK7-NEXT: call void @_Z9gtid_testv(), !llvm.access.group [[ACC_GRP6]]
3972 // CHECK7-NEXT: br label [[OMP_BODY_CONTINUE12:%.*]]
3973 // CHECK7: omp.body.continue12:
3974 // CHECK7-NEXT: br label [[OMP_INNER_FOR_INC13:%.*]]
3975 // CHECK7: omp.inner.for.inc13:
3976 // CHECK7-NEXT: [[TMP9:%.*]] = load i32, ptr [[DOTOMP_IV5]], align 4, !llvm.access.group [[ACC_GRP6]]
3977 // CHECK7-NEXT: [[ADD14:%.*]] = add nsw i32 [[TMP9]], 1
3978 // CHECK7-NEXT: store i32 [[ADD14]], ptr [[DOTOMP_IV5]], align 4, !llvm.access.group [[ACC_GRP6]]
3979 // CHECK7-NEXT: br label [[OMP_INNER_FOR_COND7]], !llvm.loop [[LOOP7:![0-9]+]]
3980 // CHECK7: omp.inner.for.end15:
3981 // CHECK7-NEXT: store i32 100, ptr [[I6]], align 4
3982 // CHECK7-NEXT: ret void
3985 // CHECK7-LABEL: define {{[^@]+}}@main
3986 // CHECK7-SAME: () #[[ATTR1:[0-9]+]] {
3987 // CHECK7-NEXT: entry:
3988 // CHECK7-NEXT: [[RETVAL:%.*]] = alloca i32, align 4
3989 // CHECK7-NEXT: [[TMP:%.*]] = alloca i32, align 4
3990 // CHECK7-NEXT: [[DOTOMP_LB:%.*]] = alloca i32, align 4
3991 // CHECK7-NEXT: [[DOTOMP_UB:%.*]] = alloca i32, align 4
3992 // CHECK7-NEXT: [[DOTOMP_IV:%.*]] = alloca i32, align 4
3993 // CHECK7-NEXT: [[I:%.*]] = alloca i32, align 4
3994 // CHECK7-NEXT: [[_TMP2:%.*]] = alloca i32, align 4
3995 // CHECK7-NEXT: [[DOTOMP_LB3:%.*]] = alloca i32, align 4
3996 // CHECK7-NEXT: [[DOTOMP_UB4:%.*]] = alloca i32, align 4
3997 // CHECK7-NEXT: [[DOTOMP_IV5:%.*]] = alloca i32, align 4
3998 // CHECK7-NEXT: [[I6:%.*]] = alloca i32, align 4
3999 // CHECK7-NEXT: [[DOTCAPTURE_EXPR_:%.*]] = alloca i8, align 1
4000 // CHECK7-NEXT: [[_TMP16:%.*]] = alloca i32, align 4
4001 // CHECK7-NEXT: [[DOTOMP_LB17:%.*]] = alloca i32, align 4
4002 // CHECK7-NEXT: [[DOTOMP_UB18:%.*]] = alloca i32, align 4
4003 // CHECK7-NEXT: [[DOTOMP_IV19:%.*]] = alloca i32, align 4
4004 // CHECK7-NEXT: [[I20:%.*]] = alloca i32, align 4
4005 // CHECK7-NEXT: store i32 0, ptr [[RETVAL]], align 4
4006 // CHECK7-NEXT: store i32 0, ptr [[DOTOMP_LB]], align 4
4007 // CHECK7-NEXT: store i32 99, ptr [[DOTOMP_UB]], align 4
4008 // CHECK7-NEXT: [[TMP0:%.*]] = load i32, ptr [[DOTOMP_LB]], align 4
4009 // CHECK7-NEXT: store i32 [[TMP0]], ptr [[DOTOMP_IV]], align 4
4010 // CHECK7-NEXT: br label [[OMP_INNER_FOR_COND:%.*]]
4011 // CHECK7: omp.inner.for.cond:
4012 // CHECK7-NEXT: [[TMP1:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP9:![0-9]+]]
4013 // CHECK7-NEXT: [[TMP2:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4, !llvm.access.group [[ACC_GRP9]]
4014 // CHECK7-NEXT: [[CMP:%.*]] = icmp sle i32 [[TMP1]], [[TMP2]]
4015 // CHECK7-NEXT: br i1 [[CMP]], label [[OMP_INNER_FOR_BODY:%.*]], label [[OMP_INNER_FOR_END:%.*]]
4016 // CHECK7: omp.inner.for.body:
4017 // CHECK7-NEXT: [[TMP3:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP9]]
4018 // CHECK7-NEXT: [[MUL:%.*]] = mul nsw i32 [[TMP3]], 1
4019 // CHECK7-NEXT: [[ADD:%.*]] = add nsw i32 0, [[MUL]]
4020 // CHECK7-NEXT: store i32 [[ADD]], ptr [[I]], align 4, !llvm.access.group [[ACC_GRP9]]
4021 // CHECK7-NEXT: call void @_Z3fn4v(), !llvm.access.group [[ACC_GRP9]]
4022 // CHECK7-NEXT: br label [[OMP_BODY_CONTINUE:%.*]]
4023 // CHECK7: omp.body.continue:
4024 // CHECK7-NEXT: br label [[OMP_INNER_FOR_INC:%.*]]
4025 // CHECK7: omp.inner.for.inc:
4026 // CHECK7-NEXT: [[TMP4:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP9]]
4027 // CHECK7-NEXT: [[ADD1:%.*]] = add nsw i32 [[TMP4]], 1
4028 // CHECK7-NEXT: store i32 [[ADD1]], ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP9]]
4029 // CHECK7-NEXT: br label [[OMP_INNER_FOR_COND]], !llvm.loop [[LOOP10:![0-9]+]]
4030 // CHECK7: omp.inner.for.end:
4031 // CHECK7-NEXT: store i32 100, ptr [[I]], align 4
4032 // CHECK7-NEXT: store i32 0, ptr [[DOTOMP_LB3]], align 4
4033 // CHECK7-NEXT: store i32 99, ptr [[DOTOMP_UB4]], align 4
4034 // CHECK7-NEXT: [[TMP5:%.*]] = load i32, ptr [[DOTOMP_LB3]], align 4
4035 // CHECK7-NEXT: store i32 [[TMP5]], ptr [[DOTOMP_IV5]], align 4
4036 // CHECK7-NEXT: br label [[OMP_INNER_FOR_COND7:%.*]]
4037 // CHECK7: omp.inner.for.cond7:
4038 // CHECK7-NEXT: [[TMP6:%.*]] = load i32, ptr [[DOTOMP_IV5]], align 4
4039 // CHECK7-NEXT: [[TMP7:%.*]] = load i32, ptr [[DOTOMP_UB4]], align 4
4040 // CHECK7-NEXT: [[CMP8:%.*]] = icmp sle i32 [[TMP6]], [[TMP7]]
4041 // CHECK7-NEXT: br i1 [[CMP8]], label [[OMP_INNER_FOR_BODY9:%.*]], label [[OMP_INNER_FOR_END15:%.*]]
4042 // CHECK7: omp.inner.for.body9:
4043 // CHECK7-NEXT: [[TMP8:%.*]] = load i32, ptr [[DOTOMP_IV5]], align 4
4044 // CHECK7-NEXT: [[MUL10:%.*]] = mul nsw i32 [[TMP8]], 1
4045 // CHECK7-NEXT: [[ADD11:%.*]] = add nsw i32 0, [[MUL10]]
4046 // CHECK7-NEXT: store i32 [[ADD11]], ptr [[I6]], align 4
4047 // CHECK7-NEXT: call void @_Z3fn5v()
4048 // CHECK7-NEXT: br label [[OMP_BODY_CONTINUE12:%.*]]
4049 // CHECK7: omp.body.continue12:
4050 // CHECK7-NEXT: br label [[OMP_INNER_FOR_INC13:%.*]]
4051 // CHECK7: omp.inner.for.inc13:
4052 // CHECK7-NEXT: [[TMP9:%.*]] = load i32, ptr [[DOTOMP_IV5]], align 4
4053 // CHECK7-NEXT: [[ADD14:%.*]] = add nsw i32 [[TMP9]], 1
4054 // CHECK7-NEXT: store i32 [[ADD14]], ptr [[DOTOMP_IV5]], align 4
4055 // CHECK7-NEXT: br label [[OMP_INNER_FOR_COND7]], !llvm.loop [[LOOP12:![0-9]+]]
4056 // CHECK7: omp.inner.for.end15:
4057 // CHECK7-NEXT: store i32 100, ptr [[I6]], align 4
4058 // CHECK7-NEXT: [[TMP10:%.*]] = load i32, ptr @Arg, align 4
4059 // CHECK7-NEXT: [[TOBOOL:%.*]] = icmp ne i32 [[TMP10]], 0
4060 // CHECK7-NEXT: [[FROMBOOL:%.*]] = zext i1 [[TOBOOL]] to i8
4061 // CHECK7-NEXT: store i8 [[FROMBOOL]], ptr [[DOTCAPTURE_EXPR_]], align 1
4062 // CHECK7-NEXT: store i32 0, ptr [[DOTOMP_LB17]], align 4
4063 // CHECK7-NEXT: store i32 99, ptr [[DOTOMP_UB18]], align 4
4064 // CHECK7-NEXT: [[TMP11:%.*]] = load i32, ptr [[DOTOMP_LB17]], align 4
4065 // CHECK7-NEXT: store i32 [[TMP11]], ptr [[DOTOMP_IV19]], align 4
4066 // CHECK7-NEXT: [[TMP12:%.*]] = load i8, ptr [[DOTCAPTURE_EXPR_]], align 1
4067 // CHECK7-NEXT: [[TOBOOL21:%.*]] = trunc i8 [[TMP12]] to i1
4068 // CHECK7-NEXT: br i1 [[TOBOOL21]], label [[OMP_IF_THEN:%.*]], label [[OMP_IF_ELSE:%.*]]
4069 // CHECK7: omp_if.then:
4070 // CHECK7-NEXT: br label [[OMP_INNER_FOR_COND22:%.*]]
4071 // CHECK7: omp.inner.for.cond22:
4072 // CHECK7-NEXT: [[TMP13:%.*]] = load i32, ptr [[DOTOMP_IV19]], align 4, !llvm.access.group [[ACC_GRP14:![0-9]+]]
4073 // CHECK7-NEXT: [[TMP14:%.*]] = load i32, ptr [[DOTOMP_UB18]], align 4, !llvm.access.group [[ACC_GRP14]]
4074 // CHECK7-NEXT: [[CMP23:%.*]] = icmp sle i32 [[TMP13]], [[TMP14]]
4075 // CHECK7-NEXT: br i1 [[CMP23]], label [[OMP_INNER_FOR_BODY24:%.*]], label [[OMP_INNER_FOR_END30:%.*]]
4076 // CHECK7: omp.inner.for.body24:
4077 // CHECK7-NEXT: [[TMP15:%.*]] = load i32, ptr [[DOTOMP_IV19]], align 4, !llvm.access.group [[ACC_GRP14]]
4078 // CHECK7-NEXT: [[MUL25:%.*]] = mul nsw i32 [[TMP15]], 1
4079 // CHECK7-NEXT: [[ADD26:%.*]] = add nsw i32 0, [[MUL25]]
4080 // CHECK7-NEXT: store i32 [[ADD26]], ptr [[I20]], align 4, !llvm.access.group [[ACC_GRP14]]
4081 // CHECK7-NEXT: call void @_Z3fn6v(), !llvm.access.group [[ACC_GRP14]]
4082 // CHECK7-NEXT: br label [[OMP_BODY_CONTINUE27:%.*]]
4083 // CHECK7: omp.body.continue27:
4084 // CHECK7-NEXT: br label [[OMP_INNER_FOR_INC28:%.*]]
4085 // CHECK7: omp.inner.for.inc28:
4086 // CHECK7-NEXT: [[TMP16:%.*]] = load i32, ptr [[DOTOMP_IV19]], align 4, !llvm.access.group [[ACC_GRP14]]
4087 // CHECK7-NEXT: [[ADD29:%.*]] = add nsw i32 [[TMP16]], 1
4088 // CHECK7-NEXT: store i32 [[ADD29]], ptr [[DOTOMP_IV19]], align 4, !llvm.access.group [[ACC_GRP14]]
4089 // CHECK7-NEXT: br label [[OMP_INNER_FOR_COND22]], !llvm.loop [[LOOP15:![0-9]+]]
4090 // CHECK7: omp.inner.for.end30:
4091 // CHECK7-NEXT: br label [[OMP_IF_END:%.*]]
4092 // CHECK7: omp_if.else:
4093 // CHECK7-NEXT: br label [[OMP_INNER_FOR_COND31:%.*]]
4094 // CHECK7: omp.inner.for.cond31:
4095 // CHECK7-NEXT: [[TMP17:%.*]] = load i32, ptr [[DOTOMP_IV19]], align 4
4096 // CHECK7-NEXT: [[TMP18:%.*]] = load i32, ptr [[DOTOMP_UB18]], align 4
4097 // CHECK7-NEXT: [[CMP32:%.*]] = icmp sle i32 [[TMP17]], [[TMP18]]
4098 // CHECK7-NEXT: br i1 [[CMP32]], label [[OMP_INNER_FOR_BODY33:%.*]], label [[OMP_INNER_FOR_END39:%.*]]
4099 // CHECK7: omp.inner.for.body33:
4100 // CHECK7-NEXT: [[TMP19:%.*]] = load i32, ptr [[DOTOMP_IV19]], align 4
4101 // CHECK7-NEXT: [[MUL34:%.*]] = mul nsw i32 [[TMP19]], 1
4102 // CHECK7-NEXT: [[ADD35:%.*]] = add nsw i32 0, [[MUL34]]
4103 // CHECK7-NEXT: store i32 [[ADD35]], ptr [[I20]], align 4
4104 // CHECK7-NEXT: call void @_Z3fn6v()
4105 // CHECK7-NEXT: br label [[OMP_BODY_CONTINUE36:%.*]]
4106 // CHECK7: omp.body.continue36:
4107 // CHECK7-NEXT: br label [[OMP_INNER_FOR_INC37:%.*]]
4108 // CHECK7: omp.inner.for.inc37:
4109 // CHECK7-NEXT: [[TMP20:%.*]] = load i32, ptr [[DOTOMP_IV19]], align 4
4110 // CHECK7-NEXT: [[ADD38:%.*]] = add nsw i32 [[TMP20]], 1
4111 // CHECK7-NEXT: store i32 [[ADD38]], ptr [[DOTOMP_IV19]], align 4
4112 // CHECK7-NEXT: br label [[OMP_INNER_FOR_COND31]], !llvm.loop [[LOOP17:![0-9]+]]
4113 // CHECK7: omp.inner.for.end39:
4114 // CHECK7-NEXT: br label [[OMP_IF_END]]
4115 // CHECK7: omp_if.end:
4116 // CHECK7-NEXT: store i32 100, ptr [[I20]], align 4
4117 // CHECK7-NEXT: [[TMP21:%.*]] = load i32, ptr @Arg, align 4
4118 // CHECK7-NEXT: [[CALL:%.*]] = call noundef i32 @_Z5tmainIiEiT_(i32 noundef [[TMP21]])
4119 // CHECK7-NEXT: ret i32 [[CALL]]
4122 // CHECK7-LABEL: define {{[^@]+}}@_Z5tmainIiEiT_
4123 // CHECK7-SAME: (i32 noundef [[ARG:%.*]]) #[[ATTR0]] comdat {
4124 // CHECK7-NEXT: entry:
4125 // CHECK7-NEXT: [[ARG_ADDR:%.*]] = alloca i32, align 4
4126 // CHECK7-NEXT: [[TMP:%.*]] = alloca i32, align 4
4127 // CHECK7-NEXT: [[DOTOMP_LB:%.*]] = alloca i32, align 4
4128 // CHECK7-NEXT: [[DOTOMP_UB:%.*]] = alloca i32, align 4
4129 // CHECK7-NEXT: [[DOTOMP_IV:%.*]] = alloca i32, align 4
4130 // CHECK7-NEXT: [[I:%.*]] = alloca i32, align 4
4131 // CHECK7-NEXT: [[_TMP2:%.*]] = alloca i32, align 4
4132 // CHECK7-NEXT: [[DOTOMP_LB3:%.*]] = alloca i32, align 4
4133 // CHECK7-NEXT: [[DOTOMP_UB4:%.*]] = alloca i32, align 4
4134 // CHECK7-NEXT: [[DOTOMP_IV5:%.*]] = alloca i32, align 4
4135 // CHECK7-NEXT: [[I6:%.*]] = alloca i32, align 4
4136 // CHECK7-NEXT: [[DOTCAPTURE_EXPR_:%.*]] = alloca i8, align 1
4137 // CHECK7-NEXT: [[_TMP16:%.*]] = alloca i32, align 4
4138 // CHECK7-NEXT: [[DOTOMP_LB17:%.*]] = alloca i32, align 4
4139 // CHECK7-NEXT: [[DOTOMP_UB18:%.*]] = alloca i32, align 4
4140 // CHECK7-NEXT: [[DOTOMP_IV19:%.*]] = alloca i32, align 4
4141 // CHECK7-NEXT: [[I20:%.*]] = alloca i32, align 4
4142 // CHECK7-NEXT: store i32 [[ARG]], ptr [[ARG_ADDR]], align 4
4143 // CHECK7-NEXT: store i32 0, ptr [[DOTOMP_LB]], align 4
4144 // CHECK7-NEXT: store i32 99, ptr [[DOTOMP_UB]], align 4
4145 // CHECK7-NEXT: [[TMP0:%.*]] = load i32, ptr [[DOTOMP_LB]], align 4
4146 // CHECK7-NEXT: store i32 [[TMP0]], ptr [[DOTOMP_IV]], align 4
4147 // CHECK7-NEXT: br label [[OMP_INNER_FOR_COND:%.*]]
4148 // CHECK7: omp.inner.for.cond:
4149 // CHECK7-NEXT: [[TMP1:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP18:![0-9]+]]
4150 // CHECK7-NEXT: [[TMP2:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4, !llvm.access.group [[ACC_GRP18]]
4151 // CHECK7-NEXT: [[CMP:%.*]] = icmp sle i32 [[TMP1]], [[TMP2]]
4152 // CHECK7-NEXT: br i1 [[CMP]], label [[OMP_INNER_FOR_BODY:%.*]], label [[OMP_INNER_FOR_END:%.*]]
4153 // CHECK7: omp.inner.for.body:
4154 // CHECK7-NEXT: [[TMP3:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP18]]
4155 // CHECK7-NEXT: [[MUL:%.*]] = mul nsw i32 [[TMP3]], 1
4156 // CHECK7-NEXT: [[ADD:%.*]] = add nsw i32 0, [[MUL]]
4157 // CHECK7-NEXT: store i32 [[ADD]], ptr [[I]], align 4, !llvm.access.group [[ACC_GRP18]]
4158 // CHECK7-NEXT: call void @_Z3fn1v(), !llvm.access.group [[ACC_GRP18]]
4159 // CHECK7-NEXT: br label [[OMP_BODY_CONTINUE:%.*]]
4160 // CHECK7: omp.body.continue:
4161 // CHECK7-NEXT: br label [[OMP_INNER_FOR_INC:%.*]]
4162 // CHECK7: omp.inner.for.inc:
4163 // CHECK7-NEXT: [[TMP4:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP18]]
4164 // CHECK7-NEXT: [[ADD1:%.*]] = add nsw i32 [[TMP4]], 1
4165 // CHECK7-NEXT: store i32 [[ADD1]], ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP18]]
4166 // CHECK7-NEXT: br label [[OMP_INNER_FOR_COND]], !llvm.loop [[LOOP19:![0-9]+]]
4167 // CHECK7: omp.inner.for.end:
4168 // CHECK7-NEXT: store i32 100, ptr [[I]], align 4
4169 // CHECK7-NEXT: store i32 0, ptr [[DOTOMP_LB3]], align 4
4170 // CHECK7-NEXT: store i32 99, ptr [[DOTOMP_UB4]], align 4
4171 // CHECK7-NEXT: [[TMP5:%.*]] = load i32, ptr [[DOTOMP_LB3]], align 4
4172 // CHECK7-NEXT: store i32 [[TMP5]], ptr [[DOTOMP_IV5]], align 4
4173 // CHECK7-NEXT: br label [[OMP_INNER_FOR_COND7:%.*]]
4174 // CHECK7: omp.inner.for.cond7:
4175 // CHECK7-NEXT: [[TMP6:%.*]] = load i32, ptr [[DOTOMP_IV5]], align 4
4176 // CHECK7-NEXT: [[TMP7:%.*]] = load i32, ptr [[DOTOMP_UB4]], align 4
4177 // CHECK7-NEXT: [[CMP8:%.*]] = icmp sle i32 [[TMP6]], [[TMP7]]
4178 // CHECK7-NEXT: br i1 [[CMP8]], label [[OMP_INNER_FOR_BODY9:%.*]], label [[OMP_INNER_FOR_END15:%.*]]
4179 // CHECK7: omp.inner.for.body9:
4180 // CHECK7-NEXT: [[TMP8:%.*]] = load i32, ptr [[DOTOMP_IV5]], align 4
4181 // CHECK7-NEXT: [[MUL10:%.*]] = mul nsw i32 [[TMP8]], 1
4182 // CHECK7-NEXT: [[ADD11:%.*]] = add nsw i32 0, [[MUL10]]
4183 // CHECK7-NEXT: store i32 [[ADD11]], ptr [[I6]], align 4
4184 // CHECK7-NEXT: call void @_Z3fn2v()
4185 // CHECK7-NEXT: br label [[OMP_BODY_CONTINUE12:%.*]]
4186 // CHECK7: omp.body.continue12:
4187 // CHECK7-NEXT: br label [[OMP_INNER_FOR_INC13:%.*]]
4188 // CHECK7: omp.inner.for.inc13:
4189 // CHECK7-NEXT: [[TMP9:%.*]] = load i32, ptr [[DOTOMP_IV5]], align 4
4190 // CHECK7-NEXT: [[ADD14:%.*]] = add nsw i32 [[TMP9]], 1
4191 // CHECK7-NEXT: store i32 [[ADD14]], ptr [[DOTOMP_IV5]], align 4
4192 // CHECK7-NEXT: br label [[OMP_INNER_FOR_COND7]], !llvm.loop [[LOOP21:![0-9]+]]
4193 // CHECK7: omp.inner.for.end15:
4194 // CHECK7-NEXT: store i32 100, ptr [[I6]], align 4
4195 // CHECK7-NEXT: [[TMP10:%.*]] = load i32, ptr [[ARG_ADDR]], align 4
4196 // CHECK7-NEXT: [[TOBOOL:%.*]] = icmp ne i32 [[TMP10]], 0
4197 // CHECK7-NEXT: [[FROMBOOL:%.*]] = zext i1 [[TOBOOL]] to i8
4198 // CHECK7-NEXT: store i8 [[FROMBOOL]], ptr [[DOTCAPTURE_EXPR_]], align 1
4199 // CHECK7-NEXT: store i32 0, ptr [[DOTOMP_LB17]], align 4
4200 // CHECK7-NEXT: store i32 99, ptr [[DOTOMP_UB18]], align 4
4201 // CHECK7-NEXT: [[TMP11:%.*]] = load i32, ptr [[DOTOMP_LB17]], align 4
4202 // CHECK7-NEXT: store i32 [[TMP11]], ptr [[DOTOMP_IV19]], align 4
4203 // CHECK7-NEXT: br label [[OMP_INNER_FOR_COND21:%.*]]
4204 // CHECK7: omp.inner.for.cond21:
4205 // CHECK7-NEXT: [[TMP12:%.*]] = load i32, ptr [[DOTOMP_IV19]], align 4, !llvm.access.group [[ACC_GRP22:![0-9]+]]
4206 // CHECK7-NEXT: [[TMP13:%.*]] = load i32, ptr [[DOTOMP_UB18]], align 4, !llvm.access.group [[ACC_GRP22]]
4207 // CHECK7-NEXT: [[CMP22:%.*]] = icmp sle i32 [[TMP12]], [[TMP13]]
4208 // CHECK7-NEXT: br i1 [[CMP22]], label [[OMP_INNER_FOR_BODY23:%.*]], label [[OMP_INNER_FOR_END29:%.*]]
4209 // CHECK7: omp.inner.for.body23:
4210 // CHECK7-NEXT: [[TMP14:%.*]] = load i32, ptr [[DOTOMP_IV19]], align 4, !llvm.access.group [[ACC_GRP22]]
4211 // CHECK7-NEXT: [[MUL24:%.*]] = mul nsw i32 [[TMP14]], 1
4212 // CHECK7-NEXT: [[ADD25:%.*]] = add nsw i32 0, [[MUL24]]
4213 // CHECK7-NEXT: store i32 [[ADD25]], ptr [[I20]], align 4, !llvm.access.group [[ACC_GRP22]]
4214 // CHECK7-NEXT: call void @_Z3fn3v(), !llvm.access.group [[ACC_GRP22]]
4215 // CHECK7-NEXT: br label [[OMP_BODY_CONTINUE26:%.*]]
4216 // CHECK7: omp.body.continue26:
4217 // CHECK7-NEXT: br label [[OMP_INNER_FOR_INC27:%.*]]
4218 // CHECK7: omp.inner.for.inc27:
4219 // CHECK7-NEXT: [[TMP15:%.*]] = load i32, ptr [[DOTOMP_IV19]], align 4, !llvm.access.group [[ACC_GRP22]]
4220 // CHECK7-NEXT: [[ADD28:%.*]] = add nsw i32 [[TMP15]], 1
4221 // CHECK7-NEXT: store i32 [[ADD28]], ptr [[DOTOMP_IV19]], align 4, !llvm.access.group [[ACC_GRP22]]
4222 // CHECK7-NEXT: br label [[OMP_INNER_FOR_COND21]], !llvm.loop [[LOOP23:![0-9]+]]
4223 // CHECK7: omp.inner.for.end29:
4224 // CHECK7-NEXT: store i32 100, ptr [[I20]], align 4
4225 // CHECK7-NEXT: ret i32 0
4228 // CHECK9-LABEL: define {{[^@]+}}@_Z9gtid_testv
4229 // CHECK9-SAME: () #[[ATTR0:[0-9]+]] {
4230 // CHECK9-NEXT: entry:
4231 // CHECK9-NEXT: [[TMP:%.*]] = alloca i32, align 4
4232 // CHECK9-NEXT: [[KERNEL_ARGS:%.*]] = alloca [[STRUCT___TGT_KERNEL_ARGUMENTS:%.*]], align 8
4233 // CHECK9-NEXT: [[_TMP1:%.*]] = alloca i32, align 4
4234 // CHECK9-NEXT: [[KERNEL_ARGS2:%.*]] = alloca [[STRUCT___TGT_KERNEL_ARGUMENTS]], align 8
4235 // CHECK9-NEXT: [[TMP0:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 0
4236 // CHECK9-NEXT: store i32 2, ptr [[TMP0]], align 4
4237 // CHECK9-NEXT: [[TMP1:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 1
4238 // CHECK9-NEXT: store i32 0, ptr [[TMP1]], align 4
4239 // CHECK9-NEXT: [[TMP2:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 2
4240 // CHECK9-NEXT: store ptr null, ptr [[TMP2]], align 8
4241 // CHECK9-NEXT: [[TMP3:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 3
4242 // CHECK9-NEXT: store ptr null, ptr [[TMP3]], align 8
4243 // CHECK9-NEXT: [[TMP4:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 4
4244 // CHECK9-NEXT: store ptr null, ptr [[TMP4]], align 8
4245 // CHECK9-NEXT: [[TMP5:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 5
4246 // CHECK9-NEXT: store ptr null, ptr [[TMP5]], align 8
4247 // CHECK9-NEXT: [[TMP6:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 6
4248 // CHECK9-NEXT: store ptr null, ptr [[TMP6]], align 8
4249 // CHECK9-NEXT: [[TMP7:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 7
4250 // CHECK9-NEXT: store ptr null, ptr [[TMP7]], align 8
4251 // CHECK9-NEXT: [[TMP8:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 8
4252 // CHECK9-NEXT: store i64 100, ptr [[TMP8]], align 8
4253 // CHECK9-NEXT: [[TMP9:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 9
4254 // CHECK9-NEXT: store i64 0, ptr [[TMP9]], align 8
4255 // CHECK9-NEXT: [[TMP10:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 10
4256 // CHECK9-NEXT: store [3 x i32] zeroinitializer, ptr [[TMP10]], align 4
4257 // CHECK9-NEXT: [[TMP11:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 11
4258 // CHECK9-NEXT: store [3 x i32] zeroinitializer, ptr [[TMP11]], align 4
4259 // CHECK9-NEXT: [[TMP12:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 12
4260 // CHECK9-NEXT: store i32 0, ptr [[TMP12]], align 4
4261 // 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]])
4262 // CHECK9-NEXT: [[TMP14:%.*]] = icmp ne i32 [[TMP13]], 0
4263 // CHECK9-NEXT: br i1 [[TMP14]], label [[OMP_OFFLOAD_FAILED:%.*]], label [[OMP_OFFLOAD_CONT:%.*]]
4264 // CHECK9: omp_offload.failed:
4265 // CHECK9-NEXT: call void @{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z9gtid_testv_l43() #[[ATTR3:[0-9]+]]
4266 // CHECK9-NEXT: br label [[OMP_OFFLOAD_CONT]]
4267 // CHECK9: omp_offload.cont:
4268 // CHECK9-NEXT: [[TMP15:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS2]], i32 0, i32 0
4269 // CHECK9-NEXT: store i32 2, ptr [[TMP15]], align 4
4270 // CHECK9-NEXT: [[TMP16:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS2]], i32 0, i32 1
4271 // CHECK9-NEXT: store i32 0, ptr [[TMP16]], align 4
4272 // CHECK9-NEXT: [[TMP17:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS2]], i32 0, i32 2
4273 // CHECK9-NEXT: store ptr null, ptr [[TMP17]], align 8
4274 // CHECK9-NEXT: [[TMP18:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS2]], i32 0, i32 3
4275 // CHECK9-NEXT: store ptr null, ptr [[TMP18]], align 8
4276 // CHECK9-NEXT: [[TMP19:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS2]], i32 0, i32 4
4277 // CHECK9-NEXT: store ptr null, ptr [[TMP19]], align 8
4278 // CHECK9-NEXT: [[TMP20:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS2]], i32 0, i32 5
4279 // CHECK9-NEXT: store ptr null, ptr [[TMP20]], align 8
4280 // CHECK9-NEXT: [[TMP21:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS2]], i32 0, i32 6
4281 // CHECK9-NEXT: store ptr null, ptr [[TMP21]], align 8
4282 // CHECK9-NEXT: [[TMP22:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS2]], i32 0, i32 7
4283 // CHECK9-NEXT: store ptr null, ptr [[TMP22]], align 8
4284 // CHECK9-NEXT: [[TMP23:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS2]], i32 0, i32 8
4285 // CHECK9-NEXT: store i64 100, ptr [[TMP23]], align 8
4286 // CHECK9-NEXT: [[TMP24:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS2]], i32 0, i32 9
4287 // CHECK9-NEXT: store i64 0, ptr [[TMP24]], align 8
4288 // CHECK9-NEXT: [[TMP25:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS2]], i32 0, i32 10
4289 // CHECK9-NEXT: store [3 x i32] zeroinitializer, ptr [[TMP25]], align 4
4290 // CHECK9-NEXT: [[TMP26:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS2]], i32 0, i32 11
4291 // CHECK9-NEXT: store [3 x i32] [i32 1, i32 0, i32 0], ptr [[TMP26]], align 4
4292 // CHECK9-NEXT: [[TMP27:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS2]], i32 0, i32 12
4293 // CHECK9-NEXT: store i32 0, ptr [[TMP27]], align 4
4294 // CHECK9-NEXT: [[TMP28:%.*]] = call i32 @__tgt_target_kernel(ptr @[[GLOB3]], i64 -1, i32 0, i32 1, ptr @.{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z9gtid_testv_l47.region_id, ptr [[KERNEL_ARGS2]])
4295 // CHECK9-NEXT: [[TMP29:%.*]] = icmp ne i32 [[TMP28]], 0
4296 // CHECK9-NEXT: br i1 [[TMP29]], label [[OMP_OFFLOAD_FAILED3:%.*]], label [[OMP_OFFLOAD_CONT4:%.*]]
4297 // CHECK9: omp_offload.failed3:
4298 // CHECK9-NEXT: call void @{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z9gtid_testv_l47() #[[ATTR3]]
4299 // CHECK9-NEXT: br label [[OMP_OFFLOAD_CONT4]]
4300 // CHECK9: omp_offload.cont4:
4301 // CHECK9-NEXT: ret void
4304 // CHECK9-LABEL: define {{[^@]+}}@{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z9gtid_testv_l43
4305 // CHECK9-SAME: () #[[ATTR1:[0-9]+]] {
4306 // CHECK9-NEXT: entry:
4307 // 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)
4308 // CHECK9-NEXT: ret void
4311 // CHECK9-LABEL: define {{[^@]+}}@{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z9gtid_testv_l43.omp_outlined
4312 // CHECK9-SAME: (ptr noalias noundef [[DOTGLOBAL_TID_:%.*]], ptr noalias noundef [[DOTBOUND_TID_:%.*]]) #[[ATTR2:[0-9]+]] {
4313 // CHECK9-NEXT: entry:
4314 // CHECK9-NEXT: [[DOTGLOBAL_TID__ADDR:%.*]] = alloca ptr, align 8
4315 // CHECK9-NEXT: [[DOTBOUND_TID__ADDR:%.*]] = alloca ptr, align 8
4316 // CHECK9-NEXT: [[DOTOMP_IV:%.*]] = alloca i32, align 4
4317 // CHECK9-NEXT: [[TMP:%.*]] = alloca i32, align 4
4318 // CHECK9-NEXT: [[DOTOMP_COMB_LB:%.*]] = alloca i32, align 4
4319 // CHECK9-NEXT: [[DOTOMP_COMB_UB:%.*]] = alloca i32, align 4
4320 // CHECK9-NEXT: [[DOTOMP_STRIDE:%.*]] = alloca i32, align 4
4321 // CHECK9-NEXT: [[DOTOMP_IS_LAST:%.*]] = alloca i32, align 4
4322 // CHECK9-NEXT: [[I:%.*]] = alloca i32, align 4
4323 // CHECK9-NEXT: store ptr [[DOTGLOBAL_TID_]], ptr [[DOTGLOBAL_TID__ADDR]], align 8
4324 // CHECK9-NEXT: store ptr [[DOTBOUND_TID_]], ptr [[DOTBOUND_TID__ADDR]], align 8
4325 // CHECK9-NEXT: store i32 0, ptr [[DOTOMP_COMB_LB]], align 4
4326 // CHECK9-NEXT: store i32 99, ptr [[DOTOMP_COMB_UB]], align 4
4327 // CHECK9-NEXT: store i32 1, ptr [[DOTOMP_STRIDE]], align 4
4328 // CHECK9-NEXT: store i32 0, ptr [[DOTOMP_IS_LAST]], align 4
4329 // CHECK9-NEXT: [[TMP0:%.*]] = load ptr, ptr [[DOTGLOBAL_TID__ADDR]], align 8
4330 // CHECK9-NEXT: [[TMP1:%.*]] = load i32, ptr [[TMP0]], align 4
4331 // 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)
4332 // CHECK9-NEXT: [[TMP2:%.*]] = load i32, ptr [[DOTOMP_COMB_UB]], align 4
4333 // CHECK9-NEXT: [[CMP:%.*]] = icmp sgt i32 [[TMP2]], 99
4334 // CHECK9-NEXT: br i1 [[CMP]], label [[COND_TRUE:%.*]], label [[COND_FALSE:%.*]]
4335 // CHECK9: cond.true:
4336 // CHECK9-NEXT: br label [[COND_END:%.*]]
4337 // CHECK9: cond.false:
4338 // CHECK9-NEXT: [[TMP3:%.*]] = load i32, ptr [[DOTOMP_COMB_UB]], align 4
4339 // CHECK9-NEXT: br label [[COND_END]]
4340 // CHECK9: cond.end:
4341 // CHECK9-NEXT: [[COND:%.*]] = phi i32 [ 99, [[COND_TRUE]] ], [ [[TMP3]], [[COND_FALSE]] ]
4342 // CHECK9-NEXT: store i32 [[COND]], ptr [[DOTOMP_COMB_UB]], align 4
4343 // CHECK9-NEXT: [[TMP4:%.*]] = load i32, ptr [[DOTOMP_COMB_LB]], align 4
4344 // CHECK9-NEXT: store i32 [[TMP4]], ptr [[DOTOMP_IV]], align 4
4345 // CHECK9-NEXT: br label [[OMP_INNER_FOR_COND:%.*]]
4346 // CHECK9: omp.inner.for.cond:
4347 // CHECK9-NEXT: [[TMP5:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP11:![0-9]+]]
4348 // CHECK9-NEXT: [[TMP6:%.*]] = load i32, ptr [[DOTOMP_COMB_UB]], align 4, !llvm.access.group [[ACC_GRP11]]
4349 // CHECK9-NEXT: [[CMP1:%.*]] = icmp sle i32 [[TMP5]], [[TMP6]]
4350 // CHECK9-NEXT: br i1 [[CMP1]], label [[OMP_INNER_FOR_BODY:%.*]], label [[OMP_INNER_FOR_END:%.*]]
4351 // CHECK9: omp.inner.for.body:
4352 // CHECK9-NEXT: [[TMP7:%.*]] = load i32, ptr [[DOTOMP_COMB_LB]], align 4, !llvm.access.group [[ACC_GRP11]]
4353 // CHECK9-NEXT: [[TMP8:%.*]] = zext i32 [[TMP7]] to i64
4354 // CHECK9-NEXT: [[TMP9:%.*]] = load i32, ptr [[DOTOMP_COMB_UB]], align 4, !llvm.access.group [[ACC_GRP11]]
4355 // CHECK9-NEXT: [[TMP10:%.*]] = zext i32 [[TMP9]] to i64
4356 // 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]]
4357 // CHECK9-NEXT: br label [[OMP_INNER_FOR_INC:%.*]]
4358 // CHECK9: omp.inner.for.inc:
4359 // CHECK9-NEXT: [[TMP11:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP11]]
4360 // CHECK9-NEXT: [[TMP12:%.*]] = load i32, ptr [[DOTOMP_STRIDE]], align 4, !llvm.access.group [[ACC_GRP11]]
4361 // CHECK9-NEXT: [[ADD:%.*]] = add nsw i32 [[TMP11]], [[TMP12]]
4362 // CHECK9-NEXT: store i32 [[ADD]], ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP11]]
4363 // CHECK9-NEXT: br label [[OMP_INNER_FOR_COND]], !llvm.loop [[LOOP12:![0-9]+]]
4364 // CHECK9: omp.inner.for.end:
4365 // CHECK9-NEXT: br label [[OMP_LOOP_EXIT:%.*]]
4366 // CHECK9: omp.loop.exit:
4367 // CHECK9-NEXT: call void @__kmpc_for_static_fini(ptr @[[GLOB1]], i32 [[TMP1]])
4368 // CHECK9-NEXT: [[TMP13:%.*]] = load i32, ptr [[DOTOMP_IS_LAST]], align 4
4369 // CHECK9-NEXT: [[TMP14:%.*]] = icmp ne i32 [[TMP13]], 0
4370 // CHECK9-NEXT: br i1 [[TMP14]], label [[DOTOMP_FINAL_THEN:%.*]], label [[DOTOMP_FINAL_DONE:%.*]]
4371 // CHECK9: .omp.final.then:
4372 // CHECK9-NEXT: store i32 100, ptr [[I]], align 4
4373 // CHECK9-NEXT: br label [[DOTOMP_FINAL_DONE]]
4374 // CHECK9: .omp.final.done:
4375 // CHECK9-NEXT: ret void
4378 // CHECK9-LABEL: define {{[^@]+}}@{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z9gtid_testv_l43.omp_outlined.omp_outlined
4379 // CHECK9-SAME: (ptr noalias noundef [[DOTGLOBAL_TID_:%.*]], ptr noalias noundef [[DOTBOUND_TID_:%.*]], i64 noundef [[DOTPREVIOUS_LB_:%.*]], i64 noundef [[DOTPREVIOUS_UB_:%.*]]) #[[ATTR2]] {
4380 // CHECK9-NEXT: entry:
4381 // CHECK9-NEXT: [[DOTGLOBAL_TID__ADDR:%.*]] = alloca ptr, align 8
4382 // CHECK9-NEXT: [[DOTBOUND_TID__ADDR:%.*]] = alloca ptr, align 8
4383 // CHECK9-NEXT: [[DOTPREVIOUS_LB__ADDR:%.*]] = alloca i64, align 8
4384 // CHECK9-NEXT: [[DOTPREVIOUS_UB__ADDR:%.*]] = alloca i64, align 8
4385 // CHECK9-NEXT: [[DOTOMP_IV:%.*]] = alloca i32, align 4
4386 // CHECK9-NEXT: [[TMP:%.*]] = alloca i32, align 4
4387 // CHECK9-NEXT: [[DOTOMP_LB:%.*]] = alloca i32, align 4
4388 // CHECK9-NEXT: [[DOTOMP_UB:%.*]] = alloca i32, align 4
4389 // CHECK9-NEXT: [[DOTOMP_STRIDE:%.*]] = alloca i32, align 4
4390 // CHECK9-NEXT: [[DOTOMP_IS_LAST:%.*]] = alloca i32, align 4
4391 // CHECK9-NEXT: [[I:%.*]] = alloca i32, align 4
4392 // CHECK9-NEXT: store ptr [[DOTGLOBAL_TID_]], ptr [[DOTGLOBAL_TID__ADDR]], align 8
4393 // CHECK9-NEXT: store ptr [[DOTBOUND_TID_]], ptr [[DOTBOUND_TID__ADDR]], align 8
4394 // CHECK9-NEXT: store i64 [[DOTPREVIOUS_LB_]], ptr [[DOTPREVIOUS_LB__ADDR]], align 8
4395 // CHECK9-NEXT: store i64 [[DOTPREVIOUS_UB_]], ptr [[DOTPREVIOUS_UB__ADDR]], align 8
4396 // CHECK9-NEXT: store i32 0, ptr [[DOTOMP_LB]], align 4
4397 // CHECK9-NEXT: store i32 99, ptr [[DOTOMP_UB]], align 4
4398 // CHECK9-NEXT: [[TMP0:%.*]] = load i64, ptr [[DOTPREVIOUS_LB__ADDR]], align 8
4399 // CHECK9-NEXT: [[CONV:%.*]] = trunc i64 [[TMP0]] to i32
4400 // CHECK9-NEXT: [[TMP1:%.*]] = load i64, ptr [[DOTPREVIOUS_UB__ADDR]], align 8
4401 // CHECK9-NEXT: [[CONV1:%.*]] = trunc i64 [[TMP1]] to i32
4402 // CHECK9-NEXT: store i32 [[CONV]], ptr [[DOTOMP_LB]], align 4
4403 // CHECK9-NEXT: store i32 [[CONV1]], ptr [[DOTOMP_UB]], align 4
4404 // CHECK9-NEXT: store i32 1, ptr [[DOTOMP_STRIDE]], align 4
4405 // CHECK9-NEXT: store i32 0, ptr [[DOTOMP_IS_LAST]], align 4
4406 // CHECK9-NEXT: [[TMP2:%.*]] = load ptr, ptr [[DOTGLOBAL_TID__ADDR]], align 8
4407 // CHECK9-NEXT: [[TMP3:%.*]] = load i32, ptr [[TMP2]], align 4
4408 // 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)
4409 // CHECK9-NEXT: [[TMP4:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4
4410 // CHECK9-NEXT: [[CMP:%.*]] = icmp sgt i32 [[TMP4]], 99
4411 // CHECK9-NEXT: br i1 [[CMP]], label [[COND_TRUE:%.*]], label [[COND_FALSE:%.*]]
4412 // CHECK9: cond.true:
4413 // CHECK9-NEXT: br label [[COND_END:%.*]]
4414 // CHECK9: cond.false:
4415 // CHECK9-NEXT: [[TMP5:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4
4416 // CHECK9-NEXT: br label [[COND_END]]
4417 // CHECK9: cond.end:
4418 // CHECK9-NEXT: [[COND:%.*]] = phi i32 [ 99, [[COND_TRUE]] ], [ [[TMP5]], [[COND_FALSE]] ]
4419 // CHECK9-NEXT: store i32 [[COND]], ptr [[DOTOMP_UB]], align 4
4420 // CHECK9-NEXT: [[TMP6:%.*]] = load i32, ptr [[DOTOMP_LB]], align 4
4421 // CHECK9-NEXT: store i32 [[TMP6]], ptr [[DOTOMP_IV]], align 4
4422 // CHECK9-NEXT: br label [[OMP_INNER_FOR_COND:%.*]]
4423 // CHECK9: omp.inner.for.cond:
4424 // CHECK9-NEXT: [[TMP7:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP15:![0-9]+]]
4425 // CHECK9-NEXT: [[TMP8:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4, !llvm.access.group [[ACC_GRP15]]
4426 // CHECK9-NEXT: [[CMP2:%.*]] = icmp sle i32 [[TMP7]], [[TMP8]]
4427 // CHECK9-NEXT: br i1 [[CMP2]], label [[OMP_INNER_FOR_BODY:%.*]], label [[OMP_INNER_FOR_END:%.*]]
4428 // CHECK9: omp.inner.for.body:
4429 // CHECK9-NEXT: [[TMP9:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP15]]
4430 // CHECK9-NEXT: [[MUL:%.*]] = mul nsw i32 [[TMP9]], 1
4431 // CHECK9-NEXT: [[ADD:%.*]] = add nsw i32 0, [[MUL]]
4432 // CHECK9-NEXT: store i32 [[ADD]], ptr [[I]], align 4, !llvm.access.group [[ACC_GRP15]]
4433 // CHECK9-NEXT: br label [[OMP_BODY_CONTINUE:%.*]]
4434 // CHECK9: omp.body.continue:
4435 // CHECK9-NEXT: br label [[OMP_INNER_FOR_INC:%.*]]
4436 // CHECK9: omp.inner.for.inc:
4437 // CHECK9-NEXT: [[TMP10:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP15]]
4438 // CHECK9-NEXT: [[ADD3:%.*]] = add nsw i32 [[TMP10]], 1
4439 // CHECK9-NEXT: store i32 [[ADD3]], ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP15]]
4440 // CHECK9-NEXT: br label [[OMP_INNER_FOR_COND]], !llvm.loop [[LOOP16:![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 [[TMP3]])
4445 // CHECK9-NEXT: [[TMP11:%.*]] = load i32, ptr [[DOTOMP_IS_LAST]], align 4
4446 // CHECK9-NEXT: [[TMP12:%.*]] = icmp ne i32 [[TMP11]], 0
4447 // CHECK9-NEXT: br i1 [[TMP12]], 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_l47
4456 // CHECK9-SAME: () #[[ATTR1]] {
4457 // CHECK9-NEXT: entry:
4458 // 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_l47.omp_outlined)
4459 // CHECK9-NEXT: ret void
4462 // CHECK9-LABEL: define {{[^@]+}}@{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z9gtid_testv_l47.omp_outlined
4463 // CHECK9-SAME: (ptr noalias noundef [[DOTGLOBAL_TID_:%.*]], ptr noalias noundef [[DOTBOUND_TID_:%.*]]) #[[ATTR2]] {
4464 // CHECK9-NEXT: entry:
4465 // CHECK9-NEXT: [[DOTGLOBAL_TID__ADDR:%.*]] = alloca ptr, align 8
4466 // CHECK9-NEXT: [[DOTBOUND_TID__ADDR:%.*]] = alloca ptr, align 8
4467 // CHECK9-NEXT: [[DOTOMP_IV:%.*]] = alloca i32, align 4
4468 // CHECK9-NEXT: [[TMP:%.*]] = alloca i32, align 4
4469 // CHECK9-NEXT: [[DOTOMP_COMB_LB:%.*]] = alloca i32, align 4
4470 // CHECK9-NEXT: [[DOTOMP_COMB_UB:%.*]] = alloca i32, align 4
4471 // CHECK9-NEXT: [[DOTOMP_STRIDE:%.*]] = alloca i32, align 4
4472 // CHECK9-NEXT: [[DOTOMP_IS_LAST:%.*]] = alloca i32, align 4
4473 // CHECK9-NEXT: [[I:%.*]] = alloca i32, align 4
4474 // CHECK9-NEXT: [[DOTBOUND_ZERO_ADDR:%.*]] = alloca i32, align 4
4475 // CHECK9-NEXT: store ptr [[DOTGLOBAL_TID_]], ptr [[DOTGLOBAL_TID__ADDR]], align 8
4476 // CHECK9-NEXT: store ptr [[DOTBOUND_TID_]], ptr [[DOTBOUND_TID__ADDR]], align 8
4477 // CHECK9-NEXT: store i32 0, ptr [[DOTOMP_COMB_LB]], align 4
4478 // CHECK9-NEXT: store i32 99, ptr [[DOTOMP_COMB_UB]], align 4
4479 // CHECK9-NEXT: store i32 1, ptr [[DOTOMP_STRIDE]], align 4
4480 // CHECK9-NEXT: store i32 0, ptr [[DOTOMP_IS_LAST]], align 4
4481 // CHECK9-NEXT: [[TMP0:%.*]] = load ptr, ptr [[DOTGLOBAL_TID__ADDR]], align 8
4482 // CHECK9-NEXT: [[TMP1:%.*]] = load i32, ptr [[TMP0]], align 4
4483 // 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)
4484 // CHECK9-NEXT: [[TMP2:%.*]] = load i32, ptr [[DOTOMP_COMB_UB]], align 4
4485 // CHECK9-NEXT: [[CMP:%.*]] = icmp sgt i32 [[TMP2]], 99
4486 // CHECK9-NEXT: br i1 [[CMP]], label [[COND_TRUE:%.*]], label [[COND_FALSE:%.*]]
4487 // CHECK9: cond.true:
4488 // CHECK9-NEXT: br label [[COND_END:%.*]]
4489 // CHECK9: cond.false:
4490 // CHECK9-NEXT: [[TMP3:%.*]] = load i32, ptr [[DOTOMP_COMB_UB]], align 4
4491 // CHECK9-NEXT: br label [[COND_END]]
4492 // CHECK9: cond.end:
4493 // CHECK9-NEXT: [[COND:%.*]] = phi i32 [ 99, [[COND_TRUE]] ], [ [[TMP3]], [[COND_FALSE]] ]
4494 // CHECK9-NEXT: store i32 [[COND]], ptr [[DOTOMP_COMB_UB]], align 4
4495 // CHECK9-NEXT: [[TMP4:%.*]] = load i32, ptr [[DOTOMP_COMB_LB]], align 4
4496 // CHECK9-NEXT: store i32 [[TMP4]], ptr [[DOTOMP_IV]], align 4
4497 // CHECK9-NEXT: br label [[OMP_INNER_FOR_COND:%.*]]
4498 // CHECK9: omp.inner.for.cond:
4499 // CHECK9-NEXT: [[TMP5:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP20:![0-9]+]]
4500 // CHECK9-NEXT: [[TMP6:%.*]] = load i32, ptr [[DOTOMP_COMB_UB]], align 4, !llvm.access.group [[ACC_GRP20]]
4501 // CHECK9-NEXT: [[CMP1:%.*]] = icmp sle i32 [[TMP5]], [[TMP6]]
4502 // CHECK9-NEXT: br i1 [[CMP1]], label [[OMP_INNER_FOR_BODY:%.*]], label [[OMP_INNER_FOR_END:%.*]]
4503 // CHECK9: omp.inner.for.body:
4504 // CHECK9-NEXT: [[TMP7:%.*]] = load i32, ptr [[DOTOMP_COMB_LB]], align 4, !llvm.access.group [[ACC_GRP20]]
4505 // CHECK9-NEXT: [[TMP8:%.*]] = zext i32 [[TMP7]] to i64
4506 // CHECK9-NEXT: [[TMP9:%.*]] = load i32, ptr [[DOTOMP_COMB_UB]], align 4, !llvm.access.group [[ACC_GRP20]]
4507 // CHECK9-NEXT: [[TMP10:%.*]] = zext i32 [[TMP9]] to i64
4508 // CHECK9-NEXT: call void @__kmpc_serialized_parallel(ptr @[[GLOB3]], i32 [[TMP1]]), !llvm.access.group [[ACC_GRP20]]
4509 // CHECK9-NEXT: [[TMP11:%.*]] = load ptr, ptr [[DOTGLOBAL_TID__ADDR]], align 8, !llvm.access.group [[ACC_GRP20]]
4510 // CHECK9-NEXT: store i32 0, ptr [[DOTBOUND_ZERO_ADDR]], align 4, !llvm.access.group [[ACC_GRP20]]
4511 // CHECK9-NEXT: call void @{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z9gtid_testv_l47.omp_outlined.omp_outlined(ptr [[TMP11]], ptr [[DOTBOUND_ZERO_ADDR]], i64 [[TMP8]], i64 [[TMP10]]) #[[ATTR3]], !llvm.access.group [[ACC_GRP20]]
4512 // CHECK9-NEXT: call void @__kmpc_end_serialized_parallel(ptr @[[GLOB3]], i32 [[TMP1]]), !llvm.access.group [[ACC_GRP20]]
4513 // CHECK9-NEXT: br label [[OMP_INNER_FOR_INC:%.*]]
4514 // CHECK9: omp.inner.for.inc:
4515 // CHECK9-NEXT: [[TMP12:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP20]]
4516 // CHECK9-NEXT: [[TMP13:%.*]] = load i32, ptr [[DOTOMP_STRIDE]], align 4, !llvm.access.group [[ACC_GRP20]]
4517 // CHECK9-NEXT: [[ADD:%.*]] = add nsw i32 [[TMP12]], [[TMP13]]
4518 // CHECK9-NEXT: store i32 [[ADD]], ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP20]]
4519 // CHECK9-NEXT: br label [[OMP_INNER_FOR_COND]], !llvm.loop [[LOOP21:![0-9]+]]
4520 // CHECK9: omp.inner.for.end:
4521 // CHECK9-NEXT: br label [[OMP_LOOP_EXIT:%.*]]
4522 // CHECK9: omp.loop.exit:
4523 // CHECK9-NEXT: call void @__kmpc_for_static_fini(ptr @[[GLOB1]], i32 [[TMP1]])
4524 // CHECK9-NEXT: [[TMP14:%.*]] = load i32, ptr [[DOTOMP_IS_LAST]], align 4
4525 // CHECK9-NEXT: [[TMP15:%.*]] = icmp ne i32 [[TMP14]], 0
4526 // CHECK9-NEXT: br i1 [[TMP15]], label [[DOTOMP_FINAL_THEN:%.*]], label [[DOTOMP_FINAL_DONE:%.*]]
4527 // CHECK9: .omp.final.then:
4528 // CHECK9-NEXT: store i32 100, ptr [[I]], align 4
4529 // CHECK9-NEXT: br label [[DOTOMP_FINAL_DONE]]
4530 // CHECK9: .omp.final.done:
4531 // CHECK9-NEXT: ret void
4534 // CHECK9-LABEL: define {{[^@]+}}@{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z9gtid_testv_l47.omp_outlined.omp_outlined
4535 // CHECK9-SAME: (ptr noalias noundef [[DOTGLOBAL_TID_:%.*]], ptr noalias noundef [[DOTBOUND_TID_:%.*]], i64 noundef [[DOTPREVIOUS_LB_:%.*]], i64 noundef [[DOTPREVIOUS_UB_:%.*]]) #[[ATTR2]] {
4536 // CHECK9-NEXT: entry:
4537 // CHECK9-NEXT: [[DOTGLOBAL_TID__ADDR:%.*]] = alloca ptr, align 8
4538 // CHECK9-NEXT: [[DOTBOUND_TID__ADDR:%.*]] = alloca ptr, align 8
4539 // CHECK9-NEXT: [[DOTPREVIOUS_LB__ADDR:%.*]] = alloca i64, align 8
4540 // CHECK9-NEXT: [[DOTPREVIOUS_UB__ADDR:%.*]] = alloca i64, align 8
4541 // CHECK9-NEXT: [[DOTOMP_IV:%.*]] = alloca i32, align 4
4542 // CHECK9-NEXT: [[TMP:%.*]] = alloca i32, align 4
4543 // CHECK9-NEXT: [[DOTOMP_LB:%.*]] = alloca i32, align 4
4544 // CHECK9-NEXT: [[DOTOMP_UB:%.*]] = alloca i32, align 4
4545 // CHECK9-NEXT: [[DOTOMP_STRIDE:%.*]] = alloca i32, align 4
4546 // CHECK9-NEXT: [[DOTOMP_IS_LAST:%.*]] = alloca i32, align 4
4547 // CHECK9-NEXT: [[I:%.*]] = alloca i32, align 4
4548 // CHECK9-NEXT: store ptr [[DOTGLOBAL_TID_]], ptr [[DOTGLOBAL_TID__ADDR]], align 8
4549 // CHECK9-NEXT: store ptr [[DOTBOUND_TID_]], ptr [[DOTBOUND_TID__ADDR]], align 8
4550 // CHECK9-NEXT: store i64 [[DOTPREVIOUS_LB_]], ptr [[DOTPREVIOUS_LB__ADDR]], align 8
4551 // CHECK9-NEXT: store i64 [[DOTPREVIOUS_UB_]], ptr [[DOTPREVIOUS_UB__ADDR]], align 8
4552 // CHECK9-NEXT: store i32 0, ptr [[DOTOMP_LB]], align 4
4553 // CHECK9-NEXT: store i32 99, ptr [[DOTOMP_UB]], align 4
4554 // CHECK9-NEXT: [[TMP0:%.*]] = load i64, ptr [[DOTPREVIOUS_LB__ADDR]], align 8
4555 // CHECK9-NEXT: [[CONV:%.*]] = trunc i64 [[TMP0]] to i32
4556 // CHECK9-NEXT: [[TMP1:%.*]] = load i64, ptr [[DOTPREVIOUS_UB__ADDR]], align 8
4557 // CHECK9-NEXT: [[CONV1:%.*]] = trunc i64 [[TMP1]] to i32
4558 // CHECK9-NEXT: store i32 [[CONV]], ptr [[DOTOMP_LB]], align 4
4559 // CHECK9-NEXT: store i32 [[CONV1]], ptr [[DOTOMP_UB]], align 4
4560 // CHECK9-NEXT: store i32 1, ptr [[DOTOMP_STRIDE]], align 4
4561 // CHECK9-NEXT: store i32 0, ptr [[DOTOMP_IS_LAST]], align 4
4562 // CHECK9-NEXT: [[TMP2:%.*]] = load ptr, ptr [[DOTGLOBAL_TID__ADDR]], align 8
4563 // CHECK9-NEXT: [[TMP3:%.*]] = load i32, ptr [[TMP2]], align 4
4564 // 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)
4565 // CHECK9-NEXT: [[TMP4:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4
4566 // CHECK9-NEXT: [[CMP:%.*]] = icmp sgt i32 [[TMP4]], 99
4567 // CHECK9-NEXT: br i1 [[CMP]], label [[COND_TRUE:%.*]], label [[COND_FALSE:%.*]]
4568 // CHECK9: cond.true:
4569 // CHECK9-NEXT: br label [[COND_END:%.*]]
4570 // CHECK9: cond.false:
4571 // CHECK9-NEXT: [[TMP5:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4
4572 // CHECK9-NEXT: br label [[COND_END]]
4573 // CHECK9: cond.end:
4574 // CHECK9-NEXT: [[COND:%.*]] = phi i32 [ 99, [[COND_TRUE]] ], [ [[TMP5]], [[COND_FALSE]] ]
4575 // CHECK9-NEXT: store i32 [[COND]], ptr [[DOTOMP_UB]], align 4
4576 // CHECK9-NEXT: [[TMP6:%.*]] = load i32, ptr [[DOTOMP_LB]], align 4
4577 // CHECK9-NEXT: store i32 [[TMP6]], ptr [[DOTOMP_IV]], align 4
4578 // CHECK9-NEXT: br label [[OMP_INNER_FOR_COND:%.*]]
4579 // CHECK9: omp.inner.for.cond:
4580 // CHECK9-NEXT: [[TMP7:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP23:![0-9]+]]
4581 // CHECK9-NEXT: [[TMP8:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4, !llvm.access.group [[ACC_GRP23]]
4582 // CHECK9-NEXT: [[CMP2:%.*]] = icmp sle i32 [[TMP7]], [[TMP8]]
4583 // CHECK9-NEXT: br i1 [[CMP2]], label [[OMP_INNER_FOR_BODY:%.*]], label [[OMP_INNER_FOR_END:%.*]]
4584 // CHECK9: omp.inner.for.body:
4585 // CHECK9-NEXT: [[TMP9:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP23]]
4586 // CHECK9-NEXT: [[MUL:%.*]] = mul nsw i32 [[TMP9]], 1
4587 // CHECK9-NEXT: [[ADD:%.*]] = add nsw i32 0, [[MUL]]
4588 // CHECK9-NEXT: store i32 [[ADD]], ptr [[I]], align 4, !llvm.access.group [[ACC_GRP23]]
4589 // CHECK9-NEXT: call void @_Z9gtid_testv(), !llvm.access.group [[ACC_GRP23]]
4590 // CHECK9-NEXT: br label [[OMP_BODY_CONTINUE:%.*]]
4591 // CHECK9: omp.body.continue:
4592 // CHECK9-NEXT: br label [[OMP_INNER_FOR_INC:%.*]]
4593 // CHECK9: omp.inner.for.inc:
4594 // CHECK9-NEXT: [[TMP10:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP23]]
4595 // CHECK9-NEXT: [[ADD3:%.*]] = add nsw i32 [[TMP10]], 1
4596 // CHECK9-NEXT: store i32 [[ADD3]], ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP23]]
4597 // CHECK9-NEXT: br label [[OMP_INNER_FOR_COND]], !llvm.loop [[LOOP24:![0-9]+]]
4598 // CHECK9: omp.inner.for.end:
4599 // CHECK9-NEXT: br label [[OMP_LOOP_EXIT:%.*]]
4600 // CHECK9: omp.loop.exit:
4601 // CHECK9-NEXT: call void @__kmpc_for_static_fini(ptr @[[GLOB1]], i32 [[TMP3]])
4602 // CHECK9-NEXT: [[TMP11:%.*]] = load i32, ptr [[DOTOMP_IS_LAST]], align 4
4603 // CHECK9-NEXT: [[TMP12:%.*]] = icmp ne i32 [[TMP11]], 0
4604 // CHECK9-NEXT: br i1 [[TMP12]], label [[DOTOMP_FINAL_THEN:%.*]], label [[DOTOMP_FINAL_DONE:%.*]]
4605 // CHECK9: .omp.final.then:
4606 // CHECK9-NEXT: store i32 100, ptr [[I]], align 4
4607 // CHECK9-NEXT: br label [[DOTOMP_FINAL_DONE]]
4608 // CHECK9: .omp.final.done:
4609 // CHECK9-NEXT: ret void
4612 // CHECK9-LABEL: define {{[^@]+}}@main
4613 // CHECK9-SAME: () #[[ATTR4:[0-9]+]] {
4614 // CHECK9-NEXT: entry:
4615 // CHECK9-NEXT: [[RETVAL:%.*]] = alloca i32, align 4
4616 // CHECK9-NEXT: [[TMP:%.*]] = alloca i32, align 4
4617 // CHECK9-NEXT: [[KERNEL_ARGS:%.*]] = alloca [[STRUCT___TGT_KERNEL_ARGUMENTS:%.*]], align 8
4618 // CHECK9-NEXT: [[_TMP1:%.*]] = alloca i32, align 4
4619 // CHECK9-NEXT: [[KERNEL_ARGS2:%.*]] = alloca [[STRUCT___TGT_KERNEL_ARGUMENTS]], align 8
4620 // CHECK9-NEXT: [[ARG_CASTED:%.*]] = alloca i64, align 8
4621 // CHECK9-NEXT: [[DOTOFFLOAD_BASEPTRS:%.*]] = alloca [1 x ptr], align 8
4622 // CHECK9-NEXT: [[DOTOFFLOAD_PTRS:%.*]] = alloca [1 x ptr], align 8
4623 // CHECK9-NEXT: [[DOTOFFLOAD_MAPPERS:%.*]] = alloca [1 x ptr], align 8
4624 // CHECK9-NEXT: [[DOTCAPTURE_EXPR_:%.*]] = alloca i8, align 1
4625 // CHECK9-NEXT: [[_TMP6:%.*]] = alloca i32, align 4
4626 // CHECK9-NEXT: [[KERNEL_ARGS7:%.*]] = alloca [[STRUCT___TGT_KERNEL_ARGUMENTS]], align 8
4627 // CHECK9-NEXT: store i32 0, ptr [[RETVAL]], align 4
4628 // CHECK9-NEXT: [[TMP0:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 0
4629 // CHECK9-NEXT: store i32 2, ptr [[TMP0]], align 4
4630 // CHECK9-NEXT: [[TMP1:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 1
4631 // CHECK9-NEXT: store i32 0, ptr [[TMP1]], align 4
4632 // CHECK9-NEXT: [[TMP2:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 2
4633 // CHECK9-NEXT: store ptr null, ptr [[TMP2]], align 8
4634 // CHECK9-NEXT: [[TMP3:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 3
4635 // CHECK9-NEXT: store ptr null, ptr [[TMP3]], align 8
4636 // CHECK9-NEXT: [[TMP4:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 4
4637 // CHECK9-NEXT: store ptr null, ptr [[TMP4]], align 8
4638 // CHECK9-NEXT: [[TMP5:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 5
4639 // CHECK9-NEXT: store ptr null, ptr [[TMP5]], align 8
4640 // CHECK9-NEXT: [[TMP6:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 6
4641 // CHECK9-NEXT: store ptr null, ptr [[TMP6]], align 8
4642 // CHECK9-NEXT: [[TMP7:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 7
4643 // CHECK9-NEXT: store ptr null, ptr [[TMP7]], align 8
4644 // CHECK9-NEXT: [[TMP8:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 8
4645 // CHECK9-NEXT: store i64 100, ptr [[TMP8]], align 8
4646 // CHECK9-NEXT: [[TMP9:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 9
4647 // CHECK9-NEXT: store i64 0, ptr [[TMP9]], align 8
4648 // CHECK9-NEXT: [[TMP10:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 10
4649 // CHECK9-NEXT: store [3 x i32] zeroinitializer, ptr [[TMP10]], align 4
4650 // CHECK9-NEXT: [[TMP11:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 11
4651 // CHECK9-NEXT: store [3 x i32] zeroinitializer, ptr [[TMP11]], align 4
4652 // CHECK9-NEXT: [[TMP12:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 12
4653 // CHECK9-NEXT: store i32 0, ptr [[TMP12]], align 4
4654 // 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_l76.region_id, ptr [[KERNEL_ARGS]])
4655 // CHECK9-NEXT: [[TMP14:%.*]] = icmp ne i32 [[TMP13]], 0
4656 // CHECK9-NEXT: br i1 [[TMP14]], label [[OMP_OFFLOAD_FAILED:%.*]], label [[OMP_OFFLOAD_CONT:%.*]]
4657 // CHECK9: omp_offload.failed:
4658 // CHECK9-NEXT: call void @{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}_main_l76() #[[ATTR3]]
4659 // CHECK9-NEXT: br label [[OMP_OFFLOAD_CONT]]
4660 // CHECK9: omp_offload.cont:
4661 // CHECK9-NEXT: [[TMP15:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS2]], i32 0, i32 0
4662 // CHECK9-NEXT: store i32 2, ptr [[TMP15]], align 4
4663 // CHECK9-NEXT: [[TMP16:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS2]], i32 0, i32 1
4664 // CHECK9-NEXT: store i32 0, ptr [[TMP16]], align 4
4665 // CHECK9-NEXT: [[TMP17:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS2]], i32 0, i32 2
4666 // CHECK9-NEXT: store ptr null, ptr [[TMP17]], align 8
4667 // CHECK9-NEXT: [[TMP18:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS2]], i32 0, i32 3
4668 // CHECK9-NEXT: store ptr null, ptr [[TMP18]], align 8
4669 // CHECK9-NEXT: [[TMP19:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS2]], i32 0, i32 4
4670 // CHECK9-NEXT: store ptr null, ptr [[TMP19]], align 8
4671 // CHECK9-NEXT: [[TMP20:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS2]], i32 0, i32 5
4672 // CHECK9-NEXT: store ptr null, ptr [[TMP20]], align 8
4673 // CHECK9-NEXT: [[TMP21:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS2]], i32 0, i32 6
4674 // CHECK9-NEXT: store ptr null, ptr [[TMP21]], align 8
4675 // CHECK9-NEXT: [[TMP22:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS2]], i32 0, i32 7
4676 // CHECK9-NEXT: store ptr null, ptr [[TMP22]], align 8
4677 // CHECK9-NEXT: [[TMP23:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS2]], i32 0, i32 8
4678 // CHECK9-NEXT: store i64 100, ptr [[TMP23]], align 8
4679 // CHECK9-NEXT: [[TMP24:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS2]], i32 0, i32 9
4680 // CHECK9-NEXT: store i64 0, ptr [[TMP24]], align 8
4681 // CHECK9-NEXT: [[TMP25:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS2]], i32 0, i32 10
4682 // CHECK9-NEXT: store [3 x i32] zeroinitializer, ptr [[TMP25]], align 4
4683 // CHECK9-NEXT: [[TMP26:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS2]], i32 0, i32 11
4684 // CHECK9-NEXT: store [3 x i32] [i32 1, i32 0, i32 0], ptr [[TMP26]], align 4
4685 // CHECK9-NEXT: [[TMP27:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS2]], i32 0, i32 12
4686 // CHECK9-NEXT: store i32 0, ptr [[TMP27]], align 4
4687 // CHECK9-NEXT: [[TMP28:%.*]] = call i32 @__tgt_target_kernel(ptr @[[GLOB3]], i64 -1, i32 0, i32 1, ptr @.{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}_main_l84.region_id, ptr [[KERNEL_ARGS2]])
4688 // CHECK9-NEXT: [[TMP29:%.*]] = icmp ne i32 [[TMP28]], 0
4689 // CHECK9-NEXT: br i1 [[TMP29]], label [[OMP_OFFLOAD_FAILED3:%.*]], label [[OMP_OFFLOAD_CONT4:%.*]]
4690 // CHECK9: omp_offload.failed3:
4691 // CHECK9-NEXT: call void @{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}_main_l84() #[[ATTR3]]
4692 // CHECK9-NEXT: br label [[OMP_OFFLOAD_CONT4]]
4693 // CHECK9: omp_offload.cont4:
4694 // CHECK9-NEXT: [[TMP30:%.*]] = load i32, ptr @Arg, align 4
4695 // CHECK9-NEXT: store i32 [[TMP30]], ptr [[ARG_CASTED]], align 4
4696 // CHECK9-NEXT: [[TMP31:%.*]] = load i64, ptr [[ARG_CASTED]], align 8
4697 // CHECK9-NEXT: [[TMP32:%.*]] = getelementptr inbounds [1 x ptr], ptr [[DOTOFFLOAD_BASEPTRS]], i32 0, i32 0
4698 // CHECK9-NEXT: store i64 [[TMP31]], ptr [[TMP32]], align 8
4699 // CHECK9-NEXT: [[TMP33:%.*]] = getelementptr inbounds [1 x ptr], ptr [[DOTOFFLOAD_PTRS]], i32 0, i32 0
4700 // CHECK9-NEXT: store i64 [[TMP31]], ptr [[TMP33]], align 8
4701 // CHECK9-NEXT: [[TMP34:%.*]] = getelementptr inbounds [1 x ptr], ptr [[DOTOFFLOAD_MAPPERS]], i64 0, i64 0
4702 // CHECK9-NEXT: store ptr null, ptr [[TMP34]], align 8
4703 // CHECK9-NEXT: [[TMP35:%.*]] = getelementptr inbounds [1 x ptr], ptr [[DOTOFFLOAD_BASEPTRS]], i32 0, i32 0
4704 // CHECK9-NEXT: [[TMP36:%.*]] = getelementptr inbounds [1 x ptr], ptr [[DOTOFFLOAD_PTRS]], i32 0, i32 0
4705 // CHECK9-NEXT: [[TMP37:%.*]] = load i32, ptr @Arg, align 4
4706 // CHECK9-NEXT: [[TOBOOL:%.*]] = icmp ne i32 [[TMP37]], 0
4707 // CHECK9-NEXT: [[FROMBOOL:%.*]] = zext i1 [[TOBOOL]] to i8
4708 // CHECK9-NEXT: store i8 [[FROMBOOL]], ptr [[DOTCAPTURE_EXPR_]], align 1
4709 // CHECK9-NEXT: [[TMP38:%.*]] = load i8, ptr [[DOTCAPTURE_EXPR_]], align 1
4710 // CHECK9-NEXT: [[TOBOOL5:%.*]] = trunc i8 [[TMP38]] to i1
4711 // CHECK9-NEXT: [[TMP39:%.*]] = select i1 [[TOBOOL5]], i32 0, i32 1
4712 // CHECK9-NEXT: [[TMP40:%.*]] = insertvalue [3 x i32] zeroinitializer, i32 [[TMP39]], 0
4713 // CHECK9-NEXT: [[TMP41:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS7]], i32 0, i32 0
4714 // CHECK9-NEXT: store i32 2, ptr [[TMP41]], align 4
4715 // CHECK9-NEXT: [[TMP42:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS7]], i32 0, i32 1
4716 // CHECK9-NEXT: store i32 1, ptr [[TMP42]], align 4
4717 // CHECK9-NEXT: [[TMP43:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS7]], i32 0, i32 2
4718 // CHECK9-NEXT: store ptr [[TMP35]], ptr [[TMP43]], align 8
4719 // CHECK9-NEXT: [[TMP44:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS7]], i32 0, i32 3
4720 // CHECK9-NEXT: store ptr [[TMP36]], ptr [[TMP44]], align 8
4721 // CHECK9-NEXT: [[TMP45:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS7]], i32 0, i32 4
4722 // CHECK9-NEXT: store ptr @.offload_sizes, ptr [[TMP45]], align 8
4723 // CHECK9-NEXT: [[TMP46:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS7]], i32 0, i32 5
4724 // CHECK9-NEXT: store ptr @.offload_maptypes, ptr [[TMP46]], align 8
4725 // CHECK9-NEXT: [[TMP47:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS7]], i32 0, i32 6
4726 // CHECK9-NEXT: store ptr null, ptr [[TMP47]], align 8
4727 // CHECK9-NEXT: [[TMP48:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS7]], i32 0, i32 7
4728 // CHECK9-NEXT: store ptr null, ptr [[TMP48]], align 8
4729 // CHECK9-NEXT: [[TMP49:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS7]], i32 0, i32 8
4730 // CHECK9-NEXT: store i64 100, ptr [[TMP49]], align 8
4731 // CHECK9-NEXT: [[TMP50:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS7]], i32 0, i32 9
4732 // CHECK9-NEXT: store i64 0, ptr [[TMP50]], align 8
4733 // CHECK9-NEXT: [[TMP51:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS7]], i32 0, i32 10
4734 // CHECK9-NEXT: store [3 x i32] zeroinitializer, ptr [[TMP51]], align 4
4735 // CHECK9-NEXT: [[TMP52:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS7]], i32 0, i32 11
4736 // CHECK9-NEXT: store [3 x i32] [[TMP40]], ptr [[TMP52]], align 4
4737 // CHECK9-NEXT: [[TMP53:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS7]], i32 0, i32 12
4738 // CHECK9-NEXT: store i32 0, ptr [[TMP53]], align 4
4739 // CHECK9-NEXT: [[TMP54:%.*]] = call i32 @__tgt_target_kernel(ptr @[[GLOB3]], i64 -1, i32 0, i32 [[TMP39]], ptr @.{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}_main_l92.region_id, ptr [[KERNEL_ARGS7]])
4740 // CHECK9-NEXT: [[TMP55:%.*]] = icmp ne i32 [[TMP54]], 0
4741 // CHECK9-NEXT: br i1 [[TMP55]], label [[OMP_OFFLOAD_FAILED8:%.*]], label [[OMP_OFFLOAD_CONT9:%.*]]
4742 // CHECK9: omp_offload.failed8:
4743 // CHECK9-NEXT: call void @{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}_main_l92(i64 [[TMP31]]) #[[ATTR3]]
4744 // CHECK9-NEXT: br label [[OMP_OFFLOAD_CONT9]]
4745 // CHECK9: omp_offload.cont9:
4746 // CHECK9-NEXT: [[TMP56:%.*]] = load i32, ptr @Arg, align 4
4747 // CHECK9-NEXT: [[CALL:%.*]] = call noundef i32 @_Z5tmainIiEiT_(i32 noundef [[TMP56]])
4748 // CHECK9-NEXT: ret i32 [[CALL]]
4751 // CHECK9-LABEL: define {{[^@]+}}@{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}_main_l76
4752 // CHECK9-SAME: () #[[ATTR1]] {
4753 // CHECK9-NEXT: entry:
4754 // CHECK9-NEXT: call void (ptr, i32, ptr, ...) @__kmpc_fork_teams(ptr @[[GLOB3]], i32 0, ptr @{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}_main_l76.omp_outlined)
4755 // CHECK9-NEXT: ret void
4758 // CHECK9-LABEL: define {{[^@]+}}@{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}_main_l76.omp_outlined
4759 // CHECK9-SAME: (ptr noalias noundef [[DOTGLOBAL_TID_:%.*]], ptr noalias noundef [[DOTBOUND_TID_:%.*]]) #[[ATTR2]] {
4760 // CHECK9-NEXT: entry:
4761 // CHECK9-NEXT: [[DOTGLOBAL_TID__ADDR:%.*]] = alloca ptr, align 8
4762 // CHECK9-NEXT: [[DOTBOUND_TID__ADDR:%.*]] = alloca ptr, align 8
4763 // CHECK9-NEXT: [[DOTOMP_IV:%.*]] = alloca i32, align 4
4764 // CHECK9-NEXT: [[TMP:%.*]] = alloca i32, align 4
4765 // CHECK9-NEXT: [[DOTOMP_COMB_LB:%.*]] = alloca i32, align 4
4766 // CHECK9-NEXT: [[DOTOMP_COMB_UB:%.*]] = alloca i32, align 4
4767 // CHECK9-NEXT: [[DOTOMP_STRIDE:%.*]] = alloca i32, align 4
4768 // CHECK9-NEXT: [[DOTOMP_IS_LAST:%.*]] = alloca i32, align 4
4769 // CHECK9-NEXT: [[I:%.*]] = alloca i32, align 4
4770 // CHECK9-NEXT: store ptr [[DOTGLOBAL_TID_]], ptr [[DOTGLOBAL_TID__ADDR]], align 8
4771 // CHECK9-NEXT: store ptr [[DOTBOUND_TID_]], ptr [[DOTBOUND_TID__ADDR]], align 8
4772 // CHECK9-NEXT: store i32 0, ptr [[DOTOMP_COMB_LB]], align 4
4773 // CHECK9-NEXT: store i32 99, ptr [[DOTOMP_COMB_UB]], align 4
4774 // CHECK9-NEXT: store i32 1, ptr [[DOTOMP_STRIDE]], align 4
4775 // CHECK9-NEXT: store i32 0, ptr [[DOTOMP_IS_LAST]], align 4
4776 // CHECK9-NEXT: [[TMP0:%.*]] = load ptr, ptr [[DOTGLOBAL_TID__ADDR]], align 8
4777 // CHECK9-NEXT: [[TMP1:%.*]] = load i32, ptr [[TMP0]], align 4
4778 // 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)
4779 // CHECK9-NEXT: [[TMP2:%.*]] = load i32, ptr [[DOTOMP_COMB_UB]], align 4
4780 // CHECK9-NEXT: [[CMP:%.*]] = icmp sgt i32 [[TMP2]], 99
4781 // CHECK9-NEXT: br i1 [[CMP]], label [[COND_TRUE:%.*]], label [[COND_FALSE:%.*]]
4782 // CHECK9: cond.true:
4783 // CHECK9-NEXT: br label [[COND_END:%.*]]
4784 // CHECK9: cond.false:
4785 // CHECK9-NEXT: [[TMP3:%.*]] = load i32, ptr [[DOTOMP_COMB_UB]], align 4
4786 // CHECK9-NEXT: br label [[COND_END]]
4787 // CHECK9: cond.end:
4788 // CHECK9-NEXT: [[COND:%.*]] = phi i32 [ 99, [[COND_TRUE]] ], [ [[TMP3]], [[COND_FALSE]] ]
4789 // CHECK9-NEXT: store i32 [[COND]], ptr [[DOTOMP_COMB_UB]], align 4
4790 // CHECK9-NEXT: [[TMP4:%.*]] = load i32, ptr [[DOTOMP_COMB_LB]], align 4
4791 // CHECK9-NEXT: store i32 [[TMP4]], ptr [[DOTOMP_IV]], align 4
4792 // CHECK9-NEXT: br label [[OMP_INNER_FOR_COND:%.*]]
4793 // CHECK9: omp.inner.for.cond:
4794 // CHECK9-NEXT: [[TMP5:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP26:![0-9]+]]
4795 // CHECK9-NEXT: [[TMP6:%.*]] = load i32, ptr [[DOTOMP_COMB_UB]], align 4, !llvm.access.group [[ACC_GRP26]]
4796 // CHECK9-NEXT: [[CMP1:%.*]] = icmp sle i32 [[TMP5]], [[TMP6]]
4797 // CHECK9-NEXT: br i1 [[CMP1]], label [[OMP_INNER_FOR_BODY:%.*]], label [[OMP_INNER_FOR_END:%.*]]
4798 // CHECK9: omp.inner.for.body:
4799 // CHECK9-NEXT: [[TMP7:%.*]] = load i32, ptr [[DOTOMP_COMB_LB]], align 4, !llvm.access.group [[ACC_GRP26]]
4800 // CHECK9-NEXT: [[TMP8:%.*]] = zext i32 [[TMP7]] to i64
4801 // CHECK9-NEXT: [[TMP9:%.*]] = load i32, ptr [[DOTOMP_COMB_UB]], align 4, !llvm.access.group [[ACC_GRP26]]
4802 // CHECK9-NEXT: [[TMP10:%.*]] = zext i32 [[TMP9]] to i64
4803 // CHECK9-NEXT: call void (ptr, i32, ptr, ...) @__kmpc_fork_call(ptr @[[GLOB3]], i32 2, ptr @{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}_main_l76.omp_outlined.omp_outlined, i64 [[TMP8]], i64 [[TMP10]]), !llvm.access.group [[ACC_GRP26]]
4804 // CHECK9-NEXT: br label [[OMP_INNER_FOR_INC:%.*]]
4805 // CHECK9: omp.inner.for.inc:
4806 // CHECK9-NEXT: [[TMP11:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP26]]
4807 // CHECK9-NEXT: [[TMP12:%.*]] = load i32, ptr [[DOTOMP_STRIDE]], align 4, !llvm.access.group [[ACC_GRP26]]
4808 // CHECK9-NEXT: [[ADD:%.*]] = add nsw i32 [[TMP11]], [[TMP12]]
4809 // CHECK9-NEXT: store i32 [[ADD]], ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP26]]
4810 // CHECK9-NEXT: br label [[OMP_INNER_FOR_COND]], !llvm.loop [[LOOP27:![0-9]+]]
4811 // CHECK9: omp.inner.for.end:
4812 // CHECK9-NEXT: br label [[OMP_LOOP_EXIT:%.*]]
4813 // CHECK9: omp.loop.exit:
4814 // CHECK9-NEXT: call void @__kmpc_for_static_fini(ptr @[[GLOB1]], i32 [[TMP1]])
4815 // CHECK9-NEXT: [[TMP13:%.*]] = load i32, ptr [[DOTOMP_IS_LAST]], align 4
4816 // CHECK9-NEXT: [[TMP14:%.*]] = icmp ne i32 [[TMP13]], 0
4817 // CHECK9-NEXT: br i1 [[TMP14]], label [[DOTOMP_FINAL_THEN:%.*]], label [[DOTOMP_FINAL_DONE:%.*]]
4818 // CHECK9: .omp.final.then:
4819 // CHECK9-NEXT: store i32 100, ptr [[I]], align 4
4820 // CHECK9-NEXT: br label [[DOTOMP_FINAL_DONE]]
4821 // CHECK9: .omp.final.done:
4822 // CHECK9-NEXT: ret void
4825 // CHECK9-LABEL: define {{[^@]+}}@{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}_main_l76.omp_outlined.omp_outlined
4826 // CHECK9-SAME: (ptr noalias noundef [[DOTGLOBAL_TID_:%.*]], ptr noalias noundef [[DOTBOUND_TID_:%.*]], i64 noundef [[DOTPREVIOUS_LB_:%.*]], i64 noundef [[DOTPREVIOUS_UB_:%.*]]) #[[ATTR2]] {
4827 // CHECK9-NEXT: entry:
4828 // CHECK9-NEXT: [[DOTGLOBAL_TID__ADDR:%.*]] = alloca ptr, align 8
4829 // CHECK9-NEXT: [[DOTBOUND_TID__ADDR:%.*]] = alloca ptr, align 8
4830 // CHECK9-NEXT: [[DOTPREVIOUS_LB__ADDR:%.*]] = alloca i64, align 8
4831 // CHECK9-NEXT: [[DOTPREVIOUS_UB__ADDR:%.*]] = alloca i64, align 8
4832 // CHECK9-NEXT: [[DOTOMP_IV:%.*]] = alloca i32, align 4
4833 // CHECK9-NEXT: [[TMP:%.*]] = alloca i32, align 4
4834 // CHECK9-NEXT: [[DOTOMP_LB:%.*]] = alloca i32, align 4
4835 // CHECK9-NEXT: [[DOTOMP_UB:%.*]] = alloca i32, align 4
4836 // CHECK9-NEXT: [[DOTOMP_STRIDE:%.*]] = alloca i32, align 4
4837 // CHECK9-NEXT: [[DOTOMP_IS_LAST:%.*]] = alloca i32, align 4
4838 // CHECK9-NEXT: [[I:%.*]] = alloca i32, align 4
4839 // CHECK9-NEXT: store ptr [[DOTGLOBAL_TID_]], ptr [[DOTGLOBAL_TID__ADDR]], align 8
4840 // CHECK9-NEXT: store ptr [[DOTBOUND_TID_]], ptr [[DOTBOUND_TID__ADDR]], align 8
4841 // CHECK9-NEXT: store i64 [[DOTPREVIOUS_LB_]], ptr [[DOTPREVIOUS_LB__ADDR]], align 8
4842 // CHECK9-NEXT: store i64 [[DOTPREVIOUS_UB_]], ptr [[DOTPREVIOUS_UB__ADDR]], align 8
4843 // CHECK9-NEXT: store i32 0, ptr [[DOTOMP_LB]], align 4
4844 // CHECK9-NEXT: store i32 99, ptr [[DOTOMP_UB]], align 4
4845 // CHECK9-NEXT: [[TMP0:%.*]] = load i64, ptr [[DOTPREVIOUS_LB__ADDR]], align 8
4846 // CHECK9-NEXT: [[CONV:%.*]] = trunc i64 [[TMP0]] to i32
4847 // CHECK9-NEXT: [[TMP1:%.*]] = load i64, ptr [[DOTPREVIOUS_UB__ADDR]], align 8
4848 // CHECK9-NEXT: [[CONV1:%.*]] = trunc i64 [[TMP1]] to i32
4849 // CHECK9-NEXT: store i32 [[CONV]], ptr [[DOTOMP_LB]], align 4
4850 // CHECK9-NEXT: store i32 [[CONV1]], ptr [[DOTOMP_UB]], align 4
4851 // CHECK9-NEXT: store i32 1, ptr [[DOTOMP_STRIDE]], align 4
4852 // CHECK9-NEXT: store i32 0, ptr [[DOTOMP_IS_LAST]], align 4
4853 // CHECK9-NEXT: [[TMP2:%.*]] = load ptr, ptr [[DOTGLOBAL_TID__ADDR]], align 8
4854 // CHECK9-NEXT: [[TMP3:%.*]] = load i32, ptr [[TMP2]], align 4
4855 // 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)
4856 // CHECK9-NEXT: [[TMP4:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4
4857 // CHECK9-NEXT: [[CMP:%.*]] = icmp sgt i32 [[TMP4]], 99
4858 // CHECK9-NEXT: br i1 [[CMP]], label [[COND_TRUE:%.*]], label [[COND_FALSE:%.*]]
4859 // CHECK9: cond.true:
4860 // CHECK9-NEXT: br label [[COND_END:%.*]]
4861 // CHECK9: cond.false:
4862 // CHECK9-NEXT: [[TMP5:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4
4863 // CHECK9-NEXT: br label [[COND_END]]
4864 // CHECK9: cond.end:
4865 // CHECK9-NEXT: [[COND:%.*]] = phi i32 [ 99, [[COND_TRUE]] ], [ [[TMP5]], [[COND_FALSE]] ]
4866 // CHECK9-NEXT: store i32 [[COND]], ptr [[DOTOMP_UB]], align 4
4867 // CHECK9-NEXT: [[TMP6:%.*]] = load i32, ptr [[DOTOMP_LB]], align 4
4868 // CHECK9-NEXT: store i32 [[TMP6]], ptr [[DOTOMP_IV]], align 4
4869 // CHECK9-NEXT: br label [[OMP_INNER_FOR_COND:%.*]]
4870 // CHECK9: omp.inner.for.cond:
4871 // CHECK9-NEXT: [[TMP7:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP29:![0-9]+]]
4872 // CHECK9-NEXT: [[TMP8:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4, !llvm.access.group [[ACC_GRP29]]
4873 // CHECK9-NEXT: [[CMP2:%.*]] = icmp sle i32 [[TMP7]], [[TMP8]]
4874 // CHECK9-NEXT: br i1 [[CMP2]], label [[OMP_INNER_FOR_BODY:%.*]], label [[OMP_INNER_FOR_END:%.*]]
4875 // CHECK9: omp.inner.for.body:
4876 // CHECK9-NEXT: [[TMP9:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP29]]
4877 // CHECK9-NEXT: [[MUL:%.*]] = mul nsw i32 [[TMP9]], 1
4878 // CHECK9-NEXT: [[ADD:%.*]] = add nsw i32 0, [[MUL]]
4879 // CHECK9-NEXT: store i32 [[ADD]], ptr [[I]], align 4, !llvm.access.group [[ACC_GRP29]]
4880 // CHECK9-NEXT: call void @_Z3fn4v(), !llvm.access.group [[ACC_GRP29]]
4881 // CHECK9-NEXT: br label [[OMP_BODY_CONTINUE:%.*]]
4882 // CHECK9: omp.body.continue:
4883 // CHECK9-NEXT: br label [[OMP_INNER_FOR_INC:%.*]]
4884 // CHECK9: omp.inner.for.inc:
4885 // CHECK9-NEXT: [[TMP10:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP29]]
4886 // CHECK9-NEXT: [[ADD3:%.*]] = add nsw i32 [[TMP10]], 1
4887 // CHECK9-NEXT: store i32 [[ADD3]], ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP29]]
4888 // CHECK9-NEXT: br label [[OMP_INNER_FOR_COND]], !llvm.loop [[LOOP30:![0-9]+]]
4889 // CHECK9: omp.inner.for.end:
4890 // CHECK9-NEXT: br label [[OMP_LOOP_EXIT:%.*]]
4891 // CHECK9: omp.loop.exit:
4892 // CHECK9-NEXT: call void @__kmpc_for_static_fini(ptr @[[GLOB1]], i32 [[TMP3]])
4893 // CHECK9-NEXT: [[TMP11:%.*]] = load i32, ptr [[DOTOMP_IS_LAST]], align 4
4894 // CHECK9-NEXT: [[TMP12:%.*]] = icmp ne i32 [[TMP11]], 0
4895 // CHECK9-NEXT: br i1 [[TMP12]], label [[DOTOMP_FINAL_THEN:%.*]], label [[DOTOMP_FINAL_DONE:%.*]]
4896 // CHECK9: .omp.final.then:
4897 // CHECK9-NEXT: store i32 100, ptr [[I]], align 4
4898 // CHECK9-NEXT: br label [[DOTOMP_FINAL_DONE]]
4899 // CHECK9: .omp.final.done:
4900 // CHECK9-NEXT: ret void
4903 // CHECK9-LABEL: define {{[^@]+}}@{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}_main_l84
4904 // CHECK9-SAME: () #[[ATTR1]] {
4905 // CHECK9-NEXT: entry:
4906 // CHECK9-NEXT: call void (ptr, i32, ptr, ...) @__kmpc_fork_teams(ptr @[[GLOB3]], i32 0, ptr @{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}_main_l84.omp_outlined)
4907 // CHECK9-NEXT: ret void
4910 // CHECK9-LABEL: define {{[^@]+}}@{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}_main_l84.omp_outlined
4911 // CHECK9-SAME: (ptr noalias noundef [[DOTGLOBAL_TID_:%.*]], ptr noalias noundef [[DOTBOUND_TID_:%.*]]) #[[ATTR2]] {
4912 // CHECK9-NEXT: entry:
4913 // CHECK9-NEXT: [[DOTGLOBAL_TID__ADDR:%.*]] = alloca ptr, align 8
4914 // CHECK9-NEXT: [[DOTBOUND_TID__ADDR:%.*]] = alloca ptr, align 8
4915 // CHECK9-NEXT: [[DOTOMP_IV:%.*]] = alloca i32, align 4
4916 // CHECK9-NEXT: [[TMP:%.*]] = alloca i32, align 4
4917 // CHECK9-NEXT: [[DOTOMP_COMB_LB:%.*]] = alloca i32, align 4
4918 // CHECK9-NEXT: [[DOTOMP_COMB_UB:%.*]] = alloca i32, align 4
4919 // CHECK9-NEXT: [[DOTOMP_STRIDE:%.*]] = alloca i32, align 4
4920 // CHECK9-NEXT: [[DOTOMP_IS_LAST:%.*]] = alloca i32, align 4
4921 // CHECK9-NEXT: [[I:%.*]] = alloca i32, align 4
4922 // CHECK9-NEXT: [[DOTBOUND_ZERO_ADDR:%.*]] = alloca i32, align 4
4923 // CHECK9-NEXT: store ptr [[DOTGLOBAL_TID_]], ptr [[DOTGLOBAL_TID__ADDR]], align 8
4924 // CHECK9-NEXT: store ptr [[DOTBOUND_TID_]], ptr [[DOTBOUND_TID__ADDR]], align 8
4925 // CHECK9-NEXT: store i32 0, ptr [[DOTOMP_COMB_LB]], align 4
4926 // CHECK9-NEXT: store i32 99, ptr [[DOTOMP_COMB_UB]], align 4
4927 // CHECK9-NEXT: store i32 1, ptr [[DOTOMP_STRIDE]], align 4
4928 // CHECK9-NEXT: store i32 0, ptr [[DOTOMP_IS_LAST]], align 4
4929 // CHECK9-NEXT: [[TMP0:%.*]] = load ptr, ptr [[DOTGLOBAL_TID__ADDR]], align 8
4930 // CHECK9-NEXT: [[TMP1:%.*]] = load i32, ptr [[TMP0]], align 4
4931 // 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)
4932 // CHECK9-NEXT: [[TMP2:%.*]] = load i32, ptr [[DOTOMP_COMB_UB]], align 4
4933 // CHECK9-NEXT: [[CMP:%.*]] = icmp sgt i32 [[TMP2]], 99
4934 // CHECK9-NEXT: br i1 [[CMP]], label [[COND_TRUE:%.*]], label [[COND_FALSE:%.*]]
4935 // CHECK9: cond.true:
4936 // CHECK9-NEXT: br label [[COND_END:%.*]]
4937 // CHECK9: cond.false:
4938 // CHECK9-NEXT: [[TMP3:%.*]] = load i32, ptr [[DOTOMP_COMB_UB]], align 4
4939 // CHECK9-NEXT: br label [[COND_END]]
4940 // CHECK9: cond.end:
4941 // CHECK9-NEXT: [[COND:%.*]] = phi i32 [ 99, [[COND_TRUE]] ], [ [[TMP3]], [[COND_FALSE]] ]
4942 // CHECK9-NEXT: store i32 [[COND]], ptr [[DOTOMP_COMB_UB]], align 4
4943 // CHECK9-NEXT: [[TMP4:%.*]] = load i32, ptr [[DOTOMP_COMB_LB]], align 4
4944 // CHECK9-NEXT: store i32 [[TMP4]], ptr [[DOTOMP_IV]], align 4
4945 // CHECK9-NEXT: br label [[OMP_INNER_FOR_COND:%.*]]
4946 // CHECK9: omp.inner.for.cond:
4947 // CHECK9-NEXT: [[TMP5:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP32:![0-9]+]]
4948 // CHECK9-NEXT: [[TMP6:%.*]] = load i32, ptr [[DOTOMP_COMB_UB]], align 4, !llvm.access.group [[ACC_GRP32]]
4949 // CHECK9-NEXT: [[CMP1:%.*]] = icmp sle i32 [[TMP5]], [[TMP6]]
4950 // CHECK9-NEXT: br i1 [[CMP1]], label [[OMP_INNER_FOR_BODY:%.*]], label [[OMP_INNER_FOR_END:%.*]]
4951 // CHECK9: omp.inner.for.body:
4952 // CHECK9-NEXT: [[TMP7:%.*]] = load i32, ptr [[DOTOMP_COMB_LB]], align 4, !llvm.access.group [[ACC_GRP32]]
4953 // CHECK9-NEXT: [[TMP8:%.*]] = zext i32 [[TMP7]] to i64
4954 // CHECK9-NEXT: [[TMP9:%.*]] = load i32, ptr [[DOTOMP_COMB_UB]], align 4, !llvm.access.group [[ACC_GRP32]]
4955 // CHECK9-NEXT: [[TMP10:%.*]] = zext i32 [[TMP9]] to i64
4956 // CHECK9-NEXT: call void @__kmpc_serialized_parallel(ptr @[[GLOB3]], i32 [[TMP1]]), !llvm.access.group [[ACC_GRP32]]
4957 // CHECK9-NEXT: [[TMP11:%.*]] = load ptr, ptr [[DOTGLOBAL_TID__ADDR]], align 8, !llvm.access.group [[ACC_GRP32]]
4958 // CHECK9-NEXT: store i32 0, ptr [[DOTBOUND_ZERO_ADDR]], align 4, !llvm.access.group [[ACC_GRP32]]
4959 // CHECK9-NEXT: call void @{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}_main_l84.omp_outlined.omp_outlined(ptr [[TMP11]], ptr [[DOTBOUND_ZERO_ADDR]], i64 [[TMP8]], i64 [[TMP10]]) #[[ATTR3]], !llvm.access.group [[ACC_GRP32]]
4960 // CHECK9-NEXT: call void @__kmpc_end_serialized_parallel(ptr @[[GLOB3]], i32 [[TMP1]]), !llvm.access.group [[ACC_GRP32]]
4961 // CHECK9-NEXT: br label [[OMP_INNER_FOR_INC:%.*]]
4962 // CHECK9: omp.inner.for.inc:
4963 // CHECK9-NEXT: [[TMP12:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP32]]
4964 // CHECK9-NEXT: [[TMP13:%.*]] = load i32, ptr [[DOTOMP_STRIDE]], align 4, !llvm.access.group [[ACC_GRP32]]
4965 // CHECK9-NEXT: [[ADD:%.*]] = add nsw i32 [[TMP12]], [[TMP13]]
4966 // CHECK9-NEXT: store i32 [[ADD]], ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP32]]
4967 // CHECK9-NEXT: br label [[OMP_INNER_FOR_COND]], !llvm.loop [[LOOP33:![0-9]+]]
4968 // CHECK9: omp.inner.for.end:
4969 // CHECK9-NEXT: br label [[OMP_LOOP_EXIT:%.*]]
4970 // CHECK9: omp.loop.exit:
4971 // CHECK9-NEXT: call void @__kmpc_for_static_fini(ptr @[[GLOB1]], i32 [[TMP1]])
4972 // CHECK9-NEXT: [[TMP14:%.*]] = load i32, ptr [[DOTOMP_IS_LAST]], align 4
4973 // CHECK9-NEXT: [[TMP15:%.*]] = icmp ne i32 [[TMP14]], 0
4974 // CHECK9-NEXT: br i1 [[TMP15]], label [[DOTOMP_FINAL_THEN:%.*]], label [[DOTOMP_FINAL_DONE:%.*]]
4975 // CHECK9: .omp.final.then:
4976 // CHECK9-NEXT: store i32 100, ptr [[I]], align 4
4977 // CHECK9-NEXT: br label [[DOTOMP_FINAL_DONE]]
4978 // CHECK9: .omp.final.done:
4979 // CHECK9-NEXT: ret void
4982 // CHECK9-LABEL: define {{[^@]+}}@{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}_main_l84.omp_outlined.omp_outlined
4983 // CHECK9-SAME: (ptr noalias noundef [[DOTGLOBAL_TID_:%.*]], ptr noalias noundef [[DOTBOUND_TID_:%.*]], i64 noundef [[DOTPREVIOUS_LB_:%.*]], i64 noundef [[DOTPREVIOUS_UB_:%.*]]) #[[ATTR2]] {
4984 // CHECK9-NEXT: entry:
4985 // CHECK9-NEXT: [[DOTGLOBAL_TID__ADDR:%.*]] = alloca ptr, align 8
4986 // CHECK9-NEXT: [[DOTBOUND_TID__ADDR:%.*]] = alloca ptr, align 8
4987 // CHECK9-NEXT: [[DOTPREVIOUS_LB__ADDR:%.*]] = alloca i64, align 8
4988 // CHECK9-NEXT: [[DOTPREVIOUS_UB__ADDR:%.*]] = alloca i64, align 8
4989 // CHECK9-NEXT: [[DOTOMP_IV:%.*]] = alloca i32, align 4
4990 // CHECK9-NEXT: [[TMP:%.*]] = alloca i32, align 4
4991 // CHECK9-NEXT: [[DOTOMP_LB:%.*]] = alloca i32, align 4
4992 // CHECK9-NEXT: [[DOTOMP_UB:%.*]] = alloca i32, align 4
4993 // CHECK9-NEXT: [[DOTOMP_STRIDE:%.*]] = alloca i32, align 4
4994 // CHECK9-NEXT: [[DOTOMP_IS_LAST:%.*]] = alloca i32, align 4
4995 // CHECK9-NEXT: [[I:%.*]] = alloca i32, align 4
4996 // CHECK9-NEXT: store ptr [[DOTGLOBAL_TID_]], ptr [[DOTGLOBAL_TID__ADDR]], align 8
4997 // CHECK9-NEXT: store ptr [[DOTBOUND_TID_]], ptr [[DOTBOUND_TID__ADDR]], align 8
4998 // CHECK9-NEXT: store i64 [[DOTPREVIOUS_LB_]], ptr [[DOTPREVIOUS_LB__ADDR]], align 8
4999 // CHECK9-NEXT: store i64 [[DOTPREVIOUS_UB_]], ptr [[DOTPREVIOUS_UB__ADDR]], align 8
5000 // CHECK9-NEXT: store i32 0, ptr [[DOTOMP_LB]], align 4
5001 // CHECK9-NEXT: store i32 99, ptr [[DOTOMP_UB]], align 4
5002 // CHECK9-NEXT: [[TMP0:%.*]] = load i64, ptr [[DOTPREVIOUS_LB__ADDR]], align 8
5003 // CHECK9-NEXT: [[CONV:%.*]] = trunc i64 [[TMP0]] to i32
5004 // CHECK9-NEXT: [[TMP1:%.*]] = load i64, ptr [[DOTPREVIOUS_UB__ADDR]], align 8
5005 // CHECK9-NEXT: [[CONV1:%.*]] = trunc i64 [[TMP1]] to i32
5006 // CHECK9-NEXT: store i32 [[CONV]], ptr [[DOTOMP_LB]], align 4
5007 // CHECK9-NEXT: store i32 [[CONV1]], ptr [[DOTOMP_UB]], align 4
5008 // CHECK9-NEXT: store i32 1, ptr [[DOTOMP_STRIDE]], align 4
5009 // CHECK9-NEXT: store i32 0, ptr [[DOTOMP_IS_LAST]], align 4
5010 // CHECK9-NEXT: [[TMP2:%.*]] = load ptr, ptr [[DOTGLOBAL_TID__ADDR]], align 8
5011 // CHECK9-NEXT: [[TMP3:%.*]] = load i32, ptr [[TMP2]], align 4
5012 // 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)
5013 // CHECK9-NEXT: [[TMP4:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4
5014 // CHECK9-NEXT: [[CMP:%.*]] = icmp sgt i32 [[TMP4]], 99
5015 // CHECK9-NEXT: br i1 [[CMP]], label [[COND_TRUE:%.*]], label [[COND_FALSE:%.*]]
5016 // CHECK9: cond.true:
5017 // CHECK9-NEXT: br label [[COND_END:%.*]]
5018 // CHECK9: cond.false:
5019 // CHECK9-NEXT: [[TMP5:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4
5020 // CHECK9-NEXT: br label [[COND_END]]
5021 // CHECK9: cond.end:
5022 // CHECK9-NEXT: [[COND:%.*]] = phi i32 [ 99, [[COND_TRUE]] ], [ [[TMP5]], [[COND_FALSE]] ]
5023 // CHECK9-NEXT: store i32 [[COND]], ptr [[DOTOMP_UB]], align 4
5024 // CHECK9-NEXT: [[TMP6:%.*]] = load i32, ptr [[DOTOMP_LB]], align 4
5025 // CHECK9-NEXT: store i32 [[TMP6]], ptr [[DOTOMP_IV]], align 4
5026 // CHECK9-NEXT: br label [[OMP_INNER_FOR_COND:%.*]]
5027 // CHECK9: omp.inner.for.cond:
5028 // CHECK9-NEXT: [[TMP7:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP35:![0-9]+]]
5029 // CHECK9-NEXT: [[TMP8:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4, !llvm.access.group [[ACC_GRP35]]
5030 // CHECK9-NEXT: [[CMP2:%.*]] = icmp sle i32 [[TMP7]], [[TMP8]]
5031 // CHECK9-NEXT: br i1 [[CMP2]], label [[OMP_INNER_FOR_BODY:%.*]], label [[OMP_INNER_FOR_END:%.*]]
5032 // CHECK9: omp.inner.for.body:
5033 // CHECK9-NEXT: [[TMP9:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP35]]
5034 // CHECK9-NEXT: [[MUL:%.*]] = mul nsw i32 [[TMP9]], 1
5035 // CHECK9-NEXT: [[ADD:%.*]] = add nsw i32 0, [[MUL]]
5036 // CHECK9-NEXT: store i32 [[ADD]], ptr [[I]], align 4, !llvm.access.group [[ACC_GRP35]]
5037 // CHECK9-NEXT: call void @_Z3fn5v(), !llvm.access.group [[ACC_GRP35]]
5038 // CHECK9-NEXT: br label [[OMP_BODY_CONTINUE:%.*]]
5039 // CHECK9: omp.body.continue:
5040 // CHECK9-NEXT: br label [[OMP_INNER_FOR_INC:%.*]]
5041 // CHECK9: omp.inner.for.inc:
5042 // CHECK9-NEXT: [[TMP10:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP35]]
5043 // CHECK9-NEXT: [[ADD3:%.*]] = add nsw i32 [[TMP10]], 1
5044 // CHECK9-NEXT: store i32 [[ADD3]], ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP35]]
5045 // CHECK9-NEXT: br label [[OMP_INNER_FOR_COND]], !llvm.loop [[LOOP36:![0-9]+]]
5046 // CHECK9: omp.inner.for.end:
5047 // CHECK9-NEXT: br label [[OMP_LOOP_EXIT:%.*]]
5048 // CHECK9: omp.loop.exit:
5049 // CHECK9-NEXT: call void @__kmpc_for_static_fini(ptr @[[GLOB1]], i32 [[TMP3]])
5050 // CHECK9-NEXT: [[TMP11:%.*]] = load i32, ptr [[DOTOMP_IS_LAST]], align 4
5051 // CHECK9-NEXT: [[TMP12:%.*]] = icmp ne i32 [[TMP11]], 0
5052 // CHECK9-NEXT: br i1 [[TMP12]], label [[DOTOMP_FINAL_THEN:%.*]], label [[DOTOMP_FINAL_DONE:%.*]]
5053 // CHECK9: .omp.final.then:
5054 // CHECK9-NEXT: store i32 100, ptr [[I]], align 4
5055 // CHECK9-NEXT: br label [[DOTOMP_FINAL_DONE]]
5056 // CHECK9: .omp.final.done:
5057 // CHECK9-NEXT: ret void
5060 // CHECK9-LABEL: define {{[^@]+}}@{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}_main_l92
5061 // CHECK9-SAME: (i64 noundef [[ARG:%.*]]) #[[ATTR1]] {
5062 // CHECK9-NEXT: entry:
5063 // CHECK9-NEXT: [[ARG_ADDR:%.*]] = alloca i64, align 8
5064 // CHECK9-NEXT: [[DOTCAPTURE_EXPR_:%.*]] = alloca i8, align 1
5065 // CHECK9-NEXT: [[DOTCAPTURE_EXPR__CASTED:%.*]] = alloca i64, align 8
5066 // CHECK9-NEXT: store i64 [[ARG]], ptr [[ARG_ADDR]], align 8
5067 // CHECK9-NEXT: [[TMP0:%.*]] = load i32, ptr [[ARG_ADDR]], align 4
5068 // CHECK9-NEXT: [[TOBOOL:%.*]] = icmp ne i32 [[TMP0]], 0
5069 // CHECK9-NEXT: [[FROMBOOL:%.*]] = zext i1 [[TOBOOL]] to i8
5070 // CHECK9-NEXT: store i8 [[FROMBOOL]], ptr [[DOTCAPTURE_EXPR_]], align 1
5071 // CHECK9-NEXT: [[TMP1:%.*]] = load i8, ptr [[DOTCAPTURE_EXPR_]], align 1
5072 // CHECK9-NEXT: [[TOBOOL1:%.*]] = trunc i8 [[TMP1]] to i1
5073 // CHECK9-NEXT: [[FROMBOOL2:%.*]] = zext i1 [[TOBOOL1]] to i8
5074 // CHECK9-NEXT: store i8 [[FROMBOOL2]], ptr [[DOTCAPTURE_EXPR__CASTED]], align 1
5075 // CHECK9-NEXT: [[TMP2:%.*]] = load i64, ptr [[DOTCAPTURE_EXPR__CASTED]], align 8
5076 // CHECK9-NEXT: call void (ptr, i32, ptr, ...) @__kmpc_fork_teams(ptr @[[GLOB3]], i32 1, ptr @{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}_main_l92.omp_outlined, i64 [[TMP2]])
5077 // CHECK9-NEXT: ret void
5080 // CHECK9-LABEL: define {{[^@]+}}@{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}_main_l92.omp_outlined
5081 // CHECK9-SAME: (ptr noalias noundef [[DOTGLOBAL_TID_:%.*]], ptr noalias noundef [[DOTBOUND_TID_:%.*]], i64 noundef [[DOTCAPTURE_EXPR_:%.*]]) #[[ATTR2]] {
5082 // CHECK9-NEXT: entry:
5083 // CHECK9-NEXT: [[DOTGLOBAL_TID__ADDR:%.*]] = alloca ptr, align 8
5084 // CHECK9-NEXT: [[DOTBOUND_TID__ADDR:%.*]] = alloca ptr, align 8
5085 // CHECK9-NEXT: [[DOTCAPTURE_EXPR__ADDR:%.*]] = alloca i64, align 8
5086 // CHECK9-NEXT: [[DOTOMP_IV:%.*]] = alloca i32, align 4
5087 // CHECK9-NEXT: [[TMP:%.*]] = alloca i32, align 4
5088 // CHECK9-NEXT: [[DOTOMP_COMB_LB:%.*]] = alloca i32, align 4
5089 // CHECK9-NEXT: [[DOTOMP_COMB_UB:%.*]] = alloca i32, align 4
5090 // CHECK9-NEXT: [[DOTOMP_STRIDE:%.*]] = alloca i32, align 4
5091 // CHECK9-NEXT: [[DOTOMP_IS_LAST:%.*]] = alloca i32, align 4
5092 // CHECK9-NEXT: [[I:%.*]] = alloca i32, align 4
5093 // CHECK9-NEXT: [[DOTBOUND_ZERO_ADDR:%.*]] = alloca i32, align 4
5094 // CHECK9-NEXT: store ptr [[DOTGLOBAL_TID_]], ptr [[DOTGLOBAL_TID__ADDR]], align 8
5095 // CHECK9-NEXT: store ptr [[DOTBOUND_TID_]], ptr [[DOTBOUND_TID__ADDR]], align 8
5096 // CHECK9-NEXT: store i64 [[DOTCAPTURE_EXPR_]], ptr [[DOTCAPTURE_EXPR__ADDR]], align 8
5097 // CHECK9-NEXT: store i32 0, ptr [[DOTOMP_COMB_LB]], align 4
5098 // CHECK9-NEXT: store i32 99, ptr [[DOTOMP_COMB_UB]], align 4
5099 // CHECK9-NEXT: store i32 1, ptr [[DOTOMP_STRIDE]], align 4
5100 // CHECK9-NEXT: store i32 0, ptr [[DOTOMP_IS_LAST]], align 4
5101 // CHECK9-NEXT: [[TMP0:%.*]] = load ptr, ptr [[DOTGLOBAL_TID__ADDR]], align 8
5102 // CHECK9-NEXT: [[TMP1:%.*]] = load i32, ptr [[TMP0]], align 4
5103 // 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)
5104 // CHECK9-NEXT: [[TMP2:%.*]] = load i32, ptr [[DOTOMP_COMB_UB]], align 4
5105 // CHECK9-NEXT: [[CMP:%.*]] = icmp sgt i32 [[TMP2]], 99
5106 // CHECK9-NEXT: br i1 [[CMP]], label [[COND_TRUE:%.*]], label [[COND_FALSE:%.*]]
5107 // CHECK9: cond.true:
5108 // CHECK9-NEXT: br label [[COND_END:%.*]]
5109 // CHECK9: cond.false:
5110 // CHECK9-NEXT: [[TMP3:%.*]] = load i32, ptr [[DOTOMP_COMB_UB]], align 4
5111 // CHECK9-NEXT: br label [[COND_END]]
5112 // CHECK9: cond.end:
5113 // CHECK9-NEXT: [[COND:%.*]] = phi i32 [ 99, [[COND_TRUE]] ], [ [[TMP3]], [[COND_FALSE]] ]
5114 // CHECK9-NEXT: store i32 [[COND]], ptr [[DOTOMP_COMB_UB]], align 4
5115 // CHECK9-NEXT: [[TMP4:%.*]] = load i32, ptr [[DOTOMP_COMB_LB]], align 4
5116 // CHECK9-NEXT: store i32 [[TMP4]], ptr [[DOTOMP_IV]], align 4
5117 // CHECK9-NEXT: br label [[OMP_INNER_FOR_COND:%.*]]
5118 // CHECK9: omp.inner.for.cond:
5119 // CHECK9-NEXT: [[TMP5:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP38:![0-9]+]]
5120 // CHECK9-NEXT: [[TMP6:%.*]] = load i32, ptr [[DOTOMP_COMB_UB]], align 4, !llvm.access.group [[ACC_GRP38]]
5121 // CHECK9-NEXT: [[CMP1:%.*]] = icmp sle i32 [[TMP5]], [[TMP6]]
5122 // CHECK9-NEXT: br i1 [[CMP1]], label [[OMP_INNER_FOR_BODY:%.*]], label [[OMP_INNER_FOR_END:%.*]]
5123 // CHECK9: omp.inner.for.body:
5124 // CHECK9-NEXT: [[TMP7:%.*]] = load i32, ptr [[DOTOMP_COMB_LB]], align 4, !llvm.access.group [[ACC_GRP38]]
5125 // CHECK9-NEXT: [[TMP8:%.*]] = zext i32 [[TMP7]] to i64
5126 // CHECK9-NEXT: [[TMP9:%.*]] = load i32, ptr [[DOTOMP_COMB_UB]], align 4, !llvm.access.group [[ACC_GRP38]]
5127 // CHECK9-NEXT: [[TMP10:%.*]] = zext i32 [[TMP9]] to i64
5128 // CHECK9-NEXT: [[TMP11:%.*]] = load i8, ptr [[DOTCAPTURE_EXPR__ADDR]], align 1, !llvm.access.group [[ACC_GRP38]]
5129 // CHECK9-NEXT: [[TOBOOL:%.*]] = trunc i8 [[TMP11]] to i1
5130 // CHECK9-NEXT: br i1 [[TOBOOL]], label [[OMP_IF_THEN:%.*]], label [[OMP_IF_ELSE:%.*]]
5131 // CHECK9: omp_if.then:
5132 // CHECK9-NEXT: call void (ptr, i32, ptr, ...) @__kmpc_fork_call(ptr @[[GLOB3]], i32 2, ptr @{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}_main_l92.omp_outlined.omp_outlined, i64 [[TMP8]], i64 [[TMP10]]), !llvm.access.group [[ACC_GRP38]]
5133 // CHECK9-NEXT: br label [[OMP_IF_END:%.*]]
5134 // CHECK9: omp_if.else:
5135 // CHECK9-NEXT: call void @__kmpc_serialized_parallel(ptr @[[GLOB3]], i32 [[TMP1]]), !llvm.access.group [[ACC_GRP38]]
5136 // CHECK9-NEXT: [[TMP12:%.*]] = load ptr, ptr [[DOTGLOBAL_TID__ADDR]], align 8, !llvm.access.group [[ACC_GRP38]]
5137 // CHECK9-NEXT: store i32 0, ptr [[DOTBOUND_ZERO_ADDR]], align 4, !llvm.access.group [[ACC_GRP38]]
5138 // CHECK9-NEXT: call void @{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}_main_l92.omp_outlined.omp_outlined(ptr [[TMP12]], ptr [[DOTBOUND_ZERO_ADDR]], i64 [[TMP8]], i64 [[TMP10]]) #[[ATTR3]], !llvm.access.group [[ACC_GRP38]]
5139 // CHECK9-NEXT: call void @__kmpc_end_serialized_parallel(ptr @[[GLOB3]], i32 [[TMP1]]), !llvm.access.group [[ACC_GRP38]]
5140 // CHECK9-NEXT: br label [[OMP_IF_END]]
5141 // CHECK9: omp_if.end:
5142 // CHECK9-NEXT: br label [[OMP_INNER_FOR_INC:%.*]]
5143 // CHECK9: omp.inner.for.inc:
5144 // CHECK9-NEXT: [[TMP13:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP38]]
5145 // CHECK9-NEXT: [[TMP14:%.*]] = load i32, ptr [[DOTOMP_STRIDE]], align 4, !llvm.access.group [[ACC_GRP38]]
5146 // CHECK9-NEXT: [[ADD:%.*]] = add nsw i32 [[TMP13]], [[TMP14]]
5147 // CHECK9-NEXT: store i32 [[ADD]], ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP38]]
5148 // CHECK9-NEXT: br label [[OMP_INNER_FOR_COND]], !llvm.loop [[LOOP39:![0-9]+]]
5149 // CHECK9: omp.inner.for.end:
5150 // CHECK9-NEXT: br label [[OMP_LOOP_EXIT:%.*]]
5151 // CHECK9: omp.loop.exit:
5152 // CHECK9-NEXT: call void @__kmpc_for_static_fini(ptr @[[GLOB1]], i32 [[TMP1]])
5153 // CHECK9-NEXT: [[TMP15:%.*]] = load i32, ptr [[DOTOMP_IS_LAST]], align 4
5154 // CHECK9-NEXT: [[TMP16:%.*]] = icmp ne i32 [[TMP15]], 0
5155 // CHECK9-NEXT: br i1 [[TMP16]], label [[DOTOMP_FINAL_THEN:%.*]], label [[DOTOMP_FINAL_DONE:%.*]]
5156 // CHECK9: .omp.final.then:
5157 // CHECK9-NEXT: store i32 100, ptr [[I]], align 4
5158 // CHECK9-NEXT: br label [[DOTOMP_FINAL_DONE]]
5159 // CHECK9: .omp.final.done:
5160 // CHECK9-NEXT: ret void
5163 // CHECK9-LABEL: define {{[^@]+}}@{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}_main_l92.omp_outlined.omp_outlined
5164 // CHECK9-SAME: (ptr noalias noundef [[DOTGLOBAL_TID_:%.*]], ptr noalias noundef [[DOTBOUND_TID_:%.*]], i64 noundef [[DOTPREVIOUS_LB_:%.*]], i64 noundef [[DOTPREVIOUS_UB_:%.*]]) #[[ATTR2]] {
5165 // CHECK9-NEXT: entry:
5166 // CHECK9-NEXT: [[DOTGLOBAL_TID__ADDR:%.*]] = alloca ptr, align 8
5167 // CHECK9-NEXT: [[DOTBOUND_TID__ADDR:%.*]] = alloca ptr, align 8
5168 // CHECK9-NEXT: [[DOTPREVIOUS_LB__ADDR:%.*]] = alloca i64, align 8
5169 // CHECK9-NEXT: [[DOTPREVIOUS_UB__ADDR:%.*]] = alloca i64, align 8
5170 // CHECK9-NEXT: [[DOTOMP_IV:%.*]] = alloca i32, align 4
5171 // CHECK9-NEXT: [[TMP:%.*]] = alloca i32, align 4
5172 // CHECK9-NEXT: [[DOTOMP_LB:%.*]] = alloca i32, align 4
5173 // CHECK9-NEXT: [[DOTOMP_UB:%.*]] = alloca i32, align 4
5174 // CHECK9-NEXT: [[DOTOMP_STRIDE:%.*]] = alloca i32, align 4
5175 // CHECK9-NEXT: [[DOTOMP_IS_LAST:%.*]] = alloca i32, align 4
5176 // CHECK9-NEXT: [[I:%.*]] = alloca i32, align 4
5177 // CHECK9-NEXT: store ptr [[DOTGLOBAL_TID_]], ptr [[DOTGLOBAL_TID__ADDR]], align 8
5178 // CHECK9-NEXT: store ptr [[DOTBOUND_TID_]], ptr [[DOTBOUND_TID__ADDR]], align 8
5179 // CHECK9-NEXT: store i64 [[DOTPREVIOUS_LB_]], ptr [[DOTPREVIOUS_LB__ADDR]], align 8
5180 // CHECK9-NEXT: store i64 [[DOTPREVIOUS_UB_]], ptr [[DOTPREVIOUS_UB__ADDR]], align 8
5181 // CHECK9-NEXT: store i32 0, ptr [[DOTOMP_LB]], align 4
5182 // CHECK9-NEXT: store i32 99, ptr [[DOTOMP_UB]], align 4
5183 // CHECK9-NEXT: [[TMP0:%.*]] = load i64, ptr [[DOTPREVIOUS_LB__ADDR]], align 8
5184 // CHECK9-NEXT: [[CONV:%.*]] = trunc i64 [[TMP0]] to i32
5185 // CHECK9-NEXT: [[TMP1:%.*]] = load i64, ptr [[DOTPREVIOUS_UB__ADDR]], align 8
5186 // CHECK9-NEXT: [[CONV1:%.*]] = trunc i64 [[TMP1]] to i32
5187 // CHECK9-NEXT: store i32 [[CONV]], ptr [[DOTOMP_LB]], align 4
5188 // CHECK9-NEXT: store i32 [[CONV1]], ptr [[DOTOMP_UB]], align 4
5189 // CHECK9-NEXT: store i32 1, ptr [[DOTOMP_STRIDE]], align 4
5190 // CHECK9-NEXT: store i32 0, ptr [[DOTOMP_IS_LAST]], align 4
5191 // CHECK9-NEXT: [[TMP2:%.*]] = load ptr, ptr [[DOTGLOBAL_TID__ADDR]], align 8
5192 // CHECK9-NEXT: [[TMP3:%.*]] = load i32, ptr [[TMP2]], align 4
5193 // 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)
5194 // CHECK9-NEXT: [[TMP4:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4
5195 // CHECK9-NEXT: [[CMP:%.*]] = icmp sgt i32 [[TMP4]], 99
5196 // CHECK9-NEXT: br i1 [[CMP]], label [[COND_TRUE:%.*]], label [[COND_FALSE:%.*]]
5197 // CHECK9: cond.true:
5198 // CHECK9-NEXT: br label [[COND_END:%.*]]
5199 // CHECK9: cond.false:
5200 // CHECK9-NEXT: [[TMP5:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4
5201 // CHECK9-NEXT: br label [[COND_END]]
5202 // CHECK9: cond.end:
5203 // CHECK9-NEXT: [[COND:%.*]] = phi i32 [ 99, [[COND_TRUE]] ], [ [[TMP5]], [[COND_FALSE]] ]
5204 // CHECK9-NEXT: store i32 [[COND]], ptr [[DOTOMP_UB]], align 4
5205 // CHECK9-NEXT: [[TMP6:%.*]] = load i32, ptr [[DOTOMP_LB]], align 4
5206 // CHECK9-NEXT: store i32 [[TMP6]], ptr [[DOTOMP_IV]], align 4
5207 // CHECK9-NEXT: br label [[OMP_INNER_FOR_COND:%.*]]
5208 // CHECK9: omp.inner.for.cond:
5209 // CHECK9-NEXT: [[TMP7:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP41:![0-9]+]]
5210 // CHECK9-NEXT: [[TMP8:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4, !llvm.access.group [[ACC_GRP41]]
5211 // CHECK9-NEXT: [[CMP2:%.*]] = icmp sle i32 [[TMP7]], [[TMP8]]
5212 // CHECK9-NEXT: br i1 [[CMP2]], label [[OMP_INNER_FOR_BODY:%.*]], label [[OMP_INNER_FOR_END:%.*]]
5213 // CHECK9: omp.inner.for.body:
5214 // CHECK9-NEXT: [[TMP9:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP41]]
5215 // CHECK9-NEXT: [[MUL:%.*]] = mul nsw i32 [[TMP9]], 1
5216 // CHECK9-NEXT: [[ADD:%.*]] = add nsw i32 0, [[MUL]]
5217 // CHECK9-NEXT: store i32 [[ADD]], ptr [[I]], align 4, !llvm.access.group [[ACC_GRP41]]
5218 // CHECK9-NEXT: call void @_Z3fn6v(), !llvm.access.group [[ACC_GRP41]]
5219 // CHECK9-NEXT: br label [[OMP_BODY_CONTINUE:%.*]]
5220 // CHECK9: omp.body.continue:
5221 // CHECK9-NEXT: br label [[OMP_INNER_FOR_INC:%.*]]
5222 // CHECK9: omp.inner.for.inc:
5223 // CHECK9-NEXT: [[TMP10:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP41]]
5224 // CHECK9-NEXT: [[ADD3:%.*]] = add nsw i32 [[TMP10]], 1
5225 // CHECK9-NEXT: store i32 [[ADD3]], ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP41]]
5226 // CHECK9-NEXT: br label [[OMP_INNER_FOR_COND]], !llvm.loop [[LOOP42:![0-9]+]]
5227 // CHECK9: omp.inner.for.end:
5228 // CHECK9-NEXT: br label [[OMP_LOOP_EXIT:%.*]]
5229 // CHECK9: omp.loop.exit:
5230 // CHECK9-NEXT: call void @__kmpc_for_static_fini(ptr @[[GLOB1]], i32 [[TMP3]])
5231 // CHECK9-NEXT: [[TMP11:%.*]] = load i32, ptr [[DOTOMP_IS_LAST]], align 4
5232 // CHECK9-NEXT: [[TMP12:%.*]] = icmp ne i32 [[TMP11]], 0
5233 // CHECK9-NEXT: br i1 [[TMP12]], label [[DOTOMP_FINAL_THEN:%.*]], label [[DOTOMP_FINAL_DONE:%.*]]
5234 // CHECK9: .omp.final.then:
5235 // CHECK9-NEXT: store i32 100, ptr [[I]], align 4
5236 // CHECK9-NEXT: br label [[DOTOMP_FINAL_DONE]]
5237 // CHECK9: .omp.final.done:
5238 // CHECK9-NEXT: ret void
5241 // CHECK9-LABEL: define {{[^@]+}}@_Z5tmainIiEiT_
5242 // CHECK9-SAME: (i32 noundef [[ARG:%.*]]) #[[ATTR0]] comdat {
5243 // CHECK9-NEXT: entry:
5244 // CHECK9-NEXT: [[ARG_ADDR:%.*]] = alloca i32, align 4
5245 // CHECK9-NEXT: [[TMP:%.*]] = alloca i32, align 4
5246 // CHECK9-NEXT: [[KERNEL_ARGS:%.*]] = alloca [[STRUCT___TGT_KERNEL_ARGUMENTS:%.*]], align 8
5247 // CHECK9-NEXT: [[_TMP1:%.*]] = alloca i32, align 4
5248 // CHECK9-NEXT: [[KERNEL_ARGS2:%.*]] = alloca [[STRUCT___TGT_KERNEL_ARGUMENTS]], align 8
5249 // CHECK9-NEXT: [[ARG_CASTED:%.*]] = alloca i64, align 8
5250 // CHECK9-NEXT: [[DOTOFFLOAD_BASEPTRS:%.*]] = alloca [1 x ptr], align 8
5251 // CHECK9-NEXT: [[DOTOFFLOAD_PTRS:%.*]] = alloca [1 x ptr], align 8
5252 // CHECK9-NEXT: [[DOTOFFLOAD_MAPPERS:%.*]] = alloca [1 x ptr], align 8
5253 // CHECK9-NEXT: [[DOTCAPTURE_EXPR_:%.*]] = alloca i8, align 1
5254 // CHECK9-NEXT: [[_TMP6:%.*]] = alloca i32, align 4
5255 // CHECK9-NEXT: [[KERNEL_ARGS7:%.*]] = alloca [[STRUCT___TGT_KERNEL_ARGUMENTS]], align 8
5256 // CHECK9-NEXT: store i32 [[ARG]], ptr [[ARG_ADDR]], align 4
5257 // CHECK9-NEXT: [[TMP0:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 0
5258 // CHECK9-NEXT: store i32 2, ptr [[TMP0]], align 4
5259 // CHECK9-NEXT: [[TMP1:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 1
5260 // CHECK9-NEXT: store i32 0, ptr [[TMP1]], align 4
5261 // CHECK9-NEXT: [[TMP2:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 2
5262 // CHECK9-NEXT: store ptr null, ptr [[TMP2]], align 8
5263 // CHECK9-NEXT: [[TMP3:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 3
5264 // CHECK9-NEXT: store ptr null, ptr [[TMP3]], align 8
5265 // CHECK9-NEXT: [[TMP4:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 4
5266 // CHECK9-NEXT: store ptr null, ptr [[TMP4]], align 8
5267 // CHECK9-NEXT: [[TMP5:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 5
5268 // CHECK9-NEXT: store ptr null, ptr [[TMP5]], align 8
5269 // CHECK9-NEXT: [[TMP6:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 6
5270 // CHECK9-NEXT: store ptr null, ptr [[TMP6]], align 8
5271 // CHECK9-NEXT: [[TMP7:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 7
5272 // CHECK9-NEXT: store ptr null, ptr [[TMP7]], align 8
5273 // CHECK9-NEXT: [[TMP8:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 8
5274 // CHECK9-NEXT: store i64 100, ptr [[TMP8]], align 8
5275 // CHECK9-NEXT: [[TMP9:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 9
5276 // CHECK9-NEXT: store i64 0, ptr [[TMP9]], align 8
5277 // CHECK9-NEXT: [[TMP10:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 10
5278 // CHECK9-NEXT: store [3 x i32] zeroinitializer, ptr [[TMP10]], align 4
5279 // CHECK9-NEXT: [[TMP11:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 11
5280 // CHECK9-NEXT: store [3 x i32] zeroinitializer, ptr [[TMP11]], align 4
5281 // CHECK9-NEXT: [[TMP12:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 12
5282 // CHECK9-NEXT: store i32 0, ptr [[TMP12]], align 4
5283 // 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__l57.region_id, ptr [[KERNEL_ARGS]])
5284 // CHECK9-NEXT: [[TMP14:%.*]] = icmp ne i32 [[TMP13]], 0
5285 // CHECK9-NEXT: br i1 [[TMP14]], label [[OMP_OFFLOAD_FAILED:%.*]], label [[OMP_OFFLOAD_CONT:%.*]]
5286 // CHECK9: omp_offload.failed:
5287 // CHECK9-NEXT: call void @{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z5tmainIiEiT__l57() #[[ATTR3]]
5288 // CHECK9-NEXT: br label [[OMP_OFFLOAD_CONT]]
5289 // CHECK9: omp_offload.cont:
5290 // CHECK9-NEXT: [[TMP15:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS2]], i32 0, i32 0
5291 // CHECK9-NEXT: store i32 2, ptr [[TMP15]], align 4
5292 // CHECK9-NEXT: [[TMP16:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS2]], i32 0, i32 1
5293 // CHECK9-NEXT: store i32 0, ptr [[TMP16]], align 4
5294 // CHECK9-NEXT: [[TMP17:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS2]], i32 0, i32 2
5295 // CHECK9-NEXT: store ptr null, ptr [[TMP17]], align 8
5296 // CHECK9-NEXT: [[TMP18:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS2]], i32 0, i32 3
5297 // CHECK9-NEXT: store ptr null, ptr [[TMP18]], align 8
5298 // CHECK9-NEXT: [[TMP19:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS2]], i32 0, i32 4
5299 // CHECK9-NEXT: store ptr null, ptr [[TMP19]], align 8
5300 // CHECK9-NEXT: [[TMP20:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS2]], i32 0, i32 5
5301 // CHECK9-NEXT: store ptr null, ptr [[TMP20]], align 8
5302 // CHECK9-NEXT: [[TMP21:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS2]], i32 0, i32 6
5303 // CHECK9-NEXT: store ptr null, ptr [[TMP21]], align 8
5304 // CHECK9-NEXT: [[TMP22:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS2]], i32 0, i32 7
5305 // CHECK9-NEXT: store ptr null, ptr [[TMP22]], align 8
5306 // CHECK9-NEXT: [[TMP23:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS2]], i32 0, i32 8
5307 // CHECK9-NEXT: store i64 100, ptr [[TMP23]], align 8
5308 // CHECK9-NEXT: [[TMP24:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS2]], i32 0, i32 9
5309 // CHECK9-NEXT: store i64 0, ptr [[TMP24]], align 8
5310 // CHECK9-NEXT: [[TMP25:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS2]], i32 0, i32 10
5311 // CHECK9-NEXT: store [3 x i32] zeroinitializer, ptr [[TMP25]], align 4
5312 // CHECK9-NEXT: [[TMP26:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS2]], i32 0, i32 11
5313 // CHECK9-NEXT: store [3 x i32] [i32 1, i32 0, i32 0], ptr [[TMP26]], align 4
5314 // CHECK9-NEXT: [[TMP27:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS2]], i32 0, i32 12
5315 // CHECK9-NEXT: store i32 0, ptr [[TMP27]], align 4
5316 // CHECK9-NEXT: [[TMP28:%.*]] = call i32 @__tgt_target_kernel(ptr @[[GLOB3]], i64 -1, i32 0, i32 1, ptr @.{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z5tmainIiEiT__l62.region_id, ptr [[KERNEL_ARGS2]])
5317 // CHECK9-NEXT: [[TMP29:%.*]] = icmp ne i32 [[TMP28]], 0
5318 // CHECK9-NEXT: br i1 [[TMP29]], label [[OMP_OFFLOAD_FAILED3:%.*]], label [[OMP_OFFLOAD_CONT4:%.*]]
5319 // CHECK9: omp_offload.failed3:
5320 // CHECK9-NEXT: call void @{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z5tmainIiEiT__l62() #[[ATTR3]]
5321 // CHECK9-NEXT: br label [[OMP_OFFLOAD_CONT4]]
5322 // CHECK9: omp_offload.cont4:
5323 // CHECK9-NEXT: [[TMP30:%.*]] = load i32, ptr [[ARG_ADDR]], align 4
5324 // CHECK9-NEXT: store i32 [[TMP30]], ptr [[ARG_CASTED]], align 4
5325 // CHECK9-NEXT: [[TMP31:%.*]] = load i64, ptr [[ARG_CASTED]], align 8
5326 // CHECK9-NEXT: [[TMP32:%.*]] = getelementptr inbounds [1 x ptr], ptr [[DOTOFFLOAD_BASEPTRS]], i32 0, i32 0
5327 // CHECK9-NEXT: store i64 [[TMP31]], ptr [[TMP32]], align 8
5328 // CHECK9-NEXT: [[TMP33:%.*]] = getelementptr inbounds [1 x ptr], ptr [[DOTOFFLOAD_PTRS]], i32 0, i32 0
5329 // CHECK9-NEXT: store i64 [[TMP31]], ptr [[TMP33]], align 8
5330 // CHECK9-NEXT: [[TMP34:%.*]] = getelementptr inbounds [1 x ptr], ptr [[DOTOFFLOAD_MAPPERS]], i64 0, i64 0
5331 // CHECK9-NEXT: store ptr null, ptr [[TMP34]], align 8
5332 // CHECK9-NEXT: [[TMP35:%.*]] = getelementptr inbounds [1 x ptr], ptr [[DOTOFFLOAD_BASEPTRS]], i32 0, i32 0
5333 // CHECK9-NEXT: [[TMP36:%.*]] = getelementptr inbounds [1 x ptr], ptr [[DOTOFFLOAD_PTRS]], i32 0, i32 0
5334 // CHECK9-NEXT: [[TMP37:%.*]] = load i32, ptr [[ARG_ADDR]], align 4
5335 // CHECK9-NEXT: [[TOBOOL:%.*]] = icmp ne i32 [[TMP37]], 0
5336 // CHECK9-NEXT: [[FROMBOOL:%.*]] = zext i1 [[TOBOOL]] to i8
5337 // CHECK9-NEXT: store i8 [[FROMBOOL]], ptr [[DOTCAPTURE_EXPR_]], align 1
5338 // CHECK9-NEXT: [[TMP38:%.*]] = load i8, ptr [[DOTCAPTURE_EXPR_]], align 1
5339 // CHECK9-NEXT: [[TOBOOL5:%.*]] = trunc i8 [[TMP38]] to i1
5340 // CHECK9-NEXT: [[TMP39:%.*]] = select i1 [[TOBOOL5]], i32 0, i32 1
5341 // CHECK9-NEXT: [[TMP40:%.*]] = insertvalue [3 x i32] zeroinitializer, i32 [[TMP39]], 0
5342 // CHECK9-NEXT: [[TMP41:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS7]], i32 0, i32 0
5343 // CHECK9-NEXT: store i32 2, ptr [[TMP41]], align 4
5344 // CHECK9-NEXT: [[TMP42:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS7]], i32 0, i32 1
5345 // CHECK9-NEXT: store i32 1, ptr [[TMP42]], align 4
5346 // CHECK9-NEXT: [[TMP43:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS7]], i32 0, i32 2
5347 // CHECK9-NEXT: store ptr [[TMP35]], ptr [[TMP43]], align 8
5348 // CHECK9-NEXT: [[TMP44:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS7]], i32 0, i32 3
5349 // CHECK9-NEXT: store ptr [[TMP36]], ptr [[TMP44]], align 8
5350 // CHECK9-NEXT: [[TMP45:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS7]], i32 0, i32 4
5351 // CHECK9-NEXT: store ptr @.offload_sizes.1, ptr [[TMP45]], align 8
5352 // CHECK9-NEXT: [[TMP46:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS7]], i32 0, i32 5
5353 // CHECK9-NEXT: store ptr @.offload_maptypes.2, ptr [[TMP46]], align 8
5354 // CHECK9-NEXT: [[TMP47:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS7]], i32 0, i32 6
5355 // CHECK9-NEXT: store ptr null, ptr [[TMP47]], align 8
5356 // CHECK9-NEXT: [[TMP48:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS7]], i32 0, i32 7
5357 // CHECK9-NEXT: store ptr null, ptr [[TMP48]], align 8
5358 // CHECK9-NEXT: [[TMP49:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS7]], i32 0, i32 8
5359 // CHECK9-NEXT: store i64 100, ptr [[TMP49]], align 8
5360 // CHECK9-NEXT: [[TMP50:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS7]], i32 0, i32 9
5361 // CHECK9-NEXT: store i64 0, ptr [[TMP50]], align 8
5362 // CHECK9-NEXT: [[TMP51:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS7]], i32 0, i32 10
5363 // CHECK9-NEXT: store [3 x i32] zeroinitializer, ptr [[TMP51]], align 4
5364 // CHECK9-NEXT: [[TMP52:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS7]], i32 0, i32 11
5365 // CHECK9-NEXT: store [3 x i32] [[TMP40]], ptr [[TMP52]], align 4
5366 // CHECK9-NEXT: [[TMP53:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS7]], i32 0, i32 12
5367 // CHECK9-NEXT: store i32 0, ptr [[TMP53]], align 4
5368 // CHECK9-NEXT: [[TMP54:%.*]] = call i32 @__tgt_target_kernel(ptr @[[GLOB3]], i64 -1, i32 0, i32 [[TMP39]], ptr @.{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z5tmainIiEiT__l67.region_id, ptr [[KERNEL_ARGS7]])
5369 // CHECK9-NEXT: [[TMP55:%.*]] = icmp ne i32 [[TMP54]], 0
5370 // CHECK9-NEXT: br i1 [[TMP55]], label [[OMP_OFFLOAD_FAILED8:%.*]], label [[OMP_OFFLOAD_CONT9:%.*]]
5371 // CHECK9: omp_offload.failed8:
5372 // CHECK9-NEXT: call void @{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z5tmainIiEiT__l67(i64 [[TMP31]]) #[[ATTR3]]
5373 // CHECK9-NEXT: br label [[OMP_OFFLOAD_CONT9]]
5374 // CHECK9: omp_offload.cont9:
5375 // CHECK9-NEXT: ret i32 0
5378 // CHECK9-LABEL: define {{[^@]+}}@{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z5tmainIiEiT__l57
5379 // CHECK9-SAME: () #[[ATTR1]] {
5380 // CHECK9-NEXT: entry:
5381 // CHECK9-NEXT: call void (ptr, i32, ptr, ...) @__kmpc_fork_teams(ptr @[[GLOB3]], i32 0, ptr @{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z5tmainIiEiT__l57.omp_outlined)
5382 // CHECK9-NEXT: ret void
5385 // CHECK9-LABEL: define {{[^@]+}}@{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z5tmainIiEiT__l57.omp_outlined
5386 // CHECK9-SAME: (ptr noalias noundef [[DOTGLOBAL_TID_:%.*]], ptr noalias noundef [[DOTBOUND_TID_:%.*]]) #[[ATTR2]] {
5387 // CHECK9-NEXT: entry:
5388 // CHECK9-NEXT: [[DOTGLOBAL_TID__ADDR:%.*]] = alloca ptr, align 8
5389 // CHECK9-NEXT: [[DOTBOUND_TID__ADDR:%.*]] = alloca ptr, align 8
5390 // CHECK9-NEXT: [[DOTOMP_IV:%.*]] = alloca i32, align 4
5391 // CHECK9-NEXT: [[TMP:%.*]] = alloca i32, align 4
5392 // CHECK9-NEXT: [[DOTOMP_COMB_LB:%.*]] = alloca i32, align 4
5393 // CHECK9-NEXT: [[DOTOMP_COMB_UB:%.*]] = alloca i32, align 4
5394 // CHECK9-NEXT: [[DOTOMP_STRIDE:%.*]] = alloca i32, align 4
5395 // CHECK9-NEXT: [[DOTOMP_IS_LAST:%.*]] = alloca i32, align 4
5396 // CHECK9-NEXT: [[I:%.*]] = alloca i32, align 4
5397 // CHECK9-NEXT: store ptr [[DOTGLOBAL_TID_]], ptr [[DOTGLOBAL_TID__ADDR]], align 8
5398 // CHECK9-NEXT: store ptr [[DOTBOUND_TID_]], ptr [[DOTBOUND_TID__ADDR]], align 8
5399 // CHECK9-NEXT: store i32 0, ptr [[DOTOMP_COMB_LB]], align 4
5400 // CHECK9-NEXT: store i32 99, ptr [[DOTOMP_COMB_UB]], align 4
5401 // CHECK9-NEXT: store i32 1, ptr [[DOTOMP_STRIDE]], align 4
5402 // CHECK9-NEXT: store i32 0, ptr [[DOTOMP_IS_LAST]], align 4
5403 // CHECK9-NEXT: [[TMP0:%.*]] = load ptr, ptr [[DOTGLOBAL_TID__ADDR]], align 8
5404 // CHECK9-NEXT: [[TMP1:%.*]] = load i32, ptr [[TMP0]], align 4
5405 // 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)
5406 // CHECK9-NEXT: [[TMP2:%.*]] = load i32, ptr [[DOTOMP_COMB_UB]], align 4
5407 // CHECK9-NEXT: [[CMP:%.*]] = icmp sgt i32 [[TMP2]], 99
5408 // CHECK9-NEXT: br i1 [[CMP]], label [[COND_TRUE:%.*]], label [[COND_FALSE:%.*]]
5409 // CHECK9: cond.true:
5410 // CHECK9-NEXT: br label [[COND_END:%.*]]
5411 // CHECK9: cond.false:
5412 // CHECK9-NEXT: [[TMP3:%.*]] = load i32, ptr [[DOTOMP_COMB_UB]], align 4
5413 // CHECK9-NEXT: br label [[COND_END]]
5414 // CHECK9: cond.end:
5415 // CHECK9-NEXT: [[COND:%.*]] = phi i32 [ 99, [[COND_TRUE]] ], [ [[TMP3]], [[COND_FALSE]] ]
5416 // CHECK9-NEXT: store i32 [[COND]], ptr [[DOTOMP_COMB_UB]], align 4
5417 // CHECK9-NEXT: [[TMP4:%.*]] = load i32, ptr [[DOTOMP_COMB_LB]], align 4
5418 // CHECK9-NEXT: store i32 [[TMP4]], ptr [[DOTOMP_IV]], align 4
5419 // CHECK9-NEXT: br label [[OMP_INNER_FOR_COND:%.*]]
5420 // CHECK9: omp.inner.for.cond:
5421 // CHECK9-NEXT: [[TMP5:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP44:![0-9]+]]
5422 // CHECK9-NEXT: [[TMP6:%.*]] = load i32, ptr [[DOTOMP_COMB_UB]], align 4, !llvm.access.group [[ACC_GRP44]]
5423 // CHECK9-NEXT: [[CMP1:%.*]] = icmp sle i32 [[TMP5]], [[TMP6]]
5424 // CHECK9-NEXT: br i1 [[CMP1]], label [[OMP_INNER_FOR_BODY:%.*]], label [[OMP_INNER_FOR_END:%.*]]
5425 // CHECK9: omp.inner.for.body:
5426 // CHECK9-NEXT: [[TMP7:%.*]] = load i32, ptr [[DOTOMP_COMB_LB]], align 4, !llvm.access.group [[ACC_GRP44]]
5427 // CHECK9-NEXT: [[TMP8:%.*]] = zext i32 [[TMP7]] to i64
5428 // CHECK9-NEXT: [[TMP9:%.*]] = load i32, ptr [[DOTOMP_COMB_UB]], align 4, !llvm.access.group [[ACC_GRP44]]
5429 // CHECK9-NEXT: [[TMP10:%.*]] = zext i32 [[TMP9]] to i64
5430 // CHECK9-NEXT: call void (ptr, i32, ptr, ...) @__kmpc_fork_call(ptr @[[GLOB3]], i32 2, ptr @{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z5tmainIiEiT__l57.omp_outlined.omp_outlined, i64 [[TMP8]], i64 [[TMP10]]), !llvm.access.group [[ACC_GRP44]]
5431 // CHECK9-NEXT: br label [[OMP_INNER_FOR_INC:%.*]]
5432 // CHECK9: omp.inner.for.inc:
5433 // CHECK9-NEXT: [[TMP11:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP44]]
5434 // CHECK9-NEXT: [[TMP12:%.*]] = load i32, ptr [[DOTOMP_STRIDE]], align 4, !llvm.access.group [[ACC_GRP44]]
5435 // CHECK9-NEXT: [[ADD:%.*]] = add nsw i32 [[TMP11]], [[TMP12]]
5436 // CHECK9-NEXT: store i32 [[ADD]], ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP44]]
5437 // CHECK9-NEXT: br label [[OMP_INNER_FOR_COND]], !llvm.loop [[LOOP45:![0-9]+]]
5438 // CHECK9: omp.inner.for.end:
5439 // CHECK9-NEXT: br label [[OMP_LOOP_EXIT:%.*]]
5440 // CHECK9: omp.loop.exit:
5441 // CHECK9-NEXT: call void @__kmpc_for_static_fini(ptr @[[GLOB1]], i32 [[TMP1]])
5442 // CHECK9-NEXT: [[TMP13:%.*]] = load i32, ptr [[DOTOMP_IS_LAST]], align 4
5443 // CHECK9-NEXT: [[TMP14:%.*]] = icmp ne i32 [[TMP13]], 0
5444 // CHECK9-NEXT: br i1 [[TMP14]], label [[DOTOMP_FINAL_THEN:%.*]], label [[DOTOMP_FINAL_DONE:%.*]]
5445 // CHECK9: .omp.final.then:
5446 // CHECK9-NEXT: store i32 100, ptr [[I]], align 4
5447 // CHECK9-NEXT: br label [[DOTOMP_FINAL_DONE]]
5448 // CHECK9: .omp.final.done:
5449 // CHECK9-NEXT: ret void
5452 // CHECK9-LABEL: define {{[^@]+}}@{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z5tmainIiEiT__l57.omp_outlined.omp_outlined
5453 // CHECK9-SAME: (ptr noalias noundef [[DOTGLOBAL_TID_:%.*]], ptr noalias noundef [[DOTBOUND_TID_:%.*]], i64 noundef [[DOTPREVIOUS_LB_:%.*]], i64 noundef [[DOTPREVIOUS_UB_:%.*]]) #[[ATTR2]] {
5454 // CHECK9-NEXT: entry:
5455 // CHECK9-NEXT: [[DOTGLOBAL_TID__ADDR:%.*]] = alloca ptr, align 8
5456 // CHECK9-NEXT: [[DOTBOUND_TID__ADDR:%.*]] = alloca ptr, align 8
5457 // CHECK9-NEXT: [[DOTPREVIOUS_LB__ADDR:%.*]] = alloca i64, align 8
5458 // CHECK9-NEXT: [[DOTPREVIOUS_UB__ADDR:%.*]] = alloca i64, align 8
5459 // CHECK9-NEXT: [[DOTOMP_IV:%.*]] = alloca i32, align 4
5460 // CHECK9-NEXT: [[TMP:%.*]] = alloca i32, align 4
5461 // CHECK9-NEXT: [[DOTOMP_LB:%.*]] = alloca i32, align 4
5462 // CHECK9-NEXT: [[DOTOMP_UB:%.*]] = alloca i32, align 4
5463 // CHECK9-NEXT: [[DOTOMP_STRIDE:%.*]] = alloca i32, align 4
5464 // CHECK9-NEXT: [[DOTOMP_IS_LAST:%.*]] = alloca i32, align 4
5465 // CHECK9-NEXT: [[I:%.*]] = alloca i32, align 4
5466 // CHECK9-NEXT: store ptr [[DOTGLOBAL_TID_]], ptr [[DOTGLOBAL_TID__ADDR]], align 8
5467 // CHECK9-NEXT: store ptr [[DOTBOUND_TID_]], ptr [[DOTBOUND_TID__ADDR]], align 8
5468 // CHECK9-NEXT: store i64 [[DOTPREVIOUS_LB_]], ptr [[DOTPREVIOUS_LB__ADDR]], align 8
5469 // CHECK9-NEXT: store i64 [[DOTPREVIOUS_UB_]], ptr [[DOTPREVIOUS_UB__ADDR]], align 8
5470 // CHECK9-NEXT: store i32 0, ptr [[DOTOMP_LB]], align 4
5471 // CHECK9-NEXT: store i32 99, ptr [[DOTOMP_UB]], align 4
5472 // CHECK9-NEXT: [[TMP0:%.*]] = load i64, ptr [[DOTPREVIOUS_LB__ADDR]], align 8
5473 // CHECK9-NEXT: [[CONV:%.*]] = trunc i64 [[TMP0]] to i32
5474 // CHECK9-NEXT: [[TMP1:%.*]] = load i64, ptr [[DOTPREVIOUS_UB__ADDR]], align 8
5475 // CHECK9-NEXT: [[CONV1:%.*]] = trunc i64 [[TMP1]] to i32
5476 // CHECK9-NEXT: store i32 [[CONV]], ptr [[DOTOMP_LB]], align 4
5477 // CHECK9-NEXT: store i32 [[CONV1]], ptr [[DOTOMP_UB]], align 4
5478 // CHECK9-NEXT: store i32 1, ptr [[DOTOMP_STRIDE]], align 4
5479 // CHECK9-NEXT: store i32 0, ptr [[DOTOMP_IS_LAST]], align 4
5480 // CHECK9-NEXT: [[TMP2:%.*]] = load ptr, ptr [[DOTGLOBAL_TID__ADDR]], align 8
5481 // CHECK9-NEXT: [[TMP3:%.*]] = load i32, ptr [[TMP2]], align 4
5482 // 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)
5483 // CHECK9-NEXT: [[TMP4:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4
5484 // CHECK9-NEXT: [[CMP:%.*]] = icmp sgt i32 [[TMP4]], 99
5485 // CHECK9-NEXT: br i1 [[CMP]], label [[COND_TRUE:%.*]], label [[COND_FALSE:%.*]]
5486 // CHECK9: cond.true:
5487 // CHECK9-NEXT: br label [[COND_END:%.*]]
5488 // CHECK9: cond.false:
5489 // CHECK9-NEXT: [[TMP5:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4
5490 // CHECK9-NEXT: br label [[COND_END]]
5491 // CHECK9: cond.end:
5492 // CHECK9-NEXT: [[COND:%.*]] = phi i32 [ 99, [[COND_TRUE]] ], [ [[TMP5]], [[COND_FALSE]] ]
5493 // CHECK9-NEXT: store i32 [[COND]], ptr [[DOTOMP_UB]], align 4
5494 // CHECK9-NEXT: [[TMP6:%.*]] = load i32, ptr [[DOTOMP_LB]], align 4
5495 // CHECK9-NEXT: store i32 [[TMP6]], ptr [[DOTOMP_IV]], align 4
5496 // CHECK9-NEXT: br label [[OMP_INNER_FOR_COND:%.*]]
5497 // CHECK9: omp.inner.for.cond:
5498 // CHECK9-NEXT: [[TMP7:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP47:![0-9]+]]
5499 // CHECK9-NEXT: [[TMP8:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4, !llvm.access.group [[ACC_GRP47]]
5500 // CHECK9-NEXT: [[CMP2:%.*]] = icmp sle i32 [[TMP7]], [[TMP8]]
5501 // CHECK9-NEXT: br i1 [[CMP2]], label [[OMP_INNER_FOR_BODY:%.*]], label [[OMP_INNER_FOR_END:%.*]]
5502 // CHECK9: omp.inner.for.body:
5503 // CHECK9-NEXT: [[TMP9:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP47]]
5504 // CHECK9-NEXT: [[MUL:%.*]] = mul nsw i32 [[TMP9]], 1
5505 // CHECK9-NEXT: [[ADD:%.*]] = add nsw i32 0, [[MUL]]
5506 // CHECK9-NEXT: store i32 [[ADD]], ptr [[I]], align 4, !llvm.access.group [[ACC_GRP47]]
5507 // CHECK9-NEXT: call void @_Z3fn1v(), !llvm.access.group [[ACC_GRP47]]
5508 // CHECK9-NEXT: br label [[OMP_BODY_CONTINUE:%.*]]
5509 // CHECK9: omp.body.continue:
5510 // CHECK9-NEXT: br label [[OMP_INNER_FOR_INC:%.*]]
5511 // CHECK9: omp.inner.for.inc:
5512 // CHECK9-NEXT: [[TMP10:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP47]]
5513 // CHECK9-NEXT: [[ADD3:%.*]] = add nsw i32 [[TMP10]], 1
5514 // CHECK9-NEXT: store i32 [[ADD3]], ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP47]]
5515 // CHECK9-NEXT: br label [[OMP_INNER_FOR_COND]], !llvm.loop [[LOOP48:![0-9]+]]
5516 // CHECK9: omp.inner.for.end:
5517 // CHECK9-NEXT: br label [[OMP_LOOP_EXIT:%.*]]
5518 // CHECK9: omp.loop.exit:
5519 // CHECK9-NEXT: call void @__kmpc_for_static_fini(ptr @[[GLOB1]], i32 [[TMP3]])
5520 // CHECK9-NEXT: [[TMP11:%.*]] = load i32, ptr [[DOTOMP_IS_LAST]], align 4
5521 // CHECK9-NEXT: [[TMP12:%.*]] = icmp ne i32 [[TMP11]], 0
5522 // CHECK9-NEXT: br i1 [[TMP12]], label [[DOTOMP_FINAL_THEN:%.*]], label [[DOTOMP_FINAL_DONE:%.*]]
5523 // CHECK9: .omp.final.then:
5524 // CHECK9-NEXT: store i32 100, ptr [[I]], align 4
5525 // CHECK9-NEXT: br label [[DOTOMP_FINAL_DONE]]
5526 // CHECK9: .omp.final.done:
5527 // CHECK9-NEXT: ret void
5530 // CHECK9-LABEL: define {{[^@]+}}@{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z5tmainIiEiT__l62
5531 // CHECK9-SAME: () #[[ATTR1]] {
5532 // CHECK9-NEXT: entry:
5533 // CHECK9-NEXT: call void (ptr, i32, ptr, ...) @__kmpc_fork_teams(ptr @[[GLOB3]], i32 0, ptr @{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z5tmainIiEiT__l62.omp_outlined)
5534 // CHECK9-NEXT: ret void
5537 // CHECK9-LABEL: define {{[^@]+}}@{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z5tmainIiEiT__l62.omp_outlined
5538 // CHECK9-SAME: (ptr noalias noundef [[DOTGLOBAL_TID_:%.*]], ptr noalias noundef [[DOTBOUND_TID_:%.*]]) #[[ATTR2]] {
5539 // CHECK9-NEXT: entry:
5540 // CHECK9-NEXT: [[DOTGLOBAL_TID__ADDR:%.*]] = alloca ptr, align 8
5541 // CHECK9-NEXT: [[DOTBOUND_TID__ADDR:%.*]] = alloca ptr, align 8
5542 // CHECK9-NEXT: [[DOTOMP_IV:%.*]] = alloca i32, align 4
5543 // CHECK9-NEXT: [[TMP:%.*]] = alloca i32, align 4
5544 // CHECK9-NEXT: [[DOTOMP_COMB_LB:%.*]] = alloca i32, align 4
5545 // CHECK9-NEXT: [[DOTOMP_COMB_UB:%.*]] = alloca i32, align 4
5546 // CHECK9-NEXT: [[DOTOMP_STRIDE:%.*]] = alloca i32, align 4
5547 // CHECK9-NEXT: [[DOTOMP_IS_LAST:%.*]] = alloca i32, align 4
5548 // CHECK9-NEXT: [[I:%.*]] = alloca i32, align 4
5549 // CHECK9-NEXT: [[DOTBOUND_ZERO_ADDR:%.*]] = alloca i32, align 4
5550 // CHECK9-NEXT: store ptr [[DOTGLOBAL_TID_]], ptr [[DOTGLOBAL_TID__ADDR]], align 8
5551 // CHECK9-NEXT: store ptr [[DOTBOUND_TID_]], ptr [[DOTBOUND_TID__ADDR]], align 8
5552 // CHECK9-NEXT: store i32 0, ptr [[DOTOMP_COMB_LB]], align 4
5553 // CHECK9-NEXT: store i32 99, ptr [[DOTOMP_COMB_UB]], align 4
5554 // CHECK9-NEXT: store i32 1, ptr [[DOTOMP_STRIDE]], align 4
5555 // CHECK9-NEXT: store i32 0, ptr [[DOTOMP_IS_LAST]], align 4
5556 // CHECK9-NEXT: [[TMP0:%.*]] = load ptr, ptr [[DOTGLOBAL_TID__ADDR]], align 8
5557 // CHECK9-NEXT: [[TMP1:%.*]] = load i32, ptr [[TMP0]], align 4
5558 // 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)
5559 // CHECK9-NEXT: [[TMP2:%.*]] = load i32, ptr [[DOTOMP_COMB_UB]], align 4
5560 // CHECK9-NEXT: [[CMP:%.*]] = icmp sgt i32 [[TMP2]], 99
5561 // CHECK9-NEXT: br i1 [[CMP]], label [[COND_TRUE:%.*]], label [[COND_FALSE:%.*]]
5562 // CHECK9: cond.true:
5563 // CHECK9-NEXT: br label [[COND_END:%.*]]
5564 // CHECK9: cond.false:
5565 // CHECK9-NEXT: [[TMP3:%.*]] = load i32, ptr [[DOTOMP_COMB_UB]], align 4
5566 // CHECK9-NEXT: br label [[COND_END]]
5567 // CHECK9: cond.end:
5568 // CHECK9-NEXT: [[COND:%.*]] = phi i32 [ 99, [[COND_TRUE]] ], [ [[TMP3]], [[COND_FALSE]] ]
5569 // CHECK9-NEXT: store i32 [[COND]], ptr [[DOTOMP_COMB_UB]], align 4
5570 // CHECK9-NEXT: [[TMP4:%.*]] = load i32, ptr [[DOTOMP_COMB_LB]], align 4
5571 // CHECK9-NEXT: store i32 [[TMP4]], ptr [[DOTOMP_IV]], align 4
5572 // CHECK9-NEXT: br label [[OMP_INNER_FOR_COND:%.*]]
5573 // CHECK9: omp.inner.for.cond:
5574 // CHECK9-NEXT: [[TMP5:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP50:![0-9]+]]
5575 // CHECK9-NEXT: [[TMP6:%.*]] = load i32, ptr [[DOTOMP_COMB_UB]], align 4, !llvm.access.group [[ACC_GRP50]]
5576 // CHECK9-NEXT: [[CMP1:%.*]] = icmp sle i32 [[TMP5]], [[TMP6]]
5577 // CHECK9-NEXT: br i1 [[CMP1]], label [[OMP_INNER_FOR_BODY:%.*]], label [[OMP_INNER_FOR_END:%.*]]
5578 // CHECK9: omp.inner.for.body:
5579 // CHECK9-NEXT: [[TMP7:%.*]] = load i32, ptr [[DOTOMP_COMB_LB]], align 4, !llvm.access.group [[ACC_GRP50]]
5580 // CHECK9-NEXT: [[TMP8:%.*]] = zext i32 [[TMP7]] to i64
5581 // CHECK9-NEXT: [[TMP9:%.*]] = load i32, ptr [[DOTOMP_COMB_UB]], align 4, !llvm.access.group [[ACC_GRP50]]
5582 // CHECK9-NEXT: [[TMP10:%.*]] = zext i32 [[TMP9]] to i64
5583 // CHECK9-NEXT: call void @__kmpc_serialized_parallel(ptr @[[GLOB3]], i32 [[TMP1]]), !llvm.access.group [[ACC_GRP50]]
5584 // CHECK9-NEXT: [[TMP11:%.*]] = load ptr, ptr [[DOTGLOBAL_TID__ADDR]], align 8, !llvm.access.group [[ACC_GRP50]]
5585 // CHECK9-NEXT: store i32 0, ptr [[DOTBOUND_ZERO_ADDR]], align 4, !llvm.access.group [[ACC_GRP50]]
5586 // CHECK9-NEXT: call void @{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z5tmainIiEiT__l62.omp_outlined.omp_outlined(ptr [[TMP11]], ptr [[DOTBOUND_ZERO_ADDR]], i64 [[TMP8]], i64 [[TMP10]]) #[[ATTR3]], !llvm.access.group [[ACC_GRP50]]
5587 // CHECK9-NEXT: call void @__kmpc_end_serialized_parallel(ptr @[[GLOB3]], i32 [[TMP1]]), !llvm.access.group [[ACC_GRP50]]
5588 // CHECK9-NEXT: br label [[OMP_INNER_FOR_INC:%.*]]
5589 // CHECK9: omp.inner.for.inc:
5590 // CHECK9-NEXT: [[TMP12:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP50]]
5591 // CHECK9-NEXT: [[TMP13:%.*]] = load i32, ptr [[DOTOMP_STRIDE]], align 4, !llvm.access.group [[ACC_GRP50]]
5592 // CHECK9-NEXT: [[ADD:%.*]] = add nsw i32 [[TMP12]], [[TMP13]]
5593 // CHECK9-NEXT: store i32 [[ADD]], ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP50]]
5594 // CHECK9-NEXT: br label [[OMP_INNER_FOR_COND]], !llvm.loop [[LOOP51:![0-9]+]]
5595 // CHECK9: omp.inner.for.end:
5596 // CHECK9-NEXT: br label [[OMP_LOOP_EXIT:%.*]]
5597 // CHECK9: omp.loop.exit:
5598 // CHECK9-NEXT: call void @__kmpc_for_static_fini(ptr @[[GLOB1]], i32 [[TMP1]])
5599 // CHECK9-NEXT: [[TMP14:%.*]] = load i32, ptr [[DOTOMP_IS_LAST]], align 4
5600 // CHECK9-NEXT: [[TMP15:%.*]] = icmp ne i32 [[TMP14]], 0
5601 // CHECK9-NEXT: br i1 [[TMP15]], label [[DOTOMP_FINAL_THEN:%.*]], label [[DOTOMP_FINAL_DONE:%.*]]
5602 // CHECK9: .omp.final.then:
5603 // CHECK9-NEXT: store i32 100, ptr [[I]], align 4
5604 // CHECK9-NEXT: br label [[DOTOMP_FINAL_DONE]]
5605 // CHECK9: .omp.final.done:
5606 // CHECK9-NEXT: ret void
5609 // CHECK9-LABEL: define {{[^@]+}}@{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z5tmainIiEiT__l62.omp_outlined.omp_outlined
5610 // CHECK9-SAME: (ptr noalias noundef [[DOTGLOBAL_TID_:%.*]], ptr noalias noundef [[DOTBOUND_TID_:%.*]], i64 noundef [[DOTPREVIOUS_LB_:%.*]], i64 noundef [[DOTPREVIOUS_UB_:%.*]]) #[[ATTR2]] {
5611 // CHECK9-NEXT: entry:
5612 // CHECK9-NEXT: [[DOTGLOBAL_TID__ADDR:%.*]] = alloca ptr, align 8
5613 // CHECK9-NEXT: [[DOTBOUND_TID__ADDR:%.*]] = alloca ptr, align 8
5614 // CHECK9-NEXT: [[DOTPREVIOUS_LB__ADDR:%.*]] = alloca i64, align 8
5615 // CHECK9-NEXT: [[DOTPREVIOUS_UB__ADDR:%.*]] = alloca i64, align 8
5616 // CHECK9-NEXT: [[DOTOMP_IV:%.*]] = alloca i32, align 4
5617 // CHECK9-NEXT: [[TMP:%.*]] = alloca i32, align 4
5618 // CHECK9-NEXT: [[DOTOMP_LB:%.*]] = alloca i32, align 4
5619 // CHECK9-NEXT: [[DOTOMP_UB:%.*]] = alloca i32, align 4
5620 // CHECK9-NEXT: [[DOTOMP_STRIDE:%.*]] = alloca i32, align 4
5621 // CHECK9-NEXT: [[DOTOMP_IS_LAST:%.*]] = alloca i32, align 4
5622 // CHECK9-NEXT: [[I:%.*]] = alloca i32, align 4
5623 // CHECK9-NEXT: store ptr [[DOTGLOBAL_TID_]], ptr [[DOTGLOBAL_TID__ADDR]], align 8
5624 // CHECK9-NEXT: store ptr [[DOTBOUND_TID_]], ptr [[DOTBOUND_TID__ADDR]], align 8
5625 // CHECK9-NEXT: store i64 [[DOTPREVIOUS_LB_]], ptr [[DOTPREVIOUS_LB__ADDR]], align 8
5626 // CHECK9-NEXT: store i64 [[DOTPREVIOUS_UB_]], ptr [[DOTPREVIOUS_UB__ADDR]], align 8
5627 // CHECK9-NEXT: store i32 0, ptr [[DOTOMP_LB]], align 4
5628 // CHECK9-NEXT: store i32 99, ptr [[DOTOMP_UB]], align 4
5629 // CHECK9-NEXT: [[TMP0:%.*]] = load i64, ptr [[DOTPREVIOUS_LB__ADDR]], align 8
5630 // CHECK9-NEXT: [[CONV:%.*]] = trunc i64 [[TMP0]] to i32
5631 // CHECK9-NEXT: [[TMP1:%.*]] = load i64, ptr [[DOTPREVIOUS_UB__ADDR]], align 8
5632 // CHECK9-NEXT: [[CONV1:%.*]] = trunc i64 [[TMP1]] to i32
5633 // CHECK9-NEXT: store i32 [[CONV]], ptr [[DOTOMP_LB]], align 4
5634 // CHECK9-NEXT: store i32 [[CONV1]], ptr [[DOTOMP_UB]], align 4
5635 // CHECK9-NEXT: store i32 1, ptr [[DOTOMP_STRIDE]], align 4
5636 // CHECK9-NEXT: store i32 0, ptr [[DOTOMP_IS_LAST]], align 4
5637 // CHECK9-NEXT: [[TMP2:%.*]] = load ptr, ptr [[DOTGLOBAL_TID__ADDR]], align 8
5638 // CHECK9-NEXT: [[TMP3:%.*]] = load i32, ptr [[TMP2]], align 4
5639 // 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)
5640 // CHECK9-NEXT: [[TMP4:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4
5641 // CHECK9-NEXT: [[CMP:%.*]] = icmp sgt i32 [[TMP4]], 99
5642 // CHECK9-NEXT: br i1 [[CMP]], label [[COND_TRUE:%.*]], label [[COND_FALSE:%.*]]
5643 // CHECK9: cond.true:
5644 // CHECK9-NEXT: br label [[COND_END:%.*]]
5645 // CHECK9: cond.false:
5646 // CHECK9-NEXT: [[TMP5:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4
5647 // CHECK9-NEXT: br label [[COND_END]]
5648 // CHECK9: cond.end:
5649 // CHECK9-NEXT: [[COND:%.*]] = phi i32 [ 99, [[COND_TRUE]] ], [ [[TMP5]], [[COND_FALSE]] ]
5650 // CHECK9-NEXT: store i32 [[COND]], ptr [[DOTOMP_UB]], align 4
5651 // CHECK9-NEXT: [[TMP6:%.*]] = load i32, ptr [[DOTOMP_LB]], align 4
5652 // CHECK9-NEXT: store i32 [[TMP6]], ptr [[DOTOMP_IV]], align 4
5653 // CHECK9-NEXT: br label [[OMP_INNER_FOR_COND:%.*]]
5654 // CHECK9: omp.inner.for.cond:
5655 // CHECK9-NEXT: [[TMP7:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP53:![0-9]+]]
5656 // CHECK9-NEXT: [[TMP8:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4, !llvm.access.group [[ACC_GRP53]]
5657 // CHECK9-NEXT: [[CMP2:%.*]] = icmp sle i32 [[TMP7]], [[TMP8]]
5658 // CHECK9-NEXT: br i1 [[CMP2]], label [[OMP_INNER_FOR_BODY:%.*]], label [[OMP_INNER_FOR_END:%.*]]
5659 // CHECK9: omp.inner.for.body:
5660 // CHECK9-NEXT: [[TMP9:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP53]]
5661 // CHECK9-NEXT: [[MUL:%.*]] = mul nsw i32 [[TMP9]], 1
5662 // CHECK9-NEXT: [[ADD:%.*]] = add nsw i32 0, [[MUL]]
5663 // CHECK9-NEXT: store i32 [[ADD]], ptr [[I]], align 4, !llvm.access.group [[ACC_GRP53]]
5664 // CHECK9-NEXT: call void @_Z3fn2v(), !llvm.access.group [[ACC_GRP53]]
5665 // CHECK9-NEXT: br label [[OMP_BODY_CONTINUE:%.*]]
5666 // CHECK9: omp.body.continue:
5667 // CHECK9-NEXT: br label [[OMP_INNER_FOR_INC:%.*]]
5668 // CHECK9: omp.inner.for.inc:
5669 // CHECK9-NEXT: [[TMP10:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP53]]
5670 // CHECK9-NEXT: [[ADD3:%.*]] = add nsw i32 [[TMP10]], 1
5671 // CHECK9-NEXT: store i32 [[ADD3]], ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP53]]
5672 // CHECK9-NEXT: br label [[OMP_INNER_FOR_COND]], !llvm.loop [[LOOP54:![0-9]+]]
5673 // CHECK9: omp.inner.for.end:
5674 // CHECK9-NEXT: br label [[OMP_LOOP_EXIT:%.*]]
5675 // CHECK9: omp.loop.exit:
5676 // CHECK9-NEXT: call void @__kmpc_for_static_fini(ptr @[[GLOB1]], i32 [[TMP3]])
5677 // CHECK9-NEXT: [[TMP11:%.*]] = load i32, ptr [[DOTOMP_IS_LAST]], align 4
5678 // CHECK9-NEXT: [[TMP12:%.*]] = icmp ne i32 [[TMP11]], 0
5679 // CHECK9-NEXT: br i1 [[TMP12]], label [[DOTOMP_FINAL_THEN:%.*]], label [[DOTOMP_FINAL_DONE:%.*]]
5680 // CHECK9: .omp.final.then:
5681 // CHECK9-NEXT: store i32 100, ptr [[I]], align 4
5682 // CHECK9-NEXT: br label [[DOTOMP_FINAL_DONE]]
5683 // CHECK9: .omp.final.done:
5684 // CHECK9-NEXT: ret void
5687 // CHECK9-LABEL: define {{[^@]+}}@{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z5tmainIiEiT__l67
5688 // CHECK9-SAME: (i64 noundef [[ARG:%.*]]) #[[ATTR1]] {
5689 // CHECK9-NEXT: entry:
5690 // CHECK9-NEXT: [[ARG_ADDR:%.*]] = alloca i64, align 8
5691 // CHECK9-NEXT: [[DOTCAPTURE_EXPR_:%.*]] = alloca i8, align 1
5692 // CHECK9-NEXT: [[DOTCAPTURE_EXPR__CASTED:%.*]] = alloca i64, align 8
5693 // CHECK9-NEXT: store i64 [[ARG]], ptr [[ARG_ADDR]], align 8
5694 // CHECK9-NEXT: [[TMP0:%.*]] = load i32, ptr [[ARG_ADDR]], align 4
5695 // CHECK9-NEXT: [[TOBOOL:%.*]] = icmp ne i32 [[TMP0]], 0
5696 // CHECK9-NEXT: [[FROMBOOL:%.*]] = zext i1 [[TOBOOL]] to i8
5697 // CHECK9-NEXT: store i8 [[FROMBOOL]], ptr [[DOTCAPTURE_EXPR_]], align 1
5698 // CHECK9-NEXT: [[TMP1:%.*]] = load i8, ptr [[DOTCAPTURE_EXPR_]], align 1
5699 // CHECK9-NEXT: [[TOBOOL1:%.*]] = trunc i8 [[TMP1]] to i1
5700 // CHECK9-NEXT: [[FROMBOOL2:%.*]] = zext i1 [[TOBOOL1]] to i8
5701 // CHECK9-NEXT: store i8 [[FROMBOOL2]], ptr [[DOTCAPTURE_EXPR__CASTED]], align 1
5702 // CHECK9-NEXT: [[TMP2:%.*]] = load i64, ptr [[DOTCAPTURE_EXPR__CASTED]], align 8
5703 // CHECK9-NEXT: call void (ptr, i32, ptr, ...) @__kmpc_fork_teams(ptr @[[GLOB3]], i32 1, ptr @{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z5tmainIiEiT__l67.omp_outlined, i64 [[TMP2]])
5704 // CHECK9-NEXT: ret void
5707 // CHECK9-LABEL: define {{[^@]+}}@{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z5tmainIiEiT__l67.omp_outlined
5708 // CHECK9-SAME: (ptr noalias noundef [[DOTGLOBAL_TID_:%.*]], ptr noalias noundef [[DOTBOUND_TID_:%.*]], i64 noundef [[DOTCAPTURE_EXPR_:%.*]]) #[[ATTR2]] {
5709 // CHECK9-NEXT: entry:
5710 // CHECK9-NEXT: [[DOTGLOBAL_TID__ADDR:%.*]] = alloca ptr, align 8
5711 // CHECK9-NEXT: [[DOTBOUND_TID__ADDR:%.*]] = alloca ptr, align 8
5712 // CHECK9-NEXT: [[DOTCAPTURE_EXPR__ADDR:%.*]] = alloca i64, align 8
5713 // CHECK9-NEXT: [[DOTOMP_IV:%.*]] = alloca i32, align 4
5714 // CHECK9-NEXT: [[TMP:%.*]] = alloca i32, align 4
5715 // CHECK9-NEXT: [[DOTOMP_COMB_LB:%.*]] = alloca i32, align 4
5716 // CHECK9-NEXT: [[DOTOMP_COMB_UB:%.*]] = alloca i32, align 4
5717 // CHECK9-NEXT: [[DOTOMP_STRIDE:%.*]] = alloca i32, align 4
5718 // CHECK9-NEXT: [[DOTOMP_IS_LAST:%.*]] = alloca i32, align 4
5719 // CHECK9-NEXT: [[I:%.*]] = alloca i32, align 4
5720 // CHECK9-NEXT: [[DOTBOUND_ZERO_ADDR:%.*]] = alloca i32, align 4
5721 // CHECK9-NEXT: store ptr [[DOTGLOBAL_TID_]], ptr [[DOTGLOBAL_TID__ADDR]], align 8
5722 // CHECK9-NEXT: store ptr [[DOTBOUND_TID_]], ptr [[DOTBOUND_TID__ADDR]], align 8
5723 // CHECK9-NEXT: store i64 [[DOTCAPTURE_EXPR_]], ptr [[DOTCAPTURE_EXPR__ADDR]], align 8
5724 // CHECK9-NEXT: store i32 0, ptr [[DOTOMP_COMB_LB]], align 4
5725 // CHECK9-NEXT: store i32 99, ptr [[DOTOMP_COMB_UB]], align 4
5726 // CHECK9-NEXT: store i32 1, ptr [[DOTOMP_STRIDE]], align 4
5727 // CHECK9-NEXT: store i32 0, ptr [[DOTOMP_IS_LAST]], align 4
5728 // CHECK9-NEXT: [[TMP0:%.*]] = load ptr, ptr [[DOTGLOBAL_TID__ADDR]], align 8
5729 // CHECK9-NEXT: [[TMP1:%.*]] = load i32, ptr [[TMP0]], align 4
5730 // 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)
5731 // CHECK9-NEXT: [[TMP2:%.*]] = load i32, ptr [[DOTOMP_COMB_UB]], align 4
5732 // CHECK9-NEXT: [[CMP:%.*]] = icmp sgt i32 [[TMP2]], 99
5733 // CHECK9-NEXT: br i1 [[CMP]], label [[COND_TRUE:%.*]], label [[COND_FALSE:%.*]]
5734 // CHECK9: cond.true:
5735 // CHECK9-NEXT: br label [[COND_END:%.*]]
5736 // CHECK9: cond.false:
5737 // CHECK9-NEXT: [[TMP3:%.*]] = load i32, ptr [[DOTOMP_COMB_UB]], align 4
5738 // CHECK9-NEXT: br label [[COND_END]]
5739 // CHECK9: cond.end:
5740 // CHECK9-NEXT: [[COND:%.*]] = phi i32 [ 99, [[COND_TRUE]] ], [ [[TMP3]], [[COND_FALSE]] ]
5741 // CHECK9-NEXT: store i32 [[COND]], ptr [[DOTOMP_COMB_UB]], align 4
5742 // CHECK9-NEXT: [[TMP4:%.*]] = load i32, ptr [[DOTOMP_COMB_LB]], align 4
5743 // CHECK9-NEXT: store i32 [[TMP4]], ptr [[DOTOMP_IV]], align 4
5744 // CHECK9-NEXT: br label [[OMP_INNER_FOR_COND:%.*]]
5745 // CHECK9: omp.inner.for.cond:
5746 // CHECK9-NEXT: [[TMP5:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP56:![0-9]+]]
5747 // CHECK9-NEXT: [[TMP6:%.*]] = load i32, ptr [[DOTOMP_COMB_UB]], align 4, !llvm.access.group [[ACC_GRP56]]
5748 // CHECK9-NEXT: [[CMP1:%.*]] = icmp sle i32 [[TMP5]], [[TMP6]]
5749 // CHECK9-NEXT: br i1 [[CMP1]], label [[OMP_INNER_FOR_BODY:%.*]], label [[OMP_INNER_FOR_END:%.*]]
5750 // CHECK9: omp.inner.for.body:
5751 // CHECK9-NEXT: [[TMP7:%.*]] = load i32, ptr [[DOTOMP_COMB_LB]], align 4, !llvm.access.group [[ACC_GRP56]]
5752 // CHECK9-NEXT: [[TMP8:%.*]] = zext i32 [[TMP7]] to i64
5753 // CHECK9-NEXT: [[TMP9:%.*]] = load i32, ptr [[DOTOMP_COMB_UB]], align 4, !llvm.access.group [[ACC_GRP56]]
5754 // CHECK9-NEXT: [[TMP10:%.*]] = zext i32 [[TMP9]] to i64
5755 // CHECK9-NEXT: [[TMP11:%.*]] = load i8, ptr [[DOTCAPTURE_EXPR__ADDR]], align 1, !llvm.access.group [[ACC_GRP56]]
5756 // CHECK9-NEXT: [[TOBOOL:%.*]] = trunc i8 [[TMP11]] to i1
5757 // CHECK9-NEXT: br i1 [[TOBOOL]], label [[OMP_IF_THEN:%.*]], label [[OMP_IF_ELSE:%.*]]
5758 // CHECK9: omp_if.then:
5759 // CHECK9-NEXT: call void (ptr, i32, ptr, ...) @__kmpc_fork_call(ptr @[[GLOB3]], i32 2, ptr @{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z5tmainIiEiT__l67.omp_outlined.omp_outlined, i64 [[TMP8]], i64 [[TMP10]]), !llvm.access.group [[ACC_GRP56]]
5760 // CHECK9-NEXT: br label [[OMP_IF_END:%.*]]
5761 // CHECK9: omp_if.else:
5762 // CHECK9-NEXT: call void @__kmpc_serialized_parallel(ptr @[[GLOB3]], i32 [[TMP1]]), !llvm.access.group [[ACC_GRP56]]
5763 // CHECK9-NEXT: [[TMP12:%.*]] = load ptr, ptr [[DOTGLOBAL_TID__ADDR]], align 8, !llvm.access.group [[ACC_GRP56]]
5764 // CHECK9-NEXT: store i32 0, ptr [[DOTBOUND_ZERO_ADDR]], align 4, !llvm.access.group [[ACC_GRP56]]
5765 // CHECK9-NEXT: call void @{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z5tmainIiEiT__l67.omp_outlined.omp_outlined(ptr [[TMP12]], ptr [[DOTBOUND_ZERO_ADDR]], i64 [[TMP8]], i64 [[TMP10]]) #[[ATTR3]], !llvm.access.group [[ACC_GRP56]]
5766 // CHECK9-NEXT: call void @__kmpc_end_serialized_parallel(ptr @[[GLOB3]], i32 [[TMP1]]), !llvm.access.group [[ACC_GRP56]]
5767 // CHECK9-NEXT: br label [[OMP_IF_END]]
5768 // CHECK9: omp_if.end:
5769 // CHECK9-NEXT: br label [[OMP_INNER_FOR_INC:%.*]]
5770 // CHECK9: omp.inner.for.inc:
5771 // CHECK9-NEXT: [[TMP13:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP56]]
5772 // CHECK9-NEXT: [[TMP14:%.*]] = load i32, ptr [[DOTOMP_STRIDE]], align 4, !llvm.access.group [[ACC_GRP56]]
5773 // CHECK9-NEXT: [[ADD:%.*]] = add nsw i32 [[TMP13]], [[TMP14]]
5774 // CHECK9-NEXT: store i32 [[ADD]], ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP56]]
5775 // CHECK9-NEXT: br label [[OMP_INNER_FOR_COND]], !llvm.loop [[LOOP57:![0-9]+]]
5776 // CHECK9: omp.inner.for.end:
5777 // CHECK9-NEXT: br label [[OMP_LOOP_EXIT:%.*]]
5778 // CHECK9: omp.loop.exit:
5779 // CHECK9-NEXT: call void @__kmpc_for_static_fini(ptr @[[GLOB1]], i32 [[TMP1]])
5780 // CHECK9-NEXT: [[TMP15:%.*]] = load i32, ptr [[DOTOMP_IS_LAST]], align 4
5781 // CHECK9-NEXT: [[TMP16:%.*]] = icmp ne i32 [[TMP15]], 0
5782 // CHECK9-NEXT: br i1 [[TMP16]], label [[DOTOMP_FINAL_THEN:%.*]], label [[DOTOMP_FINAL_DONE:%.*]]
5783 // CHECK9: .omp.final.then:
5784 // CHECK9-NEXT: store i32 100, ptr [[I]], align 4
5785 // CHECK9-NEXT: br label [[DOTOMP_FINAL_DONE]]
5786 // CHECK9: .omp.final.done:
5787 // CHECK9-NEXT: ret void
5790 // CHECK9-LABEL: define {{[^@]+}}@{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z5tmainIiEiT__l67.omp_outlined.omp_outlined
5791 // CHECK9-SAME: (ptr noalias noundef [[DOTGLOBAL_TID_:%.*]], ptr noalias noundef [[DOTBOUND_TID_:%.*]], i64 noundef [[DOTPREVIOUS_LB_:%.*]], i64 noundef [[DOTPREVIOUS_UB_:%.*]]) #[[ATTR2]] {
5792 // CHECK9-NEXT: entry:
5793 // CHECK9-NEXT: [[DOTGLOBAL_TID__ADDR:%.*]] = alloca ptr, align 8
5794 // CHECK9-NEXT: [[DOTBOUND_TID__ADDR:%.*]] = alloca ptr, align 8
5795 // CHECK9-NEXT: [[DOTPREVIOUS_LB__ADDR:%.*]] = alloca i64, align 8
5796 // CHECK9-NEXT: [[DOTPREVIOUS_UB__ADDR:%.*]] = alloca i64, align 8
5797 // CHECK9-NEXT: [[DOTOMP_IV:%.*]] = alloca i32, align 4
5798 // CHECK9-NEXT: [[TMP:%.*]] = alloca i32, align 4
5799 // CHECK9-NEXT: [[DOTOMP_LB:%.*]] = alloca i32, align 4
5800 // CHECK9-NEXT: [[DOTOMP_UB:%.*]] = alloca i32, align 4
5801 // CHECK9-NEXT: [[DOTOMP_STRIDE:%.*]] = alloca i32, align 4
5802 // CHECK9-NEXT: [[DOTOMP_IS_LAST:%.*]] = alloca i32, align 4
5803 // CHECK9-NEXT: [[I:%.*]] = alloca i32, align 4
5804 // CHECK9-NEXT: store ptr [[DOTGLOBAL_TID_]], ptr [[DOTGLOBAL_TID__ADDR]], align 8
5805 // CHECK9-NEXT: store ptr [[DOTBOUND_TID_]], ptr [[DOTBOUND_TID__ADDR]], align 8
5806 // CHECK9-NEXT: store i64 [[DOTPREVIOUS_LB_]], ptr [[DOTPREVIOUS_LB__ADDR]], align 8
5807 // CHECK9-NEXT: store i64 [[DOTPREVIOUS_UB_]], ptr [[DOTPREVIOUS_UB__ADDR]], align 8
5808 // CHECK9-NEXT: store i32 0, ptr [[DOTOMP_LB]], align 4
5809 // CHECK9-NEXT: store i32 99, ptr [[DOTOMP_UB]], align 4
5810 // CHECK9-NEXT: [[TMP0:%.*]] = load i64, ptr [[DOTPREVIOUS_LB__ADDR]], align 8
5811 // CHECK9-NEXT: [[CONV:%.*]] = trunc i64 [[TMP0]] to i32
5812 // CHECK9-NEXT: [[TMP1:%.*]] = load i64, ptr [[DOTPREVIOUS_UB__ADDR]], align 8
5813 // CHECK9-NEXT: [[CONV1:%.*]] = trunc i64 [[TMP1]] to i32
5814 // CHECK9-NEXT: store i32 [[CONV]], ptr [[DOTOMP_LB]], align 4
5815 // CHECK9-NEXT: store i32 [[CONV1]], ptr [[DOTOMP_UB]], align 4
5816 // CHECK9-NEXT: store i32 1, ptr [[DOTOMP_STRIDE]], align 4
5817 // CHECK9-NEXT: store i32 0, ptr [[DOTOMP_IS_LAST]], align 4
5818 // CHECK9-NEXT: [[TMP2:%.*]] = load ptr, ptr [[DOTGLOBAL_TID__ADDR]], align 8
5819 // CHECK9-NEXT: [[TMP3:%.*]] = load i32, ptr [[TMP2]], align 4
5820 // 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)
5821 // CHECK9-NEXT: [[TMP4:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4
5822 // CHECK9-NEXT: [[CMP:%.*]] = icmp sgt i32 [[TMP4]], 99
5823 // CHECK9-NEXT: br i1 [[CMP]], label [[COND_TRUE:%.*]], label [[COND_FALSE:%.*]]
5824 // CHECK9: cond.true:
5825 // CHECK9-NEXT: br label [[COND_END:%.*]]
5826 // CHECK9: cond.false:
5827 // CHECK9-NEXT: [[TMP5:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4
5828 // CHECK9-NEXT: br label [[COND_END]]
5829 // CHECK9: cond.end:
5830 // CHECK9-NEXT: [[COND:%.*]] = phi i32 [ 99, [[COND_TRUE]] ], [ [[TMP5]], [[COND_FALSE]] ]
5831 // CHECK9-NEXT: store i32 [[COND]], ptr [[DOTOMP_UB]], align 4
5832 // CHECK9-NEXT: [[TMP6:%.*]] = load i32, ptr [[DOTOMP_LB]], align 4
5833 // CHECK9-NEXT: store i32 [[TMP6]], ptr [[DOTOMP_IV]], align 4
5834 // CHECK9-NEXT: br label [[OMP_INNER_FOR_COND:%.*]]
5835 // CHECK9: omp.inner.for.cond:
5836 // CHECK9-NEXT: [[TMP7:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP59:![0-9]+]]
5837 // CHECK9-NEXT: [[TMP8:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4, !llvm.access.group [[ACC_GRP59]]
5838 // CHECK9-NEXT: [[CMP2:%.*]] = icmp sle i32 [[TMP7]], [[TMP8]]
5839 // CHECK9-NEXT: br i1 [[CMP2]], label [[OMP_INNER_FOR_BODY:%.*]], label [[OMP_INNER_FOR_END:%.*]]
5840 // CHECK9: omp.inner.for.body:
5841 // CHECK9-NEXT: [[TMP9:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP59]]
5842 // CHECK9-NEXT: [[MUL:%.*]] = mul nsw i32 [[TMP9]], 1
5843 // CHECK9-NEXT: [[ADD:%.*]] = add nsw i32 0, [[MUL]]
5844 // CHECK9-NEXT: store i32 [[ADD]], ptr [[I]], align 4, !llvm.access.group [[ACC_GRP59]]
5845 // CHECK9-NEXT: call void @_Z3fn3v(), !llvm.access.group [[ACC_GRP59]]
5846 // CHECK9-NEXT: br label [[OMP_BODY_CONTINUE:%.*]]
5847 // CHECK9: omp.body.continue:
5848 // CHECK9-NEXT: br label [[OMP_INNER_FOR_INC:%.*]]
5849 // CHECK9: omp.inner.for.inc:
5850 // CHECK9-NEXT: [[TMP10:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP59]]
5851 // CHECK9-NEXT: [[ADD3:%.*]] = add nsw i32 [[TMP10]], 1
5852 // CHECK9-NEXT: store i32 [[ADD3]], ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP59]]
5853 // CHECK9-NEXT: br label [[OMP_INNER_FOR_COND]], !llvm.loop [[LOOP60:![0-9]+]]
5854 // CHECK9: omp.inner.for.end:
5855 // CHECK9-NEXT: br label [[OMP_LOOP_EXIT:%.*]]
5856 // CHECK9: omp.loop.exit:
5857 // CHECK9-NEXT: call void @__kmpc_for_static_fini(ptr @[[GLOB1]], i32 [[TMP3]])
5858 // CHECK9-NEXT: [[TMP11:%.*]] = load i32, ptr [[DOTOMP_IS_LAST]], align 4
5859 // CHECK9-NEXT: [[TMP12:%.*]] = icmp ne i32 [[TMP11]], 0
5860 // CHECK9-NEXT: br i1 [[TMP12]], label [[DOTOMP_FINAL_THEN:%.*]], label [[DOTOMP_FINAL_DONE:%.*]]
5861 // CHECK9: .omp.final.then:
5862 // CHECK9-NEXT: store i32 100, ptr [[I]], align 4
5863 // CHECK9-NEXT: br label [[DOTOMP_FINAL_DONE]]
5864 // CHECK9: .omp.final.done:
5865 // CHECK9-NEXT: ret void
5868 // CHECK9-LABEL: define {{[^@]+}}@.omp_offloading.requires_reg
5869 // CHECK9-SAME: () #[[ATTR6:[0-9]+]] {
5870 // CHECK9-NEXT: entry:
5871 // CHECK9-NEXT: call void @__tgt_register_requires(i64 1)
5872 // CHECK9-NEXT: ret void
5875 // CHECK11-LABEL: define {{[^@]+}}@_Z9gtid_testv
5876 // CHECK11-SAME: () #[[ATTR0:[0-9]+]] {
5877 // CHECK11-NEXT: entry:
5878 // CHECK11-NEXT: [[TMP:%.*]] = alloca i32, align 4
5879 // CHECK11-NEXT: [[KERNEL_ARGS:%.*]] = alloca [[STRUCT___TGT_KERNEL_ARGUMENTS:%.*]], align 8
5880 // CHECK11-NEXT: [[_TMP1:%.*]] = alloca i32, align 4
5881 // CHECK11-NEXT: [[KERNEL_ARGS2:%.*]] = alloca [[STRUCT___TGT_KERNEL_ARGUMENTS]], align 8
5882 // CHECK11-NEXT: [[TMP0:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 0
5883 // CHECK11-NEXT: store i32 2, ptr [[TMP0]], align 4
5884 // CHECK11-NEXT: [[TMP1:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 1
5885 // CHECK11-NEXT: store i32 0, ptr [[TMP1]], align 4
5886 // CHECK11-NEXT: [[TMP2:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 2
5887 // CHECK11-NEXT: store ptr null, ptr [[TMP2]], align 8
5888 // CHECK11-NEXT: [[TMP3:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 3
5889 // CHECK11-NEXT: store ptr null, ptr [[TMP3]], align 8
5890 // CHECK11-NEXT: [[TMP4:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 4
5891 // CHECK11-NEXT: store ptr null, ptr [[TMP4]], align 8
5892 // CHECK11-NEXT: [[TMP5:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 5
5893 // CHECK11-NEXT: store ptr null, ptr [[TMP5]], align 8
5894 // CHECK11-NEXT: [[TMP6:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 6
5895 // CHECK11-NEXT: store ptr null, ptr [[TMP6]], align 8
5896 // CHECK11-NEXT: [[TMP7:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 7
5897 // CHECK11-NEXT: store ptr null, ptr [[TMP7]], align 8
5898 // CHECK11-NEXT: [[TMP8:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 8
5899 // CHECK11-NEXT: store i64 100, ptr [[TMP8]], align 8
5900 // CHECK11-NEXT: [[TMP9:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 9
5901 // CHECK11-NEXT: store i64 0, ptr [[TMP9]], align 8
5902 // CHECK11-NEXT: [[TMP10:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 10
5903 // CHECK11-NEXT: store [3 x i32] zeroinitializer, ptr [[TMP10]], align 4
5904 // CHECK11-NEXT: [[TMP11:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 11
5905 // CHECK11-NEXT: store [3 x i32] zeroinitializer, ptr [[TMP11]], align 4
5906 // CHECK11-NEXT: [[TMP12:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 12
5907 // CHECK11-NEXT: store i32 0, ptr [[TMP12]], align 4
5908 // 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]])
5909 // CHECK11-NEXT: [[TMP14:%.*]] = icmp ne i32 [[TMP13]], 0
5910 // CHECK11-NEXT: br i1 [[TMP14]], label [[OMP_OFFLOAD_FAILED:%.*]], label [[OMP_OFFLOAD_CONT:%.*]]
5911 // CHECK11: omp_offload.failed:
5912 // CHECK11-NEXT: call void @{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z9gtid_testv_l43() #[[ATTR3:[0-9]+]]
5913 // CHECK11-NEXT: br label [[OMP_OFFLOAD_CONT]]
5914 // CHECK11: omp_offload.cont:
5915 // CHECK11-NEXT: [[TMP15:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS2]], i32 0, i32 0
5916 // CHECK11-NEXT: store i32 2, ptr [[TMP15]], align 4
5917 // CHECK11-NEXT: [[TMP16:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS2]], i32 0, i32 1
5918 // CHECK11-NEXT: store i32 0, ptr [[TMP16]], align 4
5919 // CHECK11-NEXT: [[TMP17:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS2]], i32 0, i32 2
5920 // CHECK11-NEXT: store ptr null, ptr [[TMP17]], align 8
5921 // CHECK11-NEXT: [[TMP18:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS2]], i32 0, i32 3
5922 // CHECK11-NEXT: store ptr null, ptr [[TMP18]], align 8
5923 // CHECK11-NEXT: [[TMP19:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS2]], i32 0, i32 4
5924 // CHECK11-NEXT: store ptr null, ptr [[TMP19]], align 8
5925 // CHECK11-NEXT: [[TMP20:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS2]], i32 0, i32 5
5926 // CHECK11-NEXT: store ptr null, ptr [[TMP20]], align 8
5927 // CHECK11-NEXT: [[TMP21:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS2]], i32 0, i32 6
5928 // CHECK11-NEXT: store ptr null, ptr [[TMP21]], align 8
5929 // CHECK11-NEXT: [[TMP22:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS2]], i32 0, i32 7
5930 // CHECK11-NEXT: store ptr null, ptr [[TMP22]], align 8
5931 // CHECK11-NEXT: [[TMP23:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS2]], i32 0, i32 8
5932 // CHECK11-NEXT: store i64 100, ptr [[TMP23]], align 8
5933 // CHECK11-NEXT: [[TMP24:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS2]], i32 0, i32 9
5934 // CHECK11-NEXT: store i64 0, ptr [[TMP24]], align 8
5935 // CHECK11-NEXT: [[TMP25:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS2]], i32 0, i32 10
5936 // CHECK11-NEXT: store [3 x i32] zeroinitializer, ptr [[TMP25]], align 4
5937 // CHECK11-NEXT: [[TMP26:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS2]], i32 0, i32 11
5938 // CHECK11-NEXT: store [3 x i32] [i32 1, i32 0, i32 0], ptr [[TMP26]], align 4
5939 // CHECK11-NEXT: [[TMP27:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS2]], i32 0, i32 12
5940 // CHECK11-NEXT: store i32 0, ptr [[TMP27]], align 4
5941 // CHECK11-NEXT: [[TMP28:%.*]] = call i32 @__tgt_target_kernel(ptr @[[GLOB3]], i64 -1, i32 0, i32 1, ptr @.{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z9gtid_testv_l47.region_id, ptr [[KERNEL_ARGS2]])
5942 // CHECK11-NEXT: [[TMP29:%.*]] = icmp ne i32 [[TMP28]], 0
5943 // CHECK11-NEXT: br i1 [[TMP29]], label [[OMP_OFFLOAD_FAILED3:%.*]], label [[OMP_OFFLOAD_CONT4:%.*]]
5944 // CHECK11: omp_offload.failed3:
5945 // CHECK11-NEXT: call void @{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z9gtid_testv_l47() #[[ATTR3]]
5946 // CHECK11-NEXT: br label [[OMP_OFFLOAD_CONT4]]
5947 // CHECK11: omp_offload.cont4:
5948 // CHECK11-NEXT: ret void
5951 // CHECK11-LABEL: define {{[^@]+}}@{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z9gtid_testv_l43
5952 // CHECK11-SAME: () #[[ATTR1:[0-9]+]] {
5953 // CHECK11-NEXT: entry:
5954 // 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)
5955 // CHECK11-NEXT: ret void
5958 // CHECK11-LABEL: define {{[^@]+}}@{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z9gtid_testv_l43.omp_outlined
5959 // CHECK11-SAME: (ptr noalias noundef [[DOTGLOBAL_TID_:%.*]], ptr noalias noundef [[DOTBOUND_TID_:%.*]]) #[[ATTR2:[0-9]+]] {
5960 // CHECK11-NEXT: entry:
5961 // CHECK11-NEXT: [[DOTGLOBAL_TID__ADDR:%.*]] = alloca ptr, align 8
5962 // CHECK11-NEXT: [[DOTBOUND_TID__ADDR:%.*]] = alloca ptr, align 8
5963 // CHECK11-NEXT: [[DOTOMP_IV:%.*]] = alloca i32, align 4
5964 // CHECK11-NEXT: [[TMP:%.*]] = alloca i32, align 4
5965 // CHECK11-NEXT: [[DOTOMP_COMB_LB:%.*]] = alloca i32, align 4
5966 // CHECK11-NEXT: [[DOTOMP_COMB_UB:%.*]] = alloca i32, align 4
5967 // CHECK11-NEXT: [[DOTOMP_STRIDE:%.*]] = alloca i32, align 4
5968 // CHECK11-NEXT: [[DOTOMP_IS_LAST:%.*]] = alloca i32, align 4
5969 // CHECK11-NEXT: [[I:%.*]] = alloca i32, align 4
5970 // CHECK11-NEXT: store ptr [[DOTGLOBAL_TID_]], ptr [[DOTGLOBAL_TID__ADDR]], align 8
5971 // CHECK11-NEXT: store ptr [[DOTBOUND_TID_]], ptr [[DOTBOUND_TID__ADDR]], align 8
5972 // CHECK11-NEXT: store i32 0, ptr [[DOTOMP_COMB_LB]], align 4
5973 // CHECK11-NEXT: store i32 99, ptr [[DOTOMP_COMB_UB]], align 4
5974 // CHECK11-NEXT: store i32 1, ptr [[DOTOMP_STRIDE]], align 4
5975 // CHECK11-NEXT: store i32 0, ptr [[DOTOMP_IS_LAST]], align 4
5976 // CHECK11-NEXT: [[TMP0:%.*]] = load ptr, ptr [[DOTGLOBAL_TID__ADDR]], align 8
5977 // CHECK11-NEXT: [[TMP1:%.*]] = load i32, ptr [[TMP0]], align 4
5978 // 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)
5979 // CHECK11-NEXT: [[TMP2:%.*]] = load i32, ptr [[DOTOMP_COMB_UB]], align 4
5980 // CHECK11-NEXT: [[CMP:%.*]] = icmp sgt i32 [[TMP2]], 99
5981 // CHECK11-NEXT: br i1 [[CMP]], label [[COND_TRUE:%.*]], label [[COND_FALSE:%.*]]
5982 // CHECK11: cond.true:
5983 // CHECK11-NEXT: br label [[COND_END:%.*]]
5984 // CHECK11: cond.false:
5985 // CHECK11-NEXT: [[TMP3:%.*]] = load i32, ptr [[DOTOMP_COMB_UB]], align 4
5986 // CHECK11-NEXT: br label [[COND_END]]
5987 // CHECK11: cond.end:
5988 // CHECK11-NEXT: [[COND:%.*]] = phi i32 [ 99, [[COND_TRUE]] ], [ [[TMP3]], [[COND_FALSE]] ]
5989 // CHECK11-NEXT: store i32 [[COND]], ptr [[DOTOMP_COMB_UB]], align 4
5990 // CHECK11-NEXT: [[TMP4:%.*]] = load i32, ptr [[DOTOMP_COMB_LB]], align 4
5991 // CHECK11-NEXT: store i32 [[TMP4]], ptr [[DOTOMP_IV]], align 4
5992 // CHECK11-NEXT: br label [[OMP_INNER_FOR_COND:%.*]]
5993 // CHECK11: omp.inner.for.cond:
5994 // CHECK11-NEXT: [[TMP5:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP11:![0-9]+]]
5995 // CHECK11-NEXT: [[TMP6:%.*]] = load i32, ptr [[DOTOMP_COMB_UB]], align 4, !llvm.access.group [[ACC_GRP11]]
5996 // CHECK11-NEXT: [[CMP1:%.*]] = icmp sle i32 [[TMP5]], [[TMP6]]
5997 // CHECK11-NEXT: br i1 [[CMP1]], label [[OMP_INNER_FOR_BODY:%.*]], label [[OMP_INNER_FOR_END:%.*]]
5998 // CHECK11: omp.inner.for.body:
5999 // CHECK11-NEXT: [[TMP7:%.*]] = load i32, ptr [[DOTOMP_COMB_LB]], align 4, !llvm.access.group [[ACC_GRP11]]
6000 // CHECK11-NEXT: [[TMP8:%.*]] = zext i32 [[TMP7]] to i64
6001 // CHECK11-NEXT: [[TMP9:%.*]] = load i32, ptr [[DOTOMP_COMB_UB]], align 4, !llvm.access.group [[ACC_GRP11]]
6002 // CHECK11-NEXT: [[TMP10:%.*]] = zext i32 [[TMP9]] to i64
6003 // 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]]
6004 // CHECK11-NEXT: br label [[OMP_INNER_FOR_INC:%.*]]
6005 // CHECK11: omp.inner.for.inc:
6006 // CHECK11-NEXT: [[TMP11:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP11]]
6007 // CHECK11-NEXT: [[TMP12:%.*]] = load i32, ptr [[DOTOMP_STRIDE]], align 4, !llvm.access.group [[ACC_GRP11]]
6008 // CHECK11-NEXT: [[ADD:%.*]] = add nsw i32 [[TMP11]], [[TMP12]]
6009 // CHECK11-NEXT: store i32 [[ADD]], ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP11]]
6010 // CHECK11-NEXT: br label [[OMP_INNER_FOR_COND]], !llvm.loop [[LOOP12:![0-9]+]]
6011 // CHECK11: omp.inner.for.end:
6012 // CHECK11-NEXT: br label [[OMP_LOOP_EXIT:%.*]]
6013 // CHECK11: omp.loop.exit:
6014 // CHECK11-NEXT: call void @__kmpc_for_static_fini(ptr @[[GLOB1]], i32 [[TMP1]])
6015 // CHECK11-NEXT: [[TMP13:%.*]] = load i32, ptr [[DOTOMP_IS_LAST]], align 4
6016 // CHECK11-NEXT: [[TMP14:%.*]] = icmp ne i32 [[TMP13]], 0
6017 // CHECK11-NEXT: br i1 [[TMP14]], label [[DOTOMP_FINAL_THEN:%.*]], label [[DOTOMP_FINAL_DONE:%.*]]
6018 // CHECK11: .omp.final.then:
6019 // CHECK11-NEXT: store i32 100, ptr [[I]], align 4
6020 // CHECK11-NEXT: br label [[DOTOMP_FINAL_DONE]]
6021 // CHECK11: .omp.final.done:
6022 // CHECK11-NEXT: ret void
6025 // CHECK11-LABEL: define {{[^@]+}}@{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z9gtid_testv_l43.omp_outlined.omp_outlined
6026 // CHECK11-SAME: (ptr noalias noundef [[DOTGLOBAL_TID_:%.*]], ptr noalias noundef [[DOTBOUND_TID_:%.*]], i64 noundef [[DOTPREVIOUS_LB_:%.*]], i64 noundef [[DOTPREVIOUS_UB_:%.*]]) #[[ATTR2]] {
6027 // CHECK11-NEXT: entry:
6028 // CHECK11-NEXT: [[DOTGLOBAL_TID__ADDR:%.*]] = alloca ptr, align 8
6029 // CHECK11-NEXT: [[DOTBOUND_TID__ADDR:%.*]] = alloca ptr, align 8
6030 // CHECK11-NEXT: [[DOTPREVIOUS_LB__ADDR:%.*]] = alloca i64, align 8
6031 // CHECK11-NEXT: [[DOTPREVIOUS_UB__ADDR:%.*]] = alloca i64, align 8
6032 // CHECK11-NEXT: [[DOTOMP_IV:%.*]] = alloca i32, align 4
6033 // CHECK11-NEXT: [[TMP:%.*]] = alloca i32, align 4
6034 // CHECK11-NEXT: [[DOTOMP_LB:%.*]] = alloca i32, align 4
6035 // CHECK11-NEXT: [[DOTOMP_UB:%.*]] = alloca i32, align 4
6036 // CHECK11-NEXT: [[DOTOMP_STRIDE:%.*]] = alloca i32, align 4
6037 // CHECK11-NEXT: [[DOTOMP_IS_LAST:%.*]] = alloca i32, align 4
6038 // CHECK11-NEXT: [[I:%.*]] = alloca i32, align 4
6039 // CHECK11-NEXT: store ptr [[DOTGLOBAL_TID_]], ptr [[DOTGLOBAL_TID__ADDR]], align 8
6040 // CHECK11-NEXT: store ptr [[DOTBOUND_TID_]], ptr [[DOTBOUND_TID__ADDR]], align 8
6041 // CHECK11-NEXT: store i64 [[DOTPREVIOUS_LB_]], ptr [[DOTPREVIOUS_LB__ADDR]], align 8
6042 // CHECK11-NEXT: store i64 [[DOTPREVIOUS_UB_]], ptr [[DOTPREVIOUS_UB__ADDR]], align 8
6043 // CHECK11-NEXT: store i32 0, ptr [[DOTOMP_LB]], align 4
6044 // CHECK11-NEXT: store i32 99, ptr [[DOTOMP_UB]], align 4
6045 // CHECK11-NEXT: [[TMP0:%.*]] = load i64, ptr [[DOTPREVIOUS_LB__ADDR]], align 8
6046 // CHECK11-NEXT: [[CONV:%.*]] = trunc i64 [[TMP0]] to i32
6047 // CHECK11-NEXT: [[TMP1:%.*]] = load i64, ptr [[DOTPREVIOUS_UB__ADDR]], align 8
6048 // CHECK11-NEXT: [[CONV1:%.*]] = trunc i64 [[TMP1]] to i32
6049 // CHECK11-NEXT: store i32 [[CONV]], ptr [[DOTOMP_LB]], align 4
6050 // CHECK11-NEXT: store i32 [[CONV1]], ptr [[DOTOMP_UB]], align 4
6051 // CHECK11-NEXT: store i32 1, ptr [[DOTOMP_STRIDE]], align 4
6052 // CHECK11-NEXT: store i32 0, ptr [[DOTOMP_IS_LAST]], align 4
6053 // CHECK11-NEXT: [[TMP2:%.*]] = load ptr, ptr [[DOTGLOBAL_TID__ADDR]], align 8
6054 // CHECK11-NEXT: [[TMP3:%.*]] = load i32, ptr [[TMP2]], align 4
6055 // 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)
6056 // CHECK11-NEXT: [[TMP4:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4
6057 // CHECK11-NEXT: [[CMP:%.*]] = icmp sgt i32 [[TMP4]], 99
6058 // CHECK11-NEXT: br i1 [[CMP]], label [[COND_TRUE:%.*]], label [[COND_FALSE:%.*]]
6059 // CHECK11: cond.true:
6060 // CHECK11-NEXT: br label [[COND_END:%.*]]
6061 // CHECK11: cond.false:
6062 // CHECK11-NEXT: [[TMP5:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4
6063 // CHECK11-NEXT: br label [[COND_END]]
6064 // CHECK11: cond.end:
6065 // CHECK11-NEXT: [[COND:%.*]] = phi i32 [ 99, [[COND_TRUE]] ], [ [[TMP5]], [[COND_FALSE]] ]
6066 // CHECK11-NEXT: store i32 [[COND]], ptr [[DOTOMP_UB]], align 4
6067 // CHECK11-NEXT: [[TMP6:%.*]] = load i32, ptr [[DOTOMP_LB]], align 4
6068 // CHECK11-NEXT: store i32 [[TMP6]], ptr [[DOTOMP_IV]], align 4
6069 // CHECK11-NEXT: br label [[OMP_INNER_FOR_COND:%.*]]
6070 // CHECK11: omp.inner.for.cond:
6071 // CHECK11-NEXT: [[TMP7:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP15:![0-9]+]]
6072 // CHECK11-NEXT: [[TMP8:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4, !llvm.access.group [[ACC_GRP15]]
6073 // CHECK11-NEXT: [[CMP2:%.*]] = icmp sle i32 [[TMP7]], [[TMP8]]
6074 // CHECK11-NEXT: br i1 [[CMP2]], label [[OMP_INNER_FOR_BODY:%.*]], label [[OMP_INNER_FOR_END:%.*]]
6075 // CHECK11: omp.inner.for.body:
6076 // CHECK11-NEXT: [[TMP9:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP15]]
6077 // CHECK11-NEXT: [[MUL:%.*]] = mul nsw i32 [[TMP9]], 1
6078 // CHECK11-NEXT: [[ADD:%.*]] = add nsw i32 0, [[MUL]]
6079 // CHECK11-NEXT: store i32 [[ADD]], ptr [[I]], align 4, !llvm.access.group [[ACC_GRP15]]
6080 // CHECK11-NEXT: br label [[OMP_BODY_CONTINUE:%.*]]
6081 // CHECK11: omp.body.continue:
6082 // CHECK11-NEXT: br label [[OMP_INNER_FOR_INC:%.*]]
6083 // CHECK11: omp.inner.for.inc:
6084 // CHECK11-NEXT: [[TMP10:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP15]]
6085 // CHECK11-NEXT: [[ADD3:%.*]] = add nsw i32 [[TMP10]], 1
6086 // CHECK11-NEXT: store i32 [[ADD3]], ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP15]]
6087 // CHECK11-NEXT: br label [[OMP_INNER_FOR_COND]], !llvm.loop [[LOOP16:![0-9]+]]
6088 // CHECK11: omp.inner.for.end:
6089 // CHECK11-NEXT: br label [[OMP_LOOP_EXIT:%.*]]
6090 // CHECK11: omp.loop.exit:
6091 // CHECK11-NEXT: call void @__kmpc_for_static_fini(ptr @[[GLOB1]], i32 [[TMP3]])
6092 // CHECK11-NEXT: [[TMP11:%.*]] = load i32, ptr [[DOTOMP_IS_LAST]], align 4
6093 // CHECK11-NEXT: [[TMP12:%.*]] = icmp ne i32 [[TMP11]], 0
6094 // CHECK11-NEXT: br i1 [[TMP12]], label [[DOTOMP_FINAL_THEN:%.*]], label [[DOTOMP_FINAL_DONE:%.*]]
6095 // CHECK11: .omp.final.then:
6096 // CHECK11-NEXT: store i32 100, ptr [[I]], align 4
6097 // CHECK11-NEXT: br label [[DOTOMP_FINAL_DONE]]
6098 // CHECK11: .omp.final.done:
6099 // CHECK11-NEXT: ret void
6102 // CHECK11-LABEL: define {{[^@]+}}@{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z9gtid_testv_l47
6103 // CHECK11-SAME: () #[[ATTR1]] {
6104 // CHECK11-NEXT: entry:
6105 // 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_l47.omp_outlined)
6106 // CHECK11-NEXT: ret void
6109 // CHECK11-LABEL: define {{[^@]+}}@{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z9gtid_testv_l47.omp_outlined
6110 // CHECK11-SAME: (ptr noalias noundef [[DOTGLOBAL_TID_:%.*]], ptr noalias noundef [[DOTBOUND_TID_:%.*]]) #[[ATTR2]] {
6111 // CHECK11-NEXT: entry:
6112 // CHECK11-NEXT: [[DOTGLOBAL_TID__ADDR:%.*]] = alloca ptr, align 8
6113 // CHECK11-NEXT: [[DOTBOUND_TID__ADDR:%.*]] = alloca ptr, align 8
6114 // CHECK11-NEXT: [[DOTOMP_IV:%.*]] = alloca i32, align 4
6115 // CHECK11-NEXT: [[TMP:%.*]] = alloca i32, align 4
6116 // CHECK11-NEXT: [[DOTOMP_COMB_LB:%.*]] = alloca i32, align 4
6117 // CHECK11-NEXT: [[DOTOMP_COMB_UB:%.*]] = alloca i32, align 4
6118 // CHECK11-NEXT: [[DOTOMP_STRIDE:%.*]] = alloca i32, align 4
6119 // CHECK11-NEXT: [[DOTOMP_IS_LAST:%.*]] = alloca i32, align 4
6120 // CHECK11-NEXT: [[I:%.*]] = alloca i32, align 4
6121 // CHECK11-NEXT: [[DOTBOUND_ZERO_ADDR:%.*]] = alloca i32, align 4
6122 // CHECK11-NEXT: store ptr [[DOTGLOBAL_TID_]], ptr [[DOTGLOBAL_TID__ADDR]], align 8
6123 // CHECK11-NEXT: store ptr [[DOTBOUND_TID_]], ptr [[DOTBOUND_TID__ADDR]], align 8
6124 // CHECK11-NEXT: store i32 0, ptr [[DOTOMP_COMB_LB]], align 4
6125 // CHECK11-NEXT: store i32 99, ptr [[DOTOMP_COMB_UB]], align 4
6126 // CHECK11-NEXT: store i32 1, ptr [[DOTOMP_STRIDE]], align 4
6127 // CHECK11-NEXT: store i32 0, ptr [[DOTOMP_IS_LAST]], align 4
6128 // CHECK11-NEXT: [[TMP0:%.*]] = load ptr, ptr [[DOTGLOBAL_TID__ADDR]], align 8
6129 // CHECK11-NEXT: [[TMP1:%.*]] = load i32, ptr [[TMP0]], align 4
6130 // 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)
6131 // CHECK11-NEXT: [[TMP2:%.*]] = load i32, ptr [[DOTOMP_COMB_UB]], align 4
6132 // CHECK11-NEXT: [[CMP:%.*]] = icmp sgt i32 [[TMP2]], 99
6133 // CHECK11-NEXT: br i1 [[CMP]], label [[COND_TRUE:%.*]], label [[COND_FALSE:%.*]]
6134 // CHECK11: cond.true:
6135 // CHECK11-NEXT: br label [[COND_END:%.*]]
6136 // CHECK11: cond.false:
6137 // CHECK11-NEXT: [[TMP3:%.*]] = load i32, ptr [[DOTOMP_COMB_UB]], align 4
6138 // CHECK11-NEXT: br label [[COND_END]]
6139 // CHECK11: cond.end:
6140 // CHECK11-NEXT: [[COND:%.*]] = phi i32 [ 99, [[COND_TRUE]] ], [ [[TMP3]], [[COND_FALSE]] ]
6141 // CHECK11-NEXT: store i32 [[COND]], ptr [[DOTOMP_COMB_UB]], align 4
6142 // CHECK11-NEXT: [[TMP4:%.*]] = load i32, ptr [[DOTOMP_COMB_LB]], align 4
6143 // CHECK11-NEXT: store i32 [[TMP4]], ptr [[DOTOMP_IV]], align 4
6144 // CHECK11-NEXT: br label [[OMP_INNER_FOR_COND:%.*]]
6145 // CHECK11: omp.inner.for.cond:
6146 // CHECK11-NEXT: [[TMP5:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP20:![0-9]+]]
6147 // CHECK11-NEXT: [[TMP6:%.*]] = load i32, ptr [[DOTOMP_COMB_UB]], align 4, !llvm.access.group [[ACC_GRP20]]
6148 // CHECK11-NEXT: [[CMP1:%.*]] = icmp sle i32 [[TMP5]], [[TMP6]]
6149 // CHECK11-NEXT: br i1 [[CMP1]], label [[OMP_INNER_FOR_BODY:%.*]], label [[OMP_INNER_FOR_END:%.*]]
6150 // CHECK11: omp.inner.for.body:
6151 // CHECK11-NEXT: [[TMP7:%.*]] = load i32, ptr [[DOTOMP_COMB_LB]], align 4, !llvm.access.group [[ACC_GRP20]]
6152 // CHECK11-NEXT: [[TMP8:%.*]] = zext i32 [[TMP7]] to i64
6153 // CHECK11-NEXT: [[TMP9:%.*]] = load i32, ptr [[DOTOMP_COMB_UB]], align 4, !llvm.access.group [[ACC_GRP20]]
6154 // CHECK11-NEXT: [[TMP10:%.*]] = zext i32 [[TMP9]] to i64
6155 // CHECK11-NEXT: call void @__kmpc_serialized_parallel(ptr @[[GLOB3]], i32 [[TMP1]]), !llvm.access.group [[ACC_GRP20]]
6156 // CHECK11-NEXT: [[TMP11:%.*]] = load ptr, ptr [[DOTGLOBAL_TID__ADDR]], align 8, !llvm.access.group [[ACC_GRP20]]
6157 // CHECK11-NEXT: store i32 0, ptr [[DOTBOUND_ZERO_ADDR]], align 4, !llvm.access.group [[ACC_GRP20]]
6158 // CHECK11-NEXT: call void @{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z9gtid_testv_l47.omp_outlined.omp_outlined(ptr [[TMP11]], ptr [[DOTBOUND_ZERO_ADDR]], i64 [[TMP8]], i64 [[TMP10]]) #[[ATTR3]], !llvm.access.group [[ACC_GRP20]]
6159 // CHECK11-NEXT: call void @__kmpc_end_serialized_parallel(ptr @[[GLOB3]], i32 [[TMP1]]), !llvm.access.group [[ACC_GRP20]]
6160 // CHECK11-NEXT: br label [[OMP_INNER_FOR_INC:%.*]]
6161 // CHECK11: omp.inner.for.inc:
6162 // CHECK11-NEXT: [[TMP12:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP20]]
6163 // CHECK11-NEXT: [[TMP13:%.*]] = load i32, ptr [[DOTOMP_STRIDE]], align 4, !llvm.access.group [[ACC_GRP20]]
6164 // CHECK11-NEXT: [[ADD:%.*]] = add nsw i32 [[TMP12]], [[TMP13]]
6165 // CHECK11-NEXT: store i32 [[ADD]], ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP20]]
6166 // CHECK11-NEXT: br label [[OMP_INNER_FOR_COND]], !llvm.loop [[LOOP21:![0-9]+]]
6167 // CHECK11: omp.inner.for.end:
6168 // CHECK11-NEXT: br label [[OMP_LOOP_EXIT:%.*]]
6169 // CHECK11: omp.loop.exit:
6170 // CHECK11-NEXT: call void @__kmpc_for_static_fini(ptr @[[GLOB1]], i32 [[TMP1]])
6171 // CHECK11-NEXT: [[TMP14:%.*]] = load i32, ptr [[DOTOMP_IS_LAST]], align 4
6172 // CHECK11-NEXT: [[TMP15:%.*]] = icmp ne i32 [[TMP14]], 0
6173 // CHECK11-NEXT: br i1 [[TMP15]], label [[DOTOMP_FINAL_THEN:%.*]], label [[DOTOMP_FINAL_DONE:%.*]]
6174 // CHECK11: .omp.final.then:
6175 // CHECK11-NEXT: store i32 100, ptr [[I]], align 4
6176 // CHECK11-NEXT: br label [[DOTOMP_FINAL_DONE]]
6177 // CHECK11: .omp.final.done:
6178 // CHECK11-NEXT: ret void
6181 // CHECK11-LABEL: define {{[^@]+}}@{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z9gtid_testv_l47.omp_outlined.omp_outlined
6182 // CHECK11-SAME: (ptr noalias noundef [[DOTGLOBAL_TID_:%.*]], ptr noalias noundef [[DOTBOUND_TID_:%.*]], i64 noundef [[DOTPREVIOUS_LB_:%.*]], i64 noundef [[DOTPREVIOUS_UB_:%.*]]) #[[ATTR2]] {
6183 // CHECK11-NEXT: entry:
6184 // CHECK11-NEXT: [[DOTGLOBAL_TID__ADDR:%.*]] = alloca ptr, align 8
6185 // CHECK11-NEXT: [[DOTBOUND_TID__ADDR:%.*]] = alloca ptr, align 8
6186 // CHECK11-NEXT: [[DOTPREVIOUS_LB__ADDR:%.*]] = alloca i64, align 8
6187 // CHECK11-NEXT: [[DOTPREVIOUS_UB__ADDR:%.*]] = alloca i64, align 8
6188 // CHECK11-NEXT: [[DOTOMP_IV:%.*]] = alloca i32, align 4
6189 // CHECK11-NEXT: [[TMP:%.*]] = alloca i32, align 4
6190 // CHECK11-NEXT: [[DOTOMP_LB:%.*]] = alloca i32, align 4
6191 // CHECK11-NEXT: [[DOTOMP_UB:%.*]] = alloca i32, align 4
6192 // CHECK11-NEXT: [[DOTOMP_STRIDE:%.*]] = alloca i32, align 4
6193 // CHECK11-NEXT: [[DOTOMP_IS_LAST:%.*]] = alloca i32, align 4
6194 // CHECK11-NEXT: [[I:%.*]] = alloca i32, align 4
6195 // CHECK11-NEXT: store ptr [[DOTGLOBAL_TID_]], ptr [[DOTGLOBAL_TID__ADDR]], align 8
6196 // CHECK11-NEXT: store ptr [[DOTBOUND_TID_]], ptr [[DOTBOUND_TID__ADDR]], align 8
6197 // CHECK11-NEXT: store i64 [[DOTPREVIOUS_LB_]], ptr [[DOTPREVIOUS_LB__ADDR]], align 8
6198 // CHECK11-NEXT: store i64 [[DOTPREVIOUS_UB_]], ptr [[DOTPREVIOUS_UB__ADDR]], align 8
6199 // CHECK11-NEXT: store i32 0, ptr [[DOTOMP_LB]], align 4
6200 // CHECK11-NEXT: store i32 99, ptr [[DOTOMP_UB]], align 4
6201 // CHECK11-NEXT: [[TMP0:%.*]] = load i64, ptr [[DOTPREVIOUS_LB__ADDR]], align 8
6202 // CHECK11-NEXT: [[CONV:%.*]] = trunc i64 [[TMP0]] to i32
6203 // CHECK11-NEXT: [[TMP1:%.*]] = load i64, ptr [[DOTPREVIOUS_UB__ADDR]], align 8
6204 // CHECK11-NEXT: [[CONV1:%.*]] = trunc i64 [[TMP1]] to i32
6205 // CHECK11-NEXT: store i32 [[CONV]], ptr [[DOTOMP_LB]], align 4
6206 // CHECK11-NEXT: store i32 [[CONV1]], ptr [[DOTOMP_UB]], align 4
6207 // CHECK11-NEXT: store i32 1, ptr [[DOTOMP_STRIDE]], align 4
6208 // CHECK11-NEXT: store i32 0, ptr [[DOTOMP_IS_LAST]], align 4
6209 // CHECK11-NEXT: [[TMP2:%.*]] = load ptr, ptr [[DOTGLOBAL_TID__ADDR]], align 8
6210 // CHECK11-NEXT: [[TMP3:%.*]] = load i32, ptr [[TMP2]], align 4
6211 // 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)
6212 // CHECK11-NEXT: [[TMP4:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4
6213 // CHECK11-NEXT: [[CMP:%.*]] = icmp sgt i32 [[TMP4]], 99
6214 // CHECK11-NEXT: br i1 [[CMP]], label [[COND_TRUE:%.*]], label [[COND_FALSE:%.*]]
6215 // CHECK11: cond.true:
6216 // CHECK11-NEXT: br label [[COND_END:%.*]]
6217 // CHECK11: cond.false:
6218 // CHECK11-NEXT: [[TMP5:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4
6219 // CHECK11-NEXT: br label [[COND_END]]
6220 // CHECK11: cond.end:
6221 // CHECK11-NEXT: [[COND:%.*]] = phi i32 [ 99, [[COND_TRUE]] ], [ [[TMP5]], [[COND_FALSE]] ]
6222 // CHECK11-NEXT: store i32 [[COND]], ptr [[DOTOMP_UB]], align 4
6223 // CHECK11-NEXT: [[TMP6:%.*]] = load i32, ptr [[DOTOMP_LB]], align 4
6224 // CHECK11-NEXT: store i32 [[TMP6]], ptr [[DOTOMP_IV]], align 4
6225 // CHECK11-NEXT: br label [[OMP_INNER_FOR_COND:%.*]]
6226 // CHECK11: omp.inner.for.cond:
6227 // CHECK11-NEXT: [[TMP7:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP23:![0-9]+]]
6228 // CHECK11-NEXT: [[TMP8:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4, !llvm.access.group [[ACC_GRP23]]
6229 // CHECK11-NEXT: [[CMP2:%.*]] = icmp sle i32 [[TMP7]], [[TMP8]]
6230 // CHECK11-NEXT: br i1 [[CMP2]], label [[OMP_INNER_FOR_BODY:%.*]], label [[OMP_INNER_FOR_END:%.*]]
6231 // CHECK11: omp.inner.for.body:
6232 // CHECK11-NEXT: [[TMP9:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP23]]
6233 // CHECK11-NEXT: [[MUL:%.*]] = mul nsw i32 [[TMP9]], 1
6234 // CHECK11-NEXT: [[ADD:%.*]] = add nsw i32 0, [[MUL]]
6235 // CHECK11-NEXT: store i32 [[ADD]], ptr [[I]], align 4, !llvm.access.group [[ACC_GRP23]]
6236 // CHECK11-NEXT: call void @_Z9gtid_testv(), !llvm.access.group [[ACC_GRP23]]
6237 // CHECK11-NEXT: br label [[OMP_BODY_CONTINUE:%.*]]
6238 // CHECK11: omp.body.continue:
6239 // CHECK11-NEXT: br label [[OMP_INNER_FOR_INC:%.*]]
6240 // CHECK11: omp.inner.for.inc:
6241 // CHECK11-NEXT: [[TMP10:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP23]]
6242 // CHECK11-NEXT: [[ADD3:%.*]] = add nsw i32 [[TMP10]], 1
6243 // CHECK11-NEXT: store i32 [[ADD3]], ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP23]]
6244 // CHECK11-NEXT: br label [[OMP_INNER_FOR_COND]], !llvm.loop [[LOOP24:![0-9]+]]
6245 // CHECK11: omp.inner.for.end:
6246 // CHECK11-NEXT: br label [[OMP_LOOP_EXIT:%.*]]
6247 // CHECK11: omp.loop.exit:
6248 // CHECK11-NEXT: call void @__kmpc_for_static_fini(ptr @[[GLOB1]], i32 [[TMP3]])
6249 // CHECK11-NEXT: [[TMP11:%.*]] = load i32, ptr [[DOTOMP_IS_LAST]], align 4
6250 // CHECK11-NEXT: [[TMP12:%.*]] = icmp ne i32 [[TMP11]], 0
6251 // CHECK11-NEXT: br i1 [[TMP12]], label [[DOTOMP_FINAL_THEN:%.*]], label [[DOTOMP_FINAL_DONE:%.*]]
6252 // CHECK11: .omp.final.then:
6253 // CHECK11-NEXT: store i32 100, ptr [[I]], align 4
6254 // CHECK11-NEXT: br label [[DOTOMP_FINAL_DONE]]
6255 // CHECK11: .omp.final.done:
6256 // CHECK11-NEXT: ret void
6259 // CHECK11-LABEL: define {{[^@]+}}@main
6260 // CHECK11-SAME: () #[[ATTR4:[0-9]+]] {
6261 // CHECK11-NEXT: entry:
6262 // CHECK11-NEXT: [[RETVAL:%.*]] = alloca i32, align 4
6263 // CHECK11-NEXT: [[TMP:%.*]] = alloca i32, align 4
6264 // CHECK11-NEXT: [[KERNEL_ARGS:%.*]] = alloca [[STRUCT___TGT_KERNEL_ARGUMENTS:%.*]], align 8
6265 // CHECK11-NEXT: [[_TMP1:%.*]] = alloca i32, align 4
6266 // CHECK11-NEXT: [[KERNEL_ARGS2:%.*]] = alloca [[STRUCT___TGT_KERNEL_ARGUMENTS]], align 8
6267 // CHECK11-NEXT: [[ARG_CASTED:%.*]] = alloca i64, align 8
6268 // CHECK11-NEXT: [[DOTOFFLOAD_BASEPTRS:%.*]] = alloca [1 x ptr], align 8
6269 // CHECK11-NEXT: [[DOTOFFLOAD_PTRS:%.*]] = alloca [1 x ptr], align 8
6270 // CHECK11-NEXT: [[DOTOFFLOAD_MAPPERS:%.*]] = alloca [1 x ptr], align 8
6271 // CHECK11-NEXT: [[DOTCAPTURE_EXPR_:%.*]] = alloca i8, align 1
6272 // CHECK11-NEXT: [[_TMP6:%.*]] = alloca i32, align 4
6273 // CHECK11-NEXT: [[KERNEL_ARGS7:%.*]] = alloca [[STRUCT___TGT_KERNEL_ARGUMENTS]], align 8
6274 // CHECK11-NEXT: store i32 0, ptr [[RETVAL]], align 4
6275 // CHECK11-NEXT: [[TMP0:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 0
6276 // CHECK11-NEXT: store i32 2, ptr [[TMP0]], align 4
6277 // CHECK11-NEXT: [[TMP1:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 1
6278 // CHECK11-NEXT: store i32 0, ptr [[TMP1]], align 4
6279 // CHECK11-NEXT: [[TMP2:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 2
6280 // CHECK11-NEXT: store ptr null, ptr [[TMP2]], align 8
6281 // CHECK11-NEXT: [[TMP3:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 3
6282 // CHECK11-NEXT: store ptr null, ptr [[TMP3]], align 8
6283 // CHECK11-NEXT: [[TMP4:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 4
6284 // CHECK11-NEXT: store ptr null, ptr [[TMP4]], align 8
6285 // CHECK11-NEXT: [[TMP5:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 5
6286 // CHECK11-NEXT: store ptr null, ptr [[TMP5]], align 8
6287 // CHECK11-NEXT: [[TMP6:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 6
6288 // CHECK11-NEXT: store ptr null, ptr [[TMP6]], align 8
6289 // CHECK11-NEXT: [[TMP7:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 7
6290 // CHECK11-NEXT: store ptr null, ptr [[TMP7]], align 8
6291 // CHECK11-NEXT: [[TMP8:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 8
6292 // CHECK11-NEXT: store i64 100, ptr [[TMP8]], align 8
6293 // CHECK11-NEXT: [[TMP9:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 9
6294 // CHECK11-NEXT: store i64 0, ptr [[TMP9]], align 8
6295 // CHECK11-NEXT: [[TMP10:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 10
6296 // CHECK11-NEXT: store [3 x i32] zeroinitializer, ptr [[TMP10]], align 4
6297 // CHECK11-NEXT: [[TMP11:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 11
6298 // CHECK11-NEXT: store [3 x i32] zeroinitializer, ptr [[TMP11]], align 4
6299 // CHECK11-NEXT: [[TMP12:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 12
6300 // CHECK11-NEXT: store i32 0, ptr [[TMP12]], align 4
6301 // 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_l76.region_id, ptr [[KERNEL_ARGS]])
6302 // CHECK11-NEXT: [[TMP14:%.*]] = icmp ne i32 [[TMP13]], 0
6303 // CHECK11-NEXT: br i1 [[TMP14]], label [[OMP_OFFLOAD_FAILED:%.*]], label [[OMP_OFFLOAD_CONT:%.*]]
6304 // CHECK11: omp_offload.failed:
6305 // CHECK11-NEXT: call void @{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}_main_l76() #[[ATTR3]]
6306 // CHECK11-NEXT: br label [[OMP_OFFLOAD_CONT]]
6307 // CHECK11: omp_offload.cont:
6308 // CHECK11-NEXT: [[TMP15:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS2]], i32 0, i32 0
6309 // CHECK11-NEXT: store i32 2, ptr [[TMP15]], align 4
6310 // CHECK11-NEXT: [[TMP16:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS2]], i32 0, i32 1
6311 // CHECK11-NEXT: store i32 0, ptr [[TMP16]], align 4
6312 // CHECK11-NEXT: [[TMP17:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS2]], i32 0, i32 2
6313 // CHECK11-NEXT: store ptr null, ptr [[TMP17]], align 8
6314 // CHECK11-NEXT: [[TMP18:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS2]], i32 0, i32 3
6315 // CHECK11-NEXT: store ptr null, ptr [[TMP18]], align 8
6316 // CHECK11-NEXT: [[TMP19:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS2]], i32 0, i32 4
6317 // CHECK11-NEXT: store ptr null, ptr [[TMP19]], align 8
6318 // CHECK11-NEXT: [[TMP20:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS2]], i32 0, i32 5
6319 // CHECK11-NEXT: store ptr null, ptr [[TMP20]], align 8
6320 // CHECK11-NEXT: [[TMP21:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS2]], i32 0, i32 6
6321 // CHECK11-NEXT: store ptr null, ptr [[TMP21]], align 8
6322 // CHECK11-NEXT: [[TMP22:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS2]], i32 0, i32 7
6323 // CHECK11-NEXT: store ptr null, ptr [[TMP22]], align 8
6324 // CHECK11-NEXT: [[TMP23:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS2]], i32 0, i32 8
6325 // CHECK11-NEXT: store i64 100, ptr [[TMP23]], align 8
6326 // CHECK11-NEXT: [[TMP24:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS2]], i32 0, i32 9
6327 // CHECK11-NEXT: store i64 0, ptr [[TMP24]], align 8
6328 // CHECK11-NEXT: [[TMP25:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS2]], i32 0, i32 10
6329 // CHECK11-NEXT: store [3 x i32] zeroinitializer, ptr [[TMP25]], align 4
6330 // CHECK11-NEXT: [[TMP26:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS2]], i32 0, i32 11
6331 // CHECK11-NEXT: store [3 x i32] [i32 1, i32 0, i32 0], ptr [[TMP26]], align 4
6332 // CHECK11-NEXT: [[TMP27:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS2]], i32 0, i32 12
6333 // CHECK11-NEXT: store i32 0, ptr [[TMP27]], align 4
6334 // CHECK11-NEXT: [[TMP28:%.*]] = call i32 @__tgt_target_kernel(ptr @[[GLOB3]], i64 -1, i32 0, i32 1, ptr @.{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}_main_l84.region_id, ptr [[KERNEL_ARGS2]])
6335 // CHECK11-NEXT: [[TMP29:%.*]] = icmp ne i32 [[TMP28]], 0
6336 // CHECK11-NEXT: br i1 [[TMP29]], label [[OMP_OFFLOAD_FAILED3:%.*]], label [[OMP_OFFLOAD_CONT4:%.*]]
6337 // CHECK11: omp_offload.failed3:
6338 // CHECK11-NEXT: call void @{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}_main_l84() #[[ATTR3]]
6339 // CHECK11-NEXT: br label [[OMP_OFFLOAD_CONT4]]
6340 // CHECK11: omp_offload.cont4:
6341 // CHECK11-NEXT: [[TMP30:%.*]] = load i32, ptr @Arg, align 4
6342 // CHECK11-NEXT: store i32 [[TMP30]], ptr [[ARG_CASTED]], align 4
6343 // CHECK11-NEXT: [[TMP31:%.*]] = load i64, ptr [[ARG_CASTED]], align 8
6344 // CHECK11-NEXT: [[TMP32:%.*]] = getelementptr inbounds [1 x ptr], ptr [[DOTOFFLOAD_BASEPTRS]], i32 0, i32 0
6345 // CHECK11-NEXT: store i64 [[TMP31]], ptr [[TMP32]], align 8
6346 // CHECK11-NEXT: [[TMP33:%.*]] = getelementptr inbounds [1 x ptr], ptr [[DOTOFFLOAD_PTRS]], i32 0, i32 0
6347 // CHECK11-NEXT: store i64 [[TMP31]], ptr [[TMP33]], align 8
6348 // CHECK11-NEXT: [[TMP34:%.*]] = getelementptr inbounds [1 x ptr], ptr [[DOTOFFLOAD_MAPPERS]], i64 0, i64 0
6349 // CHECK11-NEXT: store ptr null, ptr [[TMP34]], align 8
6350 // CHECK11-NEXT: [[TMP35:%.*]] = getelementptr inbounds [1 x ptr], ptr [[DOTOFFLOAD_BASEPTRS]], i32 0, i32 0
6351 // CHECK11-NEXT: [[TMP36:%.*]] = getelementptr inbounds [1 x ptr], ptr [[DOTOFFLOAD_PTRS]], i32 0, i32 0
6352 // CHECK11-NEXT: [[TMP37:%.*]] = load i32, ptr @Arg, align 4
6353 // CHECK11-NEXT: [[TOBOOL:%.*]] = icmp ne i32 [[TMP37]], 0
6354 // CHECK11-NEXT: [[FROMBOOL:%.*]] = zext i1 [[TOBOOL]] to i8
6355 // CHECK11-NEXT: store i8 [[FROMBOOL]], ptr [[DOTCAPTURE_EXPR_]], align 1
6356 // CHECK11-NEXT: [[TMP38:%.*]] = load i8, ptr [[DOTCAPTURE_EXPR_]], align 1
6357 // CHECK11-NEXT: [[TOBOOL5:%.*]] = trunc i8 [[TMP38]] to i1
6358 // CHECK11-NEXT: [[TMP39:%.*]] = select i1 [[TOBOOL5]], i32 0, i32 1
6359 // CHECK11-NEXT: [[TMP40:%.*]] = insertvalue [3 x i32] zeroinitializer, i32 [[TMP39]], 0
6360 // CHECK11-NEXT: [[TMP41:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS7]], i32 0, i32 0
6361 // CHECK11-NEXT: store i32 2, ptr [[TMP41]], align 4
6362 // CHECK11-NEXT: [[TMP42:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS7]], i32 0, i32 1
6363 // CHECK11-NEXT: store i32 1, ptr [[TMP42]], align 4
6364 // CHECK11-NEXT: [[TMP43:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS7]], i32 0, i32 2
6365 // CHECK11-NEXT: store ptr [[TMP35]], ptr [[TMP43]], align 8
6366 // CHECK11-NEXT: [[TMP44:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS7]], i32 0, i32 3
6367 // CHECK11-NEXT: store ptr [[TMP36]], ptr [[TMP44]], align 8
6368 // CHECK11-NEXT: [[TMP45:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS7]], i32 0, i32 4
6369 // CHECK11-NEXT: store ptr @.offload_sizes, ptr [[TMP45]], align 8
6370 // CHECK11-NEXT: [[TMP46:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS7]], i32 0, i32 5
6371 // CHECK11-NEXT: store ptr @.offload_maptypes, ptr [[TMP46]], align 8
6372 // CHECK11-NEXT: [[TMP47:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS7]], i32 0, i32 6
6373 // CHECK11-NEXT: store ptr null, ptr [[TMP47]], align 8
6374 // CHECK11-NEXT: [[TMP48:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS7]], i32 0, i32 7
6375 // CHECK11-NEXT: store ptr null, ptr [[TMP48]], align 8
6376 // CHECK11-NEXT: [[TMP49:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS7]], i32 0, i32 8
6377 // CHECK11-NEXT: store i64 100, ptr [[TMP49]], align 8
6378 // CHECK11-NEXT: [[TMP50:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS7]], i32 0, i32 9
6379 // CHECK11-NEXT: store i64 0, ptr [[TMP50]], align 8
6380 // CHECK11-NEXT: [[TMP51:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS7]], i32 0, i32 10
6381 // CHECK11-NEXT: store [3 x i32] zeroinitializer, ptr [[TMP51]], align 4
6382 // CHECK11-NEXT: [[TMP52:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS7]], i32 0, i32 11
6383 // CHECK11-NEXT: store [3 x i32] [[TMP40]], ptr [[TMP52]], align 4
6384 // CHECK11-NEXT: [[TMP53:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS7]], i32 0, i32 12
6385 // CHECK11-NEXT: store i32 0, ptr [[TMP53]], align 4
6386 // CHECK11-NEXT: [[TMP54:%.*]] = call i32 @__tgt_target_kernel(ptr @[[GLOB3]], i64 -1, i32 0, i32 [[TMP39]], ptr @.{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}_main_l92.region_id, ptr [[KERNEL_ARGS7]])
6387 // CHECK11-NEXT: [[TMP55:%.*]] = icmp ne i32 [[TMP54]], 0
6388 // CHECK11-NEXT: br i1 [[TMP55]], label [[OMP_OFFLOAD_FAILED8:%.*]], label [[OMP_OFFLOAD_CONT9:%.*]]
6389 // CHECK11: omp_offload.failed8:
6390 // CHECK11-NEXT: call void @{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}_main_l92(i64 [[TMP31]]) #[[ATTR3]]
6391 // CHECK11-NEXT: br label [[OMP_OFFLOAD_CONT9]]
6392 // CHECK11: omp_offload.cont9:
6393 // CHECK11-NEXT: [[TMP56:%.*]] = load i32, ptr @Arg, align 4
6394 // CHECK11-NEXT: [[CALL:%.*]] = call noundef i32 @_Z5tmainIiEiT_(i32 noundef [[TMP56]])
6395 // CHECK11-NEXT: ret i32 [[CALL]]
6398 // CHECK11-LABEL: define {{[^@]+}}@{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}_main_l76
6399 // CHECK11-SAME: () #[[ATTR1]] {
6400 // CHECK11-NEXT: entry:
6401 // CHECK11-NEXT: call void (ptr, i32, ptr, ...) @__kmpc_fork_teams(ptr @[[GLOB3]], i32 0, ptr @{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}_main_l76.omp_outlined)
6402 // CHECK11-NEXT: ret void
6405 // CHECK11-LABEL: define {{[^@]+}}@{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}_main_l76.omp_outlined
6406 // CHECK11-SAME: (ptr noalias noundef [[DOTGLOBAL_TID_:%.*]], ptr noalias noundef [[DOTBOUND_TID_:%.*]]) #[[ATTR2]] {
6407 // CHECK11-NEXT: entry:
6408 // CHECK11-NEXT: [[DOTGLOBAL_TID__ADDR:%.*]] = alloca ptr, align 8
6409 // CHECK11-NEXT: [[DOTBOUND_TID__ADDR:%.*]] = alloca ptr, align 8
6410 // CHECK11-NEXT: [[DOTOMP_IV:%.*]] = alloca i32, align 4
6411 // CHECK11-NEXT: [[TMP:%.*]] = alloca i32, align 4
6412 // CHECK11-NEXT: [[DOTOMP_COMB_LB:%.*]] = alloca i32, align 4
6413 // CHECK11-NEXT: [[DOTOMP_COMB_UB:%.*]] = alloca i32, align 4
6414 // CHECK11-NEXT: [[DOTOMP_STRIDE:%.*]] = alloca i32, align 4
6415 // CHECK11-NEXT: [[DOTOMP_IS_LAST:%.*]] = alloca i32, align 4
6416 // CHECK11-NEXT: [[I:%.*]] = alloca i32, align 4
6417 // CHECK11-NEXT: store ptr [[DOTGLOBAL_TID_]], ptr [[DOTGLOBAL_TID__ADDR]], align 8
6418 // CHECK11-NEXT: store ptr [[DOTBOUND_TID_]], ptr [[DOTBOUND_TID__ADDR]], align 8
6419 // CHECK11-NEXT: store i32 0, ptr [[DOTOMP_COMB_LB]], align 4
6420 // CHECK11-NEXT: store i32 99, ptr [[DOTOMP_COMB_UB]], align 4
6421 // CHECK11-NEXT: store i32 1, ptr [[DOTOMP_STRIDE]], align 4
6422 // CHECK11-NEXT: store i32 0, ptr [[DOTOMP_IS_LAST]], align 4
6423 // CHECK11-NEXT: [[TMP0:%.*]] = load ptr, ptr [[DOTGLOBAL_TID__ADDR]], align 8
6424 // CHECK11-NEXT: [[TMP1:%.*]] = load i32, ptr [[TMP0]], align 4
6425 // 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)
6426 // CHECK11-NEXT: [[TMP2:%.*]] = load i32, ptr [[DOTOMP_COMB_UB]], align 4
6427 // CHECK11-NEXT: [[CMP:%.*]] = icmp sgt i32 [[TMP2]], 99
6428 // CHECK11-NEXT: br i1 [[CMP]], label [[COND_TRUE:%.*]], label [[COND_FALSE:%.*]]
6429 // CHECK11: cond.true:
6430 // CHECK11-NEXT: br label [[COND_END:%.*]]
6431 // CHECK11: cond.false:
6432 // CHECK11-NEXT: [[TMP3:%.*]] = load i32, ptr [[DOTOMP_COMB_UB]], align 4
6433 // CHECK11-NEXT: br label [[COND_END]]
6434 // CHECK11: cond.end:
6435 // CHECK11-NEXT: [[COND:%.*]] = phi i32 [ 99, [[COND_TRUE]] ], [ [[TMP3]], [[COND_FALSE]] ]
6436 // CHECK11-NEXT: store i32 [[COND]], ptr [[DOTOMP_COMB_UB]], align 4
6437 // CHECK11-NEXT: [[TMP4:%.*]] = load i32, ptr [[DOTOMP_COMB_LB]], align 4
6438 // CHECK11-NEXT: store i32 [[TMP4]], ptr [[DOTOMP_IV]], align 4
6439 // CHECK11-NEXT: br label [[OMP_INNER_FOR_COND:%.*]]
6440 // CHECK11: omp.inner.for.cond:
6441 // CHECK11-NEXT: [[TMP5:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP26:![0-9]+]]
6442 // CHECK11-NEXT: [[TMP6:%.*]] = load i32, ptr [[DOTOMP_COMB_UB]], align 4, !llvm.access.group [[ACC_GRP26]]
6443 // CHECK11-NEXT: [[CMP1:%.*]] = icmp sle i32 [[TMP5]], [[TMP6]]
6444 // CHECK11-NEXT: br i1 [[CMP1]], label [[OMP_INNER_FOR_BODY:%.*]], label [[OMP_INNER_FOR_END:%.*]]
6445 // CHECK11: omp.inner.for.body:
6446 // CHECK11-NEXT: [[TMP7:%.*]] = load i32, ptr [[DOTOMP_COMB_LB]], align 4, !llvm.access.group [[ACC_GRP26]]
6447 // CHECK11-NEXT: [[TMP8:%.*]] = zext i32 [[TMP7]] to i64
6448 // CHECK11-NEXT: [[TMP9:%.*]] = load i32, ptr [[DOTOMP_COMB_UB]], align 4, !llvm.access.group [[ACC_GRP26]]
6449 // CHECK11-NEXT: [[TMP10:%.*]] = zext i32 [[TMP9]] to i64
6450 // CHECK11-NEXT: call void (ptr, i32, ptr, ...) @__kmpc_fork_call(ptr @[[GLOB3]], i32 2, ptr @{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}_main_l76.omp_outlined.omp_outlined, i64 [[TMP8]], i64 [[TMP10]]), !llvm.access.group [[ACC_GRP26]]
6451 // CHECK11-NEXT: br label [[OMP_INNER_FOR_INC:%.*]]
6452 // CHECK11: omp.inner.for.inc:
6453 // CHECK11-NEXT: [[TMP11:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP26]]
6454 // CHECK11-NEXT: [[TMP12:%.*]] = load i32, ptr [[DOTOMP_STRIDE]], align 4, !llvm.access.group [[ACC_GRP26]]
6455 // CHECK11-NEXT: [[ADD:%.*]] = add nsw i32 [[TMP11]], [[TMP12]]
6456 // CHECK11-NEXT: store i32 [[ADD]], ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP26]]
6457 // CHECK11-NEXT: br label [[OMP_INNER_FOR_COND]], !llvm.loop [[LOOP27:![0-9]+]]
6458 // CHECK11: omp.inner.for.end:
6459 // CHECK11-NEXT: br label [[OMP_LOOP_EXIT:%.*]]
6460 // CHECK11: omp.loop.exit:
6461 // CHECK11-NEXT: call void @__kmpc_for_static_fini(ptr @[[GLOB1]], i32 [[TMP1]])
6462 // CHECK11-NEXT: [[TMP13:%.*]] = load i32, ptr [[DOTOMP_IS_LAST]], align 4
6463 // CHECK11-NEXT: [[TMP14:%.*]] = icmp ne i32 [[TMP13]], 0
6464 // CHECK11-NEXT: br i1 [[TMP14]], label [[DOTOMP_FINAL_THEN:%.*]], label [[DOTOMP_FINAL_DONE:%.*]]
6465 // CHECK11: .omp.final.then:
6466 // CHECK11-NEXT: store i32 100, ptr [[I]], align 4
6467 // CHECK11-NEXT: br label [[DOTOMP_FINAL_DONE]]
6468 // CHECK11: .omp.final.done:
6469 // CHECK11-NEXT: ret void
6472 // CHECK11-LABEL: define {{[^@]+}}@{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}_main_l76.omp_outlined.omp_outlined
6473 // CHECK11-SAME: (ptr noalias noundef [[DOTGLOBAL_TID_:%.*]], ptr noalias noundef [[DOTBOUND_TID_:%.*]], i64 noundef [[DOTPREVIOUS_LB_:%.*]], i64 noundef [[DOTPREVIOUS_UB_:%.*]]) #[[ATTR2]] {
6474 // CHECK11-NEXT: entry:
6475 // CHECK11-NEXT: [[DOTGLOBAL_TID__ADDR:%.*]] = alloca ptr, align 8
6476 // CHECK11-NEXT: [[DOTBOUND_TID__ADDR:%.*]] = alloca ptr, align 8
6477 // CHECK11-NEXT: [[DOTPREVIOUS_LB__ADDR:%.*]] = alloca i64, align 8
6478 // CHECK11-NEXT: [[DOTPREVIOUS_UB__ADDR:%.*]] = alloca i64, align 8
6479 // CHECK11-NEXT: [[DOTOMP_IV:%.*]] = alloca i32, align 4
6480 // CHECK11-NEXT: [[TMP:%.*]] = alloca i32, align 4
6481 // CHECK11-NEXT: [[DOTOMP_LB:%.*]] = alloca i32, align 4
6482 // CHECK11-NEXT: [[DOTOMP_UB:%.*]] = alloca i32, align 4
6483 // CHECK11-NEXT: [[DOTOMP_STRIDE:%.*]] = alloca i32, align 4
6484 // CHECK11-NEXT: [[DOTOMP_IS_LAST:%.*]] = alloca i32, align 4
6485 // CHECK11-NEXT: [[I:%.*]] = alloca i32, align 4
6486 // CHECK11-NEXT: store ptr [[DOTGLOBAL_TID_]], ptr [[DOTGLOBAL_TID__ADDR]], align 8
6487 // CHECK11-NEXT: store ptr [[DOTBOUND_TID_]], ptr [[DOTBOUND_TID__ADDR]], align 8
6488 // CHECK11-NEXT: store i64 [[DOTPREVIOUS_LB_]], ptr [[DOTPREVIOUS_LB__ADDR]], align 8
6489 // CHECK11-NEXT: store i64 [[DOTPREVIOUS_UB_]], ptr [[DOTPREVIOUS_UB__ADDR]], align 8
6490 // CHECK11-NEXT: store i32 0, ptr [[DOTOMP_LB]], align 4
6491 // CHECK11-NEXT: store i32 99, ptr [[DOTOMP_UB]], align 4
6492 // CHECK11-NEXT: [[TMP0:%.*]] = load i64, ptr [[DOTPREVIOUS_LB__ADDR]], align 8
6493 // CHECK11-NEXT: [[CONV:%.*]] = trunc i64 [[TMP0]] to i32
6494 // CHECK11-NEXT: [[TMP1:%.*]] = load i64, ptr [[DOTPREVIOUS_UB__ADDR]], align 8
6495 // CHECK11-NEXT: [[CONV1:%.*]] = trunc i64 [[TMP1]] to i32
6496 // CHECK11-NEXT: store i32 [[CONV]], ptr [[DOTOMP_LB]], align 4
6497 // CHECK11-NEXT: store i32 [[CONV1]], ptr [[DOTOMP_UB]], align 4
6498 // CHECK11-NEXT: store i32 1, ptr [[DOTOMP_STRIDE]], align 4
6499 // CHECK11-NEXT: store i32 0, ptr [[DOTOMP_IS_LAST]], align 4
6500 // CHECK11-NEXT: [[TMP2:%.*]] = load ptr, ptr [[DOTGLOBAL_TID__ADDR]], align 8
6501 // CHECK11-NEXT: [[TMP3:%.*]] = load i32, ptr [[TMP2]], align 4
6502 // 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)
6503 // CHECK11-NEXT: [[TMP4:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4
6504 // CHECK11-NEXT: [[CMP:%.*]] = icmp sgt i32 [[TMP4]], 99
6505 // CHECK11-NEXT: br i1 [[CMP]], label [[COND_TRUE:%.*]], label [[COND_FALSE:%.*]]
6506 // CHECK11: cond.true:
6507 // CHECK11-NEXT: br label [[COND_END:%.*]]
6508 // CHECK11: cond.false:
6509 // CHECK11-NEXT: [[TMP5:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4
6510 // CHECK11-NEXT: br label [[COND_END]]
6511 // CHECK11: cond.end:
6512 // CHECK11-NEXT: [[COND:%.*]] = phi i32 [ 99, [[COND_TRUE]] ], [ [[TMP5]], [[COND_FALSE]] ]
6513 // CHECK11-NEXT: store i32 [[COND]], ptr [[DOTOMP_UB]], align 4
6514 // CHECK11-NEXT: [[TMP6:%.*]] = load i32, ptr [[DOTOMP_LB]], align 4
6515 // CHECK11-NEXT: store i32 [[TMP6]], ptr [[DOTOMP_IV]], align 4
6516 // CHECK11-NEXT: br label [[OMP_INNER_FOR_COND:%.*]]
6517 // CHECK11: omp.inner.for.cond:
6518 // CHECK11-NEXT: [[TMP7:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP29:![0-9]+]]
6519 // CHECK11-NEXT: [[TMP8:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4, !llvm.access.group [[ACC_GRP29]]
6520 // CHECK11-NEXT: [[CMP2:%.*]] = icmp sle i32 [[TMP7]], [[TMP8]]
6521 // CHECK11-NEXT: br i1 [[CMP2]], label [[OMP_INNER_FOR_BODY:%.*]], label [[OMP_INNER_FOR_END:%.*]]
6522 // CHECK11: omp.inner.for.body:
6523 // CHECK11-NEXT: [[TMP9:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP29]]
6524 // CHECK11-NEXT: [[MUL:%.*]] = mul nsw i32 [[TMP9]], 1
6525 // CHECK11-NEXT: [[ADD:%.*]] = add nsw i32 0, [[MUL]]
6526 // CHECK11-NEXT: store i32 [[ADD]], ptr [[I]], align 4, !llvm.access.group [[ACC_GRP29]]
6527 // CHECK11-NEXT: call void @_Z3fn4v(), !llvm.access.group [[ACC_GRP29]]
6528 // CHECK11-NEXT: br label [[OMP_BODY_CONTINUE:%.*]]
6529 // CHECK11: omp.body.continue:
6530 // CHECK11-NEXT: br label [[OMP_INNER_FOR_INC:%.*]]
6531 // CHECK11: omp.inner.for.inc:
6532 // CHECK11-NEXT: [[TMP10:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP29]]
6533 // CHECK11-NEXT: [[ADD3:%.*]] = add nsw i32 [[TMP10]], 1
6534 // CHECK11-NEXT: store i32 [[ADD3]], ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP29]]
6535 // CHECK11-NEXT: br label [[OMP_INNER_FOR_COND]], !llvm.loop [[LOOP30:![0-9]+]]
6536 // CHECK11: omp.inner.for.end:
6537 // CHECK11-NEXT: br label [[OMP_LOOP_EXIT:%.*]]
6538 // CHECK11: omp.loop.exit:
6539 // CHECK11-NEXT: call void @__kmpc_for_static_fini(ptr @[[GLOB1]], i32 [[TMP3]])
6540 // CHECK11-NEXT: [[TMP11:%.*]] = load i32, ptr [[DOTOMP_IS_LAST]], align 4
6541 // CHECK11-NEXT: [[TMP12:%.*]] = icmp ne i32 [[TMP11]], 0
6542 // CHECK11-NEXT: br i1 [[TMP12]], label [[DOTOMP_FINAL_THEN:%.*]], label [[DOTOMP_FINAL_DONE:%.*]]
6543 // CHECK11: .omp.final.then:
6544 // CHECK11-NEXT: store i32 100, ptr [[I]], align 4
6545 // CHECK11-NEXT: br label [[DOTOMP_FINAL_DONE]]
6546 // CHECK11: .omp.final.done:
6547 // CHECK11-NEXT: ret void
6550 // CHECK11-LABEL: define {{[^@]+}}@{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}_main_l84
6551 // CHECK11-SAME: () #[[ATTR1]] {
6552 // CHECK11-NEXT: entry:
6553 // CHECK11-NEXT: call void (ptr, i32, ptr, ...) @__kmpc_fork_teams(ptr @[[GLOB3]], i32 0, ptr @{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}_main_l84.omp_outlined)
6554 // CHECK11-NEXT: ret void
6557 // CHECK11-LABEL: define {{[^@]+}}@{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}_main_l84.omp_outlined
6558 // CHECK11-SAME: (ptr noalias noundef [[DOTGLOBAL_TID_:%.*]], ptr noalias noundef [[DOTBOUND_TID_:%.*]]) #[[ATTR2]] {
6559 // CHECK11-NEXT: entry:
6560 // CHECK11-NEXT: [[DOTGLOBAL_TID__ADDR:%.*]] = alloca ptr, align 8
6561 // CHECK11-NEXT: [[DOTBOUND_TID__ADDR:%.*]] = alloca ptr, align 8
6562 // CHECK11-NEXT: [[DOTOMP_IV:%.*]] = alloca i32, align 4
6563 // CHECK11-NEXT: [[TMP:%.*]] = alloca i32, align 4
6564 // CHECK11-NEXT: [[DOTOMP_COMB_LB:%.*]] = alloca i32, align 4
6565 // CHECK11-NEXT: [[DOTOMP_COMB_UB:%.*]] = alloca i32, align 4
6566 // CHECK11-NEXT: [[DOTOMP_STRIDE:%.*]] = alloca i32, align 4
6567 // CHECK11-NEXT: [[DOTOMP_IS_LAST:%.*]] = alloca i32, align 4
6568 // CHECK11-NEXT: [[I:%.*]] = alloca i32, align 4
6569 // CHECK11-NEXT: [[DOTBOUND_ZERO_ADDR:%.*]] = alloca i32, align 4
6570 // CHECK11-NEXT: store ptr [[DOTGLOBAL_TID_]], ptr [[DOTGLOBAL_TID__ADDR]], align 8
6571 // CHECK11-NEXT: store ptr [[DOTBOUND_TID_]], ptr [[DOTBOUND_TID__ADDR]], align 8
6572 // CHECK11-NEXT: store i32 0, ptr [[DOTOMP_COMB_LB]], align 4
6573 // CHECK11-NEXT: store i32 99, ptr [[DOTOMP_COMB_UB]], align 4
6574 // CHECK11-NEXT: store i32 1, ptr [[DOTOMP_STRIDE]], align 4
6575 // CHECK11-NEXT: store i32 0, ptr [[DOTOMP_IS_LAST]], align 4
6576 // CHECK11-NEXT: [[TMP0:%.*]] = load ptr, ptr [[DOTGLOBAL_TID__ADDR]], align 8
6577 // CHECK11-NEXT: [[TMP1:%.*]] = load i32, ptr [[TMP0]], align 4
6578 // 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)
6579 // CHECK11-NEXT: [[TMP2:%.*]] = load i32, ptr [[DOTOMP_COMB_UB]], align 4
6580 // CHECK11-NEXT: [[CMP:%.*]] = icmp sgt i32 [[TMP2]], 99
6581 // CHECK11-NEXT: br i1 [[CMP]], label [[COND_TRUE:%.*]], label [[COND_FALSE:%.*]]
6582 // CHECK11: cond.true:
6583 // CHECK11-NEXT: br label [[COND_END:%.*]]
6584 // CHECK11: cond.false:
6585 // CHECK11-NEXT: [[TMP3:%.*]] = load i32, ptr [[DOTOMP_COMB_UB]], align 4
6586 // CHECK11-NEXT: br label [[COND_END]]
6587 // CHECK11: cond.end:
6588 // CHECK11-NEXT: [[COND:%.*]] = phi i32 [ 99, [[COND_TRUE]] ], [ [[TMP3]], [[COND_FALSE]] ]
6589 // CHECK11-NEXT: store i32 [[COND]], ptr [[DOTOMP_COMB_UB]], align 4
6590 // CHECK11-NEXT: [[TMP4:%.*]] = load i32, ptr [[DOTOMP_COMB_LB]], align 4
6591 // CHECK11-NEXT: store i32 [[TMP4]], ptr [[DOTOMP_IV]], align 4
6592 // CHECK11-NEXT: br label [[OMP_INNER_FOR_COND:%.*]]
6593 // CHECK11: omp.inner.for.cond:
6594 // CHECK11-NEXT: [[TMP5:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4
6595 // CHECK11-NEXT: [[TMP6:%.*]] = load i32, ptr [[DOTOMP_COMB_UB]], align 4
6596 // CHECK11-NEXT: [[CMP1:%.*]] = icmp sle i32 [[TMP5]], [[TMP6]]
6597 // CHECK11-NEXT: br i1 [[CMP1]], label [[OMP_INNER_FOR_BODY:%.*]], label [[OMP_INNER_FOR_END:%.*]]
6598 // CHECK11: omp.inner.for.body:
6599 // CHECK11-NEXT: [[TMP7:%.*]] = load i32, ptr [[DOTOMP_COMB_LB]], align 4
6600 // CHECK11-NEXT: [[TMP8:%.*]] = zext i32 [[TMP7]] to i64
6601 // CHECK11-NEXT: [[TMP9:%.*]] = load i32, ptr [[DOTOMP_COMB_UB]], align 4
6602 // CHECK11-NEXT: [[TMP10:%.*]] = zext i32 [[TMP9]] to i64
6603 // CHECK11-NEXT: call void @__kmpc_serialized_parallel(ptr @[[GLOB3]], i32 [[TMP1]])
6604 // CHECK11-NEXT: [[TMP11:%.*]] = load ptr, ptr [[DOTGLOBAL_TID__ADDR]], align 8
6605 // CHECK11-NEXT: store i32 0, ptr [[DOTBOUND_ZERO_ADDR]], align 4
6606 // CHECK11-NEXT: call void @{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}_main_l84.omp_outlined.omp_outlined(ptr [[TMP11]], ptr [[DOTBOUND_ZERO_ADDR]], i64 [[TMP8]], i64 [[TMP10]]) #[[ATTR3]]
6607 // CHECK11-NEXT: call void @__kmpc_end_serialized_parallel(ptr @[[GLOB3]], i32 [[TMP1]])
6608 // CHECK11-NEXT: br label [[OMP_INNER_FOR_INC:%.*]]
6609 // CHECK11: omp.inner.for.inc:
6610 // CHECK11-NEXT: [[TMP12:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4
6611 // CHECK11-NEXT: [[TMP13:%.*]] = load i32, ptr [[DOTOMP_STRIDE]], align 4
6612 // CHECK11-NEXT: [[ADD:%.*]] = add nsw i32 [[TMP12]], [[TMP13]]
6613 // CHECK11-NEXT: store i32 [[ADD]], ptr [[DOTOMP_IV]], align 4
6614 // CHECK11-NEXT: br label [[OMP_INNER_FOR_COND]], !llvm.loop [[LOOP32:![0-9]+]]
6615 // CHECK11: omp.inner.for.end:
6616 // CHECK11-NEXT: br label [[OMP_LOOP_EXIT:%.*]]
6617 // CHECK11: omp.loop.exit:
6618 // CHECK11-NEXT: call void @__kmpc_for_static_fini(ptr @[[GLOB1]], i32 [[TMP1]])
6619 // CHECK11-NEXT: [[TMP14:%.*]] = load i32, ptr [[DOTOMP_IS_LAST]], align 4
6620 // CHECK11-NEXT: [[TMP15:%.*]] = icmp ne i32 [[TMP14]], 0
6621 // CHECK11-NEXT: br i1 [[TMP15]], label [[DOTOMP_FINAL_THEN:%.*]], label [[DOTOMP_FINAL_DONE:%.*]]
6622 // CHECK11: .omp.final.then:
6623 // CHECK11-NEXT: store i32 100, ptr [[I]], align 4
6624 // CHECK11-NEXT: br label [[DOTOMP_FINAL_DONE]]
6625 // CHECK11: .omp.final.done:
6626 // CHECK11-NEXT: ret void
6629 // CHECK11-LABEL: define {{[^@]+}}@{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}_main_l84.omp_outlined.omp_outlined
6630 // CHECK11-SAME: (ptr noalias noundef [[DOTGLOBAL_TID_:%.*]], ptr noalias noundef [[DOTBOUND_TID_:%.*]], i64 noundef [[DOTPREVIOUS_LB_:%.*]], i64 noundef [[DOTPREVIOUS_UB_:%.*]]) #[[ATTR2]] {
6631 // CHECK11-NEXT: entry:
6632 // CHECK11-NEXT: [[DOTGLOBAL_TID__ADDR:%.*]] = alloca ptr, align 8
6633 // CHECK11-NEXT: [[DOTBOUND_TID__ADDR:%.*]] = alloca ptr, align 8
6634 // CHECK11-NEXT: [[DOTPREVIOUS_LB__ADDR:%.*]] = alloca i64, align 8
6635 // CHECK11-NEXT: [[DOTPREVIOUS_UB__ADDR:%.*]] = alloca i64, align 8
6636 // CHECK11-NEXT: [[DOTOMP_IV:%.*]] = alloca i32, align 4
6637 // CHECK11-NEXT: [[TMP:%.*]] = alloca i32, align 4
6638 // CHECK11-NEXT: [[DOTOMP_LB:%.*]] = alloca i32, align 4
6639 // CHECK11-NEXT: [[DOTOMP_UB:%.*]] = alloca i32, align 4
6640 // CHECK11-NEXT: [[DOTOMP_STRIDE:%.*]] = alloca i32, align 4
6641 // CHECK11-NEXT: [[DOTOMP_IS_LAST:%.*]] = alloca i32, align 4
6642 // CHECK11-NEXT: [[I:%.*]] = alloca i32, align 4
6643 // CHECK11-NEXT: store ptr [[DOTGLOBAL_TID_]], ptr [[DOTGLOBAL_TID__ADDR]], align 8
6644 // CHECK11-NEXT: store ptr [[DOTBOUND_TID_]], ptr [[DOTBOUND_TID__ADDR]], align 8
6645 // CHECK11-NEXT: store i64 [[DOTPREVIOUS_LB_]], ptr [[DOTPREVIOUS_LB__ADDR]], align 8
6646 // CHECK11-NEXT: store i64 [[DOTPREVIOUS_UB_]], ptr [[DOTPREVIOUS_UB__ADDR]], align 8
6647 // CHECK11-NEXT: store i32 0, ptr [[DOTOMP_LB]], align 4
6648 // CHECK11-NEXT: store i32 99, ptr [[DOTOMP_UB]], align 4
6649 // CHECK11-NEXT: [[TMP0:%.*]] = load i64, ptr [[DOTPREVIOUS_LB__ADDR]], align 8
6650 // CHECK11-NEXT: [[CONV:%.*]] = trunc i64 [[TMP0]] to i32
6651 // CHECK11-NEXT: [[TMP1:%.*]] = load i64, ptr [[DOTPREVIOUS_UB__ADDR]], align 8
6652 // CHECK11-NEXT: [[CONV1:%.*]] = trunc i64 [[TMP1]] to i32
6653 // CHECK11-NEXT: store i32 [[CONV]], ptr [[DOTOMP_LB]], align 4
6654 // CHECK11-NEXT: store i32 [[CONV1]], ptr [[DOTOMP_UB]], align 4
6655 // CHECK11-NEXT: store i32 1, ptr [[DOTOMP_STRIDE]], align 4
6656 // CHECK11-NEXT: store i32 0, ptr [[DOTOMP_IS_LAST]], align 4
6657 // CHECK11-NEXT: [[TMP2:%.*]] = load ptr, ptr [[DOTGLOBAL_TID__ADDR]], align 8
6658 // CHECK11-NEXT: [[TMP3:%.*]] = load i32, ptr [[TMP2]], align 4
6659 // 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)
6660 // CHECK11-NEXT: [[TMP4:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4
6661 // CHECK11-NEXT: [[CMP:%.*]] = icmp sgt i32 [[TMP4]], 99
6662 // CHECK11-NEXT: br i1 [[CMP]], label [[COND_TRUE:%.*]], label [[COND_FALSE:%.*]]
6663 // CHECK11: cond.true:
6664 // CHECK11-NEXT: br label [[COND_END:%.*]]
6665 // CHECK11: cond.false:
6666 // CHECK11-NEXT: [[TMP5:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4
6667 // CHECK11-NEXT: br label [[COND_END]]
6668 // CHECK11: cond.end:
6669 // CHECK11-NEXT: [[COND:%.*]] = phi i32 [ 99, [[COND_TRUE]] ], [ [[TMP5]], [[COND_FALSE]] ]
6670 // CHECK11-NEXT: store i32 [[COND]], ptr [[DOTOMP_UB]], align 4
6671 // CHECK11-NEXT: [[TMP6:%.*]] = load i32, ptr [[DOTOMP_LB]], align 4
6672 // CHECK11-NEXT: store i32 [[TMP6]], ptr [[DOTOMP_IV]], align 4
6673 // CHECK11-NEXT: br label [[OMP_INNER_FOR_COND:%.*]]
6674 // CHECK11: omp.inner.for.cond:
6675 // CHECK11-NEXT: [[TMP7:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4
6676 // CHECK11-NEXT: [[TMP8:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4
6677 // CHECK11-NEXT: [[CMP2:%.*]] = icmp sle i32 [[TMP7]], [[TMP8]]
6678 // CHECK11-NEXT: br i1 [[CMP2]], label [[OMP_INNER_FOR_BODY:%.*]], label [[OMP_INNER_FOR_END:%.*]]
6679 // CHECK11: omp.inner.for.body:
6680 // CHECK11-NEXT: [[TMP9:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4
6681 // CHECK11-NEXT: [[MUL:%.*]] = mul nsw i32 [[TMP9]], 1
6682 // CHECK11-NEXT: [[ADD:%.*]] = add nsw i32 0, [[MUL]]
6683 // CHECK11-NEXT: store i32 [[ADD]], ptr [[I]], align 4
6684 // CHECK11-NEXT: call void @_Z3fn5v()
6685 // CHECK11-NEXT: br label [[OMP_BODY_CONTINUE:%.*]]
6686 // CHECK11: omp.body.continue:
6687 // CHECK11-NEXT: br label [[OMP_INNER_FOR_INC:%.*]]
6688 // CHECK11: omp.inner.for.inc:
6689 // CHECK11-NEXT: [[TMP10:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4
6690 // CHECK11-NEXT: [[ADD3:%.*]] = add nsw i32 [[TMP10]], 1
6691 // CHECK11-NEXT: store i32 [[ADD3]], ptr [[DOTOMP_IV]], align 4
6692 // CHECK11-NEXT: br label [[OMP_INNER_FOR_COND]], !llvm.loop [[LOOP34:![0-9]+]]
6693 // CHECK11: omp.inner.for.end:
6694 // CHECK11-NEXT: br label [[OMP_LOOP_EXIT:%.*]]
6695 // CHECK11: omp.loop.exit:
6696 // CHECK11-NEXT: call void @__kmpc_for_static_fini(ptr @[[GLOB1]], i32 [[TMP3]])
6697 // CHECK11-NEXT: [[TMP11:%.*]] = load i32, ptr [[DOTOMP_IS_LAST]], align 4
6698 // CHECK11-NEXT: [[TMP12:%.*]] = icmp ne i32 [[TMP11]], 0
6699 // CHECK11-NEXT: br i1 [[TMP12]], label [[DOTOMP_FINAL_THEN:%.*]], label [[DOTOMP_FINAL_DONE:%.*]]
6700 // CHECK11: .omp.final.then:
6701 // CHECK11-NEXT: store i32 100, ptr [[I]], align 4
6702 // CHECK11-NEXT: br label [[DOTOMP_FINAL_DONE]]
6703 // CHECK11: .omp.final.done:
6704 // CHECK11-NEXT: ret void
6707 // CHECK11-LABEL: define {{[^@]+}}@{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}_main_l92
6708 // CHECK11-SAME: (i64 noundef [[ARG:%.*]]) #[[ATTR1]] {
6709 // CHECK11-NEXT: entry:
6710 // CHECK11-NEXT: [[ARG_ADDR:%.*]] = alloca i64, align 8
6711 // CHECK11-NEXT: [[DOTCAPTURE_EXPR_:%.*]] = alloca i8, align 1
6712 // CHECK11-NEXT: [[DOTCAPTURE_EXPR__CASTED:%.*]] = alloca i64, align 8
6713 // CHECK11-NEXT: store i64 [[ARG]], ptr [[ARG_ADDR]], align 8
6714 // CHECK11-NEXT: [[TMP0:%.*]] = load i32, ptr [[ARG_ADDR]], align 4
6715 // CHECK11-NEXT: [[TOBOOL:%.*]] = icmp ne i32 [[TMP0]], 0
6716 // CHECK11-NEXT: [[FROMBOOL:%.*]] = zext i1 [[TOBOOL]] to i8
6717 // CHECK11-NEXT: store i8 [[FROMBOOL]], ptr [[DOTCAPTURE_EXPR_]], align 1
6718 // CHECK11-NEXT: [[TMP1:%.*]] = load i8, ptr [[DOTCAPTURE_EXPR_]], align 1
6719 // CHECK11-NEXT: [[TOBOOL1:%.*]] = trunc i8 [[TMP1]] to i1
6720 // CHECK11-NEXT: [[FROMBOOL2:%.*]] = zext i1 [[TOBOOL1]] to i8
6721 // CHECK11-NEXT: store i8 [[FROMBOOL2]], ptr [[DOTCAPTURE_EXPR__CASTED]], align 1
6722 // CHECK11-NEXT: [[TMP2:%.*]] = load i64, ptr [[DOTCAPTURE_EXPR__CASTED]], align 8
6723 // CHECK11-NEXT: call void (ptr, i32, ptr, ...) @__kmpc_fork_teams(ptr @[[GLOB3]], i32 1, ptr @{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}_main_l92.omp_outlined, i64 [[TMP2]])
6724 // CHECK11-NEXT: ret void
6727 // CHECK11-LABEL: define {{[^@]+}}@{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}_main_l92.omp_outlined
6728 // CHECK11-SAME: (ptr noalias noundef [[DOTGLOBAL_TID_:%.*]], ptr noalias noundef [[DOTBOUND_TID_:%.*]], i64 noundef [[DOTCAPTURE_EXPR_:%.*]]) #[[ATTR2]] {
6729 // CHECK11-NEXT: entry:
6730 // CHECK11-NEXT: [[DOTGLOBAL_TID__ADDR:%.*]] = alloca ptr, align 8
6731 // CHECK11-NEXT: [[DOTBOUND_TID__ADDR:%.*]] = alloca ptr, align 8
6732 // CHECK11-NEXT: [[DOTCAPTURE_EXPR__ADDR:%.*]] = alloca i64, align 8
6733 // CHECK11-NEXT: [[DOTOMP_IV:%.*]] = alloca i32, align 4
6734 // CHECK11-NEXT: [[TMP:%.*]] = alloca i32, align 4
6735 // CHECK11-NEXT: [[DOTOMP_COMB_LB:%.*]] = alloca i32, align 4
6736 // CHECK11-NEXT: [[DOTOMP_COMB_UB:%.*]] = alloca i32, align 4
6737 // CHECK11-NEXT: [[DOTOMP_STRIDE:%.*]] = alloca i32, align 4
6738 // CHECK11-NEXT: [[DOTOMP_IS_LAST:%.*]] = alloca i32, align 4
6739 // CHECK11-NEXT: [[I:%.*]] = alloca i32, align 4
6740 // CHECK11-NEXT: [[DOTCAPTURE_EXPR__CASTED:%.*]] = alloca i64, align 8
6741 // CHECK11-NEXT: [[DOTBOUND_ZERO_ADDR:%.*]] = alloca i32, align 4
6742 // CHECK11-NEXT: [[DOTCAPTURE_EXPR__CASTED10:%.*]] = alloca i64, align 8
6743 // CHECK11-NEXT: [[DOTBOUND_ZERO_ADDR15:%.*]] = alloca i32, align 4
6744 // CHECK11-NEXT: store ptr [[DOTGLOBAL_TID_]], ptr [[DOTGLOBAL_TID__ADDR]], align 8
6745 // CHECK11-NEXT: store ptr [[DOTBOUND_TID_]], ptr [[DOTBOUND_TID__ADDR]], align 8
6746 // CHECK11-NEXT: store i64 [[DOTCAPTURE_EXPR_]], ptr [[DOTCAPTURE_EXPR__ADDR]], align 8
6747 // CHECK11-NEXT: store i32 0, ptr [[DOTOMP_COMB_LB]], align 4
6748 // CHECK11-NEXT: store i32 99, ptr [[DOTOMP_COMB_UB]], align 4
6749 // CHECK11-NEXT: store i32 1, ptr [[DOTOMP_STRIDE]], align 4
6750 // CHECK11-NEXT: store i32 0, ptr [[DOTOMP_IS_LAST]], align 4
6751 // CHECK11-NEXT: [[TMP0:%.*]] = load ptr, ptr [[DOTGLOBAL_TID__ADDR]], align 8
6752 // CHECK11-NEXT: [[TMP1:%.*]] = load i32, ptr [[TMP0]], align 4
6753 // 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)
6754 // CHECK11-NEXT: [[TMP2:%.*]] = load i32, ptr [[DOTOMP_COMB_UB]], align 4
6755 // CHECK11-NEXT: [[CMP:%.*]] = icmp sgt i32 [[TMP2]], 99
6756 // CHECK11-NEXT: br i1 [[CMP]], label [[COND_TRUE:%.*]], label [[COND_FALSE:%.*]]
6757 // CHECK11: cond.true:
6758 // CHECK11-NEXT: br label [[COND_END:%.*]]
6759 // CHECK11: cond.false:
6760 // CHECK11-NEXT: [[TMP3:%.*]] = load i32, ptr [[DOTOMP_COMB_UB]], align 4
6761 // CHECK11-NEXT: br label [[COND_END]]
6762 // CHECK11: cond.end:
6763 // CHECK11-NEXT: [[COND:%.*]] = phi i32 [ 99, [[COND_TRUE]] ], [ [[TMP3]], [[COND_FALSE]] ]
6764 // CHECK11-NEXT: store i32 [[COND]], ptr [[DOTOMP_COMB_UB]], align 4
6765 // CHECK11-NEXT: [[TMP4:%.*]] = load i32, ptr [[DOTOMP_COMB_LB]], align 4
6766 // CHECK11-NEXT: store i32 [[TMP4]], ptr [[DOTOMP_IV]], align 4
6767 // CHECK11-NEXT: [[TMP5:%.*]] = load i8, ptr [[DOTCAPTURE_EXPR__ADDR]], align 1
6768 // CHECK11-NEXT: [[TOBOOL:%.*]] = trunc i8 [[TMP5]] to i1
6769 // CHECK11-NEXT: br i1 [[TOBOOL]], label [[OMP_IF_THEN:%.*]], label [[OMP_IF_ELSE5:%.*]]
6770 // CHECK11: omp_if.then:
6771 // CHECK11-NEXT: br label [[OMP_INNER_FOR_COND:%.*]]
6772 // CHECK11: omp.inner.for.cond:
6773 // CHECK11-NEXT: [[TMP6:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP35:![0-9]+]]
6774 // CHECK11-NEXT: [[TMP7:%.*]] = load i32, ptr [[DOTOMP_COMB_UB]], align 4, !llvm.access.group [[ACC_GRP35]]
6775 // CHECK11-NEXT: [[CMP1:%.*]] = icmp sle i32 [[TMP6]], [[TMP7]]
6776 // CHECK11-NEXT: br i1 [[CMP1]], label [[OMP_INNER_FOR_BODY:%.*]], label [[OMP_INNER_FOR_END:%.*]]
6777 // CHECK11: omp.inner.for.body:
6778 // CHECK11-NEXT: [[TMP8:%.*]] = load i32, ptr [[DOTOMP_COMB_LB]], align 4, !llvm.access.group [[ACC_GRP35]]
6779 // CHECK11-NEXT: [[TMP9:%.*]] = zext i32 [[TMP8]] to i64
6780 // CHECK11-NEXT: [[TMP10:%.*]] = load i32, ptr [[DOTOMP_COMB_UB]], align 4, !llvm.access.group [[ACC_GRP35]]
6781 // CHECK11-NEXT: [[TMP11:%.*]] = zext i32 [[TMP10]] to i64
6782 // CHECK11-NEXT: [[TMP12:%.*]] = load i8, ptr [[DOTCAPTURE_EXPR__ADDR]], align 1, !llvm.access.group [[ACC_GRP35]]
6783 // CHECK11-NEXT: [[TOBOOL2:%.*]] = trunc i8 [[TMP12]] to i1
6784 // CHECK11-NEXT: [[FROMBOOL:%.*]] = zext i1 [[TOBOOL2]] to i8
6785 // CHECK11-NEXT: store i8 [[FROMBOOL]], ptr [[DOTCAPTURE_EXPR__CASTED]], align 1, !llvm.access.group [[ACC_GRP35]]
6786 // CHECK11-NEXT: [[TMP13:%.*]] = load i64, ptr [[DOTCAPTURE_EXPR__CASTED]], align 8, !llvm.access.group [[ACC_GRP35]]
6787 // CHECK11-NEXT: [[TMP14:%.*]] = load i8, ptr [[DOTCAPTURE_EXPR__ADDR]], align 1, !llvm.access.group [[ACC_GRP35]]
6788 // CHECK11-NEXT: [[TOBOOL3:%.*]] = trunc i8 [[TMP14]] to i1
6789 // CHECK11-NEXT: br i1 [[TOBOOL3]], label [[OMP_IF_THEN4:%.*]], label [[OMP_IF_ELSE:%.*]]
6790 // CHECK11: omp_if.then4:
6791 // CHECK11-NEXT: call void (ptr, i32, ptr, ...) @__kmpc_fork_call(ptr @[[GLOB3]], i32 3, ptr @{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}_main_l92.omp_outlined.omp_outlined, i64 [[TMP9]], i64 [[TMP11]], i64 [[TMP13]]), !llvm.access.group [[ACC_GRP35]]
6792 // CHECK11-NEXT: br label [[OMP_IF_END:%.*]]
6793 // CHECK11: omp_if.else:
6794 // CHECK11-NEXT: call void @__kmpc_serialized_parallel(ptr @[[GLOB3]], i32 [[TMP1]]), !llvm.access.group [[ACC_GRP35]]
6795 // CHECK11-NEXT: [[TMP15:%.*]] = load ptr, ptr [[DOTGLOBAL_TID__ADDR]], align 8, !llvm.access.group [[ACC_GRP35]]
6796 // CHECK11-NEXT: store i32 0, ptr [[DOTBOUND_ZERO_ADDR]], align 4, !llvm.access.group [[ACC_GRP35]]
6797 // CHECK11-NEXT: call void @{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}_main_l92.omp_outlined.omp_outlined(ptr [[TMP15]], ptr [[DOTBOUND_ZERO_ADDR]], i64 [[TMP9]], i64 [[TMP11]], i64 [[TMP13]]) #[[ATTR3]], !llvm.access.group [[ACC_GRP35]]
6798 // CHECK11-NEXT: call void @__kmpc_end_serialized_parallel(ptr @[[GLOB3]], i32 [[TMP1]]), !llvm.access.group [[ACC_GRP35]]
6799 // CHECK11-NEXT: br label [[OMP_IF_END]]
6800 // CHECK11: omp_if.end:
6801 // CHECK11-NEXT: br label [[OMP_INNER_FOR_INC:%.*]]
6802 // CHECK11: omp.inner.for.inc:
6803 // CHECK11-NEXT: [[TMP16:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP35]]
6804 // CHECK11-NEXT: [[TMP17:%.*]] = load i32, ptr [[DOTOMP_STRIDE]], align 4, !llvm.access.group [[ACC_GRP35]]
6805 // CHECK11-NEXT: [[ADD:%.*]] = add nsw i32 [[TMP16]], [[TMP17]]
6806 // CHECK11-NEXT: store i32 [[ADD]], ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP35]]
6807 // CHECK11-NEXT: br label [[OMP_INNER_FOR_COND]], !llvm.loop [[LOOP36:![0-9]+]]
6808 // CHECK11: omp.inner.for.end:
6809 // CHECK11-NEXT: br label [[OMP_IF_END20:%.*]]
6810 // CHECK11: omp_if.else5:
6811 // CHECK11-NEXT: br label [[OMP_INNER_FOR_COND6:%.*]]
6812 // CHECK11: omp.inner.for.cond6:
6813 // CHECK11-NEXT: [[TMP18:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4
6814 // CHECK11-NEXT: [[TMP19:%.*]] = load i32, ptr [[DOTOMP_COMB_UB]], align 4
6815 // CHECK11-NEXT: [[CMP7:%.*]] = icmp sle i32 [[TMP18]], [[TMP19]]
6816 // CHECK11-NEXT: br i1 [[CMP7]], label [[OMP_INNER_FOR_BODY8:%.*]], label [[OMP_INNER_FOR_END19:%.*]]
6817 // CHECK11: omp.inner.for.body8:
6818 // CHECK11-NEXT: [[TMP20:%.*]] = load i32, ptr [[DOTOMP_COMB_LB]], align 4
6819 // CHECK11-NEXT: [[TMP21:%.*]] = zext i32 [[TMP20]] to i64
6820 // CHECK11-NEXT: [[TMP22:%.*]] = load i32, ptr [[DOTOMP_COMB_UB]], align 4
6821 // CHECK11-NEXT: [[TMP23:%.*]] = zext i32 [[TMP22]] to i64
6822 // CHECK11-NEXT: [[TMP24:%.*]] = load i8, ptr [[DOTCAPTURE_EXPR__ADDR]], align 1
6823 // CHECK11-NEXT: [[TOBOOL9:%.*]] = trunc i8 [[TMP24]] to i1
6824 // CHECK11-NEXT: [[FROMBOOL11:%.*]] = zext i1 [[TOBOOL9]] to i8
6825 // CHECK11-NEXT: store i8 [[FROMBOOL11]], ptr [[DOTCAPTURE_EXPR__CASTED10]], align 1
6826 // CHECK11-NEXT: [[TMP25:%.*]] = load i64, ptr [[DOTCAPTURE_EXPR__CASTED10]], align 8
6827 // CHECK11-NEXT: [[TMP26:%.*]] = load i8, ptr [[DOTCAPTURE_EXPR__ADDR]], align 1
6828 // CHECK11-NEXT: [[TOBOOL12:%.*]] = trunc i8 [[TMP26]] to i1
6829 // CHECK11-NEXT: br i1 [[TOBOOL12]], label [[OMP_IF_THEN13:%.*]], label [[OMP_IF_ELSE14:%.*]]
6830 // CHECK11: omp_if.then13:
6831 // CHECK11-NEXT: call void (ptr, i32, ptr, ...) @__kmpc_fork_call(ptr @[[GLOB3]], i32 3, ptr @{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}_main_l92.omp_outlined.omp_outlined.1, i64 [[TMP21]], i64 [[TMP23]], i64 [[TMP25]])
6832 // CHECK11-NEXT: br label [[OMP_IF_END16:%.*]]
6833 // CHECK11: omp_if.else14:
6834 // CHECK11-NEXT: call void @__kmpc_serialized_parallel(ptr @[[GLOB3]], i32 [[TMP1]])
6835 // CHECK11-NEXT: [[TMP27:%.*]] = load ptr, ptr [[DOTGLOBAL_TID__ADDR]], align 8
6836 // CHECK11-NEXT: store i32 0, ptr [[DOTBOUND_ZERO_ADDR15]], align 4
6837 // CHECK11-NEXT: call void @{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}_main_l92.omp_outlined.omp_outlined.1(ptr [[TMP27]], ptr [[DOTBOUND_ZERO_ADDR15]], i64 [[TMP21]], i64 [[TMP23]], i64 [[TMP25]]) #[[ATTR3]]
6838 // CHECK11-NEXT: call void @__kmpc_end_serialized_parallel(ptr @[[GLOB3]], i32 [[TMP1]])
6839 // CHECK11-NEXT: br label [[OMP_IF_END16]]
6840 // CHECK11: omp_if.end16:
6841 // CHECK11-NEXT: br label [[OMP_INNER_FOR_INC17:%.*]]
6842 // CHECK11: omp.inner.for.inc17:
6843 // CHECK11-NEXT: [[TMP28:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4
6844 // CHECK11-NEXT: [[TMP29:%.*]] = load i32, ptr [[DOTOMP_STRIDE]], align 4
6845 // CHECK11-NEXT: [[ADD18:%.*]] = add nsw i32 [[TMP28]], [[TMP29]]
6846 // CHECK11-NEXT: store i32 [[ADD18]], ptr [[DOTOMP_IV]], align 4
6847 // CHECK11-NEXT: br label [[OMP_INNER_FOR_COND6]], !llvm.loop [[LOOP38:![0-9]+]]
6848 // CHECK11: omp.inner.for.end19:
6849 // CHECK11-NEXT: br label [[OMP_IF_END20]]
6850 // CHECK11: omp_if.end20:
6851 // CHECK11-NEXT: br label [[OMP_LOOP_EXIT:%.*]]
6852 // CHECK11: omp.loop.exit:
6853 // CHECK11-NEXT: call void @__kmpc_for_static_fini(ptr @[[GLOB1]], i32 [[TMP1]])
6854 // CHECK11-NEXT: [[TMP30:%.*]] = load i32, ptr [[DOTOMP_IS_LAST]], align 4
6855 // CHECK11-NEXT: [[TMP31:%.*]] = icmp ne i32 [[TMP30]], 0
6856 // CHECK11-NEXT: br i1 [[TMP31]], label [[DOTOMP_FINAL_THEN:%.*]], label [[DOTOMP_FINAL_DONE:%.*]]
6857 // CHECK11: .omp.final.then:
6858 // CHECK11-NEXT: store i32 100, ptr [[I]], align 4
6859 // CHECK11-NEXT: br label [[DOTOMP_FINAL_DONE]]
6860 // CHECK11: .omp.final.done:
6861 // CHECK11-NEXT: ret void
6864 // CHECK11-LABEL: define {{[^@]+}}@{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}_main_l92.omp_outlined.omp_outlined
6865 // CHECK11-SAME: (ptr noalias noundef [[DOTGLOBAL_TID_:%.*]], ptr noalias noundef [[DOTBOUND_TID_:%.*]], i64 noundef [[DOTPREVIOUS_LB_:%.*]], i64 noundef [[DOTPREVIOUS_UB_:%.*]], i64 noundef [[DOTCAPTURE_EXPR_:%.*]]) #[[ATTR2]] {
6866 // CHECK11-NEXT: entry:
6867 // CHECK11-NEXT: [[DOTGLOBAL_TID__ADDR:%.*]] = alloca ptr, align 8
6868 // CHECK11-NEXT: [[DOTBOUND_TID__ADDR:%.*]] = alloca ptr, align 8
6869 // CHECK11-NEXT: [[DOTPREVIOUS_LB__ADDR:%.*]] = alloca i64, align 8
6870 // CHECK11-NEXT: [[DOTPREVIOUS_UB__ADDR:%.*]] = alloca i64, align 8
6871 // CHECK11-NEXT: [[DOTCAPTURE_EXPR__ADDR:%.*]] = alloca i64, align 8
6872 // CHECK11-NEXT: [[DOTOMP_IV:%.*]] = alloca i32, align 4
6873 // CHECK11-NEXT: [[TMP:%.*]] = alloca i32, align 4
6874 // CHECK11-NEXT: [[DOTOMP_LB:%.*]] = alloca i32, align 4
6875 // CHECK11-NEXT: [[DOTOMP_UB:%.*]] = alloca i32, align 4
6876 // CHECK11-NEXT: [[DOTOMP_STRIDE:%.*]] = alloca i32, align 4
6877 // CHECK11-NEXT: [[DOTOMP_IS_LAST:%.*]] = alloca i32, align 4
6878 // CHECK11-NEXT: [[I:%.*]] = alloca i32, align 4
6879 // CHECK11-NEXT: store ptr [[DOTGLOBAL_TID_]], ptr [[DOTGLOBAL_TID__ADDR]], align 8
6880 // CHECK11-NEXT: store ptr [[DOTBOUND_TID_]], ptr [[DOTBOUND_TID__ADDR]], align 8
6881 // CHECK11-NEXT: store i64 [[DOTPREVIOUS_LB_]], ptr [[DOTPREVIOUS_LB__ADDR]], align 8
6882 // CHECK11-NEXT: store i64 [[DOTPREVIOUS_UB_]], ptr [[DOTPREVIOUS_UB__ADDR]], align 8
6883 // CHECK11-NEXT: store i64 [[DOTCAPTURE_EXPR_]], ptr [[DOTCAPTURE_EXPR__ADDR]], align 8
6884 // CHECK11-NEXT: store i32 0, ptr [[DOTOMP_LB]], align 4
6885 // CHECK11-NEXT: store i32 99, ptr [[DOTOMP_UB]], align 4
6886 // CHECK11-NEXT: [[TMP0:%.*]] = load i64, ptr [[DOTPREVIOUS_LB__ADDR]], align 8
6887 // CHECK11-NEXT: [[CONV:%.*]] = trunc i64 [[TMP0]] to i32
6888 // CHECK11-NEXT: [[TMP1:%.*]] = load i64, ptr [[DOTPREVIOUS_UB__ADDR]], align 8
6889 // CHECK11-NEXT: [[CONV1:%.*]] = trunc i64 [[TMP1]] to i32
6890 // CHECK11-NEXT: store i32 [[CONV]], ptr [[DOTOMP_LB]], align 4
6891 // CHECK11-NEXT: store i32 [[CONV1]], ptr [[DOTOMP_UB]], align 4
6892 // CHECK11-NEXT: store i32 1, ptr [[DOTOMP_STRIDE]], align 4
6893 // CHECK11-NEXT: store i32 0, ptr [[DOTOMP_IS_LAST]], align 4
6894 // CHECK11-NEXT: [[TMP2:%.*]] = load i8, ptr [[DOTCAPTURE_EXPR__ADDR]], align 1
6895 // CHECK11-NEXT: [[TOBOOL:%.*]] = trunc i8 [[TMP2]] to i1
6896 // CHECK11-NEXT: br i1 [[TOBOOL]], label [[OMP_IF_THEN:%.*]], label [[OMP_IF_ELSE:%.*]]
6897 // CHECK11: omp_if.then:
6898 // CHECK11-NEXT: [[TMP3:%.*]] = load ptr, ptr [[DOTGLOBAL_TID__ADDR]], align 8
6899 // CHECK11-NEXT: [[TMP4:%.*]] = load i32, ptr [[TMP3]], align 4
6900 // 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)
6901 // CHECK11-NEXT: [[TMP5:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4
6902 // CHECK11-NEXT: [[CMP:%.*]] = icmp sgt i32 [[TMP5]], 99
6903 // CHECK11-NEXT: br i1 [[CMP]], label [[COND_TRUE:%.*]], label [[COND_FALSE:%.*]]
6904 // CHECK11: cond.true:
6905 // CHECK11-NEXT: br label [[COND_END:%.*]]
6906 // CHECK11: cond.false:
6907 // CHECK11-NEXT: [[TMP6:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4
6908 // CHECK11-NEXT: br label [[COND_END]]
6909 // CHECK11: cond.end:
6910 // CHECK11-NEXT: [[COND:%.*]] = phi i32 [ 99, [[COND_TRUE]] ], [ [[TMP6]], [[COND_FALSE]] ]
6911 // CHECK11-NEXT: store i32 [[COND]], ptr [[DOTOMP_UB]], align 4
6912 // CHECK11-NEXT: [[TMP7:%.*]] = load i32, ptr [[DOTOMP_LB]], align 4
6913 // CHECK11-NEXT: store i32 [[TMP7]], ptr [[DOTOMP_IV]], align 4
6914 // CHECK11-NEXT: br label [[OMP_INNER_FOR_COND:%.*]]
6915 // CHECK11: omp.inner.for.cond:
6916 // CHECK11-NEXT: [[TMP8:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP39:![0-9]+]]
6917 // CHECK11-NEXT: [[TMP9:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4, !llvm.access.group [[ACC_GRP39]]
6918 // CHECK11-NEXT: [[CMP2:%.*]] = icmp sle i32 [[TMP8]], [[TMP9]]
6919 // CHECK11-NEXT: br i1 [[CMP2]], label [[OMP_INNER_FOR_BODY:%.*]], label [[OMP_INNER_FOR_END:%.*]]
6920 // CHECK11: omp.inner.for.body:
6921 // CHECK11-NEXT: [[TMP10:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP39]]
6922 // CHECK11-NEXT: [[MUL:%.*]] = mul nsw i32 [[TMP10]], 1
6923 // CHECK11-NEXT: [[ADD:%.*]] = add nsw i32 0, [[MUL]]
6924 // CHECK11-NEXT: store i32 [[ADD]], ptr [[I]], align 4, !llvm.access.group [[ACC_GRP39]]
6925 // CHECK11-NEXT: call void @_Z3fn6v(), !llvm.access.group [[ACC_GRP39]]
6926 // CHECK11-NEXT: br label [[OMP_BODY_CONTINUE:%.*]]
6927 // CHECK11: omp.body.continue:
6928 // CHECK11-NEXT: br label [[OMP_INNER_FOR_INC:%.*]]
6929 // CHECK11: omp.inner.for.inc:
6930 // CHECK11-NEXT: [[TMP11:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP39]]
6931 // CHECK11-NEXT: [[ADD3:%.*]] = add nsw i32 [[TMP11]], 1
6932 // CHECK11-NEXT: store i32 [[ADD3]], ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP39]]
6933 // CHECK11-NEXT: br label [[OMP_INNER_FOR_COND]], !llvm.loop [[LOOP40:![0-9]+]]
6934 // CHECK11: omp.inner.for.end:
6935 // CHECK11-NEXT: br label [[OMP_IF_END:%.*]]
6936 // CHECK11: omp_if.else:
6937 // CHECK11-NEXT: [[TMP12:%.*]] = load ptr, ptr [[DOTGLOBAL_TID__ADDR]], align 8
6938 // CHECK11-NEXT: [[TMP13:%.*]] = load i32, ptr [[TMP12]], align 4
6939 // 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)
6940 // CHECK11-NEXT: [[TMP14:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4
6941 // CHECK11-NEXT: [[CMP4:%.*]] = icmp sgt i32 [[TMP14]], 99
6942 // CHECK11-NEXT: br i1 [[CMP4]], label [[COND_TRUE5:%.*]], label [[COND_FALSE6:%.*]]
6943 // CHECK11: cond.true5:
6944 // CHECK11-NEXT: br label [[COND_END7:%.*]]
6945 // CHECK11: cond.false6:
6946 // CHECK11-NEXT: [[TMP15:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4
6947 // CHECK11-NEXT: br label [[COND_END7]]
6948 // CHECK11: cond.end7:
6949 // CHECK11-NEXT: [[COND8:%.*]] = phi i32 [ 99, [[COND_TRUE5]] ], [ [[TMP15]], [[COND_FALSE6]] ]
6950 // CHECK11-NEXT: store i32 [[COND8]], ptr [[DOTOMP_UB]], align 4
6951 // CHECK11-NEXT: [[TMP16:%.*]] = load i32, ptr [[DOTOMP_LB]], align 4
6952 // CHECK11-NEXT: store i32 [[TMP16]], ptr [[DOTOMP_IV]], align 4
6953 // CHECK11-NEXT: br label [[OMP_INNER_FOR_COND9:%.*]]
6954 // CHECK11: omp.inner.for.cond9:
6955 // CHECK11-NEXT: [[TMP17:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4
6956 // CHECK11-NEXT: [[TMP18:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4
6957 // CHECK11-NEXT: [[CMP10:%.*]] = icmp sle i32 [[TMP17]], [[TMP18]]
6958 // CHECK11-NEXT: br i1 [[CMP10]], label [[OMP_INNER_FOR_BODY11:%.*]], label [[OMP_INNER_FOR_END17:%.*]]
6959 // CHECK11: omp.inner.for.body11:
6960 // CHECK11-NEXT: [[TMP19:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4
6961 // CHECK11-NEXT: [[MUL12:%.*]] = mul nsw i32 [[TMP19]], 1
6962 // CHECK11-NEXT: [[ADD13:%.*]] = add nsw i32 0, [[MUL12]]
6963 // CHECK11-NEXT: store i32 [[ADD13]], ptr [[I]], align 4
6964 // CHECK11-NEXT: call void @_Z3fn6v()
6965 // CHECK11-NEXT: br label [[OMP_BODY_CONTINUE14:%.*]]
6966 // CHECK11: omp.body.continue14:
6967 // CHECK11-NEXT: br label [[OMP_INNER_FOR_INC15:%.*]]
6968 // CHECK11: omp.inner.for.inc15:
6969 // CHECK11-NEXT: [[TMP20:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4
6970 // CHECK11-NEXT: [[ADD16:%.*]] = add nsw i32 [[TMP20]], 1
6971 // CHECK11-NEXT: store i32 [[ADD16]], ptr [[DOTOMP_IV]], align 4
6972 // CHECK11-NEXT: br label [[OMP_INNER_FOR_COND9]], !llvm.loop [[LOOP42:![0-9]+]]
6973 // CHECK11: omp.inner.for.end17:
6974 // CHECK11-NEXT: br label [[OMP_IF_END]]
6975 // CHECK11: omp_if.end:
6976 // CHECK11-NEXT: br label [[OMP_LOOP_EXIT:%.*]]
6977 // CHECK11: omp.loop.exit:
6978 // CHECK11-NEXT: [[TMP21:%.*]] = load ptr, ptr [[DOTGLOBAL_TID__ADDR]], align 8
6979 // CHECK11-NEXT: [[TMP22:%.*]] = load i32, ptr [[TMP21]], align 4
6980 // CHECK11-NEXT: call void @__kmpc_for_static_fini(ptr @[[GLOB1]], i32 [[TMP22]])
6981 // CHECK11-NEXT: [[TMP23:%.*]] = load i32, ptr [[DOTOMP_IS_LAST]], align 4
6982 // CHECK11-NEXT: [[TMP24:%.*]] = icmp ne i32 [[TMP23]], 0
6983 // CHECK11-NEXT: br i1 [[TMP24]], label [[DOTOMP_FINAL_THEN:%.*]], label [[DOTOMP_FINAL_DONE:%.*]]
6984 // CHECK11: .omp.final.then:
6985 // CHECK11-NEXT: store i32 100, ptr [[I]], align 4
6986 // CHECK11-NEXT: br label [[DOTOMP_FINAL_DONE]]
6987 // CHECK11: .omp.final.done:
6988 // CHECK11-NEXT: ret void
6991 // CHECK11-LABEL: define {{[^@]+}}@{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}_main_l92.omp_outlined.omp_outlined.1
6992 // CHECK11-SAME: (ptr noalias noundef [[DOTGLOBAL_TID_:%.*]], ptr noalias noundef [[DOTBOUND_TID_:%.*]], i64 noundef [[DOTPREVIOUS_LB_:%.*]], i64 noundef [[DOTPREVIOUS_UB_:%.*]], i64 noundef [[DOTCAPTURE_EXPR_:%.*]]) #[[ATTR2]] {
6993 // CHECK11-NEXT: entry:
6994 // CHECK11-NEXT: [[DOTGLOBAL_TID__ADDR:%.*]] = alloca ptr, align 8
6995 // CHECK11-NEXT: [[DOTBOUND_TID__ADDR:%.*]] = alloca ptr, align 8
6996 // CHECK11-NEXT: [[DOTPREVIOUS_LB__ADDR:%.*]] = alloca i64, align 8
6997 // CHECK11-NEXT: [[DOTPREVIOUS_UB__ADDR:%.*]] = alloca i64, align 8
6998 // CHECK11-NEXT: [[DOTCAPTURE_EXPR__ADDR:%.*]] = alloca i64, align 8
6999 // CHECK11-NEXT: [[DOTOMP_IV:%.*]] = alloca i32, align 4
7000 // CHECK11-NEXT: [[TMP:%.*]] = alloca i32, align 4
7001 // CHECK11-NEXT: [[DOTOMP_LB:%.*]] = alloca i32, align 4
7002 // CHECK11-NEXT: [[DOTOMP_UB:%.*]] = alloca i32, align 4
7003 // CHECK11-NEXT: [[DOTOMP_STRIDE:%.*]] = alloca i32, align 4
7004 // CHECK11-NEXT: [[DOTOMP_IS_LAST:%.*]] = alloca i32, align 4
7005 // CHECK11-NEXT: [[I:%.*]] = alloca i32, align 4
7006 // CHECK11-NEXT: store ptr [[DOTGLOBAL_TID_]], ptr [[DOTGLOBAL_TID__ADDR]], align 8
7007 // CHECK11-NEXT: store ptr [[DOTBOUND_TID_]], ptr [[DOTBOUND_TID__ADDR]], align 8
7008 // CHECK11-NEXT: store i64 [[DOTPREVIOUS_LB_]], ptr [[DOTPREVIOUS_LB__ADDR]], align 8
7009 // CHECK11-NEXT: store i64 [[DOTPREVIOUS_UB_]], ptr [[DOTPREVIOUS_UB__ADDR]], align 8
7010 // CHECK11-NEXT: store i64 [[DOTCAPTURE_EXPR_]], ptr [[DOTCAPTURE_EXPR__ADDR]], align 8
7011 // CHECK11-NEXT: store i32 0, ptr [[DOTOMP_LB]], align 4
7012 // CHECK11-NEXT: store i32 99, ptr [[DOTOMP_UB]], align 4
7013 // CHECK11-NEXT: [[TMP0:%.*]] = load i64, ptr [[DOTPREVIOUS_LB__ADDR]], align 8
7014 // CHECK11-NEXT: [[CONV:%.*]] = trunc i64 [[TMP0]] to i32
7015 // CHECK11-NEXT: [[TMP1:%.*]] = load i64, ptr [[DOTPREVIOUS_UB__ADDR]], align 8
7016 // CHECK11-NEXT: [[CONV1:%.*]] = trunc i64 [[TMP1]] to i32
7017 // CHECK11-NEXT: store i32 [[CONV]], ptr [[DOTOMP_LB]], align 4
7018 // CHECK11-NEXT: store i32 [[CONV1]], ptr [[DOTOMP_UB]], align 4
7019 // CHECK11-NEXT: store i32 1, ptr [[DOTOMP_STRIDE]], align 4
7020 // CHECK11-NEXT: store i32 0, ptr [[DOTOMP_IS_LAST]], align 4
7021 // CHECK11-NEXT: [[TMP2:%.*]] = load i8, ptr [[DOTCAPTURE_EXPR__ADDR]], align 1
7022 // CHECK11-NEXT: [[TOBOOL:%.*]] = trunc i8 [[TMP2]] to i1
7023 // CHECK11-NEXT: br i1 [[TOBOOL]], label [[OMP_IF_THEN:%.*]], label [[OMP_IF_ELSE:%.*]]
7024 // CHECK11: omp_if.then:
7025 // CHECK11-NEXT: [[TMP3:%.*]] = load ptr, ptr [[DOTGLOBAL_TID__ADDR]], align 8
7026 // CHECK11-NEXT: [[TMP4:%.*]] = load i32, ptr [[TMP3]], align 4
7027 // 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)
7028 // CHECK11-NEXT: [[TMP5:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4
7029 // CHECK11-NEXT: [[CMP:%.*]] = icmp sgt i32 [[TMP5]], 99
7030 // CHECK11-NEXT: br i1 [[CMP]], label [[COND_TRUE:%.*]], label [[COND_FALSE:%.*]]
7031 // CHECK11: cond.true:
7032 // CHECK11-NEXT: br label [[COND_END:%.*]]
7033 // CHECK11: cond.false:
7034 // CHECK11-NEXT: [[TMP6:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4
7035 // CHECK11-NEXT: br label [[COND_END]]
7036 // CHECK11: cond.end:
7037 // CHECK11-NEXT: [[COND:%.*]] = phi i32 [ 99, [[COND_TRUE]] ], [ [[TMP6]], [[COND_FALSE]] ]
7038 // CHECK11-NEXT: store i32 [[COND]], ptr [[DOTOMP_UB]], align 4
7039 // CHECK11-NEXT: [[TMP7:%.*]] = load i32, ptr [[DOTOMP_LB]], align 4
7040 // CHECK11-NEXT: store i32 [[TMP7]], ptr [[DOTOMP_IV]], align 4
7041 // CHECK11-NEXT: br label [[OMP_INNER_FOR_COND:%.*]]
7042 // CHECK11: omp.inner.for.cond:
7043 // CHECK11-NEXT: [[TMP8:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP43:![0-9]+]]
7044 // CHECK11-NEXT: [[TMP9:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4, !llvm.access.group [[ACC_GRP43]]
7045 // CHECK11-NEXT: [[CMP2:%.*]] = icmp sle i32 [[TMP8]], [[TMP9]]
7046 // CHECK11-NEXT: br i1 [[CMP2]], label [[OMP_INNER_FOR_BODY:%.*]], label [[OMP_INNER_FOR_END:%.*]]
7047 // CHECK11: omp.inner.for.body:
7048 // CHECK11-NEXT: [[TMP10:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP43]]
7049 // CHECK11-NEXT: [[MUL:%.*]] = mul nsw i32 [[TMP10]], 1
7050 // CHECK11-NEXT: [[ADD:%.*]] = add nsw i32 0, [[MUL]]
7051 // CHECK11-NEXT: store i32 [[ADD]], ptr [[I]], align 4, !llvm.access.group [[ACC_GRP43]]
7052 // CHECK11-NEXT: call void @_Z3fn6v(), !llvm.access.group [[ACC_GRP43]]
7053 // CHECK11-NEXT: br label [[OMP_BODY_CONTINUE:%.*]]
7054 // CHECK11: omp.body.continue:
7055 // CHECK11-NEXT: br label [[OMP_INNER_FOR_INC:%.*]]
7056 // CHECK11: omp.inner.for.inc:
7057 // CHECK11-NEXT: [[TMP11:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP43]]
7058 // CHECK11-NEXT: [[ADD3:%.*]] = add nsw i32 [[TMP11]], 1
7059 // CHECK11-NEXT: store i32 [[ADD3]], ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP43]]
7060 // CHECK11-NEXT: br label [[OMP_INNER_FOR_COND]], !llvm.loop [[LOOP44:![0-9]+]]
7061 // CHECK11: omp.inner.for.end:
7062 // CHECK11-NEXT: br label [[OMP_IF_END:%.*]]
7063 // CHECK11: omp_if.else:
7064 // CHECK11-NEXT: [[TMP12:%.*]] = load ptr, ptr [[DOTGLOBAL_TID__ADDR]], align 8
7065 // CHECK11-NEXT: [[TMP13:%.*]] = load i32, ptr [[TMP12]], align 4
7066 // 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)
7067 // CHECK11-NEXT: [[TMP14:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4
7068 // CHECK11-NEXT: [[CMP4:%.*]] = icmp sgt i32 [[TMP14]], 99
7069 // CHECK11-NEXT: br i1 [[CMP4]], label [[COND_TRUE5:%.*]], label [[COND_FALSE6:%.*]]
7070 // CHECK11: cond.true5:
7071 // CHECK11-NEXT: br label [[COND_END7:%.*]]
7072 // CHECK11: cond.false6:
7073 // CHECK11-NEXT: [[TMP15:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4
7074 // CHECK11-NEXT: br label [[COND_END7]]
7075 // CHECK11: cond.end7:
7076 // CHECK11-NEXT: [[COND8:%.*]] = phi i32 [ 99, [[COND_TRUE5]] ], [ [[TMP15]], [[COND_FALSE6]] ]
7077 // CHECK11-NEXT: store i32 [[COND8]], ptr [[DOTOMP_UB]], align 4
7078 // CHECK11-NEXT: [[TMP16:%.*]] = load i32, ptr [[DOTOMP_LB]], align 4
7079 // CHECK11-NEXT: store i32 [[TMP16]], ptr [[DOTOMP_IV]], align 4
7080 // CHECK11-NEXT: br label [[OMP_INNER_FOR_COND9:%.*]]
7081 // CHECK11: omp.inner.for.cond9:
7082 // CHECK11-NEXT: [[TMP17:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4
7083 // CHECK11-NEXT: [[TMP18:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4
7084 // CHECK11-NEXT: [[CMP10:%.*]] = icmp sle i32 [[TMP17]], [[TMP18]]
7085 // CHECK11-NEXT: br i1 [[CMP10]], label [[OMP_INNER_FOR_BODY11:%.*]], label [[OMP_INNER_FOR_END17:%.*]]
7086 // CHECK11: omp.inner.for.body11:
7087 // CHECK11-NEXT: [[TMP19:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4
7088 // CHECK11-NEXT: [[MUL12:%.*]] = mul nsw i32 [[TMP19]], 1
7089 // CHECK11-NEXT: [[ADD13:%.*]] = add nsw i32 0, [[MUL12]]
7090 // CHECK11-NEXT: store i32 [[ADD13]], ptr [[I]], align 4
7091 // CHECK11-NEXT: call void @_Z3fn6v()
7092 // CHECK11-NEXT: br label [[OMP_BODY_CONTINUE14:%.*]]
7093 // CHECK11: omp.body.continue14:
7094 // CHECK11-NEXT: br label [[OMP_INNER_FOR_INC15:%.*]]
7095 // CHECK11: omp.inner.for.inc15:
7096 // CHECK11-NEXT: [[TMP20:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4
7097 // CHECK11-NEXT: [[ADD16:%.*]] = add nsw i32 [[TMP20]], 1
7098 // CHECK11-NEXT: store i32 [[ADD16]], ptr [[DOTOMP_IV]], align 4
7099 // CHECK11-NEXT: br label [[OMP_INNER_FOR_COND9]], !llvm.loop [[LOOP46:![0-9]+]]
7100 // CHECK11: omp.inner.for.end17:
7101 // CHECK11-NEXT: br label [[OMP_IF_END]]
7102 // CHECK11: omp_if.end:
7103 // CHECK11-NEXT: br label [[OMP_LOOP_EXIT:%.*]]
7104 // CHECK11: omp.loop.exit:
7105 // CHECK11-NEXT: [[TMP21:%.*]] = load ptr, ptr [[DOTGLOBAL_TID__ADDR]], align 8
7106 // CHECK11-NEXT: [[TMP22:%.*]] = load i32, ptr [[TMP21]], align 4
7107 // CHECK11-NEXT: call void @__kmpc_for_static_fini(ptr @[[GLOB1]], i32 [[TMP22]])
7108 // CHECK11-NEXT: [[TMP23:%.*]] = load i32, ptr [[DOTOMP_IS_LAST]], align 4
7109 // CHECK11-NEXT: [[TMP24:%.*]] = icmp ne i32 [[TMP23]], 0
7110 // CHECK11-NEXT: br i1 [[TMP24]], label [[DOTOMP_FINAL_THEN:%.*]], label [[DOTOMP_FINAL_DONE:%.*]]
7111 // CHECK11: .omp.final.then:
7112 // CHECK11-NEXT: store i32 100, ptr [[I]], align 4
7113 // CHECK11-NEXT: br label [[DOTOMP_FINAL_DONE]]
7114 // CHECK11: .omp.final.done:
7115 // CHECK11-NEXT: ret void
7118 // CHECK11-LABEL: define {{[^@]+}}@_Z5tmainIiEiT_
7119 // CHECK11-SAME: (i32 noundef [[ARG:%.*]]) #[[ATTR0]] comdat {
7120 // CHECK11-NEXT: entry:
7121 // CHECK11-NEXT: [[ARG_ADDR:%.*]] = alloca i32, align 4
7122 // CHECK11-NEXT: [[TMP:%.*]] = alloca i32, align 4
7123 // CHECK11-NEXT: [[KERNEL_ARGS:%.*]] = alloca [[STRUCT___TGT_KERNEL_ARGUMENTS:%.*]], align 8
7124 // CHECK11-NEXT: [[_TMP1:%.*]] = alloca i32, align 4
7125 // CHECK11-NEXT: [[KERNEL_ARGS2:%.*]] = alloca [[STRUCT___TGT_KERNEL_ARGUMENTS]], align 8
7126 // CHECK11-NEXT: [[ARG_CASTED:%.*]] = alloca i64, align 8
7127 // CHECK11-NEXT: [[DOTOFFLOAD_BASEPTRS:%.*]] = alloca [1 x ptr], align 8
7128 // CHECK11-NEXT: [[DOTOFFLOAD_PTRS:%.*]] = alloca [1 x ptr], align 8
7129 // CHECK11-NEXT: [[DOTOFFLOAD_MAPPERS:%.*]] = alloca [1 x ptr], align 8
7130 // CHECK11-NEXT: [[DOTCAPTURE_EXPR_:%.*]] = alloca i8, align 1
7131 // CHECK11-NEXT: [[_TMP6:%.*]] = alloca i32, align 4
7132 // CHECK11-NEXT: [[KERNEL_ARGS7:%.*]] = alloca [[STRUCT___TGT_KERNEL_ARGUMENTS]], align 8
7133 // CHECK11-NEXT: store i32 [[ARG]], ptr [[ARG_ADDR]], align 4
7134 // CHECK11-NEXT: [[TMP0:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 0
7135 // CHECK11-NEXT: store i32 2, ptr [[TMP0]], align 4
7136 // CHECK11-NEXT: [[TMP1:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 1
7137 // CHECK11-NEXT: store i32 0, ptr [[TMP1]], align 4
7138 // CHECK11-NEXT: [[TMP2:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 2
7139 // CHECK11-NEXT: store ptr null, ptr [[TMP2]], align 8
7140 // CHECK11-NEXT: [[TMP3:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 3
7141 // CHECK11-NEXT: store ptr null, ptr [[TMP3]], align 8
7142 // CHECK11-NEXT: [[TMP4:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 4
7143 // CHECK11-NEXT: store ptr null, ptr [[TMP4]], align 8
7144 // CHECK11-NEXT: [[TMP5:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 5
7145 // CHECK11-NEXT: store ptr null, ptr [[TMP5]], align 8
7146 // CHECK11-NEXT: [[TMP6:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 6
7147 // CHECK11-NEXT: store ptr null, ptr [[TMP6]], align 8
7148 // CHECK11-NEXT: [[TMP7:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 7
7149 // CHECK11-NEXT: store ptr null, ptr [[TMP7]], align 8
7150 // CHECK11-NEXT: [[TMP8:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 8
7151 // CHECK11-NEXT: store i64 100, ptr [[TMP8]], align 8
7152 // CHECK11-NEXT: [[TMP9:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 9
7153 // CHECK11-NEXT: store i64 0, ptr [[TMP9]], align 8
7154 // CHECK11-NEXT: [[TMP10:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 10
7155 // CHECK11-NEXT: store [3 x i32] zeroinitializer, ptr [[TMP10]], align 4
7156 // CHECK11-NEXT: [[TMP11:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 11
7157 // CHECK11-NEXT: store [3 x i32] zeroinitializer, ptr [[TMP11]], align 4
7158 // CHECK11-NEXT: [[TMP12:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 12
7159 // CHECK11-NEXT: store i32 0, ptr [[TMP12]], align 4
7160 // 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__l57.region_id, ptr [[KERNEL_ARGS]])
7161 // CHECK11-NEXT: [[TMP14:%.*]] = icmp ne i32 [[TMP13]], 0
7162 // CHECK11-NEXT: br i1 [[TMP14]], label [[OMP_OFFLOAD_FAILED:%.*]], label [[OMP_OFFLOAD_CONT:%.*]]
7163 // CHECK11: omp_offload.failed:
7164 // CHECK11-NEXT: call void @{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z5tmainIiEiT__l57() #[[ATTR3]]
7165 // CHECK11-NEXT: br label [[OMP_OFFLOAD_CONT]]
7166 // CHECK11: omp_offload.cont:
7167 // CHECK11-NEXT: [[TMP15:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS2]], i32 0, i32 0
7168 // CHECK11-NEXT: store i32 2, ptr [[TMP15]], align 4
7169 // CHECK11-NEXT: [[TMP16:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS2]], i32 0, i32 1
7170 // CHECK11-NEXT: store i32 0, ptr [[TMP16]], align 4
7171 // CHECK11-NEXT: [[TMP17:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS2]], i32 0, i32 2
7172 // CHECK11-NEXT: store ptr null, ptr [[TMP17]], align 8
7173 // CHECK11-NEXT: [[TMP18:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS2]], i32 0, i32 3
7174 // CHECK11-NEXT: store ptr null, ptr [[TMP18]], align 8
7175 // CHECK11-NEXT: [[TMP19:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS2]], i32 0, i32 4
7176 // CHECK11-NEXT: store ptr null, ptr [[TMP19]], align 8
7177 // CHECK11-NEXT: [[TMP20:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS2]], i32 0, i32 5
7178 // CHECK11-NEXT: store ptr null, ptr [[TMP20]], align 8
7179 // CHECK11-NEXT: [[TMP21:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS2]], i32 0, i32 6
7180 // CHECK11-NEXT: store ptr null, ptr [[TMP21]], align 8
7181 // CHECK11-NEXT: [[TMP22:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS2]], i32 0, i32 7
7182 // CHECK11-NEXT: store ptr null, ptr [[TMP22]], align 8
7183 // CHECK11-NEXT: [[TMP23:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS2]], i32 0, i32 8
7184 // CHECK11-NEXT: store i64 100, ptr [[TMP23]], align 8
7185 // CHECK11-NEXT: [[TMP24:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS2]], i32 0, i32 9
7186 // CHECK11-NEXT: store i64 0, ptr [[TMP24]], align 8
7187 // CHECK11-NEXT: [[TMP25:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS2]], i32 0, i32 10
7188 // CHECK11-NEXT: store [3 x i32] zeroinitializer, ptr [[TMP25]], align 4
7189 // CHECK11-NEXT: [[TMP26:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS2]], i32 0, i32 11
7190 // CHECK11-NEXT: store [3 x i32] [i32 1, i32 0, i32 0], ptr [[TMP26]], align 4
7191 // CHECK11-NEXT: [[TMP27:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS2]], i32 0, i32 12
7192 // CHECK11-NEXT: store i32 0, ptr [[TMP27]], align 4
7193 // CHECK11-NEXT: [[TMP28:%.*]] = call i32 @__tgt_target_kernel(ptr @[[GLOB3]], i64 -1, i32 0, i32 1, ptr @.{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z5tmainIiEiT__l62.region_id, ptr [[KERNEL_ARGS2]])
7194 // CHECK11-NEXT: [[TMP29:%.*]] = icmp ne i32 [[TMP28]], 0
7195 // CHECK11-NEXT: br i1 [[TMP29]], label [[OMP_OFFLOAD_FAILED3:%.*]], label [[OMP_OFFLOAD_CONT4:%.*]]
7196 // CHECK11: omp_offload.failed3:
7197 // CHECK11-NEXT: call void @{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z5tmainIiEiT__l62() #[[ATTR3]]
7198 // CHECK11-NEXT: br label [[OMP_OFFLOAD_CONT4]]
7199 // CHECK11: omp_offload.cont4:
7200 // CHECK11-NEXT: [[TMP30:%.*]] = load i32, ptr [[ARG_ADDR]], align 4
7201 // CHECK11-NEXT: store i32 [[TMP30]], ptr [[ARG_CASTED]], align 4
7202 // CHECK11-NEXT: [[TMP31:%.*]] = load i64, ptr [[ARG_CASTED]], align 8
7203 // CHECK11-NEXT: [[TMP32:%.*]] = getelementptr inbounds [1 x ptr], ptr [[DOTOFFLOAD_BASEPTRS]], i32 0, i32 0
7204 // CHECK11-NEXT: store i64 [[TMP31]], ptr [[TMP32]], align 8
7205 // CHECK11-NEXT: [[TMP33:%.*]] = getelementptr inbounds [1 x ptr], ptr [[DOTOFFLOAD_PTRS]], i32 0, i32 0
7206 // CHECK11-NEXT: store i64 [[TMP31]], ptr [[TMP33]], align 8
7207 // CHECK11-NEXT: [[TMP34:%.*]] = getelementptr inbounds [1 x ptr], ptr [[DOTOFFLOAD_MAPPERS]], i64 0, i64 0
7208 // CHECK11-NEXT: store ptr null, ptr [[TMP34]], align 8
7209 // CHECK11-NEXT: [[TMP35:%.*]] = getelementptr inbounds [1 x ptr], ptr [[DOTOFFLOAD_BASEPTRS]], i32 0, i32 0
7210 // CHECK11-NEXT: [[TMP36:%.*]] = getelementptr inbounds [1 x ptr], ptr [[DOTOFFLOAD_PTRS]], i32 0, i32 0
7211 // CHECK11-NEXT: [[TMP37:%.*]] = load i32, ptr [[ARG_ADDR]], align 4
7212 // CHECK11-NEXT: [[TOBOOL:%.*]] = icmp ne i32 [[TMP37]], 0
7213 // CHECK11-NEXT: [[FROMBOOL:%.*]] = zext i1 [[TOBOOL]] to i8
7214 // CHECK11-NEXT: store i8 [[FROMBOOL]], ptr [[DOTCAPTURE_EXPR_]], align 1
7215 // CHECK11-NEXT: [[TMP38:%.*]] = load i8, ptr [[DOTCAPTURE_EXPR_]], align 1
7216 // CHECK11-NEXT: [[TOBOOL5:%.*]] = trunc i8 [[TMP38]] to i1
7217 // CHECK11-NEXT: [[TMP39:%.*]] = select i1 [[TOBOOL5]], i32 0, i32 1
7218 // CHECK11-NEXT: [[TMP40:%.*]] = insertvalue [3 x i32] zeroinitializer, i32 [[TMP39]], 0
7219 // CHECK11-NEXT: [[TMP41:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS7]], i32 0, i32 0
7220 // CHECK11-NEXT: store i32 2, ptr [[TMP41]], align 4
7221 // CHECK11-NEXT: [[TMP42:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS7]], i32 0, i32 1
7222 // CHECK11-NEXT: store i32 1, ptr [[TMP42]], align 4
7223 // CHECK11-NEXT: [[TMP43:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS7]], i32 0, i32 2
7224 // CHECK11-NEXT: store ptr [[TMP35]], ptr [[TMP43]], align 8
7225 // CHECK11-NEXT: [[TMP44:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS7]], i32 0, i32 3
7226 // CHECK11-NEXT: store ptr [[TMP36]], ptr [[TMP44]], align 8
7227 // CHECK11-NEXT: [[TMP45:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS7]], i32 0, i32 4
7228 // CHECK11-NEXT: store ptr @.offload_sizes.2, ptr [[TMP45]], align 8
7229 // CHECK11-NEXT: [[TMP46:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS7]], i32 0, i32 5
7230 // CHECK11-NEXT: store ptr @.offload_maptypes.3, ptr [[TMP46]], align 8
7231 // CHECK11-NEXT: [[TMP47:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS7]], i32 0, i32 6
7232 // CHECK11-NEXT: store ptr null, ptr [[TMP47]], align 8
7233 // CHECK11-NEXT: [[TMP48:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS7]], i32 0, i32 7
7234 // CHECK11-NEXT: store ptr null, ptr [[TMP48]], align 8
7235 // CHECK11-NEXT: [[TMP49:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS7]], i32 0, i32 8
7236 // CHECK11-NEXT: store i64 100, ptr [[TMP49]], align 8
7237 // CHECK11-NEXT: [[TMP50:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS7]], i32 0, i32 9
7238 // CHECK11-NEXT: store i64 0, ptr [[TMP50]], align 8
7239 // CHECK11-NEXT: [[TMP51:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS7]], i32 0, i32 10
7240 // CHECK11-NEXT: store [3 x i32] zeroinitializer, ptr [[TMP51]], align 4
7241 // CHECK11-NEXT: [[TMP52:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS7]], i32 0, i32 11
7242 // CHECK11-NEXT: store [3 x i32] [[TMP40]], ptr [[TMP52]], align 4
7243 // CHECK11-NEXT: [[TMP53:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS7]], i32 0, i32 12
7244 // CHECK11-NEXT: store i32 0, ptr [[TMP53]], align 4
7245 // CHECK11-NEXT: [[TMP54:%.*]] = call i32 @__tgt_target_kernel(ptr @[[GLOB3]], i64 -1, i32 0, i32 [[TMP39]], ptr @.{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z5tmainIiEiT__l67.region_id, ptr [[KERNEL_ARGS7]])
7246 // CHECK11-NEXT: [[TMP55:%.*]] = icmp ne i32 [[TMP54]], 0
7247 // CHECK11-NEXT: br i1 [[TMP55]], label [[OMP_OFFLOAD_FAILED8:%.*]], label [[OMP_OFFLOAD_CONT9:%.*]]
7248 // CHECK11: omp_offload.failed8:
7249 // CHECK11-NEXT: call void @{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z5tmainIiEiT__l67(i64 [[TMP31]]) #[[ATTR3]]
7250 // CHECK11-NEXT: br label [[OMP_OFFLOAD_CONT9]]
7251 // CHECK11: omp_offload.cont9:
7252 // CHECK11-NEXT: ret i32 0
7255 // CHECK11-LABEL: define {{[^@]+}}@{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z5tmainIiEiT__l57
7256 // CHECK11-SAME: () #[[ATTR1]] {
7257 // CHECK11-NEXT: entry:
7258 // CHECK11-NEXT: call void (ptr, i32, ptr, ...) @__kmpc_fork_teams(ptr @[[GLOB3]], i32 0, ptr @{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z5tmainIiEiT__l57.omp_outlined)
7259 // CHECK11-NEXT: ret void
7262 // CHECK11-LABEL: define {{[^@]+}}@{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z5tmainIiEiT__l57.omp_outlined
7263 // CHECK11-SAME: (ptr noalias noundef [[DOTGLOBAL_TID_:%.*]], ptr noalias noundef [[DOTBOUND_TID_:%.*]]) #[[ATTR2]] {
7264 // CHECK11-NEXT: entry:
7265 // CHECK11-NEXT: [[DOTGLOBAL_TID__ADDR:%.*]] = alloca ptr, align 8
7266 // CHECK11-NEXT: [[DOTBOUND_TID__ADDR:%.*]] = alloca ptr, align 8
7267 // CHECK11-NEXT: [[DOTOMP_IV:%.*]] = alloca i32, align 4
7268 // CHECK11-NEXT: [[TMP:%.*]] = alloca i32, align 4
7269 // CHECK11-NEXT: [[DOTOMP_COMB_LB:%.*]] = alloca i32, align 4
7270 // CHECK11-NEXT: [[DOTOMP_COMB_UB:%.*]] = alloca i32, align 4
7271 // CHECK11-NEXT: [[DOTOMP_STRIDE:%.*]] = alloca i32, align 4
7272 // CHECK11-NEXT: [[DOTOMP_IS_LAST:%.*]] = alloca i32, align 4
7273 // CHECK11-NEXT: [[I:%.*]] = alloca i32, align 4
7274 // CHECK11-NEXT: store ptr [[DOTGLOBAL_TID_]], ptr [[DOTGLOBAL_TID__ADDR]], align 8
7275 // CHECK11-NEXT: store ptr [[DOTBOUND_TID_]], ptr [[DOTBOUND_TID__ADDR]], align 8
7276 // CHECK11-NEXT: store i32 0, ptr [[DOTOMP_COMB_LB]], align 4
7277 // CHECK11-NEXT: store i32 99, ptr [[DOTOMP_COMB_UB]], align 4
7278 // CHECK11-NEXT: store i32 1, ptr [[DOTOMP_STRIDE]], align 4
7279 // CHECK11-NEXT: store i32 0, ptr [[DOTOMP_IS_LAST]], align 4
7280 // CHECK11-NEXT: [[TMP0:%.*]] = load ptr, ptr [[DOTGLOBAL_TID__ADDR]], align 8
7281 // CHECK11-NEXT: [[TMP1:%.*]] = load i32, ptr [[TMP0]], align 4
7282 // 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)
7283 // CHECK11-NEXT: [[TMP2:%.*]] = load i32, ptr [[DOTOMP_COMB_UB]], align 4
7284 // CHECK11-NEXT: [[CMP:%.*]] = icmp sgt i32 [[TMP2]], 99
7285 // CHECK11-NEXT: br i1 [[CMP]], label [[COND_TRUE:%.*]], label [[COND_FALSE:%.*]]
7286 // CHECK11: cond.true:
7287 // CHECK11-NEXT: br label [[COND_END:%.*]]
7288 // CHECK11: cond.false:
7289 // CHECK11-NEXT: [[TMP3:%.*]] = load i32, ptr [[DOTOMP_COMB_UB]], align 4
7290 // CHECK11-NEXT: br label [[COND_END]]
7291 // CHECK11: cond.end:
7292 // CHECK11-NEXT: [[COND:%.*]] = phi i32 [ 99, [[COND_TRUE]] ], [ [[TMP3]], [[COND_FALSE]] ]
7293 // CHECK11-NEXT: store i32 [[COND]], ptr [[DOTOMP_COMB_UB]], align 4
7294 // CHECK11-NEXT: [[TMP4:%.*]] = load i32, ptr [[DOTOMP_COMB_LB]], align 4
7295 // CHECK11-NEXT: store i32 [[TMP4]], ptr [[DOTOMP_IV]], align 4
7296 // CHECK11-NEXT: br label [[OMP_INNER_FOR_COND:%.*]]
7297 // CHECK11: omp.inner.for.cond:
7298 // CHECK11-NEXT: [[TMP5:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP47:![0-9]+]]
7299 // CHECK11-NEXT: [[TMP6:%.*]] = load i32, ptr [[DOTOMP_COMB_UB]], align 4, !llvm.access.group [[ACC_GRP47]]
7300 // CHECK11-NEXT: [[CMP1:%.*]] = icmp sle i32 [[TMP5]], [[TMP6]]
7301 // CHECK11-NEXT: br i1 [[CMP1]], label [[OMP_INNER_FOR_BODY:%.*]], label [[OMP_INNER_FOR_END:%.*]]
7302 // CHECK11: omp.inner.for.body:
7303 // CHECK11-NEXT: [[TMP7:%.*]] = load i32, ptr [[DOTOMP_COMB_LB]], align 4, !llvm.access.group [[ACC_GRP47]]
7304 // CHECK11-NEXT: [[TMP8:%.*]] = zext i32 [[TMP7]] to i64
7305 // CHECK11-NEXT: [[TMP9:%.*]] = load i32, ptr [[DOTOMP_COMB_UB]], align 4, !llvm.access.group [[ACC_GRP47]]
7306 // CHECK11-NEXT: [[TMP10:%.*]] = zext i32 [[TMP9]] to i64
7307 // CHECK11-NEXT: call void (ptr, i32, ptr, ...) @__kmpc_fork_call(ptr @[[GLOB3]], i32 2, ptr @{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z5tmainIiEiT__l57.omp_outlined.omp_outlined, i64 [[TMP8]], i64 [[TMP10]]), !llvm.access.group [[ACC_GRP47]]
7308 // CHECK11-NEXT: br label [[OMP_INNER_FOR_INC:%.*]]
7309 // CHECK11: omp.inner.for.inc:
7310 // CHECK11-NEXT: [[TMP11:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP47]]
7311 // CHECK11-NEXT: [[TMP12:%.*]] = load i32, ptr [[DOTOMP_STRIDE]], align 4, !llvm.access.group [[ACC_GRP47]]
7312 // CHECK11-NEXT: [[ADD:%.*]] = add nsw i32 [[TMP11]], [[TMP12]]
7313 // CHECK11-NEXT: store i32 [[ADD]], ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP47]]
7314 // CHECK11-NEXT: br label [[OMP_INNER_FOR_COND]], !llvm.loop [[LOOP48:![0-9]+]]
7315 // CHECK11: omp.inner.for.end:
7316 // CHECK11-NEXT: br label [[OMP_LOOP_EXIT:%.*]]
7317 // CHECK11: omp.loop.exit:
7318 // CHECK11-NEXT: call void @__kmpc_for_static_fini(ptr @[[GLOB1]], i32 [[TMP1]])
7319 // CHECK11-NEXT: [[TMP13:%.*]] = load i32, ptr [[DOTOMP_IS_LAST]], align 4
7320 // CHECK11-NEXT: [[TMP14:%.*]] = icmp ne i32 [[TMP13]], 0
7321 // CHECK11-NEXT: br i1 [[TMP14]], label [[DOTOMP_FINAL_THEN:%.*]], label [[DOTOMP_FINAL_DONE:%.*]]
7322 // CHECK11: .omp.final.then:
7323 // CHECK11-NEXT: store i32 100, ptr [[I]], align 4
7324 // CHECK11-NEXT: br label [[DOTOMP_FINAL_DONE]]
7325 // CHECK11: .omp.final.done:
7326 // CHECK11-NEXT: ret void
7329 // CHECK11-LABEL: define {{[^@]+}}@{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z5tmainIiEiT__l57.omp_outlined.omp_outlined
7330 // CHECK11-SAME: (ptr noalias noundef [[DOTGLOBAL_TID_:%.*]], ptr noalias noundef [[DOTBOUND_TID_:%.*]], i64 noundef [[DOTPREVIOUS_LB_:%.*]], i64 noundef [[DOTPREVIOUS_UB_:%.*]]) #[[ATTR2]] {
7331 // CHECK11-NEXT: entry:
7332 // CHECK11-NEXT: [[DOTGLOBAL_TID__ADDR:%.*]] = alloca ptr, align 8
7333 // CHECK11-NEXT: [[DOTBOUND_TID__ADDR:%.*]] = alloca ptr, align 8
7334 // CHECK11-NEXT: [[DOTPREVIOUS_LB__ADDR:%.*]] = alloca i64, align 8
7335 // CHECK11-NEXT: [[DOTPREVIOUS_UB__ADDR:%.*]] = alloca i64, align 8
7336 // CHECK11-NEXT: [[DOTOMP_IV:%.*]] = alloca i32, align 4
7337 // CHECK11-NEXT: [[TMP:%.*]] = alloca i32, align 4
7338 // CHECK11-NEXT: [[DOTOMP_LB:%.*]] = alloca i32, align 4
7339 // CHECK11-NEXT: [[DOTOMP_UB:%.*]] = alloca i32, align 4
7340 // CHECK11-NEXT: [[DOTOMP_STRIDE:%.*]] = alloca i32, align 4
7341 // CHECK11-NEXT: [[DOTOMP_IS_LAST:%.*]] = alloca i32, align 4
7342 // CHECK11-NEXT: [[I:%.*]] = alloca i32, align 4
7343 // CHECK11-NEXT: store ptr [[DOTGLOBAL_TID_]], ptr [[DOTGLOBAL_TID__ADDR]], align 8
7344 // CHECK11-NEXT: store ptr [[DOTBOUND_TID_]], ptr [[DOTBOUND_TID__ADDR]], align 8
7345 // CHECK11-NEXT: store i64 [[DOTPREVIOUS_LB_]], ptr [[DOTPREVIOUS_LB__ADDR]], align 8
7346 // CHECK11-NEXT: store i64 [[DOTPREVIOUS_UB_]], ptr [[DOTPREVIOUS_UB__ADDR]], align 8
7347 // CHECK11-NEXT: store i32 0, ptr [[DOTOMP_LB]], align 4
7348 // CHECK11-NEXT: store i32 99, ptr [[DOTOMP_UB]], align 4
7349 // CHECK11-NEXT: [[TMP0:%.*]] = load i64, ptr [[DOTPREVIOUS_LB__ADDR]], align 8
7350 // CHECK11-NEXT: [[CONV:%.*]] = trunc i64 [[TMP0]] to i32
7351 // CHECK11-NEXT: [[TMP1:%.*]] = load i64, ptr [[DOTPREVIOUS_UB__ADDR]], align 8
7352 // CHECK11-NEXT: [[CONV1:%.*]] = trunc i64 [[TMP1]] to i32
7353 // CHECK11-NEXT: store i32 [[CONV]], ptr [[DOTOMP_LB]], align 4
7354 // CHECK11-NEXT: store i32 [[CONV1]], ptr [[DOTOMP_UB]], align 4
7355 // CHECK11-NEXT: store i32 1, ptr [[DOTOMP_STRIDE]], align 4
7356 // CHECK11-NEXT: store i32 0, ptr [[DOTOMP_IS_LAST]], align 4
7357 // CHECK11-NEXT: [[TMP2:%.*]] = load ptr, ptr [[DOTGLOBAL_TID__ADDR]], align 8
7358 // CHECK11-NEXT: [[TMP3:%.*]] = load i32, ptr [[TMP2]], align 4
7359 // 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)
7360 // CHECK11-NEXT: [[TMP4:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4
7361 // CHECK11-NEXT: [[CMP:%.*]] = icmp sgt i32 [[TMP4]], 99
7362 // CHECK11-NEXT: br i1 [[CMP]], label [[COND_TRUE:%.*]], label [[COND_FALSE:%.*]]
7363 // CHECK11: cond.true:
7364 // CHECK11-NEXT: br label [[COND_END:%.*]]
7365 // CHECK11: cond.false:
7366 // CHECK11-NEXT: [[TMP5:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4
7367 // CHECK11-NEXT: br label [[COND_END]]
7368 // CHECK11: cond.end:
7369 // CHECK11-NEXT: [[COND:%.*]] = phi i32 [ 99, [[COND_TRUE]] ], [ [[TMP5]], [[COND_FALSE]] ]
7370 // CHECK11-NEXT: store i32 [[COND]], ptr [[DOTOMP_UB]], align 4
7371 // CHECK11-NEXT: [[TMP6:%.*]] = load i32, ptr [[DOTOMP_LB]], align 4
7372 // CHECK11-NEXT: store i32 [[TMP6]], ptr [[DOTOMP_IV]], align 4
7373 // CHECK11-NEXT: br label [[OMP_INNER_FOR_COND:%.*]]
7374 // CHECK11: omp.inner.for.cond:
7375 // CHECK11-NEXT: [[TMP7:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP50:![0-9]+]]
7376 // CHECK11-NEXT: [[TMP8:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4, !llvm.access.group [[ACC_GRP50]]
7377 // CHECK11-NEXT: [[CMP2:%.*]] = icmp sle i32 [[TMP7]], [[TMP8]]
7378 // CHECK11-NEXT: br i1 [[CMP2]], label [[OMP_INNER_FOR_BODY:%.*]], label [[OMP_INNER_FOR_END:%.*]]
7379 // CHECK11: omp.inner.for.body:
7380 // CHECK11-NEXT: [[TMP9:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP50]]
7381 // CHECK11-NEXT: [[MUL:%.*]] = mul nsw i32 [[TMP9]], 1
7382 // CHECK11-NEXT: [[ADD:%.*]] = add nsw i32 0, [[MUL]]
7383 // CHECK11-NEXT: store i32 [[ADD]], ptr [[I]], align 4, !llvm.access.group [[ACC_GRP50]]
7384 // CHECK11-NEXT: call void @_Z3fn1v(), !llvm.access.group [[ACC_GRP50]]
7385 // CHECK11-NEXT: br label [[OMP_BODY_CONTINUE:%.*]]
7386 // CHECK11: omp.body.continue:
7387 // CHECK11-NEXT: br label [[OMP_INNER_FOR_INC:%.*]]
7388 // CHECK11: omp.inner.for.inc:
7389 // CHECK11-NEXT: [[TMP10:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP50]]
7390 // CHECK11-NEXT: [[ADD3:%.*]] = add nsw i32 [[TMP10]], 1
7391 // CHECK11-NEXT: store i32 [[ADD3]], ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP50]]
7392 // CHECK11-NEXT: br label [[OMP_INNER_FOR_COND]], !llvm.loop [[LOOP51:![0-9]+]]
7393 // CHECK11: omp.inner.for.end:
7394 // CHECK11-NEXT: br label [[OMP_LOOP_EXIT:%.*]]
7395 // CHECK11: omp.loop.exit:
7396 // CHECK11-NEXT: call void @__kmpc_for_static_fini(ptr @[[GLOB1]], i32 [[TMP3]])
7397 // CHECK11-NEXT: [[TMP11:%.*]] = load i32, ptr [[DOTOMP_IS_LAST]], align 4
7398 // CHECK11-NEXT: [[TMP12:%.*]] = icmp ne i32 [[TMP11]], 0
7399 // CHECK11-NEXT: br i1 [[TMP12]], label [[DOTOMP_FINAL_THEN:%.*]], label [[DOTOMP_FINAL_DONE:%.*]]
7400 // CHECK11: .omp.final.then:
7401 // CHECK11-NEXT: store i32 100, ptr [[I]], align 4
7402 // CHECK11-NEXT: br label [[DOTOMP_FINAL_DONE]]
7403 // CHECK11: .omp.final.done:
7404 // CHECK11-NEXT: ret void
7407 // CHECK11-LABEL: define {{[^@]+}}@{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z5tmainIiEiT__l62
7408 // CHECK11-SAME: () #[[ATTR1]] {
7409 // CHECK11-NEXT: entry:
7410 // CHECK11-NEXT: call void (ptr, i32, ptr, ...) @__kmpc_fork_teams(ptr @[[GLOB3]], i32 0, ptr @{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z5tmainIiEiT__l62.omp_outlined)
7411 // CHECK11-NEXT: ret void
7414 // CHECK11-LABEL: define {{[^@]+}}@{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z5tmainIiEiT__l62.omp_outlined
7415 // CHECK11-SAME: (ptr noalias noundef [[DOTGLOBAL_TID_:%.*]], ptr noalias noundef [[DOTBOUND_TID_:%.*]]) #[[ATTR2]] {
7416 // CHECK11-NEXT: entry:
7417 // CHECK11-NEXT: [[DOTGLOBAL_TID__ADDR:%.*]] = alloca ptr, align 8
7418 // CHECK11-NEXT: [[DOTBOUND_TID__ADDR:%.*]] = alloca ptr, align 8
7419 // CHECK11-NEXT: [[DOTOMP_IV:%.*]] = alloca i32, align 4
7420 // CHECK11-NEXT: [[TMP:%.*]] = alloca i32, align 4
7421 // CHECK11-NEXT: [[DOTOMP_COMB_LB:%.*]] = alloca i32, align 4
7422 // CHECK11-NEXT: [[DOTOMP_COMB_UB:%.*]] = alloca i32, align 4
7423 // CHECK11-NEXT: [[DOTOMP_STRIDE:%.*]] = alloca i32, align 4
7424 // CHECK11-NEXT: [[DOTOMP_IS_LAST:%.*]] = alloca i32, align 4
7425 // CHECK11-NEXT: [[I:%.*]] = alloca i32, align 4
7426 // CHECK11-NEXT: [[DOTBOUND_ZERO_ADDR:%.*]] = alloca i32, align 4
7427 // CHECK11-NEXT: store ptr [[DOTGLOBAL_TID_]], ptr [[DOTGLOBAL_TID__ADDR]], align 8
7428 // CHECK11-NEXT: store ptr [[DOTBOUND_TID_]], ptr [[DOTBOUND_TID__ADDR]], align 8
7429 // CHECK11-NEXT: store i32 0, ptr [[DOTOMP_COMB_LB]], align 4
7430 // CHECK11-NEXT: store i32 99, ptr [[DOTOMP_COMB_UB]], align 4
7431 // CHECK11-NEXT: store i32 1, ptr [[DOTOMP_STRIDE]], align 4
7432 // CHECK11-NEXT: store i32 0, ptr [[DOTOMP_IS_LAST]], align 4
7433 // CHECK11-NEXT: [[TMP0:%.*]] = load ptr, ptr [[DOTGLOBAL_TID__ADDR]], align 8
7434 // CHECK11-NEXT: [[TMP1:%.*]] = load i32, ptr [[TMP0]], align 4
7435 // 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)
7436 // CHECK11-NEXT: [[TMP2:%.*]] = load i32, ptr [[DOTOMP_COMB_UB]], align 4
7437 // CHECK11-NEXT: [[CMP:%.*]] = icmp sgt i32 [[TMP2]], 99
7438 // CHECK11-NEXT: br i1 [[CMP]], label [[COND_TRUE:%.*]], label [[COND_FALSE:%.*]]
7439 // CHECK11: cond.true:
7440 // CHECK11-NEXT: br label [[COND_END:%.*]]
7441 // CHECK11: cond.false:
7442 // CHECK11-NEXT: [[TMP3:%.*]] = load i32, ptr [[DOTOMP_COMB_UB]], align 4
7443 // CHECK11-NEXT: br label [[COND_END]]
7444 // CHECK11: cond.end:
7445 // CHECK11-NEXT: [[COND:%.*]] = phi i32 [ 99, [[COND_TRUE]] ], [ [[TMP3]], [[COND_FALSE]] ]
7446 // CHECK11-NEXT: store i32 [[COND]], ptr [[DOTOMP_COMB_UB]], align 4
7447 // CHECK11-NEXT: [[TMP4:%.*]] = load i32, ptr [[DOTOMP_COMB_LB]], align 4
7448 // CHECK11-NEXT: store i32 [[TMP4]], ptr [[DOTOMP_IV]], align 4
7449 // CHECK11-NEXT: br label [[OMP_INNER_FOR_COND:%.*]]
7450 // CHECK11: omp.inner.for.cond:
7451 // CHECK11-NEXT: [[TMP5:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4
7452 // CHECK11-NEXT: [[TMP6:%.*]] = load i32, ptr [[DOTOMP_COMB_UB]], align 4
7453 // CHECK11-NEXT: [[CMP1:%.*]] = icmp sle i32 [[TMP5]], [[TMP6]]
7454 // CHECK11-NEXT: br i1 [[CMP1]], label [[OMP_INNER_FOR_BODY:%.*]], label [[OMP_INNER_FOR_END:%.*]]
7455 // CHECK11: omp.inner.for.body:
7456 // CHECK11-NEXT: [[TMP7:%.*]] = load i32, ptr [[DOTOMP_COMB_LB]], align 4
7457 // CHECK11-NEXT: [[TMP8:%.*]] = zext i32 [[TMP7]] to i64
7458 // CHECK11-NEXT: [[TMP9:%.*]] = load i32, ptr [[DOTOMP_COMB_UB]], align 4
7459 // CHECK11-NEXT: [[TMP10:%.*]] = zext i32 [[TMP9]] to i64
7460 // CHECK11-NEXT: call void @__kmpc_serialized_parallel(ptr @[[GLOB3]], i32 [[TMP1]])
7461 // CHECK11-NEXT: [[TMP11:%.*]] = load ptr, ptr [[DOTGLOBAL_TID__ADDR]], align 8
7462 // CHECK11-NEXT: store i32 0, ptr [[DOTBOUND_ZERO_ADDR]], align 4
7463 // CHECK11-NEXT: call void @{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z5tmainIiEiT__l62.omp_outlined.omp_outlined(ptr [[TMP11]], ptr [[DOTBOUND_ZERO_ADDR]], i64 [[TMP8]], i64 [[TMP10]]) #[[ATTR3]]
7464 // CHECK11-NEXT: call void @__kmpc_end_serialized_parallel(ptr @[[GLOB3]], i32 [[TMP1]])
7465 // CHECK11-NEXT: br label [[OMP_INNER_FOR_INC:%.*]]
7466 // CHECK11: omp.inner.for.inc:
7467 // CHECK11-NEXT: [[TMP12:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4
7468 // CHECK11-NEXT: [[TMP13:%.*]] = load i32, ptr [[DOTOMP_STRIDE]], align 4
7469 // CHECK11-NEXT: [[ADD:%.*]] = add nsw i32 [[TMP12]], [[TMP13]]
7470 // CHECK11-NEXT: store i32 [[ADD]], ptr [[DOTOMP_IV]], align 4
7471 // CHECK11-NEXT: br label [[OMP_INNER_FOR_COND]], !llvm.loop [[LOOP53:![0-9]+]]
7472 // CHECK11: omp.inner.for.end:
7473 // CHECK11-NEXT: br label [[OMP_LOOP_EXIT:%.*]]
7474 // CHECK11: omp.loop.exit:
7475 // CHECK11-NEXT: call void @__kmpc_for_static_fini(ptr @[[GLOB1]], i32 [[TMP1]])
7476 // CHECK11-NEXT: [[TMP14:%.*]] = load i32, ptr [[DOTOMP_IS_LAST]], align 4
7477 // CHECK11-NEXT: [[TMP15:%.*]] = icmp ne i32 [[TMP14]], 0
7478 // CHECK11-NEXT: br i1 [[TMP15]], label [[DOTOMP_FINAL_THEN:%.*]], label [[DOTOMP_FINAL_DONE:%.*]]
7479 // CHECK11: .omp.final.then:
7480 // CHECK11-NEXT: store i32 100, ptr [[I]], align 4
7481 // CHECK11-NEXT: br label [[DOTOMP_FINAL_DONE]]
7482 // CHECK11: .omp.final.done:
7483 // CHECK11-NEXT: ret void
7486 // CHECK11-LABEL: define {{[^@]+}}@{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z5tmainIiEiT__l62.omp_outlined.omp_outlined
7487 // CHECK11-SAME: (ptr noalias noundef [[DOTGLOBAL_TID_:%.*]], ptr noalias noundef [[DOTBOUND_TID_:%.*]], i64 noundef [[DOTPREVIOUS_LB_:%.*]], i64 noundef [[DOTPREVIOUS_UB_:%.*]]) #[[ATTR2]] {
7488 // CHECK11-NEXT: entry:
7489 // CHECK11-NEXT: [[DOTGLOBAL_TID__ADDR:%.*]] = alloca ptr, align 8
7490 // CHECK11-NEXT: [[DOTBOUND_TID__ADDR:%.*]] = alloca ptr, align 8
7491 // CHECK11-NEXT: [[DOTPREVIOUS_LB__ADDR:%.*]] = alloca i64, align 8
7492 // CHECK11-NEXT: [[DOTPREVIOUS_UB__ADDR:%.*]] = alloca i64, align 8
7493 // CHECK11-NEXT: [[DOTOMP_IV:%.*]] = alloca i32, align 4
7494 // CHECK11-NEXT: [[TMP:%.*]] = alloca i32, align 4
7495 // CHECK11-NEXT: [[DOTOMP_LB:%.*]] = alloca i32, align 4
7496 // CHECK11-NEXT: [[DOTOMP_UB:%.*]] = alloca i32, align 4
7497 // CHECK11-NEXT: [[DOTOMP_STRIDE:%.*]] = alloca i32, align 4
7498 // CHECK11-NEXT: [[DOTOMP_IS_LAST:%.*]] = alloca i32, align 4
7499 // CHECK11-NEXT: [[I:%.*]] = alloca i32, align 4
7500 // CHECK11-NEXT: store ptr [[DOTGLOBAL_TID_]], ptr [[DOTGLOBAL_TID__ADDR]], align 8
7501 // CHECK11-NEXT: store ptr [[DOTBOUND_TID_]], ptr [[DOTBOUND_TID__ADDR]], align 8
7502 // CHECK11-NEXT: store i64 [[DOTPREVIOUS_LB_]], ptr [[DOTPREVIOUS_LB__ADDR]], align 8
7503 // CHECK11-NEXT: store i64 [[DOTPREVIOUS_UB_]], ptr [[DOTPREVIOUS_UB__ADDR]], align 8
7504 // CHECK11-NEXT: store i32 0, ptr [[DOTOMP_LB]], align 4
7505 // CHECK11-NEXT: store i32 99, ptr [[DOTOMP_UB]], align 4
7506 // CHECK11-NEXT: [[TMP0:%.*]] = load i64, ptr [[DOTPREVIOUS_LB__ADDR]], align 8
7507 // CHECK11-NEXT: [[CONV:%.*]] = trunc i64 [[TMP0]] to i32
7508 // CHECK11-NEXT: [[TMP1:%.*]] = load i64, ptr [[DOTPREVIOUS_UB__ADDR]], align 8
7509 // CHECK11-NEXT: [[CONV1:%.*]] = trunc i64 [[TMP1]] to i32
7510 // CHECK11-NEXT: store i32 [[CONV]], ptr [[DOTOMP_LB]], align 4
7511 // CHECK11-NEXT: store i32 [[CONV1]], ptr [[DOTOMP_UB]], align 4
7512 // CHECK11-NEXT: store i32 1, ptr [[DOTOMP_STRIDE]], align 4
7513 // CHECK11-NEXT: store i32 0, ptr [[DOTOMP_IS_LAST]], align 4
7514 // CHECK11-NEXT: [[TMP2:%.*]] = load ptr, ptr [[DOTGLOBAL_TID__ADDR]], align 8
7515 // CHECK11-NEXT: [[TMP3:%.*]] = load i32, ptr [[TMP2]], align 4
7516 // 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)
7517 // CHECK11-NEXT: [[TMP4:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4
7518 // CHECK11-NEXT: [[CMP:%.*]] = icmp sgt i32 [[TMP4]], 99
7519 // CHECK11-NEXT: br i1 [[CMP]], label [[COND_TRUE:%.*]], label [[COND_FALSE:%.*]]
7520 // CHECK11: cond.true:
7521 // CHECK11-NEXT: br label [[COND_END:%.*]]
7522 // CHECK11: cond.false:
7523 // CHECK11-NEXT: [[TMP5:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4
7524 // CHECK11-NEXT: br label [[COND_END]]
7525 // CHECK11: cond.end:
7526 // CHECK11-NEXT: [[COND:%.*]] = phi i32 [ 99, [[COND_TRUE]] ], [ [[TMP5]], [[COND_FALSE]] ]
7527 // CHECK11-NEXT: store i32 [[COND]], ptr [[DOTOMP_UB]], align 4
7528 // CHECK11-NEXT: [[TMP6:%.*]] = load i32, ptr [[DOTOMP_LB]], align 4
7529 // CHECK11-NEXT: store i32 [[TMP6]], ptr [[DOTOMP_IV]], align 4
7530 // CHECK11-NEXT: br label [[OMP_INNER_FOR_COND:%.*]]
7531 // CHECK11: omp.inner.for.cond:
7532 // CHECK11-NEXT: [[TMP7:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4
7533 // CHECK11-NEXT: [[TMP8:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4
7534 // CHECK11-NEXT: [[CMP2:%.*]] = icmp sle i32 [[TMP7]], [[TMP8]]
7535 // CHECK11-NEXT: br i1 [[CMP2]], label [[OMP_INNER_FOR_BODY:%.*]], label [[OMP_INNER_FOR_END:%.*]]
7536 // CHECK11: omp.inner.for.body:
7537 // CHECK11-NEXT: [[TMP9:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4
7538 // CHECK11-NEXT: [[MUL:%.*]] = mul nsw i32 [[TMP9]], 1
7539 // CHECK11-NEXT: [[ADD:%.*]] = add nsw i32 0, [[MUL]]
7540 // CHECK11-NEXT: store i32 [[ADD]], ptr [[I]], align 4
7541 // CHECK11-NEXT: call void @_Z3fn2v()
7542 // CHECK11-NEXT: br label [[OMP_BODY_CONTINUE:%.*]]
7543 // CHECK11: omp.body.continue:
7544 // CHECK11-NEXT: br label [[OMP_INNER_FOR_INC:%.*]]
7545 // CHECK11: omp.inner.for.inc:
7546 // CHECK11-NEXT: [[TMP10:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4
7547 // CHECK11-NEXT: [[ADD3:%.*]] = add nsw i32 [[TMP10]], 1
7548 // CHECK11-NEXT: store i32 [[ADD3]], ptr [[DOTOMP_IV]], align 4
7549 // CHECK11-NEXT: br label [[OMP_INNER_FOR_COND]], !llvm.loop [[LOOP54:![0-9]+]]
7550 // CHECK11: omp.inner.for.end:
7551 // CHECK11-NEXT: br label [[OMP_LOOP_EXIT:%.*]]
7552 // CHECK11: omp.loop.exit:
7553 // CHECK11-NEXT: call void @__kmpc_for_static_fini(ptr @[[GLOB1]], i32 [[TMP3]])
7554 // CHECK11-NEXT: [[TMP11:%.*]] = load i32, ptr [[DOTOMP_IS_LAST]], align 4
7555 // CHECK11-NEXT: [[TMP12:%.*]] = icmp ne i32 [[TMP11]], 0
7556 // CHECK11-NEXT: br i1 [[TMP12]], label [[DOTOMP_FINAL_THEN:%.*]], label [[DOTOMP_FINAL_DONE:%.*]]
7557 // CHECK11: .omp.final.then:
7558 // CHECK11-NEXT: store i32 100, ptr [[I]], align 4
7559 // CHECK11-NEXT: br label [[DOTOMP_FINAL_DONE]]
7560 // CHECK11: .omp.final.done:
7561 // CHECK11-NEXT: ret void
7564 // CHECK11-LABEL: define {{[^@]+}}@{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z5tmainIiEiT__l67
7565 // CHECK11-SAME: (i64 noundef [[ARG:%.*]]) #[[ATTR1]] {
7566 // CHECK11-NEXT: entry:
7567 // CHECK11-NEXT: [[ARG_ADDR:%.*]] = alloca i64, align 8
7568 // CHECK11-NEXT: [[DOTCAPTURE_EXPR_:%.*]] = alloca i8, align 1
7569 // CHECK11-NEXT: [[DOTCAPTURE_EXPR__CASTED:%.*]] = alloca i64, align 8
7570 // CHECK11-NEXT: store i64 [[ARG]], ptr [[ARG_ADDR]], align 8
7571 // CHECK11-NEXT: [[TMP0:%.*]] = load i32, ptr [[ARG_ADDR]], align 4
7572 // CHECK11-NEXT: [[TOBOOL:%.*]] = icmp ne i32 [[TMP0]], 0
7573 // CHECK11-NEXT: [[FROMBOOL:%.*]] = zext i1 [[TOBOOL]] to i8
7574 // CHECK11-NEXT: store i8 [[FROMBOOL]], ptr [[DOTCAPTURE_EXPR_]], align 1
7575 // CHECK11-NEXT: [[TMP1:%.*]] = load i8, ptr [[DOTCAPTURE_EXPR_]], align 1
7576 // CHECK11-NEXT: [[TOBOOL1:%.*]] = trunc i8 [[TMP1]] to i1
7577 // CHECK11-NEXT: [[FROMBOOL2:%.*]] = zext i1 [[TOBOOL1]] to i8
7578 // CHECK11-NEXT: store i8 [[FROMBOOL2]], ptr [[DOTCAPTURE_EXPR__CASTED]], align 1
7579 // CHECK11-NEXT: [[TMP2:%.*]] = load i64, ptr [[DOTCAPTURE_EXPR__CASTED]], align 8
7580 // CHECK11-NEXT: call void (ptr, i32, ptr, ...) @__kmpc_fork_teams(ptr @[[GLOB3]], i32 1, ptr @{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z5tmainIiEiT__l67.omp_outlined, i64 [[TMP2]])
7581 // CHECK11-NEXT: ret void
7584 // CHECK11-LABEL: define {{[^@]+}}@{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z5tmainIiEiT__l67.omp_outlined
7585 // CHECK11-SAME: (ptr noalias noundef [[DOTGLOBAL_TID_:%.*]], ptr noalias noundef [[DOTBOUND_TID_:%.*]], i64 noundef [[DOTCAPTURE_EXPR_:%.*]]) #[[ATTR2]] {
7586 // CHECK11-NEXT: entry:
7587 // CHECK11-NEXT: [[DOTGLOBAL_TID__ADDR:%.*]] = alloca ptr, align 8
7588 // CHECK11-NEXT: [[DOTBOUND_TID__ADDR:%.*]] = alloca ptr, align 8
7589 // CHECK11-NEXT: [[DOTCAPTURE_EXPR__ADDR:%.*]] = alloca i64, align 8
7590 // CHECK11-NEXT: [[DOTOMP_IV:%.*]] = alloca i32, align 4
7591 // CHECK11-NEXT: [[TMP:%.*]] = alloca i32, align 4
7592 // CHECK11-NEXT: [[DOTOMP_COMB_LB:%.*]] = alloca i32, align 4
7593 // CHECK11-NEXT: [[DOTOMP_COMB_UB:%.*]] = alloca i32, align 4
7594 // CHECK11-NEXT: [[DOTOMP_STRIDE:%.*]] = alloca i32, align 4
7595 // CHECK11-NEXT: [[DOTOMP_IS_LAST:%.*]] = alloca i32, align 4
7596 // CHECK11-NEXT: [[I:%.*]] = alloca i32, align 4
7597 // CHECK11-NEXT: [[DOTBOUND_ZERO_ADDR:%.*]] = alloca i32, align 4
7598 // CHECK11-NEXT: store ptr [[DOTGLOBAL_TID_]], ptr [[DOTGLOBAL_TID__ADDR]], align 8
7599 // CHECK11-NEXT: store ptr [[DOTBOUND_TID_]], ptr [[DOTBOUND_TID__ADDR]], align 8
7600 // CHECK11-NEXT: store i64 [[DOTCAPTURE_EXPR_]], ptr [[DOTCAPTURE_EXPR__ADDR]], align 8
7601 // CHECK11-NEXT: store i32 0, ptr [[DOTOMP_COMB_LB]], align 4
7602 // CHECK11-NEXT: store i32 99, ptr [[DOTOMP_COMB_UB]], align 4
7603 // CHECK11-NEXT: store i32 1, ptr [[DOTOMP_STRIDE]], align 4
7604 // CHECK11-NEXT: store i32 0, ptr [[DOTOMP_IS_LAST]], align 4
7605 // CHECK11-NEXT: [[TMP0:%.*]] = load ptr, ptr [[DOTGLOBAL_TID__ADDR]], align 8
7606 // CHECK11-NEXT: [[TMP1:%.*]] = load i32, ptr [[TMP0]], align 4
7607 // 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)
7608 // CHECK11-NEXT: [[TMP2:%.*]] = load i32, ptr [[DOTOMP_COMB_UB]], align 4
7609 // CHECK11-NEXT: [[CMP:%.*]] = icmp sgt i32 [[TMP2]], 99
7610 // CHECK11-NEXT: br i1 [[CMP]], label [[COND_TRUE:%.*]], label [[COND_FALSE:%.*]]
7611 // CHECK11: cond.true:
7612 // CHECK11-NEXT: br label [[COND_END:%.*]]
7613 // CHECK11: cond.false:
7614 // CHECK11-NEXT: [[TMP3:%.*]] = load i32, ptr [[DOTOMP_COMB_UB]], align 4
7615 // CHECK11-NEXT: br label [[COND_END]]
7616 // CHECK11: cond.end:
7617 // CHECK11-NEXT: [[COND:%.*]] = phi i32 [ 99, [[COND_TRUE]] ], [ [[TMP3]], [[COND_FALSE]] ]
7618 // CHECK11-NEXT: store i32 [[COND]], ptr [[DOTOMP_COMB_UB]], align 4
7619 // CHECK11-NEXT: [[TMP4:%.*]] = load i32, ptr [[DOTOMP_COMB_LB]], align 4
7620 // CHECK11-NEXT: store i32 [[TMP4]], ptr [[DOTOMP_IV]], align 4
7621 // CHECK11-NEXT: br label [[OMP_INNER_FOR_COND:%.*]]
7622 // CHECK11: omp.inner.for.cond:
7623 // CHECK11-NEXT: [[TMP5:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP55:![0-9]+]]
7624 // CHECK11-NEXT: [[TMP6:%.*]] = load i32, ptr [[DOTOMP_COMB_UB]], align 4, !llvm.access.group [[ACC_GRP55]]
7625 // CHECK11-NEXT: [[CMP1:%.*]] = icmp sle i32 [[TMP5]], [[TMP6]]
7626 // CHECK11-NEXT: br i1 [[CMP1]], label [[OMP_INNER_FOR_BODY:%.*]], label [[OMP_INNER_FOR_END:%.*]]
7627 // CHECK11: omp.inner.for.body:
7628 // CHECK11-NEXT: [[TMP7:%.*]] = load i32, ptr [[DOTOMP_COMB_LB]], align 4, !llvm.access.group [[ACC_GRP55]]
7629 // CHECK11-NEXT: [[TMP8:%.*]] = zext i32 [[TMP7]] to i64
7630 // CHECK11-NEXT: [[TMP9:%.*]] = load i32, ptr [[DOTOMP_COMB_UB]], align 4, !llvm.access.group [[ACC_GRP55]]
7631 // CHECK11-NEXT: [[TMP10:%.*]] = zext i32 [[TMP9]] to i64
7632 // CHECK11-NEXT: [[TMP11:%.*]] = load i8, ptr [[DOTCAPTURE_EXPR__ADDR]], align 1, !llvm.access.group [[ACC_GRP55]]
7633 // CHECK11-NEXT: [[TOBOOL:%.*]] = trunc i8 [[TMP11]] to i1
7634 // CHECK11-NEXT: br i1 [[TOBOOL]], label [[OMP_IF_THEN:%.*]], label [[OMP_IF_ELSE:%.*]]
7635 // CHECK11: omp_if.then:
7636 // CHECK11-NEXT: call void (ptr, i32, ptr, ...) @__kmpc_fork_call(ptr @[[GLOB3]], i32 2, ptr @{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z5tmainIiEiT__l67.omp_outlined.omp_outlined, i64 [[TMP8]], i64 [[TMP10]]), !llvm.access.group [[ACC_GRP55]]
7637 // CHECK11-NEXT: br label [[OMP_IF_END:%.*]]
7638 // CHECK11: omp_if.else:
7639 // CHECK11-NEXT: call void @__kmpc_serialized_parallel(ptr @[[GLOB3]], i32 [[TMP1]]), !llvm.access.group [[ACC_GRP55]]
7640 // CHECK11-NEXT: [[TMP12:%.*]] = load ptr, ptr [[DOTGLOBAL_TID__ADDR]], align 8, !llvm.access.group [[ACC_GRP55]]
7641 // CHECK11-NEXT: store i32 0, ptr [[DOTBOUND_ZERO_ADDR]], align 4, !llvm.access.group [[ACC_GRP55]]
7642 // CHECK11-NEXT: call void @{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z5tmainIiEiT__l67.omp_outlined.omp_outlined(ptr [[TMP12]], ptr [[DOTBOUND_ZERO_ADDR]], i64 [[TMP8]], i64 [[TMP10]]) #[[ATTR3]], !llvm.access.group [[ACC_GRP55]]
7643 // CHECK11-NEXT: call void @__kmpc_end_serialized_parallel(ptr @[[GLOB3]], i32 [[TMP1]]), !llvm.access.group [[ACC_GRP55]]
7644 // CHECK11-NEXT: br label [[OMP_IF_END]]
7645 // CHECK11: omp_if.end:
7646 // CHECK11-NEXT: br label [[OMP_INNER_FOR_INC:%.*]]
7647 // CHECK11: omp.inner.for.inc:
7648 // CHECK11-NEXT: [[TMP13:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP55]]
7649 // CHECK11-NEXT: [[TMP14:%.*]] = load i32, ptr [[DOTOMP_STRIDE]], align 4, !llvm.access.group [[ACC_GRP55]]
7650 // CHECK11-NEXT: [[ADD:%.*]] = add nsw i32 [[TMP13]], [[TMP14]]
7651 // CHECK11-NEXT: store i32 [[ADD]], ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP55]]
7652 // CHECK11-NEXT: br label [[OMP_INNER_FOR_COND]], !llvm.loop [[LOOP56:![0-9]+]]
7653 // CHECK11: omp.inner.for.end:
7654 // CHECK11-NEXT: br label [[OMP_LOOP_EXIT:%.*]]
7655 // CHECK11: omp.loop.exit:
7656 // CHECK11-NEXT: call void @__kmpc_for_static_fini(ptr @[[GLOB1]], i32 [[TMP1]])
7657 // CHECK11-NEXT: [[TMP15:%.*]] = load i32, ptr [[DOTOMP_IS_LAST]], align 4
7658 // CHECK11-NEXT: [[TMP16:%.*]] = icmp ne i32 [[TMP15]], 0
7659 // CHECK11-NEXT: br i1 [[TMP16]], label [[DOTOMP_FINAL_THEN:%.*]], label [[DOTOMP_FINAL_DONE:%.*]]
7660 // CHECK11: .omp.final.then:
7661 // CHECK11-NEXT: store i32 100, ptr [[I]], align 4
7662 // CHECK11-NEXT: br label [[DOTOMP_FINAL_DONE]]
7663 // CHECK11: .omp.final.done:
7664 // CHECK11-NEXT: ret void
7667 // CHECK11-LABEL: define {{[^@]+}}@{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z5tmainIiEiT__l67.omp_outlined.omp_outlined
7668 // CHECK11-SAME: (ptr noalias noundef [[DOTGLOBAL_TID_:%.*]], ptr noalias noundef [[DOTBOUND_TID_:%.*]], i64 noundef [[DOTPREVIOUS_LB_:%.*]], i64 noundef [[DOTPREVIOUS_UB_:%.*]]) #[[ATTR2]] {
7669 // CHECK11-NEXT: entry:
7670 // CHECK11-NEXT: [[DOTGLOBAL_TID__ADDR:%.*]] = alloca ptr, align 8
7671 // CHECK11-NEXT: [[DOTBOUND_TID__ADDR:%.*]] = alloca ptr, align 8
7672 // CHECK11-NEXT: [[DOTPREVIOUS_LB__ADDR:%.*]] = alloca i64, align 8
7673 // CHECK11-NEXT: [[DOTPREVIOUS_UB__ADDR:%.*]] = alloca i64, align 8
7674 // CHECK11-NEXT: [[DOTOMP_IV:%.*]] = alloca i32, align 4
7675 // CHECK11-NEXT: [[TMP:%.*]] = alloca i32, align 4
7676 // CHECK11-NEXT: [[DOTOMP_LB:%.*]] = alloca i32, align 4
7677 // CHECK11-NEXT: [[DOTOMP_UB:%.*]] = alloca i32, align 4
7678 // CHECK11-NEXT: [[DOTOMP_STRIDE:%.*]] = alloca i32, align 4
7679 // CHECK11-NEXT: [[DOTOMP_IS_LAST:%.*]] = alloca i32, align 4
7680 // CHECK11-NEXT: [[I:%.*]] = alloca i32, align 4
7681 // CHECK11-NEXT: store ptr [[DOTGLOBAL_TID_]], ptr [[DOTGLOBAL_TID__ADDR]], align 8
7682 // CHECK11-NEXT: store ptr [[DOTBOUND_TID_]], ptr [[DOTBOUND_TID__ADDR]], align 8
7683 // CHECK11-NEXT: store i64 [[DOTPREVIOUS_LB_]], ptr [[DOTPREVIOUS_LB__ADDR]], align 8
7684 // CHECK11-NEXT: store i64 [[DOTPREVIOUS_UB_]], ptr [[DOTPREVIOUS_UB__ADDR]], align 8
7685 // CHECK11-NEXT: store i32 0, ptr [[DOTOMP_LB]], align 4
7686 // CHECK11-NEXT: store i32 99, ptr [[DOTOMP_UB]], align 4
7687 // CHECK11-NEXT: [[TMP0:%.*]] = load i64, ptr [[DOTPREVIOUS_LB__ADDR]], align 8
7688 // CHECK11-NEXT: [[CONV:%.*]] = trunc i64 [[TMP0]] to i32
7689 // CHECK11-NEXT: [[TMP1:%.*]] = load i64, ptr [[DOTPREVIOUS_UB__ADDR]], align 8
7690 // CHECK11-NEXT: [[CONV1:%.*]] = trunc i64 [[TMP1]] to i32
7691 // CHECK11-NEXT: store i32 [[CONV]], ptr [[DOTOMP_LB]], align 4
7692 // CHECK11-NEXT: store i32 [[CONV1]], ptr [[DOTOMP_UB]], align 4
7693 // CHECK11-NEXT: store i32 1, ptr [[DOTOMP_STRIDE]], align 4
7694 // CHECK11-NEXT: store i32 0, ptr [[DOTOMP_IS_LAST]], align 4
7695 // CHECK11-NEXT: [[TMP2:%.*]] = load ptr, ptr [[DOTGLOBAL_TID__ADDR]], align 8
7696 // CHECK11-NEXT: [[TMP3:%.*]] = load i32, ptr [[TMP2]], align 4
7697 // 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)
7698 // CHECK11-NEXT: [[TMP4:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4
7699 // CHECK11-NEXT: [[CMP:%.*]] = icmp sgt i32 [[TMP4]], 99
7700 // CHECK11-NEXT: br i1 [[CMP]], label [[COND_TRUE:%.*]], label [[COND_FALSE:%.*]]
7701 // CHECK11: cond.true:
7702 // CHECK11-NEXT: br label [[COND_END:%.*]]
7703 // CHECK11: cond.false:
7704 // CHECK11-NEXT: [[TMP5:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4
7705 // CHECK11-NEXT: br label [[COND_END]]
7706 // CHECK11: cond.end:
7707 // CHECK11-NEXT: [[COND:%.*]] = phi i32 [ 99, [[COND_TRUE]] ], [ [[TMP5]], [[COND_FALSE]] ]
7708 // CHECK11-NEXT: store i32 [[COND]], ptr [[DOTOMP_UB]], align 4
7709 // CHECK11-NEXT: [[TMP6:%.*]] = load i32, ptr [[DOTOMP_LB]], align 4
7710 // CHECK11-NEXT: store i32 [[TMP6]], ptr [[DOTOMP_IV]], align 4
7711 // CHECK11-NEXT: br label [[OMP_INNER_FOR_COND:%.*]]
7712 // CHECK11: omp.inner.for.cond:
7713 // CHECK11-NEXT: [[TMP7:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP58:![0-9]+]]
7714 // CHECK11-NEXT: [[TMP8:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4, !llvm.access.group [[ACC_GRP58]]
7715 // CHECK11-NEXT: [[CMP2:%.*]] = icmp sle i32 [[TMP7]], [[TMP8]]
7716 // CHECK11-NEXT: br i1 [[CMP2]], label [[OMP_INNER_FOR_BODY:%.*]], label [[OMP_INNER_FOR_END:%.*]]
7717 // CHECK11: omp.inner.for.body:
7718 // CHECK11-NEXT: [[TMP9:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP58]]
7719 // CHECK11-NEXT: [[MUL:%.*]] = mul nsw i32 [[TMP9]], 1
7720 // CHECK11-NEXT: [[ADD:%.*]] = add nsw i32 0, [[MUL]]
7721 // CHECK11-NEXT: store i32 [[ADD]], ptr [[I]], align 4, !llvm.access.group [[ACC_GRP58]]
7722 // CHECK11-NEXT: call void @_Z3fn3v(), !llvm.access.group [[ACC_GRP58]]
7723 // CHECK11-NEXT: br label [[OMP_BODY_CONTINUE:%.*]]
7724 // CHECK11: omp.body.continue:
7725 // CHECK11-NEXT: br label [[OMP_INNER_FOR_INC:%.*]]
7726 // CHECK11: omp.inner.for.inc:
7727 // CHECK11-NEXT: [[TMP10:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP58]]
7728 // CHECK11-NEXT: [[ADD3:%.*]] = add nsw i32 [[TMP10]], 1
7729 // CHECK11-NEXT: store i32 [[ADD3]], ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP58]]
7730 // CHECK11-NEXT: br label [[OMP_INNER_FOR_COND]], !llvm.loop [[LOOP59:![0-9]+]]
7731 // CHECK11: omp.inner.for.end:
7732 // CHECK11-NEXT: br label [[OMP_LOOP_EXIT:%.*]]
7733 // CHECK11: omp.loop.exit:
7734 // CHECK11-NEXT: call void @__kmpc_for_static_fini(ptr @[[GLOB1]], i32 [[TMP3]])
7735 // CHECK11-NEXT: [[TMP11:%.*]] = load i32, ptr [[DOTOMP_IS_LAST]], align 4
7736 // CHECK11-NEXT: [[TMP12:%.*]] = icmp ne i32 [[TMP11]], 0
7737 // CHECK11-NEXT: br i1 [[TMP12]], label [[DOTOMP_FINAL_THEN:%.*]], label [[DOTOMP_FINAL_DONE:%.*]]
7738 // CHECK11: .omp.final.then:
7739 // CHECK11-NEXT: store i32 100, ptr [[I]], align 4
7740 // CHECK11-NEXT: br label [[DOTOMP_FINAL_DONE]]
7741 // CHECK11: .omp.final.done:
7742 // CHECK11-NEXT: ret void
7745 // CHECK11-LABEL: define {{[^@]+}}@.omp_offloading.requires_reg
7746 // CHECK11-SAME: () #[[ATTR6:[0-9]+]] {
7747 // CHECK11-NEXT: entry:
7748 // CHECK11-NEXT: call void @__tgt_register_requires(i64 1)
7749 // CHECK11-NEXT: ret void
7752 // CHECK13-LABEL: define {{[^@]+}}@_Z9gtid_testv
7753 // CHECK13-SAME: () #[[ATTR0:[0-9]+]] {
7754 // CHECK13-NEXT: entry:
7755 // CHECK13-NEXT: [[TMP:%.*]] = alloca i32, align 4
7756 // CHECK13-NEXT: [[DOTOMP_LB:%.*]] = alloca i32, align 4
7757 // CHECK13-NEXT: [[DOTOMP_UB:%.*]] = alloca i32, align 4
7758 // CHECK13-NEXT: [[DOTOMP_IV:%.*]] = alloca i32, align 4
7759 // CHECK13-NEXT: [[I:%.*]] = alloca i32, align 4
7760 // CHECK13-NEXT: [[_TMP2:%.*]] = alloca i32, align 4
7761 // CHECK13-NEXT: [[DOTOMP_LB3:%.*]] = alloca i32, align 4
7762 // CHECK13-NEXT: [[DOTOMP_UB4:%.*]] = alloca i32, align 4
7763 // CHECK13-NEXT: [[DOTOMP_IV5:%.*]] = alloca i32, align 4
7764 // CHECK13-NEXT: [[I6:%.*]] = alloca i32, align 4
7765 // CHECK13-NEXT: store i32 0, ptr [[DOTOMP_LB]], align 4
7766 // CHECK13-NEXT: store i32 99, ptr [[DOTOMP_UB]], align 4
7767 // CHECK13-NEXT: [[TMP0:%.*]] = load i32, ptr [[DOTOMP_LB]], align 4
7768 // CHECK13-NEXT: store i32 [[TMP0]], ptr [[DOTOMP_IV]], align 4
7769 // CHECK13-NEXT: br label [[OMP_INNER_FOR_COND:%.*]]
7770 // CHECK13: omp.inner.for.cond:
7771 // CHECK13-NEXT: [[TMP1:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP2:![0-9]+]]
7772 // CHECK13-NEXT: [[TMP2:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4, !llvm.access.group [[ACC_GRP2]]
7773 // CHECK13-NEXT: [[CMP:%.*]] = icmp sle i32 [[TMP1]], [[TMP2]]
7774 // CHECK13-NEXT: br i1 [[CMP]], label [[OMP_INNER_FOR_BODY:%.*]], label [[OMP_INNER_FOR_END:%.*]]
7775 // CHECK13: omp.inner.for.body:
7776 // CHECK13-NEXT: [[TMP3:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP2]]
7777 // CHECK13-NEXT: [[MUL:%.*]] = mul nsw i32 [[TMP3]], 1
7778 // CHECK13-NEXT: [[ADD:%.*]] = add nsw i32 0, [[MUL]]
7779 // CHECK13-NEXT: store i32 [[ADD]], ptr [[I]], align 4, !llvm.access.group [[ACC_GRP2]]
7780 // CHECK13-NEXT: br label [[OMP_BODY_CONTINUE:%.*]]
7781 // CHECK13: omp.body.continue:
7782 // CHECK13-NEXT: br label [[OMP_INNER_FOR_INC:%.*]]
7783 // CHECK13: omp.inner.for.inc:
7784 // CHECK13-NEXT: [[TMP4:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP2]]
7785 // CHECK13-NEXT: [[ADD1:%.*]] = add nsw i32 [[TMP4]], 1
7786 // CHECK13-NEXT: store i32 [[ADD1]], ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP2]]
7787 // CHECK13-NEXT: br label [[OMP_INNER_FOR_COND]], !llvm.loop [[LOOP3:![0-9]+]]
7788 // CHECK13: omp.inner.for.end:
7789 // CHECK13-NEXT: store i32 100, ptr [[I]], align 4
7790 // CHECK13-NEXT: store i32 0, ptr [[DOTOMP_LB3]], align 4
7791 // CHECK13-NEXT: store i32 99, ptr [[DOTOMP_UB4]], align 4
7792 // CHECK13-NEXT: [[TMP5:%.*]] = load i32, ptr [[DOTOMP_LB3]], align 4
7793 // CHECK13-NEXT: store i32 [[TMP5]], ptr [[DOTOMP_IV5]], align 4
7794 // CHECK13-NEXT: br label [[OMP_INNER_FOR_COND7:%.*]]
7795 // CHECK13: omp.inner.for.cond7:
7796 // CHECK13-NEXT: [[TMP6:%.*]] = load i32, ptr [[DOTOMP_IV5]], align 4, !llvm.access.group [[ACC_GRP6:![0-9]+]]
7797 // CHECK13-NEXT: [[TMP7:%.*]] = load i32, ptr [[DOTOMP_UB4]], align 4, !llvm.access.group [[ACC_GRP6]]
7798 // CHECK13-NEXT: [[CMP8:%.*]] = icmp sle i32 [[TMP6]], [[TMP7]]
7799 // CHECK13-NEXT: br i1 [[CMP8]], label [[OMP_INNER_FOR_BODY9:%.*]], label [[OMP_INNER_FOR_END15:%.*]]
7800 // CHECK13: omp.inner.for.body9:
7801 // CHECK13-NEXT: [[TMP8:%.*]] = load i32, ptr [[DOTOMP_IV5]], align 4, !llvm.access.group [[ACC_GRP6]]
7802 // CHECK13-NEXT: [[MUL10:%.*]] = mul nsw i32 [[TMP8]], 1
7803 // CHECK13-NEXT: [[ADD11:%.*]] = add nsw i32 0, [[MUL10]]
7804 // CHECK13-NEXT: store i32 [[ADD11]], ptr [[I6]], align 4, !llvm.access.group [[ACC_GRP6]]
7805 // CHECK13-NEXT: call void @_Z9gtid_testv(), !llvm.access.group [[ACC_GRP6]]
7806 // CHECK13-NEXT: br label [[OMP_BODY_CONTINUE12:%.*]]
7807 // CHECK13: omp.body.continue12:
7808 // CHECK13-NEXT: br label [[OMP_INNER_FOR_INC13:%.*]]
7809 // CHECK13: omp.inner.for.inc13:
7810 // CHECK13-NEXT: [[TMP9:%.*]] = load i32, ptr [[DOTOMP_IV5]], align 4, !llvm.access.group [[ACC_GRP6]]
7811 // CHECK13-NEXT: [[ADD14:%.*]] = add nsw i32 [[TMP9]], 1
7812 // CHECK13-NEXT: store i32 [[ADD14]], ptr [[DOTOMP_IV5]], align 4, !llvm.access.group [[ACC_GRP6]]
7813 // CHECK13-NEXT: br label [[OMP_INNER_FOR_COND7]], !llvm.loop [[LOOP7:![0-9]+]]
7814 // CHECK13: omp.inner.for.end15:
7815 // CHECK13-NEXT: store i32 100, ptr [[I6]], align 4
7816 // CHECK13-NEXT: ret void
7819 // CHECK13-LABEL: define {{[^@]+}}@main
7820 // CHECK13-SAME: () #[[ATTR1:[0-9]+]] {
7821 // CHECK13-NEXT: entry:
7822 // CHECK13-NEXT: [[RETVAL:%.*]] = alloca i32, align 4
7823 // CHECK13-NEXT: [[TMP:%.*]] = alloca i32, align 4
7824 // CHECK13-NEXT: [[DOTOMP_LB:%.*]] = alloca i32, align 4
7825 // CHECK13-NEXT: [[DOTOMP_UB:%.*]] = alloca i32, align 4
7826 // CHECK13-NEXT: [[DOTOMP_IV:%.*]] = alloca i32, align 4
7827 // CHECK13-NEXT: [[I:%.*]] = alloca i32, align 4
7828 // CHECK13-NEXT: [[_TMP2:%.*]] = alloca i32, align 4
7829 // CHECK13-NEXT: [[DOTOMP_LB3:%.*]] = alloca i32, align 4
7830 // CHECK13-NEXT: [[DOTOMP_UB4:%.*]] = alloca i32, align 4
7831 // CHECK13-NEXT: [[DOTOMP_IV5:%.*]] = alloca i32, align 4
7832 // CHECK13-NEXT: [[I6:%.*]] = alloca i32, align 4
7833 // CHECK13-NEXT: [[DOTCAPTURE_EXPR_:%.*]] = alloca i8, align 1
7834 // CHECK13-NEXT: [[_TMP16:%.*]] = alloca i32, align 4
7835 // CHECK13-NEXT: [[DOTOMP_LB17:%.*]] = alloca i32, align 4
7836 // CHECK13-NEXT: [[DOTOMP_UB18:%.*]] = alloca i32, align 4
7837 // CHECK13-NEXT: [[DOTOMP_IV19:%.*]] = alloca i32, align 4
7838 // CHECK13-NEXT: [[I20:%.*]] = alloca i32, align 4
7839 // CHECK13-NEXT: store i32 0, ptr [[RETVAL]], align 4
7840 // CHECK13-NEXT: store i32 0, ptr [[DOTOMP_LB]], align 4
7841 // CHECK13-NEXT: store i32 99, ptr [[DOTOMP_UB]], align 4
7842 // CHECK13-NEXT: [[TMP0:%.*]] = load i32, ptr [[DOTOMP_LB]], align 4
7843 // CHECK13-NEXT: store i32 [[TMP0]], ptr [[DOTOMP_IV]], align 4
7844 // CHECK13-NEXT: br label [[OMP_INNER_FOR_COND:%.*]]
7845 // CHECK13: omp.inner.for.cond:
7846 // CHECK13-NEXT: [[TMP1:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP9:![0-9]+]]
7847 // CHECK13-NEXT: [[TMP2:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4, !llvm.access.group [[ACC_GRP9]]
7848 // CHECK13-NEXT: [[CMP:%.*]] = icmp sle i32 [[TMP1]], [[TMP2]]
7849 // CHECK13-NEXT: br i1 [[CMP]], label [[OMP_INNER_FOR_BODY:%.*]], label [[OMP_INNER_FOR_END:%.*]]
7850 // CHECK13: omp.inner.for.body:
7851 // CHECK13-NEXT: [[TMP3:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP9]]
7852 // CHECK13-NEXT: [[MUL:%.*]] = mul nsw i32 [[TMP3]], 1
7853 // CHECK13-NEXT: [[ADD:%.*]] = add nsw i32 0, [[MUL]]
7854 // CHECK13-NEXT: store i32 [[ADD]], ptr [[I]], align 4, !llvm.access.group [[ACC_GRP9]]
7855 // CHECK13-NEXT: call void @_Z3fn4v(), !llvm.access.group [[ACC_GRP9]]
7856 // CHECK13-NEXT: br label [[OMP_BODY_CONTINUE:%.*]]
7857 // CHECK13: omp.body.continue:
7858 // CHECK13-NEXT: br label [[OMP_INNER_FOR_INC:%.*]]
7859 // CHECK13: omp.inner.for.inc:
7860 // CHECK13-NEXT: [[TMP4:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP9]]
7861 // CHECK13-NEXT: [[ADD1:%.*]] = add nsw i32 [[TMP4]], 1
7862 // CHECK13-NEXT: store i32 [[ADD1]], ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP9]]
7863 // CHECK13-NEXT: br label [[OMP_INNER_FOR_COND]], !llvm.loop [[LOOP10:![0-9]+]]
7864 // CHECK13: omp.inner.for.end:
7865 // CHECK13-NEXT: store i32 100, ptr [[I]], align 4
7866 // CHECK13-NEXT: store i32 0, ptr [[DOTOMP_LB3]], align 4
7867 // CHECK13-NEXT: store i32 99, ptr [[DOTOMP_UB4]], align 4
7868 // CHECK13-NEXT: [[TMP5:%.*]] = load i32, ptr [[DOTOMP_LB3]], align 4
7869 // CHECK13-NEXT: store i32 [[TMP5]], ptr [[DOTOMP_IV5]], align 4
7870 // CHECK13-NEXT: br label [[OMP_INNER_FOR_COND7:%.*]]
7871 // CHECK13: omp.inner.for.cond7:
7872 // CHECK13-NEXT: [[TMP6:%.*]] = load i32, ptr [[DOTOMP_IV5]], align 4, !llvm.access.group [[ACC_GRP12:![0-9]+]]
7873 // CHECK13-NEXT: [[TMP7:%.*]] = load i32, ptr [[DOTOMP_UB4]], align 4, !llvm.access.group [[ACC_GRP12]]
7874 // CHECK13-NEXT: [[CMP8:%.*]] = icmp sle i32 [[TMP6]], [[TMP7]]
7875 // CHECK13-NEXT: br i1 [[CMP8]], label [[OMP_INNER_FOR_BODY9:%.*]], label [[OMP_INNER_FOR_END15:%.*]]
7876 // CHECK13: omp.inner.for.body9:
7877 // CHECK13-NEXT: [[TMP8:%.*]] = load i32, ptr [[DOTOMP_IV5]], align 4, !llvm.access.group [[ACC_GRP12]]
7878 // CHECK13-NEXT: [[MUL10:%.*]] = mul nsw i32 [[TMP8]], 1
7879 // CHECK13-NEXT: [[ADD11:%.*]] = add nsw i32 0, [[MUL10]]
7880 // CHECK13-NEXT: store i32 [[ADD11]], ptr [[I6]], align 4, !llvm.access.group [[ACC_GRP12]]
7881 // CHECK13-NEXT: call void @_Z3fn5v(), !llvm.access.group [[ACC_GRP12]]
7882 // CHECK13-NEXT: br label [[OMP_BODY_CONTINUE12:%.*]]
7883 // CHECK13: omp.body.continue12:
7884 // CHECK13-NEXT: br label [[OMP_INNER_FOR_INC13:%.*]]
7885 // CHECK13: omp.inner.for.inc13:
7886 // CHECK13-NEXT: [[TMP9:%.*]] = load i32, ptr [[DOTOMP_IV5]], align 4, !llvm.access.group [[ACC_GRP12]]
7887 // CHECK13-NEXT: [[ADD14:%.*]] = add nsw i32 [[TMP9]], 1
7888 // CHECK13-NEXT: store i32 [[ADD14]], ptr [[DOTOMP_IV5]], align 4, !llvm.access.group [[ACC_GRP12]]
7889 // CHECK13-NEXT: br label [[OMP_INNER_FOR_COND7]], !llvm.loop [[LOOP13:![0-9]+]]
7890 // CHECK13: omp.inner.for.end15:
7891 // CHECK13-NEXT: store i32 100, ptr [[I6]], align 4
7892 // CHECK13-NEXT: [[TMP10:%.*]] = load i32, ptr @Arg, align 4
7893 // CHECK13-NEXT: [[TOBOOL:%.*]] = icmp ne i32 [[TMP10]], 0
7894 // CHECK13-NEXT: [[FROMBOOL:%.*]] = zext i1 [[TOBOOL]] to i8
7895 // CHECK13-NEXT: store i8 [[FROMBOOL]], ptr [[DOTCAPTURE_EXPR_]], align 1
7896 // CHECK13-NEXT: store i32 0, ptr [[DOTOMP_LB17]], align 4
7897 // CHECK13-NEXT: store i32 99, ptr [[DOTOMP_UB18]], align 4
7898 // CHECK13-NEXT: [[TMP11:%.*]] = load i32, ptr [[DOTOMP_LB17]], align 4
7899 // CHECK13-NEXT: store i32 [[TMP11]], ptr [[DOTOMP_IV19]], align 4
7900 // CHECK13-NEXT: br label [[OMP_INNER_FOR_COND21:%.*]]
7901 // CHECK13: omp.inner.for.cond21:
7902 // CHECK13-NEXT: [[TMP12:%.*]] = load i32, ptr [[DOTOMP_IV19]], align 4, !llvm.access.group [[ACC_GRP15:![0-9]+]]
7903 // CHECK13-NEXT: [[TMP13:%.*]] = load i32, ptr [[DOTOMP_UB18]], align 4, !llvm.access.group [[ACC_GRP15]]
7904 // CHECK13-NEXT: [[CMP22:%.*]] = icmp sle i32 [[TMP12]], [[TMP13]]
7905 // CHECK13-NEXT: br i1 [[CMP22]], label [[OMP_INNER_FOR_BODY23:%.*]], label [[OMP_INNER_FOR_END29:%.*]]
7906 // CHECK13: omp.inner.for.body23:
7907 // CHECK13-NEXT: [[TMP14:%.*]] = load i32, ptr [[DOTOMP_IV19]], align 4, !llvm.access.group [[ACC_GRP15]]
7908 // CHECK13-NEXT: [[MUL24:%.*]] = mul nsw i32 [[TMP14]], 1
7909 // CHECK13-NEXT: [[ADD25:%.*]] = add nsw i32 0, [[MUL24]]
7910 // CHECK13-NEXT: store i32 [[ADD25]], ptr [[I20]], align 4, !llvm.access.group [[ACC_GRP15]]
7911 // CHECK13-NEXT: call void @_Z3fn6v(), !llvm.access.group [[ACC_GRP15]]
7912 // CHECK13-NEXT: br label [[OMP_BODY_CONTINUE26:%.*]]
7913 // CHECK13: omp.body.continue26:
7914 // CHECK13-NEXT: br label [[OMP_INNER_FOR_INC27:%.*]]
7915 // CHECK13: omp.inner.for.inc27:
7916 // CHECK13-NEXT: [[TMP15:%.*]] = load i32, ptr [[DOTOMP_IV19]], align 4, !llvm.access.group [[ACC_GRP15]]
7917 // CHECK13-NEXT: [[ADD28:%.*]] = add nsw i32 [[TMP15]], 1
7918 // CHECK13-NEXT: store i32 [[ADD28]], ptr [[DOTOMP_IV19]], align 4, !llvm.access.group [[ACC_GRP15]]
7919 // CHECK13-NEXT: br label [[OMP_INNER_FOR_COND21]], !llvm.loop [[LOOP16:![0-9]+]]
7920 // CHECK13: omp.inner.for.end29:
7921 // CHECK13-NEXT: store i32 100, ptr [[I20]], align 4
7922 // CHECK13-NEXT: [[TMP16:%.*]] = load i32, ptr @Arg, align 4
7923 // CHECK13-NEXT: [[CALL:%.*]] = call noundef i32 @_Z5tmainIiEiT_(i32 noundef [[TMP16]])
7924 // CHECK13-NEXT: ret i32 [[CALL]]
7927 // CHECK13-LABEL: define {{[^@]+}}@_Z5tmainIiEiT_
7928 // CHECK13-SAME: (i32 noundef [[ARG:%.*]]) #[[ATTR0]] comdat {
7929 // CHECK13-NEXT: entry:
7930 // CHECK13-NEXT: [[ARG_ADDR:%.*]] = alloca i32, align 4
7931 // CHECK13-NEXT: [[TMP:%.*]] = alloca i32, align 4
7932 // CHECK13-NEXT: [[DOTOMP_LB:%.*]] = alloca i32, align 4
7933 // CHECK13-NEXT: [[DOTOMP_UB:%.*]] = alloca i32, align 4
7934 // CHECK13-NEXT: [[DOTOMP_IV:%.*]] = alloca i32, align 4
7935 // CHECK13-NEXT: [[I:%.*]] = alloca i32, align 4
7936 // CHECK13-NEXT: [[_TMP2:%.*]] = alloca i32, align 4
7937 // CHECK13-NEXT: [[DOTOMP_LB3:%.*]] = alloca i32, align 4
7938 // CHECK13-NEXT: [[DOTOMP_UB4:%.*]] = alloca i32, align 4
7939 // CHECK13-NEXT: [[DOTOMP_IV5:%.*]] = alloca i32, align 4
7940 // CHECK13-NEXT: [[I6:%.*]] = alloca i32, align 4
7941 // CHECK13-NEXT: [[DOTCAPTURE_EXPR_:%.*]] = alloca i8, align 1
7942 // CHECK13-NEXT: [[_TMP16:%.*]] = alloca i32, align 4
7943 // CHECK13-NEXT: [[DOTOMP_LB17:%.*]] = alloca i32, align 4
7944 // CHECK13-NEXT: [[DOTOMP_UB18:%.*]] = alloca i32, align 4
7945 // CHECK13-NEXT: [[DOTOMP_IV19:%.*]] = alloca i32, align 4
7946 // CHECK13-NEXT: [[I20:%.*]] = alloca i32, align 4
7947 // CHECK13-NEXT: store i32 [[ARG]], ptr [[ARG_ADDR]], align 4
7948 // CHECK13-NEXT: store i32 0, ptr [[DOTOMP_LB]], align 4
7949 // CHECK13-NEXT: store i32 99, ptr [[DOTOMP_UB]], align 4
7950 // CHECK13-NEXT: [[TMP0:%.*]] = load i32, ptr [[DOTOMP_LB]], align 4
7951 // CHECK13-NEXT: store i32 [[TMP0]], ptr [[DOTOMP_IV]], align 4
7952 // CHECK13-NEXT: br label [[OMP_INNER_FOR_COND:%.*]]
7953 // CHECK13: omp.inner.for.cond:
7954 // CHECK13-NEXT: [[TMP1:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP18:![0-9]+]]
7955 // CHECK13-NEXT: [[TMP2:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4, !llvm.access.group [[ACC_GRP18]]
7956 // CHECK13-NEXT: [[CMP:%.*]] = icmp sle i32 [[TMP1]], [[TMP2]]
7957 // CHECK13-NEXT: br i1 [[CMP]], label [[OMP_INNER_FOR_BODY:%.*]], label [[OMP_INNER_FOR_END:%.*]]
7958 // CHECK13: omp.inner.for.body:
7959 // CHECK13-NEXT: [[TMP3:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP18]]
7960 // CHECK13-NEXT: [[MUL:%.*]] = mul nsw i32 [[TMP3]], 1
7961 // CHECK13-NEXT: [[ADD:%.*]] = add nsw i32 0, [[MUL]]
7962 // CHECK13-NEXT: store i32 [[ADD]], ptr [[I]], align 4, !llvm.access.group [[ACC_GRP18]]
7963 // CHECK13-NEXT: call void @_Z3fn1v(), !llvm.access.group [[ACC_GRP18]]
7964 // CHECK13-NEXT: br label [[OMP_BODY_CONTINUE:%.*]]
7965 // CHECK13: omp.body.continue:
7966 // CHECK13-NEXT: br label [[OMP_INNER_FOR_INC:%.*]]
7967 // CHECK13: omp.inner.for.inc:
7968 // CHECK13-NEXT: [[TMP4:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP18]]
7969 // CHECK13-NEXT: [[ADD1:%.*]] = add nsw i32 [[TMP4]], 1
7970 // CHECK13-NEXT: store i32 [[ADD1]], ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP18]]
7971 // CHECK13-NEXT: br label [[OMP_INNER_FOR_COND]], !llvm.loop [[LOOP19:![0-9]+]]
7972 // CHECK13: omp.inner.for.end:
7973 // CHECK13-NEXT: store i32 100, ptr [[I]], align 4
7974 // CHECK13-NEXT: store i32 0, ptr [[DOTOMP_LB3]], align 4
7975 // CHECK13-NEXT: store i32 99, ptr [[DOTOMP_UB4]], align 4
7976 // CHECK13-NEXT: [[TMP5:%.*]] = load i32, ptr [[DOTOMP_LB3]], align 4
7977 // CHECK13-NEXT: store i32 [[TMP5]], ptr [[DOTOMP_IV5]], align 4
7978 // CHECK13-NEXT: br label [[OMP_INNER_FOR_COND7:%.*]]
7979 // CHECK13: omp.inner.for.cond7:
7980 // CHECK13-NEXT: [[TMP6:%.*]] = load i32, ptr [[DOTOMP_IV5]], align 4, !llvm.access.group [[ACC_GRP21:![0-9]+]]
7981 // CHECK13-NEXT: [[TMP7:%.*]] = load i32, ptr [[DOTOMP_UB4]], align 4, !llvm.access.group [[ACC_GRP21]]
7982 // CHECK13-NEXT: [[CMP8:%.*]] = icmp sle i32 [[TMP6]], [[TMP7]]
7983 // CHECK13-NEXT: br i1 [[CMP8]], label [[OMP_INNER_FOR_BODY9:%.*]], label [[OMP_INNER_FOR_END15:%.*]]
7984 // CHECK13: omp.inner.for.body9:
7985 // CHECK13-NEXT: [[TMP8:%.*]] = load i32, ptr [[DOTOMP_IV5]], align 4, !llvm.access.group [[ACC_GRP21]]
7986 // CHECK13-NEXT: [[MUL10:%.*]] = mul nsw i32 [[TMP8]], 1
7987 // CHECK13-NEXT: [[ADD11:%.*]] = add nsw i32 0, [[MUL10]]
7988 // CHECK13-NEXT: store i32 [[ADD11]], ptr [[I6]], align 4, !llvm.access.group [[ACC_GRP21]]
7989 // CHECK13-NEXT: call void @_Z3fn2v(), !llvm.access.group [[ACC_GRP21]]
7990 // CHECK13-NEXT: br label [[OMP_BODY_CONTINUE12:%.*]]
7991 // CHECK13: omp.body.continue12:
7992 // CHECK13-NEXT: br label [[OMP_INNER_FOR_INC13:%.*]]
7993 // CHECK13: omp.inner.for.inc13:
7994 // CHECK13-NEXT: [[TMP9:%.*]] = load i32, ptr [[DOTOMP_IV5]], align 4, !llvm.access.group [[ACC_GRP21]]
7995 // CHECK13-NEXT: [[ADD14:%.*]] = add nsw i32 [[TMP9]], 1
7996 // CHECK13-NEXT: store i32 [[ADD14]], ptr [[DOTOMP_IV5]], align 4, !llvm.access.group [[ACC_GRP21]]
7997 // CHECK13-NEXT: br label [[OMP_INNER_FOR_COND7]], !llvm.loop [[LOOP22:![0-9]+]]
7998 // CHECK13: omp.inner.for.end15:
7999 // CHECK13-NEXT: store i32 100, ptr [[I6]], align 4
8000 // CHECK13-NEXT: [[TMP10:%.*]] = load i32, ptr [[ARG_ADDR]], align 4
8001 // CHECK13-NEXT: [[TOBOOL:%.*]] = icmp ne i32 [[TMP10]], 0
8002 // CHECK13-NEXT: [[FROMBOOL:%.*]] = zext i1 [[TOBOOL]] to i8
8003 // CHECK13-NEXT: store i8 [[FROMBOOL]], ptr [[DOTCAPTURE_EXPR_]], align 1
8004 // CHECK13-NEXT: store i32 0, ptr [[DOTOMP_LB17]], align 4
8005 // CHECK13-NEXT: store i32 99, ptr [[DOTOMP_UB18]], align 4
8006 // CHECK13-NEXT: [[TMP11:%.*]] = load i32, ptr [[DOTOMP_LB17]], align 4
8007 // CHECK13-NEXT: store i32 [[TMP11]], ptr [[DOTOMP_IV19]], align 4
8008 // CHECK13-NEXT: br label [[OMP_INNER_FOR_COND21:%.*]]
8009 // CHECK13: omp.inner.for.cond21:
8010 // CHECK13-NEXT: [[TMP12:%.*]] = load i32, ptr [[DOTOMP_IV19]], align 4, !llvm.access.group [[ACC_GRP24:![0-9]+]]
8011 // CHECK13-NEXT: [[TMP13:%.*]] = load i32, ptr [[DOTOMP_UB18]], align 4, !llvm.access.group [[ACC_GRP24]]
8012 // CHECK13-NEXT: [[CMP22:%.*]] = icmp sle i32 [[TMP12]], [[TMP13]]
8013 // CHECK13-NEXT: br i1 [[CMP22]], label [[OMP_INNER_FOR_BODY23:%.*]], label [[OMP_INNER_FOR_END29:%.*]]
8014 // CHECK13: omp.inner.for.body23:
8015 // CHECK13-NEXT: [[TMP14:%.*]] = load i32, ptr [[DOTOMP_IV19]], align 4, !llvm.access.group [[ACC_GRP24]]
8016 // CHECK13-NEXT: [[MUL24:%.*]] = mul nsw i32 [[TMP14]], 1
8017 // CHECK13-NEXT: [[ADD25:%.*]] = add nsw i32 0, [[MUL24]]
8018 // CHECK13-NEXT: store i32 [[ADD25]], ptr [[I20]], align 4, !llvm.access.group [[ACC_GRP24]]
8019 // CHECK13-NEXT: call void @_Z3fn3v(), !llvm.access.group [[ACC_GRP24]]
8020 // CHECK13-NEXT: br label [[OMP_BODY_CONTINUE26:%.*]]
8021 // CHECK13: omp.body.continue26:
8022 // CHECK13-NEXT: br label [[OMP_INNER_FOR_INC27:%.*]]
8023 // CHECK13: omp.inner.for.inc27:
8024 // CHECK13-NEXT: [[TMP15:%.*]] = load i32, ptr [[DOTOMP_IV19]], align 4, !llvm.access.group [[ACC_GRP24]]
8025 // CHECK13-NEXT: [[ADD28:%.*]] = add nsw i32 [[TMP15]], 1
8026 // CHECK13-NEXT: store i32 [[ADD28]], ptr [[DOTOMP_IV19]], align 4, !llvm.access.group [[ACC_GRP24]]
8027 // CHECK13-NEXT: br label [[OMP_INNER_FOR_COND21]], !llvm.loop [[LOOP25:![0-9]+]]
8028 // CHECK13: omp.inner.for.end29:
8029 // CHECK13-NEXT: store i32 100, ptr [[I20]], align 4
8030 // CHECK13-NEXT: ret i32 0
8033 // CHECK15-LABEL: define {{[^@]+}}@_Z9gtid_testv
8034 // CHECK15-SAME: () #[[ATTR0:[0-9]+]] {
8035 // CHECK15-NEXT: entry:
8036 // CHECK15-NEXT: [[TMP:%.*]] = alloca i32, align 4
8037 // CHECK15-NEXT: [[DOTOMP_LB:%.*]] = alloca i32, align 4
8038 // CHECK15-NEXT: [[DOTOMP_UB:%.*]] = alloca i32, align 4
8039 // CHECK15-NEXT: [[DOTOMP_IV:%.*]] = alloca i32, align 4
8040 // CHECK15-NEXT: [[I:%.*]] = alloca i32, align 4
8041 // CHECK15-NEXT: [[_TMP2:%.*]] = alloca i32, align 4
8042 // CHECK15-NEXT: [[DOTOMP_LB3:%.*]] = alloca i32, align 4
8043 // CHECK15-NEXT: [[DOTOMP_UB4:%.*]] = alloca i32, align 4
8044 // CHECK15-NEXT: [[DOTOMP_IV5:%.*]] = alloca i32, align 4
8045 // CHECK15-NEXT: [[I6:%.*]] = alloca i32, align 4
8046 // CHECK15-NEXT: store i32 0, ptr [[DOTOMP_LB]], align 4
8047 // CHECK15-NEXT: store i32 99, ptr [[DOTOMP_UB]], align 4
8048 // CHECK15-NEXT: [[TMP0:%.*]] = load i32, ptr [[DOTOMP_LB]], align 4
8049 // CHECK15-NEXT: store i32 [[TMP0]], ptr [[DOTOMP_IV]], align 4
8050 // CHECK15-NEXT: br label [[OMP_INNER_FOR_COND:%.*]]
8051 // CHECK15: omp.inner.for.cond:
8052 // CHECK15-NEXT: [[TMP1:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP2:![0-9]+]]
8053 // CHECK15-NEXT: [[TMP2:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4, !llvm.access.group [[ACC_GRP2]]
8054 // CHECK15-NEXT: [[CMP:%.*]] = icmp sle i32 [[TMP1]], [[TMP2]]
8055 // CHECK15-NEXT: br i1 [[CMP]], label [[OMP_INNER_FOR_BODY:%.*]], label [[OMP_INNER_FOR_END:%.*]]
8056 // CHECK15: omp.inner.for.body:
8057 // CHECK15-NEXT: [[TMP3:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP2]]
8058 // CHECK15-NEXT: [[MUL:%.*]] = mul nsw i32 [[TMP3]], 1
8059 // CHECK15-NEXT: [[ADD:%.*]] = add nsw i32 0, [[MUL]]
8060 // CHECK15-NEXT: store i32 [[ADD]], ptr [[I]], align 4, !llvm.access.group [[ACC_GRP2]]
8061 // CHECK15-NEXT: br label [[OMP_BODY_CONTINUE:%.*]]
8062 // CHECK15: omp.body.continue:
8063 // CHECK15-NEXT: br label [[OMP_INNER_FOR_INC:%.*]]
8064 // CHECK15: omp.inner.for.inc:
8065 // CHECK15-NEXT: [[TMP4:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP2]]
8066 // CHECK15-NEXT: [[ADD1:%.*]] = add nsw i32 [[TMP4]], 1
8067 // CHECK15-NEXT: store i32 [[ADD1]], ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP2]]
8068 // CHECK15-NEXT: br label [[OMP_INNER_FOR_COND]], !llvm.loop [[LOOP3:![0-9]+]]
8069 // CHECK15: omp.inner.for.end:
8070 // CHECK15-NEXT: store i32 100, ptr [[I]], align 4
8071 // CHECK15-NEXT: store i32 0, ptr [[DOTOMP_LB3]], align 4
8072 // CHECK15-NEXT: store i32 99, ptr [[DOTOMP_UB4]], align 4
8073 // CHECK15-NEXT: [[TMP5:%.*]] = load i32, ptr [[DOTOMP_LB3]], align 4
8074 // CHECK15-NEXT: store i32 [[TMP5]], ptr [[DOTOMP_IV5]], align 4
8075 // CHECK15-NEXT: br label [[OMP_INNER_FOR_COND7:%.*]]
8076 // CHECK15: omp.inner.for.cond7:
8077 // CHECK15-NEXT: [[TMP6:%.*]] = load i32, ptr [[DOTOMP_IV5]], align 4, !llvm.access.group [[ACC_GRP6:![0-9]+]]
8078 // CHECK15-NEXT: [[TMP7:%.*]] = load i32, ptr [[DOTOMP_UB4]], align 4, !llvm.access.group [[ACC_GRP6]]
8079 // CHECK15-NEXT: [[CMP8:%.*]] = icmp sle i32 [[TMP6]], [[TMP7]]
8080 // CHECK15-NEXT: br i1 [[CMP8]], label [[OMP_INNER_FOR_BODY9:%.*]], label [[OMP_INNER_FOR_END15:%.*]]
8081 // CHECK15: omp.inner.for.body9:
8082 // CHECK15-NEXT: [[TMP8:%.*]] = load i32, ptr [[DOTOMP_IV5]], align 4, !llvm.access.group [[ACC_GRP6]]
8083 // CHECK15-NEXT: [[MUL10:%.*]] = mul nsw i32 [[TMP8]], 1
8084 // CHECK15-NEXT: [[ADD11:%.*]] = add nsw i32 0, [[MUL10]]
8085 // CHECK15-NEXT: store i32 [[ADD11]], ptr [[I6]], align 4, !llvm.access.group [[ACC_GRP6]]
8086 // CHECK15-NEXT: call void @_Z9gtid_testv(), !llvm.access.group [[ACC_GRP6]]
8087 // CHECK15-NEXT: br label [[OMP_BODY_CONTINUE12:%.*]]
8088 // CHECK15: omp.body.continue12:
8089 // CHECK15-NEXT: br label [[OMP_INNER_FOR_INC13:%.*]]
8090 // CHECK15: omp.inner.for.inc13:
8091 // CHECK15-NEXT: [[TMP9:%.*]] = load i32, ptr [[DOTOMP_IV5]], align 4, !llvm.access.group [[ACC_GRP6]]
8092 // CHECK15-NEXT: [[ADD14:%.*]] = add nsw i32 [[TMP9]], 1
8093 // CHECK15-NEXT: store i32 [[ADD14]], ptr [[DOTOMP_IV5]], align 4, !llvm.access.group [[ACC_GRP6]]
8094 // CHECK15-NEXT: br label [[OMP_INNER_FOR_COND7]], !llvm.loop [[LOOP7:![0-9]+]]
8095 // CHECK15: omp.inner.for.end15:
8096 // CHECK15-NEXT: store i32 100, ptr [[I6]], align 4
8097 // CHECK15-NEXT: ret void
8100 // CHECK15-LABEL: define {{[^@]+}}@main
8101 // CHECK15-SAME: () #[[ATTR1:[0-9]+]] {
8102 // CHECK15-NEXT: entry:
8103 // CHECK15-NEXT: [[RETVAL:%.*]] = alloca i32, align 4
8104 // CHECK15-NEXT: [[TMP:%.*]] = alloca i32, align 4
8105 // CHECK15-NEXT: [[DOTOMP_LB:%.*]] = alloca i32, align 4
8106 // CHECK15-NEXT: [[DOTOMP_UB:%.*]] = alloca i32, align 4
8107 // CHECK15-NEXT: [[DOTOMP_IV:%.*]] = alloca i32, align 4
8108 // CHECK15-NEXT: [[I:%.*]] = alloca i32, align 4
8109 // CHECK15-NEXT: [[_TMP2:%.*]] = alloca i32, align 4
8110 // CHECK15-NEXT: [[DOTOMP_LB3:%.*]] = alloca i32, align 4
8111 // CHECK15-NEXT: [[DOTOMP_UB4:%.*]] = alloca i32, align 4
8112 // CHECK15-NEXT: [[DOTOMP_IV5:%.*]] = alloca i32, align 4
8113 // CHECK15-NEXT: [[I6:%.*]] = alloca i32, align 4
8114 // CHECK15-NEXT: [[DOTCAPTURE_EXPR_:%.*]] = alloca i8, align 1
8115 // CHECK15-NEXT: [[_TMP16:%.*]] = alloca i32, align 4
8116 // CHECK15-NEXT: [[DOTOMP_LB17:%.*]] = alloca i32, align 4
8117 // CHECK15-NEXT: [[DOTOMP_UB18:%.*]] = alloca i32, align 4
8118 // CHECK15-NEXT: [[DOTOMP_IV19:%.*]] = alloca i32, align 4
8119 // CHECK15-NEXT: [[I20:%.*]] = alloca i32, align 4
8120 // CHECK15-NEXT: store i32 0, ptr [[RETVAL]], align 4
8121 // CHECK15-NEXT: store i32 0, ptr [[DOTOMP_LB]], align 4
8122 // CHECK15-NEXT: store i32 99, ptr [[DOTOMP_UB]], align 4
8123 // CHECK15-NEXT: [[TMP0:%.*]] = load i32, ptr [[DOTOMP_LB]], align 4
8124 // CHECK15-NEXT: store i32 [[TMP0]], ptr [[DOTOMP_IV]], align 4
8125 // CHECK15-NEXT: br label [[OMP_INNER_FOR_COND:%.*]]
8126 // CHECK15: omp.inner.for.cond:
8127 // CHECK15-NEXT: [[TMP1:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP9:![0-9]+]]
8128 // CHECK15-NEXT: [[TMP2:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4, !llvm.access.group [[ACC_GRP9]]
8129 // CHECK15-NEXT: [[CMP:%.*]] = icmp sle i32 [[TMP1]], [[TMP2]]
8130 // CHECK15-NEXT: br i1 [[CMP]], label [[OMP_INNER_FOR_BODY:%.*]], label [[OMP_INNER_FOR_END:%.*]]
8131 // CHECK15: omp.inner.for.body:
8132 // CHECK15-NEXT: [[TMP3:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP9]]
8133 // CHECK15-NEXT: [[MUL:%.*]] = mul nsw i32 [[TMP3]], 1
8134 // CHECK15-NEXT: [[ADD:%.*]] = add nsw i32 0, [[MUL]]
8135 // CHECK15-NEXT: store i32 [[ADD]], ptr [[I]], align 4, !llvm.access.group [[ACC_GRP9]]
8136 // CHECK15-NEXT: call void @_Z3fn4v(), !llvm.access.group [[ACC_GRP9]]
8137 // CHECK15-NEXT: br label [[OMP_BODY_CONTINUE:%.*]]
8138 // CHECK15: omp.body.continue:
8139 // CHECK15-NEXT: br label [[OMP_INNER_FOR_INC:%.*]]
8140 // CHECK15: omp.inner.for.inc:
8141 // CHECK15-NEXT: [[TMP4:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP9]]
8142 // CHECK15-NEXT: [[ADD1:%.*]] = add nsw i32 [[TMP4]], 1
8143 // CHECK15-NEXT: store i32 [[ADD1]], ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP9]]
8144 // CHECK15-NEXT: br label [[OMP_INNER_FOR_COND]], !llvm.loop [[LOOP10:![0-9]+]]
8145 // CHECK15: omp.inner.for.end:
8146 // CHECK15-NEXT: store i32 100, ptr [[I]], align 4
8147 // CHECK15-NEXT: store i32 0, ptr [[DOTOMP_LB3]], align 4
8148 // CHECK15-NEXT: store i32 99, ptr [[DOTOMP_UB4]], align 4
8149 // CHECK15-NEXT: [[TMP5:%.*]] = load i32, ptr [[DOTOMP_LB3]], align 4
8150 // CHECK15-NEXT: store i32 [[TMP5]], ptr [[DOTOMP_IV5]], align 4
8151 // CHECK15-NEXT: br label [[OMP_INNER_FOR_COND7:%.*]]
8152 // CHECK15: omp.inner.for.cond7:
8153 // CHECK15-NEXT: [[TMP6:%.*]] = load i32, ptr [[DOTOMP_IV5]], align 4
8154 // CHECK15-NEXT: [[TMP7:%.*]] = load i32, ptr [[DOTOMP_UB4]], align 4
8155 // CHECK15-NEXT: [[CMP8:%.*]] = icmp sle i32 [[TMP6]], [[TMP7]]
8156 // CHECK15-NEXT: br i1 [[CMP8]], label [[OMP_INNER_FOR_BODY9:%.*]], label [[OMP_INNER_FOR_END15:%.*]]
8157 // CHECK15: omp.inner.for.body9:
8158 // CHECK15-NEXT: [[TMP8:%.*]] = load i32, ptr [[DOTOMP_IV5]], align 4
8159 // CHECK15-NEXT: [[MUL10:%.*]] = mul nsw i32 [[TMP8]], 1
8160 // CHECK15-NEXT: [[ADD11:%.*]] = add nsw i32 0, [[MUL10]]
8161 // CHECK15-NEXT: store i32 [[ADD11]], ptr [[I6]], align 4
8162 // CHECK15-NEXT: call void @_Z3fn5v()
8163 // CHECK15-NEXT: br label [[OMP_BODY_CONTINUE12:%.*]]
8164 // CHECK15: omp.body.continue12:
8165 // CHECK15-NEXT: br label [[OMP_INNER_FOR_INC13:%.*]]
8166 // CHECK15: omp.inner.for.inc13:
8167 // CHECK15-NEXT: [[TMP9:%.*]] = load i32, ptr [[DOTOMP_IV5]], align 4
8168 // CHECK15-NEXT: [[ADD14:%.*]] = add nsw i32 [[TMP9]], 1
8169 // CHECK15-NEXT: store i32 [[ADD14]], ptr [[DOTOMP_IV5]], align 4
8170 // CHECK15-NEXT: br label [[OMP_INNER_FOR_COND7]], !llvm.loop [[LOOP12:![0-9]+]]
8171 // CHECK15: omp.inner.for.end15:
8172 // CHECK15-NEXT: store i32 100, ptr [[I6]], align 4
8173 // CHECK15-NEXT: [[TMP10:%.*]] = load i32, ptr @Arg, align 4
8174 // CHECK15-NEXT: [[TOBOOL:%.*]] = icmp ne i32 [[TMP10]], 0
8175 // CHECK15-NEXT: [[FROMBOOL:%.*]] = zext i1 [[TOBOOL]] to i8
8176 // CHECK15-NEXT: store i8 [[FROMBOOL]], ptr [[DOTCAPTURE_EXPR_]], align 1
8177 // CHECK15-NEXT: store i32 0, ptr [[DOTOMP_LB17]], align 4
8178 // CHECK15-NEXT: store i32 99, ptr [[DOTOMP_UB18]], align 4
8179 // CHECK15-NEXT: [[TMP11:%.*]] = load i32, ptr [[DOTOMP_LB17]], align 4
8180 // CHECK15-NEXT: store i32 [[TMP11]], ptr [[DOTOMP_IV19]], align 4
8181 // CHECK15-NEXT: [[TMP12:%.*]] = load i8, ptr [[DOTCAPTURE_EXPR_]], align 1
8182 // CHECK15-NEXT: [[TOBOOL21:%.*]] = trunc i8 [[TMP12]] to i1
8183 // CHECK15-NEXT: br i1 [[TOBOOL21]], label [[OMP_IF_THEN:%.*]], label [[OMP_IF_ELSE:%.*]]
8184 // CHECK15: omp_if.then:
8185 // CHECK15-NEXT: br label [[OMP_INNER_FOR_COND22:%.*]]
8186 // CHECK15: omp.inner.for.cond22:
8187 // CHECK15-NEXT: [[TMP13:%.*]] = load i32, ptr [[DOTOMP_IV19]], align 4, !llvm.access.group [[ACC_GRP14:![0-9]+]]
8188 // CHECK15-NEXT: [[TMP14:%.*]] = load i32, ptr [[DOTOMP_UB18]], align 4, !llvm.access.group [[ACC_GRP14]]
8189 // CHECK15-NEXT: [[CMP23:%.*]] = icmp sle i32 [[TMP13]], [[TMP14]]
8190 // CHECK15-NEXT: br i1 [[CMP23]], label [[OMP_INNER_FOR_BODY24:%.*]], label [[OMP_INNER_FOR_END30:%.*]]
8191 // CHECK15: omp.inner.for.body24:
8192 // CHECK15-NEXT: [[TMP15:%.*]] = load i32, ptr [[DOTOMP_IV19]], align 4, !llvm.access.group [[ACC_GRP14]]
8193 // CHECK15-NEXT: [[MUL25:%.*]] = mul nsw i32 [[TMP15]], 1
8194 // CHECK15-NEXT: [[ADD26:%.*]] = add nsw i32 0, [[MUL25]]
8195 // CHECK15-NEXT: store i32 [[ADD26]], ptr [[I20]], align 4, !llvm.access.group [[ACC_GRP14]]
8196 // CHECK15-NEXT: call void @_Z3fn6v(), !llvm.access.group [[ACC_GRP14]]
8197 // CHECK15-NEXT: br label [[OMP_BODY_CONTINUE27:%.*]]
8198 // CHECK15: omp.body.continue27:
8199 // CHECK15-NEXT: br label [[OMP_INNER_FOR_INC28:%.*]]
8200 // CHECK15: omp.inner.for.inc28:
8201 // CHECK15-NEXT: [[TMP16:%.*]] = load i32, ptr [[DOTOMP_IV19]], align 4, !llvm.access.group [[ACC_GRP14]]
8202 // CHECK15-NEXT: [[ADD29:%.*]] = add nsw i32 [[TMP16]], 1
8203 // CHECK15-NEXT: store i32 [[ADD29]], ptr [[DOTOMP_IV19]], align 4, !llvm.access.group [[ACC_GRP14]]
8204 // CHECK15-NEXT: br label [[OMP_INNER_FOR_COND22]], !llvm.loop [[LOOP15:![0-9]+]]
8205 // CHECK15: omp.inner.for.end30:
8206 // CHECK15-NEXT: br label [[OMP_IF_END:%.*]]
8207 // CHECK15: omp_if.else:
8208 // CHECK15-NEXT: br label [[OMP_INNER_FOR_COND31:%.*]]
8209 // CHECK15: omp.inner.for.cond31:
8210 // CHECK15-NEXT: [[TMP17:%.*]] = load i32, ptr [[DOTOMP_IV19]], align 4
8211 // CHECK15-NEXT: [[TMP18:%.*]] = load i32, ptr [[DOTOMP_UB18]], align 4
8212 // CHECK15-NEXT: [[CMP32:%.*]] = icmp sle i32 [[TMP17]], [[TMP18]]
8213 // CHECK15-NEXT: br i1 [[CMP32]], label [[OMP_INNER_FOR_BODY33:%.*]], label [[OMP_INNER_FOR_END39:%.*]]
8214 // CHECK15: omp.inner.for.body33:
8215 // CHECK15-NEXT: [[TMP19:%.*]] = load i32, ptr [[DOTOMP_IV19]], align 4
8216 // CHECK15-NEXT: [[MUL34:%.*]] = mul nsw i32 [[TMP19]], 1
8217 // CHECK15-NEXT: [[ADD35:%.*]] = add nsw i32 0, [[MUL34]]
8218 // CHECK15-NEXT: store i32 [[ADD35]], ptr [[I20]], align 4
8219 // CHECK15-NEXT: call void @_Z3fn6v()
8220 // CHECK15-NEXT: br label [[OMP_BODY_CONTINUE36:%.*]]
8221 // CHECK15: omp.body.continue36:
8222 // CHECK15-NEXT: br label [[OMP_INNER_FOR_INC37:%.*]]
8223 // CHECK15: omp.inner.for.inc37:
8224 // CHECK15-NEXT: [[TMP20:%.*]] = load i32, ptr [[DOTOMP_IV19]], align 4
8225 // CHECK15-NEXT: [[ADD38:%.*]] = add nsw i32 [[TMP20]], 1
8226 // CHECK15-NEXT: store i32 [[ADD38]], ptr [[DOTOMP_IV19]], align 4
8227 // CHECK15-NEXT: br label [[OMP_INNER_FOR_COND31]], !llvm.loop [[LOOP17:![0-9]+]]
8228 // CHECK15: omp.inner.for.end39:
8229 // CHECK15-NEXT: br label [[OMP_IF_END]]
8230 // CHECK15: omp_if.end:
8231 // CHECK15-NEXT: store i32 100, ptr [[I20]], align 4
8232 // CHECK15-NEXT: [[TMP21:%.*]] = load i32, ptr @Arg, align 4
8233 // CHECK15-NEXT: [[CALL:%.*]] = call noundef i32 @_Z5tmainIiEiT_(i32 noundef [[TMP21]])
8234 // CHECK15-NEXT: ret i32 [[CALL]]
8237 // CHECK15-LABEL: define {{[^@]+}}@_Z5tmainIiEiT_
8238 // CHECK15-SAME: (i32 noundef [[ARG:%.*]]) #[[ATTR0]] comdat {
8239 // CHECK15-NEXT: entry:
8240 // CHECK15-NEXT: [[ARG_ADDR:%.*]] = alloca i32, align 4
8241 // CHECK15-NEXT: [[TMP:%.*]] = alloca i32, align 4
8242 // CHECK15-NEXT: [[DOTOMP_LB:%.*]] = alloca i32, align 4
8243 // CHECK15-NEXT: [[DOTOMP_UB:%.*]] = alloca i32, align 4
8244 // CHECK15-NEXT: [[DOTOMP_IV:%.*]] = alloca i32, align 4
8245 // CHECK15-NEXT: [[I:%.*]] = alloca i32, align 4
8246 // CHECK15-NEXT: [[_TMP2:%.*]] = alloca i32, align 4
8247 // CHECK15-NEXT: [[DOTOMP_LB3:%.*]] = alloca i32, align 4
8248 // CHECK15-NEXT: [[DOTOMP_UB4:%.*]] = alloca i32, align 4
8249 // CHECK15-NEXT: [[DOTOMP_IV5:%.*]] = alloca i32, align 4
8250 // CHECK15-NEXT: [[I6:%.*]] = alloca i32, align 4
8251 // CHECK15-NEXT: [[DOTCAPTURE_EXPR_:%.*]] = alloca i8, align 1
8252 // CHECK15-NEXT: [[_TMP16:%.*]] = alloca i32, align 4
8253 // CHECK15-NEXT: [[DOTOMP_LB17:%.*]] = alloca i32, align 4
8254 // CHECK15-NEXT: [[DOTOMP_UB18:%.*]] = alloca i32, align 4
8255 // CHECK15-NEXT: [[DOTOMP_IV19:%.*]] = alloca i32, align 4
8256 // CHECK15-NEXT: [[I20:%.*]] = alloca i32, align 4
8257 // CHECK15-NEXT: store i32 [[ARG]], ptr [[ARG_ADDR]], align 4
8258 // CHECK15-NEXT: store i32 0, ptr [[DOTOMP_LB]], align 4
8259 // CHECK15-NEXT: store i32 99, ptr [[DOTOMP_UB]], align 4
8260 // CHECK15-NEXT: [[TMP0:%.*]] = load i32, ptr [[DOTOMP_LB]], align 4
8261 // CHECK15-NEXT: store i32 [[TMP0]], ptr [[DOTOMP_IV]], align 4
8262 // CHECK15-NEXT: br label [[OMP_INNER_FOR_COND:%.*]]
8263 // CHECK15: omp.inner.for.cond:
8264 // CHECK15-NEXT: [[TMP1:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP18:![0-9]+]]
8265 // CHECK15-NEXT: [[TMP2:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4, !llvm.access.group [[ACC_GRP18]]
8266 // CHECK15-NEXT: [[CMP:%.*]] = icmp sle i32 [[TMP1]], [[TMP2]]
8267 // CHECK15-NEXT: br i1 [[CMP]], label [[OMP_INNER_FOR_BODY:%.*]], label [[OMP_INNER_FOR_END:%.*]]
8268 // CHECK15: omp.inner.for.body:
8269 // CHECK15-NEXT: [[TMP3:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP18]]
8270 // CHECK15-NEXT: [[MUL:%.*]] = mul nsw i32 [[TMP3]], 1
8271 // CHECK15-NEXT: [[ADD:%.*]] = add nsw i32 0, [[MUL]]
8272 // CHECK15-NEXT: store i32 [[ADD]], ptr [[I]], align 4, !llvm.access.group [[ACC_GRP18]]
8273 // CHECK15-NEXT: call void @_Z3fn1v(), !llvm.access.group [[ACC_GRP18]]
8274 // CHECK15-NEXT: br label [[OMP_BODY_CONTINUE:%.*]]
8275 // CHECK15: omp.body.continue:
8276 // CHECK15-NEXT: br label [[OMP_INNER_FOR_INC:%.*]]
8277 // CHECK15: omp.inner.for.inc:
8278 // CHECK15-NEXT: [[TMP4:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP18]]
8279 // CHECK15-NEXT: [[ADD1:%.*]] = add nsw i32 [[TMP4]], 1
8280 // CHECK15-NEXT: store i32 [[ADD1]], ptr [[DOTOMP_IV]], align 4, !llvm.access.group [[ACC_GRP18]]
8281 // CHECK15-NEXT: br label [[OMP_INNER_FOR_COND]], !llvm.loop [[LOOP19:![0-9]+]]
8282 // CHECK15: omp.inner.for.end:
8283 // CHECK15-NEXT: store i32 100, ptr [[I]], align 4
8284 // CHECK15-NEXT: store i32 0, ptr [[DOTOMP_LB3]], align 4
8285 // CHECK15-NEXT: store i32 99, ptr [[DOTOMP_UB4]], align 4
8286 // CHECK15-NEXT: [[TMP5:%.*]] = load i32, ptr [[DOTOMP_LB3]], align 4
8287 // CHECK15-NEXT: store i32 [[TMP5]], ptr [[DOTOMP_IV5]], align 4
8288 // CHECK15-NEXT: br label [[OMP_INNER_FOR_COND7:%.*]]
8289 // CHECK15: omp.inner.for.cond7:
8290 // CHECK15-NEXT: [[TMP6:%.*]] = load i32, ptr [[DOTOMP_IV5]], align 4
8291 // CHECK15-NEXT: [[TMP7:%.*]] = load i32, ptr [[DOTOMP_UB4]], align 4
8292 // CHECK15-NEXT: [[CMP8:%.*]] = icmp sle i32 [[TMP6]], [[TMP7]]
8293 // CHECK15-NEXT: br i1 [[CMP8]], label [[OMP_INNER_FOR_BODY9:%.*]], label [[OMP_INNER_FOR_END15:%.*]]
8294 // CHECK15: omp.inner.for.body9:
8295 // CHECK15-NEXT: [[TMP8:%.*]] = load i32, ptr [[DOTOMP_IV5]], align 4
8296 // CHECK15-NEXT: [[MUL10:%.*]] = mul nsw i32 [[TMP8]], 1
8297 // CHECK15-NEXT: [[ADD11:%.*]] = add nsw i32 0, [[MUL10]]
8298 // CHECK15-NEXT: store i32 [[ADD11]], ptr [[I6]], align 4
8299 // CHECK15-NEXT: call void @_Z3fn2v()
8300 // CHECK15-NEXT: br label [[OMP_BODY_CONTINUE12:%.*]]
8301 // CHECK15: omp.body.continue12:
8302 // CHECK15-NEXT: br label [[OMP_INNER_FOR_INC13:%.*]]
8303 // CHECK15: omp.inner.for.inc13:
8304 // CHECK15-NEXT: [[TMP9:%.*]] = load i32, ptr [[DOTOMP_IV5]], align 4
8305 // CHECK15-NEXT: [[ADD14:%.*]] = add nsw i32 [[TMP9]], 1
8306 // CHECK15-NEXT: store i32 [[ADD14]], ptr [[DOTOMP_IV5]], align 4
8307 // CHECK15-NEXT: br label [[OMP_INNER_FOR_COND7]], !llvm.loop [[LOOP21:![0-9]+]]
8308 // CHECK15: omp.inner.for.end15:
8309 // CHECK15-NEXT: store i32 100, ptr [[I6]], align 4
8310 // CHECK15-NEXT: [[TMP10:%.*]] = load i32, ptr [[ARG_ADDR]], align 4
8311 // CHECK15-NEXT: [[TOBOOL:%.*]] = icmp ne i32 [[TMP10]], 0
8312 // CHECK15-NEXT: [[FROMBOOL:%.*]] = zext i1 [[TOBOOL]] to i8
8313 // CHECK15-NEXT: store i8 [[FROMBOOL]], ptr [[DOTCAPTURE_EXPR_]], align 1
8314 // CHECK15-NEXT: store i32 0, ptr [[DOTOMP_LB17]], align 4
8315 // CHECK15-NEXT: store i32 99, ptr [[DOTOMP_UB18]], align 4
8316 // CHECK15-NEXT: [[TMP11:%.*]] = load i32, ptr [[DOTOMP_LB17]], align 4
8317 // CHECK15-NEXT: store i32 [[TMP11]], ptr [[DOTOMP_IV19]], align 4
8318 // CHECK15-NEXT: br label [[OMP_INNER_FOR_COND21:%.*]]
8319 // CHECK15: omp.inner.for.cond21:
8320 // CHECK15-NEXT: [[TMP12:%.*]] = load i32, ptr [[DOTOMP_IV19]], align 4, !llvm.access.group [[ACC_GRP22:![0-9]+]]
8321 // CHECK15-NEXT: [[TMP13:%.*]] = load i32, ptr [[DOTOMP_UB18]], align 4, !llvm.access.group [[ACC_GRP22]]
8322 // CHECK15-NEXT: [[CMP22:%.*]] = icmp sle i32 [[TMP12]], [[TMP13]]
8323 // CHECK15-NEXT: br i1 [[CMP22]], label [[OMP_INNER_FOR_BODY23:%.*]], label [[OMP_INNER_FOR_END29:%.*]]
8324 // CHECK15: omp.inner.for.body23:
8325 // CHECK15-NEXT: [[TMP14:%.*]] = load i32, ptr [[DOTOMP_IV19]], align 4, !llvm.access.group [[ACC_GRP22]]
8326 // CHECK15-NEXT: [[MUL24:%.*]] = mul nsw i32 [[TMP14]], 1
8327 // CHECK15-NEXT: [[ADD25:%.*]] = add nsw i32 0, [[MUL24]]
8328 // CHECK15-NEXT: store i32 [[ADD25]], ptr [[I20]], align 4, !llvm.access.group [[ACC_GRP22]]
8329 // CHECK15-NEXT: call void @_Z3fn3v(), !llvm.access.group [[ACC_GRP22]]
8330 // CHECK15-NEXT: br label [[OMP_BODY_CONTINUE26:%.*]]
8331 // CHECK15: omp.body.continue26:
8332 // CHECK15-NEXT: br label [[OMP_INNER_FOR_INC27:%.*]]
8333 // CHECK15: omp.inner.for.inc27:
8334 // CHECK15-NEXT: [[TMP15:%.*]] = load i32, ptr [[DOTOMP_IV19]], align 4, !llvm.access.group [[ACC_GRP22]]
8335 // CHECK15-NEXT: [[ADD28:%.*]] = add nsw i32 [[TMP15]], 1
8336 // CHECK15-NEXT: store i32 [[ADD28]], ptr [[DOTOMP_IV19]], align 4, !llvm.access.group [[ACC_GRP22]]
8337 // CHECK15-NEXT: br label [[OMP_INNER_FOR_COND21]], !llvm.loop [[LOOP23:![0-9]+]]
8338 // CHECK15: omp.inner.for.end29:
8339 // CHECK15-NEXT: store i32 100, ptr [[I20]], align 4
8340 // CHECK15-NEXT: ret i32 0