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 powerpc64le-ibm-linux-gnu -emit-llvm %s -fexceptions -fcxx-exceptions -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 powerpc64le-ibm-linux-gnu -fexceptions -fcxx-exceptions -emit-pch -o %t %s
4 // RUN: %clang_cc1 -fopenmp -fopenmp-version=45 -fopenmp-targets=powerpc64le-ibm-linux-gnu -x c++ -triple powerpc64le-ibm-linux-gnu -fexceptions -fcxx-exceptions -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 powerpc64le-ibm-linux-gnu -emit-llvm %s -fexceptions -fcxx-exceptions -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 powerpc64le-ibm-linux-gnu -fexceptions -fcxx-exceptions -emit-pch -o %t %s
8 // RUN: %clang_cc1 -fopenmp-simd -fopenmp-version=45 -fopenmp-targets=powerpc64le-ibm-linux-gnu -x c++ -triple powerpc64le-ibm-linux-gnu -fexceptions -fcxx-exceptions -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 powerpc64le-ibm-linux-gnu -emit-llvm %s -fexceptions -fcxx-exceptions -o - | FileCheck %s --check-prefix=CHECK5
11 // RUN: %clang_cc1 -fopenmp -fopenmp-targets=powerpc64le-ibm-linux-gnu -x c++ -std=c++11 -triple powerpc64le-ibm-linux-gnu -fexceptions -fcxx-exceptions -emit-pch -o %t %s
12 // RUN: %clang_cc1 -fopenmp -fopenmp-targets=powerpc64le-ibm-linux-gnu -x c++ -triple powerpc64le-ibm-linux-gnu -fexceptions -fcxx-exceptions -std=c++11 -include-pch %t -verify %s -emit-llvm -o - | FileCheck %s --check-prefix=CHECK5
14 // RUN: %clang_cc1 -verify -fopenmp-simd -fopenmp-targets=powerpc64le-ibm-linux-gnu -x c++ -triple powerpc64le-ibm-linux-gnu -emit-llvm %s -fexceptions -fcxx-exceptions -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 powerpc64le-ibm-linux-gnu -fexceptions -fcxx-exceptions -emit-pch -o %t %s
16 // RUN: %clang_cc1 -fopenmp-simd -fopenmp-targets=powerpc64le-ibm-linux-gnu -x c++ -triple powerpc64le-ibm-linux-gnu -fexceptions -fcxx-exceptions -std=c++11 -include-pch %t -verify %s -emit-llvm -o - | FileCheck %s --implicit-check-not="{{__kmpc|__tgt}}"
18 // expected-no-diagnostics
22 typedef __INTPTR_TYPE__
intptr_t;
29 S(intptr_t a
) : a(a
) {}
30 operator char() { return a
; }
34 template <typename T
, int C
>
37 #pragma omp teams distribute parallel for num_threads(C)
38 for (int i
= 0; i
< 100; i
++)
41 #pragma omp teams distribute parallel for num_threads(T(23))
42 for (int i
= 0; i
< 100; i
++)
51 #pragma omp teams distribute parallel for num_threads(2)
52 for (int i
= 0; i
< 100; i
++) {
57 #pragma omp teams distribute parallel for num_threads(a)
58 for (int i
= 0; i
< 100; i
++) {
61 return a
+ tmain
<char, 5>() + tmain
<S
, 1>();
76 // CHECK1-LABEL: define {{[^@]+}}@main
77 // CHECK1-SAME: () #[[ATTR0:[0-9]+]] personality ptr @__gxx_personality_v0 {
78 // CHECK1-NEXT: entry:
79 // CHECK1-NEXT: [[RETVAL:%.*]] = alloca i32, align 4
80 // CHECK1-NEXT: [[S:%.*]] = alloca [[STRUCT_S:%.*]], align 8
81 // CHECK1-NEXT: [[A:%.*]] = alloca i8, align 1
82 // CHECK1-NEXT: [[EXN_SLOT:%.*]] = alloca ptr, align 8
83 // CHECK1-NEXT: [[EHSELECTOR_SLOT:%.*]] = alloca i32, align 4
84 // CHECK1-NEXT: [[TMP:%.*]] = alloca i32, align 4
85 // CHECK1-NEXT: [[KERNEL_ARGS:%.*]] = alloca [[STRUCT___TGT_KERNEL_ARGUMENTS:%.*]], align 8
86 // CHECK1-NEXT: [[A_CASTED:%.*]] = alloca i64, align 8
87 // CHECK1-NEXT: [[DOTOFFLOAD_BASEPTRS:%.*]] = alloca [1 x ptr], align 8
88 // CHECK1-NEXT: [[DOTOFFLOAD_PTRS:%.*]] = alloca [1 x ptr], align 8
89 // CHECK1-NEXT: [[DOTOFFLOAD_MAPPERS:%.*]] = alloca [1 x ptr], align 8
90 // CHECK1-NEXT: [[DOTCAPTURE_EXPR_:%.*]] = alloca i8, align 1
91 // CHECK1-NEXT: [[_TMP1:%.*]] = alloca i32, align 4
92 // CHECK1-NEXT: [[KERNEL_ARGS2:%.*]] = alloca [[STRUCT___TGT_KERNEL_ARGUMENTS]], align 8
93 // CHECK1-NEXT: store i32 0, ptr [[RETVAL]], align 4
94 // CHECK1-NEXT: call void @_ZN1SC1El(ptr noundef nonnull align 8 dereferenceable(24) [[S]], i64 noundef 0)
95 // CHECK1-NEXT: [[CALL:%.*]] = invoke noundef signext i8 @_ZN1ScvcEv(ptr noundef nonnull align 8 dereferenceable(24) [[S]])
96 // CHECK1-NEXT: to label [[INVOKE_CONT:%.*]] unwind label [[LPAD:%.*]]
97 // CHECK1: invoke.cont:
98 // CHECK1-NEXT: store i8 [[CALL]], ptr [[A]], align 1
99 // CHECK1-NEXT: [[TMP0:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 0
100 // CHECK1-NEXT: store i32 2, ptr [[TMP0]], align 4
101 // CHECK1-NEXT: [[TMP1:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 1
102 // CHECK1-NEXT: store i32 0, ptr [[TMP1]], align 4
103 // CHECK1-NEXT: [[TMP2:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 2
104 // CHECK1-NEXT: store ptr null, ptr [[TMP2]], align 8
105 // CHECK1-NEXT: [[TMP3:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 3
106 // CHECK1-NEXT: store ptr null, ptr [[TMP3]], align 8
107 // CHECK1-NEXT: [[TMP4:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 4
108 // CHECK1-NEXT: store ptr null, ptr [[TMP4]], align 8
109 // CHECK1-NEXT: [[TMP5:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 5
110 // CHECK1-NEXT: store ptr null, ptr [[TMP5]], align 8
111 // CHECK1-NEXT: [[TMP6:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 6
112 // CHECK1-NEXT: store ptr null, ptr [[TMP6]], align 8
113 // CHECK1-NEXT: [[TMP7:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 7
114 // CHECK1-NEXT: store ptr null, ptr [[TMP7]], align 8
115 // CHECK1-NEXT: [[TMP8:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 8
116 // CHECK1-NEXT: store i64 100, ptr [[TMP8]], align 8
117 // CHECK1-NEXT: [[TMP9:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 9
118 // CHECK1-NEXT: store i64 0, ptr [[TMP9]], align 8
119 // CHECK1-NEXT: [[TMP10:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 10
120 // CHECK1-NEXT: store [3 x i32] zeroinitializer, ptr [[TMP10]], align 4
121 // CHECK1-NEXT: [[TMP11:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 11
122 // CHECK1-NEXT: store [3 x i32] [i32 2, i32 0, i32 0], ptr [[TMP11]], align 4
123 // CHECK1-NEXT: [[TMP12:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 12
124 // CHECK1-NEXT: store i32 0, ptr [[TMP12]], align 4
125 // CHECK1-NEXT: [[TMP13:%.*]] = call i32 @__tgt_target_kernel(ptr @[[GLOB3:[0-9]+]], i64 -1, i32 0, i32 2, ptr @.{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}_main_l50.region_id, ptr [[KERNEL_ARGS]])
126 // CHECK1-NEXT: [[TMP14:%.*]] = icmp ne i32 [[TMP13]], 0
127 // CHECK1-NEXT: br i1 [[TMP14]], label [[OMP_OFFLOAD_FAILED:%.*]], label [[OMP_OFFLOAD_CONT:%.*]]
128 // CHECK1: omp_offload.failed:
129 // CHECK1-NEXT: call void @{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}_main_l50() #[[ATTR5:[0-9]+]]
130 // CHECK1-NEXT: br label [[OMP_OFFLOAD_CONT]]
132 // CHECK1-NEXT: [[TMP15:%.*]] = landingpad { ptr, i32 }
133 // CHECK1-NEXT: cleanup
134 // CHECK1-NEXT: [[TMP16:%.*]] = extractvalue { ptr, i32 } [[TMP15]], 0
135 // CHECK1-NEXT: store ptr [[TMP16]], ptr [[EXN_SLOT]], align 8
136 // CHECK1-NEXT: [[TMP17:%.*]] = extractvalue { ptr, i32 } [[TMP15]], 1
137 // CHECK1-NEXT: store i32 [[TMP17]], ptr [[EHSELECTOR_SLOT]], align 4
138 // CHECK1-NEXT: call void @_ZN1SD1Ev(ptr noundef nonnull align 8 dereferenceable(24) [[S]]) #[[ATTR5]]
139 // CHECK1-NEXT: br label [[EH_RESUME:%.*]]
140 // CHECK1: omp_offload.cont:
141 // CHECK1-NEXT: [[TMP18:%.*]] = load i8, ptr [[A]], align 1
142 // CHECK1-NEXT: store i8 [[TMP18]], ptr [[A_CASTED]], align 1
143 // CHECK1-NEXT: [[TMP19:%.*]] = load i64, ptr [[A_CASTED]], align 8
144 // CHECK1-NEXT: [[TMP20:%.*]] = getelementptr inbounds [1 x ptr], ptr [[DOTOFFLOAD_BASEPTRS]], i32 0, i32 0
145 // CHECK1-NEXT: store i64 [[TMP19]], ptr [[TMP20]], align 8
146 // CHECK1-NEXT: [[TMP21:%.*]] = getelementptr inbounds [1 x ptr], ptr [[DOTOFFLOAD_PTRS]], i32 0, i32 0
147 // CHECK1-NEXT: store i64 [[TMP19]], ptr [[TMP21]], align 8
148 // CHECK1-NEXT: [[TMP22:%.*]] = getelementptr inbounds [1 x ptr], ptr [[DOTOFFLOAD_MAPPERS]], i64 0, i64 0
149 // CHECK1-NEXT: store ptr null, ptr [[TMP22]], align 8
150 // CHECK1-NEXT: [[TMP23:%.*]] = getelementptr inbounds [1 x ptr], ptr [[DOTOFFLOAD_BASEPTRS]], i32 0, i32 0
151 // CHECK1-NEXT: [[TMP24:%.*]] = getelementptr inbounds [1 x ptr], ptr [[DOTOFFLOAD_PTRS]], i32 0, i32 0
152 // CHECK1-NEXT: [[TMP25:%.*]] = load i8, ptr [[A]], align 1
153 // CHECK1-NEXT: store i8 [[TMP25]], ptr [[DOTCAPTURE_EXPR_]], align 1
154 // CHECK1-NEXT: [[TMP26:%.*]] = load i8, ptr [[DOTCAPTURE_EXPR_]], align 1
155 // CHECK1-NEXT: [[TMP27:%.*]] = zext i8 [[TMP26]] to i32
156 // CHECK1-NEXT: [[TMP28:%.*]] = insertvalue [3 x i32] zeroinitializer, i32 [[TMP27]], 0
157 // CHECK1-NEXT: [[TMP29:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS2]], i32 0, i32 0
158 // CHECK1-NEXT: store i32 2, ptr [[TMP29]], align 4
159 // CHECK1-NEXT: [[TMP30:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS2]], i32 0, i32 1
160 // CHECK1-NEXT: store i32 1, ptr [[TMP30]], align 4
161 // CHECK1-NEXT: [[TMP31:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS2]], i32 0, i32 2
162 // CHECK1-NEXT: store ptr [[TMP23]], ptr [[TMP31]], align 8
163 // CHECK1-NEXT: [[TMP32:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS2]], i32 0, i32 3
164 // CHECK1-NEXT: store ptr [[TMP24]], ptr [[TMP32]], align 8
165 // CHECK1-NEXT: [[TMP33:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS2]], i32 0, i32 4
166 // CHECK1-NEXT: store ptr @.offload_sizes, ptr [[TMP33]], align 8
167 // CHECK1-NEXT: [[TMP34:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS2]], i32 0, i32 5
168 // CHECK1-NEXT: store ptr @.offload_maptypes, ptr [[TMP34]], align 8
169 // CHECK1-NEXT: [[TMP35:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS2]], i32 0, i32 6
170 // CHECK1-NEXT: store ptr null, ptr [[TMP35]], align 8
171 // CHECK1-NEXT: [[TMP36:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS2]], i32 0, i32 7
172 // CHECK1-NEXT: store ptr null, ptr [[TMP36]], align 8
173 // CHECK1-NEXT: [[TMP37:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS2]], i32 0, i32 8
174 // CHECK1-NEXT: store i64 100, ptr [[TMP37]], align 8
175 // CHECK1-NEXT: [[TMP38:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS2]], i32 0, i32 9
176 // CHECK1-NEXT: store i64 0, ptr [[TMP38]], align 8
177 // CHECK1-NEXT: [[TMP39:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS2]], i32 0, i32 10
178 // CHECK1-NEXT: store [3 x i32] zeroinitializer, ptr [[TMP39]], align 4
179 // CHECK1-NEXT: [[TMP40:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS2]], i32 0, i32 11
180 // CHECK1-NEXT: store [3 x i32] [[TMP28]], ptr [[TMP40]], align 4
181 // CHECK1-NEXT: [[TMP41:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS2]], i32 0, i32 12
182 // CHECK1-NEXT: store i32 0, ptr [[TMP41]], align 4
183 // CHECK1-NEXT: [[TMP42:%.*]] = call i32 @__tgt_target_kernel(ptr @[[GLOB3]], i64 -1, i32 0, i32 [[TMP27]], ptr @.{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}_main_l55.region_id, ptr [[KERNEL_ARGS2]])
184 // CHECK1-NEXT: [[TMP43:%.*]] = icmp ne i32 [[TMP42]], 0
185 // CHECK1-NEXT: br i1 [[TMP43]], label [[OMP_OFFLOAD_FAILED3:%.*]], label [[OMP_OFFLOAD_CONT4:%.*]]
186 // CHECK1: omp_offload.failed3:
187 // CHECK1-NEXT: call void @{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}_main_l55(i64 [[TMP19]]) #[[ATTR5]]
188 // CHECK1-NEXT: br label [[OMP_OFFLOAD_CONT4]]
189 // CHECK1: omp_offload.cont4:
190 // CHECK1-NEXT: [[TMP44:%.*]] = load i8, ptr [[A]], align 1
191 // CHECK1-NEXT: [[CONV:%.*]] = sext i8 [[TMP44]] to i32
192 // CHECK1-NEXT: [[CALL6:%.*]] = invoke noundef signext i32 @_Z5tmainIcLi5EEiv()
193 // CHECK1-NEXT: to label [[INVOKE_CONT5:%.*]] unwind label [[LPAD]]
194 // CHECK1: invoke.cont5:
195 // CHECK1-NEXT: [[ADD:%.*]] = add nsw i32 [[CONV]], [[CALL6]]
196 // CHECK1-NEXT: [[CALL8:%.*]] = invoke noundef signext i32 @_Z5tmainI1SLi1EEiv()
197 // CHECK1-NEXT: to label [[INVOKE_CONT7:%.*]] unwind label [[LPAD]]
198 // CHECK1: invoke.cont7:
199 // CHECK1-NEXT: [[ADD9:%.*]] = add nsw i32 [[ADD]], [[CALL8]]
200 // CHECK1-NEXT: store i32 [[ADD9]], ptr [[RETVAL]], align 4
201 // CHECK1-NEXT: call void @_ZN1SD1Ev(ptr noundef nonnull align 8 dereferenceable(24) [[S]]) #[[ATTR5]]
202 // CHECK1-NEXT: [[TMP45:%.*]] = load i32, ptr [[RETVAL]], align 4
203 // CHECK1-NEXT: ret i32 [[TMP45]]
204 // CHECK1: eh.resume:
205 // CHECK1-NEXT: [[EXN:%.*]] = load ptr, ptr [[EXN_SLOT]], align 8
206 // CHECK1-NEXT: [[SEL:%.*]] = load i32, ptr [[EHSELECTOR_SLOT]], align 4
207 // CHECK1-NEXT: [[LPAD_VAL:%.*]] = insertvalue { ptr, i32 } poison, ptr [[EXN]], 0
208 // CHECK1-NEXT: [[LPAD_VAL10:%.*]] = insertvalue { ptr, i32 } [[LPAD_VAL]], i32 [[SEL]], 1
209 // CHECK1-NEXT: resume { ptr, i32 } [[LPAD_VAL10]]
212 // CHECK1-LABEL: define {{[^@]+}}@_ZN1SC1El
213 // CHECK1-SAME: (ptr noundef nonnull align 8 dereferenceable(24) [[THIS:%.*]], i64 noundef [[A:%.*]]) unnamed_addr #[[ATTR1:[0-9]+]] comdat {
214 // CHECK1-NEXT: entry:
215 // CHECK1-NEXT: [[THIS_ADDR:%.*]] = alloca ptr, align 8
216 // CHECK1-NEXT: [[A_ADDR:%.*]] = alloca i64, align 8
217 // CHECK1-NEXT: store ptr [[THIS]], ptr [[THIS_ADDR]], align 8
218 // CHECK1-NEXT: store i64 [[A]], ptr [[A_ADDR]], align 8
219 // CHECK1-NEXT: [[THIS1:%.*]] = load ptr, ptr [[THIS_ADDR]], align 8
220 // CHECK1-NEXT: [[TMP0:%.*]] = load i64, ptr [[A_ADDR]], align 8
221 // CHECK1-NEXT: call void @_ZN1SC2El(ptr noundef nonnull align 8 dereferenceable(24) [[THIS1]], i64 noundef [[TMP0]])
222 // CHECK1-NEXT: ret void
225 // CHECK1-LABEL: define {{[^@]+}}@_ZN1ScvcEv
226 // CHECK1-SAME: (ptr noundef nonnull align 8 dereferenceable(24) [[THIS:%.*]]) #[[ATTR2:[0-9]+]] comdat {
227 // CHECK1-NEXT: entry:
228 // CHECK1-NEXT: [[THIS_ADDR:%.*]] = alloca ptr, align 8
229 // CHECK1-NEXT: store ptr [[THIS]], ptr [[THIS_ADDR]], align 8
230 // CHECK1-NEXT: [[THIS1:%.*]] = load ptr, ptr [[THIS_ADDR]], align 8
231 // CHECK1-NEXT: [[A:%.*]] = getelementptr inbounds [[STRUCT_S:%.*]], ptr [[THIS1]], i32 0, i32 0
232 // CHECK1-NEXT: [[TMP0:%.*]] = load i64, ptr [[A]], align 8
233 // CHECK1-NEXT: [[CONV:%.*]] = trunc i64 [[TMP0]] to i8
234 // CHECK1-NEXT: ret i8 [[CONV]]
237 // CHECK1-LABEL: define {{[^@]+}}@{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}_main_l50
238 // CHECK1-SAME: () #[[ATTR3:[0-9]+]] {
239 // CHECK1-NEXT: entry:
240 // CHECK1-NEXT: call void (ptr, i32, ptr, ...) @__kmpc_fork_teams(ptr @[[GLOB3]], i32 0, ptr @{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}_main_l50.omp_outlined)
241 // CHECK1-NEXT: ret void
244 // CHECK1-LABEL: define {{[^@]+}}@{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}_main_l50.omp_outlined
245 // CHECK1-SAME: (ptr noalias noundef [[DOTGLOBAL_TID_:%.*]], ptr noalias noundef [[DOTBOUND_TID_:%.*]]) #[[ATTR4:[0-9]+]] {
246 // CHECK1-NEXT: entry:
247 // CHECK1-NEXT: [[DOTGLOBAL_TID__ADDR:%.*]] = alloca ptr, align 8
248 // CHECK1-NEXT: [[DOTBOUND_TID__ADDR:%.*]] = alloca ptr, align 8
249 // CHECK1-NEXT: [[DOTOMP_IV:%.*]] = alloca i32, align 4
250 // CHECK1-NEXT: [[TMP:%.*]] = alloca i32, align 4
251 // CHECK1-NEXT: [[DOTOMP_COMB_LB:%.*]] = alloca i32, align 4
252 // CHECK1-NEXT: [[DOTOMP_COMB_UB:%.*]] = alloca i32, align 4
253 // CHECK1-NEXT: [[DOTOMP_STRIDE:%.*]] = alloca i32, align 4
254 // CHECK1-NEXT: [[DOTOMP_IS_LAST:%.*]] = alloca i32, align 4
255 // CHECK1-NEXT: [[I:%.*]] = alloca i32, align 4
256 // CHECK1-NEXT: store ptr [[DOTGLOBAL_TID_]], ptr [[DOTGLOBAL_TID__ADDR]], align 8
257 // CHECK1-NEXT: store ptr [[DOTBOUND_TID_]], ptr [[DOTBOUND_TID__ADDR]], align 8
258 // CHECK1-NEXT: store i32 0, ptr [[DOTOMP_COMB_LB]], align 4
259 // CHECK1-NEXT: store i32 99, ptr [[DOTOMP_COMB_UB]], align 4
260 // CHECK1-NEXT: store i32 1, ptr [[DOTOMP_STRIDE]], align 4
261 // CHECK1-NEXT: store i32 0, ptr [[DOTOMP_IS_LAST]], align 4
262 // CHECK1-NEXT: [[TMP0:%.*]] = load ptr, ptr [[DOTGLOBAL_TID__ADDR]], align 8
263 // CHECK1-NEXT: [[TMP1:%.*]] = load i32, ptr [[TMP0]], align 4
264 // 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)
265 // CHECK1-NEXT: [[TMP2:%.*]] = load i32, ptr [[DOTOMP_COMB_UB]], align 4
266 // CHECK1-NEXT: [[CMP:%.*]] = icmp sgt i32 [[TMP2]], 99
267 // CHECK1-NEXT: br i1 [[CMP]], label [[COND_TRUE:%.*]], label [[COND_FALSE:%.*]]
268 // CHECK1: cond.true:
269 // CHECK1-NEXT: br label [[COND_END:%.*]]
270 // CHECK1: cond.false:
271 // CHECK1-NEXT: [[TMP3:%.*]] = load i32, ptr [[DOTOMP_COMB_UB]], align 4
272 // CHECK1-NEXT: br label [[COND_END]]
274 // CHECK1-NEXT: [[COND:%.*]] = phi i32 [ 99, [[COND_TRUE]] ], [ [[TMP3]], [[COND_FALSE]] ]
275 // CHECK1-NEXT: store i32 [[COND]], ptr [[DOTOMP_COMB_UB]], align 4
276 // CHECK1-NEXT: [[TMP4:%.*]] = load i32, ptr [[DOTOMP_COMB_LB]], align 4
277 // CHECK1-NEXT: store i32 [[TMP4]], ptr [[DOTOMP_IV]], align 4
278 // CHECK1-NEXT: br label [[OMP_INNER_FOR_COND:%.*]]
279 // CHECK1: omp.inner.for.cond:
280 // CHECK1-NEXT: [[TMP5:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4
281 // CHECK1-NEXT: [[TMP6:%.*]] = load i32, ptr [[DOTOMP_COMB_UB]], align 4
282 // CHECK1-NEXT: [[CMP1:%.*]] = icmp sle i32 [[TMP5]], [[TMP6]]
283 // CHECK1-NEXT: br i1 [[CMP1]], label [[OMP_INNER_FOR_BODY:%.*]], label [[OMP_INNER_FOR_END:%.*]]
284 // CHECK1: omp.inner.for.body:
285 // CHECK1-NEXT: call void @__kmpc_push_num_threads(ptr @[[GLOB3]], i32 [[TMP1]], i32 2)
286 // CHECK1-NEXT: [[TMP7:%.*]] = load i32, ptr [[DOTOMP_COMB_LB]], align 4
287 // CHECK1-NEXT: [[TMP8:%.*]] = zext i32 [[TMP7]] to i64
288 // CHECK1-NEXT: [[TMP9:%.*]] = load i32, ptr [[DOTOMP_COMB_UB]], align 4
289 // CHECK1-NEXT: [[TMP10:%.*]] = zext i32 [[TMP9]] to i64
290 // CHECK1-NEXT: call void (ptr, i32, ptr, ...) @__kmpc_fork_call(ptr @[[GLOB3]], i32 2, ptr @{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}_main_l50.omp_outlined.omp_outlined, i64 [[TMP8]], i64 [[TMP10]])
291 // CHECK1-NEXT: br label [[OMP_INNER_FOR_INC:%.*]]
292 // CHECK1: omp.inner.for.inc:
293 // CHECK1-NEXT: [[TMP11:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4
294 // CHECK1-NEXT: [[TMP12:%.*]] = load i32, ptr [[DOTOMP_STRIDE]], align 4
295 // CHECK1-NEXT: [[ADD:%.*]] = add nsw i32 [[TMP11]], [[TMP12]]
296 // CHECK1-NEXT: store i32 [[ADD]], ptr [[DOTOMP_IV]], align 4
297 // CHECK1-NEXT: br label [[OMP_INNER_FOR_COND]]
298 // CHECK1: omp.inner.for.end:
299 // CHECK1-NEXT: br label [[OMP_LOOP_EXIT:%.*]]
300 // CHECK1: omp.loop.exit:
301 // CHECK1-NEXT: call void @__kmpc_for_static_fini(ptr @[[GLOB1]], i32 [[TMP1]])
302 // CHECK1-NEXT: ret void
305 // CHECK1-LABEL: define {{[^@]+}}@{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}_main_l50.omp_outlined.omp_outlined
306 // CHECK1-SAME: (ptr noalias noundef [[DOTGLOBAL_TID_:%.*]], ptr noalias noundef [[DOTBOUND_TID_:%.*]], i64 noundef [[DOTPREVIOUS_LB_:%.*]], i64 noundef [[DOTPREVIOUS_UB_:%.*]]) #[[ATTR4]] personality ptr @__gxx_personality_v0 {
307 // CHECK1-NEXT: entry:
308 // CHECK1-NEXT: [[DOTGLOBAL_TID__ADDR:%.*]] = alloca ptr, align 8
309 // CHECK1-NEXT: [[DOTBOUND_TID__ADDR:%.*]] = alloca ptr, align 8
310 // CHECK1-NEXT: [[DOTPREVIOUS_LB__ADDR:%.*]] = alloca i64, align 8
311 // CHECK1-NEXT: [[DOTPREVIOUS_UB__ADDR:%.*]] = alloca i64, align 8
312 // CHECK1-NEXT: [[DOTOMP_IV:%.*]] = alloca i32, align 4
313 // CHECK1-NEXT: [[TMP:%.*]] = alloca i32, align 4
314 // CHECK1-NEXT: [[DOTOMP_LB:%.*]] = alloca i32, align 4
315 // CHECK1-NEXT: [[DOTOMP_UB:%.*]] = alloca i32, align 4
316 // CHECK1-NEXT: [[DOTOMP_STRIDE:%.*]] = alloca i32, align 4
317 // CHECK1-NEXT: [[DOTOMP_IS_LAST:%.*]] = alloca i32, align 4
318 // CHECK1-NEXT: [[I:%.*]] = alloca i32, align 4
319 // CHECK1-NEXT: store ptr [[DOTGLOBAL_TID_]], ptr [[DOTGLOBAL_TID__ADDR]], align 8
320 // CHECK1-NEXT: store ptr [[DOTBOUND_TID_]], ptr [[DOTBOUND_TID__ADDR]], align 8
321 // CHECK1-NEXT: store i64 [[DOTPREVIOUS_LB_]], ptr [[DOTPREVIOUS_LB__ADDR]], align 8
322 // CHECK1-NEXT: store i64 [[DOTPREVIOUS_UB_]], ptr [[DOTPREVIOUS_UB__ADDR]], align 8
323 // CHECK1-NEXT: store i32 0, ptr [[DOTOMP_LB]], align 4
324 // CHECK1-NEXT: store i32 99, ptr [[DOTOMP_UB]], align 4
325 // CHECK1-NEXT: [[TMP0:%.*]] = load i64, ptr [[DOTPREVIOUS_LB__ADDR]], align 8
326 // CHECK1-NEXT: [[CONV:%.*]] = trunc i64 [[TMP0]] to i32
327 // CHECK1-NEXT: [[TMP1:%.*]] = load i64, ptr [[DOTPREVIOUS_UB__ADDR]], align 8
328 // CHECK1-NEXT: [[CONV1:%.*]] = trunc i64 [[TMP1]] to i32
329 // CHECK1-NEXT: store i32 [[CONV]], ptr [[DOTOMP_LB]], align 4
330 // CHECK1-NEXT: store i32 [[CONV1]], ptr [[DOTOMP_UB]], align 4
331 // CHECK1-NEXT: store i32 1, ptr [[DOTOMP_STRIDE]], align 4
332 // CHECK1-NEXT: store i32 0, ptr [[DOTOMP_IS_LAST]], align 4
333 // CHECK1-NEXT: [[TMP2:%.*]] = load ptr, ptr [[DOTGLOBAL_TID__ADDR]], align 8
334 // CHECK1-NEXT: [[TMP3:%.*]] = load i32, ptr [[TMP2]], align 4
335 // CHECK1-NEXT: call void @__kmpc_for_static_init_4(ptr @[[GLOB2:[0-9]+]], i32 [[TMP3]], i32 34, ptr [[DOTOMP_IS_LAST]], ptr [[DOTOMP_LB]], ptr [[DOTOMP_UB]], ptr [[DOTOMP_STRIDE]], i32 1, i32 1)
336 // CHECK1-NEXT: [[TMP4:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4
337 // CHECK1-NEXT: [[CMP:%.*]] = icmp sgt i32 [[TMP4]], 99
338 // CHECK1-NEXT: br i1 [[CMP]], label [[COND_TRUE:%.*]], label [[COND_FALSE:%.*]]
339 // CHECK1: cond.true:
340 // CHECK1-NEXT: br label [[COND_END:%.*]]
341 // CHECK1: cond.false:
342 // CHECK1-NEXT: [[TMP5:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4
343 // CHECK1-NEXT: br label [[COND_END]]
345 // CHECK1-NEXT: [[COND:%.*]] = phi i32 [ 99, [[COND_TRUE]] ], [ [[TMP5]], [[COND_FALSE]] ]
346 // CHECK1-NEXT: store i32 [[COND]], ptr [[DOTOMP_UB]], align 4
347 // CHECK1-NEXT: [[TMP6:%.*]] = load i32, ptr [[DOTOMP_LB]], align 4
348 // CHECK1-NEXT: store i32 [[TMP6]], ptr [[DOTOMP_IV]], align 4
349 // CHECK1-NEXT: br label [[OMP_INNER_FOR_COND:%.*]]
350 // CHECK1: omp.inner.for.cond:
351 // CHECK1-NEXT: [[TMP7:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4
352 // CHECK1-NEXT: [[TMP8:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4
353 // CHECK1-NEXT: [[CMP2:%.*]] = icmp sle i32 [[TMP7]], [[TMP8]]
354 // CHECK1-NEXT: br i1 [[CMP2]], label [[OMP_INNER_FOR_BODY:%.*]], label [[OMP_INNER_FOR_END:%.*]]
355 // CHECK1: omp.inner.for.body:
356 // CHECK1-NEXT: [[TMP9:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4
357 // CHECK1-NEXT: [[MUL:%.*]] = mul nsw i32 [[TMP9]], 1
358 // CHECK1-NEXT: [[ADD:%.*]] = add nsw i32 0, [[MUL]]
359 // CHECK1-NEXT: store i32 [[ADD]], ptr [[I]], align 4
360 // CHECK1-NEXT: invoke void @_Z3foov()
361 // CHECK1-NEXT: to label [[INVOKE_CONT:%.*]] unwind label [[TERMINATE_LPAD:%.*]]
362 // CHECK1: invoke.cont:
363 // CHECK1-NEXT: br label [[OMP_BODY_CONTINUE:%.*]]
364 // CHECK1: omp.body.continue:
365 // CHECK1-NEXT: br label [[OMP_INNER_FOR_INC:%.*]]
366 // CHECK1: omp.inner.for.inc:
367 // CHECK1-NEXT: [[TMP10:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4
368 // CHECK1-NEXT: [[ADD3:%.*]] = add nsw i32 [[TMP10]], 1
369 // CHECK1-NEXT: store i32 [[ADD3]], ptr [[DOTOMP_IV]], align 4
370 // CHECK1-NEXT: br label [[OMP_INNER_FOR_COND]]
371 // CHECK1: omp.inner.for.end:
372 // CHECK1-NEXT: br label [[OMP_LOOP_EXIT:%.*]]
373 // CHECK1: omp.loop.exit:
374 // CHECK1-NEXT: call void @__kmpc_for_static_fini(ptr @[[GLOB1]], i32 [[TMP3]])
375 // CHECK1-NEXT: ret void
376 // CHECK1: terminate.lpad:
377 // CHECK1-NEXT: [[TMP11:%.*]] = landingpad { ptr, i32 }
378 // CHECK1-NEXT: catch ptr null
379 // CHECK1-NEXT: [[TMP12:%.*]] = extractvalue { ptr, i32 } [[TMP11]], 0
380 // CHECK1-NEXT: call void @__clang_call_terminate(ptr [[TMP12]]) #[[ATTR13:[0-9]+]]
381 // CHECK1-NEXT: unreachable
384 // CHECK1-LABEL: define {{[^@]+}}@__clang_call_terminate
385 // CHECK1-SAME: (ptr noundef [[TMP0:%.*]]) #[[ATTR7:[0-9]+]] comdat {
386 // CHECK1-NEXT: [[TMP2:%.*]] = call ptr @__cxa_begin_catch(ptr [[TMP0]]) #[[ATTR5]]
387 // CHECK1-NEXT: call void @_ZSt9terminatev() #[[ATTR13]]
388 // CHECK1-NEXT: unreachable
391 // CHECK1-LABEL: define {{[^@]+}}@{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}_main_l55
392 // CHECK1-SAME: (i64 noundef [[A:%.*]]) #[[ATTR4]] {
393 // CHECK1-NEXT: entry:
394 // CHECK1-NEXT: [[A_ADDR:%.*]] = alloca i64, align 8
395 // CHECK1-NEXT: [[DOTCAPTURE_EXPR_:%.*]] = alloca i8, align 1
396 // CHECK1-NEXT: [[DOTCAPTURE_EXPR__CASTED:%.*]] = alloca i64, align 8
397 // CHECK1-NEXT: store i64 [[A]], ptr [[A_ADDR]], align 8
398 // CHECK1-NEXT: [[TMP0:%.*]] = load i8, ptr [[A_ADDR]], align 1
399 // CHECK1-NEXT: store i8 [[TMP0]], ptr [[DOTCAPTURE_EXPR_]], align 1
400 // CHECK1-NEXT: [[TMP1:%.*]] = load i8, ptr [[DOTCAPTURE_EXPR_]], align 1
401 // CHECK1-NEXT: store i8 [[TMP1]], ptr [[DOTCAPTURE_EXPR__CASTED]], align 1
402 // CHECK1-NEXT: [[TMP2:%.*]] = load i64, ptr [[DOTCAPTURE_EXPR__CASTED]], align 8
403 // CHECK1-NEXT: call void (ptr, i32, ptr, ...) @__kmpc_fork_teams(ptr @[[GLOB3]], i32 1, ptr @{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}_main_l55.omp_outlined, i64 [[TMP2]])
404 // CHECK1-NEXT: ret void
407 // CHECK1-LABEL: define {{[^@]+}}@{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}_main_l55.omp_outlined
408 // CHECK1-SAME: (ptr noalias noundef [[DOTGLOBAL_TID_:%.*]], ptr noalias noundef [[DOTBOUND_TID_:%.*]], i64 noundef [[DOTCAPTURE_EXPR_:%.*]]) #[[ATTR4]] {
409 // CHECK1-NEXT: entry:
410 // CHECK1-NEXT: [[DOTGLOBAL_TID__ADDR:%.*]] = alloca ptr, align 8
411 // CHECK1-NEXT: [[DOTBOUND_TID__ADDR:%.*]] = alloca ptr, align 8
412 // CHECK1-NEXT: [[DOTCAPTURE_EXPR__ADDR:%.*]] = alloca i64, align 8
413 // CHECK1-NEXT: [[DOTOMP_IV:%.*]] = alloca i32, align 4
414 // CHECK1-NEXT: [[TMP:%.*]] = alloca i32, align 4
415 // CHECK1-NEXT: [[DOTOMP_COMB_LB:%.*]] = alloca i32, align 4
416 // CHECK1-NEXT: [[DOTOMP_COMB_UB:%.*]] = alloca i32, align 4
417 // CHECK1-NEXT: [[DOTOMP_STRIDE:%.*]] = alloca i32, align 4
418 // CHECK1-NEXT: [[DOTOMP_IS_LAST:%.*]] = alloca i32, align 4
419 // CHECK1-NEXT: [[I:%.*]] = alloca i32, align 4
420 // CHECK1-NEXT: store ptr [[DOTGLOBAL_TID_]], ptr [[DOTGLOBAL_TID__ADDR]], align 8
421 // CHECK1-NEXT: store ptr [[DOTBOUND_TID_]], ptr [[DOTBOUND_TID__ADDR]], align 8
422 // CHECK1-NEXT: store i64 [[DOTCAPTURE_EXPR_]], ptr [[DOTCAPTURE_EXPR__ADDR]], align 8
423 // CHECK1-NEXT: store i32 0, ptr [[DOTOMP_COMB_LB]], align 4
424 // CHECK1-NEXT: store i32 99, ptr [[DOTOMP_COMB_UB]], align 4
425 // CHECK1-NEXT: store i32 1, ptr [[DOTOMP_STRIDE]], align 4
426 // CHECK1-NEXT: store i32 0, ptr [[DOTOMP_IS_LAST]], align 4
427 // CHECK1-NEXT: [[TMP0:%.*]] = load ptr, ptr [[DOTGLOBAL_TID__ADDR]], align 8
428 // CHECK1-NEXT: [[TMP1:%.*]] = load i32, ptr [[TMP0]], align 4
429 // 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)
430 // CHECK1-NEXT: [[TMP2:%.*]] = load i32, ptr [[DOTOMP_COMB_UB]], align 4
431 // CHECK1-NEXT: [[CMP:%.*]] = icmp sgt i32 [[TMP2]], 99
432 // CHECK1-NEXT: br i1 [[CMP]], label [[COND_TRUE:%.*]], label [[COND_FALSE:%.*]]
433 // CHECK1: cond.true:
434 // CHECK1-NEXT: br label [[COND_END:%.*]]
435 // CHECK1: cond.false:
436 // CHECK1-NEXT: [[TMP3:%.*]] = load i32, ptr [[DOTOMP_COMB_UB]], align 4
437 // CHECK1-NEXT: br label [[COND_END]]
439 // CHECK1-NEXT: [[COND:%.*]] = phi i32 [ 99, [[COND_TRUE]] ], [ [[TMP3]], [[COND_FALSE]] ]
440 // CHECK1-NEXT: store i32 [[COND]], ptr [[DOTOMP_COMB_UB]], align 4
441 // CHECK1-NEXT: [[TMP4:%.*]] = load i32, ptr [[DOTOMP_COMB_LB]], align 4
442 // CHECK1-NEXT: store i32 [[TMP4]], ptr [[DOTOMP_IV]], align 4
443 // CHECK1-NEXT: br label [[OMP_INNER_FOR_COND:%.*]]
444 // CHECK1: omp.inner.for.cond:
445 // CHECK1-NEXT: [[TMP5:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4
446 // CHECK1-NEXT: [[TMP6:%.*]] = load i32, ptr [[DOTOMP_COMB_UB]], align 4
447 // CHECK1-NEXT: [[CMP1:%.*]] = icmp sle i32 [[TMP5]], [[TMP6]]
448 // CHECK1-NEXT: br i1 [[CMP1]], label [[OMP_INNER_FOR_BODY:%.*]], label [[OMP_INNER_FOR_END:%.*]]
449 // CHECK1: omp.inner.for.body:
450 // CHECK1-NEXT: [[TMP7:%.*]] = load i8, ptr [[DOTCAPTURE_EXPR__ADDR]], align 1
451 // CHECK1-NEXT: [[TMP8:%.*]] = sext i8 [[TMP7]] to i32
452 // CHECK1-NEXT: call void @__kmpc_push_num_threads(ptr @[[GLOB3]], i32 [[TMP1]], i32 [[TMP8]])
453 // CHECK1-NEXT: [[TMP9:%.*]] = load i32, ptr [[DOTOMP_COMB_LB]], align 4
454 // CHECK1-NEXT: [[TMP10:%.*]] = zext i32 [[TMP9]] to i64
455 // CHECK1-NEXT: [[TMP11:%.*]] = load i32, ptr [[DOTOMP_COMB_UB]], align 4
456 // CHECK1-NEXT: [[TMP12:%.*]] = zext i32 [[TMP11]] to i64
457 // CHECK1-NEXT: call void (ptr, i32, ptr, ...) @__kmpc_fork_call(ptr @[[GLOB3]], i32 2, ptr @{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}_main_l55.omp_outlined.omp_outlined, i64 [[TMP10]], i64 [[TMP12]])
458 // CHECK1-NEXT: br label [[OMP_INNER_FOR_INC:%.*]]
459 // CHECK1: omp.inner.for.inc:
460 // CHECK1-NEXT: [[TMP13:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4
461 // CHECK1-NEXT: [[TMP14:%.*]] = load i32, ptr [[DOTOMP_STRIDE]], align 4
462 // CHECK1-NEXT: [[ADD:%.*]] = add nsw i32 [[TMP13]], [[TMP14]]
463 // CHECK1-NEXT: store i32 [[ADD]], ptr [[DOTOMP_IV]], align 4
464 // CHECK1-NEXT: br label [[OMP_INNER_FOR_COND]]
465 // CHECK1: omp.inner.for.end:
466 // CHECK1-NEXT: br label [[OMP_LOOP_EXIT:%.*]]
467 // CHECK1: omp.loop.exit:
468 // CHECK1-NEXT: call void @__kmpc_for_static_fini(ptr @[[GLOB1]], i32 [[TMP1]])
469 // CHECK1-NEXT: ret void
472 // CHECK1-LABEL: define {{[^@]+}}@{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}_main_l55.omp_outlined.omp_outlined
473 // CHECK1-SAME: (ptr noalias noundef [[DOTGLOBAL_TID_:%.*]], ptr noalias noundef [[DOTBOUND_TID_:%.*]], i64 noundef [[DOTPREVIOUS_LB_:%.*]], i64 noundef [[DOTPREVIOUS_UB_:%.*]]) #[[ATTR4]] personality ptr @__gxx_personality_v0 {
474 // CHECK1-NEXT: entry:
475 // CHECK1-NEXT: [[DOTGLOBAL_TID__ADDR:%.*]] = alloca ptr, align 8
476 // CHECK1-NEXT: [[DOTBOUND_TID__ADDR:%.*]] = alloca ptr, align 8
477 // CHECK1-NEXT: [[DOTPREVIOUS_LB__ADDR:%.*]] = alloca i64, align 8
478 // CHECK1-NEXT: [[DOTPREVIOUS_UB__ADDR:%.*]] = alloca i64, align 8
479 // CHECK1-NEXT: [[DOTOMP_IV:%.*]] = alloca i32, align 4
480 // CHECK1-NEXT: [[TMP:%.*]] = alloca i32, align 4
481 // CHECK1-NEXT: [[DOTOMP_LB:%.*]] = alloca i32, align 4
482 // CHECK1-NEXT: [[DOTOMP_UB:%.*]] = alloca i32, align 4
483 // CHECK1-NEXT: [[DOTOMP_STRIDE:%.*]] = alloca i32, align 4
484 // CHECK1-NEXT: [[DOTOMP_IS_LAST:%.*]] = alloca i32, align 4
485 // CHECK1-NEXT: [[I:%.*]] = alloca i32, align 4
486 // CHECK1-NEXT: store ptr [[DOTGLOBAL_TID_]], ptr [[DOTGLOBAL_TID__ADDR]], align 8
487 // CHECK1-NEXT: store ptr [[DOTBOUND_TID_]], ptr [[DOTBOUND_TID__ADDR]], align 8
488 // CHECK1-NEXT: store i64 [[DOTPREVIOUS_LB_]], ptr [[DOTPREVIOUS_LB__ADDR]], align 8
489 // CHECK1-NEXT: store i64 [[DOTPREVIOUS_UB_]], ptr [[DOTPREVIOUS_UB__ADDR]], align 8
490 // CHECK1-NEXT: store i32 0, ptr [[DOTOMP_LB]], align 4
491 // CHECK1-NEXT: store i32 99, ptr [[DOTOMP_UB]], align 4
492 // CHECK1-NEXT: [[TMP0:%.*]] = load i64, ptr [[DOTPREVIOUS_LB__ADDR]], align 8
493 // CHECK1-NEXT: [[CONV:%.*]] = trunc i64 [[TMP0]] to i32
494 // CHECK1-NEXT: [[TMP1:%.*]] = load i64, ptr [[DOTPREVIOUS_UB__ADDR]], align 8
495 // CHECK1-NEXT: [[CONV1:%.*]] = trunc i64 [[TMP1]] to i32
496 // CHECK1-NEXT: store i32 [[CONV]], ptr [[DOTOMP_LB]], align 4
497 // CHECK1-NEXT: store i32 [[CONV1]], ptr [[DOTOMP_UB]], align 4
498 // CHECK1-NEXT: store i32 1, ptr [[DOTOMP_STRIDE]], align 4
499 // CHECK1-NEXT: store i32 0, ptr [[DOTOMP_IS_LAST]], align 4
500 // CHECK1-NEXT: [[TMP2:%.*]] = load ptr, ptr [[DOTGLOBAL_TID__ADDR]], align 8
501 // CHECK1-NEXT: [[TMP3:%.*]] = load i32, ptr [[TMP2]], align 4
502 // 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)
503 // CHECK1-NEXT: [[TMP4:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4
504 // CHECK1-NEXT: [[CMP:%.*]] = icmp sgt i32 [[TMP4]], 99
505 // CHECK1-NEXT: br i1 [[CMP]], label [[COND_TRUE:%.*]], label [[COND_FALSE:%.*]]
506 // CHECK1: cond.true:
507 // CHECK1-NEXT: br label [[COND_END:%.*]]
508 // CHECK1: cond.false:
509 // CHECK1-NEXT: [[TMP5:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4
510 // CHECK1-NEXT: br label [[COND_END]]
512 // CHECK1-NEXT: [[COND:%.*]] = phi i32 [ 99, [[COND_TRUE]] ], [ [[TMP5]], [[COND_FALSE]] ]
513 // CHECK1-NEXT: store i32 [[COND]], ptr [[DOTOMP_UB]], align 4
514 // CHECK1-NEXT: [[TMP6:%.*]] = load i32, ptr [[DOTOMP_LB]], align 4
515 // CHECK1-NEXT: store i32 [[TMP6]], ptr [[DOTOMP_IV]], align 4
516 // CHECK1-NEXT: br label [[OMP_INNER_FOR_COND:%.*]]
517 // CHECK1: omp.inner.for.cond:
518 // CHECK1-NEXT: [[TMP7:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4
519 // CHECK1-NEXT: [[TMP8:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4
520 // CHECK1-NEXT: [[CMP2:%.*]] = icmp sle i32 [[TMP7]], [[TMP8]]
521 // CHECK1-NEXT: br i1 [[CMP2]], label [[OMP_INNER_FOR_BODY:%.*]], label [[OMP_INNER_FOR_END:%.*]]
522 // CHECK1: omp.inner.for.body:
523 // CHECK1-NEXT: [[TMP9:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4
524 // CHECK1-NEXT: [[MUL:%.*]] = mul nsw i32 [[TMP9]], 1
525 // CHECK1-NEXT: [[ADD:%.*]] = add nsw i32 0, [[MUL]]
526 // CHECK1-NEXT: store i32 [[ADD]], ptr [[I]], align 4
527 // CHECK1-NEXT: invoke void @_Z3foov()
528 // CHECK1-NEXT: to label [[INVOKE_CONT:%.*]] unwind label [[TERMINATE_LPAD:%.*]]
529 // CHECK1: invoke.cont:
530 // CHECK1-NEXT: br label [[OMP_BODY_CONTINUE:%.*]]
531 // CHECK1: omp.body.continue:
532 // CHECK1-NEXT: br label [[OMP_INNER_FOR_INC:%.*]]
533 // CHECK1: omp.inner.for.inc:
534 // CHECK1-NEXT: [[TMP10:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4
535 // CHECK1-NEXT: [[ADD3:%.*]] = add nsw i32 [[TMP10]], 1
536 // CHECK1-NEXT: store i32 [[ADD3]], ptr [[DOTOMP_IV]], align 4
537 // CHECK1-NEXT: br label [[OMP_INNER_FOR_COND]]
538 // CHECK1: omp.inner.for.end:
539 // CHECK1-NEXT: br label [[OMP_LOOP_EXIT:%.*]]
540 // CHECK1: omp.loop.exit:
541 // CHECK1-NEXT: call void @__kmpc_for_static_fini(ptr @[[GLOB1]], i32 [[TMP3]])
542 // CHECK1-NEXT: ret void
543 // CHECK1: terminate.lpad:
544 // CHECK1-NEXT: [[TMP11:%.*]] = landingpad { ptr, i32 }
545 // CHECK1-NEXT: catch ptr null
546 // CHECK1-NEXT: [[TMP12:%.*]] = extractvalue { ptr, i32 } [[TMP11]], 0
547 // CHECK1-NEXT: call void @__clang_call_terminate(ptr [[TMP12]]) #[[ATTR13]]
548 // CHECK1-NEXT: unreachable
551 // CHECK1-LABEL: define {{[^@]+}}@_Z5tmainIcLi5EEiv
552 // CHECK1-SAME: () #[[ATTR2]] comdat {
553 // CHECK1-NEXT: entry:
554 // CHECK1-NEXT: [[TMP:%.*]] = alloca i32, align 4
555 // CHECK1-NEXT: [[KERNEL_ARGS:%.*]] = alloca [[STRUCT___TGT_KERNEL_ARGUMENTS:%.*]], align 8
556 // CHECK1-NEXT: [[_TMP1:%.*]] = alloca i32, align 4
557 // CHECK1-NEXT: [[KERNEL_ARGS2:%.*]] = alloca [[STRUCT___TGT_KERNEL_ARGUMENTS]], align 8
558 // CHECK1-NEXT: [[TMP0:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 0
559 // CHECK1-NEXT: store i32 2, ptr [[TMP0]], align 4
560 // CHECK1-NEXT: [[TMP1:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 1
561 // CHECK1-NEXT: store i32 0, ptr [[TMP1]], align 4
562 // CHECK1-NEXT: [[TMP2:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 2
563 // CHECK1-NEXT: store ptr null, ptr [[TMP2]], align 8
564 // CHECK1-NEXT: [[TMP3:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 3
565 // CHECK1-NEXT: store ptr null, ptr [[TMP3]], align 8
566 // CHECK1-NEXT: [[TMP4:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 4
567 // CHECK1-NEXT: store ptr null, ptr [[TMP4]], align 8
568 // CHECK1-NEXT: [[TMP5:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 5
569 // CHECK1-NEXT: store ptr null, ptr [[TMP5]], align 8
570 // CHECK1-NEXT: [[TMP6:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 6
571 // CHECK1-NEXT: store ptr null, ptr [[TMP6]], align 8
572 // CHECK1-NEXT: [[TMP7:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 7
573 // CHECK1-NEXT: store ptr null, ptr [[TMP7]], align 8
574 // CHECK1-NEXT: [[TMP8:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 8
575 // CHECK1-NEXT: store i64 100, ptr [[TMP8]], align 8
576 // CHECK1-NEXT: [[TMP9:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 9
577 // CHECK1-NEXT: store i64 0, ptr [[TMP9]], align 8
578 // CHECK1-NEXT: [[TMP10:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 10
579 // CHECK1-NEXT: store [3 x i32] zeroinitializer, ptr [[TMP10]], align 4
580 // CHECK1-NEXT: [[TMP11:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 11
581 // CHECK1-NEXT: store [3 x i32] [i32 5, i32 0, i32 0], ptr [[TMP11]], align 4
582 // CHECK1-NEXT: [[TMP12:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 12
583 // CHECK1-NEXT: store i32 0, ptr [[TMP12]], align 4
584 // CHECK1-NEXT: [[TMP13:%.*]] = call i32 @__tgt_target_kernel(ptr @[[GLOB3]], i64 -1, i32 0, i32 5, ptr @.{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z5tmainIcLi5EEiv_l36.region_id, ptr [[KERNEL_ARGS]])
585 // CHECK1-NEXT: [[TMP14:%.*]] = icmp ne i32 [[TMP13]], 0
586 // CHECK1-NEXT: br i1 [[TMP14]], label [[OMP_OFFLOAD_FAILED:%.*]], label [[OMP_OFFLOAD_CONT:%.*]]
587 // CHECK1: omp_offload.failed:
588 // CHECK1-NEXT: call void @{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z5tmainIcLi5EEiv_l36() #[[ATTR5]]
589 // CHECK1-NEXT: br label [[OMP_OFFLOAD_CONT]]
590 // CHECK1: omp_offload.cont:
591 // CHECK1-NEXT: [[TMP15:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS2]], i32 0, i32 0
592 // CHECK1-NEXT: store i32 2, ptr [[TMP15]], align 4
593 // CHECK1-NEXT: [[TMP16:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS2]], i32 0, i32 1
594 // CHECK1-NEXT: store i32 0, ptr [[TMP16]], align 4
595 // CHECK1-NEXT: [[TMP17:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS2]], i32 0, i32 2
596 // CHECK1-NEXT: store ptr null, ptr [[TMP17]], align 8
597 // CHECK1-NEXT: [[TMP18:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS2]], i32 0, i32 3
598 // CHECK1-NEXT: store ptr null, ptr [[TMP18]], align 8
599 // CHECK1-NEXT: [[TMP19:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS2]], i32 0, i32 4
600 // CHECK1-NEXT: store ptr null, ptr [[TMP19]], align 8
601 // CHECK1-NEXT: [[TMP20:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS2]], i32 0, i32 5
602 // CHECK1-NEXT: store ptr null, ptr [[TMP20]], align 8
603 // CHECK1-NEXT: [[TMP21:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS2]], i32 0, i32 6
604 // CHECK1-NEXT: store ptr null, ptr [[TMP21]], align 8
605 // CHECK1-NEXT: [[TMP22:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS2]], i32 0, i32 7
606 // CHECK1-NEXT: store ptr null, ptr [[TMP22]], align 8
607 // CHECK1-NEXT: [[TMP23:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS2]], i32 0, i32 8
608 // CHECK1-NEXT: store i64 100, ptr [[TMP23]], align 8
609 // CHECK1-NEXT: [[TMP24:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS2]], i32 0, i32 9
610 // CHECK1-NEXT: store i64 0, ptr [[TMP24]], align 8
611 // CHECK1-NEXT: [[TMP25:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS2]], i32 0, i32 10
612 // CHECK1-NEXT: store [3 x i32] zeroinitializer, ptr [[TMP25]], align 4
613 // CHECK1-NEXT: [[TMP26:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS2]], i32 0, i32 11
614 // CHECK1-NEXT: store [3 x i32] [i32 23, i32 0, i32 0], ptr [[TMP26]], align 4
615 // CHECK1-NEXT: [[TMP27:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS2]], i32 0, i32 12
616 // CHECK1-NEXT: store i32 0, ptr [[TMP27]], align 4
617 // CHECK1-NEXT: [[TMP28:%.*]] = call i32 @__tgt_target_kernel(ptr @[[GLOB3]], i64 -1, i32 0, i32 23, ptr @.{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z5tmainIcLi5EEiv_l40.region_id, ptr [[KERNEL_ARGS2]])
618 // CHECK1-NEXT: [[TMP29:%.*]] = icmp ne i32 [[TMP28]], 0
619 // CHECK1-NEXT: br i1 [[TMP29]], label [[OMP_OFFLOAD_FAILED3:%.*]], label [[OMP_OFFLOAD_CONT4:%.*]]
620 // CHECK1: omp_offload.failed3:
621 // CHECK1-NEXT: call void @{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z5tmainIcLi5EEiv_l40() #[[ATTR5]]
622 // CHECK1-NEXT: br label [[OMP_OFFLOAD_CONT4]]
623 // CHECK1: omp_offload.cont4:
624 // CHECK1-NEXT: ret i32 0
627 // CHECK1-LABEL: define {{[^@]+}}@_Z5tmainI1SLi1EEiv
628 // CHECK1-SAME: () #[[ATTR2]] comdat personality ptr @__gxx_personality_v0 {
629 // CHECK1-NEXT: entry:
630 // CHECK1-NEXT: [[TMP:%.*]] = alloca i32, align 4
631 // CHECK1-NEXT: [[KERNEL_ARGS:%.*]] = alloca [[STRUCT___TGT_KERNEL_ARGUMENTS:%.*]], align 8
632 // CHECK1-NEXT: [[DOTCAPTURE_EXPR_:%.*]] = alloca i8, align 1
633 // CHECK1-NEXT: [[REF_TMP:%.*]] = alloca [[STRUCT_S:%.*]], align 8
634 // CHECK1-NEXT: [[_TMP1:%.*]] = alloca i32, align 4
635 // CHECK1-NEXT: [[KERNEL_ARGS2:%.*]] = alloca [[STRUCT___TGT_KERNEL_ARGUMENTS]], align 8
636 // CHECK1-NEXT: [[TMP0:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 0
637 // CHECK1-NEXT: store i32 2, ptr [[TMP0]], align 4
638 // CHECK1-NEXT: [[TMP1:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 1
639 // CHECK1-NEXT: store i32 0, ptr [[TMP1]], align 4
640 // CHECK1-NEXT: [[TMP2:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 2
641 // CHECK1-NEXT: store ptr null, ptr [[TMP2]], align 8
642 // CHECK1-NEXT: [[TMP3:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 3
643 // CHECK1-NEXT: store ptr null, ptr [[TMP3]], align 8
644 // CHECK1-NEXT: [[TMP4:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 4
645 // CHECK1-NEXT: store ptr null, ptr [[TMP4]], align 8
646 // CHECK1-NEXT: [[TMP5:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 5
647 // CHECK1-NEXT: store ptr null, ptr [[TMP5]], align 8
648 // CHECK1-NEXT: [[TMP6:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 6
649 // CHECK1-NEXT: store ptr null, ptr [[TMP6]], align 8
650 // CHECK1-NEXT: [[TMP7:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 7
651 // CHECK1-NEXT: store ptr null, ptr [[TMP7]], align 8
652 // CHECK1-NEXT: [[TMP8:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 8
653 // CHECK1-NEXT: store i64 100, ptr [[TMP8]], align 8
654 // CHECK1-NEXT: [[TMP9:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 9
655 // CHECK1-NEXT: store i64 0, ptr [[TMP9]], align 8
656 // CHECK1-NEXT: [[TMP10:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 10
657 // CHECK1-NEXT: store [3 x i32] zeroinitializer, ptr [[TMP10]], align 4
658 // CHECK1-NEXT: [[TMP11:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 11
659 // CHECK1-NEXT: store [3 x i32] [i32 1, i32 0, i32 0], ptr [[TMP11]], align 4
660 // CHECK1-NEXT: [[TMP12:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 12
661 // CHECK1-NEXT: store i32 0, ptr [[TMP12]], align 4
662 // CHECK1-NEXT: [[TMP13:%.*]] = call i32 @__tgt_target_kernel(ptr @[[GLOB3]], i64 -1, i32 0, i32 1, ptr @.{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z5tmainI1SLi1EEiv_l36.region_id, ptr [[KERNEL_ARGS]])
663 // CHECK1-NEXT: [[TMP14:%.*]] = icmp ne i32 [[TMP13]], 0
664 // CHECK1-NEXT: br i1 [[TMP14]], label [[OMP_OFFLOAD_FAILED:%.*]], label [[OMP_OFFLOAD_CONT:%.*]]
665 // CHECK1: omp_offload.failed:
666 // CHECK1-NEXT: call void @{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z5tmainI1SLi1EEiv_l36() #[[ATTR5]]
667 // CHECK1-NEXT: br label [[OMP_OFFLOAD_CONT]]
668 // CHECK1: omp_offload.cont:
669 // CHECK1-NEXT: invoke void @_ZN1SC1El(ptr noundef nonnull align 8 dereferenceable(24) [[REF_TMP]], i64 noundef 23)
670 // CHECK1-NEXT: to label [[INVOKE_CONT:%.*]] unwind label [[TERMINATE_LPAD:%.*]]
671 // CHECK1: invoke.cont:
672 // CHECK1-NEXT: [[CALL:%.*]] = call noundef signext i8 @_ZN1ScvcEv(ptr noundef nonnull align 8 dereferenceable(24) [[REF_TMP]])
673 // CHECK1-NEXT: call void @_ZN1SD1Ev(ptr noundef nonnull align 8 dereferenceable(24) [[REF_TMP]]) #[[ATTR5]]
674 // CHECK1-NEXT: store i8 [[CALL]], ptr [[DOTCAPTURE_EXPR_]], align 1
675 // CHECK1-NEXT: [[TMP15:%.*]] = load i8, ptr [[DOTCAPTURE_EXPR_]], align 1
676 // CHECK1-NEXT: [[TMP16:%.*]] = zext i8 [[TMP15]] to i32
677 // CHECK1-NEXT: [[TMP17:%.*]] = insertvalue [3 x i32] zeroinitializer, i32 [[TMP16]], 0
678 // CHECK1-NEXT: [[TMP18:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS2]], i32 0, i32 0
679 // CHECK1-NEXT: store i32 2, ptr [[TMP18]], align 4
680 // CHECK1-NEXT: [[TMP19:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS2]], i32 0, i32 1
681 // CHECK1-NEXT: store i32 0, ptr [[TMP19]], align 4
682 // CHECK1-NEXT: [[TMP20:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS2]], i32 0, i32 2
683 // CHECK1-NEXT: store ptr null, ptr [[TMP20]], align 8
684 // CHECK1-NEXT: [[TMP21:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS2]], i32 0, i32 3
685 // CHECK1-NEXT: store ptr null, ptr [[TMP21]], align 8
686 // CHECK1-NEXT: [[TMP22:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS2]], i32 0, i32 4
687 // CHECK1-NEXT: store ptr null, ptr [[TMP22]], align 8
688 // CHECK1-NEXT: [[TMP23:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS2]], i32 0, i32 5
689 // CHECK1-NEXT: store ptr null, ptr [[TMP23]], align 8
690 // CHECK1-NEXT: [[TMP24:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS2]], i32 0, i32 6
691 // CHECK1-NEXT: store ptr null, ptr [[TMP24]], align 8
692 // CHECK1-NEXT: [[TMP25:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS2]], i32 0, i32 7
693 // CHECK1-NEXT: store ptr null, ptr [[TMP25]], align 8
694 // CHECK1-NEXT: [[TMP26:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS2]], i32 0, i32 8
695 // CHECK1-NEXT: store i64 100, ptr [[TMP26]], align 8
696 // CHECK1-NEXT: [[TMP27:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS2]], i32 0, i32 9
697 // CHECK1-NEXT: store i64 0, ptr [[TMP27]], align 8
698 // CHECK1-NEXT: [[TMP28:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS2]], i32 0, i32 10
699 // CHECK1-NEXT: store [3 x i32] zeroinitializer, ptr [[TMP28]], align 4
700 // CHECK1-NEXT: [[TMP29:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS2]], i32 0, i32 11
701 // CHECK1-NEXT: store [3 x i32] [[TMP17]], ptr [[TMP29]], align 4
702 // CHECK1-NEXT: [[TMP30:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS2]], i32 0, i32 12
703 // CHECK1-NEXT: store i32 0, ptr [[TMP30]], align 4
704 // CHECK1-NEXT: [[TMP31:%.*]] = call i32 @__tgt_target_kernel(ptr @[[GLOB3]], i64 -1, i32 0, i32 [[TMP16]], ptr @.{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z5tmainI1SLi1EEiv_l40.region_id, ptr [[KERNEL_ARGS2]])
705 // CHECK1-NEXT: [[TMP32:%.*]] = icmp ne i32 [[TMP31]], 0
706 // CHECK1-NEXT: br i1 [[TMP32]], label [[OMP_OFFLOAD_FAILED3:%.*]], label [[OMP_OFFLOAD_CONT4:%.*]]
707 // CHECK1: omp_offload.failed3:
708 // CHECK1-NEXT: call void @{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z5tmainI1SLi1EEiv_l40() #[[ATTR5]]
709 // CHECK1-NEXT: br label [[OMP_OFFLOAD_CONT4]]
710 // CHECK1: omp_offload.cont4:
711 // CHECK1-NEXT: ret i32 0
712 // CHECK1: terminate.lpad:
713 // CHECK1-NEXT: [[TMP33:%.*]] = landingpad { ptr, i32 }
714 // CHECK1-NEXT: catch ptr null
715 // CHECK1-NEXT: [[TMP34:%.*]] = extractvalue { ptr, i32 } [[TMP33]], 0
716 // CHECK1-NEXT: call void @__clang_call_terminate(ptr [[TMP34]]) #[[ATTR13]]
717 // CHECK1-NEXT: unreachable
720 // CHECK1-LABEL: define {{[^@]+}}@_ZN1SD1Ev
721 // CHECK1-SAME: (ptr noundef nonnull align 8 dereferenceable(24) [[THIS:%.*]]) unnamed_addr #[[ATTR8:[0-9]+]] comdat {
722 // CHECK1-NEXT: entry:
723 // CHECK1-NEXT: [[THIS_ADDR:%.*]] = alloca ptr, align 8
724 // CHECK1-NEXT: store ptr [[THIS]], ptr [[THIS_ADDR]], align 8
725 // CHECK1-NEXT: [[THIS1:%.*]] = load ptr, ptr [[THIS_ADDR]], align 8
726 // CHECK1-NEXT: call void @_ZN1SD2Ev(ptr noundef nonnull align 8 dereferenceable(24) [[THIS1]]) #[[ATTR5]]
727 // CHECK1-NEXT: ret void
730 // CHECK1-LABEL: define {{[^@]+}}@_ZN1SC2El
731 // CHECK1-SAME: (ptr noundef nonnull align 8 dereferenceable(24) [[THIS:%.*]], i64 noundef [[A:%.*]]) unnamed_addr #[[ATTR8]] comdat {
732 // CHECK1-NEXT: entry:
733 // CHECK1-NEXT: [[THIS_ADDR:%.*]] = alloca ptr, align 8
734 // CHECK1-NEXT: [[A_ADDR:%.*]] = alloca i64, align 8
735 // CHECK1-NEXT: store ptr [[THIS]], ptr [[THIS_ADDR]], align 8
736 // CHECK1-NEXT: store i64 [[A]], ptr [[A_ADDR]], align 8
737 // CHECK1-NEXT: [[THIS1:%.*]] = load ptr, ptr [[THIS_ADDR]], align 8
738 // CHECK1-NEXT: [[A2:%.*]] = getelementptr inbounds [[STRUCT_S:%.*]], ptr [[THIS1]], i32 0, i32 0
739 // CHECK1-NEXT: [[TMP0:%.*]] = load i64, ptr [[A_ADDR]], align 8
740 // CHECK1-NEXT: store i64 [[TMP0]], ptr [[A2]], align 8
741 // CHECK1-NEXT: ret void
744 // CHECK1-LABEL: define {{[^@]+}}@_ZN1SD2Ev
745 // CHECK1-SAME: (ptr noundef nonnull align 8 dereferenceable(24) [[THIS:%.*]]) unnamed_addr #[[ATTR8]] comdat {
746 // CHECK1-NEXT: entry:
747 // CHECK1-NEXT: [[THIS_ADDR:%.*]] = alloca ptr, align 8
748 // CHECK1-NEXT: store ptr [[THIS]], ptr [[THIS_ADDR]], align 8
749 // CHECK1-NEXT: [[THIS1:%.*]] = load ptr, ptr [[THIS_ADDR]], align 8
750 // CHECK1-NEXT: ret void
753 // CHECK1-LABEL: define {{[^@]+}}@{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z5tmainIcLi5EEiv_l36
754 // CHECK1-SAME: () #[[ATTR9:[0-9]+]] {
755 // CHECK1-NEXT: entry:
756 // CHECK1-NEXT: call void (ptr, i32, ptr, ...) @__kmpc_fork_teams(ptr @[[GLOB3]], i32 0, ptr @{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z5tmainIcLi5EEiv_l36.omp_outlined)
757 // CHECK1-NEXT: ret void
760 // CHECK1-LABEL: define {{[^@]+}}@{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z5tmainIcLi5EEiv_l36.omp_outlined
761 // CHECK1-SAME: (ptr noalias noundef [[DOTGLOBAL_TID_:%.*]], ptr noalias noundef [[DOTBOUND_TID_:%.*]]) #[[ATTR4]] {
762 // CHECK1-NEXT: entry:
763 // CHECK1-NEXT: [[DOTGLOBAL_TID__ADDR:%.*]] = alloca ptr, align 8
764 // CHECK1-NEXT: [[DOTBOUND_TID__ADDR:%.*]] = alloca ptr, align 8
765 // CHECK1-NEXT: [[DOTOMP_IV:%.*]] = alloca i32, align 4
766 // CHECK1-NEXT: [[TMP:%.*]] = alloca i32, align 4
767 // CHECK1-NEXT: [[DOTOMP_COMB_LB:%.*]] = alloca i32, align 4
768 // CHECK1-NEXT: [[DOTOMP_COMB_UB:%.*]] = alloca i32, align 4
769 // CHECK1-NEXT: [[DOTOMP_STRIDE:%.*]] = alloca i32, align 4
770 // CHECK1-NEXT: [[DOTOMP_IS_LAST:%.*]] = alloca i32, align 4
771 // CHECK1-NEXT: [[I:%.*]] = alloca i32, align 4
772 // CHECK1-NEXT: store ptr [[DOTGLOBAL_TID_]], ptr [[DOTGLOBAL_TID__ADDR]], align 8
773 // CHECK1-NEXT: store ptr [[DOTBOUND_TID_]], ptr [[DOTBOUND_TID__ADDR]], align 8
774 // CHECK1-NEXT: store i32 0, ptr [[DOTOMP_COMB_LB]], align 4
775 // CHECK1-NEXT: store i32 99, ptr [[DOTOMP_COMB_UB]], align 4
776 // CHECK1-NEXT: store i32 1, ptr [[DOTOMP_STRIDE]], align 4
777 // CHECK1-NEXT: store i32 0, ptr [[DOTOMP_IS_LAST]], align 4
778 // CHECK1-NEXT: [[TMP0:%.*]] = load ptr, ptr [[DOTGLOBAL_TID__ADDR]], align 8
779 // CHECK1-NEXT: [[TMP1:%.*]] = load i32, ptr [[TMP0]], align 4
780 // 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)
781 // CHECK1-NEXT: [[TMP2:%.*]] = load i32, ptr [[DOTOMP_COMB_UB]], align 4
782 // CHECK1-NEXT: [[CMP:%.*]] = icmp sgt i32 [[TMP2]], 99
783 // CHECK1-NEXT: br i1 [[CMP]], label [[COND_TRUE:%.*]], label [[COND_FALSE:%.*]]
784 // CHECK1: cond.true:
785 // CHECK1-NEXT: br label [[COND_END:%.*]]
786 // CHECK1: cond.false:
787 // CHECK1-NEXT: [[TMP3:%.*]] = load i32, ptr [[DOTOMP_COMB_UB]], align 4
788 // CHECK1-NEXT: br label [[COND_END]]
790 // CHECK1-NEXT: [[COND:%.*]] = phi i32 [ 99, [[COND_TRUE]] ], [ [[TMP3]], [[COND_FALSE]] ]
791 // CHECK1-NEXT: store i32 [[COND]], ptr [[DOTOMP_COMB_UB]], align 4
792 // CHECK1-NEXT: [[TMP4:%.*]] = load i32, ptr [[DOTOMP_COMB_LB]], align 4
793 // CHECK1-NEXT: store i32 [[TMP4]], ptr [[DOTOMP_IV]], align 4
794 // CHECK1-NEXT: br label [[OMP_INNER_FOR_COND:%.*]]
795 // CHECK1: omp.inner.for.cond:
796 // CHECK1-NEXT: [[TMP5:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4
797 // CHECK1-NEXT: [[TMP6:%.*]] = load i32, ptr [[DOTOMP_COMB_UB]], align 4
798 // CHECK1-NEXT: [[CMP1:%.*]] = icmp sle i32 [[TMP5]], [[TMP6]]
799 // CHECK1-NEXT: br i1 [[CMP1]], label [[OMP_INNER_FOR_BODY:%.*]], label [[OMP_INNER_FOR_END:%.*]]
800 // CHECK1: omp.inner.for.body:
801 // CHECK1-NEXT: call void @__kmpc_push_num_threads(ptr @[[GLOB3]], i32 [[TMP1]], i32 5)
802 // CHECK1-NEXT: [[TMP7:%.*]] = load i32, ptr [[DOTOMP_COMB_LB]], align 4
803 // CHECK1-NEXT: [[TMP8:%.*]] = zext i32 [[TMP7]] to i64
804 // CHECK1-NEXT: [[TMP9:%.*]] = load i32, ptr [[DOTOMP_COMB_UB]], align 4
805 // CHECK1-NEXT: [[TMP10:%.*]] = zext i32 [[TMP9]] to i64
806 // CHECK1-NEXT: call void (ptr, i32, ptr, ...) @__kmpc_fork_call(ptr @[[GLOB3]], i32 2, ptr @{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z5tmainIcLi5EEiv_l36.omp_outlined.omp_outlined, i64 [[TMP8]], i64 [[TMP10]])
807 // CHECK1-NEXT: br label [[OMP_INNER_FOR_INC:%.*]]
808 // CHECK1: omp.inner.for.inc:
809 // CHECK1-NEXT: [[TMP11:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4
810 // CHECK1-NEXT: [[TMP12:%.*]] = load i32, ptr [[DOTOMP_STRIDE]], align 4
811 // CHECK1-NEXT: [[ADD:%.*]] = add nsw i32 [[TMP11]], [[TMP12]]
812 // CHECK1-NEXT: store i32 [[ADD]], ptr [[DOTOMP_IV]], align 4
813 // CHECK1-NEXT: br label [[OMP_INNER_FOR_COND]]
814 // CHECK1: omp.inner.for.end:
815 // CHECK1-NEXT: br label [[OMP_LOOP_EXIT:%.*]]
816 // CHECK1: omp.loop.exit:
817 // CHECK1-NEXT: call void @__kmpc_for_static_fini(ptr @[[GLOB1]], i32 [[TMP1]])
818 // CHECK1-NEXT: ret void
821 // CHECK1-LABEL: define {{[^@]+}}@{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z5tmainIcLi5EEiv_l36.omp_outlined.omp_outlined
822 // CHECK1-SAME: (ptr noalias noundef [[DOTGLOBAL_TID_:%.*]], ptr noalias noundef [[DOTBOUND_TID_:%.*]], i64 noundef [[DOTPREVIOUS_LB_:%.*]], i64 noundef [[DOTPREVIOUS_UB_:%.*]]) #[[ATTR4]] personality ptr @__gxx_personality_v0 {
823 // CHECK1-NEXT: entry:
824 // CHECK1-NEXT: [[DOTGLOBAL_TID__ADDR:%.*]] = alloca ptr, align 8
825 // CHECK1-NEXT: [[DOTBOUND_TID__ADDR:%.*]] = alloca ptr, align 8
826 // CHECK1-NEXT: [[DOTPREVIOUS_LB__ADDR:%.*]] = alloca i64, align 8
827 // CHECK1-NEXT: [[DOTPREVIOUS_UB__ADDR:%.*]] = alloca i64, align 8
828 // CHECK1-NEXT: [[DOTOMP_IV:%.*]] = alloca i32, align 4
829 // CHECK1-NEXT: [[TMP:%.*]] = alloca i32, align 4
830 // CHECK1-NEXT: [[DOTOMP_LB:%.*]] = alloca i32, align 4
831 // CHECK1-NEXT: [[DOTOMP_UB:%.*]] = alloca i32, align 4
832 // CHECK1-NEXT: [[DOTOMP_STRIDE:%.*]] = alloca i32, align 4
833 // CHECK1-NEXT: [[DOTOMP_IS_LAST:%.*]] = alloca i32, align 4
834 // CHECK1-NEXT: [[I:%.*]] = alloca i32, align 4
835 // CHECK1-NEXT: store ptr [[DOTGLOBAL_TID_]], ptr [[DOTGLOBAL_TID__ADDR]], align 8
836 // CHECK1-NEXT: store ptr [[DOTBOUND_TID_]], ptr [[DOTBOUND_TID__ADDR]], align 8
837 // CHECK1-NEXT: store i64 [[DOTPREVIOUS_LB_]], ptr [[DOTPREVIOUS_LB__ADDR]], align 8
838 // CHECK1-NEXT: store i64 [[DOTPREVIOUS_UB_]], ptr [[DOTPREVIOUS_UB__ADDR]], align 8
839 // CHECK1-NEXT: store i32 0, ptr [[DOTOMP_LB]], align 4
840 // CHECK1-NEXT: store i32 99, ptr [[DOTOMP_UB]], align 4
841 // CHECK1-NEXT: [[TMP0:%.*]] = load i64, ptr [[DOTPREVIOUS_LB__ADDR]], align 8
842 // CHECK1-NEXT: [[CONV:%.*]] = trunc i64 [[TMP0]] to i32
843 // CHECK1-NEXT: [[TMP1:%.*]] = load i64, ptr [[DOTPREVIOUS_UB__ADDR]], align 8
844 // CHECK1-NEXT: [[CONV1:%.*]] = trunc i64 [[TMP1]] to i32
845 // CHECK1-NEXT: store i32 [[CONV]], ptr [[DOTOMP_LB]], align 4
846 // CHECK1-NEXT: store i32 [[CONV1]], ptr [[DOTOMP_UB]], align 4
847 // CHECK1-NEXT: store i32 1, ptr [[DOTOMP_STRIDE]], align 4
848 // CHECK1-NEXT: store i32 0, ptr [[DOTOMP_IS_LAST]], align 4
849 // CHECK1-NEXT: [[TMP2:%.*]] = load ptr, ptr [[DOTGLOBAL_TID__ADDR]], align 8
850 // CHECK1-NEXT: [[TMP3:%.*]] = load i32, ptr [[TMP2]], align 4
851 // 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)
852 // CHECK1-NEXT: [[TMP4:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4
853 // CHECK1-NEXT: [[CMP:%.*]] = icmp sgt i32 [[TMP4]], 99
854 // CHECK1-NEXT: br i1 [[CMP]], label [[COND_TRUE:%.*]], label [[COND_FALSE:%.*]]
855 // CHECK1: cond.true:
856 // CHECK1-NEXT: br label [[COND_END:%.*]]
857 // CHECK1: cond.false:
858 // CHECK1-NEXT: [[TMP5:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4
859 // CHECK1-NEXT: br label [[COND_END]]
861 // CHECK1-NEXT: [[COND:%.*]] = phi i32 [ 99, [[COND_TRUE]] ], [ [[TMP5]], [[COND_FALSE]] ]
862 // CHECK1-NEXT: store i32 [[COND]], ptr [[DOTOMP_UB]], align 4
863 // CHECK1-NEXT: [[TMP6:%.*]] = load i32, ptr [[DOTOMP_LB]], align 4
864 // CHECK1-NEXT: store i32 [[TMP6]], ptr [[DOTOMP_IV]], align 4
865 // CHECK1-NEXT: br label [[OMP_INNER_FOR_COND:%.*]]
866 // CHECK1: omp.inner.for.cond:
867 // CHECK1-NEXT: [[TMP7:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4
868 // CHECK1-NEXT: [[TMP8:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4
869 // CHECK1-NEXT: [[CMP2:%.*]] = icmp sle i32 [[TMP7]], [[TMP8]]
870 // CHECK1-NEXT: br i1 [[CMP2]], label [[OMP_INNER_FOR_BODY:%.*]], label [[OMP_INNER_FOR_END:%.*]]
871 // CHECK1: omp.inner.for.body:
872 // CHECK1-NEXT: [[TMP9:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4
873 // CHECK1-NEXT: [[MUL:%.*]] = mul nsw i32 [[TMP9]], 1
874 // CHECK1-NEXT: [[ADD:%.*]] = add nsw i32 0, [[MUL]]
875 // CHECK1-NEXT: store i32 [[ADD]], ptr [[I]], align 4
876 // CHECK1-NEXT: invoke void @_Z3foov()
877 // CHECK1-NEXT: to label [[INVOKE_CONT:%.*]] unwind label [[TERMINATE_LPAD:%.*]]
878 // CHECK1: invoke.cont:
879 // CHECK1-NEXT: br label [[OMP_BODY_CONTINUE:%.*]]
880 // CHECK1: omp.body.continue:
881 // CHECK1-NEXT: br label [[OMP_INNER_FOR_INC:%.*]]
882 // CHECK1: omp.inner.for.inc:
883 // CHECK1-NEXT: [[TMP10:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4
884 // CHECK1-NEXT: [[ADD3:%.*]] = add nsw i32 [[TMP10]], 1
885 // CHECK1-NEXT: store i32 [[ADD3]], ptr [[DOTOMP_IV]], align 4
886 // CHECK1-NEXT: br label [[OMP_INNER_FOR_COND]]
887 // CHECK1: omp.inner.for.end:
888 // CHECK1-NEXT: br label [[OMP_LOOP_EXIT:%.*]]
889 // CHECK1: omp.loop.exit:
890 // CHECK1-NEXT: call void @__kmpc_for_static_fini(ptr @[[GLOB1]], i32 [[TMP3]])
891 // CHECK1-NEXT: ret void
892 // CHECK1: terminate.lpad:
893 // CHECK1-NEXT: [[TMP11:%.*]] = landingpad { ptr, i32 }
894 // CHECK1-NEXT: catch ptr null
895 // CHECK1-NEXT: [[TMP12:%.*]] = extractvalue { ptr, i32 } [[TMP11]], 0
896 // CHECK1-NEXT: call void @__clang_call_terminate(ptr [[TMP12]]) #[[ATTR13]]
897 // CHECK1-NEXT: unreachable
900 // CHECK1-LABEL: define {{[^@]+}}@{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z5tmainIcLi5EEiv_l40
901 // CHECK1-SAME: () #[[ATTR10:[0-9]+]] {
902 // CHECK1-NEXT: entry:
903 // CHECK1-NEXT: call void (ptr, i32, ptr, ...) @__kmpc_fork_teams(ptr @[[GLOB3]], i32 0, ptr @{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z5tmainIcLi5EEiv_l40.omp_outlined)
904 // CHECK1-NEXT: ret void
907 // CHECK1-LABEL: define {{[^@]+}}@{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z5tmainIcLi5EEiv_l40.omp_outlined
908 // CHECK1-SAME: (ptr noalias noundef [[DOTGLOBAL_TID_:%.*]], ptr noalias noundef [[DOTBOUND_TID_:%.*]]) #[[ATTR4]] {
909 // CHECK1-NEXT: entry:
910 // CHECK1-NEXT: [[DOTGLOBAL_TID__ADDR:%.*]] = alloca ptr, align 8
911 // CHECK1-NEXT: [[DOTBOUND_TID__ADDR:%.*]] = alloca ptr, align 8
912 // CHECK1-NEXT: [[DOTOMP_IV:%.*]] = alloca i32, align 4
913 // CHECK1-NEXT: [[TMP:%.*]] = alloca i32, align 4
914 // CHECK1-NEXT: [[DOTOMP_COMB_LB:%.*]] = alloca i32, align 4
915 // CHECK1-NEXT: [[DOTOMP_COMB_UB:%.*]] = alloca i32, align 4
916 // CHECK1-NEXT: [[DOTOMP_STRIDE:%.*]] = alloca i32, align 4
917 // CHECK1-NEXT: [[DOTOMP_IS_LAST:%.*]] = alloca i32, align 4
918 // CHECK1-NEXT: [[I:%.*]] = alloca i32, align 4
919 // CHECK1-NEXT: store ptr [[DOTGLOBAL_TID_]], ptr [[DOTGLOBAL_TID__ADDR]], align 8
920 // CHECK1-NEXT: store ptr [[DOTBOUND_TID_]], ptr [[DOTBOUND_TID__ADDR]], align 8
921 // CHECK1-NEXT: store i32 0, ptr [[DOTOMP_COMB_LB]], align 4
922 // CHECK1-NEXT: store i32 99, ptr [[DOTOMP_COMB_UB]], align 4
923 // CHECK1-NEXT: store i32 1, ptr [[DOTOMP_STRIDE]], align 4
924 // CHECK1-NEXT: store i32 0, ptr [[DOTOMP_IS_LAST]], align 4
925 // CHECK1-NEXT: [[TMP0:%.*]] = load ptr, ptr [[DOTGLOBAL_TID__ADDR]], align 8
926 // CHECK1-NEXT: [[TMP1:%.*]] = load i32, ptr [[TMP0]], align 4
927 // 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)
928 // CHECK1-NEXT: [[TMP2:%.*]] = load i32, ptr [[DOTOMP_COMB_UB]], align 4
929 // CHECK1-NEXT: [[CMP:%.*]] = icmp sgt i32 [[TMP2]], 99
930 // CHECK1-NEXT: br i1 [[CMP]], label [[COND_TRUE:%.*]], label [[COND_FALSE:%.*]]
931 // CHECK1: cond.true:
932 // CHECK1-NEXT: br label [[COND_END:%.*]]
933 // CHECK1: cond.false:
934 // CHECK1-NEXT: [[TMP3:%.*]] = load i32, ptr [[DOTOMP_COMB_UB]], align 4
935 // CHECK1-NEXT: br label [[COND_END]]
937 // CHECK1-NEXT: [[COND:%.*]] = phi i32 [ 99, [[COND_TRUE]] ], [ [[TMP3]], [[COND_FALSE]] ]
938 // CHECK1-NEXT: store i32 [[COND]], ptr [[DOTOMP_COMB_UB]], align 4
939 // CHECK1-NEXT: [[TMP4:%.*]] = load i32, ptr [[DOTOMP_COMB_LB]], align 4
940 // CHECK1-NEXT: store i32 [[TMP4]], ptr [[DOTOMP_IV]], align 4
941 // CHECK1-NEXT: br label [[OMP_INNER_FOR_COND:%.*]]
942 // CHECK1: omp.inner.for.cond:
943 // CHECK1-NEXT: [[TMP5:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4
944 // CHECK1-NEXT: [[TMP6:%.*]] = load i32, ptr [[DOTOMP_COMB_UB]], align 4
945 // CHECK1-NEXT: [[CMP1:%.*]] = icmp sle i32 [[TMP5]], [[TMP6]]
946 // CHECK1-NEXT: br i1 [[CMP1]], label [[OMP_INNER_FOR_BODY:%.*]], label [[OMP_INNER_FOR_END:%.*]]
947 // CHECK1: omp.inner.for.body:
948 // CHECK1-NEXT: call void @__kmpc_push_num_threads(ptr @[[GLOB3]], i32 [[TMP1]], i32 23)
949 // CHECK1-NEXT: [[TMP7:%.*]] = load i32, ptr [[DOTOMP_COMB_LB]], align 4
950 // CHECK1-NEXT: [[TMP8:%.*]] = zext i32 [[TMP7]] to i64
951 // CHECK1-NEXT: [[TMP9:%.*]] = load i32, ptr [[DOTOMP_COMB_UB]], align 4
952 // CHECK1-NEXT: [[TMP10:%.*]] = zext i32 [[TMP9]] to i64
953 // CHECK1-NEXT: call void (ptr, i32, ptr, ...) @__kmpc_fork_call(ptr @[[GLOB3]], i32 2, ptr @{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z5tmainIcLi5EEiv_l40.omp_outlined.omp_outlined, i64 [[TMP8]], i64 [[TMP10]])
954 // CHECK1-NEXT: br label [[OMP_INNER_FOR_INC:%.*]]
955 // CHECK1: omp.inner.for.inc:
956 // CHECK1-NEXT: [[TMP11:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4
957 // CHECK1-NEXT: [[TMP12:%.*]] = load i32, ptr [[DOTOMP_STRIDE]], align 4
958 // CHECK1-NEXT: [[ADD:%.*]] = add nsw i32 [[TMP11]], [[TMP12]]
959 // CHECK1-NEXT: store i32 [[ADD]], ptr [[DOTOMP_IV]], align 4
960 // CHECK1-NEXT: br label [[OMP_INNER_FOR_COND]]
961 // CHECK1: omp.inner.for.end:
962 // CHECK1-NEXT: br label [[OMP_LOOP_EXIT:%.*]]
963 // CHECK1: omp.loop.exit:
964 // CHECK1-NEXT: call void @__kmpc_for_static_fini(ptr @[[GLOB1]], i32 [[TMP1]])
965 // CHECK1-NEXT: ret void
968 // CHECK1-LABEL: define {{[^@]+}}@{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z5tmainIcLi5EEiv_l40.omp_outlined.omp_outlined
969 // CHECK1-SAME: (ptr noalias noundef [[DOTGLOBAL_TID_:%.*]], ptr noalias noundef [[DOTBOUND_TID_:%.*]], i64 noundef [[DOTPREVIOUS_LB_:%.*]], i64 noundef [[DOTPREVIOUS_UB_:%.*]]) #[[ATTR4]] personality ptr @__gxx_personality_v0 {
970 // CHECK1-NEXT: entry:
971 // CHECK1-NEXT: [[DOTGLOBAL_TID__ADDR:%.*]] = alloca ptr, align 8
972 // CHECK1-NEXT: [[DOTBOUND_TID__ADDR:%.*]] = alloca ptr, align 8
973 // CHECK1-NEXT: [[DOTPREVIOUS_LB__ADDR:%.*]] = alloca i64, align 8
974 // CHECK1-NEXT: [[DOTPREVIOUS_UB__ADDR:%.*]] = alloca i64, align 8
975 // CHECK1-NEXT: [[DOTOMP_IV:%.*]] = alloca i32, align 4
976 // CHECK1-NEXT: [[TMP:%.*]] = alloca i32, align 4
977 // CHECK1-NEXT: [[DOTOMP_LB:%.*]] = alloca i32, align 4
978 // CHECK1-NEXT: [[DOTOMP_UB:%.*]] = alloca i32, align 4
979 // CHECK1-NEXT: [[DOTOMP_STRIDE:%.*]] = alloca i32, align 4
980 // CHECK1-NEXT: [[DOTOMP_IS_LAST:%.*]] = alloca i32, align 4
981 // CHECK1-NEXT: [[I:%.*]] = alloca i32, align 4
982 // CHECK1-NEXT: store ptr [[DOTGLOBAL_TID_]], ptr [[DOTGLOBAL_TID__ADDR]], align 8
983 // CHECK1-NEXT: store ptr [[DOTBOUND_TID_]], ptr [[DOTBOUND_TID__ADDR]], align 8
984 // CHECK1-NEXT: store i64 [[DOTPREVIOUS_LB_]], ptr [[DOTPREVIOUS_LB__ADDR]], align 8
985 // CHECK1-NEXT: store i64 [[DOTPREVIOUS_UB_]], ptr [[DOTPREVIOUS_UB__ADDR]], align 8
986 // CHECK1-NEXT: store i32 0, ptr [[DOTOMP_LB]], align 4
987 // CHECK1-NEXT: store i32 99, ptr [[DOTOMP_UB]], align 4
988 // CHECK1-NEXT: [[TMP0:%.*]] = load i64, ptr [[DOTPREVIOUS_LB__ADDR]], align 8
989 // CHECK1-NEXT: [[CONV:%.*]] = trunc i64 [[TMP0]] to i32
990 // CHECK1-NEXT: [[TMP1:%.*]] = load i64, ptr [[DOTPREVIOUS_UB__ADDR]], align 8
991 // CHECK1-NEXT: [[CONV1:%.*]] = trunc i64 [[TMP1]] to i32
992 // CHECK1-NEXT: store i32 [[CONV]], ptr [[DOTOMP_LB]], align 4
993 // CHECK1-NEXT: store i32 [[CONV1]], ptr [[DOTOMP_UB]], align 4
994 // CHECK1-NEXT: store i32 1, ptr [[DOTOMP_STRIDE]], align 4
995 // CHECK1-NEXT: store i32 0, ptr [[DOTOMP_IS_LAST]], align 4
996 // CHECK1-NEXT: [[TMP2:%.*]] = load ptr, ptr [[DOTGLOBAL_TID__ADDR]], align 8
997 // CHECK1-NEXT: [[TMP3:%.*]] = load i32, ptr [[TMP2]], align 4
998 // 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)
999 // CHECK1-NEXT: [[TMP4:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4
1000 // CHECK1-NEXT: [[CMP:%.*]] = icmp sgt i32 [[TMP4]], 99
1001 // CHECK1-NEXT: br i1 [[CMP]], label [[COND_TRUE:%.*]], label [[COND_FALSE:%.*]]
1002 // CHECK1: cond.true:
1003 // CHECK1-NEXT: br label [[COND_END:%.*]]
1004 // CHECK1: cond.false:
1005 // CHECK1-NEXT: [[TMP5:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4
1006 // CHECK1-NEXT: br label [[COND_END]]
1007 // CHECK1: cond.end:
1008 // CHECK1-NEXT: [[COND:%.*]] = phi i32 [ 99, [[COND_TRUE]] ], [ [[TMP5]], [[COND_FALSE]] ]
1009 // CHECK1-NEXT: store i32 [[COND]], ptr [[DOTOMP_UB]], align 4
1010 // CHECK1-NEXT: [[TMP6:%.*]] = load i32, ptr [[DOTOMP_LB]], align 4
1011 // CHECK1-NEXT: store i32 [[TMP6]], ptr [[DOTOMP_IV]], align 4
1012 // CHECK1-NEXT: br label [[OMP_INNER_FOR_COND:%.*]]
1013 // CHECK1: omp.inner.for.cond:
1014 // CHECK1-NEXT: [[TMP7:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4
1015 // CHECK1-NEXT: [[TMP8:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4
1016 // CHECK1-NEXT: [[CMP2:%.*]] = icmp sle i32 [[TMP7]], [[TMP8]]
1017 // CHECK1-NEXT: br i1 [[CMP2]], label [[OMP_INNER_FOR_BODY:%.*]], label [[OMP_INNER_FOR_END:%.*]]
1018 // CHECK1: omp.inner.for.body:
1019 // CHECK1-NEXT: [[TMP9:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4
1020 // CHECK1-NEXT: [[MUL:%.*]] = mul nsw i32 [[TMP9]], 1
1021 // CHECK1-NEXT: [[ADD:%.*]] = add nsw i32 0, [[MUL]]
1022 // CHECK1-NEXT: store i32 [[ADD]], ptr [[I]], align 4
1023 // CHECK1-NEXT: invoke void @_Z3foov()
1024 // CHECK1-NEXT: to label [[INVOKE_CONT:%.*]] unwind label [[TERMINATE_LPAD:%.*]]
1025 // CHECK1: invoke.cont:
1026 // CHECK1-NEXT: br label [[OMP_BODY_CONTINUE:%.*]]
1027 // CHECK1: omp.body.continue:
1028 // CHECK1-NEXT: br label [[OMP_INNER_FOR_INC:%.*]]
1029 // CHECK1: omp.inner.for.inc:
1030 // CHECK1-NEXT: [[TMP10:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4
1031 // CHECK1-NEXT: [[ADD3:%.*]] = add nsw i32 [[TMP10]], 1
1032 // CHECK1-NEXT: store i32 [[ADD3]], ptr [[DOTOMP_IV]], align 4
1033 // CHECK1-NEXT: br label [[OMP_INNER_FOR_COND]]
1034 // CHECK1: omp.inner.for.end:
1035 // CHECK1-NEXT: br label [[OMP_LOOP_EXIT:%.*]]
1036 // CHECK1: omp.loop.exit:
1037 // CHECK1-NEXT: call void @__kmpc_for_static_fini(ptr @[[GLOB1]], i32 [[TMP3]])
1038 // CHECK1-NEXT: ret void
1039 // CHECK1: terminate.lpad:
1040 // CHECK1-NEXT: [[TMP11:%.*]] = landingpad { ptr, i32 }
1041 // CHECK1-NEXT: catch ptr null
1042 // CHECK1-NEXT: [[TMP12:%.*]] = extractvalue { ptr, i32 } [[TMP11]], 0
1043 // CHECK1-NEXT: call void @__clang_call_terminate(ptr [[TMP12]]) #[[ATTR13]]
1044 // CHECK1-NEXT: unreachable
1047 // CHECK1-LABEL: define {{[^@]+}}@{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z5tmainI1SLi1EEiv_l36
1048 // CHECK1-SAME: () #[[ATTR11:[0-9]+]] {
1049 // CHECK1-NEXT: entry:
1050 // CHECK1-NEXT: call void (ptr, i32, ptr, ...) @__kmpc_fork_teams(ptr @[[GLOB3]], i32 0, ptr @{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z5tmainI1SLi1EEiv_l36.omp_outlined)
1051 // CHECK1-NEXT: ret void
1054 // CHECK1-LABEL: define {{[^@]+}}@{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z5tmainI1SLi1EEiv_l36.omp_outlined
1055 // CHECK1-SAME: (ptr noalias noundef [[DOTGLOBAL_TID_:%.*]], ptr noalias noundef [[DOTBOUND_TID_:%.*]]) #[[ATTR4]] {
1056 // CHECK1-NEXT: entry:
1057 // CHECK1-NEXT: [[DOTGLOBAL_TID__ADDR:%.*]] = alloca ptr, align 8
1058 // CHECK1-NEXT: [[DOTBOUND_TID__ADDR:%.*]] = alloca ptr, align 8
1059 // CHECK1-NEXT: [[DOTOMP_IV:%.*]] = alloca i32, align 4
1060 // CHECK1-NEXT: [[TMP:%.*]] = alloca i32, align 4
1061 // CHECK1-NEXT: [[DOTOMP_COMB_LB:%.*]] = alloca i32, align 4
1062 // CHECK1-NEXT: [[DOTOMP_COMB_UB:%.*]] = alloca i32, align 4
1063 // CHECK1-NEXT: [[DOTOMP_STRIDE:%.*]] = alloca i32, align 4
1064 // CHECK1-NEXT: [[DOTOMP_IS_LAST:%.*]] = alloca i32, align 4
1065 // CHECK1-NEXT: [[I:%.*]] = alloca i32, align 4
1066 // CHECK1-NEXT: store ptr [[DOTGLOBAL_TID_]], ptr [[DOTGLOBAL_TID__ADDR]], align 8
1067 // CHECK1-NEXT: store ptr [[DOTBOUND_TID_]], ptr [[DOTBOUND_TID__ADDR]], align 8
1068 // CHECK1-NEXT: store i32 0, ptr [[DOTOMP_COMB_LB]], align 4
1069 // CHECK1-NEXT: store i32 99, ptr [[DOTOMP_COMB_UB]], align 4
1070 // CHECK1-NEXT: store i32 1, ptr [[DOTOMP_STRIDE]], align 4
1071 // CHECK1-NEXT: store i32 0, ptr [[DOTOMP_IS_LAST]], align 4
1072 // CHECK1-NEXT: [[TMP0:%.*]] = load ptr, ptr [[DOTGLOBAL_TID__ADDR]], align 8
1073 // CHECK1-NEXT: [[TMP1:%.*]] = load i32, ptr [[TMP0]], align 4
1074 // 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)
1075 // CHECK1-NEXT: [[TMP2:%.*]] = load i32, ptr [[DOTOMP_COMB_UB]], align 4
1076 // CHECK1-NEXT: [[CMP:%.*]] = icmp sgt i32 [[TMP2]], 99
1077 // CHECK1-NEXT: br i1 [[CMP]], label [[COND_TRUE:%.*]], label [[COND_FALSE:%.*]]
1078 // CHECK1: cond.true:
1079 // CHECK1-NEXT: br label [[COND_END:%.*]]
1080 // CHECK1: cond.false:
1081 // CHECK1-NEXT: [[TMP3:%.*]] = load i32, ptr [[DOTOMP_COMB_UB]], align 4
1082 // CHECK1-NEXT: br label [[COND_END]]
1083 // CHECK1: cond.end:
1084 // CHECK1-NEXT: [[COND:%.*]] = phi i32 [ 99, [[COND_TRUE]] ], [ [[TMP3]], [[COND_FALSE]] ]
1085 // CHECK1-NEXT: store i32 [[COND]], ptr [[DOTOMP_COMB_UB]], align 4
1086 // CHECK1-NEXT: [[TMP4:%.*]] = load i32, ptr [[DOTOMP_COMB_LB]], align 4
1087 // CHECK1-NEXT: store i32 [[TMP4]], ptr [[DOTOMP_IV]], align 4
1088 // CHECK1-NEXT: br label [[OMP_INNER_FOR_COND:%.*]]
1089 // CHECK1: omp.inner.for.cond:
1090 // CHECK1-NEXT: [[TMP5:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4
1091 // CHECK1-NEXT: [[TMP6:%.*]] = load i32, ptr [[DOTOMP_COMB_UB]], align 4
1092 // CHECK1-NEXT: [[CMP1:%.*]] = icmp sle i32 [[TMP5]], [[TMP6]]
1093 // CHECK1-NEXT: br i1 [[CMP1]], label [[OMP_INNER_FOR_BODY:%.*]], label [[OMP_INNER_FOR_END:%.*]]
1094 // CHECK1: omp.inner.for.body:
1095 // CHECK1-NEXT: call void @__kmpc_push_num_threads(ptr @[[GLOB3]], i32 [[TMP1]], i32 1)
1096 // CHECK1-NEXT: [[TMP7:%.*]] = load i32, ptr [[DOTOMP_COMB_LB]], align 4
1097 // CHECK1-NEXT: [[TMP8:%.*]] = zext i32 [[TMP7]] to i64
1098 // CHECK1-NEXT: [[TMP9:%.*]] = load i32, ptr [[DOTOMP_COMB_UB]], align 4
1099 // CHECK1-NEXT: [[TMP10:%.*]] = zext i32 [[TMP9]] to i64
1100 // CHECK1-NEXT: call void (ptr, i32, ptr, ...) @__kmpc_fork_call(ptr @[[GLOB3]], i32 2, ptr @{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z5tmainI1SLi1EEiv_l36.omp_outlined.omp_outlined, i64 [[TMP8]], i64 [[TMP10]])
1101 // CHECK1-NEXT: br label [[OMP_INNER_FOR_INC:%.*]]
1102 // CHECK1: omp.inner.for.inc:
1103 // CHECK1-NEXT: [[TMP11:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4
1104 // CHECK1-NEXT: [[TMP12:%.*]] = load i32, ptr [[DOTOMP_STRIDE]], align 4
1105 // CHECK1-NEXT: [[ADD:%.*]] = add nsw i32 [[TMP11]], [[TMP12]]
1106 // CHECK1-NEXT: store i32 [[ADD]], ptr [[DOTOMP_IV]], align 4
1107 // CHECK1-NEXT: br label [[OMP_INNER_FOR_COND]]
1108 // CHECK1: omp.inner.for.end:
1109 // CHECK1-NEXT: br label [[OMP_LOOP_EXIT:%.*]]
1110 // CHECK1: omp.loop.exit:
1111 // CHECK1-NEXT: call void @__kmpc_for_static_fini(ptr @[[GLOB1]], i32 [[TMP1]])
1112 // CHECK1-NEXT: ret void
1115 // CHECK1-LABEL: define {{[^@]+}}@{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z5tmainI1SLi1EEiv_l36.omp_outlined.omp_outlined
1116 // CHECK1-SAME: (ptr noalias noundef [[DOTGLOBAL_TID_:%.*]], ptr noalias noundef [[DOTBOUND_TID_:%.*]], i64 noundef [[DOTPREVIOUS_LB_:%.*]], i64 noundef [[DOTPREVIOUS_UB_:%.*]]) #[[ATTR4]] personality ptr @__gxx_personality_v0 {
1117 // CHECK1-NEXT: entry:
1118 // CHECK1-NEXT: [[DOTGLOBAL_TID__ADDR:%.*]] = alloca ptr, align 8
1119 // CHECK1-NEXT: [[DOTBOUND_TID__ADDR:%.*]] = alloca ptr, align 8
1120 // CHECK1-NEXT: [[DOTPREVIOUS_LB__ADDR:%.*]] = alloca i64, align 8
1121 // CHECK1-NEXT: [[DOTPREVIOUS_UB__ADDR:%.*]] = alloca i64, align 8
1122 // CHECK1-NEXT: [[DOTOMP_IV:%.*]] = alloca i32, align 4
1123 // CHECK1-NEXT: [[TMP:%.*]] = alloca i32, align 4
1124 // CHECK1-NEXT: [[DOTOMP_LB:%.*]] = alloca i32, align 4
1125 // CHECK1-NEXT: [[DOTOMP_UB:%.*]] = alloca i32, align 4
1126 // CHECK1-NEXT: [[DOTOMP_STRIDE:%.*]] = alloca i32, align 4
1127 // CHECK1-NEXT: [[DOTOMP_IS_LAST:%.*]] = alloca i32, align 4
1128 // CHECK1-NEXT: [[I:%.*]] = alloca i32, align 4
1129 // CHECK1-NEXT: store ptr [[DOTGLOBAL_TID_]], ptr [[DOTGLOBAL_TID__ADDR]], align 8
1130 // CHECK1-NEXT: store ptr [[DOTBOUND_TID_]], ptr [[DOTBOUND_TID__ADDR]], align 8
1131 // CHECK1-NEXT: store i64 [[DOTPREVIOUS_LB_]], ptr [[DOTPREVIOUS_LB__ADDR]], align 8
1132 // CHECK1-NEXT: store i64 [[DOTPREVIOUS_UB_]], ptr [[DOTPREVIOUS_UB__ADDR]], align 8
1133 // CHECK1-NEXT: store i32 0, ptr [[DOTOMP_LB]], align 4
1134 // CHECK1-NEXT: store i32 99, ptr [[DOTOMP_UB]], align 4
1135 // CHECK1-NEXT: [[TMP0:%.*]] = load i64, ptr [[DOTPREVIOUS_LB__ADDR]], align 8
1136 // CHECK1-NEXT: [[CONV:%.*]] = trunc i64 [[TMP0]] to i32
1137 // CHECK1-NEXT: [[TMP1:%.*]] = load i64, ptr [[DOTPREVIOUS_UB__ADDR]], align 8
1138 // CHECK1-NEXT: [[CONV1:%.*]] = trunc i64 [[TMP1]] to i32
1139 // CHECK1-NEXT: store i32 [[CONV]], ptr [[DOTOMP_LB]], align 4
1140 // CHECK1-NEXT: store i32 [[CONV1]], ptr [[DOTOMP_UB]], align 4
1141 // CHECK1-NEXT: store i32 1, ptr [[DOTOMP_STRIDE]], align 4
1142 // CHECK1-NEXT: store i32 0, ptr [[DOTOMP_IS_LAST]], align 4
1143 // CHECK1-NEXT: [[TMP2:%.*]] = load ptr, ptr [[DOTGLOBAL_TID__ADDR]], align 8
1144 // CHECK1-NEXT: [[TMP3:%.*]] = load i32, ptr [[TMP2]], align 4
1145 // 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)
1146 // CHECK1-NEXT: [[TMP4:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4
1147 // CHECK1-NEXT: [[CMP:%.*]] = icmp sgt i32 [[TMP4]], 99
1148 // CHECK1-NEXT: br i1 [[CMP]], label [[COND_TRUE:%.*]], label [[COND_FALSE:%.*]]
1149 // CHECK1: cond.true:
1150 // CHECK1-NEXT: br label [[COND_END:%.*]]
1151 // CHECK1: cond.false:
1152 // CHECK1-NEXT: [[TMP5:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4
1153 // CHECK1-NEXT: br label [[COND_END]]
1154 // CHECK1: cond.end:
1155 // CHECK1-NEXT: [[COND:%.*]] = phi i32 [ 99, [[COND_TRUE]] ], [ [[TMP5]], [[COND_FALSE]] ]
1156 // CHECK1-NEXT: store i32 [[COND]], ptr [[DOTOMP_UB]], align 4
1157 // CHECK1-NEXT: [[TMP6:%.*]] = load i32, ptr [[DOTOMP_LB]], align 4
1158 // CHECK1-NEXT: store i32 [[TMP6]], ptr [[DOTOMP_IV]], align 4
1159 // CHECK1-NEXT: br label [[OMP_INNER_FOR_COND:%.*]]
1160 // CHECK1: omp.inner.for.cond:
1161 // CHECK1-NEXT: [[TMP7:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4
1162 // CHECK1-NEXT: [[TMP8:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4
1163 // CHECK1-NEXT: [[CMP2:%.*]] = icmp sle i32 [[TMP7]], [[TMP8]]
1164 // CHECK1-NEXT: br i1 [[CMP2]], label [[OMP_INNER_FOR_BODY:%.*]], label [[OMP_INNER_FOR_END:%.*]]
1165 // CHECK1: omp.inner.for.body:
1166 // CHECK1-NEXT: [[TMP9:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4
1167 // CHECK1-NEXT: [[MUL:%.*]] = mul nsw i32 [[TMP9]], 1
1168 // CHECK1-NEXT: [[ADD:%.*]] = add nsw i32 0, [[MUL]]
1169 // CHECK1-NEXT: store i32 [[ADD]], ptr [[I]], align 4
1170 // CHECK1-NEXT: invoke void @_Z3foov()
1171 // CHECK1-NEXT: to label [[INVOKE_CONT:%.*]] unwind label [[TERMINATE_LPAD:%.*]]
1172 // CHECK1: invoke.cont:
1173 // CHECK1-NEXT: br label [[OMP_BODY_CONTINUE:%.*]]
1174 // CHECK1: omp.body.continue:
1175 // CHECK1-NEXT: br label [[OMP_INNER_FOR_INC:%.*]]
1176 // CHECK1: omp.inner.for.inc:
1177 // CHECK1-NEXT: [[TMP10:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4
1178 // CHECK1-NEXT: [[ADD3:%.*]] = add nsw i32 [[TMP10]], 1
1179 // CHECK1-NEXT: store i32 [[ADD3]], ptr [[DOTOMP_IV]], align 4
1180 // CHECK1-NEXT: br label [[OMP_INNER_FOR_COND]]
1181 // CHECK1: omp.inner.for.end:
1182 // CHECK1-NEXT: br label [[OMP_LOOP_EXIT:%.*]]
1183 // CHECK1: omp.loop.exit:
1184 // CHECK1-NEXT: call void @__kmpc_for_static_fini(ptr @[[GLOB1]], i32 [[TMP3]])
1185 // CHECK1-NEXT: ret void
1186 // CHECK1: terminate.lpad:
1187 // CHECK1-NEXT: [[TMP11:%.*]] = landingpad { ptr, i32 }
1188 // CHECK1-NEXT: catch ptr null
1189 // CHECK1-NEXT: [[TMP12:%.*]] = extractvalue { ptr, i32 } [[TMP11]], 0
1190 // CHECK1-NEXT: call void @__clang_call_terminate(ptr [[TMP12]]) #[[ATTR13]]
1191 // CHECK1-NEXT: unreachable
1194 // CHECK1-LABEL: define {{[^@]+}}@{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z5tmainI1SLi1EEiv_l40
1195 // CHECK1-SAME: () #[[ATTR4]] personality ptr @__gxx_personality_v0 {
1196 // CHECK1-NEXT: entry:
1197 // CHECK1-NEXT: [[DOTCAPTURE_EXPR_:%.*]] = alloca i8, align 1
1198 // CHECK1-NEXT: [[REF_TMP:%.*]] = alloca [[STRUCT_S:%.*]], align 8
1199 // CHECK1-NEXT: [[DOTCAPTURE_EXPR__CASTED:%.*]] = alloca i64, align 8
1200 // CHECK1-NEXT: invoke void @_ZN1SC1El(ptr noundef nonnull align 8 dereferenceable(24) [[REF_TMP]], i64 noundef 23)
1201 // CHECK1-NEXT: to label [[INVOKE_CONT:%.*]] unwind label [[TERMINATE_LPAD:%.*]]
1202 // CHECK1: invoke.cont:
1203 // CHECK1-NEXT: [[CALL:%.*]] = call noundef signext i8 @_ZN1ScvcEv(ptr noundef nonnull align 8 dereferenceable(24) [[REF_TMP]])
1204 // CHECK1-NEXT: call void @_ZN1SD1Ev(ptr noundef nonnull align 8 dereferenceable(24) [[REF_TMP]]) #[[ATTR5]]
1205 // CHECK1-NEXT: store i8 [[CALL]], ptr [[DOTCAPTURE_EXPR_]], align 1
1206 // CHECK1-NEXT: [[TMP0:%.*]] = load i8, ptr [[DOTCAPTURE_EXPR_]], align 1
1207 // CHECK1-NEXT: store i8 [[TMP0]], ptr [[DOTCAPTURE_EXPR__CASTED]], align 1
1208 // CHECK1-NEXT: [[TMP1:%.*]] = load i64, ptr [[DOTCAPTURE_EXPR__CASTED]], align 8
1209 // CHECK1-NEXT: call void (ptr, i32, ptr, ...) @__kmpc_fork_teams(ptr @[[GLOB3]], i32 1, ptr @{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z5tmainI1SLi1EEiv_l40.omp_outlined, i64 [[TMP1]])
1210 // CHECK1-NEXT: ret void
1211 // CHECK1: terminate.lpad:
1212 // CHECK1-NEXT: [[TMP2:%.*]] = landingpad { ptr, i32 }
1213 // CHECK1-NEXT: catch ptr null
1214 // CHECK1-NEXT: [[TMP3:%.*]] = extractvalue { ptr, i32 } [[TMP2]], 0
1215 // CHECK1-NEXT: call void @__clang_call_terminate(ptr [[TMP3]]) #[[ATTR13]]
1216 // CHECK1-NEXT: unreachable
1219 // CHECK1-LABEL: define {{[^@]+}}@{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z5tmainI1SLi1EEiv_l40.omp_outlined
1220 // CHECK1-SAME: (ptr noalias noundef [[DOTGLOBAL_TID_:%.*]], ptr noalias noundef [[DOTBOUND_TID_:%.*]], i64 noundef [[DOTCAPTURE_EXPR_:%.*]]) #[[ATTR4]] {
1221 // CHECK1-NEXT: entry:
1222 // CHECK1-NEXT: [[DOTGLOBAL_TID__ADDR:%.*]] = alloca ptr, align 8
1223 // CHECK1-NEXT: [[DOTBOUND_TID__ADDR:%.*]] = alloca ptr, align 8
1224 // CHECK1-NEXT: [[DOTCAPTURE_EXPR__ADDR:%.*]] = alloca i64, align 8
1225 // CHECK1-NEXT: [[DOTOMP_IV:%.*]] = alloca i32, align 4
1226 // CHECK1-NEXT: [[TMP:%.*]] = alloca i32, align 4
1227 // CHECK1-NEXT: [[DOTOMP_COMB_LB:%.*]] = alloca i32, align 4
1228 // CHECK1-NEXT: [[DOTOMP_COMB_UB:%.*]] = alloca i32, align 4
1229 // CHECK1-NEXT: [[DOTOMP_STRIDE:%.*]] = alloca i32, align 4
1230 // CHECK1-NEXT: [[DOTOMP_IS_LAST:%.*]] = alloca i32, align 4
1231 // CHECK1-NEXT: [[I:%.*]] = alloca i32, align 4
1232 // CHECK1-NEXT: store ptr [[DOTGLOBAL_TID_]], ptr [[DOTGLOBAL_TID__ADDR]], align 8
1233 // CHECK1-NEXT: store ptr [[DOTBOUND_TID_]], ptr [[DOTBOUND_TID__ADDR]], align 8
1234 // CHECK1-NEXT: store i64 [[DOTCAPTURE_EXPR_]], ptr [[DOTCAPTURE_EXPR__ADDR]], align 8
1235 // CHECK1-NEXT: store i32 0, ptr [[DOTOMP_COMB_LB]], align 4
1236 // CHECK1-NEXT: store i32 99, ptr [[DOTOMP_COMB_UB]], align 4
1237 // CHECK1-NEXT: store i32 1, ptr [[DOTOMP_STRIDE]], align 4
1238 // CHECK1-NEXT: store i32 0, ptr [[DOTOMP_IS_LAST]], align 4
1239 // CHECK1-NEXT: [[TMP0:%.*]] = load ptr, ptr [[DOTGLOBAL_TID__ADDR]], align 8
1240 // CHECK1-NEXT: [[TMP1:%.*]] = load i32, ptr [[TMP0]], align 4
1241 // 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)
1242 // CHECK1-NEXT: [[TMP2:%.*]] = load i32, ptr [[DOTOMP_COMB_UB]], align 4
1243 // CHECK1-NEXT: [[CMP:%.*]] = icmp sgt i32 [[TMP2]], 99
1244 // CHECK1-NEXT: br i1 [[CMP]], label [[COND_TRUE:%.*]], label [[COND_FALSE:%.*]]
1245 // CHECK1: cond.true:
1246 // CHECK1-NEXT: br label [[COND_END:%.*]]
1247 // CHECK1: cond.false:
1248 // CHECK1-NEXT: [[TMP3:%.*]] = load i32, ptr [[DOTOMP_COMB_UB]], align 4
1249 // CHECK1-NEXT: br label [[COND_END]]
1250 // CHECK1: cond.end:
1251 // CHECK1-NEXT: [[COND:%.*]] = phi i32 [ 99, [[COND_TRUE]] ], [ [[TMP3]], [[COND_FALSE]] ]
1252 // CHECK1-NEXT: store i32 [[COND]], ptr [[DOTOMP_COMB_UB]], align 4
1253 // CHECK1-NEXT: [[TMP4:%.*]] = load i32, ptr [[DOTOMP_COMB_LB]], align 4
1254 // CHECK1-NEXT: store i32 [[TMP4]], ptr [[DOTOMP_IV]], align 4
1255 // CHECK1-NEXT: br label [[OMP_INNER_FOR_COND:%.*]]
1256 // CHECK1: omp.inner.for.cond:
1257 // CHECK1-NEXT: [[TMP5:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4
1258 // CHECK1-NEXT: [[TMP6:%.*]] = load i32, ptr [[DOTOMP_COMB_UB]], align 4
1259 // CHECK1-NEXT: [[CMP1:%.*]] = icmp sle i32 [[TMP5]], [[TMP6]]
1260 // CHECK1-NEXT: br i1 [[CMP1]], label [[OMP_INNER_FOR_BODY:%.*]], label [[OMP_INNER_FOR_END:%.*]]
1261 // CHECK1: omp.inner.for.body:
1262 // CHECK1-NEXT: [[TMP7:%.*]] = load i8, ptr [[DOTCAPTURE_EXPR__ADDR]], align 1
1263 // CHECK1-NEXT: [[TMP8:%.*]] = sext i8 [[TMP7]] to i32
1264 // CHECK1-NEXT: call void @__kmpc_push_num_threads(ptr @[[GLOB3]], i32 [[TMP1]], i32 [[TMP8]])
1265 // CHECK1-NEXT: [[TMP9:%.*]] = load i32, ptr [[DOTOMP_COMB_LB]], align 4
1266 // CHECK1-NEXT: [[TMP10:%.*]] = zext i32 [[TMP9]] to i64
1267 // CHECK1-NEXT: [[TMP11:%.*]] = load i32, ptr [[DOTOMP_COMB_UB]], align 4
1268 // CHECK1-NEXT: [[TMP12:%.*]] = zext i32 [[TMP11]] to i64
1269 // CHECK1-NEXT: call void (ptr, i32, ptr, ...) @__kmpc_fork_call(ptr @[[GLOB3]], i32 2, ptr @{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z5tmainI1SLi1EEiv_l40.omp_outlined.omp_outlined, i64 [[TMP10]], i64 [[TMP12]])
1270 // CHECK1-NEXT: br label [[OMP_INNER_FOR_INC:%.*]]
1271 // CHECK1: omp.inner.for.inc:
1272 // CHECK1-NEXT: [[TMP13:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4
1273 // CHECK1-NEXT: [[TMP14:%.*]] = load i32, ptr [[DOTOMP_STRIDE]], align 4
1274 // CHECK1-NEXT: [[ADD:%.*]] = add nsw i32 [[TMP13]], [[TMP14]]
1275 // CHECK1-NEXT: store i32 [[ADD]], ptr [[DOTOMP_IV]], align 4
1276 // CHECK1-NEXT: br label [[OMP_INNER_FOR_COND]]
1277 // CHECK1: omp.inner.for.end:
1278 // CHECK1-NEXT: br label [[OMP_LOOP_EXIT:%.*]]
1279 // CHECK1: omp.loop.exit:
1280 // CHECK1-NEXT: call void @__kmpc_for_static_fini(ptr @[[GLOB1]], i32 [[TMP1]])
1281 // CHECK1-NEXT: ret void
1284 // CHECK1-LABEL: define {{[^@]+}}@{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z5tmainI1SLi1EEiv_l40.omp_outlined.omp_outlined
1285 // CHECK1-SAME: (ptr noalias noundef [[DOTGLOBAL_TID_:%.*]], ptr noalias noundef [[DOTBOUND_TID_:%.*]], i64 noundef [[DOTPREVIOUS_LB_:%.*]], i64 noundef [[DOTPREVIOUS_UB_:%.*]]) #[[ATTR4]] personality ptr @__gxx_personality_v0 {
1286 // CHECK1-NEXT: entry:
1287 // CHECK1-NEXT: [[DOTGLOBAL_TID__ADDR:%.*]] = alloca ptr, align 8
1288 // CHECK1-NEXT: [[DOTBOUND_TID__ADDR:%.*]] = alloca ptr, align 8
1289 // CHECK1-NEXT: [[DOTPREVIOUS_LB__ADDR:%.*]] = alloca i64, align 8
1290 // CHECK1-NEXT: [[DOTPREVIOUS_UB__ADDR:%.*]] = alloca i64, align 8
1291 // CHECK1-NEXT: [[DOTOMP_IV:%.*]] = alloca i32, align 4
1292 // CHECK1-NEXT: [[TMP:%.*]] = alloca i32, align 4
1293 // CHECK1-NEXT: [[DOTOMP_LB:%.*]] = alloca i32, align 4
1294 // CHECK1-NEXT: [[DOTOMP_UB:%.*]] = alloca i32, align 4
1295 // CHECK1-NEXT: [[DOTOMP_STRIDE:%.*]] = alloca i32, align 4
1296 // CHECK1-NEXT: [[DOTOMP_IS_LAST:%.*]] = alloca i32, align 4
1297 // CHECK1-NEXT: [[I:%.*]] = alloca i32, align 4
1298 // CHECK1-NEXT: store ptr [[DOTGLOBAL_TID_]], ptr [[DOTGLOBAL_TID__ADDR]], align 8
1299 // CHECK1-NEXT: store ptr [[DOTBOUND_TID_]], ptr [[DOTBOUND_TID__ADDR]], align 8
1300 // CHECK1-NEXT: store i64 [[DOTPREVIOUS_LB_]], ptr [[DOTPREVIOUS_LB__ADDR]], align 8
1301 // CHECK1-NEXT: store i64 [[DOTPREVIOUS_UB_]], ptr [[DOTPREVIOUS_UB__ADDR]], align 8
1302 // CHECK1-NEXT: store i32 0, ptr [[DOTOMP_LB]], align 4
1303 // CHECK1-NEXT: store i32 99, ptr [[DOTOMP_UB]], align 4
1304 // CHECK1-NEXT: [[TMP0:%.*]] = load i64, ptr [[DOTPREVIOUS_LB__ADDR]], align 8
1305 // CHECK1-NEXT: [[CONV:%.*]] = trunc i64 [[TMP0]] to i32
1306 // CHECK1-NEXT: [[TMP1:%.*]] = load i64, ptr [[DOTPREVIOUS_UB__ADDR]], align 8
1307 // CHECK1-NEXT: [[CONV1:%.*]] = trunc i64 [[TMP1]] to i32
1308 // CHECK1-NEXT: store i32 [[CONV]], ptr [[DOTOMP_LB]], align 4
1309 // CHECK1-NEXT: store i32 [[CONV1]], ptr [[DOTOMP_UB]], align 4
1310 // CHECK1-NEXT: store i32 1, ptr [[DOTOMP_STRIDE]], align 4
1311 // CHECK1-NEXT: store i32 0, ptr [[DOTOMP_IS_LAST]], align 4
1312 // CHECK1-NEXT: [[TMP2:%.*]] = load ptr, ptr [[DOTGLOBAL_TID__ADDR]], align 8
1313 // CHECK1-NEXT: [[TMP3:%.*]] = load i32, ptr [[TMP2]], align 4
1314 // 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)
1315 // CHECK1-NEXT: [[TMP4:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4
1316 // CHECK1-NEXT: [[CMP:%.*]] = icmp sgt i32 [[TMP4]], 99
1317 // CHECK1-NEXT: br i1 [[CMP]], label [[COND_TRUE:%.*]], label [[COND_FALSE:%.*]]
1318 // CHECK1: cond.true:
1319 // CHECK1-NEXT: br label [[COND_END:%.*]]
1320 // CHECK1: cond.false:
1321 // CHECK1-NEXT: [[TMP5:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4
1322 // CHECK1-NEXT: br label [[COND_END]]
1323 // CHECK1: cond.end:
1324 // CHECK1-NEXT: [[COND:%.*]] = phi i32 [ 99, [[COND_TRUE]] ], [ [[TMP5]], [[COND_FALSE]] ]
1325 // CHECK1-NEXT: store i32 [[COND]], ptr [[DOTOMP_UB]], align 4
1326 // CHECK1-NEXT: [[TMP6:%.*]] = load i32, ptr [[DOTOMP_LB]], align 4
1327 // CHECK1-NEXT: store i32 [[TMP6]], ptr [[DOTOMP_IV]], align 4
1328 // CHECK1-NEXT: br label [[OMP_INNER_FOR_COND:%.*]]
1329 // CHECK1: omp.inner.for.cond:
1330 // CHECK1-NEXT: [[TMP7:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4
1331 // CHECK1-NEXT: [[TMP8:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4
1332 // CHECK1-NEXT: [[CMP2:%.*]] = icmp sle i32 [[TMP7]], [[TMP8]]
1333 // CHECK1-NEXT: br i1 [[CMP2]], label [[OMP_INNER_FOR_BODY:%.*]], label [[OMP_INNER_FOR_END:%.*]]
1334 // CHECK1: omp.inner.for.body:
1335 // CHECK1-NEXT: [[TMP9:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4
1336 // CHECK1-NEXT: [[MUL:%.*]] = mul nsw i32 [[TMP9]], 1
1337 // CHECK1-NEXT: [[ADD:%.*]] = add nsw i32 0, [[MUL]]
1338 // CHECK1-NEXT: store i32 [[ADD]], ptr [[I]], align 4
1339 // CHECK1-NEXT: invoke void @_Z3foov()
1340 // CHECK1-NEXT: to label [[INVOKE_CONT:%.*]] unwind label [[TERMINATE_LPAD:%.*]]
1341 // CHECK1: invoke.cont:
1342 // CHECK1-NEXT: br label [[OMP_BODY_CONTINUE:%.*]]
1343 // CHECK1: omp.body.continue:
1344 // CHECK1-NEXT: br label [[OMP_INNER_FOR_INC:%.*]]
1345 // CHECK1: omp.inner.for.inc:
1346 // CHECK1-NEXT: [[TMP10:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4
1347 // CHECK1-NEXT: [[ADD3:%.*]] = add nsw i32 [[TMP10]], 1
1348 // CHECK1-NEXT: store i32 [[ADD3]], ptr [[DOTOMP_IV]], align 4
1349 // CHECK1-NEXT: br label [[OMP_INNER_FOR_COND]]
1350 // CHECK1: omp.inner.for.end:
1351 // CHECK1-NEXT: br label [[OMP_LOOP_EXIT:%.*]]
1352 // CHECK1: omp.loop.exit:
1353 // CHECK1-NEXT: call void @__kmpc_for_static_fini(ptr @[[GLOB1]], i32 [[TMP3]])
1354 // CHECK1-NEXT: ret void
1355 // CHECK1: terminate.lpad:
1356 // CHECK1-NEXT: [[TMP11:%.*]] = landingpad { ptr, i32 }
1357 // CHECK1-NEXT: catch ptr null
1358 // CHECK1-NEXT: [[TMP12:%.*]] = extractvalue { ptr, i32 } [[TMP11]], 0
1359 // CHECK1-NEXT: call void @__clang_call_terminate(ptr [[TMP12]]) #[[ATTR13]]
1360 // CHECK1-NEXT: unreachable
1363 // CHECK1-LABEL: define {{[^@]+}}@.omp_offloading.requires_reg
1364 // CHECK1-SAME: () #[[ATTR12:[0-9]+]] section ".text.startup" {
1365 // CHECK1-NEXT: entry:
1366 // CHECK1-NEXT: call void @__tgt_register_requires(i64 1)
1367 // CHECK1-NEXT: ret void
1370 // CHECK5-LABEL: define {{[^@]+}}@main
1371 // CHECK5-SAME: () #[[ATTR0:[0-9]+]] personality ptr @__gxx_personality_v0 {
1372 // CHECK5-NEXT: entry:
1373 // CHECK5-NEXT: [[RETVAL:%.*]] = alloca i32, align 4
1374 // CHECK5-NEXT: [[S:%.*]] = alloca [[STRUCT_S:%.*]], align 8
1375 // CHECK5-NEXT: [[A:%.*]] = alloca i8, align 1
1376 // CHECK5-NEXT: [[EXN_SLOT:%.*]] = alloca ptr, align 8
1377 // CHECK5-NEXT: [[EHSELECTOR_SLOT:%.*]] = alloca i32, align 4
1378 // CHECK5-NEXT: [[TMP:%.*]] = alloca i32, align 4
1379 // CHECK5-NEXT: [[KERNEL_ARGS:%.*]] = alloca [[STRUCT___TGT_KERNEL_ARGUMENTS:%.*]], align 8
1380 // CHECK5-NEXT: [[A_CASTED:%.*]] = alloca i64, align 8
1381 // CHECK5-NEXT: [[DOTOFFLOAD_BASEPTRS:%.*]] = alloca [1 x ptr], align 8
1382 // CHECK5-NEXT: [[DOTOFFLOAD_PTRS:%.*]] = alloca [1 x ptr], align 8
1383 // CHECK5-NEXT: [[DOTOFFLOAD_MAPPERS:%.*]] = alloca [1 x ptr], align 8
1384 // CHECK5-NEXT: [[DOTCAPTURE_EXPR_:%.*]] = alloca i8, align 1
1385 // CHECK5-NEXT: [[_TMP1:%.*]] = alloca i32, align 4
1386 // CHECK5-NEXT: [[KERNEL_ARGS2:%.*]] = alloca [[STRUCT___TGT_KERNEL_ARGUMENTS]], align 8
1387 // CHECK5-NEXT: store i32 0, ptr [[RETVAL]], align 4
1388 // CHECK5-NEXT: call void @_ZN1SC1El(ptr noundef nonnull align 8 dereferenceable(24) [[S]], i64 noundef 0)
1389 // CHECK5-NEXT: [[CALL:%.*]] = invoke noundef signext i8 @_ZN1ScvcEv(ptr noundef nonnull align 8 dereferenceable(24) [[S]])
1390 // CHECK5-NEXT: to label [[INVOKE_CONT:%.*]] unwind label [[LPAD:%.*]]
1391 // CHECK5: invoke.cont:
1392 // CHECK5-NEXT: store i8 [[CALL]], ptr [[A]], align 1
1393 // CHECK5-NEXT: [[TMP0:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 0
1394 // CHECK5-NEXT: store i32 2, ptr [[TMP0]], align 4
1395 // CHECK5-NEXT: [[TMP1:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 1
1396 // CHECK5-NEXT: store i32 0, ptr [[TMP1]], align 4
1397 // CHECK5-NEXT: [[TMP2:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 2
1398 // CHECK5-NEXT: store ptr null, ptr [[TMP2]], align 8
1399 // CHECK5-NEXT: [[TMP3:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 3
1400 // CHECK5-NEXT: store ptr null, ptr [[TMP3]], align 8
1401 // CHECK5-NEXT: [[TMP4:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 4
1402 // CHECK5-NEXT: store ptr null, ptr [[TMP4]], align 8
1403 // CHECK5-NEXT: [[TMP5:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 5
1404 // CHECK5-NEXT: store ptr null, ptr [[TMP5]], align 8
1405 // CHECK5-NEXT: [[TMP6:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 6
1406 // CHECK5-NEXT: store ptr null, ptr [[TMP6]], align 8
1407 // CHECK5-NEXT: [[TMP7:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 7
1408 // CHECK5-NEXT: store ptr null, ptr [[TMP7]], align 8
1409 // CHECK5-NEXT: [[TMP8:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 8
1410 // CHECK5-NEXT: store i64 100, ptr [[TMP8]], align 8
1411 // CHECK5-NEXT: [[TMP9:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 9
1412 // CHECK5-NEXT: store i64 0, ptr [[TMP9]], align 8
1413 // CHECK5-NEXT: [[TMP10:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 10
1414 // CHECK5-NEXT: store [3 x i32] zeroinitializer, ptr [[TMP10]], align 4
1415 // CHECK5-NEXT: [[TMP11:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 11
1416 // CHECK5-NEXT: store [3 x i32] [i32 2, i32 0, i32 0], ptr [[TMP11]], align 4
1417 // CHECK5-NEXT: [[TMP12:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 12
1418 // CHECK5-NEXT: store i32 0, ptr [[TMP12]], align 4
1419 // CHECK5-NEXT: [[TMP13:%.*]] = call i32 @__tgt_target_kernel(ptr @[[GLOB3:[0-9]+]], i64 -1, i32 0, i32 2, ptr @.{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}_main_l50.region_id, ptr [[KERNEL_ARGS]])
1420 // CHECK5-NEXT: [[TMP14:%.*]] = icmp ne i32 [[TMP13]], 0
1421 // CHECK5-NEXT: br i1 [[TMP14]], label [[OMP_OFFLOAD_FAILED:%.*]], label [[OMP_OFFLOAD_CONT:%.*]]
1422 // CHECK5: omp_offload.failed:
1423 // CHECK5-NEXT: call void @{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}_main_l50() #[[ATTR5:[0-9]+]]
1424 // CHECK5-NEXT: br label [[OMP_OFFLOAD_CONT]]
1426 // CHECK5-NEXT: [[TMP15:%.*]] = landingpad { ptr, i32 }
1427 // CHECK5-NEXT: cleanup
1428 // CHECK5-NEXT: [[TMP16:%.*]] = extractvalue { ptr, i32 } [[TMP15]], 0
1429 // CHECK5-NEXT: store ptr [[TMP16]], ptr [[EXN_SLOT]], align 8
1430 // CHECK5-NEXT: [[TMP17:%.*]] = extractvalue { ptr, i32 } [[TMP15]], 1
1431 // CHECK5-NEXT: store i32 [[TMP17]], ptr [[EHSELECTOR_SLOT]], align 4
1432 // CHECK5-NEXT: call void @_ZN1SD1Ev(ptr noundef nonnull align 8 dereferenceable(24) [[S]]) #[[ATTR5]]
1433 // CHECK5-NEXT: br label [[EH_RESUME:%.*]]
1434 // CHECK5: omp_offload.cont:
1435 // CHECK5-NEXT: [[TMP18:%.*]] = load i8, ptr [[A]], align 1
1436 // CHECK5-NEXT: store i8 [[TMP18]], ptr [[A_CASTED]], align 1
1437 // CHECK5-NEXT: [[TMP19:%.*]] = load i64, ptr [[A_CASTED]], align 8
1438 // CHECK5-NEXT: [[TMP20:%.*]] = getelementptr inbounds [1 x ptr], ptr [[DOTOFFLOAD_BASEPTRS]], i32 0, i32 0
1439 // CHECK5-NEXT: store i64 [[TMP19]], ptr [[TMP20]], align 8
1440 // CHECK5-NEXT: [[TMP21:%.*]] = getelementptr inbounds [1 x ptr], ptr [[DOTOFFLOAD_PTRS]], i32 0, i32 0
1441 // CHECK5-NEXT: store i64 [[TMP19]], ptr [[TMP21]], align 8
1442 // CHECK5-NEXT: [[TMP22:%.*]] = getelementptr inbounds [1 x ptr], ptr [[DOTOFFLOAD_MAPPERS]], i64 0, i64 0
1443 // CHECK5-NEXT: store ptr null, ptr [[TMP22]], align 8
1444 // CHECK5-NEXT: [[TMP23:%.*]] = getelementptr inbounds [1 x ptr], ptr [[DOTOFFLOAD_BASEPTRS]], i32 0, i32 0
1445 // CHECK5-NEXT: [[TMP24:%.*]] = getelementptr inbounds [1 x ptr], ptr [[DOTOFFLOAD_PTRS]], i32 0, i32 0
1446 // CHECK5-NEXT: [[TMP25:%.*]] = load i8, ptr [[A]], align 1
1447 // CHECK5-NEXT: store i8 [[TMP25]], ptr [[DOTCAPTURE_EXPR_]], align 1
1448 // CHECK5-NEXT: [[TMP26:%.*]] = load i8, ptr [[DOTCAPTURE_EXPR_]], align 1
1449 // CHECK5-NEXT: [[TMP27:%.*]] = zext i8 [[TMP26]] to i32
1450 // CHECK5-NEXT: [[TMP28:%.*]] = insertvalue [3 x i32] zeroinitializer, i32 [[TMP27]], 0
1451 // CHECK5-NEXT: [[TMP29:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS2]], i32 0, i32 0
1452 // CHECK5-NEXT: store i32 2, ptr [[TMP29]], align 4
1453 // CHECK5-NEXT: [[TMP30:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS2]], i32 0, i32 1
1454 // CHECK5-NEXT: store i32 1, ptr [[TMP30]], align 4
1455 // CHECK5-NEXT: [[TMP31:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS2]], i32 0, i32 2
1456 // CHECK5-NEXT: store ptr [[TMP23]], ptr [[TMP31]], align 8
1457 // CHECK5-NEXT: [[TMP32:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS2]], i32 0, i32 3
1458 // CHECK5-NEXT: store ptr [[TMP24]], ptr [[TMP32]], align 8
1459 // CHECK5-NEXT: [[TMP33:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS2]], i32 0, i32 4
1460 // CHECK5-NEXT: store ptr @.offload_sizes, ptr [[TMP33]], align 8
1461 // CHECK5-NEXT: [[TMP34:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS2]], i32 0, i32 5
1462 // CHECK5-NEXT: store ptr @.offload_maptypes, ptr [[TMP34]], align 8
1463 // CHECK5-NEXT: [[TMP35:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS2]], i32 0, i32 6
1464 // CHECK5-NEXT: store ptr null, ptr [[TMP35]], align 8
1465 // CHECK5-NEXT: [[TMP36:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS2]], i32 0, i32 7
1466 // CHECK5-NEXT: store ptr null, ptr [[TMP36]], align 8
1467 // CHECK5-NEXT: [[TMP37:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS2]], i32 0, i32 8
1468 // CHECK5-NEXT: store i64 100, ptr [[TMP37]], align 8
1469 // CHECK5-NEXT: [[TMP38:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS2]], i32 0, i32 9
1470 // CHECK5-NEXT: store i64 0, ptr [[TMP38]], align 8
1471 // CHECK5-NEXT: [[TMP39:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS2]], i32 0, i32 10
1472 // CHECK5-NEXT: store [3 x i32] zeroinitializer, ptr [[TMP39]], align 4
1473 // CHECK5-NEXT: [[TMP40:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS2]], i32 0, i32 11
1474 // CHECK5-NEXT: store [3 x i32] [[TMP28]], ptr [[TMP40]], align 4
1475 // CHECK5-NEXT: [[TMP41:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS2]], i32 0, i32 12
1476 // CHECK5-NEXT: store i32 0, ptr [[TMP41]], align 4
1477 // CHECK5-NEXT: [[TMP42:%.*]] = call i32 @__tgt_target_kernel(ptr @[[GLOB3]], i64 -1, i32 0, i32 [[TMP27]], ptr @.{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}_main_l55.region_id, ptr [[KERNEL_ARGS2]])
1478 // CHECK5-NEXT: [[TMP43:%.*]] = icmp ne i32 [[TMP42]], 0
1479 // CHECK5-NEXT: br i1 [[TMP43]], label [[OMP_OFFLOAD_FAILED3:%.*]], label [[OMP_OFFLOAD_CONT4:%.*]]
1480 // CHECK5: omp_offload.failed3:
1481 // CHECK5-NEXT: call void @{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}_main_l55(i64 [[TMP19]]) #[[ATTR5]]
1482 // CHECK5-NEXT: br label [[OMP_OFFLOAD_CONT4]]
1483 // CHECK5: omp_offload.cont4:
1484 // CHECK5-NEXT: [[TMP44:%.*]] = load i8, ptr [[A]], align 1
1485 // CHECK5-NEXT: [[CONV:%.*]] = sext i8 [[TMP44]] to i32
1486 // CHECK5-NEXT: [[CALL6:%.*]] = invoke noundef signext i32 @_Z5tmainIcLi5EEiv()
1487 // CHECK5-NEXT: to label [[INVOKE_CONT5:%.*]] unwind label [[LPAD]]
1488 // CHECK5: invoke.cont5:
1489 // CHECK5-NEXT: [[ADD:%.*]] = add nsw i32 [[CONV]], [[CALL6]]
1490 // CHECK5-NEXT: [[CALL8:%.*]] = invoke noundef signext i32 @_Z5tmainI1SLi1EEiv()
1491 // CHECK5-NEXT: to label [[INVOKE_CONT7:%.*]] unwind label [[LPAD]]
1492 // CHECK5: invoke.cont7:
1493 // CHECK5-NEXT: [[ADD9:%.*]] = add nsw i32 [[ADD]], [[CALL8]]
1494 // CHECK5-NEXT: store i32 [[ADD9]], ptr [[RETVAL]], align 4
1495 // CHECK5-NEXT: call void @_ZN1SD1Ev(ptr noundef nonnull align 8 dereferenceable(24) [[S]]) #[[ATTR5]]
1496 // CHECK5-NEXT: [[TMP45:%.*]] = load i32, ptr [[RETVAL]], align 4
1497 // CHECK5-NEXT: ret i32 [[TMP45]]
1498 // CHECK5: eh.resume:
1499 // CHECK5-NEXT: [[EXN:%.*]] = load ptr, ptr [[EXN_SLOT]], align 8
1500 // CHECK5-NEXT: [[SEL:%.*]] = load i32, ptr [[EHSELECTOR_SLOT]], align 4
1501 // CHECK5-NEXT: [[LPAD_VAL:%.*]] = insertvalue { ptr, i32 } poison, ptr [[EXN]], 0
1502 // CHECK5-NEXT: [[LPAD_VAL10:%.*]] = insertvalue { ptr, i32 } [[LPAD_VAL]], i32 [[SEL]], 1
1503 // CHECK5-NEXT: resume { ptr, i32 } [[LPAD_VAL10]]
1506 // CHECK5-LABEL: define {{[^@]+}}@_ZN1SC1El
1507 // CHECK5-SAME: (ptr noundef nonnull align 8 dereferenceable(24) [[THIS:%.*]], i64 noundef [[A:%.*]]) unnamed_addr #[[ATTR1:[0-9]+]] comdat {
1508 // CHECK5-NEXT: entry:
1509 // CHECK5-NEXT: [[THIS_ADDR:%.*]] = alloca ptr, align 8
1510 // CHECK5-NEXT: [[A_ADDR:%.*]] = alloca i64, align 8
1511 // CHECK5-NEXT: store ptr [[THIS]], ptr [[THIS_ADDR]], align 8
1512 // CHECK5-NEXT: store i64 [[A]], ptr [[A_ADDR]], align 8
1513 // CHECK5-NEXT: [[THIS1:%.*]] = load ptr, ptr [[THIS_ADDR]], align 8
1514 // CHECK5-NEXT: [[TMP0:%.*]] = load i64, ptr [[A_ADDR]], align 8
1515 // CHECK5-NEXT: call void @_ZN1SC2El(ptr noundef nonnull align 8 dereferenceable(24) [[THIS1]], i64 noundef [[TMP0]])
1516 // CHECK5-NEXT: ret void
1519 // CHECK5-LABEL: define {{[^@]+}}@_ZN1ScvcEv
1520 // CHECK5-SAME: (ptr noundef nonnull align 8 dereferenceable(24) [[THIS:%.*]]) #[[ATTR2:[0-9]+]] comdat {
1521 // CHECK5-NEXT: entry:
1522 // CHECK5-NEXT: [[THIS_ADDR:%.*]] = alloca ptr, align 8
1523 // CHECK5-NEXT: store ptr [[THIS]], ptr [[THIS_ADDR]], align 8
1524 // CHECK5-NEXT: [[THIS1:%.*]] = load ptr, ptr [[THIS_ADDR]], align 8
1525 // CHECK5-NEXT: [[A:%.*]] = getelementptr inbounds [[STRUCT_S:%.*]], ptr [[THIS1]], i32 0, i32 0
1526 // CHECK5-NEXT: [[TMP0:%.*]] = load i64, ptr [[A]], align 8
1527 // CHECK5-NEXT: [[CONV:%.*]] = trunc i64 [[TMP0]] to i8
1528 // CHECK5-NEXT: ret i8 [[CONV]]
1531 // CHECK5-LABEL: define {{[^@]+}}@{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}_main_l50
1532 // CHECK5-SAME: () #[[ATTR3:[0-9]+]] {
1533 // CHECK5-NEXT: entry:
1534 // CHECK5-NEXT: call void (ptr, i32, ptr, ...) @__kmpc_fork_teams(ptr @[[GLOB3]], i32 0, ptr @{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}_main_l50.omp_outlined)
1535 // CHECK5-NEXT: ret void
1538 // CHECK5-LABEL: define {{[^@]+}}@{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}_main_l50.omp_outlined
1539 // CHECK5-SAME: (ptr noalias noundef [[DOTGLOBAL_TID_:%.*]], ptr noalias noundef [[DOTBOUND_TID_:%.*]]) #[[ATTR4:[0-9]+]] {
1540 // CHECK5-NEXT: entry:
1541 // CHECK5-NEXT: [[DOTGLOBAL_TID__ADDR:%.*]] = alloca ptr, align 8
1542 // CHECK5-NEXT: [[DOTBOUND_TID__ADDR:%.*]] = alloca ptr, align 8
1543 // CHECK5-NEXT: [[DOTOMP_IV:%.*]] = alloca i32, align 4
1544 // CHECK5-NEXT: [[TMP:%.*]] = alloca i32, align 4
1545 // CHECK5-NEXT: [[DOTOMP_COMB_LB:%.*]] = alloca i32, align 4
1546 // CHECK5-NEXT: [[DOTOMP_COMB_UB:%.*]] = alloca i32, align 4
1547 // CHECK5-NEXT: [[DOTOMP_STRIDE:%.*]] = alloca i32, align 4
1548 // CHECK5-NEXT: [[DOTOMP_IS_LAST:%.*]] = alloca i32, align 4
1549 // CHECK5-NEXT: [[I:%.*]] = alloca i32, align 4
1550 // CHECK5-NEXT: store ptr [[DOTGLOBAL_TID_]], ptr [[DOTGLOBAL_TID__ADDR]], align 8
1551 // CHECK5-NEXT: store ptr [[DOTBOUND_TID_]], ptr [[DOTBOUND_TID__ADDR]], align 8
1552 // CHECK5-NEXT: store i32 0, ptr [[DOTOMP_COMB_LB]], align 4
1553 // CHECK5-NEXT: store i32 99, ptr [[DOTOMP_COMB_UB]], align 4
1554 // CHECK5-NEXT: store i32 1, ptr [[DOTOMP_STRIDE]], align 4
1555 // CHECK5-NEXT: store i32 0, ptr [[DOTOMP_IS_LAST]], align 4
1556 // CHECK5-NEXT: [[TMP0:%.*]] = load ptr, ptr [[DOTGLOBAL_TID__ADDR]], align 8
1557 // CHECK5-NEXT: [[TMP1:%.*]] = load i32, ptr [[TMP0]], align 4
1558 // CHECK5-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)
1559 // CHECK5-NEXT: [[TMP2:%.*]] = load i32, ptr [[DOTOMP_COMB_UB]], align 4
1560 // CHECK5-NEXT: [[CMP:%.*]] = icmp sgt i32 [[TMP2]], 99
1561 // CHECK5-NEXT: br i1 [[CMP]], label [[COND_TRUE:%.*]], label [[COND_FALSE:%.*]]
1562 // CHECK5: cond.true:
1563 // CHECK5-NEXT: br label [[COND_END:%.*]]
1564 // CHECK5: cond.false:
1565 // CHECK5-NEXT: [[TMP3:%.*]] = load i32, ptr [[DOTOMP_COMB_UB]], align 4
1566 // CHECK5-NEXT: br label [[COND_END]]
1567 // CHECK5: cond.end:
1568 // CHECK5-NEXT: [[COND:%.*]] = phi i32 [ 99, [[COND_TRUE]] ], [ [[TMP3]], [[COND_FALSE]] ]
1569 // CHECK5-NEXT: store i32 [[COND]], ptr [[DOTOMP_COMB_UB]], align 4
1570 // CHECK5-NEXT: [[TMP4:%.*]] = load i32, ptr [[DOTOMP_COMB_LB]], align 4
1571 // CHECK5-NEXT: store i32 [[TMP4]], ptr [[DOTOMP_IV]], align 4
1572 // CHECK5-NEXT: br label [[OMP_INNER_FOR_COND:%.*]]
1573 // CHECK5: omp.inner.for.cond:
1574 // CHECK5-NEXT: [[TMP5:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4
1575 // CHECK5-NEXT: [[TMP6:%.*]] = load i32, ptr [[DOTOMP_COMB_UB]], align 4
1576 // CHECK5-NEXT: [[CMP1:%.*]] = icmp sle i32 [[TMP5]], [[TMP6]]
1577 // CHECK5-NEXT: br i1 [[CMP1]], label [[OMP_INNER_FOR_BODY:%.*]], label [[OMP_INNER_FOR_END:%.*]]
1578 // CHECK5: omp.inner.for.body:
1579 // CHECK5-NEXT: call void @__kmpc_push_num_threads(ptr @[[GLOB3]], i32 [[TMP1]], i32 2)
1580 // CHECK5-NEXT: [[TMP7:%.*]] = load i32, ptr [[DOTOMP_COMB_LB]], align 4
1581 // CHECK5-NEXT: [[TMP8:%.*]] = zext i32 [[TMP7]] to i64
1582 // CHECK5-NEXT: [[TMP9:%.*]] = load i32, ptr [[DOTOMP_COMB_UB]], align 4
1583 // CHECK5-NEXT: [[TMP10:%.*]] = zext i32 [[TMP9]] to i64
1584 // CHECK5-NEXT: call void (ptr, i32, ptr, ...) @__kmpc_fork_call(ptr @[[GLOB3]], i32 2, ptr @{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}_main_l50.omp_outlined.omp_outlined, i64 [[TMP8]], i64 [[TMP10]])
1585 // CHECK5-NEXT: br label [[OMP_INNER_FOR_INC:%.*]]
1586 // CHECK5: omp.inner.for.inc:
1587 // CHECK5-NEXT: [[TMP11:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4
1588 // CHECK5-NEXT: [[TMP12:%.*]] = load i32, ptr [[DOTOMP_STRIDE]], align 4
1589 // CHECK5-NEXT: [[ADD:%.*]] = add nsw i32 [[TMP11]], [[TMP12]]
1590 // CHECK5-NEXT: store i32 [[ADD]], ptr [[DOTOMP_IV]], align 4
1591 // CHECK5-NEXT: br label [[OMP_INNER_FOR_COND]]
1592 // CHECK5: omp.inner.for.end:
1593 // CHECK5-NEXT: br label [[OMP_LOOP_EXIT:%.*]]
1594 // CHECK5: omp.loop.exit:
1595 // CHECK5-NEXT: call void @__kmpc_for_static_fini(ptr @[[GLOB1]], i32 [[TMP1]])
1596 // CHECK5-NEXT: ret void
1599 // CHECK5-LABEL: define {{[^@]+}}@{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}_main_l50.omp_outlined.omp_outlined
1600 // CHECK5-SAME: (ptr noalias noundef [[DOTGLOBAL_TID_:%.*]], ptr noalias noundef [[DOTBOUND_TID_:%.*]], i64 noundef [[DOTPREVIOUS_LB_:%.*]], i64 noundef [[DOTPREVIOUS_UB_:%.*]]) #[[ATTR4]] personality ptr @__gxx_personality_v0 {
1601 // CHECK5-NEXT: entry:
1602 // CHECK5-NEXT: [[DOTGLOBAL_TID__ADDR:%.*]] = alloca ptr, align 8
1603 // CHECK5-NEXT: [[DOTBOUND_TID__ADDR:%.*]] = alloca ptr, align 8
1604 // CHECK5-NEXT: [[DOTPREVIOUS_LB__ADDR:%.*]] = alloca i64, align 8
1605 // CHECK5-NEXT: [[DOTPREVIOUS_UB__ADDR:%.*]] = alloca i64, align 8
1606 // CHECK5-NEXT: [[DOTOMP_IV:%.*]] = alloca i32, align 4
1607 // CHECK5-NEXT: [[TMP:%.*]] = alloca i32, align 4
1608 // CHECK5-NEXT: [[DOTOMP_LB:%.*]] = alloca i32, align 4
1609 // CHECK5-NEXT: [[DOTOMP_UB:%.*]] = alloca i32, align 4
1610 // CHECK5-NEXT: [[DOTOMP_STRIDE:%.*]] = alloca i32, align 4
1611 // CHECK5-NEXT: [[DOTOMP_IS_LAST:%.*]] = alloca i32, align 4
1612 // CHECK5-NEXT: [[I:%.*]] = alloca i32, align 4
1613 // CHECK5-NEXT: store ptr [[DOTGLOBAL_TID_]], ptr [[DOTGLOBAL_TID__ADDR]], align 8
1614 // CHECK5-NEXT: store ptr [[DOTBOUND_TID_]], ptr [[DOTBOUND_TID__ADDR]], align 8
1615 // CHECK5-NEXT: store i64 [[DOTPREVIOUS_LB_]], ptr [[DOTPREVIOUS_LB__ADDR]], align 8
1616 // CHECK5-NEXT: store i64 [[DOTPREVIOUS_UB_]], ptr [[DOTPREVIOUS_UB__ADDR]], align 8
1617 // CHECK5-NEXT: store i32 0, ptr [[DOTOMP_LB]], align 4
1618 // CHECK5-NEXT: store i32 99, ptr [[DOTOMP_UB]], align 4
1619 // CHECK5-NEXT: [[TMP0:%.*]] = load i64, ptr [[DOTPREVIOUS_LB__ADDR]], align 8
1620 // CHECK5-NEXT: [[CONV:%.*]] = trunc i64 [[TMP0]] to i32
1621 // CHECK5-NEXT: [[TMP1:%.*]] = load i64, ptr [[DOTPREVIOUS_UB__ADDR]], align 8
1622 // CHECK5-NEXT: [[CONV1:%.*]] = trunc i64 [[TMP1]] to i32
1623 // CHECK5-NEXT: store i32 [[CONV]], ptr [[DOTOMP_LB]], align 4
1624 // CHECK5-NEXT: store i32 [[CONV1]], ptr [[DOTOMP_UB]], align 4
1625 // CHECK5-NEXT: store i32 1, ptr [[DOTOMP_STRIDE]], align 4
1626 // CHECK5-NEXT: store i32 0, ptr [[DOTOMP_IS_LAST]], align 4
1627 // CHECK5-NEXT: [[TMP2:%.*]] = load ptr, ptr [[DOTGLOBAL_TID__ADDR]], align 8
1628 // CHECK5-NEXT: [[TMP3:%.*]] = load i32, ptr [[TMP2]], align 4
1629 // CHECK5-NEXT: call void @__kmpc_for_static_init_4(ptr @[[GLOB2:[0-9]+]], i32 [[TMP3]], i32 34, ptr [[DOTOMP_IS_LAST]], ptr [[DOTOMP_LB]], ptr [[DOTOMP_UB]], ptr [[DOTOMP_STRIDE]], i32 1, i32 1)
1630 // CHECK5-NEXT: [[TMP4:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4
1631 // CHECK5-NEXT: [[CMP:%.*]] = icmp sgt i32 [[TMP4]], 99
1632 // CHECK5-NEXT: br i1 [[CMP]], label [[COND_TRUE:%.*]], label [[COND_FALSE:%.*]]
1633 // CHECK5: cond.true:
1634 // CHECK5-NEXT: br label [[COND_END:%.*]]
1635 // CHECK5: cond.false:
1636 // CHECK5-NEXT: [[TMP5:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4
1637 // CHECK5-NEXT: br label [[COND_END]]
1638 // CHECK5: cond.end:
1639 // CHECK5-NEXT: [[COND:%.*]] = phi i32 [ 99, [[COND_TRUE]] ], [ [[TMP5]], [[COND_FALSE]] ]
1640 // CHECK5-NEXT: store i32 [[COND]], ptr [[DOTOMP_UB]], align 4
1641 // CHECK5-NEXT: [[TMP6:%.*]] = load i32, ptr [[DOTOMP_LB]], align 4
1642 // CHECK5-NEXT: store i32 [[TMP6]], ptr [[DOTOMP_IV]], align 4
1643 // CHECK5-NEXT: br label [[OMP_INNER_FOR_COND:%.*]]
1644 // CHECK5: omp.inner.for.cond:
1645 // CHECK5-NEXT: [[TMP7:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4
1646 // CHECK5-NEXT: [[TMP8:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4
1647 // CHECK5-NEXT: [[CMP2:%.*]] = icmp sle i32 [[TMP7]], [[TMP8]]
1648 // CHECK5-NEXT: br i1 [[CMP2]], label [[OMP_INNER_FOR_BODY:%.*]], label [[OMP_INNER_FOR_END:%.*]]
1649 // CHECK5: omp.inner.for.body:
1650 // CHECK5-NEXT: [[TMP9:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4
1651 // CHECK5-NEXT: [[MUL:%.*]] = mul nsw i32 [[TMP9]], 1
1652 // CHECK5-NEXT: [[ADD:%.*]] = add nsw i32 0, [[MUL]]
1653 // CHECK5-NEXT: store i32 [[ADD]], ptr [[I]], align 4
1654 // CHECK5-NEXT: invoke void @_Z3foov()
1655 // CHECK5-NEXT: to label [[INVOKE_CONT:%.*]] unwind label [[TERMINATE_LPAD:%.*]]
1656 // CHECK5: invoke.cont:
1657 // CHECK5-NEXT: br label [[OMP_BODY_CONTINUE:%.*]]
1658 // CHECK5: omp.body.continue:
1659 // CHECK5-NEXT: br label [[OMP_INNER_FOR_INC:%.*]]
1660 // CHECK5: omp.inner.for.inc:
1661 // CHECK5-NEXT: [[TMP10:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4
1662 // CHECK5-NEXT: [[ADD3:%.*]] = add nsw i32 [[TMP10]], 1
1663 // CHECK5-NEXT: store i32 [[ADD3]], ptr [[DOTOMP_IV]], align 4
1664 // CHECK5-NEXT: br label [[OMP_INNER_FOR_COND]]
1665 // CHECK5: omp.inner.for.end:
1666 // CHECK5-NEXT: br label [[OMP_LOOP_EXIT:%.*]]
1667 // CHECK5: omp.loop.exit:
1668 // CHECK5-NEXT: call void @__kmpc_for_static_fini(ptr @[[GLOB1]], i32 [[TMP3]])
1669 // CHECK5-NEXT: ret void
1670 // CHECK5: terminate.lpad:
1671 // CHECK5-NEXT: [[TMP11:%.*]] = landingpad { ptr, i32 }
1672 // CHECK5-NEXT: catch ptr null
1673 // CHECK5-NEXT: [[TMP12:%.*]] = extractvalue { ptr, i32 } [[TMP11]], 0
1674 // CHECK5-NEXT: call void @__clang_call_terminate(ptr [[TMP12]]) #[[ATTR13:[0-9]+]]
1675 // CHECK5-NEXT: unreachable
1678 // CHECK5-LABEL: define {{[^@]+}}@__clang_call_terminate
1679 // CHECK5-SAME: (ptr noundef [[TMP0:%.*]]) #[[ATTR7:[0-9]+]] comdat {
1680 // CHECK5-NEXT: [[TMP2:%.*]] = call ptr @__cxa_begin_catch(ptr [[TMP0]]) #[[ATTR5]]
1681 // CHECK5-NEXT: call void @_ZSt9terminatev() #[[ATTR13]]
1682 // CHECK5-NEXT: unreachable
1685 // CHECK5-LABEL: define {{[^@]+}}@{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}_main_l55
1686 // CHECK5-SAME: (i64 noundef [[A:%.*]]) #[[ATTR4]] {
1687 // CHECK5-NEXT: entry:
1688 // CHECK5-NEXT: [[A_ADDR:%.*]] = alloca i64, align 8
1689 // CHECK5-NEXT: [[DOTCAPTURE_EXPR_:%.*]] = alloca i8, align 1
1690 // CHECK5-NEXT: [[DOTCAPTURE_EXPR__CASTED:%.*]] = alloca i64, align 8
1691 // CHECK5-NEXT: store i64 [[A]], ptr [[A_ADDR]], align 8
1692 // CHECK5-NEXT: [[TMP0:%.*]] = load i8, ptr [[A_ADDR]], align 1
1693 // CHECK5-NEXT: store i8 [[TMP0]], ptr [[DOTCAPTURE_EXPR_]], align 1
1694 // CHECK5-NEXT: [[TMP1:%.*]] = load i8, ptr [[DOTCAPTURE_EXPR_]], align 1
1695 // CHECK5-NEXT: store i8 [[TMP1]], ptr [[DOTCAPTURE_EXPR__CASTED]], align 1
1696 // CHECK5-NEXT: [[TMP2:%.*]] = load i64, ptr [[DOTCAPTURE_EXPR__CASTED]], align 8
1697 // CHECK5-NEXT: call void (ptr, i32, ptr, ...) @__kmpc_fork_teams(ptr @[[GLOB3]], i32 1, ptr @{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}_main_l55.omp_outlined, i64 [[TMP2]])
1698 // CHECK5-NEXT: ret void
1701 // CHECK5-LABEL: define {{[^@]+}}@{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}_main_l55.omp_outlined
1702 // CHECK5-SAME: (ptr noalias noundef [[DOTGLOBAL_TID_:%.*]], ptr noalias noundef [[DOTBOUND_TID_:%.*]], i64 noundef [[DOTCAPTURE_EXPR_:%.*]]) #[[ATTR4]] {
1703 // CHECK5-NEXT: entry:
1704 // CHECK5-NEXT: [[DOTGLOBAL_TID__ADDR:%.*]] = alloca ptr, align 8
1705 // CHECK5-NEXT: [[DOTBOUND_TID__ADDR:%.*]] = alloca ptr, align 8
1706 // CHECK5-NEXT: [[DOTCAPTURE_EXPR__ADDR:%.*]] = alloca i64, align 8
1707 // CHECK5-NEXT: [[DOTOMP_IV:%.*]] = alloca i32, align 4
1708 // CHECK5-NEXT: [[TMP:%.*]] = alloca i32, align 4
1709 // CHECK5-NEXT: [[DOTOMP_COMB_LB:%.*]] = alloca i32, align 4
1710 // CHECK5-NEXT: [[DOTOMP_COMB_UB:%.*]] = alloca i32, align 4
1711 // CHECK5-NEXT: [[DOTOMP_STRIDE:%.*]] = alloca i32, align 4
1712 // CHECK5-NEXT: [[DOTOMP_IS_LAST:%.*]] = alloca i32, align 4
1713 // CHECK5-NEXT: [[I:%.*]] = alloca i32, align 4
1714 // CHECK5-NEXT: store ptr [[DOTGLOBAL_TID_]], ptr [[DOTGLOBAL_TID__ADDR]], align 8
1715 // CHECK5-NEXT: store ptr [[DOTBOUND_TID_]], ptr [[DOTBOUND_TID__ADDR]], align 8
1716 // CHECK5-NEXT: store i64 [[DOTCAPTURE_EXPR_]], ptr [[DOTCAPTURE_EXPR__ADDR]], align 8
1717 // CHECK5-NEXT: store i32 0, ptr [[DOTOMP_COMB_LB]], align 4
1718 // CHECK5-NEXT: store i32 99, ptr [[DOTOMP_COMB_UB]], align 4
1719 // CHECK5-NEXT: store i32 1, ptr [[DOTOMP_STRIDE]], align 4
1720 // CHECK5-NEXT: store i32 0, ptr [[DOTOMP_IS_LAST]], align 4
1721 // CHECK5-NEXT: [[TMP0:%.*]] = load ptr, ptr [[DOTGLOBAL_TID__ADDR]], align 8
1722 // CHECK5-NEXT: [[TMP1:%.*]] = load i32, ptr [[TMP0]], align 4
1723 // CHECK5-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)
1724 // CHECK5-NEXT: [[TMP2:%.*]] = load i32, ptr [[DOTOMP_COMB_UB]], align 4
1725 // CHECK5-NEXT: [[CMP:%.*]] = icmp sgt i32 [[TMP2]], 99
1726 // CHECK5-NEXT: br i1 [[CMP]], label [[COND_TRUE:%.*]], label [[COND_FALSE:%.*]]
1727 // CHECK5: cond.true:
1728 // CHECK5-NEXT: br label [[COND_END:%.*]]
1729 // CHECK5: cond.false:
1730 // CHECK5-NEXT: [[TMP3:%.*]] = load i32, ptr [[DOTOMP_COMB_UB]], align 4
1731 // CHECK5-NEXT: br label [[COND_END]]
1732 // CHECK5: cond.end:
1733 // CHECK5-NEXT: [[COND:%.*]] = phi i32 [ 99, [[COND_TRUE]] ], [ [[TMP3]], [[COND_FALSE]] ]
1734 // CHECK5-NEXT: store i32 [[COND]], ptr [[DOTOMP_COMB_UB]], align 4
1735 // CHECK5-NEXT: [[TMP4:%.*]] = load i32, ptr [[DOTOMP_COMB_LB]], align 4
1736 // CHECK5-NEXT: store i32 [[TMP4]], ptr [[DOTOMP_IV]], align 4
1737 // CHECK5-NEXT: br label [[OMP_INNER_FOR_COND:%.*]]
1738 // CHECK5: omp.inner.for.cond:
1739 // CHECK5-NEXT: [[TMP5:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4
1740 // CHECK5-NEXT: [[TMP6:%.*]] = load i32, ptr [[DOTOMP_COMB_UB]], align 4
1741 // CHECK5-NEXT: [[CMP1:%.*]] = icmp sle i32 [[TMP5]], [[TMP6]]
1742 // CHECK5-NEXT: br i1 [[CMP1]], label [[OMP_INNER_FOR_BODY:%.*]], label [[OMP_INNER_FOR_END:%.*]]
1743 // CHECK5: omp.inner.for.body:
1744 // CHECK5-NEXT: [[TMP7:%.*]] = load i8, ptr [[DOTCAPTURE_EXPR__ADDR]], align 1
1745 // CHECK5-NEXT: [[TMP8:%.*]] = sext i8 [[TMP7]] to i32
1746 // CHECK5-NEXT: call void @__kmpc_push_num_threads(ptr @[[GLOB3]], i32 [[TMP1]], i32 [[TMP8]])
1747 // CHECK5-NEXT: [[TMP9:%.*]] = load i32, ptr [[DOTOMP_COMB_LB]], align 4
1748 // CHECK5-NEXT: [[TMP10:%.*]] = zext i32 [[TMP9]] to i64
1749 // CHECK5-NEXT: [[TMP11:%.*]] = load i32, ptr [[DOTOMP_COMB_UB]], align 4
1750 // CHECK5-NEXT: [[TMP12:%.*]] = zext i32 [[TMP11]] to i64
1751 // CHECK5-NEXT: call void (ptr, i32, ptr, ...) @__kmpc_fork_call(ptr @[[GLOB3]], i32 2, ptr @{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}_main_l55.omp_outlined.omp_outlined, i64 [[TMP10]], i64 [[TMP12]])
1752 // CHECK5-NEXT: br label [[OMP_INNER_FOR_INC:%.*]]
1753 // CHECK5: omp.inner.for.inc:
1754 // CHECK5-NEXT: [[TMP13:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4
1755 // CHECK5-NEXT: [[TMP14:%.*]] = load i32, ptr [[DOTOMP_STRIDE]], align 4
1756 // CHECK5-NEXT: [[ADD:%.*]] = add nsw i32 [[TMP13]], [[TMP14]]
1757 // CHECK5-NEXT: store i32 [[ADD]], ptr [[DOTOMP_IV]], align 4
1758 // CHECK5-NEXT: br label [[OMP_INNER_FOR_COND]]
1759 // CHECK5: omp.inner.for.end:
1760 // CHECK5-NEXT: br label [[OMP_LOOP_EXIT:%.*]]
1761 // CHECK5: omp.loop.exit:
1762 // CHECK5-NEXT: call void @__kmpc_for_static_fini(ptr @[[GLOB1]], i32 [[TMP1]])
1763 // CHECK5-NEXT: ret void
1766 // CHECK5-LABEL: define {{[^@]+}}@{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}_main_l55.omp_outlined.omp_outlined
1767 // CHECK5-SAME: (ptr noalias noundef [[DOTGLOBAL_TID_:%.*]], ptr noalias noundef [[DOTBOUND_TID_:%.*]], i64 noundef [[DOTPREVIOUS_LB_:%.*]], i64 noundef [[DOTPREVIOUS_UB_:%.*]]) #[[ATTR4]] personality ptr @__gxx_personality_v0 {
1768 // CHECK5-NEXT: entry:
1769 // CHECK5-NEXT: [[DOTGLOBAL_TID__ADDR:%.*]] = alloca ptr, align 8
1770 // CHECK5-NEXT: [[DOTBOUND_TID__ADDR:%.*]] = alloca ptr, align 8
1771 // CHECK5-NEXT: [[DOTPREVIOUS_LB__ADDR:%.*]] = alloca i64, align 8
1772 // CHECK5-NEXT: [[DOTPREVIOUS_UB__ADDR:%.*]] = alloca i64, align 8
1773 // CHECK5-NEXT: [[DOTOMP_IV:%.*]] = alloca i32, align 4
1774 // CHECK5-NEXT: [[TMP:%.*]] = alloca i32, align 4
1775 // CHECK5-NEXT: [[DOTOMP_LB:%.*]] = alloca i32, align 4
1776 // CHECK5-NEXT: [[DOTOMP_UB:%.*]] = alloca i32, align 4
1777 // CHECK5-NEXT: [[DOTOMP_STRIDE:%.*]] = alloca i32, align 4
1778 // CHECK5-NEXT: [[DOTOMP_IS_LAST:%.*]] = alloca i32, align 4
1779 // CHECK5-NEXT: [[I:%.*]] = alloca i32, align 4
1780 // CHECK5-NEXT: store ptr [[DOTGLOBAL_TID_]], ptr [[DOTGLOBAL_TID__ADDR]], align 8
1781 // CHECK5-NEXT: store ptr [[DOTBOUND_TID_]], ptr [[DOTBOUND_TID__ADDR]], align 8
1782 // CHECK5-NEXT: store i64 [[DOTPREVIOUS_LB_]], ptr [[DOTPREVIOUS_LB__ADDR]], align 8
1783 // CHECK5-NEXT: store i64 [[DOTPREVIOUS_UB_]], ptr [[DOTPREVIOUS_UB__ADDR]], align 8
1784 // CHECK5-NEXT: store i32 0, ptr [[DOTOMP_LB]], align 4
1785 // CHECK5-NEXT: store i32 99, ptr [[DOTOMP_UB]], align 4
1786 // CHECK5-NEXT: [[TMP0:%.*]] = load i64, ptr [[DOTPREVIOUS_LB__ADDR]], align 8
1787 // CHECK5-NEXT: [[CONV:%.*]] = trunc i64 [[TMP0]] to i32
1788 // CHECK5-NEXT: [[TMP1:%.*]] = load i64, ptr [[DOTPREVIOUS_UB__ADDR]], align 8
1789 // CHECK5-NEXT: [[CONV1:%.*]] = trunc i64 [[TMP1]] to i32
1790 // CHECK5-NEXT: store i32 [[CONV]], ptr [[DOTOMP_LB]], align 4
1791 // CHECK5-NEXT: store i32 [[CONV1]], ptr [[DOTOMP_UB]], align 4
1792 // CHECK5-NEXT: store i32 1, ptr [[DOTOMP_STRIDE]], align 4
1793 // CHECK5-NEXT: store i32 0, ptr [[DOTOMP_IS_LAST]], align 4
1794 // CHECK5-NEXT: [[TMP2:%.*]] = load ptr, ptr [[DOTGLOBAL_TID__ADDR]], align 8
1795 // CHECK5-NEXT: [[TMP3:%.*]] = load i32, ptr [[TMP2]], align 4
1796 // CHECK5-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)
1797 // CHECK5-NEXT: [[TMP4:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4
1798 // CHECK5-NEXT: [[CMP:%.*]] = icmp sgt i32 [[TMP4]], 99
1799 // CHECK5-NEXT: br i1 [[CMP]], label [[COND_TRUE:%.*]], label [[COND_FALSE:%.*]]
1800 // CHECK5: cond.true:
1801 // CHECK5-NEXT: br label [[COND_END:%.*]]
1802 // CHECK5: cond.false:
1803 // CHECK5-NEXT: [[TMP5:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4
1804 // CHECK5-NEXT: br label [[COND_END]]
1805 // CHECK5: cond.end:
1806 // CHECK5-NEXT: [[COND:%.*]] = phi i32 [ 99, [[COND_TRUE]] ], [ [[TMP5]], [[COND_FALSE]] ]
1807 // CHECK5-NEXT: store i32 [[COND]], ptr [[DOTOMP_UB]], align 4
1808 // CHECK5-NEXT: [[TMP6:%.*]] = load i32, ptr [[DOTOMP_LB]], align 4
1809 // CHECK5-NEXT: store i32 [[TMP6]], ptr [[DOTOMP_IV]], align 4
1810 // CHECK5-NEXT: br label [[OMP_INNER_FOR_COND:%.*]]
1811 // CHECK5: omp.inner.for.cond:
1812 // CHECK5-NEXT: [[TMP7:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4
1813 // CHECK5-NEXT: [[TMP8:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4
1814 // CHECK5-NEXT: [[CMP2:%.*]] = icmp sle i32 [[TMP7]], [[TMP8]]
1815 // CHECK5-NEXT: br i1 [[CMP2]], label [[OMP_INNER_FOR_BODY:%.*]], label [[OMP_INNER_FOR_END:%.*]]
1816 // CHECK5: omp.inner.for.body:
1817 // CHECK5-NEXT: [[TMP9:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4
1818 // CHECK5-NEXT: [[MUL:%.*]] = mul nsw i32 [[TMP9]], 1
1819 // CHECK5-NEXT: [[ADD:%.*]] = add nsw i32 0, [[MUL]]
1820 // CHECK5-NEXT: store i32 [[ADD]], ptr [[I]], align 4
1821 // CHECK5-NEXT: invoke void @_Z3foov()
1822 // CHECK5-NEXT: to label [[INVOKE_CONT:%.*]] unwind label [[TERMINATE_LPAD:%.*]]
1823 // CHECK5: invoke.cont:
1824 // CHECK5-NEXT: br label [[OMP_BODY_CONTINUE:%.*]]
1825 // CHECK5: omp.body.continue:
1826 // CHECK5-NEXT: br label [[OMP_INNER_FOR_INC:%.*]]
1827 // CHECK5: omp.inner.for.inc:
1828 // CHECK5-NEXT: [[TMP10:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4
1829 // CHECK5-NEXT: [[ADD3:%.*]] = add nsw i32 [[TMP10]], 1
1830 // CHECK5-NEXT: store i32 [[ADD3]], ptr [[DOTOMP_IV]], align 4
1831 // CHECK5-NEXT: br label [[OMP_INNER_FOR_COND]]
1832 // CHECK5: omp.inner.for.end:
1833 // CHECK5-NEXT: br label [[OMP_LOOP_EXIT:%.*]]
1834 // CHECK5: omp.loop.exit:
1835 // CHECK5-NEXT: call void @__kmpc_for_static_fini(ptr @[[GLOB1]], i32 [[TMP3]])
1836 // CHECK5-NEXT: ret void
1837 // CHECK5: terminate.lpad:
1838 // CHECK5-NEXT: [[TMP11:%.*]] = landingpad { ptr, i32 }
1839 // CHECK5-NEXT: catch ptr null
1840 // CHECK5-NEXT: [[TMP12:%.*]] = extractvalue { ptr, i32 } [[TMP11]], 0
1841 // CHECK5-NEXT: call void @__clang_call_terminate(ptr [[TMP12]]) #[[ATTR13]]
1842 // CHECK5-NEXT: unreachable
1845 // CHECK5-LABEL: define {{[^@]+}}@_Z5tmainIcLi5EEiv
1846 // CHECK5-SAME: () #[[ATTR2]] comdat {
1847 // CHECK5-NEXT: entry:
1848 // CHECK5-NEXT: [[TMP:%.*]] = alloca i32, align 4
1849 // CHECK5-NEXT: [[KERNEL_ARGS:%.*]] = alloca [[STRUCT___TGT_KERNEL_ARGUMENTS:%.*]], align 8
1850 // CHECK5-NEXT: [[_TMP1:%.*]] = alloca i32, align 4
1851 // CHECK5-NEXT: [[KERNEL_ARGS2:%.*]] = alloca [[STRUCT___TGT_KERNEL_ARGUMENTS]], align 8
1852 // CHECK5-NEXT: [[TMP0:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 0
1853 // CHECK5-NEXT: store i32 2, ptr [[TMP0]], align 4
1854 // CHECK5-NEXT: [[TMP1:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 1
1855 // CHECK5-NEXT: store i32 0, ptr [[TMP1]], align 4
1856 // CHECK5-NEXT: [[TMP2:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 2
1857 // CHECK5-NEXT: store ptr null, ptr [[TMP2]], align 8
1858 // CHECK5-NEXT: [[TMP3:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 3
1859 // CHECK5-NEXT: store ptr null, ptr [[TMP3]], align 8
1860 // CHECK5-NEXT: [[TMP4:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 4
1861 // CHECK5-NEXT: store ptr null, ptr [[TMP4]], align 8
1862 // CHECK5-NEXT: [[TMP5:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 5
1863 // CHECK5-NEXT: store ptr null, ptr [[TMP5]], align 8
1864 // CHECK5-NEXT: [[TMP6:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 6
1865 // CHECK5-NEXT: store ptr null, ptr [[TMP6]], align 8
1866 // CHECK5-NEXT: [[TMP7:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 7
1867 // CHECK5-NEXT: store ptr null, ptr [[TMP7]], align 8
1868 // CHECK5-NEXT: [[TMP8:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 8
1869 // CHECK5-NEXT: store i64 100, ptr [[TMP8]], align 8
1870 // CHECK5-NEXT: [[TMP9:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 9
1871 // CHECK5-NEXT: store i64 0, ptr [[TMP9]], align 8
1872 // CHECK5-NEXT: [[TMP10:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 10
1873 // CHECK5-NEXT: store [3 x i32] zeroinitializer, ptr [[TMP10]], align 4
1874 // CHECK5-NEXT: [[TMP11:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 11
1875 // CHECK5-NEXT: store [3 x i32] [i32 5, i32 0, i32 0], ptr [[TMP11]], align 4
1876 // CHECK5-NEXT: [[TMP12:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 12
1877 // CHECK5-NEXT: store i32 0, ptr [[TMP12]], align 4
1878 // CHECK5-NEXT: [[TMP13:%.*]] = call i32 @__tgt_target_kernel(ptr @[[GLOB3]], i64 -1, i32 0, i32 5, ptr @.{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z5tmainIcLi5EEiv_l36.region_id, ptr [[KERNEL_ARGS]])
1879 // CHECK5-NEXT: [[TMP14:%.*]] = icmp ne i32 [[TMP13]], 0
1880 // CHECK5-NEXT: br i1 [[TMP14]], label [[OMP_OFFLOAD_FAILED:%.*]], label [[OMP_OFFLOAD_CONT:%.*]]
1881 // CHECK5: omp_offload.failed:
1882 // CHECK5-NEXT: call void @{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z5tmainIcLi5EEiv_l36() #[[ATTR5]]
1883 // CHECK5-NEXT: br label [[OMP_OFFLOAD_CONT]]
1884 // CHECK5: omp_offload.cont:
1885 // CHECK5-NEXT: [[TMP15:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS2]], i32 0, i32 0
1886 // CHECK5-NEXT: store i32 2, ptr [[TMP15]], align 4
1887 // CHECK5-NEXT: [[TMP16:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS2]], i32 0, i32 1
1888 // CHECK5-NEXT: store i32 0, ptr [[TMP16]], align 4
1889 // CHECK5-NEXT: [[TMP17:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS2]], i32 0, i32 2
1890 // CHECK5-NEXT: store ptr null, ptr [[TMP17]], align 8
1891 // CHECK5-NEXT: [[TMP18:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS2]], i32 0, i32 3
1892 // CHECK5-NEXT: store ptr null, ptr [[TMP18]], align 8
1893 // CHECK5-NEXT: [[TMP19:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS2]], i32 0, i32 4
1894 // CHECK5-NEXT: store ptr null, ptr [[TMP19]], align 8
1895 // CHECK5-NEXT: [[TMP20:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS2]], i32 0, i32 5
1896 // CHECK5-NEXT: store ptr null, ptr [[TMP20]], align 8
1897 // CHECK5-NEXT: [[TMP21:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS2]], i32 0, i32 6
1898 // CHECK5-NEXT: store ptr null, ptr [[TMP21]], align 8
1899 // CHECK5-NEXT: [[TMP22:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS2]], i32 0, i32 7
1900 // CHECK5-NEXT: store ptr null, ptr [[TMP22]], align 8
1901 // CHECK5-NEXT: [[TMP23:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS2]], i32 0, i32 8
1902 // CHECK5-NEXT: store i64 100, ptr [[TMP23]], align 8
1903 // CHECK5-NEXT: [[TMP24:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS2]], i32 0, i32 9
1904 // CHECK5-NEXT: store i64 0, ptr [[TMP24]], align 8
1905 // CHECK5-NEXT: [[TMP25:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS2]], i32 0, i32 10
1906 // CHECK5-NEXT: store [3 x i32] zeroinitializer, ptr [[TMP25]], align 4
1907 // CHECK5-NEXT: [[TMP26:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS2]], i32 0, i32 11
1908 // CHECK5-NEXT: store [3 x i32] [i32 23, i32 0, i32 0], ptr [[TMP26]], align 4
1909 // CHECK5-NEXT: [[TMP27:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS2]], i32 0, i32 12
1910 // CHECK5-NEXT: store i32 0, ptr [[TMP27]], align 4
1911 // CHECK5-NEXT: [[TMP28:%.*]] = call i32 @__tgt_target_kernel(ptr @[[GLOB3]], i64 -1, i32 0, i32 23, ptr @.{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z5tmainIcLi5EEiv_l40.region_id, ptr [[KERNEL_ARGS2]])
1912 // CHECK5-NEXT: [[TMP29:%.*]] = icmp ne i32 [[TMP28]], 0
1913 // CHECK5-NEXT: br i1 [[TMP29]], label [[OMP_OFFLOAD_FAILED3:%.*]], label [[OMP_OFFLOAD_CONT4:%.*]]
1914 // CHECK5: omp_offload.failed3:
1915 // CHECK5-NEXT: call void @{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z5tmainIcLi5EEiv_l40() #[[ATTR5]]
1916 // CHECK5-NEXT: br label [[OMP_OFFLOAD_CONT4]]
1917 // CHECK5: omp_offload.cont4:
1918 // CHECK5-NEXT: ret i32 0
1921 // CHECK5-LABEL: define {{[^@]+}}@_Z5tmainI1SLi1EEiv
1922 // CHECK5-SAME: () #[[ATTR2]] comdat personality ptr @__gxx_personality_v0 {
1923 // CHECK5-NEXT: entry:
1924 // CHECK5-NEXT: [[TMP:%.*]] = alloca i32, align 4
1925 // CHECK5-NEXT: [[KERNEL_ARGS:%.*]] = alloca [[STRUCT___TGT_KERNEL_ARGUMENTS:%.*]], align 8
1926 // CHECK5-NEXT: [[DOTCAPTURE_EXPR_:%.*]] = alloca i8, align 1
1927 // CHECK5-NEXT: [[REF_TMP:%.*]] = alloca [[STRUCT_S:%.*]], align 8
1928 // CHECK5-NEXT: [[_TMP1:%.*]] = alloca i32, align 4
1929 // CHECK5-NEXT: [[KERNEL_ARGS2:%.*]] = alloca [[STRUCT___TGT_KERNEL_ARGUMENTS]], align 8
1930 // CHECK5-NEXT: [[TMP0:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 0
1931 // CHECK5-NEXT: store i32 2, ptr [[TMP0]], align 4
1932 // CHECK5-NEXT: [[TMP1:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 1
1933 // CHECK5-NEXT: store i32 0, ptr [[TMP1]], align 4
1934 // CHECK5-NEXT: [[TMP2:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 2
1935 // CHECK5-NEXT: store ptr null, ptr [[TMP2]], align 8
1936 // CHECK5-NEXT: [[TMP3:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 3
1937 // CHECK5-NEXT: store ptr null, ptr [[TMP3]], align 8
1938 // CHECK5-NEXT: [[TMP4:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 4
1939 // CHECK5-NEXT: store ptr null, ptr [[TMP4]], align 8
1940 // CHECK5-NEXT: [[TMP5:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 5
1941 // CHECK5-NEXT: store ptr null, ptr [[TMP5]], align 8
1942 // CHECK5-NEXT: [[TMP6:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 6
1943 // CHECK5-NEXT: store ptr null, ptr [[TMP6]], align 8
1944 // CHECK5-NEXT: [[TMP7:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 7
1945 // CHECK5-NEXT: store ptr null, ptr [[TMP7]], align 8
1946 // CHECK5-NEXT: [[TMP8:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 8
1947 // CHECK5-NEXT: store i64 100, ptr [[TMP8]], align 8
1948 // CHECK5-NEXT: [[TMP9:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 9
1949 // CHECK5-NEXT: store i64 0, ptr [[TMP9]], align 8
1950 // CHECK5-NEXT: [[TMP10:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 10
1951 // CHECK5-NEXT: store [3 x i32] zeroinitializer, ptr [[TMP10]], align 4
1952 // CHECK5-NEXT: [[TMP11:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 11
1953 // CHECK5-NEXT: store [3 x i32] [i32 1, i32 0, i32 0], ptr [[TMP11]], align 4
1954 // CHECK5-NEXT: [[TMP12:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS]], i32 0, i32 12
1955 // CHECK5-NEXT: store i32 0, ptr [[TMP12]], align 4
1956 // CHECK5-NEXT: [[TMP13:%.*]] = call i32 @__tgt_target_kernel(ptr @[[GLOB3]], i64 -1, i32 0, i32 1, ptr @.{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z5tmainI1SLi1EEiv_l36.region_id, ptr [[KERNEL_ARGS]])
1957 // CHECK5-NEXT: [[TMP14:%.*]] = icmp ne i32 [[TMP13]], 0
1958 // CHECK5-NEXT: br i1 [[TMP14]], label [[OMP_OFFLOAD_FAILED:%.*]], label [[OMP_OFFLOAD_CONT:%.*]]
1959 // CHECK5: omp_offload.failed:
1960 // CHECK5-NEXT: call void @{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z5tmainI1SLi1EEiv_l36() #[[ATTR5]]
1961 // CHECK5-NEXT: br label [[OMP_OFFLOAD_CONT]]
1962 // CHECK5: omp_offload.cont:
1963 // CHECK5-NEXT: invoke void @_ZN1SC1El(ptr noundef nonnull align 8 dereferenceable(24) [[REF_TMP]], i64 noundef 23)
1964 // CHECK5-NEXT: to label [[INVOKE_CONT:%.*]] unwind label [[TERMINATE_LPAD:%.*]]
1965 // CHECK5: invoke.cont:
1966 // CHECK5-NEXT: [[CALL:%.*]] = call noundef signext i8 @_ZN1ScvcEv(ptr noundef nonnull align 8 dereferenceable(24) [[REF_TMP]])
1967 // CHECK5-NEXT: call void @_ZN1SD1Ev(ptr noundef nonnull align 8 dereferenceable(24) [[REF_TMP]]) #[[ATTR5]]
1968 // CHECK5-NEXT: store i8 [[CALL]], ptr [[DOTCAPTURE_EXPR_]], align 1
1969 // CHECK5-NEXT: [[TMP15:%.*]] = load i8, ptr [[DOTCAPTURE_EXPR_]], align 1
1970 // CHECK5-NEXT: [[TMP16:%.*]] = zext i8 [[TMP15]] to i32
1971 // CHECK5-NEXT: [[TMP17:%.*]] = insertvalue [3 x i32] zeroinitializer, i32 [[TMP16]], 0
1972 // CHECK5-NEXT: [[TMP18:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS2]], i32 0, i32 0
1973 // CHECK5-NEXT: store i32 2, ptr [[TMP18]], align 4
1974 // CHECK5-NEXT: [[TMP19:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS2]], i32 0, i32 1
1975 // CHECK5-NEXT: store i32 0, ptr [[TMP19]], align 4
1976 // CHECK5-NEXT: [[TMP20:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS2]], i32 0, i32 2
1977 // CHECK5-NEXT: store ptr null, ptr [[TMP20]], align 8
1978 // CHECK5-NEXT: [[TMP21:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS2]], i32 0, i32 3
1979 // CHECK5-NEXT: store ptr null, ptr [[TMP21]], align 8
1980 // CHECK5-NEXT: [[TMP22:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS2]], i32 0, i32 4
1981 // CHECK5-NEXT: store ptr null, ptr [[TMP22]], align 8
1982 // CHECK5-NEXT: [[TMP23:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS2]], i32 0, i32 5
1983 // CHECK5-NEXT: store ptr null, ptr [[TMP23]], align 8
1984 // CHECK5-NEXT: [[TMP24:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS2]], i32 0, i32 6
1985 // CHECK5-NEXT: store ptr null, ptr [[TMP24]], align 8
1986 // CHECK5-NEXT: [[TMP25:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS2]], i32 0, i32 7
1987 // CHECK5-NEXT: store ptr null, ptr [[TMP25]], align 8
1988 // CHECK5-NEXT: [[TMP26:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS2]], i32 0, i32 8
1989 // CHECK5-NEXT: store i64 100, ptr [[TMP26]], align 8
1990 // CHECK5-NEXT: [[TMP27:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS2]], i32 0, i32 9
1991 // CHECK5-NEXT: store i64 0, ptr [[TMP27]], align 8
1992 // CHECK5-NEXT: [[TMP28:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS2]], i32 0, i32 10
1993 // CHECK5-NEXT: store [3 x i32] zeroinitializer, ptr [[TMP28]], align 4
1994 // CHECK5-NEXT: [[TMP29:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS2]], i32 0, i32 11
1995 // CHECK5-NEXT: store [3 x i32] [[TMP17]], ptr [[TMP29]], align 4
1996 // CHECK5-NEXT: [[TMP30:%.*]] = getelementptr inbounds [[STRUCT___TGT_KERNEL_ARGUMENTS]], ptr [[KERNEL_ARGS2]], i32 0, i32 12
1997 // CHECK5-NEXT: store i32 0, ptr [[TMP30]], align 4
1998 // CHECK5-NEXT: [[TMP31:%.*]] = call i32 @__tgt_target_kernel(ptr @[[GLOB3]], i64 -1, i32 0, i32 [[TMP16]], ptr @.{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z5tmainI1SLi1EEiv_l40.region_id, ptr [[KERNEL_ARGS2]])
1999 // CHECK5-NEXT: [[TMP32:%.*]] = icmp ne i32 [[TMP31]], 0
2000 // CHECK5-NEXT: br i1 [[TMP32]], label [[OMP_OFFLOAD_FAILED3:%.*]], label [[OMP_OFFLOAD_CONT4:%.*]]
2001 // CHECK5: omp_offload.failed3:
2002 // CHECK5-NEXT: call void @{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z5tmainI1SLi1EEiv_l40() #[[ATTR5]]
2003 // CHECK5-NEXT: br label [[OMP_OFFLOAD_CONT4]]
2004 // CHECK5: omp_offload.cont4:
2005 // CHECK5-NEXT: ret i32 0
2006 // CHECK5: terminate.lpad:
2007 // CHECK5-NEXT: [[TMP33:%.*]] = landingpad { ptr, i32 }
2008 // CHECK5-NEXT: catch ptr null
2009 // CHECK5-NEXT: [[TMP34:%.*]] = extractvalue { ptr, i32 } [[TMP33]], 0
2010 // CHECK5-NEXT: call void @__clang_call_terminate(ptr [[TMP34]]) #[[ATTR13]]
2011 // CHECK5-NEXT: unreachable
2014 // CHECK5-LABEL: define {{[^@]+}}@_ZN1SD1Ev
2015 // CHECK5-SAME: (ptr noundef nonnull align 8 dereferenceable(24) [[THIS:%.*]]) unnamed_addr #[[ATTR8:[0-9]+]] comdat {
2016 // CHECK5-NEXT: entry:
2017 // CHECK5-NEXT: [[THIS_ADDR:%.*]] = alloca ptr, align 8
2018 // CHECK5-NEXT: store ptr [[THIS]], ptr [[THIS_ADDR]], align 8
2019 // CHECK5-NEXT: [[THIS1:%.*]] = load ptr, ptr [[THIS_ADDR]], align 8
2020 // CHECK5-NEXT: call void @_ZN1SD2Ev(ptr noundef nonnull align 8 dereferenceable(24) [[THIS1]]) #[[ATTR5]]
2021 // CHECK5-NEXT: ret void
2024 // CHECK5-LABEL: define {{[^@]+}}@_ZN1SC2El
2025 // CHECK5-SAME: (ptr noundef nonnull align 8 dereferenceable(24) [[THIS:%.*]], i64 noundef [[A:%.*]]) unnamed_addr #[[ATTR8]] comdat {
2026 // CHECK5-NEXT: entry:
2027 // CHECK5-NEXT: [[THIS_ADDR:%.*]] = alloca ptr, align 8
2028 // CHECK5-NEXT: [[A_ADDR:%.*]] = alloca i64, align 8
2029 // CHECK5-NEXT: store ptr [[THIS]], ptr [[THIS_ADDR]], align 8
2030 // CHECK5-NEXT: store i64 [[A]], ptr [[A_ADDR]], align 8
2031 // CHECK5-NEXT: [[THIS1:%.*]] = load ptr, ptr [[THIS_ADDR]], align 8
2032 // CHECK5-NEXT: [[A2:%.*]] = getelementptr inbounds [[STRUCT_S:%.*]], ptr [[THIS1]], i32 0, i32 0
2033 // CHECK5-NEXT: [[TMP0:%.*]] = load i64, ptr [[A_ADDR]], align 8
2034 // CHECK5-NEXT: store i64 [[TMP0]], ptr [[A2]], align 8
2035 // CHECK5-NEXT: ret void
2038 // CHECK5-LABEL: define {{[^@]+}}@{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z5tmainIcLi5EEiv_l36
2039 // CHECK5-SAME: () #[[ATTR9:[0-9]+]] {
2040 // CHECK5-NEXT: entry:
2041 // CHECK5-NEXT: call void (ptr, i32, ptr, ...) @__kmpc_fork_teams(ptr @[[GLOB3]], i32 0, ptr @{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z5tmainIcLi5EEiv_l36.omp_outlined)
2042 // CHECK5-NEXT: ret void
2045 // CHECK5-LABEL: define {{[^@]+}}@{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z5tmainIcLi5EEiv_l36.omp_outlined
2046 // CHECK5-SAME: (ptr noalias noundef [[DOTGLOBAL_TID_:%.*]], ptr noalias noundef [[DOTBOUND_TID_:%.*]]) #[[ATTR4]] {
2047 // CHECK5-NEXT: entry:
2048 // CHECK5-NEXT: [[DOTGLOBAL_TID__ADDR:%.*]] = alloca ptr, align 8
2049 // CHECK5-NEXT: [[DOTBOUND_TID__ADDR:%.*]] = alloca ptr, align 8
2050 // CHECK5-NEXT: [[DOTOMP_IV:%.*]] = alloca i32, align 4
2051 // CHECK5-NEXT: [[TMP:%.*]] = alloca i32, align 4
2052 // CHECK5-NEXT: [[DOTOMP_COMB_LB:%.*]] = alloca i32, align 4
2053 // CHECK5-NEXT: [[DOTOMP_COMB_UB:%.*]] = alloca i32, align 4
2054 // CHECK5-NEXT: [[DOTOMP_STRIDE:%.*]] = alloca i32, align 4
2055 // CHECK5-NEXT: [[DOTOMP_IS_LAST:%.*]] = alloca i32, align 4
2056 // CHECK5-NEXT: [[I:%.*]] = alloca i32, align 4
2057 // CHECK5-NEXT: store ptr [[DOTGLOBAL_TID_]], ptr [[DOTGLOBAL_TID__ADDR]], align 8
2058 // CHECK5-NEXT: store ptr [[DOTBOUND_TID_]], ptr [[DOTBOUND_TID__ADDR]], align 8
2059 // CHECK5-NEXT: store i32 0, ptr [[DOTOMP_COMB_LB]], align 4
2060 // CHECK5-NEXT: store i32 99, ptr [[DOTOMP_COMB_UB]], align 4
2061 // CHECK5-NEXT: store i32 1, ptr [[DOTOMP_STRIDE]], align 4
2062 // CHECK5-NEXT: store i32 0, ptr [[DOTOMP_IS_LAST]], align 4
2063 // CHECK5-NEXT: [[TMP0:%.*]] = load ptr, ptr [[DOTGLOBAL_TID__ADDR]], align 8
2064 // CHECK5-NEXT: [[TMP1:%.*]] = load i32, ptr [[TMP0]], align 4
2065 // CHECK5-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)
2066 // CHECK5-NEXT: [[TMP2:%.*]] = load i32, ptr [[DOTOMP_COMB_UB]], align 4
2067 // CHECK5-NEXT: [[CMP:%.*]] = icmp sgt i32 [[TMP2]], 99
2068 // CHECK5-NEXT: br i1 [[CMP]], label [[COND_TRUE:%.*]], label [[COND_FALSE:%.*]]
2069 // CHECK5: cond.true:
2070 // CHECK5-NEXT: br label [[COND_END:%.*]]
2071 // CHECK5: cond.false:
2072 // CHECK5-NEXT: [[TMP3:%.*]] = load i32, ptr [[DOTOMP_COMB_UB]], align 4
2073 // CHECK5-NEXT: br label [[COND_END]]
2074 // CHECK5: cond.end:
2075 // CHECK5-NEXT: [[COND:%.*]] = phi i32 [ 99, [[COND_TRUE]] ], [ [[TMP3]], [[COND_FALSE]] ]
2076 // CHECK5-NEXT: store i32 [[COND]], ptr [[DOTOMP_COMB_UB]], align 4
2077 // CHECK5-NEXT: [[TMP4:%.*]] = load i32, ptr [[DOTOMP_COMB_LB]], align 4
2078 // CHECK5-NEXT: store i32 [[TMP4]], ptr [[DOTOMP_IV]], align 4
2079 // CHECK5-NEXT: br label [[OMP_INNER_FOR_COND:%.*]]
2080 // CHECK5: omp.inner.for.cond:
2081 // CHECK5-NEXT: [[TMP5:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4
2082 // CHECK5-NEXT: [[TMP6:%.*]] = load i32, ptr [[DOTOMP_COMB_UB]], align 4
2083 // CHECK5-NEXT: [[CMP1:%.*]] = icmp sle i32 [[TMP5]], [[TMP6]]
2084 // CHECK5-NEXT: br i1 [[CMP1]], label [[OMP_INNER_FOR_BODY:%.*]], label [[OMP_INNER_FOR_END:%.*]]
2085 // CHECK5: omp.inner.for.body:
2086 // CHECK5-NEXT: call void @__kmpc_push_num_threads(ptr @[[GLOB3]], i32 [[TMP1]], i32 5)
2087 // CHECK5-NEXT: [[TMP7:%.*]] = load i32, ptr [[DOTOMP_COMB_LB]], align 4
2088 // CHECK5-NEXT: [[TMP8:%.*]] = zext i32 [[TMP7]] to i64
2089 // CHECK5-NEXT: [[TMP9:%.*]] = load i32, ptr [[DOTOMP_COMB_UB]], align 4
2090 // CHECK5-NEXT: [[TMP10:%.*]] = zext i32 [[TMP9]] to i64
2091 // CHECK5-NEXT: call void (ptr, i32, ptr, ...) @__kmpc_fork_call(ptr @[[GLOB3]], i32 2, ptr @{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z5tmainIcLi5EEiv_l36.omp_outlined.omp_outlined, i64 [[TMP8]], i64 [[TMP10]])
2092 // CHECK5-NEXT: br label [[OMP_INNER_FOR_INC:%.*]]
2093 // CHECK5: omp.inner.for.inc:
2094 // CHECK5-NEXT: [[TMP11:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4
2095 // CHECK5-NEXT: [[TMP12:%.*]] = load i32, ptr [[DOTOMP_STRIDE]], align 4
2096 // CHECK5-NEXT: [[ADD:%.*]] = add nsw i32 [[TMP11]], [[TMP12]]
2097 // CHECK5-NEXT: store i32 [[ADD]], ptr [[DOTOMP_IV]], align 4
2098 // CHECK5-NEXT: br label [[OMP_INNER_FOR_COND]]
2099 // CHECK5: omp.inner.for.end:
2100 // CHECK5-NEXT: br label [[OMP_LOOP_EXIT:%.*]]
2101 // CHECK5: omp.loop.exit:
2102 // CHECK5-NEXT: call void @__kmpc_for_static_fini(ptr @[[GLOB1]], i32 [[TMP1]])
2103 // CHECK5-NEXT: ret void
2106 // CHECK5-LABEL: define {{[^@]+}}@{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z5tmainIcLi5EEiv_l36.omp_outlined.omp_outlined
2107 // CHECK5-SAME: (ptr noalias noundef [[DOTGLOBAL_TID_:%.*]], ptr noalias noundef [[DOTBOUND_TID_:%.*]], i64 noundef [[DOTPREVIOUS_LB_:%.*]], i64 noundef [[DOTPREVIOUS_UB_:%.*]]) #[[ATTR4]] personality ptr @__gxx_personality_v0 {
2108 // CHECK5-NEXT: entry:
2109 // CHECK5-NEXT: [[DOTGLOBAL_TID__ADDR:%.*]] = alloca ptr, align 8
2110 // CHECK5-NEXT: [[DOTBOUND_TID__ADDR:%.*]] = alloca ptr, align 8
2111 // CHECK5-NEXT: [[DOTPREVIOUS_LB__ADDR:%.*]] = alloca i64, align 8
2112 // CHECK5-NEXT: [[DOTPREVIOUS_UB__ADDR:%.*]] = alloca i64, align 8
2113 // CHECK5-NEXT: [[DOTOMP_IV:%.*]] = alloca i32, align 4
2114 // CHECK5-NEXT: [[TMP:%.*]] = alloca i32, align 4
2115 // CHECK5-NEXT: [[DOTOMP_LB:%.*]] = alloca i32, align 4
2116 // CHECK5-NEXT: [[DOTOMP_UB:%.*]] = alloca i32, align 4
2117 // CHECK5-NEXT: [[DOTOMP_STRIDE:%.*]] = alloca i32, align 4
2118 // CHECK5-NEXT: [[DOTOMP_IS_LAST:%.*]] = alloca i32, align 4
2119 // CHECK5-NEXT: [[I:%.*]] = alloca i32, align 4
2120 // CHECK5-NEXT: store ptr [[DOTGLOBAL_TID_]], ptr [[DOTGLOBAL_TID__ADDR]], align 8
2121 // CHECK5-NEXT: store ptr [[DOTBOUND_TID_]], ptr [[DOTBOUND_TID__ADDR]], align 8
2122 // CHECK5-NEXT: store i64 [[DOTPREVIOUS_LB_]], ptr [[DOTPREVIOUS_LB__ADDR]], align 8
2123 // CHECK5-NEXT: store i64 [[DOTPREVIOUS_UB_]], ptr [[DOTPREVIOUS_UB__ADDR]], align 8
2124 // CHECK5-NEXT: store i32 0, ptr [[DOTOMP_LB]], align 4
2125 // CHECK5-NEXT: store i32 99, ptr [[DOTOMP_UB]], align 4
2126 // CHECK5-NEXT: [[TMP0:%.*]] = load i64, ptr [[DOTPREVIOUS_LB__ADDR]], align 8
2127 // CHECK5-NEXT: [[CONV:%.*]] = trunc i64 [[TMP0]] to i32
2128 // CHECK5-NEXT: [[TMP1:%.*]] = load i64, ptr [[DOTPREVIOUS_UB__ADDR]], align 8
2129 // CHECK5-NEXT: [[CONV1:%.*]] = trunc i64 [[TMP1]] to i32
2130 // CHECK5-NEXT: store i32 [[CONV]], ptr [[DOTOMP_LB]], align 4
2131 // CHECK5-NEXT: store i32 [[CONV1]], ptr [[DOTOMP_UB]], align 4
2132 // CHECK5-NEXT: store i32 1, ptr [[DOTOMP_STRIDE]], align 4
2133 // CHECK5-NEXT: store i32 0, ptr [[DOTOMP_IS_LAST]], align 4
2134 // CHECK5-NEXT: [[TMP2:%.*]] = load ptr, ptr [[DOTGLOBAL_TID__ADDR]], align 8
2135 // CHECK5-NEXT: [[TMP3:%.*]] = load i32, ptr [[TMP2]], align 4
2136 // CHECK5-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)
2137 // CHECK5-NEXT: [[TMP4:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4
2138 // CHECK5-NEXT: [[CMP:%.*]] = icmp sgt i32 [[TMP4]], 99
2139 // CHECK5-NEXT: br i1 [[CMP]], label [[COND_TRUE:%.*]], label [[COND_FALSE:%.*]]
2140 // CHECK5: cond.true:
2141 // CHECK5-NEXT: br label [[COND_END:%.*]]
2142 // CHECK5: cond.false:
2143 // CHECK5-NEXT: [[TMP5:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4
2144 // CHECK5-NEXT: br label [[COND_END]]
2145 // CHECK5: cond.end:
2146 // CHECK5-NEXT: [[COND:%.*]] = phi i32 [ 99, [[COND_TRUE]] ], [ [[TMP5]], [[COND_FALSE]] ]
2147 // CHECK5-NEXT: store i32 [[COND]], ptr [[DOTOMP_UB]], align 4
2148 // CHECK5-NEXT: [[TMP6:%.*]] = load i32, ptr [[DOTOMP_LB]], align 4
2149 // CHECK5-NEXT: store i32 [[TMP6]], ptr [[DOTOMP_IV]], align 4
2150 // CHECK5-NEXT: br label [[OMP_INNER_FOR_COND:%.*]]
2151 // CHECK5: omp.inner.for.cond:
2152 // CHECK5-NEXT: [[TMP7:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4
2153 // CHECK5-NEXT: [[TMP8:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4
2154 // CHECK5-NEXT: [[CMP2:%.*]] = icmp sle i32 [[TMP7]], [[TMP8]]
2155 // CHECK5-NEXT: br i1 [[CMP2]], label [[OMP_INNER_FOR_BODY:%.*]], label [[OMP_INNER_FOR_END:%.*]]
2156 // CHECK5: omp.inner.for.body:
2157 // CHECK5-NEXT: [[TMP9:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4
2158 // CHECK5-NEXT: [[MUL:%.*]] = mul nsw i32 [[TMP9]], 1
2159 // CHECK5-NEXT: [[ADD:%.*]] = add nsw i32 0, [[MUL]]
2160 // CHECK5-NEXT: store i32 [[ADD]], ptr [[I]], align 4
2161 // CHECK5-NEXT: invoke void @_Z3foov()
2162 // CHECK5-NEXT: to label [[INVOKE_CONT:%.*]] unwind label [[TERMINATE_LPAD:%.*]]
2163 // CHECK5: invoke.cont:
2164 // CHECK5-NEXT: br label [[OMP_BODY_CONTINUE:%.*]]
2165 // CHECK5: omp.body.continue:
2166 // CHECK5-NEXT: br label [[OMP_INNER_FOR_INC:%.*]]
2167 // CHECK5: omp.inner.for.inc:
2168 // CHECK5-NEXT: [[TMP10:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4
2169 // CHECK5-NEXT: [[ADD3:%.*]] = add nsw i32 [[TMP10]], 1
2170 // CHECK5-NEXT: store i32 [[ADD3]], ptr [[DOTOMP_IV]], align 4
2171 // CHECK5-NEXT: br label [[OMP_INNER_FOR_COND]]
2172 // CHECK5: omp.inner.for.end:
2173 // CHECK5-NEXT: br label [[OMP_LOOP_EXIT:%.*]]
2174 // CHECK5: omp.loop.exit:
2175 // CHECK5-NEXT: call void @__kmpc_for_static_fini(ptr @[[GLOB1]], i32 [[TMP3]])
2176 // CHECK5-NEXT: ret void
2177 // CHECK5: terminate.lpad:
2178 // CHECK5-NEXT: [[TMP11:%.*]] = landingpad { ptr, i32 }
2179 // CHECK5-NEXT: catch ptr null
2180 // CHECK5-NEXT: [[TMP12:%.*]] = extractvalue { ptr, i32 } [[TMP11]], 0
2181 // CHECK5-NEXT: call void @__clang_call_terminate(ptr [[TMP12]]) #[[ATTR13]]
2182 // CHECK5-NEXT: unreachable
2185 // CHECK5-LABEL: define {{[^@]+}}@{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z5tmainIcLi5EEiv_l40
2186 // CHECK5-SAME: () #[[ATTR10:[0-9]+]] {
2187 // CHECK5-NEXT: entry:
2188 // CHECK5-NEXT: call void (ptr, i32, ptr, ...) @__kmpc_fork_teams(ptr @[[GLOB3]], i32 0, ptr @{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z5tmainIcLi5EEiv_l40.omp_outlined)
2189 // CHECK5-NEXT: ret void
2192 // CHECK5-LABEL: define {{[^@]+}}@{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z5tmainIcLi5EEiv_l40.omp_outlined
2193 // CHECK5-SAME: (ptr noalias noundef [[DOTGLOBAL_TID_:%.*]], ptr noalias noundef [[DOTBOUND_TID_:%.*]]) #[[ATTR4]] {
2194 // CHECK5-NEXT: entry:
2195 // CHECK5-NEXT: [[DOTGLOBAL_TID__ADDR:%.*]] = alloca ptr, align 8
2196 // CHECK5-NEXT: [[DOTBOUND_TID__ADDR:%.*]] = alloca ptr, align 8
2197 // CHECK5-NEXT: [[DOTOMP_IV:%.*]] = alloca i32, align 4
2198 // CHECK5-NEXT: [[TMP:%.*]] = alloca i32, align 4
2199 // CHECK5-NEXT: [[DOTOMP_COMB_LB:%.*]] = alloca i32, align 4
2200 // CHECK5-NEXT: [[DOTOMP_COMB_UB:%.*]] = alloca i32, align 4
2201 // CHECK5-NEXT: [[DOTOMP_STRIDE:%.*]] = alloca i32, align 4
2202 // CHECK5-NEXT: [[DOTOMP_IS_LAST:%.*]] = alloca i32, align 4
2203 // CHECK5-NEXT: [[I:%.*]] = alloca i32, align 4
2204 // CHECK5-NEXT: store ptr [[DOTGLOBAL_TID_]], ptr [[DOTGLOBAL_TID__ADDR]], align 8
2205 // CHECK5-NEXT: store ptr [[DOTBOUND_TID_]], ptr [[DOTBOUND_TID__ADDR]], align 8
2206 // CHECK5-NEXT: store i32 0, ptr [[DOTOMP_COMB_LB]], align 4
2207 // CHECK5-NEXT: store i32 99, ptr [[DOTOMP_COMB_UB]], align 4
2208 // CHECK5-NEXT: store i32 1, ptr [[DOTOMP_STRIDE]], align 4
2209 // CHECK5-NEXT: store i32 0, ptr [[DOTOMP_IS_LAST]], align 4
2210 // CHECK5-NEXT: [[TMP0:%.*]] = load ptr, ptr [[DOTGLOBAL_TID__ADDR]], align 8
2211 // CHECK5-NEXT: [[TMP1:%.*]] = load i32, ptr [[TMP0]], align 4
2212 // CHECK5-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)
2213 // CHECK5-NEXT: [[TMP2:%.*]] = load i32, ptr [[DOTOMP_COMB_UB]], align 4
2214 // CHECK5-NEXT: [[CMP:%.*]] = icmp sgt i32 [[TMP2]], 99
2215 // CHECK5-NEXT: br i1 [[CMP]], label [[COND_TRUE:%.*]], label [[COND_FALSE:%.*]]
2216 // CHECK5: cond.true:
2217 // CHECK5-NEXT: br label [[COND_END:%.*]]
2218 // CHECK5: cond.false:
2219 // CHECK5-NEXT: [[TMP3:%.*]] = load i32, ptr [[DOTOMP_COMB_UB]], align 4
2220 // CHECK5-NEXT: br label [[COND_END]]
2221 // CHECK5: cond.end:
2222 // CHECK5-NEXT: [[COND:%.*]] = phi i32 [ 99, [[COND_TRUE]] ], [ [[TMP3]], [[COND_FALSE]] ]
2223 // CHECK5-NEXT: store i32 [[COND]], ptr [[DOTOMP_COMB_UB]], align 4
2224 // CHECK5-NEXT: [[TMP4:%.*]] = load i32, ptr [[DOTOMP_COMB_LB]], align 4
2225 // CHECK5-NEXT: store i32 [[TMP4]], ptr [[DOTOMP_IV]], align 4
2226 // CHECK5-NEXT: br label [[OMP_INNER_FOR_COND:%.*]]
2227 // CHECK5: omp.inner.for.cond:
2228 // CHECK5-NEXT: [[TMP5:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4
2229 // CHECK5-NEXT: [[TMP6:%.*]] = load i32, ptr [[DOTOMP_COMB_UB]], align 4
2230 // CHECK5-NEXT: [[CMP1:%.*]] = icmp sle i32 [[TMP5]], [[TMP6]]
2231 // CHECK5-NEXT: br i1 [[CMP1]], label [[OMP_INNER_FOR_BODY:%.*]], label [[OMP_INNER_FOR_END:%.*]]
2232 // CHECK5: omp.inner.for.body:
2233 // CHECK5-NEXT: call void @__kmpc_push_num_threads(ptr @[[GLOB3]], i32 [[TMP1]], i32 23)
2234 // CHECK5-NEXT: [[TMP7:%.*]] = load i32, ptr [[DOTOMP_COMB_LB]], align 4
2235 // CHECK5-NEXT: [[TMP8:%.*]] = zext i32 [[TMP7]] to i64
2236 // CHECK5-NEXT: [[TMP9:%.*]] = load i32, ptr [[DOTOMP_COMB_UB]], align 4
2237 // CHECK5-NEXT: [[TMP10:%.*]] = zext i32 [[TMP9]] to i64
2238 // CHECK5-NEXT: call void (ptr, i32, ptr, ...) @__kmpc_fork_call(ptr @[[GLOB3]], i32 2, ptr @{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z5tmainIcLi5EEiv_l40.omp_outlined.omp_outlined, i64 [[TMP8]], i64 [[TMP10]])
2239 // CHECK5-NEXT: br label [[OMP_INNER_FOR_INC:%.*]]
2240 // CHECK5: omp.inner.for.inc:
2241 // CHECK5-NEXT: [[TMP11:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4
2242 // CHECK5-NEXT: [[TMP12:%.*]] = load i32, ptr [[DOTOMP_STRIDE]], align 4
2243 // CHECK5-NEXT: [[ADD:%.*]] = add nsw i32 [[TMP11]], [[TMP12]]
2244 // CHECK5-NEXT: store i32 [[ADD]], ptr [[DOTOMP_IV]], align 4
2245 // CHECK5-NEXT: br label [[OMP_INNER_FOR_COND]]
2246 // CHECK5: omp.inner.for.end:
2247 // CHECK5-NEXT: br label [[OMP_LOOP_EXIT:%.*]]
2248 // CHECK5: omp.loop.exit:
2249 // CHECK5-NEXT: call void @__kmpc_for_static_fini(ptr @[[GLOB1]], i32 [[TMP1]])
2250 // CHECK5-NEXT: ret void
2253 // CHECK5-LABEL: define {{[^@]+}}@{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z5tmainIcLi5EEiv_l40.omp_outlined.omp_outlined
2254 // CHECK5-SAME: (ptr noalias noundef [[DOTGLOBAL_TID_:%.*]], ptr noalias noundef [[DOTBOUND_TID_:%.*]], i64 noundef [[DOTPREVIOUS_LB_:%.*]], i64 noundef [[DOTPREVIOUS_UB_:%.*]]) #[[ATTR4]] personality ptr @__gxx_personality_v0 {
2255 // CHECK5-NEXT: entry:
2256 // CHECK5-NEXT: [[DOTGLOBAL_TID__ADDR:%.*]] = alloca ptr, align 8
2257 // CHECK5-NEXT: [[DOTBOUND_TID__ADDR:%.*]] = alloca ptr, align 8
2258 // CHECK5-NEXT: [[DOTPREVIOUS_LB__ADDR:%.*]] = alloca i64, align 8
2259 // CHECK5-NEXT: [[DOTPREVIOUS_UB__ADDR:%.*]] = alloca i64, align 8
2260 // CHECK5-NEXT: [[DOTOMP_IV:%.*]] = alloca i32, align 4
2261 // CHECK5-NEXT: [[TMP:%.*]] = alloca i32, align 4
2262 // CHECK5-NEXT: [[DOTOMP_LB:%.*]] = alloca i32, align 4
2263 // CHECK5-NEXT: [[DOTOMP_UB:%.*]] = alloca i32, align 4
2264 // CHECK5-NEXT: [[DOTOMP_STRIDE:%.*]] = alloca i32, align 4
2265 // CHECK5-NEXT: [[DOTOMP_IS_LAST:%.*]] = alloca i32, align 4
2266 // CHECK5-NEXT: [[I:%.*]] = alloca i32, align 4
2267 // CHECK5-NEXT: store ptr [[DOTGLOBAL_TID_]], ptr [[DOTGLOBAL_TID__ADDR]], align 8
2268 // CHECK5-NEXT: store ptr [[DOTBOUND_TID_]], ptr [[DOTBOUND_TID__ADDR]], align 8
2269 // CHECK5-NEXT: store i64 [[DOTPREVIOUS_LB_]], ptr [[DOTPREVIOUS_LB__ADDR]], align 8
2270 // CHECK5-NEXT: store i64 [[DOTPREVIOUS_UB_]], ptr [[DOTPREVIOUS_UB__ADDR]], align 8
2271 // CHECK5-NEXT: store i32 0, ptr [[DOTOMP_LB]], align 4
2272 // CHECK5-NEXT: store i32 99, ptr [[DOTOMP_UB]], align 4
2273 // CHECK5-NEXT: [[TMP0:%.*]] = load i64, ptr [[DOTPREVIOUS_LB__ADDR]], align 8
2274 // CHECK5-NEXT: [[CONV:%.*]] = trunc i64 [[TMP0]] to i32
2275 // CHECK5-NEXT: [[TMP1:%.*]] = load i64, ptr [[DOTPREVIOUS_UB__ADDR]], align 8
2276 // CHECK5-NEXT: [[CONV1:%.*]] = trunc i64 [[TMP1]] to i32
2277 // CHECK5-NEXT: store i32 [[CONV]], ptr [[DOTOMP_LB]], align 4
2278 // CHECK5-NEXT: store i32 [[CONV1]], ptr [[DOTOMP_UB]], align 4
2279 // CHECK5-NEXT: store i32 1, ptr [[DOTOMP_STRIDE]], align 4
2280 // CHECK5-NEXT: store i32 0, ptr [[DOTOMP_IS_LAST]], align 4
2281 // CHECK5-NEXT: [[TMP2:%.*]] = load ptr, ptr [[DOTGLOBAL_TID__ADDR]], align 8
2282 // CHECK5-NEXT: [[TMP3:%.*]] = load i32, ptr [[TMP2]], align 4
2283 // CHECK5-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)
2284 // CHECK5-NEXT: [[TMP4:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4
2285 // CHECK5-NEXT: [[CMP:%.*]] = icmp sgt i32 [[TMP4]], 99
2286 // CHECK5-NEXT: br i1 [[CMP]], label [[COND_TRUE:%.*]], label [[COND_FALSE:%.*]]
2287 // CHECK5: cond.true:
2288 // CHECK5-NEXT: br label [[COND_END:%.*]]
2289 // CHECK5: cond.false:
2290 // CHECK5-NEXT: [[TMP5:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4
2291 // CHECK5-NEXT: br label [[COND_END]]
2292 // CHECK5: cond.end:
2293 // CHECK5-NEXT: [[COND:%.*]] = phi i32 [ 99, [[COND_TRUE]] ], [ [[TMP5]], [[COND_FALSE]] ]
2294 // CHECK5-NEXT: store i32 [[COND]], ptr [[DOTOMP_UB]], align 4
2295 // CHECK5-NEXT: [[TMP6:%.*]] = load i32, ptr [[DOTOMP_LB]], align 4
2296 // CHECK5-NEXT: store i32 [[TMP6]], ptr [[DOTOMP_IV]], align 4
2297 // CHECK5-NEXT: br label [[OMP_INNER_FOR_COND:%.*]]
2298 // CHECK5: omp.inner.for.cond:
2299 // CHECK5-NEXT: [[TMP7:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4
2300 // CHECK5-NEXT: [[TMP8:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4
2301 // CHECK5-NEXT: [[CMP2:%.*]] = icmp sle i32 [[TMP7]], [[TMP8]]
2302 // CHECK5-NEXT: br i1 [[CMP2]], label [[OMP_INNER_FOR_BODY:%.*]], label [[OMP_INNER_FOR_END:%.*]]
2303 // CHECK5: omp.inner.for.body:
2304 // CHECK5-NEXT: [[TMP9:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4
2305 // CHECK5-NEXT: [[MUL:%.*]] = mul nsw i32 [[TMP9]], 1
2306 // CHECK5-NEXT: [[ADD:%.*]] = add nsw i32 0, [[MUL]]
2307 // CHECK5-NEXT: store i32 [[ADD]], ptr [[I]], align 4
2308 // CHECK5-NEXT: invoke void @_Z3foov()
2309 // CHECK5-NEXT: to label [[INVOKE_CONT:%.*]] unwind label [[TERMINATE_LPAD:%.*]]
2310 // CHECK5: invoke.cont:
2311 // CHECK5-NEXT: br label [[OMP_BODY_CONTINUE:%.*]]
2312 // CHECK5: omp.body.continue:
2313 // CHECK5-NEXT: br label [[OMP_INNER_FOR_INC:%.*]]
2314 // CHECK5: omp.inner.for.inc:
2315 // CHECK5-NEXT: [[TMP10:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4
2316 // CHECK5-NEXT: [[ADD3:%.*]] = add nsw i32 [[TMP10]], 1
2317 // CHECK5-NEXT: store i32 [[ADD3]], ptr [[DOTOMP_IV]], align 4
2318 // CHECK5-NEXT: br label [[OMP_INNER_FOR_COND]]
2319 // CHECK5: omp.inner.for.end:
2320 // CHECK5-NEXT: br label [[OMP_LOOP_EXIT:%.*]]
2321 // CHECK5: omp.loop.exit:
2322 // CHECK5-NEXT: call void @__kmpc_for_static_fini(ptr @[[GLOB1]], i32 [[TMP3]])
2323 // CHECK5-NEXT: ret void
2324 // CHECK5: terminate.lpad:
2325 // CHECK5-NEXT: [[TMP11:%.*]] = landingpad { ptr, i32 }
2326 // CHECK5-NEXT: catch ptr null
2327 // CHECK5-NEXT: [[TMP12:%.*]] = extractvalue { ptr, i32 } [[TMP11]], 0
2328 // CHECK5-NEXT: call void @__clang_call_terminate(ptr [[TMP12]]) #[[ATTR13]]
2329 // CHECK5-NEXT: unreachable
2332 // CHECK5-LABEL: define {{[^@]+}}@{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z5tmainI1SLi1EEiv_l36
2333 // CHECK5-SAME: () #[[ATTR11:[0-9]+]] {
2334 // CHECK5-NEXT: entry:
2335 // CHECK5-NEXT: call void (ptr, i32, ptr, ...) @__kmpc_fork_teams(ptr @[[GLOB3]], i32 0, ptr @{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z5tmainI1SLi1EEiv_l36.omp_outlined)
2336 // CHECK5-NEXT: ret void
2339 // CHECK5-LABEL: define {{[^@]+}}@{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z5tmainI1SLi1EEiv_l36.omp_outlined
2340 // CHECK5-SAME: (ptr noalias noundef [[DOTGLOBAL_TID_:%.*]], ptr noalias noundef [[DOTBOUND_TID_:%.*]]) #[[ATTR4]] {
2341 // CHECK5-NEXT: entry:
2342 // CHECK5-NEXT: [[DOTGLOBAL_TID__ADDR:%.*]] = alloca ptr, align 8
2343 // CHECK5-NEXT: [[DOTBOUND_TID__ADDR:%.*]] = alloca ptr, align 8
2344 // CHECK5-NEXT: [[DOTOMP_IV:%.*]] = alloca i32, align 4
2345 // CHECK5-NEXT: [[TMP:%.*]] = alloca i32, align 4
2346 // CHECK5-NEXT: [[DOTOMP_COMB_LB:%.*]] = alloca i32, align 4
2347 // CHECK5-NEXT: [[DOTOMP_COMB_UB:%.*]] = alloca i32, align 4
2348 // CHECK5-NEXT: [[DOTOMP_STRIDE:%.*]] = alloca i32, align 4
2349 // CHECK5-NEXT: [[DOTOMP_IS_LAST:%.*]] = alloca i32, align 4
2350 // CHECK5-NEXT: [[I:%.*]] = alloca i32, align 4
2351 // CHECK5-NEXT: store ptr [[DOTGLOBAL_TID_]], ptr [[DOTGLOBAL_TID__ADDR]], align 8
2352 // CHECK5-NEXT: store ptr [[DOTBOUND_TID_]], ptr [[DOTBOUND_TID__ADDR]], align 8
2353 // CHECK5-NEXT: store i32 0, ptr [[DOTOMP_COMB_LB]], align 4
2354 // CHECK5-NEXT: store i32 99, ptr [[DOTOMP_COMB_UB]], align 4
2355 // CHECK5-NEXT: store i32 1, ptr [[DOTOMP_STRIDE]], align 4
2356 // CHECK5-NEXT: store i32 0, ptr [[DOTOMP_IS_LAST]], align 4
2357 // CHECK5-NEXT: [[TMP0:%.*]] = load ptr, ptr [[DOTGLOBAL_TID__ADDR]], align 8
2358 // CHECK5-NEXT: [[TMP1:%.*]] = load i32, ptr [[TMP0]], align 4
2359 // CHECK5-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)
2360 // CHECK5-NEXT: [[TMP2:%.*]] = load i32, ptr [[DOTOMP_COMB_UB]], align 4
2361 // CHECK5-NEXT: [[CMP:%.*]] = icmp sgt i32 [[TMP2]], 99
2362 // CHECK5-NEXT: br i1 [[CMP]], label [[COND_TRUE:%.*]], label [[COND_FALSE:%.*]]
2363 // CHECK5: cond.true:
2364 // CHECK5-NEXT: br label [[COND_END:%.*]]
2365 // CHECK5: cond.false:
2366 // CHECK5-NEXT: [[TMP3:%.*]] = load i32, ptr [[DOTOMP_COMB_UB]], align 4
2367 // CHECK5-NEXT: br label [[COND_END]]
2368 // CHECK5: cond.end:
2369 // CHECK5-NEXT: [[COND:%.*]] = phi i32 [ 99, [[COND_TRUE]] ], [ [[TMP3]], [[COND_FALSE]] ]
2370 // CHECK5-NEXT: store i32 [[COND]], ptr [[DOTOMP_COMB_UB]], align 4
2371 // CHECK5-NEXT: [[TMP4:%.*]] = load i32, ptr [[DOTOMP_COMB_LB]], align 4
2372 // CHECK5-NEXT: store i32 [[TMP4]], ptr [[DOTOMP_IV]], align 4
2373 // CHECK5-NEXT: br label [[OMP_INNER_FOR_COND:%.*]]
2374 // CHECK5: omp.inner.for.cond:
2375 // CHECK5-NEXT: [[TMP5:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4
2376 // CHECK5-NEXT: [[TMP6:%.*]] = load i32, ptr [[DOTOMP_COMB_UB]], align 4
2377 // CHECK5-NEXT: [[CMP1:%.*]] = icmp sle i32 [[TMP5]], [[TMP6]]
2378 // CHECK5-NEXT: br i1 [[CMP1]], label [[OMP_INNER_FOR_BODY:%.*]], label [[OMP_INNER_FOR_END:%.*]]
2379 // CHECK5: omp.inner.for.body:
2380 // CHECK5-NEXT: call void @__kmpc_push_num_threads(ptr @[[GLOB3]], i32 [[TMP1]], i32 1)
2381 // CHECK5-NEXT: [[TMP7:%.*]] = load i32, ptr [[DOTOMP_COMB_LB]], align 4
2382 // CHECK5-NEXT: [[TMP8:%.*]] = zext i32 [[TMP7]] to i64
2383 // CHECK5-NEXT: [[TMP9:%.*]] = load i32, ptr [[DOTOMP_COMB_UB]], align 4
2384 // CHECK5-NEXT: [[TMP10:%.*]] = zext i32 [[TMP9]] to i64
2385 // CHECK5-NEXT: call void (ptr, i32, ptr, ...) @__kmpc_fork_call(ptr @[[GLOB3]], i32 2, ptr @{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z5tmainI1SLi1EEiv_l36.omp_outlined.omp_outlined, i64 [[TMP8]], i64 [[TMP10]])
2386 // CHECK5-NEXT: br label [[OMP_INNER_FOR_INC:%.*]]
2387 // CHECK5: omp.inner.for.inc:
2388 // CHECK5-NEXT: [[TMP11:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4
2389 // CHECK5-NEXT: [[TMP12:%.*]] = load i32, ptr [[DOTOMP_STRIDE]], align 4
2390 // CHECK5-NEXT: [[ADD:%.*]] = add nsw i32 [[TMP11]], [[TMP12]]
2391 // CHECK5-NEXT: store i32 [[ADD]], ptr [[DOTOMP_IV]], align 4
2392 // CHECK5-NEXT: br label [[OMP_INNER_FOR_COND]]
2393 // CHECK5: omp.inner.for.end:
2394 // CHECK5-NEXT: br label [[OMP_LOOP_EXIT:%.*]]
2395 // CHECK5: omp.loop.exit:
2396 // CHECK5-NEXT: call void @__kmpc_for_static_fini(ptr @[[GLOB1]], i32 [[TMP1]])
2397 // CHECK5-NEXT: ret void
2400 // CHECK5-LABEL: define {{[^@]+}}@{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z5tmainI1SLi1EEiv_l36.omp_outlined.omp_outlined
2401 // CHECK5-SAME: (ptr noalias noundef [[DOTGLOBAL_TID_:%.*]], ptr noalias noundef [[DOTBOUND_TID_:%.*]], i64 noundef [[DOTPREVIOUS_LB_:%.*]], i64 noundef [[DOTPREVIOUS_UB_:%.*]]) #[[ATTR4]] personality ptr @__gxx_personality_v0 {
2402 // CHECK5-NEXT: entry:
2403 // CHECK5-NEXT: [[DOTGLOBAL_TID__ADDR:%.*]] = alloca ptr, align 8
2404 // CHECK5-NEXT: [[DOTBOUND_TID__ADDR:%.*]] = alloca ptr, align 8
2405 // CHECK5-NEXT: [[DOTPREVIOUS_LB__ADDR:%.*]] = alloca i64, align 8
2406 // CHECK5-NEXT: [[DOTPREVIOUS_UB__ADDR:%.*]] = alloca i64, align 8
2407 // CHECK5-NEXT: [[DOTOMP_IV:%.*]] = alloca i32, align 4
2408 // CHECK5-NEXT: [[TMP:%.*]] = alloca i32, align 4
2409 // CHECK5-NEXT: [[DOTOMP_LB:%.*]] = alloca i32, align 4
2410 // CHECK5-NEXT: [[DOTOMP_UB:%.*]] = alloca i32, align 4
2411 // CHECK5-NEXT: [[DOTOMP_STRIDE:%.*]] = alloca i32, align 4
2412 // CHECK5-NEXT: [[DOTOMP_IS_LAST:%.*]] = alloca i32, align 4
2413 // CHECK5-NEXT: [[I:%.*]] = alloca i32, align 4
2414 // CHECK5-NEXT: store ptr [[DOTGLOBAL_TID_]], ptr [[DOTGLOBAL_TID__ADDR]], align 8
2415 // CHECK5-NEXT: store ptr [[DOTBOUND_TID_]], ptr [[DOTBOUND_TID__ADDR]], align 8
2416 // CHECK5-NEXT: store i64 [[DOTPREVIOUS_LB_]], ptr [[DOTPREVIOUS_LB__ADDR]], align 8
2417 // CHECK5-NEXT: store i64 [[DOTPREVIOUS_UB_]], ptr [[DOTPREVIOUS_UB__ADDR]], align 8
2418 // CHECK5-NEXT: store i32 0, ptr [[DOTOMP_LB]], align 4
2419 // CHECK5-NEXT: store i32 99, ptr [[DOTOMP_UB]], align 4
2420 // CHECK5-NEXT: [[TMP0:%.*]] = load i64, ptr [[DOTPREVIOUS_LB__ADDR]], align 8
2421 // CHECK5-NEXT: [[CONV:%.*]] = trunc i64 [[TMP0]] to i32
2422 // CHECK5-NEXT: [[TMP1:%.*]] = load i64, ptr [[DOTPREVIOUS_UB__ADDR]], align 8
2423 // CHECK5-NEXT: [[CONV1:%.*]] = trunc i64 [[TMP1]] to i32
2424 // CHECK5-NEXT: store i32 [[CONV]], ptr [[DOTOMP_LB]], align 4
2425 // CHECK5-NEXT: store i32 [[CONV1]], ptr [[DOTOMP_UB]], align 4
2426 // CHECK5-NEXT: store i32 1, ptr [[DOTOMP_STRIDE]], align 4
2427 // CHECK5-NEXT: store i32 0, ptr [[DOTOMP_IS_LAST]], align 4
2428 // CHECK5-NEXT: [[TMP2:%.*]] = load ptr, ptr [[DOTGLOBAL_TID__ADDR]], align 8
2429 // CHECK5-NEXT: [[TMP3:%.*]] = load i32, ptr [[TMP2]], align 4
2430 // CHECK5-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)
2431 // CHECK5-NEXT: [[TMP4:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4
2432 // CHECK5-NEXT: [[CMP:%.*]] = icmp sgt i32 [[TMP4]], 99
2433 // CHECK5-NEXT: br i1 [[CMP]], label [[COND_TRUE:%.*]], label [[COND_FALSE:%.*]]
2434 // CHECK5: cond.true:
2435 // CHECK5-NEXT: br label [[COND_END:%.*]]
2436 // CHECK5: cond.false:
2437 // CHECK5-NEXT: [[TMP5:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4
2438 // CHECK5-NEXT: br label [[COND_END]]
2439 // CHECK5: cond.end:
2440 // CHECK5-NEXT: [[COND:%.*]] = phi i32 [ 99, [[COND_TRUE]] ], [ [[TMP5]], [[COND_FALSE]] ]
2441 // CHECK5-NEXT: store i32 [[COND]], ptr [[DOTOMP_UB]], align 4
2442 // CHECK5-NEXT: [[TMP6:%.*]] = load i32, ptr [[DOTOMP_LB]], align 4
2443 // CHECK5-NEXT: store i32 [[TMP6]], ptr [[DOTOMP_IV]], align 4
2444 // CHECK5-NEXT: br label [[OMP_INNER_FOR_COND:%.*]]
2445 // CHECK5: omp.inner.for.cond:
2446 // CHECK5-NEXT: [[TMP7:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4
2447 // CHECK5-NEXT: [[TMP8:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4
2448 // CHECK5-NEXT: [[CMP2:%.*]] = icmp sle i32 [[TMP7]], [[TMP8]]
2449 // CHECK5-NEXT: br i1 [[CMP2]], label [[OMP_INNER_FOR_BODY:%.*]], label [[OMP_INNER_FOR_END:%.*]]
2450 // CHECK5: omp.inner.for.body:
2451 // CHECK5-NEXT: [[TMP9:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4
2452 // CHECK5-NEXT: [[MUL:%.*]] = mul nsw i32 [[TMP9]], 1
2453 // CHECK5-NEXT: [[ADD:%.*]] = add nsw i32 0, [[MUL]]
2454 // CHECK5-NEXT: store i32 [[ADD]], ptr [[I]], align 4
2455 // CHECK5-NEXT: invoke void @_Z3foov()
2456 // CHECK5-NEXT: to label [[INVOKE_CONT:%.*]] unwind label [[TERMINATE_LPAD:%.*]]
2457 // CHECK5: invoke.cont:
2458 // CHECK5-NEXT: br label [[OMP_BODY_CONTINUE:%.*]]
2459 // CHECK5: omp.body.continue:
2460 // CHECK5-NEXT: br label [[OMP_INNER_FOR_INC:%.*]]
2461 // CHECK5: omp.inner.for.inc:
2462 // CHECK5-NEXT: [[TMP10:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4
2463 // CHECK5-NEXT: [[ADD3:%.*]] = add nsw i32 [[TMP10]], 1
2464 // CHECK5-NEXT: store i32 [[ADD3]], ptr [[DOTOMP_IV]], align 4
2465 // CHECK5-NEXT: br label [[OMP_INNER_FOR_COND]]
2466 // CHECK5: omp.inner.for.end:
2467 // CHECK5-NEXT: br label [[OMP_LOOP_EXIT:%.*]]
2468 // CHECK5: omp.loop.exit:
2469 // CHECK5-NEXT: call void @__kmpc_for_static_fini(ptr @[[GLOB1]], i32 [[TMP3]])
2470 // CHECK5-NEXT: ret void
2471 // CHECK5: terminate.lpad:
2472 // CHECK5-NEXT: [[TMP11:%.*]] = landingpad { ptr, i32 }
2473 // CHECK5-NEXT: catch ptr null
2474 // CHECK5-NEXT: [[TMP12:%.*]] = extractvalue { ptr, i32 } [[TMP11]], 0
2475 // CHECK5-NEXT: call void @__clang_call_terminate(ptr [[TMP12]]) #[[ATTR13]]
2476 // CHECK5-NEXT: unreachable
2479 // CHECK5-LABEL: define {{[^@]+}}@{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z5tmainI1SLi1EEiv_l40
2480 // CHECK5-SAME: () #[[ATTR4]] personality ptr @__gxx_personality_v0 {
2481 // CHECK5-NEXT: entry:
2482 // CHECK5-NEXT: [[DOTCAPTURE_EXPR_:%.*]] = alloca i8, align 1
2483 // CHECK5-NEXT: [[REF_TMP:%.*]] = alloca [[STRUCT_S:%.*]], align 8
2484 // CHECK5-NEXT: [[DOTCAPTURE_EXPR__CASTED:%.*]] = alloca i64, align 8
2485 // CHECK5-NEXT: invoke void @_ZN1SC1El(ptr noundef nonnull align 8 dereferenceable(24) [[REF_TMP]], i64 noundef 23)
2486 // CHECK5-NEXT: to label [[INVOKE_CONT:%.*]] unwind label [[TERMINATE_LPAD:%.*]]
2487 // CHECK5: invoke.cont:
2488 // CHECK5-NEXT: [[CALL:%.*]] = call noundef signext i8 @_ZN1ScvcEv(ptr noundef nonnull align 8 dereferenceable(24) [[REF_TMP]])
2489 // CHECK5-NEXT: call void @_ZN1SD1Ev(ptr noundef nonnull align 8 dereferenceable(24) [[REF_TMP]]) #[[ATTR5]]
2490 // CHECK5-NEXT: store i8 [[CALL]], ptr [[DOTCAPTURE_EXPR_]], align 1
2491 // CHECK5-NEXT: [[TMP0:%.*]] = load i8, ptr [[DOTCAPTURE_EXPR_]], align 1
2492 // CHECK5-NEXT: store i8 [[TMP0]], ptr [[DOTCAPTURE_EXPR__CASTED]], align 1
2493 // CHECK5-NEXT: [[TMP1:%.*]] = load i64, ptr [[DOTCAPTURE_EXPR__CASTED]], align 8
2494 // CHECK5-NEXT: call void (ptr, i32, ptr, ...) @__kmpc_fork_teams(ptr @[[GLOB3]], i32 1, ptr @{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z5tmainI1SLi1EEiv_l40.omp_outlined, i64 [[TMP1]])
2495 // CHECK5-NEXT: ret void
2496 // CHECK5: terminate.lpad:
2497 // CHECK5-NEXT: [[TMP2:%.*]] = landingpad { ptr, i32 }
2498 // CHECK5-NEXT: catch ptr null
2499 // CHECK5-NEXT: [[TMP3:%.*]] = extractvalue { ptr, i32 } [[TMP2]], 0
2500 // CHECK5-NEXT: call void @__clang_call_terminate(ptr [[TMP3]]) #[[ATTR13]]
2501 // CHECK5-NEXT: unreachable
2504 // CHECK5-LABEL: define {{[^@]+}}@{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z5tmainI1SLi1EEiv_l40.omp_outlined
2505 // CHECK5-SAME: (ptr noalias noundef [[DOTGLOBAL_TID_:%.*]], ptr noalias noundef [[DOTBOUND_TID_:%.*]], i64 noundef [[DOTCAPTURE_EXPR_:%.*]]) #[[ATTR4]] {
2506 // CHECK5-NEXT: entry:
2507 // CHECK5-NEXT: [[DOTGLOBAL_TID__ADDR:%.*]] = alloca ptr, align 8
2508 // CHECK5-NEXT: [[DOTBOUND_TID__ADDR:%.*]] = alloca ptr, align 8
2509 // CHECK5-NEXT: [[DOTCAPTURE_EXPR__ADDR:%.*]] = alloca i64, align 8
2510 // CHECK5-NEXT: [[DOTOMP_IV:%.*]] = alloca i32, align 4
2511 // CHECK5-NEXT: [[TMP:%.*]] = alloca i32, align 4
2512 // CHECK5-NEXT: [[DOTOMP_COMB_LB:%.*]] = alloca i32, align 4
2513 // CHECK5-NEXT: [[DOTOMP_COMB_UB:%.*]] = alloca i32, align 4
2514 // CHECK5-NEXT: [[DOTOMP_STRIDE:%.*]] = alloca i32, align 4
2515 // CHECK5-NEXT: [[DOTOMP_IS_LAST:%.*]] = alloca i32, align 4
2516 // CHECK5-NEXT: [[I:%.*]] = alloca i32, align 4
2517 // CHECK5-NEXT: store ptr [[DOTGLOBAL_TID_]], ptr [[DOTGLOBAL_TID__ADDR]], align 8
2518 // CHECK5-NEXT: store ptr [[DOTBOUND_TID_]], ptr [[DOTBOUND_TID__ADDR]], align 8
2519 // CHECK5-NEXT: store i64 [[DOTCAPTURE_EXPR_]], ptr [[DOTCAPTURE_EXPR__ADDR]], align 8
2520 // CHECK5-NEXT: store i32 0, ptr [[DOTOMP_COMB_LB]], align 4
2521 // CHECK5-NEXT: store i32 99, ptr [[DOTOMP_COMB_UB]], align 4
2522 // CHECK5-NEXT: store i32 1, ptr [[DOTOMP_STRIDE]], align 4
2523 // CHECK5-NEXT: store i32 0, ptr [[DOTOMP_IS_LAST]], align 4
2524 // CHECK5-NEXT: [[TMP0:%.*]] = load ptr, ptr [[DOTGLOBAL_TID__ADDR]], align 8
2525 // CHECK5-NEXT: [[TMP1:%.*]] = load i32, ptr [[TMP0]], align 4
2526 // CHECK5-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)
2527 // CHECK5-NEXT: [[TMP2:%.*]] = load i32, ptr [[DOTOMP_COMB_UB]], align 4
2528 // CHECK5-NEXT: [[CMP:%.*]] = icmp sgt i32 [[TMP2]], 99
2529 // CHECK5-NEXT: br i1 [[CMP]], label [[COND_TRUE:%.*]], label [[COND_FALSE:%.*]]
2530 // CHECK5: cond.true:
2531 // CHECK5-NEXT: br label [[COND_END:%.*]]
2532 // CHECK5: cond.false:
2533 // CHECK5-NEXT: [[TMP3:%.*]] = load i32, ptr [[DOTOMP_COMB_UB]], align 4
2534 // CHECK5-NEXT: br label [[COND_END]]
2535 // CHECK5: cond.end:
2536 // CHECK5-NEXT: [[COND:%.*]] = phi i32 [ 99, [[COND_TRUE]] ], [ [[TMP3]], [[COND_FALSE]] ]
2537 // CHECK5-NEXT: store i32 [[COND]], ptr [[DOTOMP_COMB_UB]], align 4
2538 // CHECK5-NEXT: [[TMP4:%.*]] = load i32, ptr [[DOTOMP_COMB_LB]], align 4
2539 // CHECK5-NEXT: store i32 [[TMP4]], ptr [[DOTOMP_IV]], align 4
2540 // CHECK5-NEXT: br label [[OMP_INNER_FOR_COND:%.*]]
2541 // CHECK5: omp.inner.for.cond:
2542 // CHECK5-NEXT: [[TMP5:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4
2543 // CHECK5-NEXT: [[TMP6:%.*]] = load i32, ptr [[DOTOMP_COMB_UB]], align 4
2544 // CHECK5-NEXT: [[CMP1:%.*]] = icmp sle i32 [[TMP5]], [[TMP6]]
2545 // CHECK5-NEXT: br i1 [[CMP1]], label [[OMP_INNER_FOR_BODY:%.*]], label [[OMP_INNER_FOR_END:%.*]]
2546 // CHECK5: omp.inner.for.body:
2547 // CHECK5-NEXT: [[TMP7:%.*]] = load i8, ptr [[DOTCAPTURE_EXPR__ADDR]], align 1
2548 // CHECK5-NEXT: [[TMP8:%.*]] = sext i8 [[TMP7]] to i32
2549 // CHECK5-NEXT: call void @__kmpc_push_num_threads(ptr @[[GLOB3]], i32 [[TMP1]], i32 [[TMP8]])
2550 // CHECK5-NEXT: [[TMP9:%.*]] = load i32, ptr [[DOTOMP_COMB_LB]], align 4
2551 // CHECK5-NEXT: [[TMP10:%.*]] = zext i32 [[TMP9]] to i64
2552 // CHECK5-NEXT: [[TMP11:%.*]] = load i32, ptr [[DOTOMP_COMB_UB]], align 4
2553 // CHECK5-NEXT: [[TMP12:%.*]] = zext i32 [[TMP11]] to i64
2554 // CHECK5-NEXT: call void (ptr, i32, ptr, ...) @__kmpc_fork_call(ptr @[[GLOB3]], i32 2, ptr @{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z5tmainI1SLi1EEiv_l40.omp_outlined.omp_outlined, i64 [[TMP10]], i64 [[TMP12]])
2555 // CHECK5-NEXT: br label [[OMP_INNER_FOR_INC:%.*]]
2556 // CHECK5: omp.inner.for.inc:
2557 // CHECK5-NEXT: [[TMP13:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4
2558 // CHECK5-NEXT: [[TMP14:%.*]] = load i32, ptr [[DOTOMP_STRIDE]], align 4
2559 // CHECK5-NEXT: [[ADD:%.*]] = add nsw i32 [[TMP13]], [[TMP14]]
2560 // CHECK5-NEXT: store i32 [[ADD]], ptr [[DOTOMP_IV]], align 4
2561 // CHECK5-NEXT: br label [[OMP_INNER_FOR_COND]]
2562 // CHECK5: omp.inner.for.end:
2563 // CHECK5-NEXT: br label [[OMP_LOOP_EXIT:%.*]]
2564 // CHECK5: omp.loop.exit:
2565 // CHECK5-NEXT: call void @__kmpc_for_static_fini(ptr @[[GLOB1]], i32 [[TMP1]])
2566 // CHECK5-NEXT: ret void
2569 // CHECK5-LABEL: define {{[^@]+}}@{{__omp_offloading_[0-9a-z]+_[0-9a-z]+}}__Z5tmainI1SLi1EEiv_l40.omp_outlined.omp_outlined
2570 // CHECK5-SAME: (ptr noalias noundef [[DOTGLOBAL_TID_:%.*]], ptr noalias noundef [[DOTBOUND_TID_:%.*]], i64 noundef [[DOTPREVIOUS_LB_:%.*]], i64 noundef [[DOTPREVIOUS_UB_:%.*]]) #[[ATTR4]] personality ptr @__gxx_personality_v0 {
2571 // CHECK5-NEXT: entry:
2572 // CHECK5-NEXT: [[DOTGLOBAL_TID__ADDR:%.*]] = alloca ptr, align 8
2573 // CHECK5-NEXT: [[DOTBOUND_TID__ADDR:%.*]] = alloca ptr, align 8
2574 // CHECK5-NEXT: [[DOTPREVIOUS_LB__ADDR:%.*]] = alloca i64, align 8
2575 // CHECK5-NEXT: [[DOTPREVIOUS_UB__ADDR:%.*]] = alloca i64, align 8
2576 // CHECK5-NEXT: [[DOTOMP_IV:%.*]] = alloca i32, align 4
2577 // CHECK5-NEXT: [[TMP:%.*]] = alloca i32, align 4
2578 // CHECK5-NEXT: [[DOTOMP_LB:%.*]] = alloca i32, align 4
2579 // CHECK5-NEXT: [[DOTOMP_UB:%.*]] = alloca i32, align 4
2580 // CHECK5-NEXT: [[DOTOMP_STRIDE:%.*]] = alloca i32, align 4
2581 // CHECK5-NEXT: [[DOTOMP_IS_LAST:%.*]] = alloca i32, align 4
2582 // CHECK5-NEXT: [[I:%.*]] = alloca i32, align 4
2583 // CHECK5-NEXT: store ptr [[DOTGLOBAL_TID_]], ptr [[DOTGLOBAL_TID__ADDR]], align 8
2584 // CHECK5-NEXT: store ptr [[DOTBOUND_TID_]], ptr [[DOTBOUND_TID__ADDR]], align 8
2585 // CHECK5-NEXT: store i64 [[DOTPREVIOUS_LB_]], ptr [[DOTPREVIOUS_LB__ADDR]], align 8
2586 // CHECK5-NEXT: store i64 [[DOTPREVIOUS_UB_]], ptr [[DOTPREVIOUS_UB__ADDR]], align 8
2587 // CHECK5-NEXT: store i32 0, ptr [[DOTOMP_LB]], align 4
2588 // CHECK5-NEXT: store i32 99, ptr [[DOTOMP_UB]], align 4
2589 // CHECK5-NEXT: [[TMP0:%.*]] = load i64, ptr [[DOTPREVIOUS_LB__ADDR]], align 8
2590 // CHECK5-NEXT: [[CONV:%.*]] = trunc i64 [[TMP0]] to i32
2591 // CHECK5-NEXT: [[TMP1:%.*]] = load i64, ptr [[DOTPREVIOUS_UB__ADDR]], align 8
2592 // CHECK5-NEXT: [[CONV1:%.*]] = trunc i64 [[TMP1]] to i32
2593 // CHECK5-NEXT: store i32 [[CONV]], ptr [[DOTOMP_LB]], align 4
2594 // CHECK5-NEXT: store i32 [[CONV1]], ptr [[DOTOMP_UB]], align 4
2595 // CHECK5-NEXT: store i32 1, ptr [[DOTOMP_STRIDE]], align 4
2596 // CHECK5-NEXT: store i32 0, ptr [[DOTOMP_IS_LAST]], align 4
2597 // CHECK5-NEXT: [[TMP2:%.*]] = load ptr, ptr [[DOTGLOBAL_TID__ADDR]], align 8
2598 // CHECK5-NEXT: [[TMP3:%.*]] = load i32, ptr [[TMP2]], align 4
2599 // CHECK5-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)
2600 // CHECK5-NEXT: [[TMP4:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4
2601 // CHECK5-NEXT: [[CMP:%.*]] = icmp sgt i32 [[TMP4]], 99
2602 // CHECK5-NEXT: br i1 [[CMP]], label [[COND_TRUE:%.*]], label [[COND_FALSE:%.*]]
2603 // CHECK5: cond.true:
2604 // CHECK5-NEXT: br label [[COND_END:%.*]]
2605 // CHECK5: cond.false:
2606 // CHECK5-NEXT: [[TMP5:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4
2607 // CHECK5-NEXT: br label [[COND_END]]
2608 // CHECK5: cond.end:
2609 // CHECK5-NEXT: [[COND:%.*]] = phi i32 [ 99, [[COND_TRUE]] ], [ [[TMP5]], [[COND_FALSE]] ]
2610 // CHECK5-NEXT: store i32 [[COND]], ptr [[DOTOMP_UB]], align 4
2611 // CHECK5-NEXT: [[TMP6:%.*]] = load i32, ptr [[DOTOMP_LB]], align 4
2612 // CHECK5-NEXT: store i32 [[TMP6]], ptr [[DOTOMP_IV]], align 4
2613 // CHECK5-NEXT: br label [[OMP_INNER_FOR_COND:%.*]]
2614 // CHECK5: omp.inner.for.cond:
2615 // CHECK5-NEXT: [[TMP7:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4
2616 // CHECK5-NEXT: [[TMP8:%.*]] = load i32, ptr [[DOTOMP_UB]], align 4
2617 // CHECK5-NEXT: [[CMP2:%.*]] = icmp sle i32 [[TMP7]], [[TMP8]]
2618 // CHECK5-NEXT: br i1 [[CMP2]], label [[OMP_INNER_FOR_BODY:%.*]], label [[OMP_INNER_FOR_END:%.*]]
2619 // CHECK5: omp.inner.for.body:
2620 // CHECK5-NEXT: [[TMP9:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4
2621 // CHECK5-NEXT: [[MUL:%.*]] = mul nsw i32 [[TMP9]], 1
2622 // CHECK5-NEXT: [[ADD:%.*]] = add nsw i32 0, [[MUL]]
2623 // CHECK5-NEXT: store i32 [[ADD]], ptr [[I]], align 4
2624 // CHECK5-NEXT: invoke void @_Z3foov()
2625 // CHECK5-NEXT: to label [[INVOKE_CONT:%.*]] unwind label [[TERMINATE_LPAD:%.*]]
2626 // CHECK5: invoke.cont:
2627 // CHECK5-NEXT: br label [[OMP_BODY_CONTINUE:%.*]]
2628 // CHECK5: omp.body.continue:
2629 // CHECK5-NEXT: br label [[OMP_INNER_FOR_INC:%.*]]
2630 // CHECK5: omp.inner.for.inc:
2631 // CHECK5-NEXT: [[TMP10:%.*]] = load i32, ptr [[DOTOMP_IV]], align 4
2632 // CHECK5-NEXT: [[ADD3:%.*]] = add nsw i32 [[TMP10]], 1
2633 // CHECK5-NEXT: store i32 [[ADD3]], ptr [[DOTOMP_IV]], align 4
2634 // CHECK5-NEXT: br label [[OMP_INNER_FOR_COND]]
2635 // CHECK5: omp.inner.for.end:
2636 // CHECK5-NEXT: br label [[OMP_LOOP_EXIT:%.*]]
2637 // CHECK5: omp.loop.exit:
2638 // CHECK5-NEXT: call void @__kmpc_for_static_fini(ptr @[[GLOB1]], i32 [[TMP3]])
2639 // CHECK5-NEXT: ret void
2640 // CHECK5: terminate.lpad:
2641 // CHECK5-NEXT: [[TMP11:%.*]] = landingpad { ptr, i32 }
2642 // CHECK5-NEXT: catch ptr null
2643 // CHECK5-NEXT: [[TMP12:%.*]] = extractvalue { ptr, i32 } [[TMP11]], 0
2644 // CHECK5-NEXT: call void @__clang_call_terminate(ptr [[TMP12]]) #[[ATTR13]]
2645 // CHECK5-NEXT: unreachable
2648 // CHECK5-LABEL: define {{[^@]+}}@_ZN1SD2Ev
2649 // CHECK5-SAME: (ptr noundef nonnull align 8 dereferenceable(24) [[THIS:%.*]]) unnamed_addr #[[ATTR8]] comdat {
2650 // CHECK5-NEXT: entry:
2651 // CHECK5-NEXT: [[THIS_ADDR:%.*]] = alloca ptr, align 8
2652 // CHECK5-NEXT: store ptr [[THIS]], ptr [[THIS_ADDR]], align 8
2653 // CHECK5-NEXT: [[THIS1:%.*]] = load ptr, ptr [[THIS_ADDR]], align 8
2654 // CHECK5-NEXT: ret void
2657 // CHECK5-LABEL: define {{[^@]+}}@.omp_offloading.requires_reg
2658 // CHECK5-SAME: () #[[ATTR12:[0-9]+]] section ".text.startup" {
2659 // CHECK5-NEXT: entry:
2660 // CHECK5-NEXT: call void @__tgt_register_requires(i64 1)
2661 // CHECK5-NEXT: ret void