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
6 // 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 --implicit-check-not="{{__kmpc|__tgt}}"
7 // 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
8 // 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 --implicit-check-not="{{__kmpc|__tgt}}"
10 // RUN: %clang_cc1 -verify -fopenmp -fopenmp-targets=powerpc64le-ibm-linux-gnu -x c++ -triple x86_64-unknown-unknown -emit-llvm %s -o - | FileCheck %s --check-prefix=CHECK1
11 // RUN: %clang_cc1 -fopenmp -fopenmp-targets=powerpc64le-ibm-linux-gnu -x c++ -std=c++11 -triple x86_64-unknown-unknown -emit-pch -o %t %s
12 // RUN: %clang_cc1 -fopenmp -fopenmp-targets=powerpc64le-ibm-linux-gnu -x c++ -triple x86_64-unknown-unknown -std=c++11 -include-pch %t -verify %s -emit-llvm -o - | FileCheck %s --check-prefix=CHECK1
14 // RUN: %clang_cc1 -verify -fopenmp-simd -fopenmp-targets=powerpc64le-ibm-linux-gnu -x c++ -triple x86_64-unknown-unknown -emit-llvm %s -o - | FileCheck %s --implicit-check-not="{{__kmpc|__tgt}}"
15 // RUN: %clang_cc1 -fopenmp-simd -fopenmp-targets=powerpc64le-ibm-linux-gnu -x c++ -std=c++11 -triple x86_64-unknown-unknown -emit-pch -o %t %s
16 // RUN: %clang_cc1 -fopenmp-simd -fopenmp-targets=powerpc64le-ibm-linux-gnu -x c++ -triple x86_64-unknown-unknown -std=c++11 -include-pch %t -verify %s -emit-llvm -o - | FileCheck %s --implicit-check-not="{{__kmpc|__tgt}}"
18 // 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=CHECK1
19 // 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
20 // 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=CHECK1
22 // 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 --implicit-check-not="{{__kmpc|__tgt}}"
23 // 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
24 // 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 --implicit-check-not="{{__kmpc|__tgt}}"
26 // RUN: %clang_cc1 -verify -fopenmp -fopenmp-targets=powerpc64le-ibm-linux-gnu -x c++ -triple aarch64-unknown-unknown -emit-llvm %s -o - | FileCheck %s --check-prefix=CHECK1
27 // RUN: %clang_cc1 -fopenmp -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 -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=CHECK1
30 // RUN: %clang_cc1 -verify -fopenmp-simd -fopenmp-targets=powerpc64le-ibm-linux-gnu -x c++ -triple aarch64-unknown-unknown -emit-llvm %s -o - | FileCheck %s --implicit-check-not="{{__kmpc|__tgt}}"
31 // RUN: %clang_cc1 -fopenmp-simd -fopenmp-targets=powerpc64le-ibm-linux-gnu -x c++ -std=c++11 -triple aarch64-unknown-unknown -emit-pch -o %t %s
32 // RUN: %clang_cc1 -fopenmp-simd -fopenmp-targets=powerpc64le-ibm-linux-gnu -x c++ -triple aarch64-unknown-unknown -std=c++11 -include-pch %t -verify %s -emit-llvm -o - | FileCheck %s --implicit-check-not="{{__kmpc|__tgt}}"
34 // expected-no-diagnostics
48 #pragma omp target teams loop
49 for(int i
= 0 ; i
< 100; i
++) {}
51 #pragma omp target teams loop if (target: false)
52 for(int i
= 0 ; i
< 100; i
++) {
60 #pragma omp target teams loop if (true)
61 for(int i
= 0 ; i
< 100; i
++) {
64 #pragma omp target teams loop if (false)
65 for(int i
= 0 ; i
< 100; i
++) {
68 #pragma omp target teams loop if (target: Arg)
69 for(int i
= 0 ; i
< 100; i
++) {
76 #pragma omp target teams loop if (true)
77 for(int i
= 0 ; i
< 100; i
++) {
83 #pragma omp target teams loop if (false)
84 for(int i
= 0 ; i
< 100; i
++) {
90 #pragma omp target teams loop if (Arg)
91 for(int i
= 0 ; i
< 100; i
++) {
105 // call void [[T_OUTLINE_FUN_3:@.+]](
108 // CHECK1-LABEL: define {{[^@]+}}@_Z9gtid_testv
109 // CHECK1-SAME: () #[[ATTR0:[0-9]+]] {
110 // CHECK1-NEXT: entry:
111 // CHECK1-NEXT: [[TMP:%.*]] = alloca i32, align 4
112 // CHECK1-NEXT: [[KERNEL_ARGS:%.*]] = alloca [[STRUCT___TGT_KERNEL_ARGUMENTS:%.*]], align 8
113 // CHECK1-NEXT: [[TMP0:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 0
114 // CHECK1-NEXT: store i32 2, ptr [[TMP0]], align 4
115 // CHECK1-NEXT: [[TMP1:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 1
116 // CHECK1-NEXT: store i32 0, ptr [[TMP1]], align 4
117 // CHECK1-NEXT: [[TMP2:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 2
118 // CHECK1-NEXT: store ptr null, ptr [[TMP2]], align 8
119 // CHECK1-NEXT: [[TMP3:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 3
120 // CHECK1-NEXT: store ptr null, ptr [[TMP3]], align 8
121 // CHECK1-NEXT: [[TMP4:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 4
122 // CHECK1-NEXT: store ptr null, ptr [[TMP4]], align 8
123 // CHECK1-NEXT: [[TMP5:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 5
124 // CHECK1-NEXT: store ptr null, ptr [[TMP5]], align 8
125 // CHECK1-NEXT: [[TMP6:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 6
126 // CHECK1-NEXT: store ptr null, ptr [[TMP6]], align 8
127 // CHECK1-NEXT: [[TMP7:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 7
128 // CHECK1-NEXT: store ptr null, ptr [[TMP7]], align 8
129 // CHECK1-NEXT: [[TMP8:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 8
130 // CHECK1-NEXT: store i64 100, ptr [[TMP8]], align 8
131 // CHECK1-NEXT: [[TMP9:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 9
132 // CHECK1-NEXT: store i64 0, ptr [[TMP9]], align 8
133 // CHECK1-NEXT: [[TMP10:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 10
134 // CHECK1-NEXT: store [3 x i32] zeroinitializer, ptr [[TMP10]], align 4
135 // CHECK1-NEXT: [[TMP11:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 11
136 // CHECK1-NEXT: store [3 x i32] zeroinitializer, ptr [[TMP11]], align 4
137 // CHECK1-NEXT: [[TMP12:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 12
138 // CHECK1-NEXT: store i32 0, ptr [[TMP12]], align 4
139 // 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_l48.region_id, ptr [[KERNEL_ARGS]])
140 // CHECK1-NEXT: [[TMP14:%.*]] = icmp ne i32 [[TMP13]], 0
141 // CHECK1-NEXT: br i1 [[TMP14]], label [[OMP_OFFLOAD_FAILED:%.*]], label [[OMP_OFFLOAD_CONT:%.*]]
142 // CHECK1: omp_offload.failed:
143 // CHECK1-NEXT: call void @{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z9gtid_testv_l48() #[[ATTR2:[0-9]+]]
144 // CHECK1-NEXT: br label [[OMP_OFFLOAD_CONT]]
145 // CHECK1: omp_offload.cont:
146 // CHECK1-NEXT: call void @{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z9gtid_testv_l51() #[[ATTR2]]
147 // CHECK1-NEXT: ret void
150 // CHECK1-LABEL: define {{[^@]+}}@{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z9gtid_testv_l48
151 // CHECK1-SAME: () #[[ATTR1:[0-9]+]] {
152 // CHECK1-NEXT: entry:
153 // CHECK1-NEXT: call void (ptr, i32, ptr, ...) @__kmpc_fork_teams(ptr @[[GLOB3]], i32 0, ptr @{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z9gtid_testv_l48.omp_outlined)
154 // CHECK1-NEXT: ret void
157 // CHECK1-LABEL: define {{[^@]+}}@{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z9gtid_testv_l48.omp_outlined
158 // CHECK1-SAME: (ptr noalias noundef [[DOTGLOBAL_TID_:%.*]], ptr noalias noundef [[DOTBOUND_TID_:%.*]]) #[[ATTR1]] {
159 // CHECK1-NEXT: entry:
160 // CHECK1-NEXT: [[DOTGLOBAL_TID__ADDR:%.*]] = alloca ptr, align 8
161 // CHECK1-NEXT: [[DOTBOUND_TID__ADDR:%.*]] = alloca ptr, align 8
162 // CHECK1-NEXT: [[DOTOMP_IV:%.*]] = alloca i32, align 4
163 // CHECK1-NEXT: [[TMP:%.*]] = alloca i32, align 4
164 // CHECK1-NEXT: [[DOTOMP_COMB_LB:%.*]] = alloca i32, align 4
165 // CHECK1-NEXT: [[DOTOMP_COMB_UB:%.*]] = alloca i32, align 4
166 // CHECK1-NEXT: [[DOTOMP_STRIDE:%.*]] = alloca i32, align 4
167 // CHECK1-NEXT: [[DOTOMP_IS_LAST:%.*]] = alloca i32, align 4
168 // CHECK1-NEXT: [[I:%.*]] = alloca i32, align 4
169 // CHECK1-NEXT: store ptr [[DOTGLOBAL_TID_]], ptr [[DOTGLOBAL_TID__ADDR]], align 8
170 // CHECK1-NEXT: store ptr [[DOTBOUND_TID_]], ptr [[DOTBOUND_TID__ADDR]], align 8
171 // CHECK1-NEXT: store i32 0, ptr [[DOTOMP_COMB_LB]], align 4
172 // CHECK1-NEXT: store i32 99, ptr [[DOTOMP_COMB_UB]], align 4
173 // CHECK1-NEXT: store i32 1, ptr [[DOTOMP_STRIDE]], align 4
174 // CHECK1-NEXT: store i32 0, ptr [[DOTOMP_IS_LAST]], align 4
175 // CHECK1-NEXT: [[TMP0:%.*]] = load ptr, ptr [[DOTGLOBAL_TID__ADDR]], align 8
176 // CHECK1-NEXT: [[TMP1:%.*]] = load i32, ptr [[TMP0]], align 4
177 // 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)
178 // CHECK1-NEXT: [[TMP2:%.*]] = load i32, ptr [[DOTOMP_COMB_UB]], align 4
179 // CHECK1-NEXT: [[CMP:%.*]] = icmp sgt i32 [[TMP2]], 99
180 // CHECK1-NEXT: br i1 [[CMP]], label [[COND_TRUE:%.*]], label [[COND_FALSE:%.*]]
181 // CHECK1: cond.true:
182 // CHECK1-NEXT: br label [[COND_END:%.*]]
183 // CHECK1: cond.false:
184 // CHECK1-NEXT: [[TMP3:%.*]] = load i32, ptr [[DOTOMP_COMB_UB]], align 4
185 // CHECK1-NEXT: br label [[COND_END]]
187 // CHECK1-NEXT: [[COND:%.*]] = phi i32 [ 99, [[COND_TRUE]] ], [ [[TMP3]], [[COND_FALSE]] ]
188 // CHECK1-NEXT: store i32 [[COND]], ptr [[DOTOMP_COMB_UB]], align 4
189 // CHECK1-NEXT: [[TMP4:%.*]] = load i32, ptr [[DOTOMP_COMB_LB]], align 4
190 // CHECK1-NEXT: store i32 [[TMP4]], ptr [[DOTOMP_IV]], align 4
191 // CHECK1-NEXT: br label [[OMP_INNER_FOR_COND:%.*]]
192 // CHECK1: omp.inner.for.cond:
193 // CHECK1-NEXT: [[TMP5:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4
194 // CHECK1-NEXT: [[TMP6:%.*]] = load i32, ptr [[DOTOMP_COMB_UB]], align 4
195 // CHECK1-NEXT: [[CMP1:%.*]] = icmp sle i32 [[TMP5]], [[TMP6]]
196 // CHECK1-NEXT: br i1 [[CMP1]], label [[OMP_INNER_FOR_BODY:%.*]], label [[OMP_INNER_FOR_END:%.*]]
197 // CHECK1: omp.inner.for.body:
198 // CHECK1-NEXT: [[TMP7:%.*]] = load i32, ptr [[DOTOMP_COMB_LB]], align 4
199 // CHECK1-NEXT: [[TMP8:%.*]] = zext i32 [[TMP7]] to i64
200 // CHECK1-NEXT: [[TMP9:%.*]] = load i32, ptr [[DOTOMP_COMB_UB]], align 4
201 // CHECK1-NEXT: [[TMP10:%.*]] = zext i32 [[TMP9]] to i64
202 // 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_l48.omp_outlined.omp_outlined, i64 [[TMP8]], i64 [[TMP10]])
203 // CHECK1-NEXT: br label [[OMP_INNER_FOR_INC:%.*]]
204 // CHECK1: omp.inner.for.inc:
205 // CHECK1-NEXT: [[TMP11:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4
206 // CHECK1-NEXT: [[TMP12:%.*]] = load i32, ptr [[DOTOMP_STRIDE]], align 4
207 // CHECK1-NEXT: [[ADD:%.*]] = add nsw i32 [[TMP11]], [[TMP12]]
208 // CHECK1-NEXT: store i32 [[ADD]], ptr [[DOTOMP_IV]], align 4
209 // CHECK1-NEXT: br label [[OMP_INNER_FOR_COND]]
210 // CHECK1: omp.inner.for.end:
211 // CHECK1-NEXT: br label [[OMP_LOOP_EXIT:%.*]]
212 // CHECK1: omp.loop.exit:
213 // CHECK1-NEXT: call void @__kmpc_for_static_fini(ptr @[[GLOB2:[0-9]+]], i32 [[TMP1]])
214 // CHECK1-NEXT: ret void
217 // CHECK1-LABEL: define {{[^@]+}}@{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z9gtid_testv_l48.omp_outlined.omp_outlined
218 // CHECK1-SAME: (ptr noalias noundef [[DOTGLOBAL_TID_:%.*]], ptr noalias noundef [[DOTBOUND_TID_:%.*]], i64 noundef [[DOTPREVIOUS_LB_:%.*]], i64 noundef [[DOTPREVIOUS_UB_:%.*]]) #[[ATTR1]] {
219 // CHECK1-NEXT: entry:
220 // CHECK1-NEXT: [[DOTGLOBAL_TID__ADDR:%.*]] = alloca ptr, align 8
221 // CHECK1-NEXT: [[DOTBOUND_TID__ADDR:%.*]] = alloca ptr, align 8
222 // CHECK1-NEXT: [[DOTPREVIOUS_LB__ADDR:%.*]] = alloca i64, align 8
223 // CHECK1-NEXT: [[DOTPREVIOUS_UB__ADDR:%.*]] = alloca i64, align 8
224 // CHECK1-NEXT: [[DOTOMP_IV:%.*]] = alloca i32, align 4
225 // CHECK1-NEXT: [[TMP:%.*]] = alloca i32, align 4
226 // CHECK1-NEXT: [[DOTOMP_LB:%.*]] = alloca i32, align 4
227 // CHECK1-NEXT: [[DOTOMP_UB:%.*]] = alloca i32, align 4
228 // CHECK1-NEXT: [[DOTOMP_STRIDE:%.*]] = alloca i32, align 4
229 // CHECK1-NEXT: [[DOTOMP_IS_LAST:%.*]] = alloca i32, align 4
230 // CHECK1-NEXT: [[I:%.*]] = alloca i32, align 4
231 // CHECK1-NEXT: store ptr [[DOTGLOBAL_TID_]], ptr [[DOTGLOBAL_TID__ADDR]], align 8
232 // CHECK1-NEXT: store ptr [[DOTBOUND_TID_]], ptr [[DOTBOUND_TID__ADDR]], align 8
233 // CHECK1-NEXT: store i64 [[DOTPREVIOUS_LB_]], ptr [[DOTPREVIOUS_LB__ADDR]], align 8
234 // CHECK1-NEXT: store i64 [[DOTPREVIOUS_UB_]], ptr [[DOTPREVIOUS_UB__ADDR]], align 8
235 // CHECK1-NEXT: store i32 0, ptr [[DOTOMP_LB]], align 4
236 // CHECK1-NEXT: store i32 99, ptr [[DOTOMP_UB]], align 4
237 // CHECK1-NEXT: [[TMP0:%.*]] = load i64, ptr [[DOTPREVIOUS_LB__ADDR]], align 8
238 // CHECK1-NEXT: [[CONV:%.*]] = trunc i64 [[TMP0]] to i32
239 // CHECK1-NEXT: [[TMP1:%.*]] = load i64, ptr [[DOTPREVIOUS_UB__ADDR]], align 8
240 // CHECK1-NEXT: [[CONV1:%.*]] = trunc i64 [[TMP1]] to i32
241 // CHECK1-NEXT: store i32 [[CONV]], ptr [[DOTOMP_LB]], align 4
242 // CHECK1-NEXT: store i32 [[CONV1]], ptr [[DOTOMP_UB]], align 4
243 // CHECK1-NEXT: store i32 1, ptr [[DOTOMP_STRIDE]], align 4
244 // CHECK1-NEXT: store i32 0, ptr [[DOTOMP_IS_LAST]], align 4
245 // CHECK1-NEXT: [[TMP2:%.*]] = load ptr, ptr [[DOTGLOBAL_TID__ADDR]], align 8
246 // CHECK1-NEXT: [[TMP3:%.*]] = load i32, ptr [[TMP2]], align 4
247 // 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)
248 // CHECK1-NEXT: [[TMP4:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4
249 // CHECK1-NEXT: [[CMP:%.*]] = icmp sgt i32 [[TMP4]], 99
250 // CHECK1-NEXT: br i1 [[CMP]], label [[COND_TRUE:%.*]], label [[COND_FALSE:%.*]]
251 // CHECK1: cond.true:
252 // CHECK1-NEXT: br label [[COND_END:%.*]]
253 // CHECK1: cond.false:
254 // CHECK1-NEXT: [[TMP5:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4
255 // CHECK1-NEXT: br label [[COND_END]]
257 // CHECK1-NEXT: [[COND:%.*]] = phi i32 [ 99, [[COND_TRUE]] ], [ [[TMP5]], [[COND_FALSE]] ]
258 // CHECK1-NEXT: store i32 [[COND]], ptr [[DOTOMP_UB]], align 4
259 // CHECK1-NEXT: [[TMP6:%.*]] = load i32, ptr [[DOTOMP_LB]], align 4
260 // CHECK1-NEXT: store i32 [[TMP6]], ptr [[DOTOMP_IV]], align 4
261 // CHECK1-NEXT: br label [[OMP_INNER_FOR_COND:%.*]]
262 // CHECK1: omp.inner.for.cond:
263 // CHECK1-NEXT: [[TMP7:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4
264 // CHECK1-NEXT: [[TMP8:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4
265 // CHECK1-NEXT: [[CMP2:%.*]] = icmp sle i32 [[TMP7]], [[TMP8]]
266 // CHECK1-NEXT: br i1 [[CMP2]], label [[OMP_INNER_FOR_BODY:%.*]], label [[OMP_INNER_FOR_END:%.*]]
267 // CHECK1: omp.inner.for.body:
268 // CHECK1-NEXT: [[TMP9:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4
269 // CHECK1-NEXT: [[MUL:%.*]] = mul nsw i32 [[TMP9]], 1
270 // CHECK1-NEXT: [[ADD:%.*]] = add nsw i32 0, [[MUL]]
271 // CHECK1-NEXT: store i32 [[ADD]], ptr [[I]], align 4
272 // CHECK1-NEXT: br label [[OMP_BODY_CONTINUE:%.*]]
273 // CHECK1: omp.body.continue:
274 // CHECK1-NEXT: br label [[OMP_INNER_FOR_INC:%.*]]
275 // CHECK1: omp.inner.for.inc:
276 // CHECK1-NEXT: [[TMP10:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4
277 // CHECK1-NEXT: [[ADD3:%.*]] = add nsw i32 [[TMP10]], 1
278 // CHECK1-NEXT: store i32 [[ADD3]], ptr [[DOTOMP_IV]], align 4
279 // CHECK1-NEXT: br label [[OMP_INNER_FOR_COND]]
280 // CHECK1: omp.inner.for.end:
281 // CHECK1-NEXT: br label [[OMP_LOOP_EXIT:%.*]]
282 // CHECK1: omp.loop.exit:
283 // CHECK1-NEXT: call void @__kmpc_for_static_fini(ptr @[[GLOB2]], i32 [[TMP3]])
284 // CHECK1-NEXT: ret void
287 // CHECK1-LABEL: define {{[^@]+}}@{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z9gtid_testv_l51
288 // CHECK1-SAME: () #[[ATTR1]] {
289 // CHECK1-NEXT: entry:
290 // 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_l51.omp_outlined)
291 // CHECK1-NEXT: ret void
294 // CHECK1-LABEL: define {{[^@]+}}@{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z9gtid_testv_l51.omp_outlined
295 // CHECK1-SAME: (ptr noalias noundef [[DOTGLOBAL_TID_:%.*]], ptr noalias noundef [[DOTBOUND_TID_:%.*]]) #[[ATTR1]] {
296 // CHECK1-NEXT: entry:
297 // CHECK1-NEXT: [[DOTGLOBAL_TID__ADDR:%.*]] = alloca ptr, align 8
298 // CHECK1-NEXT: [[DOTBOUND_TID__ADDR:%.*]] = alloca ptr, align 8
299 // CHECK1-NEXT: [[DOTOMP_IV:%.*]] = alloca i32, align 4
300 // CHECK1-NEXT: [[TMP:%.*]] = alloca i32, align 4
301 // CHECK1-NEXT: [[DOTOMP_COMB_LB:%.*]] = alloca i32, align 4
302 // CHECK1-NEXT: [[DOTOMP_COMB_UB:%.*]] = alloca i32, align 4
303 // CHECK1-NEXT: [[DOTOMP_STRIDE:%.*]] = alloca i32, align 4
304 // CHECK1-NEXT: [[DOTOMP_IS_LAST:%.*]] = alloca i32, align 4
305 // CHECK1-NEXT: [[I:%.*]] = alloca i32, align 4
306 // CHECK1-NEXT: store ptr [[DOTGLOBAL_TID_]], ptr [[DOTGLOBAL_TID__ADDR]], align 8
307 // CHECK1-NEXT: store ptr [[DOTBOUND_TID_]], ptr [[DOTBOUND_TID__ADDR]], align 8
308 // CHECK1-NEXT: store i32 0, ptr [[DOTOMP_COMB_LB]], align 4
309 // CHECK1-NEXT: store i32 99, ptr [[DOTOMP_COMB_UB]], align 4
310 // CHECK1-NEXT: store i32 1, ptr [[DOTOMP_STRIDE]], align 4
311 // CHECK1-NEXT: store i32 0, ptr [[DOTOMP_IS_LAST]], align 4
312 // CHECK1-NEXT: [[TMP0:%.*]] = load ptr, ptr [[DOTGLOBAL_TID__ADDR]], align 8
313 // CHECK1-NEXT: [[TMP1:%.*]] = load i32, ptr [[TMP0]], align 4
314 // 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)
315 // CHECK1-NEXT: [[TMP2:%.*]] = load i32, ptr [[DOTOMP_COMB_UB]], align 4
316 // CHECK1-NEXT: [[CMP:%.*]] = icmp sgt i32 [[TMP2]], 99
317 // CHECK1-NEXT: br i1 [[CMP]], label [[COND_TRUE:%.*]], label [[COND_FALSE:%.*]]
318 // CHECK1: cond.true:
319 // CHECK1-NEXT: br label [[COND_END:%.*]]
320 // CHECK1: cond.false:
321 // CHECK1-NEXT: [[TMP3:%.*]] = load i32, ptr [[DOTOMP_COMB_UB]], align 4
322 // CHECK1-NEXT: br label [[COND_END]]
324 // CHECK1-NEXT: [[COND:%.*]] = phi i32 [ 99, [[COND_TRUE]] ], [ [[TMP3]], [[COND_FALSE]] ]
325 // CHECK1-NEXT: store i32 [[COND]], ptr [[DOTOMP_COMB_UB]], align 4
326 // CHECK1-NEXT: [[TMP4:%.*]] = load i32, ptr [[DOTOMP_COMB_LB]], align 4
327 // CHECK1-NEXT: store i32 [[TMP4]], ptr [[DOTOMP_IV]], align 4
328 // CHECK1-NEXT: br label [[OMP_INNER_FOR_COND:%.*]]
329 // CHECK1: omp.inner.for.cond:
330 // CHECK1-NEXT: [[TMP5:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4
331 // CHECK1-NEXT: [[TMP6:%.*]] = load i32, ptr [[DOTOMP_COMB_UB]], align 4
332 // CHECK1-NEXT: [[CMP1:%.*]] = icmp sle i32 [[TMP5]], [[TMP6]]
333 // CHECK1-NEXT: br i1 [[CMP1]], label [[OMP_INNER_FOR_BODY:%.*]], label [[OMP_INNER_FOR_END:%.*]]
334 // CHECK1: omp.inner.for.body:
335 // CHECK1-NEXT: [[TMP7:%.*]] = load i32, ptr [[DOTOMP_COMB_LB]], align 4
336 // CHECK1-NEXT: [[TMP8:%.*]] = zext i32 [[TMP7]] to i64
337 // CHECK1-NEXT: [[TMP9:%.*]] = load i32, ptr [[DOTOMP_COMB_UB]], align 4
338 // CHECK1-NEXT: [[TMP10:%.*]] = zext i32 [[TMP9]] to i64
339 // 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_l51.omp_outlined.omp_outlined, i64 [[TMP8]], i64 [[TMP10]])
340 // CHECK1-NEXT: br label [[OMP_INNER_FOR_INC:%.*]]
341 // CHECK1: omp.inner.for.inc:
342 // CHECK1-NEXT: [[TMP11:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4
343 // CHECK1-NEXT: [[TMP12:%.*]] = load i32, ptr [[DOTOMP_STRIDE]], align 4
344 // CHECK1-NEXT: [[ADD:%.*]] = add nsw i32 [[TMP11]], [[TMP12]]
345 // CHECK1-NEXT: store i32 [[ADD]], ptr [[DOTOMP_IV]], align 4
346 // CHECK1-NEXT: br label [[OMP_INNER_FOR_COND]]
347 // CHECK1: omp.inner.for.end:
348 // CHECK1-NEXT: br label [[OMP_LOOP_EXIT:%.*]]
349 // CHECK1: omp.loop.exit:
350 // CHECK1-NEXT: call void @__kmpc_for_static_fini(ptr @[[GLOB2]], i32 [[TMP1]])
351 // CHECK1-NEXT: ret void
354 // CHECK1-LABEL: define {{[^@]+}}@{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z9gtid_testv_l51.omp_outlined.omp_outlined
355 // CHECK1-SAME: (ptr noalias noundef [[DOTGLOBAL_TID_:%.*]], ptr noalias noundef [[DOTBOUND_TID_:%.*]], i64 noundef [[DOTPREVIOUS_LB_:%.*]], i64 noundef [[DOTPREVIOUS_UB_:%.*]]) #[[ATTR1]] {
356 // CHECK1-NEXT: entry:
357 // CHECK1-NEXT: [[DOTGLOBAL_TID__ADDR:%.*]] = alloca ptr, align 8
358 // CHECK1-NEXT: [[DOTBOUND_TID__ADDR:%.*]] = alloca ptr, align 8
359 // CHECK1-NEXT: [[DOTPREVIOUS_LB__ADDR:%.*]] = alloca i64, align 8
360 // CHECK1-NEXT: [[DOTPREVIOUS_UB__ADDR:%.*]] = alloca i64, align 8
361 // CHECK1-NEXT: [[DOTOMP_IV:%.*]] = alloca i32, align 4
362 // CHECK1-NEXT: [[TMP:%.*]] = alloca i32, align 4
363 // CHECK1-NEXT: [[DOTOMP_LB:%.*]] = alloca i32, align 4
364 // CHECK1-NEXT: [[DOTOMP_UB:%.*]] = alloca i32, align 4
365 // CHECK1-NEXT: [[DOTOMP_STRIDE:%.*]] = alloca i32, align 4
366 // CHECK1-NEXT: [[DOTOMP_IS_LAST:%.*]] = alloca i32, align 4
367 // CHECK1-NEXT: [[I:%.*]] = alloca i32, align 4
368 // CHECK1-NEXT: store ptr [[DOTGLOBAL_TID_]], ptr [[DOTGLOBAL_TID__ADDR]], align 8
369 // CHECK1-NEXT: store ptr [[DOTBOUND_TID_]], ptr [[DOTBOUND_TID__ADDR]], align 8
370 // CHECK1-NEXT: store i64 [[DOTPREVIOUS_LB_]], ptr [[DOTPREVIOUS_LB__ADDR]], align 8
371 // CHECK1-NEXT: store i64 [[DOTPREVIOUS_UB_]], ptr [[DOTPREVIOUS_UB__ADDR]], align 8
372 // CHECK1-NEXT: store i32 0, ptr [[DOTOMP_LB]], align 4
373 // CHECK1-NEXT: store i32 99, ptr [[DOTOMP_UB]], align 4
374 // CHECK1-NEXT: [[TMP0:%.*]] = load i64, ptr [[DOTPREVIOUS_LB__ADDR]], align 8
375 // CHECK1-NEXT: [[CONV:%.*]] = trunc i64 [[TMP0]] to i32
376 // CHECK1-NEXT: [[TMP1:%.*]] = load i64, ptr [[DOTPREVIOUS_UB__ADDR]], align 8
377 // CHECK1-NEXT: [[CONV1:%.*]] = trunc i64 [[TMP1]] to i32
378 // CHECK1-NEXT: store i32 [[CONV]], ptr [[DOTOMP_LB]], align 4
379 // CHECK1-NEXT: store i32 [[CONV1]], ptr [[DOTOMP_UB]], align 4
380 // CHECK1-NEXT: store i32 1, ptr [[DOTOMP_STRIDE]], align 4
381 // CHECK1-NEXT: store i32 0, ptr [[DOTOMP_IS_LAST]], align 4
382 // CHECK1-NEXT: [[TMP2:%.*]] = load ptr, ptr [[DOTGLOBAL_TID__ADDR]], align 8
383 // CHECK1-NEXT: [[TMP3:%.*]] = load i32, ptr [[TMP2]], align 4
384 // 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)
385 // CHECK1-NEXT: [[TMP4:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4
386 // CHECK1-NEXT: [[CMP:%.*]] = icmp sgt i32 [[TMP4]], 99
387 // CHECK1-NEXT: br i1 [[CMP]], label [[COND_TRUE:%.*]], label [[COND_FALSE:%.*]]
388 // CHECK1: cond.true:
389 // CHECK1-NEXT: br label [[COND_END:%.*]]
390 // CHECK1: cond.false:
391 // CHECK1-NEXT: [[TMP5:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4
392 // CHECK1-NEXT: br label [[COND_END]]
394 // CHECK1-NEXT: [[COND:%.*]] = phi i32 [ 99, [[COND_TRUE]] ], [ [[TMP5]], [[COND_FALSE]] ]
395 // CHECK1-NEXT: store i32 [[COND]], ptr [[DOTOMP_UB]], align 4
396 // CHECK1-NEXT: [[TMP6:%.*]] = load i32, ptr [[DOTOMP_LB]], align 4
397 // CHECK1-NEXT: store i32 [[TMP6]], ptr [[DOTOMP_IV]], align 4
398 // CHECK1-NEXT: br label [[OMP_INNER_FOR_COND:%.*]]
399 // CHECK1: omp.inner.for.cond:
400 // CHECK1-NEXT: [[TMP7:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4
401 // CHECK1-NEXT: [[TMP8:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4
402 // CHECK1-NEXT: [[CMP2:%.*]] = icmp sle i32 [[TMP7]], [[TMP8]]
403 // CHECK1-NEXT: br i1 [[CMP2]], label [[OMP_INNER_FOR_BODY:%.*]], label [[OMP_INNER_FOR_END:%.*]]
404 // CHECK1: omp.inner.for.body:
405 // CHECK1-NEXT: [[TMP9:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4
406 // CHECK1-NEXT: [[MUL:%.*]] = mul nsw i32 [[TMP9]], 1
407 // CHECK1-NEXT: [[ADD:%.*]] = add nsw i32 0, [[MUL]]
408 // CHECK1-NEXT: store i32 [[ADD]], ptr [[I]], align 4
409 // CHECK1-NEXT: call void @_Z9gtid_testv()
410 // CHECK1-NEXT: br label [[OMP_BODY_CONTINUE:%.*]]
411 // CHECK1: omp.body.continue:
412 // CHECK1-NEXT: br label [[OMP_INNER_FOR_INC:%.*]]
413 // CHECK1: omp.inner.for.inc:
414 // CHECK1-NEXT: [[TMP10:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4
415 // CHECK1-NEXT: [[ADD3:%.*]] = add nsw i32 [[TMP10]], 1
416 // CHECK1-NEXT: store i32 [[ADD3]], ptr [[DOTOMP_IV]], align 4
417 // CHECK1-NEXT: br label [[OMP_INNER_FOR_COND]]
418 // CHECK1: omp.inner.for.end:
419 // CHECK1-NEXT: br label [[OMP_LOOP_EXIT:%.*]]
420 // CHECK1: omp.loop.exit:
421 // CHECK1-NEXT: call void @__kmpc_for_static_fini(ptr @[[GLOB2]], i32 [[TMP3]])
422 // CHECK1-NEXT: ret void
425 // CHECK1-LABEL: define {{[^@]+}}@main
426 // CHECK1-SAME: () #[[ATTR3:[0-9]+]] {
427 // CHECK1-NEXT: entry:
428 // CHECK1-NEXT: [[RETVAL:%.*]] = alloca i32, align 4
429 // CHECK1-NEXT: [[TMP:%.*]] = alloca i32, align 4
430 // CHECK1-NEXT: [[KERNEL_ARGS:%.*]] = alloca [[STRUCT___TGT_KERNEL_ARGUMENTS:%.*]], align 8
431 // CHECK1-NEXT: [[DOTCAPTURE_EXPR_:%.*]] = alloca i8, align 1
432 // CHECK1-NEXT: [[DOTCAPTURE_EXPR__CASTED:%.*]] = alloca i64, align 8
433 // CHECK1-NEXT: [[DOTOFFLOAD_BASEPTRS:%.*]] = alloca [1 x ptr], align 8
434 // CHECK1-NEXT: [[DOTOFFLOAD_PTRS:%.*]] = alloca [1 x ptr], align 8
435 // CHECK1-NEXT: [[DOTOFFLOAD_MAPPERS:%.*]] = alloca [1 x ptr], align 8
436 // CHECK1-NEXT: [[_TMP5:%.*]] = alloca i32, align 4
437 // CHECK1-NEXT: [[KERNEL_ARGS6:%.*]] = alloca [[STRUCT___TGT_KERNEL_ARGUMENTS]], align 8
438 // CHECK1-NEXT: store i32 0, ptr [[RETVAL]], align 4
439 // CHECK1-NEXT: [[TMP0:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 0
440 // CHECK1-NEXT: store i32 2, ptr [[TMP0]], align 4
441 // CHECK1-NEXT: [[TMP1:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 1
442 // CHECK1-NEXT: store i32 0, ptr [[TMP1]], align 4
443 // CHECK1-NEXT: [[TMP2:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 2
444 // CHECK1-NEXT: store ptr null, ptr [[TMP2]], align 8
445 // CHECK1-NEXT: [[TMP3:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 3
446 // CHECK1-NEXT: store ptr null, ptr [[TMP3]], align 8
447 // CHECK1-NEXT: [[TMP4:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 4
448 // CHECK1-NEXT: store ptr null, ptr [[TMP4]], align 8
449 // CHECK1-NEXT: [[TMP5:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 5
450 // CHECK1-NEXT: store ptr null, ptr [[TMP5]], align 8
451 // CHECK1-NEXT: [[TMP6:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 6
452 // CHECK1-NEXT: store ptr null, ptr [[TMP6]], align 8
453 // CHECK1-NEXT: [[TMP7:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 7
454 // CHECK1-NEXT: store ptr null, ptr [[TMP7]], align 8
455 // CHECK1-NEXT: [[TMP8:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 8
456 // CHECK1-NEXT: store i64 100, ptr [[TMP8]], align 8
457 // CHECK1-NEXT: [[TMP9:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 9
458 // CHECK1-NEXT: store i64 0, ptr [[TMP9]], align 8
459 // CHECK1-NEXT: [[TMP10:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 10
460 // CHECK1-NEXT: store [3 x i32] zeroinitializer, ptr [[TMP10]], align 4
461 // CHECK1-NEXT: [[TMP11:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 11
462 // CHECK1-NEXT: store [3 x i32] zeroinitializer, ptr [[TMP11]], align 4
463 // CHECK1-NEXT: [[TMP12:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 12
464 // CHECK1-NEXT: store i32 0, ptr [[TMP12]], align 4
465 // 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]])
466 // CHECK1-NEXT: [[TMP14:%.*]] = icmp ne i32 [[TMP13]], 0
467 // CHECK1-NEXT: br i1 [[TMP14]], label [[OMP_OFFLOAD_FAILED:%.*]], label [[OMP_OFFLOAD_CONT:%.*]]
468 // CHECK1: omp_offload.failed:
469 // CHECK1-NEXT: call void @{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}_main_l76() #[[ATTR2]]
470 // CHECK1-NEXT: br label [[OMP_OFFLOAD_CONT]]
471 // CHECK1: omp_offload.cont:
472 // CHECK1-NEXT: call void @{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}_main_l83() #[[ATTR2]]
473 // CHECK1-NEXT: [[TMP15:%.*]] = load i32, ptr @Arg, align 4
474 // CHECK1-NEXT: [[TOBOOL:%.*]] = icmp ne i32 [[TMP15]], 0
475 // CHECK1-NEXT: [[FROMBOOL:%.*]] = zext i1 [[TOBOOL]] to i8
476 // CHECK1-NEXT: store i8 [[FROMBOOL]], ptr [[DOTCAPTURE_EXPR_]], align 1
477 // CHECK1-NEXT: [[TMP16:%.*]] = load i8, ptr [[DOTCAPTURE_EXPR_]], align 1
478 // CHECK1-NEXT: [[TOBOOL1:%.*]] = trunc i8 [[TMP16]] to i1
479 // CHECK1-NEXT: [[FROMBOOL2:%.*]] = zext i1 [[TOBOOL1]] to i8
480 // CHECK1-NEXT: store i8 [[FROMBOOL2]], ptr [[DOTCAPTURE_EXPR__CASTED]], align 1
481 // CHECK1-NEXT: [[TMP17:%.*]] = load i64, ptr [[DOTCAPTURE_EXPR__CASTED]], align 8
482 // CHECK1-NEXT: [[TMP18:%.*]] = load i8, ptr [[DOTCAPTURE_EXPR_]], align 1
483 // CHECK1-NEXT: [[TOBOOL3:%.*]] = trunc i8 [[TMP18]] to i1
484 // CHECK1-NEXT: br i1 [[TOBOOL3]], label [[OMP_IF_THEN:%.*]], label [[OMP_IF_ELSE:%.*]]
485 // CHECK1: omp_if.then:
486 // CHECK1-NEXT: [[TMP19:%.*]] = getelementptr inbounds [1 x ptr], ptr [[DOTOFFLOAD_BASEPTRS]], i32 0, i32 0
487 // CHECK1-NEXT: store i64 [[TMP17]], ptr [[TMP19]], align 8
488 // CHECK1-NEXT: [[TMP20:%.*]] = getelementptr inbounds [1 x ptr], ptr [[DOTOFFLOAD_PTRS]], i32 0, i32 0
489 // CHECK1-NEXT: store i64 [[TMP17]], ptr [[TMP20]], align 8
490 // CHECK1-NEXT: [[TMP21:%.*]] = getelementptr inbounds [1 x ptr], ptr [[DOTOFFLOAD_MAPPERS]], i64 0, i64 0
491 // CHECK1-NEXT: store ptr null, ptr [[TMP21]], align 8
492 // CHECK1-NEXT: [[TMP22:%.*]] = getelementptr inbounds [1 x ptr], ptr [[DOTOFFLOAD_BASEPTRS]], i32 0, i32 0
493 // CHECK1-NEXT: [[TMP23:%.*]] = getelementptr inbounds [1 x ptr], ptr [[DOTOFFLOAD_PTRS]], i32 0, i32 0
494 // CHECK1-NEXT: [[TMP24:%.*]] = load i8, ptr [[DOTCAPTURE_EXPR_]], align 1
495 // CHECK1-NEXT: [[TOBOOL4:%.*]] = trunc i8 [[TMP24]] to i1
496 // CHECK1-NEXT: [[TMP25:%.*]] = select i1 [[TOBOOL4]], i32 0, i32 1
497 // CHECK1-NEXT: [[TMP26:%.*]] = insertvalue [3 x i32] zeroinitializer, i32 [[TMP25]], 0
498 // CHECK1-NEXT: [[TMP27:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS6]], i32 0, i32 0
499 // CHECK1-NEXT: store i32 2, ptr [[TMP27]], align 4
500 // CHECK1-NEXT: [[TMP28:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS6]], i32 0, i32 1
501 // CHECK1-NEXT: store i32 1, ptr [[TMP28]], align 4
502 // CHECK1-NEXT: [[TMP29:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS6]], i32 0, i32 2
503 // CHECK1-NEXT: store ptr [[TMP22]], ptr [[TMP29]], align 8
504 // CHECK1-NEXT: [[TMP30:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS6]], i32 0, i32 3
505 // CHECK1-NEXT: store ptr [[TMP23]], ptr [[TMP30]], align 8
506 // CHECK1-NEXT: [[TMP31:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS6]], i32 0, i32 4
507 // CHECK1-NEXT: store ptr @.offload_sizes, ptr [[TMP31]], align 8
508 // CHECK1-NEXT: [[TMP32:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS6]], i32 0, i32 5
509 // CHECK1-NEXT: store ptr @.offload_maptypes, ptr [[TMP32]], align 8
510 // CHECK1-NEXT: [[TMP33:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS6]], i32 0, i32 6
511 // CHECK1-NEXT: store ptr null, ptr [[TMP33]], align 8
512 // CHECK1-NEXT: [[TMP34:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS6]], i32 0, i32 7
513 // CHECK1-NEXT: store ptr null, ptr [[TMP34]], align 8
514 // CHECK1-NEXT: [[TMP35:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS6]], i32 0, i32 8
515 // CHECK1-NEXT: store i64 100, ptr [[TMP35]], align 8
516 // CHECK1-NEXT: [[TMP36:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS6]], i32 0, i32 9
517 // CHECK1-NEXT: store i64 0, ptr [[TMP36]], align 8
518 // CHECK1-NEXT: [[TMP37:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS6]], i32 0, i32 10
519 // CHECK1-NEXT: store [3 x i32] zeroinitializer, ptr [[TMP37]], align 4
520 // CHECK1-NEXT: [[TMP38:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS6]], i32 0, i32 11
521 // CHECK1-NEXT: store [3 x i32] [[TMP26]], ptr [[TMP38]], align 4
522 // CHECK1-NEXT: [[TMP39:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS6]], i32 0, i32 12
523 // CHECK1-NEXT: store i32 0, ptr [[TMP39]], align 4
524 // CHECK1-NEXT: [[TMP40:%.*]] = call i32 @__tgt_target_kernel(ptr @[[GLOB3]], i64 -1, i32 0, i32 [[TMP25]], ptr @.{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}_main_l90.region_id, ptr [[KERNEL_ARGS6]])
525 // CHECK1-NEXT: [[TMP41:%.*]] = icmp ne i32 [[TMP40]], 0
526 // CHECK1-NEXT: br i1 [[TMP41]], label [[OMP_OFFLOAD_FAILED7:%.*]], label [[OMP_OFFLOAD_CONT8:%.*]]
527 // CHECK1: omp_offload.failed7:
528 // CHECK1-NEXT: call void @{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}_main_l90(i64 [[TMP17]]) #[[ATTR2]]
529 // CHECK1-NEXT: br label [[OMP_OFFLOAD_CONT8]]
530 // CHECK1: omp_offload.cont8:
531 // CHECK1-NEXT: br label [[OMP_IF_END:%.*]]
532 // CHECK1: omp_if.else:
533 // CHECK1-NEXT: call void @{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}_main_l90(i64 [[TMP17]]) #[[ATTR2]]
534 // CHECK1-NEXT: br label [[OMP_IF_END]]
535 // CHECK1: omp_if.end:
536 // CHECK1-NEXT: [[TMP42:%.*]] = load i32, ptr @Arg, align 4
537 // CHECK1-NEXT: [[CALL:%.*]] = call noundef i32 @_Z5tmainIiEiT_(i32 noundef [[TMP42]])
538 // CHECK1-NEXT: ret i32 [[CALL]]
541 // CHECK1-LABEL: define {{[^@]+}}@{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}_main_l76
542 // CHECK1-SAME: () #[[ATTR1]] {
543 // CHECK1-NEXT: entry:
544 // 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)
545 // CHECK1-NEXT: ret void
548 // CHECK1-LABEL: define {{[^@]+}}@{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}_main_l76.omp_outlined
549 // CHECK1-SAME: (ptr noalias noundef [[DOTGLOBAL_TID_:%.*]], ptr noalias noundef [[DOTBOUND_TID_:%.*]]) #[[ATTR1]] {
550 // CHECK1-NEXT: entry:
551 // CHECK1-NEXT: [[DOTGLOBAL_TID__ADDR:%.*]] = alloca ptr, align 8
552 // CHECK1-NEXT: [[DOTBOUND_TID__ADDR:%.*]] = alloca ptr, align 8
553 // CHECK1-NEXT: [[DOTOMP_IV:%.*]] = alloca i32, align 4
554 // CHECK1-NEXT: [[TMP:%.*]] = alloca i32, align 4
555 // CHECK1-NEXT: [[DOTOMP_COMB_LB:%.*]] = alloca i32, align 4
556 // CHECK1-NEXT: [[DOTOMP_COMB_UB:%.*]] = alloca i32, align 4
557 // CHECK1-NEXT: [[DOTOMP_STRIDE:%.*]] = alloca i32, align 4
558 // CHECK1-NEXT: [[DOTOMP_IS_LAST:%.*]] = alloca i32, align 4
559 // CHECK1-NEXT: [[I:%.*]] = alloca i32, align 4
560 // CHECK1-NEXT: store ptr [[DOTGLOBAL_TID_]], ptr [[DOTGLOBAL_TID__ADDR]], align 8
561 // CHECK1-NEXT: store ptr [[DOTBOUND_TID_]], ptr [[DOTBOUND_TID__ADDR]], align 8
562 // CHECK1-NEXT: store i32 0, ptr [[DOTOMP_COMB_LB]], align 4
563 // CHECK1-NEXT: store i32 99, ptr [[DOTOMP_COMB_UB]], align 4
564 // CHECK1-NEXT: store i32 1, ptr [[DOTOMP_STRIDE]], align 4
565 // CHECK1-NEXT: store i32 0, ptr [[DOTOMP_IS_LAST]], align 4
566 // CHECK1-NEXT: [[TMP0:%.*]] = load ptr, ptr [[DOTGLOBAL_TID__ADDR]], align 8
567 // CHECK1-NEXT: [[TMP1:%.*]] = load i32, ptr [[TMP0]], align 4
568 // 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)
569 // CHECK1-NEXT: [[TMP2:%.*]] = load i32, ptr [[DOTOMP_COMB_UB]], align 4
570 // CHECK1-NEXT: [[CMP:%.*]] = icmp sgt i32 [[TMP2]], 99
571 // CHECK1-NEXT: br i1 [[CMP]], label [[COND_TRUE:%.*]], label [[COND_FALSE:%.*]]
572 // CHECK1: cond.true:
573 // CHECK1-NEXT: br label [[COND_END:%.*]]
574 // CHECK1: cond.false:
575 // CHECK1-NEXT: [[TMP3:%.*]] = load i32, ptr [[DOTOMP_COMB_UB]], align 4
576 // CHECK1-NEXT: br label [[COND_END]]
578 // CHECK1-NEXT: [[COND:%.*]] = phi i32 [ 99, [[COND_TRUE]] ], [ [[TMP3]], [[COND_FALSE]] ]
579 // CHECK1-NEXT: store i32 [[COND]], ptr [[DOTOMP_COMB_UB]], align 4
580 // CHECK1-NEXT: [[TMP4:%.*]] = load i32, ptr [[DOTOMP_COMB_LB]], align 4
581 // CHECK1-NEXT: store i32 [[TMP4]], ptr [[DOTOMP_IV]], align 4
582 // CHECK1-NEXT: br label [[OMP_INNER_FOR_COND:%.*]]
583 // CHECK1: omp.inner.for.cond:
584 // CHECK1-NEXT: [[TMP5:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4
585 // CHECK1-NEXT: [[TMP6:%.*]] = load i32, ptr [[DOTOMP_COMB_UB]], align 4
586 // CHECK1-NEXT: [[CMP1:%.*]] = icmp sle i32 [[TMP5]], [[TMP6]]
587 // CHECK1-NEXT: br i1 [[CMP1]], label [[OMP_INNER_FOR_BODY:%.*]], label [[OMP_INNER_FOR_END:%.*]]
588 // CHECK1: omp.inner.for.body:
589 // CHECK1-NEXT: [[TMP7:%.*]] = load i32, ptr [[DOTOMP_COMB_LB]], align 4
590 // CHECK1-NEXT: [[TMP8:%.*]] = zext i32 [[TMP7]] to i64
591 // CHECK1-NEXT: [[TMP9:%.*]] = load i32, ptr [[DOTOMP_COMB_UB]], align 4
592 // CHECK1-NEXT: [[TMP10:%.*]] = zext i32 [[TMP9]] to i64
593 // 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]])
594 // CHECK1-NEXT: br label [[OMP_INNER_FOR_INC:%.*]]
595 // CHECK1: omp.inner.for.inc:
596 // CHECK1-NEXT: [[TMP11:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4
597 // CHECK1-NEXT: [[TMP12:%.*]] = load i32, ptr [[DOTOMP_STRIDE]], align 4
598 // CHECK1-NEXT: [[ADD:%.*]] = add nsw i32 [[TMP11]], [[TMP12]]
599 // CHECK1-NEXT: store i32 [[ADD]], ptr [[DOTOMP_IV]], align 4
600 // CHECK1-NEXT: br label [[OMP_INNER_FOR_COND]]
601 // CHECK1: omp.inner.for.end:
602 // CHECK1-NEXT: br label [[OMP_LOOP_EXIT:%.*]]
603 // CHECK1: omp.loop.exit:
604 // CHECK1-NEXT: call void @__kmpc_for_static_fini(ptr @[[GLOB2]], i32 [[TMP1]])
605 // CHECK1-NEXT: ret void
608 // CHECK1-LABEL: define {{[^@]+}}@{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}_main_l76.omp_outlined.omp_outlined
609 // CHECK1-SAME: (ptr noalias noundef [[DOTGLOBAL_TID_:%.*]], ptr noalias noundef [[DOTBOUND_TID_:%.*]], i64 noundef [[DOTPREVIOUS_LB_:%.*]], i64 noundef [[DOTPREVIOUS_UB_:%.*]]) #[[ATTR1]] {
610 // CHECK1-NEXT: entry:
611 // CHECK1-NEXT: [[DOTGLOBAL_TID__ADDR:%.*]] = alloca ptr, align 8
612 // CHECK1-NEXT: [[DOTBOUND_TID__ADDR:%.*]] = alloca ptr, align 8
613 // CHECK1-NEXT: [[DOTPREVIOUS_LB__ADDR:%.*]] = alloca i64, align 8
614 // CHECK1-NEXT: [[DOTPREVIOUS_UB__ADDR:%.*]] = alloca i64, align 8
615 // CHECK1-NEXT: [[DOTOMP_IV:%.*]] = alloca i32, align 4
616 // CHECK1-NEXT: [[TMP:%.*]] = alloca i32, align 4
617 // CHECK1-NEXT: [[DOTOMP_LB:%.*]] = alloca i32, align 4
618 // CHECK1-NEXT: [[DOTOMP_UB:%.*]] = alloca i32, align 4
619 // CHECK1-NEXT: [[DOTOMP_STRIDE:%.*]] = alloca i32, align 4
620 // CHECK1-NEXT: [[DOTOMP_IS_LAST:%.*]] = alloca i32, align 4
621 // CHECK1-NEXT: [[I:%.*]] = alloca i32, align 4
622 // CHECK1-NEXT: store ptr [[DOTGLOBAL_TID_]], ptr [[DOTGLOBAL_TID__ADDR]], align 8
623 // CHECK1-NEXT: store ptr [[DOTBOUND_TID_]], ptr [[DOTBOUND_TID__ADDR]], align 8
624 // CHECK1-NEXT: store i64 [[DOTPREVIOUS_LB_]], ptr [[DOTPREVIOUS_LB__ADDR]], align 8
625 // CHECK1-NEXT: store i64 [[DOTPREVIOUS_UB_]], ptr [[DOTPREVIOUS_UB__ADDR]], align 8
626 // CHECK1-NEXT: store i32 0, ptr [[DOTOMP_LB]], align 4
627 // CHECK1-NEXT: store i32 99, ptr [[DOTOMP_UB]], align 4
628 // CHECK1-NEXT: [[TMP0:%.*]] = load i64, ptr [[DOTPREVIOUS_LB__ADDR]], align 8
629 // CHECK1-NEXT: [[CONV:%.*]] = trunc i64 [[TMP0]] to i32
630 // CHECK1-NEXT: [[TMP1:%.*]] = load i64, ptr [[DOTPREVIOUS_UB__ADDR]], align 8
631 // CHECK1-NEXT: [[CONV1:%.*]] = trunc i64 [[TMP1]] to i32
632 // CHECK1-NEXT: store i32 [[CONV]], ptr [[DOTOMP_LB]], align 4
633 // CHECK1-NEXT: store i32 [[CONV1]], ptr [[DOTOMP_UB]], align 4
634 // CHECK1-NEXT: store i32 1, ptr [[DOTOMP_STRIDE]], align 4
635 // CHECK1-NEXT: store i32 0, ptr [[DOTOMP_IS_LAST]], align 4
636 // CHECK1-NEXT: [[TMP2:%.*]] = load ptr, ptr [[DOTGLOBAL_TID__ADDR]], align 8
637 // CHECK1-NEXT: [[TMP3:%.*]] = load i32, ptr [[TMP2]], align 4
638 // 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)
639 // CHECK1-NEXT: [[TMP4:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4
640 // CHECK1-NEXT: [[CMP:%.*]] = icmp sgt i32 [[TMP4]], 99
641 // CHECK1-NEXT: br i1 [[CMP]], label [[COND_TRUE:%.*]], label [[COND_FALSE:%.*]]
642 // CHECK1: cond.true:
643 // CHECK1-NEXT: br label [[COND_END:%.*]]
644 // CHECK1: cond.false:
645 // CHECK1-NEXT: [[TMP5:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4
646 // CHECK1-NEXT: br label [[COND_END]]
648 // CHECK1-NEXT: [[COND:%.*]] = phi i32 [ 99, [[COND_TRUE]] ], [ [[TMP5]], [[COND_FALSE]] ]
649 // CHECK1-NEXT: store i32 [[COND]], ptr [[DOTOMP_UB]], align 4
650 // CHECK1-NEXT: [[TMP6:%.*]] = load i32, ptr [[DOTOMP_LB]], align 4
651 // CHECK1-NEXT: store i32 [[TMP6]], ptr [[DOTOMP_IV]], align 4
652 // CHECK1-NEXT: br label [[OMP_INNER_FOR_COND:%.*]]
653 // CHECK1: omp.inner.for.cond:
654 // CHECK1-NEXT: [[TMP7:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4
655 // CHECK1-NEXT: [[TMP8:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4
656 // CHECK1-NEXT: [[CMP2:%.*]] = icmp sle i32 [[TMP7]], [[TMP8]]
657 // CHECK1-NEXT: br i1 [[CMP2]], label [[OMP_INNER_FOR_BODY:%.*]], label [[OMP_INNER_FOR_END:%.*]]
658 // CHECK1: omp.inner.for.body:
659 // CHECK1-NEXT: [[TMP9:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4
660 // CHECK1-NEXT: [[MUL:%.*]] = mul nsw i32 [[TMP9]], 1
661 // CHECK1-NEXT: [[ADD:%.*]] = add nsw i32 0, [[MUL]]
662 // CHECK1-NEXT: store i32 [[ADD]], ptr [[I]], align 4
663 // CHECK1-NEXT: call void @_Z3fn4v()
664 // CHECK1-NEXT: br label [[OMP_BODY_CONTINUE:%.*]]
665 // CHECK1: omp.body.continue:
666 // CHECK1-NEXT: br label [[OMP_INNER_FOR_INC:%.*]]
667 // CHECK1: omp.inner.for.inc:
668 // CHECK1-NEXT: [[TMP10:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4
669 // CHECK1-NEXT: [[ADD3:%.*]] = add nsw i32 [[TMP10]], 1
670 // CHECK1-NEXT: store i32 [[ADD3]], ptr [[DOTOMP_IV]], align 4
671 // CHECK1-NEXT: br label [[OMP_INNER_FOR_COND]]
672 // CHECK1: omp.inner.for.end:
673 // CHECK1-NEXT: br label [[OMP_LOOP_EXIT:%.*]]
674 // CHECK1: omp.loop.exit:
675 // CHECK1-NEXT: call void @__kmpc_for_static_fini(ptr @[[GLOB2]], i32 [[TMP3]])
676 // CHECK1-NEXT: ret void
679 // CHECK1-LABEL: define {{[^@]+}}@{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}_main_l83
680 // CHECK1-SAME: () #[[ATTR1]] {
681 // CHECK1-NEXT: entry:
682 // CHECK1-NEXT: call void (ptr, i32, ptr, ...) @__kmpc_fork_teams(ptr @[[GLOB3]], i32 0, ptr @{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}_main_l83.omp_outlined)
683 // CHECK1-NEXT: ret void
686 // CHECK1-LABEL: define {{[^@]+}}@{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}_main_l83.omp_outlined
687 // CHECK1-SAME: (ptr noalias noundef [[DOTGLOBAL_TID_:%.*]], ptr noalias noundef [[DOTBOUND_TID_:%.*]]) #[[ATTR1]] {
688 // CHECK1-NEXT: entry:
689 // CHECK1-NEXT: [[DOTGLOBAL_TID__ADDR:%.*]] = alloca ptr, align 8
690 // CHECK1-NEXT: [[DOTBOUND_TID__ADDR:%.*]] = alloca ptr, align 8
691 // CHECK1-NEXT: [[DOTOMP_IV:%.*]] = alloca i32, align 4
692 // CHECK1-NEXT: [[TMP:%.*]] = alloca i32, align 4
693 // CHECK1-NEXT: [[DOTOMP_COMB_LB:%.*]] = alloca i32, align 4
694 // CHECK1-NEXT: [[DOTOMP_COMB_UB:%.*]] = alloca i32, align 4
695 // CHECK1-NEXT: [[DOTOMP_STRIDE:%.*]] = alloca i32, align 4
696 // CHECK1-NEXT: [[DOTOMP_IS_LAST:%.*]] = alloca i32, align 4
697 // CHECK1-NEXT: [[I:%.*]] = alloca i32, align 4
698 // CHECK1-NEXT: [[DOTBOUND_ZERO_ADDR:%.*]] = alloca i32, align 4
699 // CHECK1-NEXT: store ptr [[DOTGLOBAL_TID_]], ptr [[DOTGLOBAL_TID__ADDR]], align 8
700 // CHECK1-NEXT: store ptr [[DOTBOUND_TID_]], ptr [[DOTBOUND_TID__ADDR]], align 8
701 // CHECK1-NEXT: store i32 0, ptr [[DOTOMP_COMB_LB]], align 4
702 // CHECK1-NEXT: store i32 99, ptr [[DOTOMP_COMB_UB]], align 4
703 // CHECK1-NEXT: store i32 1, ptr [[DOTOMP_STRIDE]], align 4
704 // CHECK1-NEXT: store i32 0, ptr [[DOTOMP_IS_LAST]], align 4
705 // CHECK1-NEXT: [[TMP0:%.*]] = load ptr, ptr [[DOTGLOBAL_TID__ADDR]], align 8
706 // CHECK1-NEXT: [[TMP1:%.*]] = load i32, ptr [[TMP0]], align 4
707 // 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)
708 // CHECK1-NEXT: [[TMP2:%.*]] = load i32, ptr [[DOTOMP_COMB_UB]], align 4
709 // CHECK1-NEXT: [[CMP:%.*]] = icmp sgt i32 [[TMP2]], 99
710 // CHECK1-NEXT: br i1 [[CMP]], label [[COND_TRUE:%.*]], label [[COND_FALSE:%.*]]
711 // CHECK1: cond.true:
712 // CHECK1-NEXT: br label [[COND_END:%.*]]
713 // CHECK1: cond.false:
714 // CHECK1-NEXT: [[TMP3:%.*]] = load i32, ptr [[DOTOMP_COMB_UB]], align 4
715 // CHECK1-NEXT: br label [[COND_END]]
717 // CHECK1-NEXT: [[COND:%.*]] = phi i32 [ 99, [[COND_TRUE]] ], [ [[TMP3]], [[COND_FALSE]] ]
718 // CHECK1-NEXT: store i32 [[COND]], ptr [[DOTOMP_COMB_UB]], align 4
719 // CHECK1-NEXT: [[TMP4:%.*]] = load i32, ptr [[DOTOMP_COMB_LB]], align 4
720 // CHECK1-NEXT: store i32 [[TMP4]], ptr [[DOTOMP_IV]], align 4
721 // CHECK1-NEXT: br label [[OMP_INNER_FOR_COND:%.*]]
722 // CHECK1: omp.inner.for.cond:
723 // CHECK1-NEXT: [[TMP5:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4
724 // CHECK1-NEXT: [[TMP6:%.*]] = load i32, ptr [[DOTOMP_COMB_UB]], align 4
725 // CHECK1-NEXT: [[CMP1:%.*]] = icmp sle i32 [[TMP5]], [[TMP6]]
726 // CHECK1-NEXT: br i1 [[CMP1]], label [[OMP_INNER_FOR_BODY:%.*]], label [[OMP_INNER_FOR_END:%.*]]
727 // CHECK1: omp.inner.for.body:
728 // CHECK1-NEXT: [[TMP7:%.*]] = load i32, ptr [[DOTOMP_COMB_LB]], align 4
729 // CHECK1-NEXT: [[TMP8:%.*]] = zext i32 [[TMP7]] to i64
730 // CHECK1-NEXT: [[TMP9:%.*]] = load i32, ptr [[DOTOMP_COMB_UB]], align 4
731 // CHECK1-NEXT: [[TMP10:%.*]] = zext i32 [[TMP9]] to i64
732 // CHECK1-NEXT: call void @__kmpc_serialized_parallel(ptr @[[GLOB3]], i32 [[TMP1]])
733 // CHECK1-NEXT: [[TMP11:%.*]] = load ptr, ptr [[DOTGLOBAL_TID__ADDR]], align 8
734 // CHECK1-NEXT: store i32 0, ptr [[DOTBOUND_ZERO_ADDR]], align 4
735 // CHECK1-NEXT: call void @{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}_main_l83.omp_outlined.omp_outlined(ptr [[TMP11]], ptr [[DOTBOUND_ZERO_ADDR]], i64 [[TMP8]], i64 [[TMP10]]) #[[ATTR2]]
736 // CHECK1-NEXT: call void @__kmpc_end_serialized_parallel(ptr @[[GLOB3]], i32 [[TMP1]])
737 // CHECK1-NEXT: br label [[OMP_INNER_FOR_INC:%.*]]
738 // CHECK1: omp.inner.for.inc:
739 // CHECK1-NEXT: [[TMP12:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4
740 // CHECK1-NEXT: [[TMP13:%.*]] = load i32, ptr [[DOTOMP_STRIDE]], align 4
741 // CHECK1-NEXT: [[ADD:%.*]] = add nsw i32 [[TMP12]], [[TMP13]]
742 // CHECK1-NEXT: store i32 [[ADD]], ptr [[DOTOMP_IV]], align 4
743 // CHECK1-NEXT: br label [[OMP_INNER_FOR_COND]]
744 // CHECK1: omp.inner.for.end:
745 // CHECK1-NEXT: br label [[OMP_LOOP_EXIT:%.*]]
746 // CHECK1: omp.loop.exit:
747 // CHECK1-NEXT: call void @__kmpc_for_static_fini(ptr @[[GLOB2]], i32 [[TMP1]])
748 // CHECK1-NEXT: ret void
751 // CHECK1-LABEL: define {{[^@]+}}@{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}_main_l83.omp_outlined.omp_outlined
752 // CHECK1-SAME: (ptr noalias noundef [[DOTGLOBAL_TID_:%.*]], ptr noalias noundef [[DOTBOUND_TID_:%.*]], i64 noundef [[DOTPREVIOUS_LB_:%.*]], i64 noundef [[DOTPREVIOUS_UB_:%.*]]) #[[ATTR1]] {
753 // CHECK1-NEXT: entry:
754 // CHECK1-NEXT: [[DOTGLOBAL_TID__ADDR:%.*]] = alloca ptr, align 8
755 // CHECK1-NEXT: [[DOTBOUND_TID__ADDR:%.*]] = alloca ptr, align 8
756 // CHECK1-NEXT: [[DOTPREVIOUS_LB__ADDR:%.*]] = alloca i64, align 8
757 // CHECK1-NEXT: [[DOTPREVIOUS_UB__ADDR:%.*]] = alloca i64, align 8
758 // CHECK1-NEXT: [[DOTOMP_IV:%.*]] = alloca i32, align 4
759 // CHECK1-NEXT: [[TMP:%.*]] = alloca i32, align 4
760 // CHECK1-NEXT: [[DOTOMP_LB:%.*]] = alloca i32, align 4
761 // CHECK1-NEXT: [[DOTOMP_UB:%.*]] = alloca i32, align 4
762 // CHECK1-NEXT: [[DOTOMP_STRIDE:%.*]] = alloca i32, align 4
763 // CHECK1-NEXT: [[DOTOMP_IS_LAST:%.*]] = alloca i32, align 4
764 // CHECK1-NEXT: [[I:%.*]] = alloca i32, align 4
765 // CHECK1-NEXT: store ptr [[DOTGLOBAL_TID_]], ptr [[DOTGLOBAL_TID__ADDR]], align 8
766 // CHECK1-NEXT: store ptr [[DOTBOUND_TID_]], ptr [[DOTBOUND_TID__ADDR]], align 8
767 // CHECK1-NEXT: store i64 [[DOTPREVIOUS_LB_]], ptr [[DOTPREVIOUS_LB__ADDR]], align 8
768 // CHECK1-NEXT: store i64 [[DOTPREVIOUS_UB_]], ptr [[DOTPREVIOUS_UB__ADDR]], align 8
769 // CHECK1-NEXT: store i32 0, ptr [[DOTOMP_LB]], align 4
770 // CHECK1-NEXT: store i32 99, ptr [[DOTOMP_UB]], align 4
771 // CHECK1-NEXT: [[TMP0:%.*]] = load i64, ptr [[DOTPREVIOUS_LB__ADDR]], align 8
772 // CHECK1-NEXT: [[CONV:%.*]] = trunc i64 [[TMP0]] to i32
773 // CHECK1-NEXT: [[TMP1:%.*]] = load i64, ptr [[DOTPREVIOUS_UB__ADDR]], align 8
774 // CHECK1-NEXT: [[CONV1:%.*]] = trunc i64 [[TMP1]] to i32
775 // CHECK1-NEXT: store i32 [[CONV]], ptr [[DOTOMP_LB]], align 4
776 // CHECK1-NEXT: store i32 [[CONV1]], ptr [[DOTOMP_UB]], align 4
777 // CHECK1-NEXT: store i32 1, ptr [[DOTOMP_STRIDE]], align 4
778 // CHECK1-NEXT: store i32 0, ptr [[DOTOMP_IS_LAST]], align 4
779 // CHECK1-NEXT: [[TMP2:%.*]] = load ptr, ptr [[DOTGLOBAL_TID__ADDR]], align 8
780 // CHECK1-NEXT: [[TMP3:%.*]] = load i32, ptr [[TMP2]], align 4
781 // 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)
782 // CHECK1-NEXT: [[TMP4:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4
783 // CHECK1-NEXT: [[CMP:%.*]] = icmp sgt i32 [[TMP4]], 99
784 // CHECK1-NEXT: br i1 [[CMP]], label [[COND_TRUE:%.*]], label [[COND_FALSE:%.*]]
785 // CHECK1: cond.true:
786 // CHECK1-NEXT: br label [[COND_END:%.*]]
787 // CHECK1: cond.false:
788 // CHECK1-NEXT: [[TMP5:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4
789 // CHECK1-NEXT: br label [[COND_END]]
791 // CHECK1-NEXT: [[COND:%.*]] = phi i32 [ 99, [[COND_TRUE]] ], [ [[TMP5]], [[COND_FALSE]] ]
792 // CHECK1-NEXT: store i32 [[COND]], ptr [[DOTOMP_UB]], align 4
793 // CHECK1-NEXT: [[TMP6:%.*]] = load i32, ptr [[DOTOMP_LB]], align 4
794 // CHECK1-NEXT: store i32 [[TMP6]], ptr [[DOTOMP_IV]], align 4
795 // CHECK1-NEXT: br label [[OMP_INNER_FOR_COND:%.*]]
796 // CHECK1: omp.inner.for.cond:
797 // CHECK1-NEXT: [[TMP7:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4
798 // CHECK1-NEXT: [[TMP8:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4
799 // CHECK1-NEXT: [[CMP2:%.*]] = icmp sle i32 [[TMP7]], [[TMP8]]
800 // CHECK1-NEXT: br i1 [[CMP2]], label [[OMP_INNER_FOR_BODY:%.*]], label [[OMP_INNER_FOR_END:%.*]]
801 // CHECK1: omp.inner.for.body:
802 // CHECK1-NEXT: [[TMP9:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4
803 // CHECK1-NEXT: [[MUL:%.*]] = mul nsw i32 [[TMP9]], 1
804 // CHECK1-NEXT: [[ADD:%.*]] = add nsw i32 0, [[MUL]]
805 // CHECK1-NEXT: store i32 [[ADD]], ptr [[I]], align 4
806 // CHECK1-NEXT: call void @_Z3fn5v()
807 // CHECK1-NEXT: br label [[OMP_BODY_CONTINUE:%.*]]
808 // CHECK1: omp.body.continue:
809 // CHECK1-NEXT: br label [[OMP_INNER_FOR_INC:%.*]]
810 // CHECK1: omp.inner.for.inc:
811 // CHECK1-NEXT: [[TMP10:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4
812 // CHECK1-NEXT: [[ADD3:%.*]] = add nsw i32 [[TMP10]], 1
813 // CHECK1-NEXT: store i32 [[ADD3]], ptr [[DOTOMP_IV]], align 4
814 // CHECK1-NEXT: br label [[OMP_INNER_FOR_COND]]
815 // CHECK1: omp.inner.for.end:
816 // CHECK1-NEXT: br label [[OMP_LOOP_EXIT:%.*]]
817 // CHECK1: omp.loop.exit:
818 // CHECK1-NEXT: call void @__kmpc_for_static_fini(ptr @[[GLOB2]], i32 [[TMP3]])
819 // CHECK1-NEXT: ret void
822 // CHECK1-LABEL: define {{[^@]+}}@{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}_main_l90
823 // CHECK1-SAME: (i64 noundef [[DOTCAPTURE_EXPR_:%.*]]) #[[ATTR1]] {
824 // CHECK1-NEXT: entry:
825 // CHECK1-NEXT: [[DOTCAPTURE_EXPR__ADDR:%.*]] = alloca i64, align 8
826 // CHECK1-NEXT: [[DOTCAPTURE_EXPR__CASTED:%.*]] = alloca i64, align 8
827 // CHECK1-NEXT: store i64 [[DOTCAPTURE_EXPR_]], ptr [[DOTCAPTURE_EXPR__ADDR]], align 8
828 // CHECK1-NEXT: [[TMP0:%.*]] = load i8, ptr [[DOTCAPTURE_EXPR__ADDR]], align 1
829 // CHECK1-NEXT: [[TOBOOL:%.*]] = trunc i8 [[TMP0]] to i1
830 // CHECK1-NEXT: [[FROMBOOL:%.*]] = zext i1 [[TOBOOL]] to i8
831 // CHECK1-NEXT: store i8 [[FROMBOOL]], ptr [[DOTCAPTURE_EXPR__CASTED]], align 1
832 // CHECK1-NEXT: [[TMP1:%.*]] = load i64, ptr [[DOTCAPTURE_EXPR__CASTED]], align 8
833 // CHECK1-NEXT: call void (ptr, i32, ptr, ...) @__kmpc_fork_teams(ptr @[[GLOB3]], i32 1, ptr @{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}_main_l90.omp_outlined, i64 [[TMP1]])
834 // CHECK1-NEXT: ret void
837 // CHECK1-LABEL: define {{[^@]+}}@{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}_main_l90.omp_outlined
838 // CHECK1-SAME: (ptr noalias noundef [[DOTGLOBAL_TID_:%.*]], ptr noalias noundef [[DOTBOUND_TID_:%.*]], i64 noundef [[DOTCAPTURE_EXPR_:%.*]]) #[[ATTR1]] {
839 // CHECK1-NEXT: entry:
840 // CHECK1-NEXT: [[DOTGLOBAL_TID__ADDR:%.*]] = alloca ptr, align 8
841 // CHECK1-NEXT: [[DOTBOUND_TID__ADDR:%.*]] = alloca ptr, align 8
842 // CHECK1-NEXT: [[DOTCAPTURE_EXPR__ADDR:%.*]] = alloca i64, align 8
843 // CHECK1-NEXT: [[DOTOMP_IV:%.*]] = alloca i32, align 4
844 // CHECK1-NEXT: [[TMP:%.*]] = alloca i32, align 4
845 // CHECK1-NEXT: [[DOTOMP_COMB_LB:%.*]] = alloca i32, align 4
846 // CHECK1-NEXT: [[DOTOMP_COMB_UB:%.*]] = alloca i32, align 4
847 // CHECK1-NEXT: [[DOTOMP_STRIDE:%.*]] = alloca i32, align 4
848 // CHECK1-NEXT: [[DOTOMP_IS_LAST:%.*]] = alloca i32, align 4
849 // CHECK1-NEXT: [[I:%.*]] = alloca i32, align 4
850 // CHECK1-NEXT: [[DOTBOUND_ZERO_ADDR:%.*]] = alloca i32, align 4
851 // CHECK1-NEXT: store ptr [[DOTGLOBAL_TID_]], ptr [[DOTGLOBAL_TID__ADDR]], align 8
852 // CHECK1-NEXT: store ptr [[DOTBOUND_TID_]], ptr [[DOTBOUND_TID__ADDR]], align 8
853 // CHECK1-NEXT: store i64 [[DOTCAPTURE_EXPR_]], ptr [[DOTCAPTURE_EXPR__ADDR]], align 8
854 // CHECK1-NEXT: store i32 0, ptr [[DOTOMP_COMB_LB]], align 4
855 // CHECK1-NEXT: store i32 99, ptr [[DOTOMP_COMB_UB]], align 4
856 // CHECK1-NEXT: store i32 1, ptr [[DOTOMP_STRIDE]], align 4
857 // CHECK1-NEXT: store i32 0, ptr [[DOTOMP_IS_LAST]], align 4
858 // CHECK1-NEXT: [[TMP0:%.*]] = load ptr, ptr [[DOTGLOBAL_TID__ADDR]], align 8
859 // CHECK1-NEXT: [[TMP1:%.*]] = load i32, ptr [[TMP0]], align 4
860 // 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)
861 // CHECK1-NEXT: [[TMP2:%.*]] = load i32, ptr [[DOTOMP_COMB_UB]], align 4
862 // CHECK1-NEXT: [[CMP:%.*]] = icmp sgt i32 [[TMP2]], 99
863 // CHECK1-NEXT: br i1 [[CMP]], label [[COND_TRUE:%.*]], label [[COND_FALSE:%.*]]
864 // CHECK1: cond.true:
865 // CHECK1-NEXT: br label [[COND_END:%.*]]
866 // CHECK1: cond.false:
867 // CHECK1-NEXT: [[TMP3:%.*]] = load i32, ptr [[DOTOMP_COMB_UB]], align 4
868 // CHECK1-NEXT: br label [[COND_END]]
870 // CHECK1-NEXT: [[COND:%.*]] = phi i32 [ 99, [[COND_TRUE]] ], [ [[TMP3]], [[COND_FALSE]] ]
871 // CHECK1-NEXT: store i32 [[COND]], ptr [[DOTOMP_COMB_UB]], align 4
872 // CHECK1-NEXT: [[TMP4:%.*]] = load i32, ptr [[DOTOMP_COMB_LB]], align 4
873 // CHECK1-NEXT: store i32 [[TMP4]], ptr [[DOTOMP_IV]], align 4
874 // CHECK1-NEXT: br label [[OMP_INNER_FOR_COND:%.*]]
875 // CHECK1: omp.inner.for.cond:
876 // CHECK1-NEXT: [[TMP5:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4
877 // CHECK1-NEXT: [[TMP6:%.*]] = load i32, ptr [[DOTOMP_COMB_UB]], align 4
878 // CHECK1-NEXT: [[CMP1:%.*]] = icmp sle i32 [[TMP5]], [[TMP6]]
879 // CHECK1-NEXT: br i1 [[CMP1]], label [[OMP_INNER_FOR_BODY:%.*]], label [[OMP_INNER_FOR_END:%.*]]
880 // CHECK1: omp.inner.for.body:
881 // CHECK1-NEXT: [[TMP7:%.*]] = load i32, ptr [[DOTOMP_COMB_LB]], align 4
882 // CHECK1-NEXT: [[TMP8:%.*]] = zext i32 [[TMP7]] to i64
883 // CHECK1-NEXT: [[TMP9:%.*]] = load i32, ptr [[DOTOMP_COMB_UB]], align 4
884 // CHECK1-NEXT: [[TMP10:%.*]] = zext i32 [[TMP9]] to i64
885 // CHECK1-NEXT: [[TMP11:%.*]] = load i8, ptr [[DOTCAPTURE_EXPR__ADDR]], align 1
886 // CHECK1-NEXT: [[TOBOOL:%.*]] = trunc i8 [[TMP11]] to i1
887 // CHECK1-NEXT: br i1 [[TOBOOL]], label [[OMP_IF_THEN:%.*]], label [[OMP_IF_ELSE:%.*]]
888 // CHECK1: omp_if.then:
889 // CHECK1-NEXT: call void (ptr, i32, ptr, ...) @__kmpc_fork_call(ptr @[[GLOB3]], i32 2, ptr @{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}_main_l90.omp_outlined.omp_outlined, i64 [[TMP8]], i64 [[TMP10]])
890 // CHECK1-NEXT: br label [[OMP_IF_END:%.*]]
891 // CHECK1: omp_if.else:
892 // CHECK1-NEXT: call void @__kmpc_serialized_parallel(ptr @[[GLOB3]], i32 [[TMP1]])
893 // CHECK1-NEXT: [[TMP12:%.*]] = load ptr, ptr [[DOTGLOBAL_TID__ADDR]], align 8
894 // CHECK1-NEXT: store i32 0, ptr [[DOTBOUND_ZERO_ADDR]], align 4
895 // CHECK1-NEXT: call void @{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}_main_l90.omp_outlined.omp_outlined(ptr [[TMP12]], ptr [[DOTBOUND_ZERO_ADDR]], i64 [[TMP8]], i64 [[TMP10]]) #[[ATTR2]]
896 // CHECK1-NEXT: call void @__kmpc_end_serialized_parallel(ptr @[[GLOB3]], i32 [[TMP1]])
897 // CHECK1-NEXT: br label [[OMP_IF_END]]
898 // CHECK1: omp_if.end:
899 // CHECK1-NEXT: br label [[OMP_INNER_FOR_INC:%.*]]
900 // CHECK1: omp.inner.for.inc:
901 // CHECK1-NEXT: [[TMP13:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4
902 // CHECK1-NEXT: [[TMP14:%.*]] = load i32, ptr [[DOTOMP_STRIDE]], align 4
903 // CHECK1-NEXT: [[ADD:%.*]] = add nsw i32 [[TMP13]], [[TMP14]]
904 // CHECK1-NEXT: store i32 [[ADD]], ptr [[DOTOMP_IV]], align 4
905 // CHECK1-NEXT: br label [[OMP_INNER_FOR_COND]]
906 // CHECK1: omp.inner.for.end:
907 // CHECK1-NEXT: br label [[OMP_LOOP_EXIT:%.*]]
908 // CHECK1: omp.loop.exit:
909 // CHECK1-NEXT: call void @__kmpc_for_static_fini(ptr @[[GLOB2]], i32 [[TMP1]])
910 // CHECK1-NEXT: ret void
913 // CHECK1-LABEL: define {{[^@]+}}@{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}_main_l90.omp_outlined.omp_outlined
914 // CHECK1-SAME: (ptr noalias noundef [[DOTGLOBAL_TID_:%.*]], ptr noalias noundef [[DOTBOUND_TID_:%.*]], i64 noundef [[DOTPREVIOUS_LB_:%.*]], i64 noundef [[DOTPREVIOUS_UB_:%.*]]) #[[ATTR1]] {
915 // CHECK1-NEXT: entry:
916 // CHECK1-NEXT: [[DOTGLOBAL_TID__ADDR:%.*]] = alloca ptr, align 8
917 // CHECK1-NEXT: [[DOTBOUND_TID__ADDR:%.*]] = alloca ptr, align 8
918 // CHECK1-NEXT: [[DOTPREVIOUS_LB__ADDR:%.*]] = alloca i64, align 8
919 // CHECK1-NEXT: [[DOTPREVIOUS_UB__ADDR:%.*]] = alloca i64, align 8
920 // CHECK1-NEXT: [[DOTOMP_IV:%.*]] = alloca i32, align 4
921 // CHECK1-NEXT: [[TMP:%.*]] = alloca i32, align 4
922 // CHECK1-NEXT: [[DOTOMP_LB:%.*]] = alloca i32, align 4
923 // CHECK1-NEXT: [[DOTOMP_UB:%.*]] = alloca i32, align 4
924 // CHECK1-NEXT: [[DOTOMP_STRIDE:%.*]] = alloca i32, align 4
925 // CHECK1-NEXT: [[DOTOMP_IS_LAST:%.*]] = alloca i32, align 4
926 // CHECK1-NEXT: [[I:%.*]] = alloca i32, align 4
927 // CHECK1-NEXT: store ptr [[DOTGLOBAL_TID_]], ptr [[DOTGLOBAL_TID__ADDR]], align 8
928 // CHECK1-NEXT: store ptr [[DOTBOUND_TID_]], ptr [[DOTBOUND_TID__ADDR]], align 8
929 // CHECK1-NEXT: store i64 [[DOTPREVIOUS_LB_]], ptr [[DOTPREVIOUS_LB__ADDR]], align 8
930 // CHECK1-NEXT: store i64 [[DOTPREVIOUS_UB_]], ptr [[DOTPREVIOUS_UB__ADDR]], align 8
931 // CHECK1-NEXT: store i32 0, ptr [[DOTOMP_LB]], align 4
932 // CHECK1-NEXT: store i32 99, ptr [[DOTOMP_UB]], align 4
933 // CHECK1-NEXT: [[TMP0:%.*]] = load i64, ptr [[DOTPREVIOUS_LB__ADDR]], align 8
934 // CHECK1-NEXT: [[CONV:%.*]] = trunc i64 [[TMP0]] to i32
935 // CHECK1-NEXT: [[TMP1:%.*]] = load i64, ptr [[DOTPREVIOUS_UB__ADDR]], align 8
936 // CHECK1-NEXT: [[CONV1:%.*]] = trunc i64 [[TMP1]] to i32
937 // CHECK1-NEXT: store i32 [[CONV]], ptr [[DOTOMP_LB]], align 4
938 // CHECK1-NEXT: store i32 [[CONV1]], ptr [[DOTOMP_UB]], align 4
939 // CHECK1-NEXT: store i32 1, ptr [[DOTOMP_STRIDE]], align 4
940 // CHECK1-NEXT: store i32 0, ptr [[DOTOMP_IS_LAST]], align 4
941 // CHECK1-NEXT: [[TMP2:%.*]] = load ptr, ptr [[DOTGLOBAL_TID__ADDR]], align 8
942 // CHECK1-NEXT: [[TMP3:%.*]] = load i32, ptr [[TMP2]], align 4
943 // 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)
944 // CHECK1-NEXT: [[TMP4:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4
945 // CHECK1-NEXT: [[CMP:%.*]] = icmp sgt i32 [[TMP4]], 99
946 // CHECK1-NEXT: br i1 [[CMP]], label [[COND_TRUE:%.*]], label [[COND_FALSE:%.*]]
947 // CHECK1: cond.true:
948 // CHECK1-NEXT: br label [[COND_END:%.*]]
949 // CHECK1: cond.false:
950 // CHECK1-NEXT: [[TMP5:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4
951 // CHECK1-NEXT: br label [[COND_END]]
953 // CHECK1-NEXT: [[COND:%.*]] = phi i32 [ 99, [[COND_TRUE]] ], [ [[TMP5]], [[COND_FALSE]] ]
954 // CHECK1-NEXT: store i32 [[COND]], ptr [[DOTOMP_UB]], align 4
955 // CHECK1-NEXT: [[TMP6:%.*]] = load i32, ptr [[DOTOMP_LB]], align 4
956 // CHECK1-NEXT: store i32 [[TMP6]], ptr [[DOTOMP_IV]], align 4
957 // CHECK1-NEXT: br label [[OMP_INNER_FOR_COND:%.*]]
958 // CHECK1: omp.inner.for.cond:
959 // CHECK1-NEXT: [[TMP7:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4
960 // CHECK1-NEXT: [[TMP8:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4
961 // CHECK1-NEXT: [[CMP2:%.*]] = icmp sle i32 [[TMP7]], [[TMP8]]
962 // CHECK1-NEXT: br i1 [[CMP2]], label [[OMP_INNER_FOR_BODY:%.*]], label [[OMP_INNER_FOR_END:%.*]]
963 // CHECK1: omp.inner.for.body:
964 // CHECK1-NEXT: [[TMP9:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4
965 // CHECK1-NEXT: [[MUL:%.*]] = mul nsw i32 [[TMP9]], 1
966 // CHECK1-NEXT: [[ADD:%.*]] = add nsw i32 0, [[MUL]]
967 // CHECK1-NEXT: store i32 [[ADD]], ptr [[I]], align 4
968 // CHECK1-NEXT: call void @_Z3fn6v()
969 // CHECK1-NEXT: br label [[OMP_BODY_CONTINUE:%.*]]
970 // CHECK1: omp.body.continue:
971 // CHECK1-NEXT: br label [[OMP_INNER_FOR_INC:%.*]]
972 // CHECK1: omp.inner.for.inc:
973 // CHECK1-NEXT: [[TMP10:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4
974 // CHECK1-NEXT: [[ADD3:%.*]] = add nsw i32 [[TMP10]], 1
975 // CHECK1-NEXT: store i32 [[ADD3]], ptr [[DOTOMP_IV]], align 4
976 // CHECK1-NEXT: br label [[OMP_INNER_FOR_COND]]
977 // CHECK1: omp.inner.for.end:
978 // CHECK1-NEXT: br label [[OMP_LOOP_EXIT:%.*]]
979 // CHECK1: omp.loop.exit:
980 // CHECK1-NEXT: call void @__kmpc_for_static_fini(ptr @[[GLOB2]], i32 [[TMP3]])
981 // CHECK1-NEXT: ret void
984 // CHECK1-LABEL: define {{[^@]+}}@_Z5tmainIiEiT_
985 // CHECK1-SAME: (i32 noundef [[ARG:%.*]]) #[[ATTR0]] comdat {
986 // CHECK1-NEXT: entry:
987 // CHECK1-NEXT: [[ARG_ADDR:%.*]] = alloca i32, align 4
988 // CHECK1-NEXT: [[TMP:%.*]] = alloca i32, align 4
989 // CHECK1-NEXT: [[KERNEL_ARGS:%.*]] = alloca [[STRUCT___TGT_KERNEL_ARGUMENTS:%.*]], align 8
990 // CHECK1-NEXT: [[_TMP1:%.*]] = alloca i32, align 4
991 // CHECK1-NEXT: [[KERNEL_ARGS2:%.*]] = alloca [[STRUCT___TGT_KERNEL_ARGUMENTS]], align 8
992 // CHECK1-NEXT: store i32 [[ARG]], ptr [[ARG_ADDR]], align 4
993 // CHECK1-NEXT: [[TMP0:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 0
994 // CHECK1-NEXT: store i32 2, ptr [[TMP0]], align 4
995 // CHECK1-NEXT: [[TMP1:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 1
996 // CHECK1-NEXT: store i32 0, ptr [[TMP1]], align 4
997 // CHECK1-NEXT: [[TMP2:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 2
998 // CHECK1-NEXT: store ptr null, ptr [[TMP2]], align 8
999 // CHECK1-NEXT: [[TMP3:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 3
1000 // CHECK1-NEXT: store ptr null, ptr [[TMP3]], align 8
1001 // CHECK1-NEXT: [[TMP4:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 4
1002 // CHECK1-NEXT: store ptr null, ptr [[TMP4]], align 8
1003 // CHECK1-NEXT: [[TMP5:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 5
1004 // CHECK1-NEXT: store ptr null, ptr [[TMP5]], align 8
1005 // CHECK1-NEXT: [[TMP6:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 6
1006 // CHECK1-NEXT: store ptr null, ptr [[TMP6]], align 8
1007 // CHECK1-NEXT: [[TMP7:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 7
1008 // CHECK1-NEXT: store ptr null, ptr [[TMP7]], align 8
1009 // CHECK1-NEXT: [[TMP8:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 8
1010 // CHECK1-NEXT: store i64 100, ptr [[TMP8]], align 8
1011 // CHECK1-NEXT: [[TMP9:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 9
1012 // CHECK1-NEXT: store i64 0, ptr [[TMP9]], align 8
1013 // CHECK1-NEXT: [[TMP10:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 10
1014 // CHECK1-NEXT: store [3 x i32] zeroinitializer, ptr [[TMP10]], align 4
1015 // CHECK1-NEXT: [[TMP11:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 11
1016 // CHECK1-NEXT: store [3 x i32] zeroinitializer, ptr [[TMP11]], align 4
1017 // CHECK1-NEXT: [[TMP12:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 12
1018 // CHECK1-NEXT: store i32 0, ptr [[TMP12]], align 4
1019 // 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__l60.region_id, ptr [[KERNEL_ARGS]])
1020 // CHECK1-NEXT: [[TMP14:%.*]] = icmp ne i32 [[TMP13]], 0
1021 // CHECK1-NEXT: br i1 [[TMP14]], label [[OMP_OFFLOAD_FAILED:%.*]], label [[OMP_OFFLOAD_CONT:%.*]]
1022 // CHECK1: omp_offload.failed:
1023 // CHECK1-NEXT: call void @{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z5tmainIiEiT__l60() #[[ATTR2]]
1024 // CHECK1-NEXT: br label [[OMP_OFFLOAD_CONT]]
1025 // CHECK1: omp_offload.cont:
1026 // CHECK1-NEXT: call void @{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z5tmainIiEiT__l64() #[[ATTR2]]
1027 // CHECK1-NEXT: [[TMP15:%.*]] = load i32, ptr [[ARG_ADDR]], align 4
1028 // CHECK1-NEXT: [[TOBOOL:%.*]] = icmp ne i32 [[TMP15]], 0
1029 // CHECK1-NEXT: br i1 [[TOBOOL]], label [[OMP_IF_THEN:%.*]], label [[OMP_IF_ELSE:%.*]]
1030 // CHECK1: omp_if.then:
1031 // CHECK1-NEXT: [[TMP16:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS2]], i32 0, i32 0
1032 // CHECK1-NEXT: store i32 2, ptr [[TMP16]], align 4
1033 // CHECK1-NEXT: [[TMP17:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS2]], i32 0, i32 1
1034 // CHECK1-NEXT: store i32 0, ptr [[TMP17]], align 4
1035 // CHECK1-NEXT: [[TMP18:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS2]], i32 0, i32 2
1036 // CHECK1-NEXT: store ptr null, ptr [[TMP18]], align 8
1037 // CHECK1-NEXT: [[TMP19:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS2]], i32 0, i32 3
1038 // CHECK1-NEXT: store ptr null, ptr [[TMP19]], align 8
1039 // CHECK1-NEXT: [[TMP20:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS2]], i32 0, i32 4
1040 // CHECK1-NEXT: store ptr null, ptr [[TMP20]], align 8
1041 // CHECK1-NEXT: [[TMP21:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS2]], i32 0, i32 5
1042 // CHECK1-NEXT: store ptr null, ptr [[TMP21]], align 8
1043 // CHECK1-NEXT: [[TMP22:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS2]], i32 0, i32 6
1044 // CHECK1-NEXT: store ptr null, ptr [[TMP22]], align 8
1045 // CHECK1-NEXT: [[TMP23:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS2]], i32 0, i32 7
1046 // CHECK1-NEXT: store ptr null, ptr [[TMP23]], align 8
1047 // CHECK1-NEXT: [[TMP24:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS2]], i32 0, i32 8
1048 // CHECK1-NEXT: store i64 100, ptr [[TMP24]], align 8
1049 // CHECK1-NEXT: [[TMP25:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS2]], i32 0, i32 9
1050 // CHECK1-NEXT: store i64 0, ptr [[TMP25]], align 8
1051 // CHECK1-NEXT: [[TMP26:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS2]], i32 0, i32 10
1052 // CHECK1-NEXT: store [3 x i32] zeroinitializer, ptr [[TMP26]], align 4
1053 // CHECK1-NEXT: [[TMP27:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS2]], i32 0, i32 11
1054 // CHECK1-NEXT: store [3 x i32] zeroinitializer, ptr [[TMP27]], align 4
1055 // CHECK1-NEXT: [[TMP28:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS2]], i32 0, i32 12
1056 // CHECK1-NEXT: store i32 0, ptr [[TMP28]], align 4
1057 // CHECK1-NEXT: [[TMP29:%.*]] = call i32 @__tgt_target_kernel(ptr @[[GLOB3]], i64 -1, i32 0, i32 0, ptr @.{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z5tmainIiEiT__l68.region_id, ptr [[KERNEL_ARGS2]])
1058 // CHECK1-NEXT: [[TMP30:%.*]] = icmp ne i32 [[TMP29]], 0
1059 // CHECK1-NEXT: br i1 [[TMP30]], label [[OMP_OFFLOAD_FAILED3:%.*]], label [[OMP_OFFLOAD_CONT4:%.*]]
1060 // CHECK1: omp_offload.failed3:
1061 // CHECK1-NEXT: call void @{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z5tmainIiEiT__l68() #[[ATTR2]]
1062 // CHECK1-NEXT: br label [[OMP_OFFLOAD_CONT4]]
1063 // CHECK1: omp_offload.cont4:
1064 // CHECK1-NEXT: br label [[OMP_IF_END:%.*]]
1065 // CHECK1: omp_if.else:
1066 // CHECK1-NEXT: call void @{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z5tmainIiEiT__l68() #[[ATTR2]]
1067 // CHECK1-NEXT: br label [[OMP_IF_END]]
1068 // CHECK1: omp_if.end:
1069 // CHECK1-NEXT: ret i32 0
1072 // CHECK1-LABEL: define {{[^@]+}}@{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z5tmainIiEiT__l60
1073 // CHECK1-SAME: () #[[ATTR1]] {
1074 // CHECK1-NEXT: entry:
1075 // CHECK1-NEXT: call void (ptr, i32, ptr, ...) @__kmpc_fork_teams(ptr @[[GLOB3]], i32 0, ptr @{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z5tmainIiEiT__l60.omp_outlined)
1076 // CHECK1-NEXT: ret void
1079 // CHECK1-LABEL: define {{[^@]+}}@{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z5tmainIiEiT__l60.omp_outlined
1080 // CHECK1-SAME: (ptr noalias noundef [[DOTGLOBAL_TID_:%.*]], ptr noalias noundef [[DOTBOUND_TID_:%.*]]) #[[ATTR1]] {
1081 // CHECK1-NEXT: entry:
1082 // CHECK1-NEXT: [[DOTGLOBAL_TID__ADDR:%.*]] = alloca ptr, align 8
1083 // CHECK1-NEXT: [[DOTBOUND_TID__ADDR:%.*]] = alloca ptr, align 8
1084 // CHECK1-NEXT: [[DOTOMP_IV:%.*]] = alloca i32, align 4
1085 // CHECK1-NEXT: [[TMP:%.*]] = alloca i32, align 4
1086 // CHECK1-NEXT: [[DOTOMP_COMB_LB:%.*]] = alloca i32, align 4
1087 // CHECK1-NEXT: [[DOTOMP_COMB_UB:%.*]] = alloca i32, align 4
1088 // CHECK1-NEXT: [[DOTOMP_STRIDE:%.*]] = alloca i32, align 4
1089 // CHECK1-NEXT: [[DOTOMP_IS_LAST:%.*]] = alloca i32, align 4
1090 // CHECK1-NEXT: [[I:%.*]] = alloca i32, align 4
1091 // CHECK1-NEXT: store ptr [[DOTGLOBAL_TID_]], ptr [[DOTGLOBAL_TID__ADDR]], align 8
1092 // CHECK1-NEXT: store ptr [[DOTBOUND_TID_]], ptr [[DOTBOUND_TID__ADDR]], align 8
1093 // CHECK1-NEXT: store i32 0, ptr [[DOTOMP_COMB_LB]], align 4
1094 // CHECK1-NEXT: store i32 99, ptr [[DOTOMP_COMB_UB]], align 4
1095 // CHECK1-NEXT: store i32 1, ptr [[DOTOMP_STRIDE]], align 4
1096 // CHECK1-NEXT: store i32 0, ptr [[DOTOMP_IS_LAST]], align 4
1097 // CHECK1-NEXT: [[TMP0:%.*]] = load ptr, ptr [[DOTGLOBAL_TID__ADDR]], align 8
1098 // CHECK1-NEXT: [[TMP1:%.*]] = load i32, ptr [[TMP0]], align 4
1099 // 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)
1100 // CHECK1-NEXT: [[TMP2:%.*]] = load i32, ptr [[DOTOMP_COMB_UB]], align 4
1101 // CHECK1-NEXT: [[CMP:%.*]] = icmp sgt i32 [[TMP2]], 99
1102 // CHECK1-NEXT: br i1 [[CMP]], label [[COND_TRUE:%.*]], label [[COND_FALSE:%.*]]
1103 // CHECK1: cond.true:
1104 // CHECK1-NEXT: br label [[COND_END:%.*]]
1105 // CHECK1: cond.false:
1106 // CHECK1-NEXT: [[TMP3:%.*]] = load i32, ptr [[DOTOMP_COMB_UB]], align 4
1107 // CHECK1-NEXT: br label [[COND_END]]
1108 // CHECK1: cond.end:
1109 // CHECK1-NEXT: [[COND:%.*]] = phi i32 [ 99, [[COND_TRUE]] ], [ [[TMP3]], [[COND_FALSE]] ]
1110 // CHECK1-NEXT: store i32 [[COND]], ptr [[DOTOMP_COMB_UB]], align 4
1111 // CHECK1-NEXT: [[TMP4:%.*]] = load i32, ptr [[DOTOMP_COMB_LB]], align 4
1112 // CHECK1-NEXT: store i32 [[TMP4]], ptr [[DOTOMP_IV]], align 4
1113 // CHECK1-NEXT: br label [[OMP_INNER_FOR_COND:%.*]]
1114 // CHECK1: omp.inner.for.cond:
1115 // CHECK1-NEXT: [[TMP5:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4
1116 // CHECK1-NEXT: [[TMP6:%.*]] = load i32, ptr [[DOTOMP_COMB_UB]], align 4
1117 // CHECK1-NEXT: [[CMP1:%.*]] = icmp sle i32 [[TMP5]], [[TMP6]]
1118 // CHECK1-NEXT: br i1 [[CMP1]], label [[OMP_INNER_FOR_BODY:%.*]], label [[OMP_INNER_FOR_END:%.*]]
1119 // CHECK1: omp.inner.for.body:
1120 // CHECK1-NEXT: [[TMP7:%.*]] = load i32, ptr [[DOTOMP_COMB_LB]], align 4
1121 // CHECK1-NEXT: [[TMP8:%.*]] = zext i32 [[TMP7]] to i64
1122 // CHECK1-NEXT: [[TMP9:%.*]] = load i32, ptr [[DOTOMP_COMB_UB]], align 4
1123 // CHECK1-NEXT: [[TMP10:%.*]] = zext i32 [[TMP9]] to i64
1124 // CHECK1-NEXT: call void (ptr, i32, ptr, ...) @__kmpc_fork_call(ptr @[[GLOB3]], i32 2, ptr @{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z5tmainIiEiT__l60.omp_outlined.omp_outlined, i64 [[TMP8]], i64 [[TMP10]])
1125 // CHECK1-NEXT: br label [[OMP_INNER_FOR_INC:%.*]]
1126 // CHECK1: omp.inner.for.inc:
1127 // CHECK1-NEXT: [[TMP11:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4
1128 // CHECK1-NEXT: [[TMP12:%.*]] = load i32, ptr [[DOTOMP_STRIDE]], align 4
1129 // CHECK1-NEXT: [[ADD:%.*]] = add nsw i32 [[TMP11]], [[TMP12]]
1130 // CHECK1-NEXT: store i32 [[ADD]], ptr [[DOTOMP_IV]], align 4
1131 // CHECK1-NEXT: br label [[OMP_INNER_FOR_COND]]
1132 // CHECK1: omp.inner.for.end:
1133 // CHECK1-NEXT: br label [[OMP_LOOP_EXIT:%.*]]
1134 // CHECK1: omp.loop.exit:
1135 // CHECK1-NEXT: call void @__kmpc_for_static_fini(ptr @[[GLOB2]], i32 [[TMP1]])
1136 // CHECK1-NEXT: ret void
1139 // CHECK1-LABEL: define {{[^@]+}}@{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z5tmainIiEiT__l60.omp_outlined.omp_outlined
1140 // CHECK1-SAME: (ptr noalias noundef [[DOTGLOBAL_TID_:%.*]], ptr noalias noundef [[DOTBOUND_TID_:%.*]], i64 noundef [[DOTPREVIOUS_LB_:%.*]], i64 noundef [[DOTPREVIOUS_UB_:%.*]]) #[[ATTR1]] {
1141 // CHECK1-NEXT: entry:
1142 // CHECK1-NEXT: [[DOTGLOBAL_TID__ADDR:%.*]] = alloca ptr, align 8
1143 // CHECK1-NEXT: [[DOTBOUND_TID__ADDR:%.*]] = alloca ptr, align 8
1144 // CHECK1-NEXT: [[DOTPREVIOUS_LB__ADDR:%.*]] = alloca i64, align 8
1145 // CHECK1-NEXT: [[DOTPREVIOUS_UB__ADDR:%.*]] = alloca i64, align 8
1146 // CHECK1-NEXT: [[DOTOMP_IV:%.*]] = alloca i32, align 4
1147 // CHECK1-NEXT: [[TMP:%.*]] = alloca i32, align 4
1148 // CHECK1-NEXT: [[DOTOMP_LB:%.*]] = alloca i32, align 4
1149 // CHECK1-NEXT: [[DOTOMP_UB:%.*]] = alloca i32, align 4
1150 // CHECK1-NEXT: [[DOTOMP_STRIDE:%.*]] = alloca i32, align 4
1151 // CHECK1-NEXT: [[DOTOMP_IS_LAST:%.*]] = alloca i32, align 4
1152 // CHECK1-NEXT: [[I:%.*]] = alloca i32, align 4
1153 // CHECK1-NEXT: store ptr [[DOTGLOBAL_TID_]], ptr [[DOTGLOBAL_TID__ADDR]], align 8
1154 // CHECK1-NEXT: store ptr [[DOTBOUND_TID_]], ptr [[DOTBOUND_TID__ADDR]], align 8
1155 // CHECK1-NEXT: store i64 [[DOTPREVIOUS_LB_]], ptr [[DOTPREVIOUS_LB__ADDR]], align 8
1156 // CHECK1-NEXT: store i64 [[DOTPREVIOUS_UB_]], ptr [[DOTPREVIOUS_UB__ADDR]], align 8
1157 // CHECK1-NEXT: store i32 0, ptr [[DOTOMP_LB]], align 4
1158 // CHECK1-NEXT: store i32 99, ptr [[DOTOMP_UB]], align 4
1159 // CHECK1-NEXT: [[TMP0:%.*]] = load i64, ptr [[DOTPREVIOUS_LB__ADDR]], align 8
1160 // CHECK1-NEXT: [[CONV:%.*]] = trunc i64 [[TMP0]] to i32
1161 // CHECK1-NEXT: [[TMP1:%.*]] = load i64, ptr [[DOTPREVIOUS_UB__ADDR]], align 8
1162 // CHECK1-NEXT: [[CONV1:%.*]] = trunc i64 [[TMP1]] to i32
1163 // CHECK1-NEXT: store i32 [[CONV]], ptr [[DOTOMP_LB]], align 4
1164 // CHECK1-NEXT: store i32 [[CONV1]], ptr [[DOTOMP_UB]], align 4
1165 // CHECK1-NEXT: store i32 1, ptr [[DOTOMP_STRIDE]], align 4
1166 // CHECK1-NEXT: store i32 0, ptr [[DOTOMP_IS_LAST]], align 4
1167 // CHECK1-NEXT: [[TMP2:%.*]] = load ptr, ptr [[DOTGLOBAL_TID__ADDR]], align 8
1168 // CHECK1-NEXT: [[TMP3:%.*]] = load i32, ptr [[TMP2]], align 4
1169 // 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)
1170 // CHECK1-NEXT: [[TMP4:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4
1171 // CHECK1-NEXT: [[CMP:%.*]] = icmp sgt i32 [[TMP4]], 99
1172 // CHECK1-NEXT: br i1 [[CMP]], label [[COND_TRUE:%.*]], label [[COND_FALSE:%.*]]
1173 // CHECK1: cond.true:
1174 // CHECK1-NEXT: br label [[COND_END:%.*]]
1175 // CHECK1: cond.false:
1176 // CHECK1-NEXT: [[TMP5:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4
1177 // CHECK1-NEXT: br label [[COND_END]]
1178 // CHECK1: cond.end:
1179 // CHECK1-NEXT: [[COND:%.*]] = phi i32 [ 99, [[COND_TRUE]] ], [ [[TMP5]], [[COND_FALSE]] ]
1180 // CHECK1-NEXT: store i32 [[COND]], ptr [[DOTOMP_UB]], align 4
1181 // CHECK1-NEXT: [[TMP6:%.*]] = load i32, ptr [[DOTOMP_LB]], align 4
1182 // CHECK1-NEXT: store i32 [[TMP6]], ptr [[DOTOMP_IV]], align 4
1183 // CHECK1-NEXT: br label [[OMP_INNER_FOR_COND:%.*]]
1184 // CHECK1: omp.inner.for.cond:
1185 // CHECK1-NEXT: [[TMP7:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4
1186 // CHECK1-NEXT: [[TMP8:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4
1187 // CHECK1-NEXT: [[CMP2:%.*]] = icmp sle i32 [[TMP7]], [[TMP8]]
1188 // CHECK1-NEXT: br i1 [[CMP2]], label [[OMP_INNER_FOR_BODY:%.*]], label [[OMP_INNER_FOR_END:%.*]]
1189 // CHECK1: omp.inner.for.body:
1190 // CHECK1-NEXT: [[TMP9:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4
1191 // CHECK1-NEXT: [[MUL:%.*]] = mul nsw i32 [[TMP9]], 1
1192 // CHECK1-NEXT: [[ADD:%.*]] = add nsw i32 0, [[MUL]]
1193 // CHECK1-NEXT: store i32 [[ADD]], ptr [[I]], align 4
1194 // CHECK1-NEXT: call void @_Z3fn1v()
1195 // CHECK1-NEXT: br label [[OMP_BODY_CONTINUE:%.*]]
1196 // CHECK1: omp.body.continue:
1197 // CHECK1-NEXT: br label [[OMP_INNER_FOR_INC:%.*]]
1198 // CHECK1: omp.inner.for.inc:
1199 // CHECK1-NEXT: [[TMP10:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4
1200 // CHECK1-NEXT: [[ADD3:%.*]] = add nsw i32 [[TMP10]], 1
1201 // CHECK1-NEXT: store i32 [[ADD3]], ptr [[DOTOMP_IV]], align 4
1202 // CHECK1-NEXT: br label [[OMP_INNER_FOR_COND]]
1203 // CHECK1: omp.inner.for.end:
1204 // CHECK1-NEXT: br label [[OMP_LOOP_EXIT:%.*]]
1205 // CHECK1: omp.loop.exit:
1206 // CHECK1-NEXT: call void @__kmpc_for_static_fini(ptr @[[GLOB2]], i32 [[TMP3]])
1207 // CHECK1-NEXT: ret void
1210 // CHECK1-LABEL: define {{[^@]+}}@{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z5tmainIiEiT__l64
1211 // CHECK1-SAME: () #[[ATTR1]] {
1212 // CHECK1-NEXT: entry:
1213 // CHECK1-NEXT: call void (ptr, i32, ptr, ...) @__kmpc_fork_teams(ptr @[[GLOB3]], i32 0, ptr @{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z5tmainIiEiT__l64.omp_outlined)
1214 // CHECK1-NEXT: ret void
1217 // CHECK1-LABEL: define {{[^@]+}}@{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z5tmainIiEiT__l64.omp_outlined
1218 // CHECK1-SAME: (ptr noalias noundef [[DOTGLOBAL_TID_:%.*]], ptr noalias noundef [[DOTBOUND_TID_:%.*]]) #[[ATTR1]] {
1219 // CHECK1-NEXT: entry:
1220 // CHECK1-NEXT: [[DOTGLOBAL_TID__ADDR:%.*]] = alloca ptr, align 8
1221 // CHECK1-NEXT: [[DOTBOUND_TID__ADDR:%.*]] = alloca ptr, align 8
1222 // CHECK1-NEXT: [[DOTOMP_IV:%.*]] = alloca i32, align 4
1223 // CHECK1-NEXT: [[TMP:%.*]] = alloca i32, align 4
1224 // CHECK1-NEXT: [[DOTOMP_COMB_LB:%.*]] = alloca i32, align 4
1225 // CHECK1-NEXT: [[DOTOMP_COMB_UB:%.*]] = alloca i32, align 4
1226 // CHECK1-NEXT: [[DOTOMP_STRIDE:%.*]] = alloca i32, align 4
1227 // CHECK1-NEXT: [[DOTOMP_IS_LAST:%.*]] = alloca i32, align 4
1228 // CHECK1-NEXT: [[I:%.*]] = alloca i32, align 4
1229 // CHECK1-NEXT: [[DOTBOUND_ZERO_ADDR:%.*]] = alloca i32, align 4
1230 // CHECK1-NEXT: store ptr [[DOTGLOBAL_TID_]], ptr [[DOTGLOBAL_TID__ADDR]], align 8
1231 // CHECK1-NEXT: store ptr [[DOTBOUND_TID_]], ptr [[DOTBOUND_TID__ADDR]], align 8
1232 // CHECK1-NEXT: store i32 0, ptr [[DOTOMP_COMB_LB]], align 4
1233 // CHECK1-NEXT: store i32 99, ptr [[DOTOMP_COMB_UB]], align 4
1234 // CHECK1-NEXT: store i32 1, ptr [[DOTOMP_STRIDE]], align 4
1235 // CHECK1-NEXT: store i32 0, ptr [[DOTOMP_IS_LAST]], align 4
1236 // CHECK1-NEXT: [[TMP0:%.*]] = load ptr, ptr [[DOTGLOBAL_TID__ADDR]], align 8
1237 // CHECK1-NEXT: [[TMP1:%.*]] = load i32, ptr [[TMP0]], align 4
1238 // 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)
1239 // CHECK1-NEXT: [[TMP2:%.*]] = load i32, ptr [[DOTOMP_COMB_UB]], align 4
1240 // CHECK1-NEXT: [[CMP:%.*]] = icmp sgt i32 [[TMP2]], 99
1241 // CHECK1-NEXT: br i1 [[CMP]], label [[COND_TRUE:%.*]], label [[COND_FALSE:%.*]]
1242 // CHECK1: cond.true:
1243 // CHECK1-NEXT: br label [[COND_END:%.*]]
1244 // CHECK1: cond.false:
1245 // CHECK1-NEXT: [[TMP3:%.*]] = load i32, ptr [[DOTOMP_COMB_UB]], align 4
1246 // CHECK1-NEXT: br label [[COND_END]]
1247 // CHECK1: cond.end:
1248 // CHECK1-NEXT: [[COND:%.*]] = phi i32 [ 99, [[COND_TRUE]] ], [ [[TMP3]], [[COND_FALSE]] ]
1249 // CHECK1-NEXT: store i32 [[COND]], ptr [[DOTOMP_COMB_UB]], align 4
1250 // CHECK1-NEXT: [[TMP4:%.*]] = load i32, ptr [[DOTOMP_COMB_LB]], align 4
1251 // CHECK1-NEXT: store i32 [[TMP4]], ptr [[DOTOMP_IV]], align 4
1252 // CHECK1-NEXT: br label [[OMP_INNER_FOR_COND:%.*]]
1253 // CHECK1: omp.inner.for.cond:
1254 // CHECK1-NEXT: [[TMP5:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4
1255 // CHECK1-NEXT: [[TMP6:%.*]] = load i32, ptr [[DOTOMP_COMB_UB]], align 4
1256 // CHECK1-NEXT: [[CMP1:%.*]] = icmp sle i32 [[TMP5]], [[TMP6]]
1257 // CHECK1-NEXT: br i1 [[CMP1]], label [[OMP_INNER_FOR_BODY:%.*]], label [[OMP_INNER_FOR_END:%.*]]
1258 // CHECK1: omp.inner.for.body:
1259 // CHECK1-NEXT: [[TMP7:%.*]] = load i32, ptr [[DOTOMP_COMB_LB]], align 4
1260 // CHECK1-NEXT: [[TMP8:%.*]] = zext i32 [[TMP7]] to i64
1261 // CHECK1-NEXT: [[TMP9:%.*]] = load i32, ptr [[DOTOMP_COMB_UB]], align 4
1262 // CHECK1-NEXT: [[TMP10:%.*]] = zext i32 [[TMP9]] to i64
1263 // CHECK1-NEXT: call void @__kmpc_serialized_parallel(ptr @[[GLOB3]], i32 [[TMP1]])
1264 // CHECK1-NEXT: [[TMP11:%.*]] = load ptr, ptr [[DOTGLOBAL_TID__ADDR]], align 8
1265 // CHECK1-NEXT: store i32 0, ptr [[DOTBOUND_ZERO_ADDR]], align 4
1266 // CHECK1-NEXT: call void @{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z5tmainIiEiT__l64.omp_outlined.omp_outlined(ptr [[TMP11]], ptr [[DOTBOUND_ZERO_ADDR]], i64 [[TMP8]], i64 [[TMP10]]) #[[ATTR2]]
1267 // CHECK1-NEXT: call void @__kmpc_end_serialized_parallel(ptr @[[GLOB3]], i32 [[TMP1]])
1268 // CHECK1-NEXT: br label [[OMP_INNER_FOR_INC:%.*]]
1269 // CHECK1: omp.inner.for.inc:
1270 // CHECK1-NEXT: [[TMP12:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4
1271 // CHECK1-NEXT: [[TMP13:%.*]] = load i32, ptr [[DOTOMP_STRIDE]], align 4
1272 // CHECK1-NEXT: [[ADD:%.*]] = add nsw i32 [[TMP12]], [[TMP13]]
1273 // CHECK1-NEXT: store i32 [[ADD]], ptr [[DOTOMP_IV]], align 4
1274 // CHECK1-NEXT: br label [[OMP_INNER_FOR_COND]]
1275 // CHECK1: omp.inner.for.end:
1276 // CHECK1-NEXT: br label [[OMP_LOOP_EXIT:%.*]]
1277 // CHECK1: omp.loop.exit:
1278 // CHECK1-NEXT: call void @__kmpc_for_static_fini(ptr @[[GLOB2]], i32 [[TMP1]])
1279 // CHECK1-NEXT: ret void
1282 // CHECK1-LABEL: define {{[^@]+}}@{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z5tmainIiEiT__l64.omp_outlined.omp_outlined
1283 // CHECK1-SAME: (ptr noalias noundef [[DOTGLOBAL_TID_:%.*]], ptr noalias noundef [[DOTBOUND_TID_:%.*]], i64 noundef [[DOTPREVIOUS_LB_:%.*]], i64 noundef [[DOTPREVIOUS_UB_:%.*]]) #[[ATTR1]] {
1284 // CHECK1-NEXT: entry:
1285 // CHECK1-NEXT: [[DOTGLOBAL_TID__ADDR:%.*]] = alloca ptr, align 8
1286 // CHECK1-NEXT: [[DOTBOUND_TID__ADDR:%.*]] = alloca ptr, align 8
1287 // CHECK1-NEXT: [[DOTPREVIOUS_LB__ADDR:%.*]] = alloca i64, align 8
1288 // CHECK1-NEXT: [[DOTPREVIOUS_UB__ADDR:%.*]] = alloca i64, align 8
1289 // CHECK1-NEXT: [[DOTOMP_IV:%.*]] = alloca i32, align 4
1290 // CHECK1-NEXT: [[TMP:%.*]] = alloca i32, align 4
1291 // CHECK1-NEXT: [[DOTOMP_LB:%.*]] = alloca i32, align 4
1292 // CHECK1-NEXT: [[DOTOMP_UB:%.*]] = alloca i32, align 4
1293 // CHECK1-NEXT: [[DOTOMP_STRIDE:%.*]] = alloca i32, align 4
1294 // CHECK1-NEXT: [[DOTOMP_IS_LAST:%.*]] = alloca i32, align 4
1295 // CHECK1-NEXT: [[I:%.*]] = alloca i32, align 4
1296 // CHECK1-NEXT: store ptr [[DOTGLOBAL_TID_]], ptr [[DOTGLOBAL_TID__ADDR]], align 8
1297 // CHECK1-NEXT: store ptr [[DOTBOUND_TID_]], ptr [[DOTBOUND_TID__ADDR]], align 8
1298 // CHECK1-NEXT: store i64 [[DOTPREVIOUS_LB_]], ptr [[DOTPREVIOUS_LB__ADDR]], align 8
1299 // CHECK1-NEXT: store i64 [[DOTPREVIOUS_UB_]], ptr [[DOTPREVIOUS_UB__ADDR]], align 8
1300 // CHECK1-NEXT: store i32 0, ptr [[DOTOMP_LB]], align 4
1301 // CHECK1-NEXT: store i32 99, ptr [[DOTOMP_UB]], align 4
1302 // CHECK1-NEXT: [[TMP0:%.*]] = load i64, ptr [[DOTPREVIOUS_LB__ADDR]], align 8
1303 // CHECK1-NEXT: [[CONV:%.*]] = trunc i64 [[TMP0]] to i32
1304 // CHECK1-NEXT: [[TMP1:%.*]] = load i64, ptr [[DOTPREVIOUS_UB__ADDR]], align 8
1305 // CHECK1-NEXT: [[CONV1:%.*]] = trunc i64 [[TMP1]] to i32
1306 // CHECK1-NEXT: store i32 [[CONV]], ptr [[DOTOMP_LB]], align 4
1307 // CHECK1-NEXT: store i32 [[CONV1]], ptr [[DOTOMP_UB]], align 4
1308 // CHECK1-NEXT: store i32 1, ptr [[DOTOMP_STRIDE]], align 4
1309 // CHECK1-NEXT: store i32 0, ptr [[DOTOMP_IS_LAST]], align 4
1310 // CHECK1-NEXT: [[TMP2:%.*]] = load ptr, ptr [[DOTGLOBAL_TID__ADDR]], align 8
1311 // CHECK1-NEXT: [[TMP3:%.*]] = load i32, ptr [[TMP2]], align 4
1312 // 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)
1313 // CHECK1-NEXT: [[TMP4:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4
1314 // CHECK1-NEXT: [[CMP:%.*]] = icmp sgt i32 [[TMP4]], 99
1315 // CHECK1-NEXT: br i1 [[CMP]], label [[COND_TRUE:%.*]], label [[COND_FALSE:%.*]]
1316 // CHECK1: cond.true:
1317 // CHECK1-NEXT: br label [[COND_END:%.*]]
1318 // CHECK1: cond.false:
1319 // CHECK1-NEXT: [[TMP5:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4
1320 // CHECK1-NEXT: br label [[COND_END]]
1321 // CHECK1: cond.end:
1322 // CHECK1-NEXT: [[COND:%.*]] = phi i32 [ 99, [[COND_TRUE]] ], [ [[TMP5]], [[COND_FALSE]] ]
1323 // CHECK1-NEXT: store i32 [[COND]], ptr [[DOTOMP_UB]], align 4
1324 // CHECK1-NEXT: [[TMP6:%.*]] = load i32, ptr [[DOTOMP_LB]], align 4
1325 // CHECK1-NEXT: store i32 [[TMP6]], ptr [[DOTOMP_IV]], align 4
1326 // CHECK1-NEXT: br label [[OMP_INNER_FOR_COND:%.*]]
1327 // CHECK1: omp.inner.for.cond:
1328 // CHECK1-NEXT: [[TMP7:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4
1329 // CHECK1-NEXT: [[TMP8:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4
1330 // CHECK1-NEXT: [[CMP2:%.*]] = icmp sle i32 [[TMP7]], [[TMP8]]
1331 // CHECK1-NEXT: br i1 [[CMP2]], label [[OMP_INNER_FOR_BODY:%.*]], label [[OMP_INNER_FOR_END:%.*]]
1332 // CHECK1: omp.inner.for.body:
1333 // CHECK1-NEXT: [[TMP9:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4
1334 // CHECK1-NEXT: [[MUL:%.*]] = mul nsw i32 [[TMP9]], 1
1335 // CHECK1-NEXT: [[ADD:%.*]] = add nsw i32 0, [[MUL]]
1336 // CHECK1-NEXT: store i32 [[ADD]], ptr [[I]], align 4
1337 // CHECK1-NEXT: call void @_Z3fn2v()
1338 // CHECK1-NEXT: br label [[OMP_BODY_CONTINUE:%.*]]
1339 // CHECK1: omp.body.continue:
1340 // CHECK1-NEXT: br label [[OMP_INNER_FOR_INC:%.*]]
1341 // CHECK1: omp.inner.for.inc:
1342 // CHECK1-NEXT: [[TMP10:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4
1343 // CHECK1-NEXT: [[ADD3:%.*]] = add nsw i32 [[TMP10]], 1
1344 // CHECK1-NEXT: store i32 [[ADD3]], ptr [[DOTOMP_IV]], align 4
1345 // CHECK1-NEXT: br label [[OMP_INNER_FOR_COND]]
1346 // CHECK1: omp.inner.for.end:
1347 // CHECK1-NEXT: br label [[OMP_LOOP_EXIT:%.*]]
1348 // CHECK1: omp.loop.exit:
1349 // CHECK1-NEXT: call void @__kmpc_for_static_fini(ptr @[[GLOB2]], i32 [[TMP3]])
1350 // CHECK1-NEXT: ret void
1353 // CHECK1-LABEL: define {{[^@]+}}@{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z5tmainIiEiT__l68
1354 // CHECK1-SAME: () #[[ATTR1]] {
1355 // CHECK1-NEXT: entry:
1356 // CHECK1-NEXT: call void (ptr, i32, ptr, ...) @__kmpc_fork_teams(ptr @[[GLOB3]], i32 0, ptr @{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z5tmainIiEiT__l68.omp_outlined)
1357 // CHECK1-NEXT: ret void
1360 // CHECK1-LABEL: define {{[^@]+}}@{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z5tmainIiEiT__l68.omp_outlined
1361 // CHECK1-SAME: (ptr noalias noundef [[DOTGLOBAL_TID_:%.*]], ptr noalias noundef [[DOTBOUND_TID_:%.*]]) #[[ATTR1]] {
1362 // CHECK1-NEXT: entry:
1363 // CHECK1-NEXT: [[DOTGLOBAL_TID__ADDR:%.*]] = alloca ptr, align 8
1364 // CHECK1-NEXT: [[DOTBOUND_TID__ADDR:%.*]] = alloca ptr, align 8
1365 // CHECK1-NEXT: [[DOTOMP_IV:%.*]] = alloca i32, align 4
1366 // CHECK1-NEXT: [[TMP:%.*]] = alloca i32, align 4
1367 // CHECK1-NEXT: [[DOTOMP_COMB_LB:%.*]] = alloca i32, align 4
1368 // CHECK1-NEXT: [[DOTOMP_COMB_UB:%.*]] = alloca i32, align 4
1369 // CHECK1-NEXT: [[DOTOMP_STRIDE:%.*]] = alloca i32, align 4
1370 // CHECK1-NEXT: [[DOTOMP_IS_LAST:%.*]] = alloca i32, align 4
1371 // CHECK1-NEXT: [[I:%.*]] = alloca i32, align 4
1372 // CHECK1-NEXT: store ptr [[DOTGLOBAL_TID_]], ptr [[DOTGLOBAL_TID__ADDR]], align 8
1373 // CHECK1-NEXT: store ptr [[DOTBOUND_TID_]], ptr [[DOTBOUND_TID__ADDR]], align 8
1374 // CHECK1-NEXT: store i32 0, ptr [[DOTOMP_COMB_LB]], align 4
1375 // CHECK1-NEXT: store i32 99, ptr [[DOTOMP_COMB_UB]], align 4
1376 // CHECK1-NEXT: store i32 1, ptr [[DOTOMP_STRIDE]], align 4
1377 // CHECK1-NEXT: store i32 0, ptr [[DOTOMP_IS_LAST]], align 4
1378 // CHECK1-NEXT: [[TMP0:%.*]] = load ptr, ptr [[DOTGLOBAL_TID__ADDR]], align 8
1379 // CHECK1-NEXT: [[TMP1:%.*]] = load i32, ptr [[TMP0]], align 4
1380 // 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)
1381 // CHECK1-NEXT: [[TMP2:%.*]] = load i32, ptr [[DOTOMP_COMB_UB]], align 4
1382 // CHECK1-NEXT: [[CMP:%.*]] = icmp sgt i32 [[TMP2]], 99
1383 // CHECK1-NEXT: br i1 [[CMP]], label [[COND_TRUE:%.*]], label [[COND_FALSE:%.*]]
1384 // CHECK1: cond.true:
1385 // CHECK1-NEXT: br label [[COND_END:%.*]]
1386 // CHECK1: cond.false:
1387 // CHECK1-NEXT: [[TMP3:%.*]] = load i32, ptr [[DOTOMP_COMB_UB]], align 4
1388 // CHECK1-NEXT: br label [[COND_END]]
1389 // CHECK1: cond.end:
1390 // CHECK1-NEXT: [[COND:%.*]] = phi i32 [ 99, [[COND_TRUE]] ], [ [[TMP3]], [[COND_FALSE]] ]
1391 // CHECK1-NEXT: store i32 [[COND]], ptr [[DOTOMP_COMB_UB]], align 4
1392 // CHECK1-NEXT: [[TMP4:%.*]] = load i32, ptr [[DOTOMP_COMB_LB]], align 4
1393 // CHECK1-NEXT: store i32 [[TMP4]], ptr [[DOTOMP_IV]], align 4
1394 // CHECK1-NEXT: br label [[OMP_INNER_FOR_COND:%.*]]
1395 // CHECK1: omp.inner.for.cond:
1396 // CHECK1-NEXT: [[TMP5:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4
1397 // CHECK1-NEXT: [[TMP6:%.*]] = load i32, ptr [[DOTOMP_COMB_UB]], align 4
1398 // CHECK1-NEXT: [[CMP1:%.*]] = icmp sle i32 [[TMP5]], [[TMP6]]
1399 // CHECK1-NEXT: br i1 [[CMP1]], label [[OMP_INNER_FOR_BODY:%.*]], label [[OMP_INNER_FOR_END:%.*]]
1400 // CHECK1: omp.inner.for.body:
1401 // CHECK1-NEXT: [[TMP7:%.*]] = load i32, ptr [[DOTOMP_COMB_LB]], align 4
1402 // CHECK1-NEXT: [[TMP8:%.*]] = zext i32 [[TMP7]] to i64
1403 // CHECK1-NEXT: [[TMP9:%.*]] = load i32, ptr [[DOTOMP_COMB_UB]], align 4
1404 // CHECK1-NEXT: [[TMP10:%.*]] = zext i32 [[TMP9]] to i64
1405 // CHECK1-NEXT: call void (ptr, i32, ptr, ...) @__kmpc_fork_call(ptr @[[GLOB3]], i32 2, ptr @{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z5tmainIiEiT__l68.omp_outlined.omp_outlined, i64 [[TMP8]], i64 [[TMP10]])
1406 // CHECK1-NEXT: br label [[OMP_INNER_FOR_INC:%.*]]
1407 // CHECK1: omp.inner.for.inc:
1408 // CHECK1-NEXT: [[TMP11:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4
1409 // CHECK1-NEXT: [[TMP12:%.*]] = load i32, ptr [[DOTOMP_STRIDE]], align 4
1410 // CHECK1-NEXT: [[ADD:%.*]] = add nsw i32 [[TMP11]], [[TMP12]]
1411 // CHECK1-NEXT: store i32 [[ADD]], ptr [[DOTOMP_IV]], align 4
1412 // CHECK1-NEXT: br label [[OMP_INNER_FOR_COND]]
1413 // CHECK1: omp.inner.for.end:
1414 // CHECK1-NEXT: br label [[OMP_LOOP_EXIT:%.*]]
1415 // CHECK1: omp.loop.exit:
1416 // CHECK1-NEXT: call void @__kmpc_for_static_fini(ptr @[[GLOB2]], i32 [[TMP1]])
1417 // CHECK1-NEXT: ret void
1420 // CHECK1-LABEL: define {{[^@]+}}@{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z5tmainIiEiT__l68.omp_outlined.omp_outlined
1421 // CHECK1-SAME: (ptr noalias noundef [[DOTGLOBAL_TID_:%.*]], ptr noalias noundef [[DOTBOUND_TID_:%.*]], i64 noundef [[DOTPREVIOUS_LB_:%.*]], i64 noundef [[DOTPREVIOUS_UB_:%.*]]) #[[ATTR1]] {
1422 // CHECK1-NEXT: entry:
1423 // CHECK1-NEXT: [[DOTGLOBAL_TID__ADDR:%.*]] = alloca ptr, align 8
1424 // CHECK1-NEXT: [[DOTBOUND_TID__ADDR:%.*]] = alloca ptr, align 8
1425 // CHECK1-NEXT: [[DOTPREVIOUS_LB__ADDR:%.*]] = alloca i64, align 8
1426 // CHECK1-NEXT: [[DOTPREVIOUS_UB__ADDR:%.*]] = alloca i64, align 8
1427 // CHECK1-NEXT: [[DOTOMP_IV:%.*]] = alloca i32, align 4
1428 // CHECK1-NEXT: [[TMP:%.*]] = alloca i32, align 4
1429 // CHECK1-NEXT: [[DOTOMP_LB:%.*]] = alloca i32, align 4
1430 // CHECK1-NEXT: [[DOTOMP_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: store ptr [[DOTGLOBAL_TID_]], ptr [[DOTGLOBAL_TID__ADDR]], align 8
1435 // CHECK1-NEXT: store ptr [[DOTBOUND_TID_]], ptr [[DOTBOUND_TID__ADDR]], align 8
1436 // CHECK1-NEXT: store i64 [[DOTPREVIOUS_LB_]], ptr [[DOTPREVIOUS_LB__ADDR]], align 8
1437 // CHECK1-NEXT: store i64 [[DOTPREVIOUS_UB_]], ptr [[DOTPREVIOUS_UB__ADDR]], align 8
1438 // CHECK1-NEXT: store i32 0, ptr [[DOTOMP_LB]], align 4
1439 // CHECK1-NEXT: store i32 99, ptr [[DOTOMP_UB]], align 4
1440 // CHECK1-NEXT: [[TMP0:%.*]] = load i64, ptr [[DOTPREVIOUS_LB__ADDR]], align 8
1441 // CHECK1-NEXT: [[CONV:%.*]] = trunc i64 [[TMP0]] to i32
1442 // CHECK1-NEXT: [[TMP1:%.*]] = load i64, ptr [[DOTPREVIOUS_UB__ADDR]], align 8
1443 // CHECK1-NEXT: [[CONV1:%.*]] = trunc i64 [[TMP1]] to i32
1444 // CHECK1-NEXT: store i32 [[CONV]], ptr [[DOTOMP_LB]], align 4
1445 // CHECK1-NEXT: store i32 [[CONV1]], ptr [[DOTOMP_UB]], align 4
1446 // CHECK1-NEXT: store i32 1, ptr [[DOTOMP_STRIDE]], align 4
1447 // CHECK1-NEXT: store i32 0, ptr [[DOTOMP_IS_LAST]], align 4
1448 // CHECK1-NEXT: [[TMP2:%.*]] = load ptr, ptr [[DOTGLOBAL_TID__ADDR]], align 8
1449 // CHECK1-NEXT: [[TMP3:%.*]] = load i32, ptr [[TMP2]], align 4
1450 // 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)
1451 // CHECK1-NEXT: [[TMP4:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4
1452 // CHECK1-NEXT: [[CMP:%.*]] = icmp sgt i32 [[TMP4]], 99
1453 // CHECK1-NEXT: br i1 [[CMP]], label [[COND_TRUE:%.*]], label [[COND_FALSE:%.*]]
1454 // CHECK1: cond.true:
1455 // CHECK1-NEXT: br label [[COND_END:%.*]]
1456 // CHECK1: cond.false:
1457 // CHECK1-NEXT: [[TMP5:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4
1458 // CHECK1-NEXT: br label [[COND_END]]
1459 // CHECK1: cond.end:
1460 // CHECK1-NEXT: [[COND:%.*]] = phi i32 [ 99, [[COND_TRUE]] ], [ [[TMP5]], [[COND_FALSE]] ]
1461 // CHECK1-NEXT: store i32 [[COND]], ptr [[DOTOMP_UB]], align 4
1462 // CHECK1-NEXT: [[TMP6:%.*]] = load i32, ptr [[DOTOMP_LB]], align 4
1463 // CHECK1-NEXT: store i32 [[TMP6]], ptr [[DOTOMP_IV]], align 4
1464 // CHECK1-NEXT: br label [[OMP_INNER_FOR_COND:%.*]]
1465 // CHECK1: omp.inner.for.cond:
1466 // CHECK1-NEXT: [[TMP7:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4
1467 // CHECK1-NEXT: [[TMP8:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4
1468 // CHECK1-NEXT: [[CMP2:%.*]] = icmp sle i32 [[TMP7]], [[TMP8]]
1469 // CHECK1-NEXT: br i1 [[CMP2]], label [[OMP_INNER_FOR_BODY:%.*]], label [[OMP_INNER_FOR_END:%.*]]
1470 // CHECK1: omp.inner.for.body:
1471 // CHECK1-NEXT: [[TMP9:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4
1472 // CHECK1-NEXT: [[MUL:%.*]] = mul nsw i32 [[TMP9]], 1
1473 // CHECK1-NEXT: [[ADD:%.*]] = add nsw i32 0, [[MUL]]
1474 // CHECK1-NEXT: store i32 [[ADD]], ptr [[I]], align 4
1475 // CHECK1-NEXT: call void @_Z3fn3v()
1476 // CHECK1-NEXT: br label [[OMP_BODY_CONTINUE:%.*]]
1477 // CHECK1: omp.body.continue:
1478 // CHECK1-NEXT: br label [[OMP_INNER_FOR_INC:%.*]]
1479 // CHECK1: omp.inner.for.inc:
1480 // CHECK1-NEXT: [[TMP10:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4
1481 // CHECK1-NEXT: [[ADD3:%.*]] = add nsw i32 [[TMP10]], 1
1482 // CHECK1-NEXT: store i32 [[ADD3]], ptr [[DOTOMP_IV]], align 4
1483 // CHECK1-NEXT: br label [[OMP_INNER_FOR_COND]]
1484 // CHECK1: omp.inner.for.end:
1485 // CHECK1-NEXT: br label [[OMP_LOOP_EXIT:%.*]]
1486 // CHECK1: omp.loop.exit:
1487 // CHECK1-NEXT: call void @__kmpc_for_static_fini(ptr @[[GLOB2]], i32 [[TMP3]])
1488 // CHECK1-NEXT: ret void
1491 // CHECK1-LABEL: define {{[^@]+}}@.omp_offloading.requires_reg
1492 // CHECK1-SAME: () #[[ATTR5:[0-9]+]] {
1493 // CHECK1-NEXT: entry:
1494 // CHECK1-NEXT: call void @__tgt_register_requires(i64 1)
1495 // CHECK1-NEXT: ret void