[clang] Implement lifetime analysis for lifetime_capture_by(X) (#115921)
[llvm-project.git] / clang / test / OpenMP / parallel_codegen.cpp
blob2a0a881b109bec2a761dc8bfafd18a21a693bd12
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 -Wno-vla -fopenmp -x c++ -emit-llvm %s -triple x86_64-unknown-linux -fexceptions -fcxx-exceptions -o - | FileCheck %s --check-prefix=CHECK1
3 // RUN: %clang_cc1 -fopenmp -x c++ -std=c++11 -triple x86_64-unknown-unknown -fexceptions -fcxx-exceptions -emit-pch -o %t %s
4 // RUN: %clang_cc1 -fopenmp -x c++ -triple x86_64-unknown-unknown -fexceptions -fcxx-exceptions -debug-info-kind=limited -std=c++11 -include-pch %t -verify -Wno-vla %s -emit-llvm -o - | FileCheck %s --check-prefix=CHECK2
5 // RUN: %clang_cc1 -verify -Wno-vla -fopenmp -fopenmp-enable-irbuilder -DIRBUILDER -x c++ -emit-llvm %s -triple x86_64-unknown-linux -fexceptions -fcxx-exceptions -o - | FileCheck %s --check-prefix=CHECK3
6 // RUN: %clang_cc1 -fopenmp -fopenmp-enable-irbuilder -DIRBUILDER -x c++ -std=c++11 -triple x86_64-unknown-unknown -fexceptions -fcxx-exceptions -emit-pch -o %t %s
7 // RUN: %clang_cc1 -fopenmp -fopenmp-enable-irbuilder -DIRBUILDER -x c++ -triple x86_64-unknown-unknown -fexceptions -fcxx-exceptions -debug-info-kind=limited -gno-column-info -std=c++11 -include-pch %t -verify -Wno-vla %s -emit-llvm -o - | FileCheck %s --check-prefix=CHECK4
9 // RUN: %clang_cc1 -verify -Wno-vla -fopenmp-simd -x c++ -emit-llvm %s -triple x86_64-unknown-linux -fexceptions -fcxx-exceptions -o - | FileCheck %s --implicit-check-not="{{__kmpc|__tgt}}"
10 // RUN: %clang_cc1 -fopenmp-simd -x c++ -std=c++11 -triple x86_64-unknown-unknown -fexceptions -fcxx-exceptions -emit-pch -o %t %s
11 // RUN: %clang_cc1 -fopenmp-simd -x c++ -triple x86_64-unknown-unknown -fexceptions -fcxx-exceptions -debug-info-kind=limited -std=c++11 -include-pch %t -verify -Wno-vla %s -emit-llvm -o - | FileCheck %s --implicit-check-not="{{__kmpc|__tgt}}"
12 // RUN: %clang_cc1 -verify -Wno-vla -fopenmp-simd -fopenmp-enable-irbuilder -x c++ -emit-llvm %s -triple x86_64-unknown-linux -fexceptions -fcxx-exceptions -o - | FileCheck %s --implicit-check-not="{{__kmpc|__tgt}}"
13 // RUN: %clang_cc1 -fopenmp-simd -fopenmp-enable-irbuilder -x c++ -std=c++11 -triple x86_64-unknown-unknown -fexceptions -fcxx-exceptions -emit-pch -o %t %s
14 // RUN: %clang_cc1 -fopenmp-simd -fopenmp-enable-irbuilder -x c++ -triple x86_64-unknown-unknown -fexceptions -fcxx-exceptions -debug-info-kind=limited -std=c++11 -include-pch %t -verify -Wno-vla %s -emit-llvm -o - | FileCheck %s --implicit-check-not="{{__kmpc|__tgt}}"
15 // expected-no-diagnostics
16 #ifndef HEADER
17 #define HEADER
20 template <class T>
21 void foo(T argc) {}
23 template <typename T>
24 int tmain(T argc) {
25 typedef double (*chunk_t)[argc[0][0]];
26 #pragma omp parallel
28 foo(argc);
29 chunk_t var;(void)var[0][0];
31 return 0;
34 int global;
35 int main (int argc, char **argv) {
36 int a[argc];
37 #pragma omp parallel shared(global, a) default(none)
38 foo(a[1]), a[1] = global;
39 #ifndef IRBUILDER
40 // TODO: Support for privates in IRBuilder.
41 #pragma omp parallel private(global, a) default(none)
42 #pragma omp parallel shared(global, a) default(none)
43 foo(a[1]), a[1] = global;
44 // FIXME: IRBuilder crashes in void llvm::OpenMPIRBuilder::finalize()
45 // Assertion `Extractor.isEligible() && "Expected OpenMP outlining to be possible!"' failed.
46 #pragma omp parallel shared(global, a) default(none)
47 #pragma omp parallel shared(global, a) default(none)
48 foo(a[1]), a[1] = global;
49 #endif // IRBUILDER
50 return tmain(argv);
64 // Note that OpenMPIRBuilder puts the trailing arguments in a different order:
65 // arguments that are wrapped into additional pointers precede the other
66 // arguments. This is expected and not problematic because both the call and the
67 // function are generated from the same place, and the function is internal.
72 #endif
73 // CHECK1-LABEL: define {{[^@]+}}@main
74 // CHECK1-SAME: (i32 noundef [[ARGC:%.*]], ptr noundef [[ARGV:%.*]]) #[[ATTR0:[0-9]+]] {
75 // CHECK1-NEXT: entry:
76 // CHECK1-NEXT: [[RETVAL:%.*]] = alloca i32, align 4
77 // CHECK1-NEXT: [[ARGC_ADDR:%.*]] = alloca i32, align 4
78 // CHECK1-NEXT: [[ARGV_ADDR:%.*]] = alloca ptr, align 8
79 // CHECK1-NEXT: [[SAVED_STACK:%.*]] = alloca ptr, align 8
80 // CHECK1-NEXT: [[__VLA_EXPR0:%.*]] = alloca i64, align 8
81 // CHECK1-NEXT: store i32 0, ptr [[RETVAL]], align 4
82 // CHECK1-NEXT: store i32 [[ARGC]], ptr [[ARGC_ADDR]], align 4
83 // CHECK1-NEXT: store ptr [[ARGV]], ptr [[ARGV_ADDR]], align 8
84 // CHECK1-NEXT: [[TMP0:%.*]] = load i32, ptr [[ARGC_ADDR]], align 4
85 // CHECK1-NEXT: [[TMP1:%.*]] = zext i32 [[TMP0]] to i64
86 // CHECK1-NEXT: [[TMP2:%.*]] = call ptr @llvm.stacksave.p0()
87 // CHECK1-NEXT: store ptr [[TMP2]], ptr [[SAVED_STACK]], align 8
88 // CHECK1-NEXT: [[VLA:%.*]] = alloca i32, i64 [[TMP1]], align 16
89 // CHECK1-NEXT: store i64 [[TMP1]], ptr [[__VLA_EXPR0]], align 8
90 // CHECK1-NEXT: call void (ptr, i32, ptr, ...) @__kmpc_fork_call(ptr @[[GLOB1:[0-9]+]], i32 2, ptr @main.omp_outlined, i64 [[TMP1]], ptr [[VLA]])
91 // CHECK1-NEXT: call void (ptr, i32, ptr, ...) @__kmpc_fork_call(ptr @[[GLOB1]], i32 1, ptr @main.omp_outlined.1, i64 [[TMP1]])
92 // CHECK1-NEXT: call void (ptr, i32, ptr, ...) @__kmpc_fork_call(ptr @[[GLOB1]], i32 2, ptr @main.omp_outlined.2, i64 [[TMP1]], ptr [[VLA]])
93 // CHECK1-NEXT: [[TMP3:%.*]] = load ptr, ptr [[ARGV_ADDR]], align 8
94 // CHECK1-NEXT: [[CALL:%.*]] = call noundef i32 @_Z5tmainIPPcEiT_(ptr noundef [[TMP3]])
95 // CHECK1-NEXT: store i32 [[CALL]], ptr [[RETVAL]], align 4
96 // CHECK1-NEXT: [[TMP4:%.*]] = load ptr, ptr [[SAVED_STACK]], align 8
97 // CHECK1-NEXT: call void @llvm.stackrestore.p0(ptr [[TMP4]])
98 // CHECK1-NEXT: [[TMP5:%.*]] = load i32, ptr [[RETVAL]], align 4
99 // CHECK1-NEXT: ret i32 [[TMP5]]
102 // CHECK1-LABEL: define {{[^@]+}}@main.omp_outlined
103 // CHECK1-SAME: (ptr noalias noundef [[DOTGLOBAL_TID_:%.*]], ptr noalias noundef [[DOTBOUND_TID_:%.*]], i64 noundef [[VLA:%.*]], ptr noundef nonnull align 4 dereferenceable(4) [[A:%.*]]) #[[ATTR2:[0-9]+]] personality ptr @__gxx_personality_v0 {
104 // CHECK1-NEXT: entry:
105 // CHECK1-NEXT: [[DOTGLOBAL_TID__ADDR:%.*]] = alloca ptr, align 8
106 // CHECK1-NEXT: [[DOTBOUND_TID__ADDR:%.*]] = alloca ptr, align 8
107 // CHECK1-NEXT: [[VLA_ADDR:%.*]] = alloca i64, align 8
108 // CHECK1-NEXT: [[A_ADDR:%.*]] = alloca ptr, align 8
109 // CHECK1-NEXT: store ptr [[DOTGLOBAL_TID_]], ptr [[DOTGLOBAL_TID__ADDR]], align 8
110 // CHECK1-NEXT: store ptr [[DOTBOUND_TID_]], ptr [[DOTBOUND_TID__ADDR]], align 8
111 // CHECK1-NEXT: store i64 [[VLA]], ptr [[VLA_ADDR]], align 8
112 // CHECK1-NEXT: store ptr [[A]], ptr [[A_ADDR]], align 8
113 // CHECK1-NEXT: [[TMP0:%.*]] = load i64, ptr [[VLA_ADDR]], align 8
114 // CHECK1-NEXT: [[TMP1:%.*]] = load ptr, ptr [[A_ADDR]], align 8
115 // CHECK1-NEXT: [[ARRAYIDX:%.*]] = getelementptr inbounds i32, ptr [[TMP1]], i64 1
116 // CHECK1-NEXT: [[TMP2:%.*]] = load i32, ptr [[ARRAYIDX]], align 4
117 // CHECK1-NEXT: invoke void @_Z3fooIiEvT_(i32 noundef [[TMP2]])
118 // CHECK1-NEXT: to label [[INVOKE_CONT:%.*]] unwind label [[TERMINATE_LPAD:%.*]]
119 // CHECK1: invoke.cont:
120 // CHECK1-NEXT: [[TMP3:%.*]] = load i32, ptr @global, align 4
121 // CHECK1-NEXT: [[ARRAYIDX1:%.*]] = getelementptr inbounds i32, ptr [[TMP1]], i64 1
122 // CHECK1-NEXT: store i32 [[TMP3]], ptr [[ARRAYIDX1]], align 4
123 // CHECK1-NEXT: ret void
124 // CHECK1: terminate.lpad:
125 // CHECK1-NEXT: [[TMP4:%.*]] = landingpad { ptr, i32 }
126 // CHECK1-NEXT: catch ptr null
127 // CHECK1-NEXT: [[TMP5:%.*]] = extractvalue { ptr, i32 } [[TMP4]], 0
128 // CHECK1-NEXT: call void @__clang_call_terminate(ptr [[TMP5]]) #[[ATTR6:[0-9]+]]
129 // CHECK1-NEXT: unreachable
132 // CHECK1-LABEL: define {{[^@]+}}@_Z3fooIiEvT_
133 // CHECK1-SAME: (i32 noundef [[ARGC:%.*]]) #[[ATTR3:[0-9]+]] comdat {
134 // CHECK1-NEXT: entry:
135 // CHECK1-NEXT: [[ARGC_ADDR:%.*]] = alloca i32, align 4
136 // CHECK1-NEXT: store i32 [[ARGC]], ptr [[ARGC_ADDR]], align 4
137 // CHECK1-NEXT: ret void
140 // CHECK1-LABEL: define {{[^@]+}}@__clang_call_terminate
141 // CHECK1-SAME: (ptr noundef [[TMP0:%.*]]) #[[ATTR4:[0-9]+]] comdat {
142 // CHECK1-NEXT: [[TMP2:%.*]] = call ptr @__cxa_begin_catch(ptr [[TMP0]]) #[[ATTR5:[0-9]+]]
143 // CHECK1-NEXT: call void @_ZSt9terminatev() #[[ATTR6]]
144 // CHECK1-NEXT: unreachable
147 // CHECK1-LABEL: define {{[^@]+}}@main.omp_outlined.1
148 // CHECK1-SAME: (ptr noalias noundef [[DOTGLOBAL_TID_:%.*]], ptr noalias noundef [[DOTBOUND_TID_:%.*]], i64 noundef [[VLA:%.*]]) #[[ATTR2]] {
149 // CHECK1-NEXT: entry:
150 // CHECK1-NEXT: [[DOTGLOBAL_TID__ADDR:%.*]] = alloca ptr, align 8
151 // CHECK1-NEXT: [[DOTBOUND_TID__ADDR:%.*]] = alloca ptr, align 8
152 // CHECK1-NEXT: [[VLA_ADDR:%.*]] = alloca i64, align 8
153 // CHECK1-NEXT: [[GLOBAL:%.*]] = alloca i32, align 4
154 // CHECK1-NEXT: [[SAVED_STACK:%.*]] = alloca ptr, align 8
155 // CHECK1-NEXT: [[__VLA_EXPR0:%.*]] = alloca i64, align 8
156 // CHECK1-NEXT: store ptr [[DOTGLOBAL_TID_]], ptr [[DOTGLOBAL_TID__ADDR]], align 8
157 // CHECK1-NEXT: store ptr [[DOTBOUND_TID_]], ptr [[DOTBOUND_TID__ADDR]], align 8
158 // CHECK1-NEXT: store i64 [[VLA]], ptr [[VLA_ADDR]], align 8
159 // CHECK1-NEXT: [[TMP0:%.*]] = load i64, ptr [[VLA_ADDR]], align 8
160 // CHECK1-NEXT: [[TMP1:%.*]] = call ptr @llvm.stacksave.p0()
161 // CHECK1-NEXT: store ptr [[TMP1]], ptr [[SAVED_STACK]], align 8
162 // CHECK1-NEXT: [[VLA1:%.*]] = alloca i32, i64 [[TMP0]], align 16
163 // CHECK1-NEXT: store i64 [[TMP0]], ptr [[__VLA_EXPR0]], align 8
164 // CHECK1-NEXT: call void (ptr, i32, ptr, ...) @__kmpc_fork_call(ptr @[[GLOB1]], i32 3, ptr @main.omp_outlined.1.omp_outlined, i64 [[TMP0]], ptr [[VLA1]], ptr [[GLOBAL]])
165 // CHECK1-NEXT: [[TMP2:%.*]] = load ptr, ptr [[SAVED_STACK]], align 8
166 // CHECK1-NEXT: call void @llvm.stackrestore.p0(ptr [[TMP2]])
167 // CHECK1-NEXT: ret void
170 // CHECK1-LABEL: define {{[^@]+}}@main.omp_outlined.1.omp_outlined
171 // CHECK1-SAME: (ptr noalias noundef [[DOTGLOBAL_TID_:%.*]], ptr noalias noundef [[DOTBOUND_TID_:%.*]], i64 noundef [[VLA:%.*]], ptr noundef nonnull align 4 dereferenceable(4) [[A:%.*]], ptr noundef nonnull align 4 dereferenceable(4) [[GLOBAL:%.*]]) #[[ATTR2]] personality ptr @__gxx_personality_v0 {
172 // CHECK1-NEXT: entry:
173 // CHECK1-NEXT: [[DOTGLOBAL_TID__ADDR:%.*]] = alloca ptr, align 8
174 // CHECK1-NEXT: [[DOTBOUND_TID__ADDR:%.*]] = alloca ptr, align 8
175 // CHECK1-NEXT: [[VLA_ADDR:%.*]] = alloca i64, align 8
176 // CHECK1-NEXT: [[A_ADDR:%.*]] = alloca ptr, align 8
177 // CHECK1-NEXT: [[GLOBAL_ADDR:%.*]] = alloca ptr, align 8
178 // CHECK1-NEXT: store ptr [[DOTGLOBAL_TID_]], ptr [[DOTGLOBAL_TID__ADDR]], align 8
179 // CHECK1-NEXT: store ptr [[DOTBOUND_TID_]], ptr [[DOTBOUND_TID__ADDR]], align 8
180 // CHECK1-NEXT: store i64 [[VLA]], ptr [[VLA_ADDR]], align 8
181 // CHECK1-NEXT: store ptr [[A]], ptr [[A_ADDR]], align 8
182 // CHECK1-NEXT: store ptr [[GLOBAL]], ptr [[GLOBAL_ADDR]], align 8
183 // CHECK1-NEXT: [[TMP0:%.*]] = load i64, ptr [[VLA_ADDR]], align 8
184 // CHECK1-NEXT: [[TMP1:%.*]] = load ptr, ptr [[A_ADDR]], align 8
185 // CHECK1-NEXT: [[TMP2:%.*]] = load ptr, ptr [[GLOBAL_ADDR]], align 8
186 // CHECK1-NEXT: [[ARRAYIDX:%.*]] = getelementptr inbounds i32, ptr [[TMP1]], i64 1
187 // CHECK1-NEXT: [[TMP3:%.*]] = load i32, ptr [[ARRAYIDX]], align 4
188 // CHECK1-NEXT: invoke void @_Z3fooIiEvT_(i32 noundef [[TMP3]])
189 // CHECK1-NEXT: to label [[INVOKE_CONT:%.*]] unwind label [[TERMINATE_LPAD:%.*]]
190 // CHECK1: invoke.cont:
191 // CHECK1-NEXT: [[TMP4:%.*]] = load i32, ptr [[TMP2]], align 4
192 // CHECK1-NEXT: [[ARRAYIDX1:%.*]] = getelementptr inbounds i32, ptr [[TMP1]], i64 1
193 // CHECK1-NEXT: store i32 [[TMP4]], ptr [[ARRAYIDX1]], align 4
194 // CHECK1-NEXT: ret void
195 // CHECK1: terminate.lpad:
196 // CHECK1-NEXT: [[TMP5:%.*]] = landingpad { ptr, i32 }
197 // CHECK1-NEXT: catch ptr null
198 // CHECK1-NEXT: [[TMP6:%.*]] = extractvalue { ptr, i32 } [[TMP5]], 0
199 // CHECK1-NEXT: call void @__clang_call_terminate(ptr [[TMP6]]) #[[ATTR6]]
200 // CHECK1-NEXT: unreachable
203 // CHECK1-LABEL: define {{[^@]+}}@main.omp_outlined.2
204 // CHECK1-SAME: (ptr noalias noundef [[DOTGLOBAL_TID_:%.*]], ptr noalias noundef [[DOTBOUND_TID_:%.*]], i64 noundef [[VLA:%.*]], ptr noundef nonnull align 4 dereferenceable(4) [[A:%.*]]) #[[ATTR2]] {
205 // CHECK1-NEXT: entry:
206 // CHECK1-NEXT: [[DOTGLOBAL_TID__ADDR:%.*]] = alloca ptr, align 8
207 // CHECK1-NEXT: [[DOTBOUND_TID__ADDR:%.*]] = alloca ptr, align 8
208 // CHECK1-NEXT: [[VLA_ADDR:%.*]] = alloca i64, align 8
209 // CHECK1-NEXT: [[A_ADDR:%.*]] = alloca ptr, align 8
210 // CHECK1-NEXT: store ptr [[DOTGLOBAL_TID_]], ptr [[DOTGLOBAL_TID__ADDR]], align 8
211 // CHECK1-NEXT: store ptr [[DOTBOUND_TID_]], ptr [[DOTBOUND_TID__ADDR]], align 8
212 // CHECK1-NEXT: store i64 [[VLA]], ptr [[VLA_ADDR]], align 8
213 // CHECK1-NEXT: store ptr [[A]], ptr [[A_ADDR]], align 8
214 // CHECK1-NEXT: [[TMP0:%.*]] = load i64, ptr [[VLA_ADDR]], align 8
215 // CHECK1-NEXT: [[TMP1:%.*]] = load ptr, ptr [[A_ADDR]], align 8
216 // CHECK1-NEXT: call void (ptr, i32, ptr, ...) @__kmpc_fork_call(ptr @[[GLOB1]], i32 2, ptr @main.omp_outlined.2.omp_outlined, i64 [[TMP0]], ptr [[TMP1]])
217 // CHECK1-NEXT: ret void
220 // CHECK1-LABEL: define {{[^@]+}}@main.omp_outlined.2.omp_outlined
221 // CHECK1-SAME: (ptr noalias noundef [[DOTGLOBAL_TID_:%.*]], ptr noalias noundef [[DOTBOUND_TID_:%.*]], i64 noundef [[VLA:%.*]], ptr noundef nonnull align 4 dereferenceable(4) [[A:%.*]]) #[[ATTR2]] personality ptr @__gxx_personality_v0 {
222 // CHECK1-NEXT: entry:
223 // CHECK1-NEXT: [[DOTGLOBAL_TID__ADDR:%.*]] = alloca ptr, align 8
224 // CHECK1-NEXT: [[DOTBOUND_TID__ADDR:%.*]] = alloca ptr, align 8
225 // CHECK1-NEXT: [[VLA_ADDR:%.*]] = alloca i64, align 8
226 // CHECK1-NEXT: [[A_ADDR:%.*]] = alloca ptr, align 8
227 // CHECK1-NEXT: store ptr [[DOTGLOBAL_TID_]], ptr [[DOTGLOBAL_TID__ADDR]], align 8
228 // CHECK1-NEXT: store ptr [[DOTBOUND_TID_]], ptr [[DOTBOUND_TID__ADDR]], align 8
229 // CHECK1-NEXT: store i64 [[VLA]], ptr [[VLA_ADDR]], align 8
230 // CHECK1-NEXT: store ptr [[A]], ptr [[A_ADDR]], align 8
231 // CHECK1-NEXT: [[TMP0:%.*]] = load i64, ptr [[VLA_ADDR]], align 8
232 // CHECK1-NEXT: [[TMP1:%.*]] = load ptr, ptr [[A_ADDR]], align 8
233 // CHECK1-NEXT: [[ARRAYIDX:%.*]] = getelementptr inbounds i32, ptr [[TMP1]], i64 1
234 // CHECK1-NEXT: [[TMP2:%.*]] = load i32, ptr [[ARRAYIDX]], align 4
235 // CHECK1-NEXT: invoke void @_Z3fooIiEvT_(i32 noundef [[TMP2]])
236 // CHECK1-NEXT: to label [[INVOKE_CONT:%.*]] unwind label [[TERMINATE_LPAD:%.*]]
237 // CHECK1: invoke.cont:
238 // CHECK1-NEXT: [[TMP3:%.*]] = load i32, ptr @global, align 4
239 // CHECK1-NEXT: [[ARRAYIDX1:%.*]] = getelementptr inbounds i32, ptr [[TMP1]], i64 1
240 // CHECK1-NEXT: store i32 [[TMP3]], ptr [[ARRAYIDX1]], align 4
241 // CHECK1-NEXT: ret void
242 // CHECK1: terminate.lpad:
243 // CHECK1-NEXT: [[TMP4:%.*]] = landingpad { ptr, i32 }
244 // CHECK1-NEXT: catch ptr null
245 // CHECK1-NEXT: [[TMP5:%.*]] = extractvalue { ptr, i32 } [[TMP4]], 0
246 // CHECK1-NEXT: call void @__clang_call_terminate(ptr [[TMP5]]) #[[ATTR6]]
247 // CHECK1-NEXT: unreachable
250 // CHECK1-LABEL: define {{[^@]+}}@_Z5tmainIPPcEiT_
251 // CHECK1-SAME: (ptr noundef [[ARGC:%.*]]) #[[ATTR3]] comdat {
252 // CHECK1-NEXT: entry:
253 // CHECK1-NEXT: [[ARGC_ADDR:%.*]] = alloca ptr, align 8
254 // CHECK1-NEXT: store ptr [[ARGC]], ptr [[ARGC_ADDR]], align 8
255 // CHECK1-NEXT: [[TMP0:%.*]] = load ptr, ptr [[ARGC_ADDR]], align 8
256 // CHECK1-NEXT: [[ARRAYIDX:%.*]] = getelementptr inbounds ptr, ptr [[TMP0]], i64 0
257 // CHECK1-NEXT: [[TMP1:%.*]] = load ptr, ptr [[ARRAYIDX]], align 8
258 // CHECK1-NEXT: [[ARRAYIDX1:%.*]] = getelementptr inbounds i8, ptr [[TMP1]], i64 0
259 // CHECK1-NEXT: [[TMP2:%.*]] = load i8, ptr [[ARRAYIDX1]], align 1
260 // CHECK1-NEXT: [[TMP3:%.*]] = zext i8 [[TMP2]] to i64
261 // CHECK1-NEXT: call void (ptr, i32, ptr, ...) @__kmpc_fork_call(ptr @[[GLOB1]], i32 2, ptr @_Z5tmainIPPcEiT_.omp_outlined, ptr [[ARGC_ADDR]], i64 [[TMP3]])
262 // CHECK1-NEXT: ret i32 0
265 // CHECK1-LABEL: define {{[^@]+}}@_Z5tmainIPPcEiT_.omp_outlined
266 // CHECK1-SAME: (ptr noalias noundef [[DOTGLOBAL_TID_:%.*]], ptr noalias noundef [[DOTBOUND_TID_:%.*]], ptr noundef nonnull align 8 dereferenceable(8) [[ARGC:%.*]], i64 noundef [[VLA:%.*]]) #[[ATTR2]] personality ptr @__gxx_personality_v0 {
267 // CHECK1-NEXT: entry:
268 // CHECK1-NEXT: [[DOTGLOBAL_TID__ADDR:%.*]] = alloca ptr, align 8
269 // CHECK1-NEXT: [[DOTBOUND_TID__ADDR:%.*]] = alloca ptr, align 8
270 // CHECK1-NEXT: [[ARGC_ADDR:%.*]] = alloca ptr, align 8
271 // CHECK1-NEXT: [[VLA_ADDR:%.*]] = alloca i64, align 8
272 // CHECK1-NEXT: [[VAR:%.*]] = alloca ptr, align 8
273 // CHECK1-NEXT: store ptr [[DOTGLOBAL_TID_]], ptr [[DOTGLOBAL_TID__ADDR]], align 8
274 // CHECK1-NEXT: store ptr [[DOTBOUND_TID_]], ptr [[DOTBOUND_TID__ADDR]], align 8
275 // CHECK1-NEXT: store ptr [[ARGC]], ptr [[ARGC_ADDR]], align 8
276 // CHECK1-NEXT: store i64 [[VLA]], ptr [[VLA_ADDR]], align 8
277 // CHECK1-NEXT: [[TMP0:%.*]] = load ptr, ptr [[ARGC_ADDR]], align 8
278 // CHECK1-NEXT: [[TMP1:%.*]] = load i64, ptr [[VLA_ADDR]], align 8
279 // CHECK1-NEXT: [[TMP2:%.*]] = load ptr, ptr [[TMP0]], align 8
280 // CHECK1-NEXT: invoke void @_Z3fooIPPcEvT_(ptr noundef [[TMP2]])
281 // CHECK1-NEXT: to label [[INVOKE_CONT:%.*]] unwind label [[TERMINATE_LPAD:%.*]]
282 // CHECK1: invoke.cont:
283 // CHECK1-NEXT: [[TMP3:%.*]] = load ptr, ptr [[VAR]], align 8
284 // CHECK1-NEXT: [[TMP4:%.*]] = mul nsw i64 0, [[TMP1]]
285 // CHECK1-NEXT: [[ARRAYIDX:%.*]] = getelementptr inbounds double, ptr [[TMP3]], i64 [[TMP4]]
286 // CHECK1-NEXT: [[ARRAYIDX1:%.*]] = getelementptr inbounds double, ptr [[ARRAYIDX]], i64 0
287 // CHECK1-NEXT: ret void
288 // CHECK1: terminate.lpad:
289 // CHECK1-NEXT: [[TMP5:%.*]] = landingpad { ptr, i32 }
290 // CHECK1-NEXT: catch ptr null
291 // CHECK1-NEXT: [[TMP6:%.*]] = extractvalue { ptr, i32 } [[TMP5]], 0
292 // CHECK1-NEXT: call void @__clang_call_terminate(ptr [[TMP6]]) #[[ATTR6]]
293 // CHECK1-NEXT: unreachable
296 // CHECK1-LABEL: define {{[^@]+}}@_Z3fooIPPcEvT_
297 // CHECK1-SAME: (ptr noundef [[ARGC:%.*]]) #[[ATTR3]] comdat {
298 // CHECK1-NEXT: entry:
299 // CHECK1-NEXT: [[ARGC_ADDR:%.*]] = alloca ptr, align 8
300 // CHECK1-NEXT: store ptr [[ARGC]], ptr [[ARGC_ADDR]], align 8
301 // CHECK1-NEXT: ret void
304 // CHECK2-LABEL: define {{[^@]+}}@main
305 // CHECK2-SAME: (i32 noundef [[ARGC:%.*]], ptr noundef [[ARGV:%.*]]) #[[ATTR0:[0-9]+]] !dbg [[DBG11:![0-9]+]] {
306 // CHECK2-NEXT: entry:
307 // CHECK2-NEXT: [[RETVAL:%.*]] = alloca i32, align 4
308 // CHECK2-NEXT: [[ARGC_ADDR:%.*]] = alloca i32, align 4
309 // CHECK2-NEXT: [[ARGV_ADDR:%.*]] = alloca ptr, align 8
310 // CHECK2-NEXT: [[SAVED_STACK:%.*]] = alloca ptr, align 8
311 // CHECK2-NEXT: [[__VLA_EXPR0:%.*]] = alloca i64, align 8
312 // CHECK2-NEXT: store i32 0, ptr [[RETVAL]], align 4
313 // CHECK2-NEXT: store i32 [[ARGC]], ptr [[ARGC_ADDR]], align 4
314 // CHECK2-NEXT: #dbg_declare(ptr [[ARGC_ADDR]], [[META18:![0-9]+]], !DIExpression(), [[META19:![0-9]+]])
315 // CHECK2-NEXT: store ptr [[ARGV]], ptr [[ARGV_ADDR]], align 8
316 // CHECK2-NEXT: #dbg_declare(ptr [[ARGV_ADDR]], [[META20:![0-9]+]], !DIExpression(), [[META21:![0-9]+]])
317 // CHECK2-NEXT: [[TMP0:%.*]] = load i32, ptr [[ARGC_ADDR]], align 4, !dbg [[DBG22:![0-9]+]]
318 // CHECK2-NEXT: [[TMP1:%.*]] = zext i32 [[TMP0]] to i64, !dbg [[DBG23:![0-9]+]]
319 // CHECK2-NEXT: [[TMP2:%.*]] = call ptr @llvm.stacksave.p0(), !dbg [[DBG23]]
320 // CHECK2-NEXT: store ptr [[TMP2]], ptr [[SAVED_STACK]], align 8, !dbg [[DBG23]]
321 // CHECK2-NEXT: [[VLA:%.*]] = alloca i32, i64 [[TMP1]], align 16, !dbg [[DBG23]]
322 // CHECK2-NEXT: store i64 [[TMP1]], ptr [[__VLA_EXPR0]], align 8, !dbg [[DBG23]]
323 // CHECK2-NEXT: #dbg_declare(ptr [[__VLA_EXPR0]], [[META24:![0-9]+]], !DIExpression(), [[META26:![0-9]+]])
324 // CHECK2-NEXT: #dbg_declare(ptr [[VLA]], [[META27:![0-9]+]], !DIExpression(), [[META31:![0-9]+]])
325 // CHECK2-NEXT: call void (ptr, i32, ptr, ...) @__kmpc_fork_call(ptr @[[GLOB1:[0-9]+]], i32 2, ptr @main.omp_outlined, i64 [[TMP1]], ptr [[VLA]]), !dbg [[DBG32:![0-9]+]]
326 // CHECK2-NEXT: call void (ptr, i32, ptr, ...) @__kmpc_fork_call(ptr @[[GLOB5:[0-9]+]], i32 1, ptr @main.omp_outlined.1, i64 [[TMP1]]), !dbg [[DBG33:![0-9]+]]
327 // CHECK2-NEXT: call void (ptr, i32, ptr, ...) @__kmpc_fork_call(ptr @[[GLOB9:[0-9]+]], i32 2, ptr @main.omp_outlined.3, i64 [[TMP1]], ptr [[VLA]]), !dbg [[DBG34:![0-9]+]]
328 // CHECK2-NEXT: [[TMP3:%.*]] = load ptr, ptr [[ARGV_ADDR]], align 8, !dbg [[DBG35:![0-9]+]]
329 // CHECK2-NEXT: [[CALL:%.*]] = call noundef i32 @_Z5tmainIPPcEiT_(ptr noundef [[TMP3]]), !dbg [[DBG36:![0-9]+]]
330 // CHECK2-NEXT: store i32 [[CALL]], ptr [[RETVAL]], align 4, !dbg [[DBG37:![0-9]+]]
331 // CHECK2-NEXT: [[TMP4:%.*]] = load ptr, ptr [[SAVED_STACK]], align 8, !dbg [[DBG38:![0-9]+]]
332 // CHECK2-NEXT: call void @llvm.stackrestore.p0(ptr [[TMP4]]), !dbg [[DBG38]]
333 // CHECK2-NEXT: [[TMP5:%.*]] = load i32, ptr [[RETVAL]], align 4, !dbg [[DBG38]]
334 // CHECK2-NEXT: ret i32 [[TMP5]], !dbg [[DBG38]]
337 // CHECK2-LABEL: define {{[^@]+}}@main.omp_outlined_debug__
338 // CHECK2-SAME: (ptr noalias noundef [[DOTGLOBAL_TID_:%.*]], ptr noalias noundef [[DOTBOUND_TID_:%.*]], i64 noundef [[VLA:%.*]], ptr noundef nonnull align 4 dereferenceable(4) [[A:%.*]]) #[[ATTR2:[0-9]+]] personality ptr @__gxx_personality_v0 !dbg [[DBG39:![0-9]+]] {
339 // CHECK2-NEXT: entry:
340 // CHECK2-NEXT: [[DOTGLOBAL_TID__ADDR:%.*]] = alloca ptr, align 8
341 // CHECK2-NEXT: [[DOTBOUND_TID__ADDR:%.*]] = alloca ptr, align 8
342 // CHECK2-NEXT: [[VLA_ADDR:%.*]] = alloca i64, align 8
343 // CHECK2-NEXT: [[A_ADDR:%.*]] = alloca ptr, align 8
344 // CHECK2-NEXT: store ptr [[DOTGLOBAL_TID_]], ptr [[DOTGLOBAL_TID__ADDR]], align 8
345 // CHECK2-NEXT: #dbg_declare(ptr [[DOTGLOBAL_TID__ADDR]], [[META47:![0-9]+]], !DIExpression(), [[META48:![0-9]+]])
346 // CHECK2-NEXT: store ptr [[DOTBOUND_TID_]], ptr [[DOTBOUND_TID__ADDR]], align 8
347 // CHECK2-NEXT: #dbg_declare(ptr [[DOTBOUND_TID__ADDR]], [[META49:![0-9]+]], !DIExpression(), [[META48]])
348 // CHECK2-NEXT: store i64 [[VLA]], ptr [[VLA_ADDR]], align 8
349 // CHECK2-NEXT: #dbg_declare(ptr [[VLA_ADDR]], [[META50:![0-9]+]], !DIExpression(), [[META48]])
350 // CHECK2-NEXT: store ptr [[A]], ptr [[A_ADDR]], align 8
351 // CHECK2-NEXT: #dbg_declare(ptr [[A_ADDR]], [[META51:![0-9]+]], !DIExpression(), [[META52:![0-9]+]])
352 // CHECK2-NEXT: [[TMP0:%.*]] = load i64, ptr [[VLA_ADDR]], align 8, !dbg [[DBG53:![0-9]+]]
353 // CHECK2-NEXT: [[TMP1:%.*]] = load ptr, ptr [[A_ADDR]], align 8, !dbg [[DBG53]]
354 // CHECK2-NEXT: [[ARRAYIDX:%.*]] = getelementptr inbounds i32, ptr [[TMP1]], i64 1, !dbg [[DBG54:![0-9]+]]
355 // CHECK2-NEXT: [[TMP2:%.*]] = load i32, ptr [[ARRAYIDX]], align 4, !dbg [[DBG54]]
356 // CHECK2-NEXT: invoke void @_Z3fooIiEvT_(i32 noundef [[TMP2]])
357 // CHECK2-NEXT: to label [[INVOKE_CONT:%.*]] unwind label [[TERMINATE_LPAD:%.*]], !dbg [[DBG53]]
358 // CHECK2: invoke.cont:
359 // CHECK2-NEXT: [[TMP3:%.*]] = load i32, ptr @global, align 4, !dbg [[DBG55:![0-9]+]]
360 // CHECK2-NEXT: [[ARRAYIDX1:%.*]] = getelementptr inbounds i32, ptr [[TMP1]], i64 1, !dbg [[DBG56:![0-9]+]]
361 // CHECK2-NEXT: store i32 [[TMP3]], ptr [[ARRAYIDX1]], align 4, !dbg [[DBG57:![0-9]+]]
362 // CHECK2-NEXT: ret void, !dbg [[DBG55]]
363 // CHECK2: terminate.lpad:
364 // CHECK2-NEXT: [[TMP4:%.*]] = landingpad { ptr, i32 }
365 // CHECK2-NEXT: catch ptr null, !dbg [[DBG53]]
366 // CHECK2-NEXT: [[TMP5:%.*]] = extractvalue { ptr, i32 } [[TMP4]], 0, !dbg [[DBG53]]
367 // CHECK2-NEXT: call void @__clang_call_terminate(ptr [[TMP5]]) #[[ATTR6:[0-9]+]], !dbg [[DBG53]]
368 // CHECK2-NEXT: unreachable, !dbg [[DBG53]]
371 // CHECK2-LABEL: define {{[^@]+}}@main.omp_outlined
372 // CHECK2-SAME: (ptr noalias noundef [[DOTGLOBAL_TID_:%.*]], ptr noalias noundef [[DOTBOUND_TID_:%.*]], i64 noundef [[VLA:%.*]], ptr noundef nonnull align 4 dereferenceable(4) [[A:%.*]]) #[[ATTR2]] !dbg [[DBG58:![0-9]+]] {
373 // CHECK2-NEXT: entry:
374 // CHECK2-NEXT: [[DOTGLOBAL_TID__ADDR:%.*]] = alloca ptr, align 8
375 // CHECK2-NEXT: [[DOTBOUND_TID__ADDR:%.*]] = alloca ptr, align 8
376 // CHECK2-NEXT: [[VLA_ADDR:%.*]] = alloca i64, align 8
377 // CHECK2-NEXT: [[A_ADDR:%.*]] = alloca ptr, align 8
378 // CHECK2-NEXT: store ptr [[DOTGLOBAL_TID_]], ptr [[DOTGLOBAL_TID__ADDR]], align 8
379 // CHECK2-NEXT: #dbg_declare(ptr [[DOTGLOBAL_TID__ADDR]], [[META59:![0-9]+]], !DIExpression(), [[META60:![0-9]+]])
380 // CHECK2-NEXT: store ptr [[DOTBOUND_TID_]], ptr [[DOTBOUND_TID__ADDR]], align 8
381 // CHECK2-NEXT: #dbg_declare(ptr [[DOTBOUND_TID__ADDR]], [[META61:![0-9]+]], !DIExpression(), [[META60]])
382 // CHECK2-NEXT: store i64 [[VLA]], ptr [[VLA_ADDR]], align 8
383 // CHECK2-NEXT: #dbg_declare(ptr [[VLA_ADDR]], [[META62:![0-9]+]], !DIExpression(), [[META60]])
384 // CHECK2-NEXT: store ptr [[A]], ptr [[A_ADDR]], align 8
385 // CHECK2-NEXT: #dbg_declare(ptr [[A_ADDR]], [[META63:![0-9]+]], !DIExpression(), [[META60]])
386 // CHECK2-NEXT: [[TMP0:%.*]] = load i64, ptr [[VLA_ADDR]], align 8, !dbg [[DBG64:![0-9]+]]
387 // CHECK2-NEXT: [[TMP1:%.*]] = load ptr, ptr [[A_ADDR]], align 8, !dbg [[DBG64]]
388 // CHECK2-NEXT: [[TMP2:%.*]] = load ptr, ptr [[DOTGLOBAL_TID__ADDR]], align 8, !dbg [[DBG64]]
389 // CHECK2-NEXT: [[TMP3:%.*]] = load ptr, ptr [[DOTBOUND_TID__ADDR]], align 8, !dbg [[DBG64]]
390 // CHECK2-NEXT: [[TMP4:%.*]] = load ptr, ptr [[A_ADDR]], align 8, !dbg [[DBG64]]
391 // CHECK2-NEXT: call void @main.omp_outlined_debug__(ptr [[TMP2]], ptr [[TMP3]], i64 [[TMP0]], ptr [[TMP4]]) #[[ATTR5:[0-9]+]], !dbg [[DBG64]]
392 // CHECK2-NEXT: ret void, !dbg [[DBG64]]
395 // CHECK2-LABEL: define {{[^@]+}}@_Z3fooIiEvT_
396 // CHECK2-SAME: (i32 noundef [[ARGC:%.*]]) #[[ATTR3:[0-9]+]] comdat !dbg [[DBG65:![0-9]+]] {
397 // CHECK2-NEXT: entry:
398 // CHECK2-NEXT: [[ARGC_ADDR:%.*]] = alloca i32, align 4
399 // CHECK2-NEXT: store i32 [[ARGC]], ptr [[ARGC_ADDR]], align 4
400 // CHECK2-NEXT: #dbg_declare(ptr [[ARGC_ADDR]], [[META70:![0-9]+]], !DIExpression(), [[META71:![0-9]+]])
401 // CHECK2-NEXT: ret void, !dbg [[DBG72:![0-9]+]]
404 // CHECK2-LABEL: define {{[^@]+}}@__clang_call_terminate
405 // CHECK2-SAME: (ptr noundef [[TMP0:%.*]]) #[[ATTR4:[0-9]+]] comdat {
406 // CHECK2-NEXT: [[TMP2:%.*]] = call ptr @__cxa_begin_catch(ptr [[TMP0]]) #[[ATTR5]]
407 // CHECK2-NEXT: call void @_ZSt9terminatev() #[[ATTR6]]
408 // CHECK2-NEXT: unreachable
411 // CHECK2-LABEL: define {{[^@]+}}@main.omp_outlined_debug__.2
412 // CHECK2-SAME: (ptr noalias noundef [[DOTGLOBAL_TID_:%.*]], ptr noalias noundef [[DOTBOUND_TID_:%.*]], i64 noundef [[VLA:%.*]]) #[[ATTR2]] !dbg [[DBG75:![0-9]+]] {
413 // CHECK2-NEXT: entry:
414 // CHECK2-NEXT: [[DOTGLOBAL_TID__ADDR:%.*]] = alloca ptr, align 8
415 // CHECK2-NEXT: [[DOTBOUND_TID__ADDR:%.*]] = alloca ptr, align 8
416 // CHECK2-NEXT: [[VLA_ADDR:%.*]] = alloca i64, align 8
417 // CHECK2-NEXT: [[GLOBAL:%.*]] = alloca i32, align 4
418 // CHECK2-NEXT: [[SAVED_STACK:%.*]] = alloca ptr, align 8
419 // CHECK2-NEXT: [[__VLA_EXPR0:%.*]] = alloca i64, align 8
420 // CHECK2-NEXT: store ptr [[DOTGLOBAL_TID_]], ptr [[DOTGLOBAL_TID__ADDR]], align 8
421 // CHECK2-NEXT: #dbg_declare(ptr [[DOTGLOBAL_TID__ADDR]], [[META78:![0-9]+]], !DIExpression(), [[META79:![0-9]+]])
422 // CHECK2-NEXT: store ptr [[DOTBOUND_TID_]], ptr [[DOTBOUND_TID__ADDR]], align 8
423 // CHECK2-NEXT: #dbg_declare(ptr [[DOTBOUND_TID__ADDR]], [[META80:![0-9]+]], !DIExpression(), [[META79]])
424 // CHECK2-NEXT: store i64 [[VLA]], ptr [[VLA_ADDR]], align 8
425 // CHECK2-NEXT: #dbg_declare(ptr [[VLA_ADDR]], [[META81:![0-9]+]], !DIExpression(), [[META79]])
426 // CHECK2-NEXT: [[TMP0:%.*]] = load i64, ptr [[VLA_ADDR]], align 8, !dbg [[DBG82:![0-9]+]]
427 // CHECK2-NEXT: #dbg_declare(ptr [[GLOBAL]], [[META83:![0-9]+]], !DIExpression(), [[META79]])
428 // CHECK2-NEXT: [[TMP1:%.*]] = call ptr @llvm.stacksave.p0(), !dbg [[DBG82]]
429 // CHECK2-NEXT: store ptr [[TMP1]], ptr [[SAVED_STACK]], align 8, !dbg [[DBG82]]
430 // CHECK2-NEXT: [[VLA1:%.*]] = alloca i32, i64 [[TMP0]], align 16, !dbg [[DBG82]]
431 // CHECK2-NEXT: store i64 [[TMP0]], ptr [[__VLA_EXPR0]], align 8, !dbg [[DBG82]]
432 // CHECK2-NEXT: #dbg_declare(ptr [[__VLA_EXPR0]], [[META84:![0-9]+]], !DIExpression(), [[META79]])
433 // CHECK2-NEXT: #dbg_declare(ptr [[VLA1]], [[META85:![0-9]+]], !DIExpression(), [[META79]])
434 // CHECK2-NEXT: call void (ptr, i32, ptr, ...) @__kmpc_fork_call(ptr @[[GLOB3:[0-9]+]], i32 3, ptr @main.omp_outlined_debug__.2.omp_outlined, i64 [[TMP0]], ptr [[VLA1]], ptr [[GLOBAL]]), !dbg [[DBG82]]
435 // CHECK2-NEXT: [[TMP2:%.*]] = load ptr, ptr [[SAVED_STACK]], align 8, !dbg [[DBG86:![0-9]+]]
436 // CHECK2-NEXT: call void @llvm.stackrestore.p0(ptr [[TMP2]]), !dbg [[DBG86]]
437 // CHECK2-NEXT: ret void, !dbg [[DBG88:![0-9]+]]
440 // CHECK2-LABEL: define {{[^@]+}}@main.omp_outlined.1
441 // CHECK2-SAME: (ptr noalias noundef [[DOTGLOBAL_TID_:%.*]], ptr noalias noundef [[DOTBOUND_TID_:%.*]], i64 noundef [[VLA:%.*]]) #[[ATTR2]] !dbg [[DBG89:![0-9]+]] {
442 // CHECK2-NEXT: entry:
443 // CHECK2-NEXT: [[DOTGLOBAL_TID__ADDR:%.*]] = alloca ptr, align 8
444 // CHECK2-NEXT: [[DOTBOUND_TID__ADDR:%.*]] = alloca ptr, align 8
445 // CHECK2-NEXT: [[VLA_ADDR:%.*]] = alloca i64, align 8
446 // CHECK2-NEXT: store ptr [[DOTGLOBAL_TID_]], ptr [[DOTGLOBAL_TID__ADDR]], align 8
447 // CHECK2-NEXT: #dbg_declare(ptr [[DOTGLOBAL_TID__ADDR]], [[META90:![0-9]+]], !DIExpression(), [[META91:![0-9]+]])
448 // CHECK2-NEXT: store ptr [[DOTBOUND_TID_]], ptr [[DOTBOUND_TID__ADDR]], align 8
449 // CHECK2-NEXT: #dbg_declare(ptr [[DOTBOUND_TID__ADDR]], [[META92:![0-9]+]], !DIExpression(), [[META91]])
450 // CHECK2-NEXT: store i64 [[VLA]], ptr [[VLA_ADDR]], align 8
451 // CHECK2-NEXT: #dbg_declare(ptr [[VLA_ADDR]], [[META93:![0-9]+]], !DIExpression(), [[META91]])
452 // CHECK2-NEXT: [[TMP0:%.*]] = load i64, ptr [[VLA_ADDR]], align 8, !dbg [[DBG94:![0-9]+]]
453 // CHECK2-NEXT: [[TMP1:%.*]] = load ptr, ptr [[DOTGLOBAL_TID__ADDR]], align 8, !dbg [[DBG94]]
454 // CHECK2-NEXT: [[TMP2:%.*]] = load ptr, ptr [[DOTBOUND_TID__ADDR]], align 8, !dbg [[DBG94]]
455 // CHECK2-NEXT: call void @main.omp_outlined_debug__.2(ptr [[TMP1]], ptr [[TMP2]], i64 [[TMP0]]) #[[ATTR5]], !dbg [[DBG94]]
456 // CHECK2-NEXT: ret void, !dbg [[DBG94]]
459 // CHECK2-LABEL: define {{[^@]+}}@main.omp_outlined_debug__.2.omp_outlined_debug__
460 // CHECK2-SAME: (ptr noalias noundef [[DOTGLOBAL_TID_:%.*]], ptr noalias noundef [[DOTBOUND_TID_:%.*]], i64 noundef [[VLA:%.*]], ptr noundef nonnull align 4 dereferenceable(4) [[A:%.*]], ptr noundef nonnull align 4 dereferenceable(4) [[GLOBAL:%.*]]) #[[ATTR2]] personality ptr @__gxx_personality_v0 !dbg [[DBG95:![0-9]+]] {
461 // CHECK2-NEXT: entry:
462 // CHECK2-NEXT: [[DOTGLOBAL_TID__ADDR:%.*]] = alloca ptr, align 8
463 // CHECK2-NEXT: [[DOTBOUND_TID__ADDR:%.*]] = alloca ptr, align 8
464 // CHECK2-NEXT: [[VLA_ADDR:%.*]] = alloca i64, align 8
465 // CHECK2-NEXT: [[A_ADDR:%.*]] = alloca ptr, align 8
466 // CHECK2-NEXT: [[GLOBAL_ADDR:%.*]] = alloca ptr, align 8
467 // CHECK2-NEXT: store ptr [[DOTGLOBAL_TID_]], ptr [[DOTGLOBAL_TID__ADDR]], align 8
468 // CHECK2-NEXT: #dbg_declare(ptr [[DOTGLOBAL_TID__ADDR]], [[META98:![0-9]+]], !DIExpression(), [[META99:![0-9]+]])
469 // CHECK2-NEXT: store ptr [[DOTBOUND_TID_]], ptr [[DOTBOUND_TID__ADDR]], align 8
470 // CHECK2-NEXT: #dbg_declare(ptr [[DOTBOUND_TID__ADDR]], [[META100:![0-9]+]], !DIExpression(), [[META99]])
471 // CHECK2-NEXT: store i64 [[VLA]], ptr [[VLA_ADDR]], align 8
472 // CHECK2-NEXT: #dbg_declare(ptr [[VLA_ADDR]], [[META101:![0-9]+]], !DIExpression(), [[META99]])
473 // CHECK2-NEXT: store ptr [[A]], ptr [[A_ADDR]], align 8
474 // CHECK2-NEXT: #dbg_declare(ptr [[A_ADDR]], [[META102:![0-9]+]], !DIExpression(), [[META103:![0-9]+]])
475 // CHECK2-NEXT: store ptr [[GLOBAL]], ptr [[GLOBAL_ADDR]], align 8
476 // CHECK2-NEXT: #dbg_declare(ptr [[GLOBAL_ADDR]], [[META104:![0-9]+]], !DIExpression(), [[META105:![0-9]+]])
477 // CHECK2-NEXT: [[TMP0:%.*]] = load i64, ptr [[VLA_ADDR]], align 8, !dbg [[DBG106:![0-9]+]]
478 // CHECK2-NEXT: [[TMP1:%.*]] = load ptr, ptr [[A_ADDR]], align 8, !dbg [[DBG106]]
479 // CHECK2-NEXT: [[TMP2:%.*]] = load ptr, ptr [[GLOBAL_ADDR]], align 8, !dbg [[DBG106]]
480 // CHECK2-NEXT: [[ARRAYIDX:%.*]] = getelementptr inbounds i32, ptr [[TMP1]], i64 1, !dbg [[DBG107:![0-9]+]]
481 // CHECK2-NEXT: [[TMP3:%.*]] = load i32, ptr [[ARRAYIDX]], align 4, !dbg [[DBG107]]
482 // CHECK2-NEXT: invoke void @_Z3fooIiEvT_(i32 noundef [[TMP3]])
483 // CHECK2-NEXT: to label [[INVOKE_CONT:%.*]] unwind label [[TERMINATE_LPAD:%.*]], !dbg [[DBG106]]
484 // CHECK2: invoke.cont:
485 // CHECK2-NEXT: [[TMP4:%.*]] = load i32, ptr [[TMP2]], align 4, !dbg [[DBG108:![0-9]+]]
486 // CHECK2-NEXT: [[ARRAYIDX1:%.*]] = getelementptr inbounds i32, ptr [[TMP1]], i64 1, !dbg [[DBG109:![0-9]+]]
487 // CHECK2-NEXT: store i32 [[TMP4]], ptr [[ARRAYIDX1]], align 4, !dbg [[DBG110:![0-9]+]]
488 // CHECK2-NEXT: ret void, !dbg [[DBG108]]
489 // CHECK2: terminate.lpad:
490 // CHECK2-NEXT: [[TMP5:%.*]] = landingpad { ptr, i32 }
491 // CHECK2-NEXT: catch ptr null, !dbg [[DBG106]]
492 // CHECK2-NEXT: [[TMP6:%.*]] = extractvalue { ptr, i32 } [[TMP5]], 0, !dbg [[DBG106]]
493 // CHECK2-NEXT: call void @__clang_call_terminate(ptr [[TMP6]]) #[[ATTR6]], !dbg [[DBG106]]
494 // CHECK2-NEXT: unreachable, !dbg [[DBG106]]
497 // CHECK2-LABEL: define {{[^@]+}}@main.omp_outlined_debug__.2.omp_outlined
498 // CHECK2-SAME: (ptr noalias noundef [[DOTGLOBAL_TID_:%.*]], ptr noalias noundef [[DOTBOUND_TID_:%.*]], i64 noundef [[VLA:%.*]], ptr noundef nonnull align 4 dereferenceable(4) [[A:%.*]], ptr noundef nonnull align 4 dereferenceable(4) [[GLOBAL:%.*]]) #[[ATTR2]] !dbg [[DBG111:![0-9]+]] {
499 // CHECK2-NEXT: entry:
500 // CHECK2-NEXT: [[DOTGLOBAL_TID__ADDR:%.*]] = alloca ptr, align 8
501 // CHECK2-NEXT: [[DOTBOUND_TID__ADDR:%.*]] = alloca ptr, align 8
502 // CHECK2-NEXT: [[VLA_ADDR:%.*]] = alloca i64, align 8
503 // CHECK2-NEXT: [[A_ADDR:%.*]] = alloca ptr, align 8
504 // CHECK2-NEXT: [[GLOBAL_ADDR:%.*]] = alloca ptr, align 8
505 // CHECK2-NEXT: store ptr [[DOTGLOBAL_TID_]], ptr [[DOTGLOBAL_TID__ADDR]], align 8
506 // CHECK2-NEXT: #dbg_declare(ptr [[DOTGLOBAL_TID__ADDR]], [[META112:![0-9]+]], !DIExpression(), [[META113:![0-9]+]])
507 // CHECK2-NEXT: store ptr [[DOTBOUND_TID_]], ptr [[DOTBOUND_TID__ADDR]], align 8
508 // CHECK2-NEXT: #dbg_declare(ptr [[DOTBOUND_TID__ADDR]], [[META114:![0-9]+]], !DIExpression(), [[META113]])
509 // CHECK2-NEXT: store i64 [[VLA]], ptr [[VLA_ADDR]], align 8
510 // CHECK2-NEXT: #dbg_declare(ptr [[VLA_ADDR]], [[META115:![0-9]+]], !DIExpression(), [[META113]])
511 // CHECK2-NEXT: store ptr [[A]], ptr [[A_ADDR]], align 8
512 // CHECK2-NEXT: #dbg_declare(ptr [[A_ADDR]], [[META116:![0-9]+]], !DIExpression(), [[META113]])
513 // CHECK2-NEXT: store ptr [[GLOBAL]], ptr [[GLOBAL_ADDR]], align 8
514 // CHECK2-NEXT: #dbg_declare(ptr [[GLOBAL_ADDR]], [[META117:![0-9]+]], !DIExpression(), [[META113]])
515 // CHECK2-NEXT: [[TMP0:%.*]] = load i64, ptr [[VLA_ADDR]], align 8, !dbg [[DBG118:![0-9]+]]
516 // CHECK2-NEXT: [[TMP1:%.*]] = load ptr, ptr [[A_ADDR]], align 8, !dbg [[DBG118]]
517 // CHECK2-NEXT: [[TMP2:%.*]] = load ptr, ptr [[GLOBAL_ADDR]], align 8, !dbg [[DBG118]]
518 // CHECK2-NEXT: [[TMP3:%.*]] = load ptr, ptr [[DOTGLOBAL_TID__ADDR]], align 8, !dbg [[DBG118]]
519 // CHECK2-NEXT: [[TMP4:%.*]] = load ptr, ptr [[DOTBOUND_TID__ADDR]], align 8, !dbg [[DBG118]]
520 // CHECK2-NEXT: [[TMP5:%.*]] = load ptr, ptr [[A_ADDR]], align 8, !dbg [[DBG118]]
521 // CHECK2-NEXT: [[TMP6:%.*]] = load ptr, ptr [[GLOBAL_ADDR]], align 8, !dbg [[DBG118]]
522 // CHECK2-NEXT: call void @main.omp_outlined_debug__.2.omp_outlined_debug__(ptr [[TMP3]], ptr [[TMP4]], i64 [[TMP0]], ptr [[TMP5]], ptr [[TMP6]]) #[[ATTR5]], !dbg [[DBG118]]
523 // CHECK2-NEXT: ret void, !dbg [[DBG118]]
526 // CHECK2-LABEL: define {{[^@]+}}@main.omp_outlined_debug__.4
527 // CHECK2-SAME: (ptr noalias noundef [[DOTGLOBAL_TID_:%.*]], ptr noalias noundef [[DOTBOUND_TID_:%.*]], i64 noundef [[VLA:%.*]], ptr noundef nonnull align 4 dereferenceable(4) [[A:%.*]]) #[[ATTR2]] !dbg [[DBG119:![0-9]+]] {
528 // CHECK2-NEXT: entry:
529 // CHECK2-NEXT: [[DOTGLOBAL_TID__ADDR:%.*]] = alloca ptr, align 8
530 // CHECK2-NEXT: [[DOTBOUND_TID__ADDR:%.*]] = alloca ptr, align 8
531 // CHECK2-NEXT: [[VLA_ADDR:%.*]] = alloca i64, align 8
532 // CHECK2-NEXT: [[A_ADDR:%.*]] = alloca ptr, align 8
533 // CHECK2-NEXT: store ptr [[DOTGLOBAL_TID_]], ptr [[DOTGLOBAL_TID__ADDR]], align 8
534 // CHECK2-NEXT: #dbg_declare(ptr [[DOTGLOBAL_TID__ADDR]], [[META120:![0-9]+]], !DIExpression(), [[META121:![0-9]+]])
535 // CHECK2-NEXT: store ptr [[DOTBOUND_TID_]], ptr [[DOTBOUND_TID__ADDR]], align 8
536 // CHECK2-NEXT: #dbg_declare(ptr [[DOTBOUND_TID__ADDR]], [[META122:![0-9]+]], !DIExpression(), [[META121]])
537 // CHECK2-NEXT: store i64 [[VLA]], ptr [[VLA_ADDR]], align 8
538 // CHECK2-NEXT: #dbg_declare(ptr [[VLA_ADDR]], [[META123:![0-9]+]], !DIExpression(), [[META121]])
539 // CHECK2-NEXT: store ptr [[A]], ptr [[A_ADDR]], align 8
540 // CHECK2-NEXT: #dbg_declare(ptr [[A_ADDR]], [[META124:![0-9]+]], !DIExpression(), [[META125:![0-9]+]])
541 // CHECK2-NEXT: [[TMP0:%.*]] = load i64, ptr [[VLA_ADDR]], align 8, !dbg [[DBG126:![0-9]+]]
542 // CHECK2-NEXT: [[TMP1:%.*]] = load ptr, ptr [[A_ADDR]], align 8, !dbg [[DBG126]]
543 // CHECK2-NEXT: call void (ptr, i32, ptr, ...) @__kmpc_fork_call(ptr @[[GLOB7:[0-9]+]], i32 2, ptr @main.omp_outlined_debug__.4.omp_outlined, i64 [[TMP0]], ptr [[TMP1]]), !dbg [[DBG126]]
544 // CHECK2-NEXT: ret void, !dbg [[DBG127:![0-9]+]]
547 // CHECK2-LABEL: define {{[^@]+}}@main.omp_outlined.3
548 // CHECK2-SAME: (ptr noalias noundef [[DOTGLOBAL_TID_:%.*]], ptr noalias noundef [[DOTBOUND_TID_:%.*]], i64 noundef [[VLA:%.*]], ptr noundef nonnull align 4 dereferenceable(4) [[A:%.*]]) #[[ATTR2]] !dbg [[DBG128:![0-9]+]] {
549 // CHECK2-NEXT: entry:
550 // CHECK2-NEXT: [[DOTGLOBAL_TID__ADDR:%.*]] = alloca ptr, align 8
551 // CHECK2-NEXT: [[DOTBOUND_TID__ADDR:%.*]] = alloca ptr, align 8
552 // CHECK2-NEXT: [[VLA_ADDR:%.*]] = alloca i64, align 8
553 // CHECK2-NEXT: [[A_ADDR:%.*]] = alloca ptr, align 8
554 // CHECK2-NEXT: store ptr [[DOTGLOBAL_TID_]], ptr [[DOTGLOBAL_TID__ADDR]], align 8
555 // CHECK2-NEXT: #dbg_declare(ptr [[DOTGLOBAL_TID__ADDR]], [[META129:![0-9]+]], !DIExpression(), [[META130:![0-9]+]])
556 // CHECK2-NEXT: store ptr [[DOTBOUND_TID_]], ptr [[DOTBOUND_TID__ADDR]], align 8
557 // CHECK2-NEXT: #dbg_declare(ptr [[DOTBOUND_TID__ADDR]], [[META131:![0-9]+]], !DIExpression(), [[META130]])
558 // CHECK2-NEXT: store i64 [[VLA]], ptr [[VLA_ADDR]], align 8
559 // CHECK2-NEXT: #dbg_declare(ptr [[VLA_ADDR]], [[META132:![0-9]+]], !DIExpression(), [[META130]])
560 // CHECK2-NEXT: store ptr [[A]], ptr [[A_ADDR]], align 8
561 // CHECK2-NEXT: #dbg_declare(ptr [[A_ADDR]], [[META133:![0-9]+]], !DIExpression(), [[META130]])
562 // CHECK2-NEXT: [[TMP0:%.*]] = load i64, ptr [[VLA_ADDR]], align 8, !dbg [[DBG134:![0-9]+]]
563 // CHECK2-NEXT: [[TMP1:%.*]] = load ptr, ptr [[A_ADDR]], align 8, !dbg [[DBG134]]
564 // CHECK2-NEXT: [[TMP2:%.*]] = load ptr, ptr [[DOTGLOBAL_TID__ADDR]], align 8, !dbg [[DBG134]]
565 // CHECK2-NEXT: [[TMP3:%.*]] = load ptr, ptr [[DOTBOUND_TID__ADDR]], align 8, !dbg [[DBG134]]
566 // CHECK2-NEXT: [[TMP4:%.*]] = load ptr, ptr [[A_ADDR]], align 8, !dbg [[DBG134]]
567 // CHECK2-NEXT: call void @main.omp_outlined_debug__.4(ptr [[TMP2]], ptr [[TMP3]], i64 [[TMP0]], ptr [[TMP4]]) #[[ATTR5]], !dbg [[DBG134]]
568 // CHECK2-NEXT: ret void, !dbg [[DBG134]]
571 // CHECK2-LABEL: define {{[^@]+}}@main.omp_outlined_debug__.4.omp_outlined_debug__
572 // CHECK2-SAME: (ptr noalias noundef [[DOTGLOBAL_TID_:%.*]], ptr noalias noundef [[DOTBOUND_TID_:%.*]], i64 noundef [[VLA:%.*]], ptr noundef nonnull align 4 dereferenceable(4) [[A:%.*]]) #[[ATTR2]] personality ptr @__gxx_personality_v0 !dbg [[DBG135:![0-9]+]] {
573 // CHECK2-NEXT: entry:
574 // CHECK2-NEXT: [[DOTGLOBAL_TID__ADDR:%.*]] = alloca ptr, align 8
575 // CHECK2-NEXT: [[DOTBOUND_TID__ADDR:%.*]] = alloca ptr, align 8
576 // CHECK2-NEXT: [[VLA_ADDR:%.*]] = alloca i64, align 8
577 // CHECK2-NEXT: [[A_ADDR:%.*]] = alloca ptr, align 8
578 // CHECK2-NEXT: store ptr [[DOTGLOBAL_TID_]], ptr [[DOTGLOBAL_TID__ADDR]], align 8
579 // CHECK2-NEXT: #dbg_declare(ptr [[DOTGLOBAL_TID__ADDR]], [[META136:![0-9]+]], !DIExpression(), [[META137:![0-9]+]])
580 // CHECK2-NEXT: store ptr [[DOTBOUND_TID_]], ptr [[DOTBOUND_TID__ADDR]], align 8
581 // CHECK2-NEXT: #dbg_declare(ptr [[DOTBOUND_TID__ADDR]], [[META138:![0-9]+]], !DIExpression(), [[META137]])
582 // CHECK2-NEXT: store i64 [[VLA]], ptr [[VLA_ADDR]], align 8
583 // CHECK2-NEXT: #dbg_declare(ptr [[VLA_ADDR]], [[META139:![0-9]+]], !DIExpression(), [[META137]])
584 // CHECK2-NEXT: store ptr [[A]], ptr [[A_ADDR]], align 8
585 // CHECK2-NEXT: #dbg_declare(ptr [[A_ADDR]], [[META140:![0-9]+]], !DIExpression(), [[META141:![0-9]+]])
586 // CHECK2-NEXT: [[TMP0:%.*]] = load i64, ptr [[VLA_ADDR]], align 8, !dbg [[DBG142:![0-9]+]]
587 // CHECK2-NEXT: [[TMP1:%.*]] = load ptr, ptr [[A_ADDR]], align 8, !dbg [[DBG142]]
588 // CHECK2-NEXT: [[ARRAYIDX:%.*]] = getelementptr inbounds i32, ptr [[TMP1]], i64 1, !dbg [[DBG143:![0-9]+]]
589 // CHECK2-NEXT: [[TMP2:%.*]] = load i32, ptr [[ARRAYIDX]], align 4, !dbg [[DBG143]]
590 // CHECK2-NEXT: invoke void @_Z3fooIiEvT_(i32 noundef [[TMP2]])
591 // CHECK2-NEXT: to label [[INVOKE_CONT:%.*]] unwind label [[TERMINATE_LPAD:%.*]], !dbg [[DBG142]]
592 // CHECK2: invoke.cont:
593 // CHECK2-NEXT: [[TMP3:%.*]] = load i32, ptr @global, align 4, !dbg [[DBG144:![0-9]+]]
594 // CHECK2-NEXT: [[ARRAYIDX1:%.*]] = getelementptr inbounds i32, ptr [[TMP1]], i64 1, !dbg [[DBG145:![0-9]+]]
595 // CHECK2-NEXT: store i32 [[TMP3]], ptr [[ARRAYIDX1]], align 4, !dbg [[DBG146:![0-9]+]]
596 // CHECK2-NEXT: ret void, !dbg [[DBG144]]
597 // CHECK2: terminate.lpad:
598 // CHECK2-NEXT: [[TMP4:%.*]] = landingpad { ptr, i32 }
599 // CHECK2-NEXT: catch ptr null, !dbg [[DBG142]]
600 // CHECK2-NEXT: [[TMP5:%.*]] = extractvalue { ptr, i32 } [[TMP4]], 0, !dbg [[DBG142]]
601 // CHECK2-NEXT: call void @__clang_call_terminate(ptr [[TMP5]]) #[[ATTR6]], !dbg [[DBG142]]
602 // CHECK2-NEXT: unreachable, !dbg [[DBG142]]
605 // CHECK2-LABEL: define {{[^@]+}}@main.omp_outlined_debug__.4.omp_outlined
606 // CHECK2-SAME: (ptr noalias noundef [[DOTGLOBAL_TID_:%.*]], ptr noalias noundef [[DOTBOUND_TID_:%.*]], i64 noundef [[VLA:%.*]], ptr noundef nonnull align 4 dereferenceable(4) [[A:%.*]]) #[[ATTR2]] !dbg [[DBG147:![0-9]+]] {
607 // CHECK2-NEXT: entry:
608 // CHECK2-NEXT: [[DOTGLOBAL_TID__ADDR:%.*]] = alloca ptr, align 8
609 // CHECK2-NEXT: [[DOTBOUND_TID__ADDR:%.*]] = alloca ptr, align 8
610 // CHECK2-NEXT: [[VLA_ADDR:%.*]] = alloca i64, align 8
611 // CHECK2-NEXT: [[A_ADDR:%.*]] = alloca ptr, align 8
612 // CHECK2-NEXT: store ptr [[DOTGLOBAL_TID_]], ptr [[DOTGLOBAL_TID__ADDR]], align 8
613 // CHECK2-NEXT: #dbg_declare(ptr [[DOTGLOBAL_TID__ADDR]], [[META148:![0-9]+]], !DIExpression(), [[META149:![0-9]+]])
614 // CHECK2-NEXT: store ptr [[DOTBOUND_TID_]], ptr [[DOTBOUND_TID__ADDR]], align 8
615 // CHECK2-NEXT: #dbg_declare(ptr [[DOTBOUND_TID__ADDR]], [[META150:![0-9]+]], !DIExpression(), [[META149]])
616 // CHECK2-NEXT: store i64 [[VLA]], ptr [[VLA_ADDR]], align 8
617 // CHECK2-NEXT: #dbg_declare(ptr [[VLA_ADDR]], [[META151:![0-9]+]], !DIExpression(), [[META149]])
618 // CHECK2-NEXT: store ptr [[A]], ptr [[A_ADDR]], align 8
619 // CHECK2-NEXT: #dbg_declare(ptr [[A_ADDR]], [[META152:![0-9]+]], !DIExpression(), [[META149]])
620 // CHECK2-NEXT: [[TMP0:%.*]] = load i64, ptr [[VLA_ADDR]], align 8, !dbg [[DBG153:![0-9]+]]
621 // CHECK2-NEXT: [[TMP1:%.*]] = load ptr, ptr [[A_ADDR]], align 8, !dbg [[DBG153]]
622 // CHECK2-NEXT: [[TMP2:%.*]] = load ptr, ptr [[DOTGLOBAL_TID__ADDR]], align 8, !dbg [[DBG153]]
623 // CHECK2-NEXT: [[TMP3:%.*]] = load ptr, ptr [[DOTBOUND_TID__ADDR]], align 8, !dbg [[DBG153]]
624 // CHECK2-NEXT: [[TMP4:%.*]] = load ptr, ptr [[A_ADDR]], align 8, !dbg [[DBG153]]
625 // CHECK2-NEXT: call void @main.omp_outlined_debug__.4.omp_outlined_debug__(ptr [[TMP2]], ptr [[TMP3]], i64 [[TMP0]], ptr [[TMP4]]) #[[ATTR5]], !dbg [[DBG153]]
626 // CHECK2-NEXT: ret void, !dbg [[DBG153]]
629 // CHECK2-LABEL: define {{[^@]+}}@_Z5tmainIPPcEiT_
630 // CHECK2-SAME: (ptr noundef [[ARGC:%.*]]) #[[ATTR3]] comdat !dbg [[DBG154:![0-9]+]] {
631 // CHECK2-NEXT: entry:
632 // CHECK2-NEXT: [[ARGC_ADDR:%.*]] = alloca ptr, align 8
633 // CHECK2-NEXT: store ptr [[ARGC]], ptr [[ARGC_ADDR]], align 8
634 // CHECK2-NEXT: #dbg_declare(ptr [[ARGC_ADDR]], [[META159:![0-9]+]], !DIExpression(), [[META160:![0-9]+]])
635 // CHECK2-NEXT: [[TMP0:%.*]] = load ptr, ptr [[ARGC_ADDR]], align 8, !dbg [[DBG161:![0-9]+]]
636 // CHECK2-NEXT: [[ARRAYIDX:%.*]] = getelementptr inbounds ptr, ptr [[TMP0]], i64 0, !dbg [[DBG161]]
637 // CHECK2-NEXT: [[TMP1:%.*]] = load ptr, ptr [[ARRAYIDX]], align 8, !dbg [[DBG161]]
638 // CHECK2-NEXT: [[ARRAYIDX1:%.*]] = getelementptr inbounds i8, ptr [[TMP1]], i64 0, !dbg [[DBG161]]
639 // CHECK2-NEXT: [[TMP2:%.*]] = load i8, ptr [[ARRAYIDX1]], align 1, !dbg [[DBG161]]
640 // CHECK2-NEXT: [[TMP3:%.*]] = zext i8 [[TMP2]] to i64, !dbg [[DBG162:![0-9]+]]
641 // CHECK2-NEXT: call void (ptr, i32, ptr, ...) @__kmpc_fork_call(ptr @[[GLOB11:[0-9]+]], i32 2, ptr @_Z5tmainIPPcEiT_.omp_outlined, ptr [[ARGC_ADDR]], i64 [[TMP3]]), !dbg [[DBG163:![0-9]+]]
642 // CHECK2-NEXT: ret i32 0, !dbg [[DBG164:![0-9]+]]
645 // CHECK2-LABEL: define {{[^@]+}}@_Z5tmainIPPcEiT_.omp_outlined_debug__
646 // CHECK2-SAME: (ptr noalias noundef [[DOTGLOBAL_TID_:%.*]], ptr noalias noundef [[DOTBOUND_TID_:%.*]], ptr noundef nonnull align 8 dereferenceable(8) [[ARGC:%.*]], i64 noundef [[VLA:%.*]]) #[[ATTR2]] personality ptr @__gxx_personality_v0 !dbg [[DBG165:![0-9]+]] {
647 // CHECK2-NEXT: entry:
648 // CHECK2-NEXT: [[DOTGLOBAL_TID__ADDR:%.*]] = alloca ptr, align 8
649 // CHECK2-NEXT: [[DOTBOUND_TID__ADDR:%.*]] = alloca ptr, align 8
650 // CHECK2-NEXT: [[ARGC_ADDR:%.*]] = alloca ptr, align 8
651 // CHECK2-NEXT: [[VLA_ADDR:%.*]] = alloca i64, align 8
652 // CHECK2-NEXT: [[VAR:%.*]] = alloca ptr, align 8
653 // CHECK2-NEXT: store ptr [[DOTGLOBAL_TID_]], ptr [[DOTGLOBAL_TID__ADDR]], align 8
654 // CHECK2-NEXT: #dbg_declare(ptr [[DOTGLOBAL_TID__ADDR]], [[META169:![0-9]+]], !DIExpression(), [[META170:![0-9]+]])
655 // CHECK2-NEXT: store ptr [[DOTBOUND_TID_]], ptr [[DOTBOUND_TID__ADDR]], align 8
656 // CHECK2-NEXT: #dbg_declare(ptr [[DOTBOUND_TID__ADDR]], [[META171:![0-9]+]], !DIExpression(), [[META170]])
657 // CHECK2-NEXT: store ptr [[ARGC]], ptr [[ARGC_ADDR]], align 8
658 // CHECK2-NEXT: #dbg_declare(ptr [[ARGC_ADDR]], [[META172:![0-9]+]], !DIExpression(), [[META173:![0-9]+]])
659 // CHECK2-NEXT: store i64 [[VLA]], ptr [[VLA_ADDR]], align 8
660 // CHECK2-NEXT: #dbg_declare(ptr [[VLA_ADDR]], [[META174:![0-9]+]], !DIExpression(), [[META170]])
661 // CHECK2-NEXT: [[TMP0:%.*]] = load ptr, ptr [[ARGC_ADDR]], align 8, !dbg [[DBG175:![0-9]+]]
662 // CHECK2-NEXT: [[TMP1:%.*]] = load i64, ptr [[VLA_ADDR]], align 8, !dbg [[DBG175]]
663 // CHECK2-NEXT: [[TMP2:%.*]] = load ptr, ptr [[TMP0]], align 8, !dbg [[DBG176:![0-9]+]]
664 // CHECK2-NEXT: invoke void @_Z3fooIPPcEvT_(ptr noundef [[TMP2]])
665 // CHECK2-NEXT: to label [[INVOKE_CONT:%.*]] unwind label [[TERMINATE_LPAD:%.*]], !dbg [[DBG178:![0-9]+]]
666 // CHECK2: invoke.cont:
667 // CHECK2-NEXT: #dbg_declare(ptr [[VAR]], [[META179:![0-9]+]], !DIExpression(), [[META186:![0-9]+]])
668 // CHECK2-NEXT: [[TMP3:%.*]] = load ptr, ptr [[VAR]], align 8, !dbg [[DBG187:![0-9]+]]
669 // CHECK2-NEXT: [[TMP4:%.*]] = mul nsw i64 0, [[TMP1]], !dbg [[DBG187]]
670 // CHECK2-NEXT: [[ARRAYIDX:%.*]] = getelementptr inbounds double, ptr [[TMP3]], i64 [[TMP4]], !dbg [[DBG187]]
671 // CHECK2-NEXT: [[ARRAYIDX1:%.*]] = getelementptr inbounds double, ptr [[ARRAYIDX]], i64 0, !dbg [[DBG187]]
672 // CHECK2-NEXT: ret void, !dbg [[DBG188:![0-9]+]]
673 // CHECK2: terminate.lpad:
674 // CHECK2-NEXT: [[TMP5:%.*]] = landingpad { ptr, i32 }
675 // CHECK2-NEXT: catch ptr null, !dbg [[DBG178]]
676 // CHECK2-NEXT: [[TMP6:%.*]] = extractvalue { ptr, i32 } [[TMP5]], 0, !dbg [[DBG178]]
677 // CHECK2-NEXT: call void @__clang_call_terminate(ptr [[TMP6]]) #[[ATTR6]], !dbg [[DBG178]]
678 // CHECK2-NEXT: unreachable, !dbg [[DBG178]]
681 // CHECK2-LABEL: define {{[^@]+}}@_Z5tmainIPPcEiT_.omp_outlined
682 // CHECK2-SAME: (ptr noalias noundef [[DOTGLOBAL_TID_:%.*]], ptr noalias noundef [[DOTBOUND_TID_:%.*]], ptr noundef nonnull align 8 dereferenceable(8) [[ARGC:%.*]], i64 noundef [[VLA:%.*]]) #[[ATTR2]] !dbg [[DBG189:![0-9]+]] {
683 // CHECK2-NEXT: entry:
684 // CHECK2-NEXT: [[DOTGLOBAL_TID__ADDR:%.*]] = alloca ptr, align 8
685 // CHECK2-NEXT: [[DOTBOUND_TID__ADDR:%.*]] = alloca ptr, align 8
686 // CHECK2-NEXT: [[ARGC_ADDR:%.*]] = alloca ptr, align 8
687 // CHECK2-NEXT: [[VLA_ADDR:%.*]] = alloca i64, align 8
688 // CHECK2-NEXT: store ptr [[DOTGLOBAL_TID_]], ptr [[DOTGLOBAL_TID__ADDR]], align 8
689 // CHECK2-NEXT: #dbg_declare(ptr [[DOTGLOBAL_TID__ADDR]], [[META190:![0-9]+]], !DIExpression(), [[META191:![0-9]+]])
690 // CHECK2-NEXT: store ptr [[DOTBOUND_TID_]], ptr [[DOTBOUND_TID__ADDR]], align 8
691 // CHECK2-NEXT: #dbg_declare(ptr [[DOTBOUND_TID__ADDR]], [[META192:![0-9]+]], !DIExpression(), [[META191]])
692 // CHECK2-NEXT: store ptr [[ARGC]], ptr [[ARGC_ADDR]], align 8
693 // CHECK2-NEXT: #dbg_declare(ptr [[ARGC_ADDR]], [[META193:![0-9]+]], !DIExpression(), [[META191]])
694 // CHECK2-NEXT: store i64 [[VLA]], ptr [[VLA_ADDR]], align 8
695 // CHECK2-NEXT: #dbg_declare(ptr [[VLA_ADDR]], [[META194:![0-9]+]], !DIExpression(), [[META191]])
696 // CHECK2-NEXT: [[TMP0:%.*]] = load ptr, ptr [[ARGC_ADDR]], align 8, !dbg [[DBG195:![0-9]+]]
697 // CHECK2-NEXT: [[TMP1:%.*]] = load i64, ptr [[VLA_ADDR]], align 8, !dbg [[DBG195]]
698 // CHECK2-NEXT: [[TMP2:%.*]] = load ptr, ptr [[DOTGLOBAL_TID__ADDR]], align 8, !dbg [[DBG195]]
699 // CHECK2-NEXT: [[TMP3:%.*]] = load ptr, ptr [[DOTBOUND_TID__ADDR]], align 8, !dbg [[DBG195]]
700 // CHECK2-NEXT: [[TMP4:%.*]] = load ptr, ptr [[ARGC_ADDR]], align 8, !dbg [[DBG195]]
701 // CHECK2-NEXT: call void @_Z5tmainIPPcEiT_.omp_outlined_debug__(ptr [[TMP2]], ptr [[TMP3]], ptr [[TMP4]], i64 [[TMP1]]) #[[ATTR5]], !dbg [[DBG195]]
702 // CHECK2-NEXT: ret void, !dbg [[DBG195]]
705 // CHECK2-LABEL: define {{[^@]+}}@_Z3fooIPPcEvT_
706 // CHECK2-SAME: (ptr noundef [[ARGC:%.*]]) #[[ATTR3]] comdat !dbg [[DBG196:![0-9]+]] {
707 // CHECK2-NEXT: entry:
708 // CHECK2-NEXT: [[ARGC_ADDR:%.*]] = alloca ptr, align 8
709 // CHECK2-NEXT: store ptr [[ARGC]], ptr [[ARGC_ADDR]], align 8
710 // CHECK2-NEXT: #dbg_declare(ptr [[ARGC_ADDR]], [[META199:![0-9]+]], !DIExpression(), [[META200:![0-9]+]])
711 // CHECK2-NEXT: ret void, !dbg [[DBG201:![0-9]+]]
714 // CHECK3-LABEL: define {{[^@]+}}@main
715 // CHECK3-SAME: (i32 noundef [[ARGC:%.*]], ptr noundef [[ARGV:%.*]]) #[[ATTR0:[0-9]+]] {
716 // CHECK3-NEXT: entry:
717 // CHECK3-NEXT: [[STRUCTARG:%.*]] = alloca { ptr }, align 8
718 // CHECK3-NEXT: [[RETVAL:%.*]] = alloca i32, align 4
719 // CHECK3-NEXT: [[ARGC_ADDR:%.*]] = alloca i32, align 4
720 // CHECK3-NEXT: [[ARGV_ADDR:%.*]] = alloca ptr, align 8
721 // CHECK3-NEXT: [[SAVED_STACK:%.*]] = alloca ptr, align 8
722 // CHECK3-NEXT: [[__VLA_EXPR0:%.*]] = alloca i64, align 8
723 // CHECK3-NEXT: store i32 0, ptr [[RETVAL]], align 4
724 // CHECK3-NEXT: store i32 [[ARGC]], ptr [[ARGC_ADDR]], align 4
725 // CHECK3-NEXT: store ptr [[ARGV]], ptr [[ARGV_ADDR]], align 8
726 // CHECK3-NEXT: [[TMP0:%.*]] = load i32, ptr [[ARGC_ADDR]], align 4
727 // CHECK3-NEXT: [[TMP1:%.*]] = zext i32 [[TMP0]] to i64
728 // CHECK3-NEXT: [[TMP2:%.*]] = call ptr @llvm.stacksave.p0()
729 // CHECK3-NEXT: store ptr [[TMP2]], ptr [[SAVED_STACK]], align 8
730 // CHECK3-NEXT: [[VLA:%.*]] = alloca i32, i64 [[TMP1]], align 16
731 // CHECK3-NEXT: store i64 [[TMP1]], ptr [[__VLA_EXPR0]], align 8
732 // CHECK3-NEXT: [[OMP_GLOBAL_THREAD_NUM:%.*]] = call i32 @__kmpc_global_thread_num(ptr @[[GLOB1:[0-9]+]])
733 // CHECK3-NEXT: br label [[OMP_PARALLEL:%.*]]
734 // CHECK3: omp_parallel:
735 // CHECK3-NEXT: [[GEP_VLA:%.*]] = getelementptr { ptr }, ptr [[STRUCTARG]], i32 0, i32 0
736 // CHECK3-NEXT: store ptr [[VLA]], ptr [[GEP_VLA]], align 8
737 // CHECK3-NEXT: call void (ptr, i32, ptr, ...) @__kmpc_fork_call(ptr @[[GLOB1]], i32 1, ptr @main..omp_par, ptr [[STRUCTARG]])
738 // CHECK3-NEXT: br label [[OMP_PAR_OUTLINED_EXIT:%.*]]
739 // CHECK3: omp.par.outlined.exit:
740 // CHECK3-NEXT: br label [[OMP_PAR_EXIT_SPLIT:%.*]]
741 // CHECK3: omp.par.exit.split:
742 // CHECK3-NEXT: [[TMP3:%.*]] = load ptr, ptr [[ARGV_ADDR]], align 8
743 // CHECK3-NEXT: [[CALL:%.*]] = call noundef i32 @_Z5tmainIPPcEiT_(ptr noundef [[TMP3]])
744 // CHECK3-NEXT: store i32 [[CALL]], ptr [[RETVAL]], align 4
745 // CHECK3-NEXT: [[TMP4:%.*]] = load ptr, ptr [[SAVED_STACK]], align 8
746 // CHECK3-NEXT: call void @llvm.stackrestore.p0(ptr [[TMP4]])
747 // CHECK3-NEXT: [[TMP5:%.*]] = load i32, ptr [[RETVAL]], align 4
748 // CHECK3-NEXT: ret i32 [[TMP5]]
751 // CHECK3-LABEL: define {{[^@]+}}@main..omp_par
752 // CHECK3-SAME: (ptr noalias [[TID_ADDR:%.*]], ptr noalias [[ZERO_ADDR:%.*]], ptr [[TMP0:%.*]]) #[[ATTR1:[0-9]+]] {
753 // CHECK3-NEXT: omp.par.entry:
754 // CHECK3-NEXT: [[GEP_VLA:%.*]] = getelementptr { ptr }, ptr [[TMP0]], i32 0, i32 0
755 // CHECK3-NEXT: [[LOADGEP_VLA:%.*]] = load ptr, ptr [[GEP_VLA]], align 8
756 // CHECK3-NEXT: [[TID_ADDR_LOCAL:%.*]] = alloca i32, align 4
757 // CHECK3-NEXT: [[TMP1:%.*]] = load i32, ptr [[TID_ADDR]], align 4
758 // CHECK3-NEXT: store i32 [[TMP1]], ptr [[TID_ADDR_LOCAL]], align 4
759 // CHECK3-NEXT: [[TID:%.*]] = load i32, ptr [[TID_ADDR_LOCAL]], align 4
760 // CHECK3-NEXT: br label [[OMP_PAR_REGION:%.*]]
761 // CHECK3: omp.par.region:
762 // CHECK3-NEXT: [[ARRAYIDX:%.*]] = getelementptr inbounds i32, ptr [[LOADGEP_VLA]], i64 1
763 // CHECK3-NEXT: [[TMP2:%.*]] = load i32, ptr [[ARRAYIDX]], align 4
764 // CHECK3-NEXT: call void @_Z3fooIiEvT_(i32 noundef [[TMP2]])
765 // CHECK3-NEXT: [[TMP3:%.*]] = load i32, ptr @global, align 4
766 // CHECK3-NEXT: [[ARRAYIDX1:%.*]] = getelementptr inbounds i32, ptr [[LOADGEP_VLA]], i64 1
767 // CHECK3-NEXT: store i32 [[TMP3]], ptr [[ARRAYIDX1]], align 4
768 // CHECK3-NEXT: br label [[OMP_PAR_REGION_PARALLEL_AFTER:%.*]]
769 // CHECK3: omp.par.region.parallel.after:
770 // CHECK3-NEXT: br label [[OMP_PAR_PRE_FINALIZE:%.*]]
771 // CHECK3: omp.par.pre_finalize:
772 // CHECK3-NEXT: br label [[OMP_PAR_OUTLINED_EXIT_EXITSTUB:%.*]]
773 // CHECK3: omp.par.outlined.exit.exitStub:
774 // CHECK3-NEXT: ret void
777 // CHECK3-LABEL: define {{[^@]+}}@_Z3fooIiEvT_
778 // CHECK3-SAME: (i32 noundef [[ARGC:%.*]]) #[[ATTR4:[0-9]+]] comdat {
779 // CHECK3-NEXT: entry:
780 // CHECK3-NEXT: [[ARGC_ADDR:%.*]] = alloca i32, align 4
781 // CHECK3-NEXT: store i32 [[ARGC]], ptr [[ARGC_ADDR]], align 4
782 // CHECK3-NEXT: ret void
785 // CHECK3-LABEL: define {{[^@]+}}@_Z5tmainIPPcEiT_
786 // CHECK3-SAME: (ptr noundef [[ARGC:%.*]]) #[[ATTR5:[0-9]+]] comdat {
787 // CHECK3-NEXT: entry:
788 // CHECK3-NEXT: [[STRUCTARG:%.*]] = alloca { ptr, ptr }, align 8
789 // CHECK3-NEXT: [[DOTRELOADED:%.*]] = alloca i64, align 8
790 // CHECK3-NEXT: [[ARGC_ADDR:%.*]] = alloca ptr, align 8
791 // CHECK3-NEXT: store ptr [[ARGC]], ptr [[ARGC_ADDR]], align 8
792 // CHECK3-NEXT: [[TMP0:%.*]] = load ptr, ptr [[ARGC_ADDR]], align 8
793 // CHECK3-NEXT: [[ARRAYIDX:%.*]] = getelementptr inbounds ptr, ptr [[TMP0]], i64 0
794 // CHECK3-NEXT: [[TMP1:%.*]] = load ptr, ptr [[ARRAYIDX]], align 8
795 // CHECK3-NEXT: [[ARRAYIDX1:%.*]] = getelementptr inbounds i8, ptr [[TMP1]], i64 0
796 // CHECK3-NEXT: [[TMP2:%.*]] = load i8, ptr [[ARRAYIDX1]], align 1
797 // CHECK3-NEXT: [[TMP3:%.*]] = zext i8 [[TMP2]] to i64
798 // CHECK3-NEXT: [[OMP_GLOBAL_THREAD_NUM:%.*]] = call i32 @__kmpc_global_thread_num(ptr @[[GLOB1]])
799 // CHECK3-NEXT: store i64 [[TMP3]], ptr [[DOTRELOADED]], align 8
800 // CHECK3-NEXT: br label [[OMP_PARALLEL:%.*]]
801 // CHECK3: omp_parallel:
802 // CHECK3-NEXT: [[GEP__RELOADED:%.*]] = getelementptr { ptr, ptr }, ptr [[STRUCTARG]], i32 0, i32 0
803 // CHECK3-NEXT: store ptr [[DOTRELOADED]], ptr [[GEP__RELOADED]], align 8
804 // CHECK3-NEXT: [[GEP_ARGC_ADDR:%.*]] = getelementptr { ptr, ptr }, ptr [[STRUCTARG]], i32 0, i32 1
805 // CHECK3-NEXT: store ptr [[ARGC_ADDR]], ptr [[GEP_ARGC_ADDR]], align 8
806 // CHECK3-NEXT: call void (ptr, i32, ptr, ...) @__kmpc_fork_call(ptr @[[GLOB1]], i32 1, ptr @_Z5tmainIPPcEiT_..omp_par, ptr [[STRUCTARG]])
807 // CHECK3-NEXT: br label [[OMP_PAR_OUTLINED_EXIT:%.*]]
808 // CHECK3: omp.par.outlined.exit:
809 // CHECK3-NEXT: br label [[OMP_PAR_EXIT_SPLIT:%.*]]
810 // CHECK3: omp.par.exit.split:
811 // CHECK3-NEXT: ret i32 0
814 // CHECK3-LABEL: define {{[^@]+}}@_Z5tmainIPPcEiT_..omp_par
815 // CHECK3-SAME: (ptr noalias [[TID_ADDR:%.*]], ptr noalias [[ZERO_ADDR:%.*]], ptr [[TMP0:%.*]]) #[[ATTR6:[0-9]+]] {
816 // CHECK3-NEXT: omp.par.entry:
817 // CHECK3-NEXT: [[GEP__RELOADED:%.*]] = getelementptr { ptr, ptr }, ptr [[TMP0]], i32 0, i32 0
818 // CHECK3-NEXT: [[LOADGEP__RELOADED:%.*]] = load ptr, ptr [[GEP__RELOADED]], align 8
819 // CHECK3-NEXT: [[GEP_ARGC_ADDR:%.*]] = getelementptr { ptr, ptr }, ptr [[TMP0]], i32 0, i32 1
820 // CHECK3-NEXT: [[LOADGEP_ARGC_ADDR:%.*]] = load ptr, ptr [[GEP_ARGC_ADDR]], align 8
821 // CHECK3-NEXT: [[TID_ADDR_LOCAL:%.*]] = alloca i32, align 4
822 // CHECK3-NEXT: [[TMP1:%.*]] = load i32, ptr [[TID_ADDR]], align 4
823 // CHECK3-NEXT: store i32 [[TMP1]], ptr [[TID_ADDR_LOCAL]], align 4
824 // CHECK3-NEXT: [[TID:%.*]] = load i32, ptr [[TID_ADDR_LOCAL]], align 4
825 // CHECK3-NEXT: [[VAR:%.*]] = alloca ptr, align 8
826 // CHECK3-NEXT: [[TMP2:%.*]] = load i64, ptr [[LOADGEP__RELOADED]], align 8
827 // CHECK3-NEXT: br label [[OMP_PAR_REGION:%.*]]
828 // CHECK3: omp.par.region:
829 // CHECK3-NEXT: [[TMP3:%.*]] = load ptr, ptr [[LOADGEP_ARGC_ADDR]], align 8
830 // CHECK3-NEXT: call void @_Z3fooIPPcEvT_(ptr noundef [[TMP3]])
831 // CHECK3-NEXT: [[TMP4:%.*]] = load ptr, ptr [[VAR]], align 8
832 // CHECK3-NEXT: [[TMP5:%.*]] = mul nsw i64 0, [[TMP2]]
833 // CHECK3-NEXT: [[ARRAYIDX2:%.*]] = getelementptr inbounds double, ptr [[TMP4]], i64 [[TMP5]]
834 // CHECK3-NEXT: [[ARRAYIDX3:%.*]] = getelementptr inbounds double, ptr [[ARRAYIDX2]], i64 0
835 // CHECK3-NEXT: br label [[OMP_PAR_REGION_PARALLEL_AFTER:%.*]]
836 // CHECK3: omp.par.region.parallel.after:
837 // CHECK3-NEXT: br label [[OMP_PAR_PRE_FINALIZE:%.*]]
838 // CHECK3: omp.par.pre_finalize:
839 // CHECK3-NEXT: br label [[OMP_PAR_OUTLINED_EXIT_EXITSTUB:%.*]]
840 // CHECK3: omp.par.outlined.exit.exitStub:
841 // CHECK3-NEXT: ret void
844 // CHECK3-LABEL: define {{[^@]+}}@_Z3fooIPPcEvT_
845 // CHECK3-SAME: (ptr noundef [[ARGC:%.*]]) #[[ATTR4]] comdat {
846 // CHECK3-NEXT: entry:
847 // CHECK3-NEXT: [[ARGC_ADDR:%.*]] = alloca ptr, align 8
848 // CHECK3-NEXT: store ptr [[ARGC]], ptr [[ARGC_ADDR]], align 8
849 // CHECK3-NEXT: ret void
852 // CHECK4-LABEL: define {{[^@]+}}@main
853 // CHECK4-SAME: (i32 noundef [[ARGC:%.*]], ptr noundef [[ARGV:%.*]]) #[[ATTR0:[0-9]+]] !dbg [[DBG11:![0-9]+]] {
854 // CHECK4-NEXT: entry:
855 // CHECK4-NEXT: [[STRUCTARG:%.*]] = alloca { ptr }, align 8
856 // CHECK4-NEXT: [[RETVAL:%.*]] = alloca i32, align 4
857 // CHECK4-NEXT: [[ARGC_ADDR:%.*]] = alloca i32, align 4
858 // CHECK4-NEXT: [[ARGV_ADDR:%.*]] = alloca ptr, align 8
859 // CHECK4-NEXT: [[SAVED_STACK:%.*]] = alloca ptr, align 8
860 // CHECK4-NEXT: [[__VLA_EXPR0:%.*]] = alloca i64, align 8
861 // CHECK4-NEXT: store i32 0, ptr [[RETVAL]], align 4
862 // CHECK4-NEXT: store i32 [[ARGC]], ptr [[ARGC_ADDR]], align 4
863 // CHECK4-NEXT: #dbg_declare(ptr [[ARGC_ADDR]], [[META18:![0-9]+]], !DIExpression(), [[META19:![0-9]+]])
864 // CHECK4-NEXT: store ptr [[ARGV]], ptr [[ARGV_ADDR]], align 8
865 // CHECK4-NEXT: #dbg_declare(ptr [[ARGV_ADDR]], [[META20:![0-9]+]], !DIExpression(), [[META19]])
866 // CHECK4-NEXT: [[TMP0:%.*]] = load i32, ptr [[ARGC_ADDR]], align 4, !dbg [[DBG21:![0-9]+]]
867 // CHECK4-NEXT: [[TMP1:%.*]] = zext i32 [[TMP0]] to i64, !dbg [[DBG21]]
868 // CHECK4-NEXT: [[TMP2:%.*]] = call ptr @llvm.stacksave.p0(), !dbg [[DBG21]]
869 // CHECK4-NEXT: store ptr [[TMP2]], ptr [[SAVED_STACK]], align 8, !dbg [[DBG21]]
870 // CHECK4-NEXT: [[VLA:%.*]] = alloca i32, i64 [[TMP1]], align 16, !dbg [[DBG21]]
871 // CHECK4-NEXT: store i64 [[TMP1]], ptr [[__VLA_EXPR0]], align 8, !dbg [[DBG21]]
872 // CHECK4-NEXT: #dbg_declare(ptr [[__VLA_EXPR0]], [[META22:![0-9]+]], !DIExpression(), [[META24:![0-9]+]])
873 // CHECK4-NEXT: #dbg_declare(ptr [[VLA]], [[META25:![0-9]+]], !DIExpression(), [[DBG21]])
874 // CHECK4-NEXT: [[OMP_GLOBAL_THREAD_NUM:%.*]] = call i32 @__kmpc_global_thread_num(ptr @[[GLOB1:[0-9]+]]), !dbg [[DBG29:![0-9]+]]
875 // CHECK4-NEXT: br label [[OMP_PARALLEL:%.*]]
876 // CHECK4: omp_parallel:
877 // CHECK4-NEXT: [[GEP_VLA:%.*]] = getelementptr { ptr }, ptr [[STRUCTARG]], i32 0, i32 0
878 // CHECK4-NEXT: store ptr [[VLA]], ptr [[GEP_VLA]], align 8
879 // CHECK4-NEXT: call void (ptr, i32, ptr, ...) @__kmpc_fork_call(ptr @[[GLOB1]], i32 1, ptr @main..omp_par, ptr [[STRUCTARG]]), !dbg [[DBG30:![0-9]+]]
880 // CHECK4-NEXT: br label [[OMP_PAR_OUTLINED_EXIT:%.*]]
881 // CHECK4: omp.par.outlined.exit:
882 // CHECK4-NEXT: br label [[OMP_PAR_EXIT_SPLIT:%.*]]
883 // CHECK4: omp.par.exit.split:
884 // CHECK4-NEXT: [[TMP3:%.*]] = load ptr, ptr [[ARGV_ADDR]], align 8, !dbg [[DBG31:![0-9]+]]
885 // CHECK4-NEXT: [[CALL:%.*]] = call noundef i32 @_Z5tmainIPPcEiT_(ptr noundef [[TMP3]]), !dbg [[DBG31]]
886 // CHECK4-NEXT: store i32 [[CALL]], ptr [[RETVAL]], align 4, !dbg [[DBG31]]
887 // CHECK4-NEXT: [[TMP4:%.*]] = load ptr, ptr [[SAVED_STACK]], align 8, !dbg [[DBG32:![0-9]+]]
888 // CHECK4-NEXT: call void @llvm.stackrestore.p0(ptr [[TMP4]]), !dbg [[DBG32]]
889 // CHECK4-NEXT: [[TMP5:%.*]] = load i32, ptr [[RETVAL]], align 4, !dbg [[DBG32]]
890 // CHECK4-NEXT: ret i32 [[TMP5]], !dbg [[DBG32]]
893 // CHECK4-LABEL: define {{[^@]+}}@main..omp_par
894 // CHECK4-SAME: (ptr noalias [[TID_ADDR:%.*]], ptr noalias [[ZERO_ADDR:%.*]], ptr [[TMP0:%.*]]) #[[ATTR1:[0-9]+]] !dbg [[DBG33:![0-9]+]] {
895 // CHECK4-NEXT: omp.par.entry:
896 // CHECK4-NEXT: [[GEP_VLA:%.*]] = getelementptr { ptr }, ptr [[TMP0]], i32 0, i32 0
897 // CHECK4-NEXT: [[LOADGEP_VLA:%.*]] = load ptr, ptr [[GEP_VLA]], align 8
898 // CHECK4-NEXT: [[TID_ADDR_LOCAL:%.*]] = alloca i32, align 4
899 // CHECK4-NEXT: [[TMP1:%.*]] = load i32, ptr [[TID_ADDR]], align 4
900 // CHECK4-NEXT: store i32 [[TMP1]], ptr [[TID_ADDR_LOCAL]], align 4
901 // CHECK4-NEXT: [[TID:%.*]] = load i32, ptr [[TID_ADDR_LOCAL]], align 4
902 // CHECK4-NEXT: br label [[OMP_PAR_REGION:%.*]]
903 // CHECK4: omp.par.region:
904 // CHECK4-NEXT: [[ARRAYIDX:%.*]] = getelementptr inbounds i32, ptr [[LOADGEP_VLA]], i64 1, !dbg [[DBG35:![0-9]+]]
905 // CHECK4-NEXT: [[TMP2:%.*]] = load i32, ptr [[ARRAYIDX]], align 4, !dbg [[DBG35]]
906 // CHECK4-NEXT: call void @_Z3fooIiEvT_(i32 noundef [[TMP2]]), !dbg [[DBG35]]
907 // CHECK4-NEXT: [[TMP3:%.*]] = load i32, ptr @global, align 4, !dbg [[DBG35]]
908 // CHECK4-NEXT: [[ARRAYIDX1:%.*]] = getelementptr inbounds i32, ptr [[LOADGEP_VLA]], i64 1, !dbg [[DBG35]]
909 // CHECK4-NEXT: store i32 [[TMP3]], ptr [[ARRAYIDX1]], align 4, !dbg [[DBG35]]
910 // CHECK4-NEXT: br label [[OMP_PAR_REGION_PARALLEL_AFTER:%.*]], !dbg [[DBG35]]
911 // CHECK4: omp.par.region.parallel.after:
912 // CHECK4-NEXT: br label [[OMP_PAR_PRE_FINALIZE:%.*]]
913 // CHECK4: omp.par.pre_finalize:
914 // CHECK4-NEXT: br label [[OMP_PAR_OUTLINED_EXIT_EXITSTUB:%.*]], !dbg [[DBG35]]
915 // CHECK4: omp.par.outlined.exit.exitStub:
916 // CHECK4-NEXT: ret void
919 // CHECK4-LABEL: define {{[^@]+}}@_Z3fooIiEvT_
920 // CHECK4-SAME: (i32 noundef [[ARGC:%.*]]) #[[ATTR4:[0-9]+]] comdat !dbg [[DBG36:![0-9]+]] {
921 // CHECK4-NEXT: entry:
922 // CHECK4-NEXT: [[ARGC_ADDR:%.*]] = alloca i32, align 4
923 // CHECK4-NEXT: store i32 [[ARGC]], ptr [[ARGC_ADDR]], align 4
924 // CHECK4-NEXT: #dbg_declare(ptr [[ARGC_ADDR]], [[META41:![0-9]+]], !DIExpression(), [[META42:![0-9]+]])
925 // CHECK4-NEXT: ret void, !dbg [[META42]]
928 // CHECK4-LABEL: define {{[^@]+}}@_Z5tmainIPPcEiT_
929 // CHECK4-SAME: (ptr noundef [[ARGC:%.*]]) #[[ATTR5:[0-9]+]] comdat !dbg [[DBG43:![0-9]+]] {
930 // CHECK4-NEXT: entry:
931 // CHECK4-NEXT: [[STRUCTARG:%.*]] = alloca { ptr, ptr }, align 8
932 // CHECK4-NEXT: [[DOTRELOADED:%.*]] = alloca i64, align 8
933 // CHECK4-NEXT: [[ARGC_ADDR:%.*]] = alloca ptr, align 8
934 // CHECK4-NEXT: store ptr [[ARGC]], ptr [[ARGC_ADDR]], align 8
935 // CHECK4-NEXT: #dbg_declare(ptr [[ARGC_ADDR]], [[META48:![0-9]+]], !DIExpression(), [[META49:![0-9]+]])
936 // CHECK4-NEXT: [[TMP0:%.*]] = load ptr, ptr [[ARGC_ADDR]], align 8, !dbg [[DBG50:![0-9]+]]
937 // CHECK4-NEXT: [[ARRAYIDX:%.*]] = getelementptr inbounds ptr, ptr [[TMP0]], i64 0, !dbg [[DBG50]]
938 // CHECK4-NEXT: [[TMP1:%.*]] = load ptr, ptr [[ARRAYIDX]], align 8, !dbg [[DBG50]]
939 // CHECK4-NEXT: [[ARRAYIDX1:%.*]] = getelementptr inbounds i8, ptr [[TMP1]], i64 0, !dbg [[DBG50]]
940 // CHECK4-NEXT: [[TMP2:%.*]] = load i8, ptr [[ARRAYIDX1]], align 1, !dbg [[DBG50]]
941 // CHECK4-NEXT: [[TMP3:%.*]] = zext i8 [[TMP2]] to i64, !dbg [[DBG50]]
942 // CHECK4-NEXT: [[OMP_GLOBAL_THREAD_NUM:%.*]] = call i32 @__kmpc_global_thread_num(ptr @[[GLOB3:[0-9]+]]), !dbg [[DBG51:![0-9]+]]
943 // CHECK4-NEXT: store i64 [[TMP3]], ptr [[DOTRELOADED]], align 8
944 // CHECK4-NEXT: br label [[OMP_PARALLEL:%.*]]
945 // CHECK4: omp_parallel:
946 // CHECK4-NEXT: [[GEP__RELOADED:%.*]] = getelementptr { ptr, ptr }, ptr [[STRUCTARG]], i32 0, i32 0
947 // CHECK4-NEXT: store ptr [[DOTRELOADED]], ptr [[GEP__RELOADED]], align 8
948 // CHECK4-NEXT: [[GEP_ARGC_ADDR:%.*]] = getelementptr { ptr, ptr }, ptr [[STRUCTARG]], i32 0, i32 1
949 // CHECK4-NEXT: store ptr [[ARGC_ADDR]], ptr [[GEP_ARGC_ADDR]], align 8
950 // CHECK4-NEXT: call void (ptr, i32, ptr, ...) @__kmpc_fork_call(ptr @[[GLOB3]], i32 1, ptr @_Z5tmainIPPcEiT_..omp_par, ptr [[STRUCTARG]]), !dbg [[DBG52:![0-9]+]]
951 // CHECK4-NEXT: br label [[OMP_PAR_OUTLINED_EXIT:%.*]]
952 // CHECK4: omp.par.outlined.exit:
953 // CHECK4-NEXT: br label [[OMP_PAR_EXIT_SPLIT:%.*]]
954 // CHECK4: omp.par.exit.split:
955 // CHECK4-NEXT: ret i32 0, !dbg [[DBG54:![0-9]+]]
958 // CHECK4-LABEL: define {{[^@]+}}@_Z5tmainIPPcEiT_..omp_par
959 // CHECK4-SAME: (ptr noalias [[TID_ADDR:%.*]], ptr noalias [[ZERO_ADDR:%.*]], ptr [[TMP0:%.*]]) #[[ATTR6:[0-9]+]] !dbg [[DBG55:![0-9]+]] {
960 // CHECK4-NEXT: omp.par.entry:
961 // CHECK4-NEXT: [[GEP__RELOADED:%.*]] = getelementptr { ptr, ptr }, ptr [[TMP0]], i32 0, i32 0
962 // CHECK4-NEXT: [[LOADGEP__RELOADED:%.*]] = load ptr, ptr [[GEP__RELOADED]], align 8
963 // CHECK4-NEXT: [[GEP_ARGC_ADDR:%.*]] = getelementptr { ptr, ptr }, ptr [[TMP0]], i32 0, i32 1
964 // CHECK4-NEXT: [[LOADGEP_ARGC_ADDR:%.*]] = load ptr, ptr [[GEP_ARGC_ADDR]], align 8
965 // CHECK4-NEXT: [[TID_ADDR_LOCAL:%.*]] = alloca i32, align 4
966 // CHECK4-NEXT: [[TMP1:%.*]] = load i32, ptr [[TID_ADDR]], align 4
967 // CHECK4-NEXT: store i32 [[TMP1]], ptr [[TID_ADDR_LOCAL]], align 4
968 // CHECK4-NEXT: [[TID:%.*]] = load i32, ptr [[TID_ADDR_LOCAL]], align 4
969 // CHECK4-NEXT: [[VAR:%.*]] = alloca ptr, align 8
970 // CHECK4-NEXT: [[TMP2:%.*]] = load i64, ptr [[LOADGEP__RELOADED]], align 8
971 // CHECK4-NEXT: br label [[OMP_PAR_REGION:%.*]]
972 // CHECK4: omp.par.region:
973 // CHECK4-NEXT: [[TMP3:%.*]] = load ptr, ptr [[LOADGEP_ARGC_ADDR]], align 8, !dbg [[DBG56:![0-9]+]]
974 // CHECK4-NEXT: call void @_Z3fooIPPcEvT_(ptr noundef [[TMP3]]), !dbg [[DBG56]]
975 // CHECK4-NEXT: #dbg_declare(ptr [[VAR]], [[META58:![0-9]+]], !DIExpression(), [[META65:![0-9]+]])
976 // CHECK4-NEXT: [[TMP4:%.*]] = load ptr, ptr [[VAR]], align 8, !dbg [[META65]]
977 // CHECK4-NEXT: [[TMP5:%.*]] = mul nsw i64 0, [[TMP2]], !dbg [[META65]]
978 // CHECK4-NEXT: [[ARRAYIDX2:%.*]] = getelementptr inbounds double, ptr [[TMP4]], i64 [[TMP5]], !dbg [[META65]]
979 // CHECK4-NEXT: [[ARRAYIDX3:%.*]] = getelementptr inbounds double, ptr [[ARRAYIDX2]], i64 0, !dbg [[META65]]
980 // CHECK4-NEXT: br label [[OMP_PAR_REGION_PARALLEL_AFTER:%.*]], !dbg [[DBG66:![0-9]+]]
981 // CHECK4: omp.par.region.parallel.after:
982 // CHECK4-NEXT: br label [[OMP_PAR_PRE_FINALIZE:%.*]]
983 // CHECK4: omp.par.pre_finalize:
984 // CHECK4-NEXT: br label [[OMP_PAR_OUTLINED_EXIT_EXITSTUB:%.*]], !dbg [[DBG66]]
985 // CHECK4: omp.par.outlined.exit.exitStub:
986 // CHECK4-NEXT: ret void
989 // CHECK4-LABEL: define {{[^@]+}}@_Z3fooIPPcEvT_
990 // CHECK4-SAME: (ptr noundef [[ARGC:%.*]]) #[[ATTR4]] comdat !dbg [[DBG69:![0-9]+]] {
991 // CHECK4-NEXT: entry:
992 // CHECK4-NEXT: [[ARGC_ADDR:%.*]] = alloca ptr, align 8
993 // CHECK4-NEXT: store ptr [[ARGC]], ptr [[ARGC_ADDR]], align 8
994 // CHECK4-NEXT: #dbg_declare(ptr [[ARGC_ADDR]], [[META72:![0-9]+]], !DIExpression(), [[META73:![0-9]+]])
995 // CHECK4-NEXT: ret void, !dbg [[META73]]