1 ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --function-signature --include-generated-funcs
2 ; RUN: opt -S -aa-pipeline= -passes='attributor,cgscc(openmp-opt-cgscc)' -openmp-opt-enable-merging < %s | FileCheck %s --check-prefix=CHECK2
12 ; #pragma omp parallel
17 ; void unmergable_proc_bind(int a) {
18 ; #pragma omp parallel proc_bind(close)
22 ; #pragma omp parallel
27 ; void unmergable_num_threads(int a) {
28 ; #pragma omp parallel num_threads(a)
32 ; #pragma omp parallel
37 ; void unmergable_seq_call(int a) {
38 ; #pragma omp parallel
43 ; #pragma omp parallel
48 ; void merge_seq(int a) {
49 ; #pragma omp parallel
54 ; #pragma omp parallel
60 ; void merge_seq_float(float f, ptr p) {
61 ; #pragma omp parallel
66 ; #pragma omp parallel
71 ; void merge_seq_firstprivate(int a) {
72 ; #pragma omp parallel
77 ; #pragma omp parallel firstprivate(a)
83 ; void merge_seq_sink_lt(int a) {
84 ; #pragma omp parallel
91 ; #pragma omp parallel
96 ; void merge_seq_par_use(int a) {
97 ; #pragma omp parallel
102 ; #pragma omp parallel
108 ; void merge_cancellable_regions(int cancel1, int cancel2)
110 ; #pragma omp parallel
113 ; #pragma omp cancel parallel
116 ; #pragma omp parallel
119 ; #pragma omp cancel parallel
123 ; void merge_cancellable_regions_seq(int cancel1, int cancel2)
125 ; #pragma omp parallel
128 ; #pragma omp cancel parallel
131 ; cancel2 = !cancel1;
132 ; #pragma omp parallel
135 ; #pragma omp cancel parallel
139 ; void merge_3(int a) {
140 ; #pragma omp parallel
144 ; #pragma omp parallel
148 ; #pragma omp parallel
153 ; void merge_3_seq(int a, int b) {
154 ; #pragma omp parallel
159 ; #pragma omp parallel
164 ; #pragma omp parallel
170 ; void unmergable_3_seq_call(int a) {
171 ; #pragma omp parallel
176 ; #pragma omp parallel
181 ; #pragma omp parallel
186 ; void unmergable_3_proc_bind(int a) {
187 ; #pragma omp parallel
191 ; #pragma omp parallel proc_bind(close)
195 ; #pragma omp parallel
200 ; void unmergable_3_num_threads(int a) {
201 ; #pragma omp parallel
205 ; #pragma omp parallel num_threads(a)
209 ; #pragma omp parallel
214 ; void merge_2_unmergable_1(int a) {
215 ; #pragma omp parallel
219 ; #pragma omp parallel
224 ; #pragma omp parallel
229 target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
231 %struct.ident_t = type { i32, i32, i32, i32, ptr }
233 @0 = private unnamed_addr constant [23 x i8] c";unknown;unknown;0;0;;\00", align 1
234 @1 = private unnamed_addr constant %struct.ident_t { i32 0, i32 2, i32 0, i32 0, ptr @0 }, align 8
236 define dso_local void @merge(i32 %a) local_unnamed_addr {
238 %a.addr = alloca i32, align 4
239 store i32 %a, ptr %a.addr, align 4
240 call void (ptr, i32, ptr, ...) @__kmpc_fork_call(ptr nonnull @1, i32 1, ptr @.omp_outlined., ptr nonnull %a.addr)
241 call void (ptr, i32, ptr, ...) @__kmpc_fork_call(ptr nonnull @1, i32 1, ptr @.omp_outlined..1, ptr nonnull %a.addr)
245 define internal void @.omp_outlined.(ptr noalias nocapture readnone %.global_tid., ptr noalias nocapture readnone %.bound_tid., ptr nocapture nonnull readonly align 4 dereferenceable(4) %a) {
247 %0 = load i32, ptr %a, align 4
248 call void @use(i32 %0)
252 declare dso_local void @use(i32) local_unnamed_addr
254 declare !callback !1 void @__kmpc_fork_call(ptr, i32, ptr, ...) local_unnamed_addr
256 define internal void @.omp_outlined..1(ptr noalias nocapture readnone %.global_tid., ptr noalias nocapture readnone %.bound_tid., ptr nocapture nonnull readonly align 4 dereferenceable(4) %a) {
258 %0 = load i32, ptr %a, align 4
259 call void @use(i32 %0)
263 define dso_local void @unmergable_proc_bind(i32 %a) local_unnamed_addr {
265 %a.addr = alloca i32, align 4
266 %0 = call i32 @__kmpc_global_thread_num(ptr nonnull @1)
267 store i32 %a, ptr %a.addr, align 4
268 call void @__kmpc_push_proc_bind(ptr nonnull @1, i32 %0, i32 3)
269 call void (ptr, i32, ptr, ...) @__kmpc_fork_call(ptr nonnull @1, i32 1, ptr @.omp_outlined..2, ptr nonnull %a.addr)
270 call void (ptr, i32, ptr, ...) @__kmpc_fork_call(ptr nonnull @1, i32 1, ptr @.omp_outlined..3, ptr nonnull %a.addr)
274 define internal void @.omp_outlined..2(ptr noalias nocapture readnone %.global_tid., ptr noalias nocapture readnone %.bound_tid., ptr nocapture nonnull readonly align 4 dereferenceable(4) %a) {
276 %0 = load i32, ptr %a, align 4
277 call void @use(i32 %0)
281 declare i32 @__kmpc_global_thread_num(ptr) local_unnamed_addr
283 declare void @__kmpc_push_proc_bind(ptr, i32, i32) local_unnamed_addr
285 define internal void @.omp_outlined..3(ptr noalias nocapture readnone %.global_tid., ptr noalias nocapture readnone %.bound_tid., ptr nocapture nonnull readonly align 4 dereferenceable(4) %a) {
287 %0 = load i32, ptr %a, align 4
288 call void @use(i32 %0)
292 define dso_local void @unmergable_num_threads(i32 %a) local_unnamed_addr {
294 %a.addr = alloca i32, align 4
295 %0 = call i32 @__kmpc_global_thread_num(ptr nonnull @1)
296 store i32 %a, ptr %a.addr, align 4
297 call void @__kmpc_push_num_threads(ptr nonnull @1, i32 %0, i32 %a)
298 call void (ptr, i32, ptr, ...) @__kmpc_fork_call(ptr nonnull @1, i32 1, ptr @.omp_outlined..4, ptr nonnull %a.addr)
299 call void (ptr, i32, ptr, ...) @__kmpc_fork_call(ptr nonnull @1, i32 1, ptr @.omp_outlined..5, ptr nonnull %a.addr)
303 define internal void @.omp_outlined..4(ptr noalias nocapture readnone %.global_tid., ptr noalias nocapture readnone %.bound_tid., ptr nocapture nonnull readonly align 4 dereferenceable(4) %a) {
305 %0 = load i32, ptr %a, align 4
306 call void @use(i32 %0)
310 declare void @__kmpc_push_num_threads(ptr, i32, i32) local_unnamed_addr
312 define internal void @.omp_outlined..5(ptr noalias nocapture readnone %.global_tid., ptr noalias nocapture readnone %.bound_tid., ptr nocapture nonnull readonly align 4 dereferenceable(4) %a) {
314 %0 = load i32, ptr %a, align 4
315 call void @use(i32 %0)
319 define dso_local void @unmergable_seq_call(i32 %a) local_unnamed_addr {
321 %a.addr = alloca i32, align 4
322 store i32 %a, ptr %a.addr, align 4
323 call void (ptr, i32, ptr, ...) @__kmpc_fork_call(ptr nonnull @1, i32 1, ptr @.omp_outlined..6, ptr nonnull %a.addr)
324 call void (...) @foo()
325 call void (ptr, i32, ptr, ...) @__kmpc_fork_call(ptr nonnull @1, i32 1, ptr @.omp_outlined..7, ptr nonnull %a.addr)
329 define internal void @.omp_outlined..6(ptr noalias nocapture readnone %.global_tid., ptr noalias nocapture readnone %.bound_tid., ptr nocapture nonnull readonly align 4 dereferenceable(4) %a) {
331 %0 = load i32, ptr %a, align 4
332 call void @use(i32 %0)
336 declare dso_local void @foo(...) local_unnamed_addr
338 define internal void @.omp_outlined..7(ptr noalias nocapture readnone %.global_tid., ptr noalias nocapture readnone %.bound_tid., ptr nocapture nonnull readonly align 4 dereferenceable(4) %a) {
340 %0 = load i32, ptr %a, align 4
341 call void @use(i32 %0)
345 define dso_local void @merge_seq(i32 %a) local_unnamed_addr {
347 %a.addr = alloca i32, align 4
348 store i32 %a, ptr %a.addr, align 4
349 call void (ptr, i32, ptr, ...) @__kmpc_fork_call(ptr nonnull @1, i32 1, ptr @.omp_outlined..8, ptr nonnull %a.addr)
350 %0 = load i32, ptr %a.addr, align 4
351 %add = add nsw i32 %0, 1
352 store i32 %add, ptr %a.addr, align 4
353 call void (ptr, i32, ptr, ...) @__kmpc_fork_call(ptr nonnull @1, i32 1, ptr @.omp_outlined..9, ptr nonnull %a.addr)
354 %1 = load i32, ptr %a.addr, align 4
355 call void @use(i32 %1)
359 define internal void @.omp_outlined..8(ptr noalias nocapture readnone %.global_tid., ptr noalias nocapture readnone %.bound_tid., ptr nocapture nonnull readonly align 4 dereferenceable(4) %a) {
361 %0 = load i32, ptr %a, align 4
362 call void @use(i32 %0)
366 define internal void @.omp_outlined..9(ptr noalias nocapture readnone %.global_tid., ptr noalias nocapture readnone %.bound_tid., ptr nocapture nonnull readonly align 4 dereferenceable(4) %a) {
368 %0 = load i32, ptr %a, align 4
369 call void @use(i32 %0)
373 define dso_local void @merge_seq_float(float %f, ptr nocapture %p) local_unnamed_addr {
375 %f.addr = alloca float, align 4
376 store float %f, ptr %f.addr, align 4
377 call void (ptr, i32, ptr, ...) @__kmpc_fork_call(ptr nonnull @1, i32 1, ptr @.omp_outlined..10, ptr nonnull %f.addr)
378 %0 = load float, ptr %f.addr, align 4
379 %add = fadd float %0, 0x40091EB860000000
380 store float %add, ptr %p, align 4
381 call void (ptr, i32, ptr, ...) @__kmpc_fork_call(ptr nonnull @1, i32 1, ptr @.omp_outlined..11, ptr nonnull %f.addr)
385 define internal void @.omp_outlined..10(ptr noalias nocapture readnone %.global_tid., ptr noalias nocapture readnone %.bound_tid., ptr nocapture nonnull readonly align 4 dereferenceable(4) %f) {
387 %0 = load float, ptr %f, align 4
388 %conv = fptosi float %0 to i32
389 call void @use(i32 %conv)
393 define internal void @.omp_outlined..11(ptr noalias nocapture readnone %.global_tid., ptr noalias nocapture readnone %.bound_tid., ptr nocapture nonnull readonly align 4 dereferenceable(4) %f) {
395 %0 = load float, ptr %f, align 4
396 %conv = fptosi float %0 to i32
397 call void @use(i32 %conv)
401 define dso_local void @merge_seq_firstprivate(i32 %a) local_unnamed_addr {
403 %a.addr = alloca i32, align 4
404 store i32 %a, ptr %a.addr, align 4
405 call void (ptr, i32, ptr, ...) @__kmpc_fork_call(ptr nonnull @1, i32 1, ptr @.omp_outlined..12, ptr nonnull %a.addr)
406 %0 = load i32, ptr %a.addr, align 4
407 %add = add nsw i32 %0, 1
408 store i32 %add, ptr %a.addr, align 4
409 %a.casted.sroa.0.0.insert.ext = zext i32 %add to i64
410 call void (ptr, i32, ptr, ...) @__kmpc_fork_call(ptr nonnull @1, i32 1, ptr @.omp_outlined..13, i64 %a.casted.sroa.0.0.insert.ext)
411 %1 = load i32, ptr %a.addr, align 4
412 call void @use(i32 %1)
416 define internal void @.omp_outlined..12(ptr noalias nocapture readnone %.global_tid., ptr noalias nocapture readnone %.bound_tid., ptr nocapture nonnull readonly align 4 dereferenceable(4) %a) {
418 %0 = load i32, ptr %a, align 4
419 call void @use(i32 %0)
423 define internal void @.omp_outlined..13(ptr noalias nocapture readnone %.global_tid., ptr noalias nocapture readnone %.bound_tid., i64 %a) {
425 %a.addr.sroa.0.0.extract.trunc = trunc i64 %a to i32
426 call void @use(i32 %a.addr.sroa.0.0.extract.trunc)
430 define dso_local void @merge_seq_sink_lt(i32 %a) local_unnamed_addr {
432 %a.addr = alloca i32, align 4
433 %b = alloca i32, align 4
434 store i32 %a, ptr %a.addr, align 4
435 call void (ptr, i32, ptr, ...) @__kmpc_fork_call(ptr nonnull @1, i32 1, ptr @.omp_outlined..14, ptr nonnull %a.addr)
436 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b)
437 %0 = ptrtoint ptr %b to i64
438 %1 = trunc i64 %0 to i32
439 store i32 %1, ptr %b, align 4
440 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b)
441 call void (ptr, i32, ptr, ...) @__kmpc_fork_call(ptr nonnull @1, i32 1, ptr @.omp_outlined..15, ptr nonnull %a.addr)
445 define internal void @.omp_outlined..14(ptr noalias nocapture readnone %.global_tid., ptr noalias nocapture readnone %.bound_tid., ptr nocapture nonnull readonly align 4 dereferenceable(4) %a) {
447 %0 = load i32, ptr %a, align 4
448 call void @use(i32 %0)
452 declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture)
454 declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture)
456 define internal void @.omp_outlined..15(ptr noalias nocapture readnone %.global_tid., ptr noalias nocapture readnone %.bound_tid., ptr nocapture nonnull readonly align 4 dereferenceable(4) %a) {
458 %0 = load i32, ptr %a, align 4
459 call void @use(i32 %0)
463 define dso_local void @merge_seq_par_use(i32 %a) local_unnamed_addr {
465 %a.addr = alloca i32, align 4
466 %b = alloca i32, align 4
467 store i32 %a, ptr %a.addr, align 4
468 call void (ptr, i32, ptr, ...) @__kmpc_fork_call(ptr nonnull @1, i32 1, ptr @.omp_outlined..16, ptr nonnull %a.addr)
469 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b)
470 %0 = load i32, ptr %a.addr, align 4
471 %add = add nsw i32 %0, 1
472 store i32 %add, ptr %b, align 4
473 call void (ptr, i32, ptr, ...) @__kmpc_fork_call(ptr nonnull @1, i32 2, ptr @.omp_outlined..17, ptr nonnull %a.addr, ptr nonnull %b)
474 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b)
478 define internal void @.omp_outlined..16(ptr noalias nocapture readnone %.global_tid., ptr noalias nocapture readnone %.bound_tid., ptr nocapture nonnull readonly align 4 dereferenceable(4) %a) {
480 %0 = load i32, ptr %a, align 4
481 call void @use(i32 %0)
485 define internal void @.omp_outlined..17(ptr noalias nocapture readnone %.global_tid., ptr noalias nocapture readnone %.bound_tid., ptr nocapture nonnull readonly align 4 dereferenceable(4) %a, ptr nocapture nonnull readonly align 4 dereferenceable(4) %b) {
487 %0 = load i32, ptr %a, align 4
488 call void @use(i32 %0)
489 %1 = load i32, ptr %b, align 4
490 call void @use(i32 %1)
494 define dso_local void @merge_cancellable_regions(i32 %cancel1, i32 %cancel2) local_unnamed_addr {
496 %cancel1.addr = alloca i32, align 4
497 %cancel2.addr = alloca i32, align 4
498 store i32 %cancel1, ptr %cancel1.addr, align 4
499 store i32 %cancel2, ptr %cancel2.addr, align 4
500 call void (ptr, i32, ptr, ...) @__kmpc_fork_call(ptr nonnull @1, i32 1, ptr @.omp_outlined..18, ptr nonnull %cancel1.addr)
501 call void (ptr, i32, ptr, ...) @__kmpc_fork_call(ptr nonnull @1, i32 1, ptr @.omp_outlined..19, ptr nonnull %cancel2.addr)
505 define internal void @.omp_outlined..18(ptr noalias nocapture readonly %.global_tid., ptr noalias nocapture readnone %.bound_tid., ptr nocapture nonnull readonly align 4 dereferenceable(4) %cancel1) {
507 %0 = load i32, ptr %cancel1, align 4
508 %tobool.not = icmp eq i32 %0, 0
509 br i1 %tobool.not, label %if.end, label %if.then
511 if.then: ; preds = %entry
512 %1 = load i32, ptr %.global_tid., align 4
513 %2 = call i32 @__kmpc_cancel(ptr nonnull @1, i32 %1, i32 1)
516 if.end: ; preds = %entry
520 declare i32 @__kmpc_cancel(ptr, i32, i32) local_unnamed_addr
522 define internal void @.omp_outlined..19(ptr noalias nocapture readonly %.global_tid., ptr noalias nocapture readnone %.bound_tid., ptr nocapture nonnull readonly align 4 dereferenceable(4) %cancel2) {
524 %0 = load i32, ptr %cancel2, align 4
525 %tobool.not = icmp eq i32 %0, 0
526 br i1 %tobool.not, label %if.end, label %if.then
528 if.then: ; preds = %entry
529 %1 = load i32, ptr %.global_tid., align 4
530 %2 = call i32 @__kmpc_cancel(ptr nonnull @1, i32 %1, i32 1)
533 if.end: ; preds = %entry
537 define dso_local void @merge_cancellable_regions_seq(i32 %cancel1, i32 %cancel2) local_unnamed_addr {
539 %cancel1.addr = alloca i32, align 4
540 %cancel2.addr = alloca i32, align 4
541 store i32 %cancel1, ptr %cancel1.addr, align 4
542 store i32 %cancel2, ptr %cancel2.addr, align 4
543 call void (ptr, i32, ptr, ...) @__kmpc_fork_call(ptr nonnull @1, i32 1, ptr @.omp_outlined..20, ptr nonnull %cancel1.addr)
544 %0 = load i32, ptr %cancel1.addr, align 4
545 %tobool.not = icmp eq i32 %0, 0
546 %lnot.ext = zext i1 %tobool.not to i32
547 store i32 %lnot.ext, ptr %cancel2.addr, align 4
548 call void (ptr, i32, ptr, ...) @__kmpc_fork_call(ptr nonnull @1, i32 1, ptr @.omp_outlined..21, ptr nonnull %cancel2.addr)
552 define internal void @.omp_outlined..20(ptr noalias nocapture readonly %.global_tid., ptr noalias nocapture readnone %.bound_tid., ptr nocapture nonnull readonly align 4 dereferenceable(4) %cancel1) {
554 %0 = load i32, ptr %cancel1, align 4
555 %tobool.not = icmp eq i32 %0, 0
556 br i1 %tobool.not, label %if.end, label %if.then
558 if.then: ; preds = %entry
559 %1 = load i32, ptr %.global_tid., align 4
560 %2 = call i32 @__kmpc_cancel(ptr nonnull @1, i32 %1, i32 1)
563 if.end: ; preds = %entry
567 define internal void @.omp_outlined..21(ptr noalias nocapture readonly %.global_tid., ptr noalias nocapture readnone %.bound_tid., ptr nocapture nonnull readonly align 4 dereferenceable(4) %cancel2) {
569 %0 = load i32, ptr %cancel2, align 4
570 %tobool.not = icmp eq i32 %0, 0
571 br i1 %tobool.not, label %if.end, label %if.then
573 if.then: ; preds = %entry
574 %1 = load i32, ptr %.global_tid., align 4
575 %2 = call i32 @__kmpc_cancel(ptr nonnull @1, i32 %1, i32 1)
578 if.end: ; preds = %entry
582 define dso_local void @merge_3(i32 %a) local_unnamed_addr {
584 %a.addr = alloca i32, align 4
585 store i32 %a, ptr %a.addr, align 4
586 call void (ptr, i32, ptr, ...) @__kmpc_fork_call(ptr nonnull @1, i32 1, ptr @.omp_outlined..22, ptr nonnull %a.addr)
587 call void (ptr, i32, ptr, ...) @__kmpc_fork_call(ptr nonnull @1, i32 1, ptr @.omp_outlined..23, ptr nonnull %a.addr)
588 call void (ptr, i32, ptr, ...) @__kmpc_fork_call(ptr nonnull @1, i32 1, ptr @.omp_outlined..24, ptr nonnull %a.addr)
592 define internal void @.omp_outlined..22(ptr noalias nocapture readnone %.global_tid., ptr noalias nocapture readnone %.bound_tid., ptr nocapture nonnull readonly align 4 dereferenceable(4) %a) {
594 %0 = load i32, ptr %a, align 4
595 call void @use(i32 %0)
599 define internal void @.omp_outlined..23(ptr noalias nocapture readnone %.global_tid., ptr noalias nocapture readnone %.bound_tid., ptr nocapture nonnull readonly align 4 dereferenceable(4) %a) {
601 %0 = load i32, ptr %a, align 4
602 call void @use(i32 %0)
606 define internal void @.omp_outlined..24(ptr noalias nocapture readnone %.global_tid., ptr noalias nocapture readnone %.bound_tid., ptr nocapture nonnull readonly align 4 dereferenceable(4) %a) {
608 %0 = load i32, ptr %a, align 4
609 call void @use(i32 %0)
613 define dso_local void @merge_3_seq(i32 %a, i32 %b) local_unnamed_addr {
615 %a.addr = alloca i32, align 4
616 store i32 %a, ptr %a.addr, align 4
617 call void (ptr, i32, ptr, ...) @__kmpc_fork_call(ptr nonnull @1, i32 1, ptr @.omp_outlined..25, ptr nonnull %a.addr)
618 %0 = load i32, ptr %a.addr, align 4
619 %add = add nsw i32 %0, 1
620 call void (ptr, i32, ptr, ...) @__kmpc_fork_call(ptr nonnull @1, i32 1, ptr @.omp_outlined..26, ptr nonnull %a.addr)
621 %1 = load i32, ptr %a.addr, align 4
622 %add1 = add nsw i32 %add, %1
623 call void (ptr, i32, ptr, ...) @__kmpc_fork_call(ptr nonnull @1, i32 1, ptr @.omp_outlined..27, ptr nonnull %a.addr)
624 call void @use(i32 %add1)
628 define internal void @.omp_outlined..25(ptr noalias nocapture readnone %.global_tid., ptr noalias nocapture readnone %.bound_tid., ptr nocapture nonnull readonly align 4 dereferenceable(4) %a) {
630 %0 = load i32, ptr %a, align 4
631 call void @use(i32 %0)
635 define internal void @.omp_outlined..26(ptr noalias nocapture readnone %.global_tid., ptr noalias nocapture readnone %.bound_tid., ptr nocapture nonnull readonly align 4 dereferenceable(4) %a) {
637 %0 = load i32, ptr %a, align 4
638 call void @use(i32 %0)
642 define internal void @.omp_outlined..27(ptr noalias nocapture readnone %.global_tid., ptr noalias nocapture readnone %.bound_tid., ptr nocapture nonnull readonly align 4 dereferenceable(4) %a) {
644 %0 = load i32, ptr %a, align 4
645 call void @use(i32 %0)
649 define dso_local void @unmergable_3_seq_call(i32 %a) local_unnamed_addr {
651 %a.addr = alloca i32, align 4
652 store i32 %a, ptr %a.addr, align 4
653 call void (ptr, i32, ptr, ...) @__kmpc_fork_call(ptr nonnull @1, i32 1, ptr @.omp_outlined..28, ptr nonnull %a.addr)
654 call void (...) @foo()
655 call void (ptr, i32, ptr, ...) @__kmpc_fork_call(ptr nonnull @1, i32 1, ptr @.omp_outlined..29, ptr nonnull %a.addr)
656 call void (...) @foo()
657 call void (ptr, i32, ptr, ...) @__kmpc_fork_call(ptr nonnull @1, i32 1, ptr @.omp_outlined..30, ptr nonnull %a.addr)
661 define internal void @.omp_outlined..28(ptr noalias nocapture readnone %.global_tid., ptr noalias nocapture readnone %.bound_tid., ptr nocapture nonnull readonly align 4 dereferenceable(4) %a) {
663 %0 = load i32, ptr %a, align 4
664 call void @use(i32 %0)
668 define internal void @.omp_outlined..29(ptr noalias nocapture readnone %.global_tid., ptr noalias nocapture readnone %.bound_tid., ptr nocapture nonnull readonly align 4 dereferenceable(4) %a) {
670 %0 = load i32, ptr %a, align 4
671 call void @use(i32 %0)
675 define internal void @.omp_outlined..30(ptr noalias nocapture readnone %.global_tid., ptr noalias nocapture readnone %.bound_tid., ptr nocapture nonnull readonly align 4 dereferenceable(4) %a) {
677 %0 = load i32, ptr %a, align 4
678 call void @use(i32 %0)
682 define dso_local void @unmergable_3_proc_bind(i32 %a) local_unnamed_addr {
684 %a.addr = alloca i32, align 4
685 %0 = call i32 @__kmpc_global_thread_num(ptr nonnull @1)
686 store i32 %a, ptr %a.addr, align 4
687 call void (ptr, i32, ptr, ...) @__kmpc_fork_call(ptr nonnull @1, i32 1, ptr @.omp_outlined..31, ptr nonnull %a.addr)
688 call void @__kmpc_push_proc_bind(ptr nonnull @1, i32 %0, i32 3)
689 call void (ptr, i32, ptr, ...) @__kmpc_fork_call(ptr nonnull @1, i32 1, ptr @.omp_outlined..32, ptr nonnull %a.addr)
690 call void (ptr, i32, ptr, ...) @__kmpc_fork_call(ptr nonnull @1, i32 1, ptr @.omp_outlined..33, ptr nonnull %a.addr)
694 define internal void @.omp_outlined..31(ptr noalias nocapture readnone %.global_tid., ptr noalias nocapture readnone %.bound_tid., ptr nocapture nonnull readonly align 4 dereferenceable(4) %a) {
696 %0 = load i32, ptr %a, align 4
697 call void @use(i32 %0)
701 define internal void @.omp_outlined..32(ptr noalias nocapture readnone %.global_tid., ptr noalias nocapture readnone %.bound_tid., ptr nocapture nonnull readonly align 4 dereferenceable(4) %a) {
703 %0 = load i32, ptr %a, align 4
704 call void @use(i32 %0)
708 define internal void @.omp_outlined..33(ptr noalias nocapture readnone %.global_tid., ptr noalias nocapture readnone %.bound_tid., ptr nocapture nonnull readonly align 4 dereferenceable(4) %a) {
710 %0 = load i32, ptr %a, align 4
711 call void @use(i32 %0)
715 define dso_local void @unmergable_3_num_threads(i32 %a) local_unnamed_addr {
717 %a.addr = alloca i32, align 4
718 %0 = call i32 @__kmpc_global_thread_num(ptr nonnull @1)
719 store i32 %a, ptr %a.addr, align 4
720 call void (ptr, i32, ptr, ...) @__kmpc_fork_call(ptr nonnull @1, i32 1, ptr @.omp_outlined..34, ptr nonnull %a.addr)
721 %1 = load i32, ptr %a.addr, align 4
722 call void @__kmpc_push_num_threads(ptr nonnull @1, i32 %0, i32 %1)
723 call void (ptr, i32, ptr, ...) @__kmpc_fork_call(ptr nonnull @1, i32 1, ptr @.omp_outlined..35, ptr nonnull %a.addr)
724 call void (ptr, i32, ptr, ...) @__kmpc_fork_call(ptr nonnull @1, i32 1, ptr @.omp_outlined..36, ptr nonnull %a.addr)
728 define internal void @.omp_outlined..34(ptr noalias nocapture readnone %.global_tid., ptr noalias nocapture readnone %.bound_tid., ptr nocapture nonnull readonly align 4 dereferenceable(4) %a) {
730 %0 = load i32, ptr %a, align 4
731 call void @use(i32 %0)
735 define internal void @.omp_outlined..35(ptr noalias nocapture readnone %.global_tid., ptr noalias nocapture readnone %.bound_tid., ptr nocapture nonnull readonly align 4 dereferenceable(4) %a) {
737 %0 = load i32, ptr %a, align 4
738 call void @use(i32 %0)
742 define internal void @.omp_outlined..36(ptr noalias nocapture readnone %.global_tid., ptr noalias nocapture readnone %.bound_tid., ptr nocapture nonnull readonly align 4 dereferenceable(4) %a) {
744 %0 = load i32, ptr %a, align 4
745 call void @use(i32 %0)
749 define dso_local void @merge_2_unmergable_1(i32 %a) local_unnamed_addr {
751 %a.addr = alloca i32, align 4
752 store i32 %a, ptr %a.addr, align 4
753 call void (ptr, i32, ptr, ...) @__kmpc_fork_call(ptr nonnull @1, i32 1, ptr @.omp_outlined..37, ptr nonnull %a.addr)
754 call void (ptr, i32, ptr, ...) @__kmpc_fork_call(ptr nonnull @1, i32 1, ptr @.omp_outlined..38, ptr nonnull %a.addr)
755 call void (...) @foo()
756 call void (ptr, i32, ptr, ...) @__kmpc_fork_call(ptr nonnull @1, i32 1, ptr @.omp_outlined..39, ptr nonnull %a.addr)
760 define internal void @.omp_outlined..37(ptr noalias nocapture readnone %.global_tid., ptr noalias nocapture readnone %.bound_tid., ptr nocapture nonnull readonly align 4 dereferenceable(4) %a) {
762 %0 = load i32, ptr %a, align 4
763 call void @use(i32 %0)
767 define internal void @.omp_outlined..38(ptr noalias nocapture readnone %.global_tid., ptr noalias nocapture readnone %.bound_tid., ptr nocapture nonnull readonly align 4 dereferenceable(4) %a) {
769 %0 = load i32, ptr %a, align 4
770 call void @use(i32 %0)
774 define internal void @.omp_outlined..39(ptr noalias nocapture readnone %.global_tid., ptr noalias nocapture readnone %.bound_tid., ptr nocapture nonnull readonly align 4 dereferenceable(4) %a) {
776 %0 = load i32, ptr %a, align 4
777 call void @use(i32 %0)
782 !llvm.module.flags = !{!0, !3}
784 !0 = !{i32 1, !"wchar_size", i32 4}
786 !2 = !{i64 2, i64 -1, i64 -1, i1 true}
787 !3 = !{i32 7, !"openmp", i32 50}
788 ; CHECK-LABEL: define {{[^@]+}}@merge
789 ; CHECK-SAME: (i32 [[A:%.*]]) local_unnamed_addr {
791 ; CHECK-NEXT: [[A_ADDR:%.*]] = alloca i32, align 4
792 ; CHECK-NEXT: store i32 [[A]], ptr [[A_ADDR]], align 4
793 ; CHECK-NEXT: [[OMP_GLOBAL_THREAD_NUM:%.*]] = call i32 @__kmpc_global_thread_num(ptr @[[GLOB1:[0-9]+]])
794 ; CHECK-NEXT: br label [[OMP_PARALLEL:%.*]]
795 ; CHECK: omp_parallel:
796 ; CHECK-NEXT: call void (ptr, i32, ptr, ...) @__kmpc_fork_call(ptr @[[GLOB1]], i32 1, ptr @merge..omp_par, ptr [[A_ADDR]])
797 ; CHECK-NEXT: br label [[OMP_PAR_OUTLINED_EXIT:%.*]]
798 ; CHECK: omp.par.outlined.exit:
799 ; CHECK-NEXT: br label [[OMP_PAR_EXIT_SPLIT:%.*]]
800 ; CHECK: omp.par.exit.split:
801 ; CHECK-NEXT: br label [[ENTRY_SPLIT_SPLIT:%.*]]
802 ; CHECK: entry.split.split:
803 ; CHECK-NEXT: ret void
804 ; CHECK-LABEL: define {{[^@]+}}@merge..omp_par
805 ; CHECK-SAME: (ptr noalias [[TID_ADDR:%.*]], ptr noalias [[ZERO_ADDR:%.*]], ptr [[A_ADDR:%.*]]) #[[ATTR0:[0-9]+]] {
806 ; CHECK-NEXT: omp.par.entry:
807 ; CHECK-NEXT: [[TID_ADDR_LOCAL:%.*]] = alloca i32, align 4
808 ; CHECK-NEXT: [[TMP0:%.*]] = load i32, ptr [[TID_ADDR]], align 4
809 ; CHECK-NEXT: store i32 [[TMP0]], ptr [[TID_ADDR_LOCAL]], align 4
810 ; CHECK-NEXT: [[TID:%.*]] = load i32, ptr [[TID_ADDR_LOCAL]], align 4
811 ; CHECK-NEXT: br label [[OMP_PAR_REGION:%.*]]
812 ; CHECK: omp.par.outlined.exit.exitStub:
813 ; CHECK-NEXT: ret void
814 ; CHECK: omp.par.region:
815 ; CHECK-NEXT: br label [[OMP_PAR_MERGED:%.*]]
816 ; CHECK: omp.par.merged:
817 ; CHECK-NEXT: call void @.omp_outlined.(ptr [[TID_ADDR]], ptr [[ZERO_ADDR]], ptr nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[A_ADDR]])
818 ; CHECK-NEXT: [[OMP_GLOBAL_THREAD_NUM:%.*]] = call i32 @__kmpc_global_thread_num(ptr @[[GLOB1]])
819 ; CHECK-NEXT: call void @__kmpc_barrier(ptr @[[GLOB2:[0-9]+]], i32 [[OMP_GLOBAL_THREAD_NUM]])
820 ; CHECK-NEXT: call void @.omp_outlined..1(ptr [[TID_ADDR]], ptr [[ZERO_ADDR]], ptr nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[A_ADDR]])
821 ; CHECK-NEXT: br label [[ENTRY_SPLIT:%.*]]
822 ; CHECK: entry.split:
823 ; CHECK-NEXT: br label [[OMP_PAR_REGION_SPLIT:%.*]]
824 ; CHECK: omp.par.region.split:
825 ; CHECK-NEXT: br label [[OMP_PAR_PRE_FINALIZE:%.*]]
826 ; CHECK: omp.par.pre_finalize:
827 ; CHECK-NEXT: br label [[OMP_PAR_OUTLINED_EXIT_EXITSTUB:%.*]]
828 ; CHECK-LABEL: define {{[^@]+}}@.omp_outlined.
829 ; CHECK-SAME: (ptr noalias nocapture nofree readnone [[DOTGLOBAL_TID_:%.*]], ptr noalias nocapture nofree readnone [[DOTBOUND_TID_:%.*]], ptr nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[A:%.*]]) {
831 ; CHECK-NEXT: [[TMP0:%.*]] = load i32, ptr [[A]], align 4
832 ; CHECK-NEXT: call void @use(i32 [[TMP0]])
833 ; CHECK-NEXT: ret void
834 ; CHECK-LABEL: define {{[^@]+}}@.omp_outlined..1
835 ; CHECK-SAME: (ptr noalias nocapture nofree readnone [[DOTGLOBAL_TID_:%.*]], ptr noalias nocapture nofree readnone [[DOTBOUND_TID_:%.*]], ptr nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[A:%.*]]) {
837 ; CHECK-NEXT: [[TMP0:%.*]] = load i32, ptr [[A]], align 4
838 ; CHECK-NEXT: call void @use(i32 [[TMP0]])
839 ; CHECK-NEXT: ret void
840 ; CHECK-LABEL: define {{[^@]+}}@unmergable_proc_bind
841 ; CHECK-SAME: (i32 [[A:%.*]]) local_unnamed_addr {
843 ; CHECK-NEXT: [[A_ADDR:%.*]] = alloca i32, align 4
844 ; CHECK-NEXT: [[TMP0:%.*]] = call i32 @__kmpc_global_thread_num(ptr noundef nonnull align 8 dereferenceable(24) @[[GLOB1]])
845 ; CHECK-NEXT: store i32 [[A]], ptr [[A_ADDR]], align 4
846 ; CHECK-NEXT: call void @__kmpc_push_proc_bind(ptr noundef nonnull align 8 dereferenceable(24) @[[GLOB1]], i32 [[TMP0]], i32 noundef 3)
847 ; CHECK-NEXT: call void (ptr, i32, ptr, ...) @__kmpc_fork_call(ptr noundef nonnull align 8 dereferenceable(24) @[[GLOB1]], i32 noundef 1, ptr noundef @.omp_outlined..2, ptr nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[A_ADDR]])
848 ; CHECK-NEXT: call void (ptr, i32, ptr, ...) @__kmpc_fork_call(ptr noundef nonnull align 8 dereferenceable(24) @[[GLOB1]], i32 noundef 1, ptr noundef @.omp_outlined..3, ptr nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[A_ADDR]])
849 ; CHECK-NEXT: ret void
850 ; CHECK-LABEL: define {{[^@]+}}@.omp_outlined..2
851 ; CHECK-SAME: (ptr noalias nocapture nofree readnone [[DOTGLOBAL_TID_:%.*]], ptr noalias nocapture nofree readnone [[DOTBOUND_TID_:%.*]], ptr nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[A:%.*]]) {
853 ; CHECK-NEXT: [[TMP0:%.*]] = load i32, ptr [[A]], align 4
854 ; CHECK-NEXT: call void @use(i32 [[TMP0]])
855 ; CHECK-NEXT: ret void
856 ; CHECK-LABEL: define {{[^@]+}}@.omp_outlined..3
857 ; CHECK-SAME: (ptr noalias nocapture nofree readnone [[DOTGLOBAL_TID_:%.*]], ptr noalias nocapture nofree readnone [[DOTBOUND_TID_:%.*]], ptr nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[A:%.*]]) {
859 ; CHECK-NEXT: [[TMP0:%.*]] = load i32, ptr [[A]], align 4
860 ; CHECK-NEXT: call void @use(i32 [[TMP0]])
861 ; CHECK-NEXT: ret void
862 ; CHECK-LABEL: define {{[^@]+}}@unmergable_num_threads
863 ; CHECK-SAME: (i32 [[A:%.*]]) local_unnamed_addr {
865 ; CHECK-NEXT: [[A_ADDR:%.*]] = alloca i32, align 4
866 ; CHECK-NEXT: [[TMP0:%.*]] = call i32 @__kmpc_global_thread_num(ptr noundef nonnull align 8 dereferenceable(24) @[[GLOB1]])
867 ; CHECK-NEXT: store i32 [[A]], ptr [[A_ADDR]], align 4
868 ; CHECK-NEXT: call void @__kmpc_push_num_threads(ptr noundef nonnull align 8 dereferenceable(24) @[[GLOB1]], i32 [[TMP0]], i32 [[A]])
869 ; CHECK-NEXT: call void (ptr, i32, ptr, ...) @__kmpc_fork_call(ptr noundef nonnull align 8 dereferenceable(24) @[[GLOB1]], i32 noundef 1, ptr noundef @.omp_outlined..4, ptr nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[A_ADDR]])
870 ; CHECK-NEXT: call void (ptr, i32, ptr, ...) @__kmpc_fork_call(ptr noundef nonnull align 8 dereferenceable(24) @[[GLOB1]], i32 noundef 1, ptr noundef @.omp_outlined..5, ptr nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[A_ADDR]])
871 ; CHECK-NEXT: ret void
872 ; CHECK-LABEL: define {{[^@]+}}@.omp_outlined..4
873 ; CHECK-SAME: (ptr noalias nocapture nofree readnone [[DOTGLOBAL_TID_:%.*]], ptr noalias nocapture nofree readnone [[DOTBOUND_TID_:%.*]], ptr nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[A:%.*]]) {
875 ; CHECK-NEXT: [[TMP0:%.*]] = load i32, ptr [[A]], align 4
876 ; CHECK-NEXT: call void @use(i32 [[TMP0]])
877 ; CHECK-NEXT: ret void
878 ; CHECK-LABEL: define {{[^@]+}}@.omp_outlined..5
879 ; CHECK-SAME: (ptr noalias nocapture nofree readnone [[DOTGLOBAL_TID_:%.*]], ptr noalias nocapture nofree readnone [[DOTBOUND_TID_:%.*]], ptr nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[A:%.*]]) {
881 ; CHECK-NEXT: [[TMP0:%.*]] = load i32, ptr [[A]], align 4
882 ; CHECK-NEXT: call void @use(i32 [[TMP0]])
883 ; CHECK-NEXT: ret void
884 ; CHECK-LABEL: define {{[^@]+}}@unmergable_seq_call
885 ; CHECK-SAME: (i32 [[A:%.*]]) local_unnamed_addr {
887 ; CHECK-NEXT: [[A_ADDR:%.*]] = alloca i32, align 4
888 ; CHECK-NEXT: store i32 [[A]], ptr [[A_ADDR]], align 4
889 ; CHECK-NEXT: call void (ptr, i32, ptr, ...) @__kmpc_fork_call(ptr noundef nonnull align 8 dereferenceable(24) @[[GLOB1]], i32 noundef 1, ptr noundef @.omp_outlined..6, ptr nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[A_ADDR]])
890 ; CHECK-NEXT: call void (...) @foo()
891 ; CHECK-NEXT: call void (ptr, i32, ptr, ...) @__kmpc_fork_call(ptr noundef nonnull align 8 dereferenceable(24) @[[GLOB1]], i32 noundef 1, ptr noundef @.omp_outlined..7, ptr nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[A_ADDR]])
892 ; CHECK-NEXT: ret void
893 ; CHECK-LABEL: define {{[^@]+}}@.omp_outlined..6
894 ; CHECK-SAME: (ptr noalias nocapture nofree readnone [[DOTGLOBAL_TID_:%.*]], ptr noalias nocapture nofree readnone [[DOTBOUND_TID_:%.*]], ptr nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[A:%.*]]) {
896 ; CHECK-NEXT: [[TMP0:%.*]] = load i32, ptr [[A]], align 4
897 ; CHECK-NEXT: call void @use(i32 [[TMP0]])
898 ; CHECK-NEXT: ret void
899 ; CHECK-LABEL: define {{[^@]+}}@.omp_outlined..7
900 ; CHECK-SAME: (ptr noalias nocapture nofree readnone [[DOTGLOBAL_TID_:%.*]], ptr noalias nocapture nofree readnone [[DOTBOUND_TID_:%.*]], ptr nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[A:%.*]]) {
902 ; CHECK-NEXT: [[TMP0:%.*]] = load i32, ptr [[A]], align 4
903 ; CHECK-NEXT: call void @use(i32 [[TMP0]])
904 ; CHECK-NEXT: ret void
905 ; CHECK-LABEL: define {{[^@]+}}@merge_seq
906 ; CHECK-SAME: (i32 [[A:%.*]]) local_unnamed_addr {
908 ; CHECK-NEXT: [[A_ADDR:%.*]] = alloca i32, align 4
909 ; CHECK-NEXT: store i32 [[A]], ptr [[A_ADDR]], align 4
910 ; CHECK-NEXT: [[OMP_GLOBAL_THREAD_NUM2:%.*]] = call i32 @__kmpc_global_thread_num(ptr @[[GLOB1]])
911 ; CHECK-NEXT: br label [[OMP_PARALLEL:%.*]]
912 ; CHECK: omp_parallel:
913 ; CHECK-NEXT: call void (ptr, i32, ptr, ...) @__kmpc_fork_call(ptr @[[GLOB1]], i32 1, ptr @merge_seq..omp_par, ptr [[A_ADDR]])
914 ; CHECK-NEXT: br label [[OMP_PAR_OUTLINED_EXIT:%.*]]
915 ; CHECK: omp.par.outlined.exit:
916 ; CHECK-NEXT: br label [[OMP_PAR_EXIT_SPLIT:%.*]]
917 ; CHECK: omp.par.exit.split:
918 ; CHECK-NEXT: br label [[ENTRY_SPLIT_SPLIT:%.*]]
919 ; CHECK: entry.split.split:
920 ; CHECK-NEXT: [[TMP0:%.*]] = load i32, ptr [[A_ADDR]], align 4
921 ; CHECK-NEXT: call void @use(i32 [[TMP0]])
922 ; CHECK-NEXT: ret void
923 ; CHECK-LABEL: define {{[^@]+}}@merge_seq..omp_par
924 ; CHECK-SAME: (ptr noalias [[TID_ADDR:%.*]], ptr noalias [[ZERO_ADDR:%.*]], ptr [[A_ADDR:%.*]]) #[[ATTR0]] {
925 ; CHECK-NEXT: omp.par.entry:
926 ; CHECK-NEXT: [[TID_ADDR_LOCAL:%.*]] = alloca i32, align 4
927 ; CHECK-NEXT: [[TMP0:%.*]] = load i32, ptr [[TID_ADDR]], align 4
928 ; CHECK-NEXT: store i32 [[TMP0]], ptr [[TID_ADDR_LOCAL]], align 4
929 ; CHECK-NEXT: [[TID:%.*]] = load i32, ptr [[TID_ADDR_LOCAL]], align 4
930 ; CHECK-NEXT: br label [[OMP_PAR_REGION:%.*]]
931 ; CHECK: omp.par.outlined.exit.exitStub:
932 ; CHECK-NEXT: ret void
933 ; CHECK: omp.par.region:
934 ; CHECK-NEXT: br label [[OMP_PAR_MERGED:%.*]]
935 ; CHECK: omp.par.merged:
936 ; CHECK-NEXT: call void @.omp_outlined..8(ptr [[TID_ADDR]], ptr [[ZERO_ADDR]], ptr nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[A_ADDR]])
937 ; CHECK-NEXT: [[OMP_GLOBAL_THREAD_NUM2:%.*]] = call i32 @__kmpc_global_thread_num(ptr @[[GLOB1]])
938 ; CHECK-NEXT: call void @__kmpc_barrier(ptr @[[GLOB2]], i32 [[OMP_GLOBAL_THREAD_NUM2]])
939 ; CHECK-NEXT: [[OMP_GLOBAL_THREAD_NUM:%.*]] = call i32 @__kmpc_global_thread_num(ptr @[[GLOB1]])
940 ; CHECK-NEXT: [[TMP1:%.*]] = call i32 @__kmpc_master(ptr @[[GLOB1]], i32 [[OMP_GLOBAL_THREAD_NUM]])
941 ; CHECK-NEXT: [[TMP2:%.*]] = icmp ne i32 [[TMP1]], 0
942 ; CHECK-NEXT: br i1 [[TMP2]], label [[OMP_REGION_BODY:%.*]], label [[OMP_REGION_END:%.*]]
943 ; CHECK: omp_region.end:
944 ; CHECK-NEXT: [[OMP_GLOBAL_THREAD_NUM1:%.*]] = call i32 @__kmpc_global_thread_num(ptr @[[GLOB1]])
945 ; CHECK-NEXT: call void @__kmpc_barrier(ptr @[[GLOB2]], i32 [[OMP_GLOBAL_THREAD_NUM1]])
946 ; CHECK-NEXT: br label [[OMP_PAR_MERGED_SPLIT_SPLIT:%.*]]
947 ; CHECK: omp.par.merged.split.split:
948 ; CHECK-NEXT: call void @.omp_outlined..9(ptr [[TID_ADDR]], ptr [[ZERO_ADDR]], ptr nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[A_ADDR]])
949 ; CHECK-NEXT: br label [[ENTRY_SPLIT:%.*]]
950 ; CHECK: entry.split:
951 ; CHECK-NEXT: br label [[OMP_PAR_REGION_SPLIT:%.*]]
952 ; CHECK: omp.par.region.split:
953 ; CHECK-NEXT: br label [[OMP_PAR_PRE_FINALIZE:%.*]]
954 ; CHECK: omp.par.pre_finalize:
955 ; CHECK-NEXT: br label [[OMP_PAR_OUTLINED_EXIT_EXITSTUB:%.*]]
956 ; CHECK: omp_region.body:
957 ; CHECK-NEXT: br label [[SEQ_PAR_MERGED:%.*]]
958 ; CHECK: seq.par.merged:
959 ; CHECK-NEXT: [[TMP3:%.*]] = load i32, ptr [[A_ADDR]], align 4
960 ; CHECK-NEXT: [[ADD:%.*]] = add nsw i32 [[TMP3]], 1
961 ; CHECK-NEXT: store i32 [[ADD]], ptr [[A_ADDR]], align 4
962 ; CHECK-NEXT: br label [[OMP_PAR_MERGED_SPLIT:%.*]]
963 ; CHECK: omp.par.merged.split:
964 ; CHECK-NEXT: br label [[OMP_REGION_BODY_SPLIT:%.*]]
965 ; CHECK: omp_region.body.split:
966 ; CHECK-NEXT: call void @__kmpc_end_master(ptr @[[GLOB1]], i32 [[OMP_GLOBAL_THREAD_NUM]])
967 ; CHECK-NEXT: br label [[OMP_REGION_END]]
968 ; CHECK-LABEL: define {{[^@]+}}@.omp_outlined..8
969 ; CHECK-SAME: (ptr noalias nocapture nofree readnone [[DOTGLOBAL_TID_:%.*]], ptr noalias nocapture nofree readnone [[DOTBOUND_TID_:%.*]], ptr nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[A:%.*]]) {
971 ; CHECK-NEXT: [[TMP0:%.*]] = load i32, ptr [[A]], align 4
972 ; CHECK-NEXT: call void @use(i32 [[TMP0]])
973 ; CHECK-NEXT: ret void
974 ; CHECK-LABEL: define {{[^@]+}}@.omp_outlined..9
975 ; CHECK-SAME: (ptr noalias nocapture nofree readnone [[DOTGLOBAL_TID_:%.*]], ptr noalias nocapture nofree readnone [[DOTBOUND_TID_:%.*]], ptr nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[A:%.*]]) {
977 ; CHECK-NEXT: [[TMP0:%.*]] = load i32, ptr [[A]], align 4
978 ; CHECK-NEXT: call void @use(i32 [[TMP0]])
979 ; CHECK-NEXT: ret void
980 ; CHECK-LABEL: define {{[^@]+}}@merge_seq_float
981 ; CHECK-SAME: (float [[F:%.*]], ptr nocapture nofree writeonly [[P:%.*]]) local_unnamed_addr {
983 ; CHECK-NEXT: [[F_ADDR:%.*]] = alloca float, align 4
984 ; CHECK-NEXT: store float [[F]], ptr [[F_ADDR]], align 4
985 ; CHECK-NEXT: [[OMP_GLOBAL_THREAD_NUM2:%.*]] = call i32 @__kmpc_global_thread_num(ptr @[[GLOB1]])
986 ; CHECK-NEXT: br label [[OMP_PARALLEL:%.*]]
987 ; CHECK: omp_parallel:
988 ; CHECK-NEXT: call void (ptr, i32, ptr, ...) @__kmpc_fork_call(ptr @[[GLOB1]], i32 2, ptr @merge_seq_float..omp_par, ptr [[F_ADDR]], ptr [[P]])
989 ; CHECK-NEXT: br label [[OMP_PAR_OUTLINED_EXIT:%.*]]
990 ; CHECK: omp.par.outlined.exit:
991 ; CHECK-NEXT: br label [[OMP_PAR_EXIT_SPLIT:%.*]]
992 ; CHECK: omp.par.exit.split:
993 ; CHECK-NEXT: br label [[ENTRY_SPLIT_SPLIT:%.*]]
994 ; CHECK: entry.split.split:
995 ; CHECK-NEXT: ret void
996 ; CHECK-LABEL: define {{[^@]+}}@merge_seq_float..omp_par
997 ; CHECK-SAME: (ptr noalias [[TID_ADDR:%.*]], ptr noalias [[ZERO_ADDR:%.*]], ptr [[F_ADDR:%.*]], ptr [[P:%.*]]) #[[ATTR0]] {
998 ; CHECK-NEXT: omp.par.entry:
999 ; CHECK-NEXT: [[TID_ADDR_LOCAL:%.*]] = alloca i32, align 4
1000 ; CHECK-NEXT: [[TMP0:%.*]] = load i32, ptr [[TID_ADDR]], align 4
1001 ; CHECK-NEXT: store i32 [[TMP0]], ptr [[TID_ADDR_LOCAL]], align 4
1002 ; CHECK-NEXT: [[TID:%.*]] = load i32, ptr [[TID_ADDR_LOCAL]], align 4
1003 ; CHECK-NEXT: br label [[OMP_PAR_REGION:%.*]]
1004 ; CHECK: omp.par.outlined.exit.exitStub:
1005 ; CHECK-NEXT: ret void
1006 ; CHECK: omp.par.region:
1007 ; CHECK-NEXT: br label [[OMP_PAR_MERGED:%.*]]
1008 ; CHECK: omp.par.merged:
1009 ; CHECK-NEXT: call void @.omp_outlined..10(ptr [[TID_ADDR]], ptr [[ZERO_ADDR]], ptr nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[F_ADDR]])
1010 ; CHECK-NEXT: [[OMP_GLOBAL_THREAD_NUM2:%.*]] = call i32 @__kmpc_global_thread_num(ptr @[[GLOB1]])
1011 ; CHECK-NEXT: call void @__kmpc_barrier(ptr @[[GLOB2]], i32 [[OMP_GLOBAL_THREAD_NUM2]])
1012 ; CHECK-NEXT: [[OMP_GLOBAL_THREAD_NUM:%.*]] = call i32 @__kmpc_global_thread_num(ptr @[[GLOB1]])
1013 ; CHECK-NEXT: [[TMP1:%.*]] = call i32 @__kmpc_master(ptr @[[GLOB1]], i32 [[OMP_GLOBAL_THREAD_NUM]])
1014 ; CHECK-NEXT: [[TMP2:%.*]] = icmp ne i32 [[TMP1]], 0
1015 ; CHECK-NEXT: br i1 [[TMP2]], label [[OMP_REGION_BODY:%.*]], label [[OMP_REGION_END:%.*]]
1016 ; CHECK: omp_region.end:
1017 ; CHECK-NEXT: [[OMP_GLOBAL_THREAD_NUM1:%.*]] = call i32 @__kmpc_global_thread_num(ptr @[[GLOB1]])
1018 ; CHECK-NEXT: call void @__kmpc_barrier(ptr @[[GLOB2]], i32 [[OMP_GLOBAL_THREAD_NUM1]])
1019 ; CHECK-NEXT: br label [[OMP_PAR_MERGED_SPLIT_SPLIT:%.*]]
1020 ; CHECK: omp.par.merged.split.split:
1021 ; CHECK-NEXT: call void @.omp_outlined..11(ptr [[TID_ADDR]], ptr [[ZERO_ADDR]], ptr nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[F_ADDR]])
1022 ; CHECK-NEXT: br label [[ENTRY_SPLIT:%.*]]
1023 ; CHECK: entry.split:
1024 ; CHECK-NEXT: br label [[OMP_PAR_REGION_SPLIT:%.*]]
1025 ; CHECK: omp.par.region.split:
1026 ; CHECK-NEXT: br label [[OMP_PAR_PRE_FINALIZE:%.*]]
1027 ; CHECK: omp.par.pre_finalize:
1028 ; CHECK-NEXT: br label [[OMP_PAR_OUTLINED_EXIT_EXITSTUB:%.*]]
1029 ; CHECK: omp_region.body:
1030 ; CHECK-NEXT: br label [[SEQ_PAR_MERGED:%.*]]
1031 ; CHECK: seq.par.merged:
1032 ; CHECK-NEXT: [[TMP3:%.*]] = load float, ptr [[F_ADDR]], align 4
1033 ; CHECK-NEXT: [[ADD:%.*]] = fadd float [[TMP3]], 0x40091EB860000000
1034 ; CHECK-NEXT: store float [[ADD]], ptr [[P]], align 4
1035 ; CHECK-NEXT: br label [[OMP_PAR_MERGED_SPLIT:%.*]]
1036 ; CHECK: omp.par.merged.split:
1037 ; CHECK-NEXT: br label [[OMP_REGION_BODY_SPLIT:%.*]]
1038 ; CHECK: omp_region.body.split:
1039 ; CHECK-NEXT: call void @__kmpc_end_master(ptr @[[GLOB1]], i32 [[OMP_GLOBAL_THREAD_NUM]])
1040 ; CHECK-NEXT: br label [[OMP_REGION_END]]
1041 ; CHECK-LABEL: define {{[^@]+}}@.omp_outlined..10
1042 ; CHECK-SAME: (ptr noalias nocapture nofree readnone [[DOTGLOBAL_TID_:%.*]], ptr noalias nocapture nofree readnone [[DOTBOUND_TID_:%.*]], ptr nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[F:%.*]]) {
1043 ; CHECK-NEXT: entry:
1044 ; CHECK-NEXT: [[TMP0:%.*]] = load float, ptr [[F]], align 4
1045 ; CHECK-NEXT: [[CONV:%.*]] = fptosi float [[TMP0]] to i32
1046 ; CHECK-NEXT: call void @use(i32 [[CONV]])
1047 ; CHECK-NEXT: ret void
1048 ; CHECK-LABEL: define {{[^@]+}}@.omp_outlined..11
1049 ; CHECK-SAME: (ptr noalias nocapture nofree readnone [[DOTGLOBAL_TID_:%.*]], ptr noalias nocapture nofree readnone [[DOTBOUND_TID_:%.*]], ptr nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[F:%.*]]) {
1050 ; CHECK-NEXT: entry:
1051 ; CHECK-NEXT: [[TMP0:%.*]] = load float, ptr [[F]], align 4
1052 ; CHECK-NEXT: [[CONV:%.*]] = fptosi float [[TMP0]] to i32
1053 ; CHECK-NEXT: call void @use(i32 [[CONV]])
1054 ; CHECK-NEXT: ret void
1055 ; CHECK-LABEL: define {{[^@]+}}@merge_seq_firstprivate
1056 ; CHECK-SAME: (i32 [[A:%.*]]) local_unnamed_addr {
1057 ; CHECK-NEXT: entry:
1058 ; CHECK-NEXT: [[A_CASTED_SROA_0_0_INSERT_EXT_SEQ_OUTPUT_ALLOC:%.*]] = alloca i64, align 8
1059 ; CHECK-NEXT: [[A_ADDR:%.*]] = alloca i32, align 4
1060 ; CHECK-NEXT: store i32 [[A]], ptr [[A_ADDR]], align 4
1061 ; CHECK-NEXT: [[OMP_GLOBAL_THREAD_NUM2:%.*]] = call i32 @__kmpc_global_thread_num(ptr @[[GLOB1]])
1062 ; CHECK-NEXT: br label [[OMP_PARALLEL:%.*]]
1063 ; CHECK: omp_parallel:
1064 ; CHECK-NEXT: call void (ptr, i32, ptr, ...) @__kmpc_fork_call(ptr @[[GLOB1]], i32 2, ptr @merge_seq_firstprivate..omp_par, ptr [[A_ADDR]], ptr [[A_CASTED_SROA_0_0_INSERT_EXT_SEQ_OUTPUT_ALLOC]])
1065 ; CHECK-NEXT: br label [[OMP_PAR_OUTLINED_EXIT:%.*]]
1066 ; CHECK: omp.par.outlined.exit:
1067 ; CHECK-NEXT: br label [[OMP_PAR_EXIT_SPLIT:%.*]]
1068 ; CHECK: omp.par.exit.split:
1069 ; CHECK-NEXT: br label [[ENTRY_SPLIT_SPLIT:%.*]]
1070 ; CHECK: entry.split.split:
1071 ; CHECK-NEXT: [[TMP0:%.*]] = load i32, ptr [[A_ADDR]], align 4
1072 ; CHECK-NEXT: call void @use(i32 [[TMP0]])
1073 ; CHECK-NEXT: ret void
1074 ; CHECK-LABEL: define {{[^@]+}}@merge_seq_firstprivate..omp_par
1075 ; CHECK-SAME: (ptr noalias [[TID_ADDR:%.*]], ptr noalias [[ZERO_ADDR:%.*]], ptr [[A_ADDR:%.*]], ptr [[A_CASTED_SROA_0_0_INSERT_EXT_SEQ_OUTPUT_ALLOC:%.*]]) #[[ATTR0]] {
1076 ; CHECK-NEXT: omp.par.entry:
1077 ; CHECK-NEXT: [[TID_ADDR_LOCAL:%.*]] = alloca i32, align 4
1078 ; CHECK-NEXT: [[TMP0:%.*]] = load i32, ptr [[TID_ADDR]], align 4
1079 ; CHECK-NEXT: store i32 [[TMP0]], ptr [[TID_ADDR_LOCAL]], align 4
1080 ; CHECK-NEXT: [[TID:%.*]] = load i32, ptr [[TID_ADDR_LOCAL]], align 4
1081 ; CHECK-NEXT: br label [[OMP_PAR_REGION:%.*]]
1082 ; CHECK: omp.par.outlined.exit.exitStub:
1083 ; CHECK-NEXT: ret void
1084 ; CHECK: omp.par.region:
1085 ; CHECK-NEXT: br label [[OMP_PAR_MERGED:%.*]]
1086 ; CHECK: omp.par.merged:
1087 ; CHECK-NEXT: call void @.omp_outlined..12(ptr [[TID_ADDR]], ptr [[ZERO_ADDR]], ptr nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[A_ADDR]])
1088 ; CHECK-NEXT: [[OMP_GLOBAL_THREAD_NUM2:%.*]] = call i32 @__kmpc_global_thread_num(ptr @[[GLOB1]])
1089 ; CHECK-NEXT: call void @__kmpc_barrier(ptr @[[GLOB2]], i32 [[OMP_GLOBAL_THREAD_NUM2]])
1090 ; CHECK-NEXT: [[OMP_GLOBAL_THREAD_NUM:%.*]] = call i32 @__kmpc_global_thread_num(ptr @[[GLOB1]])
1091 ; CHECK-NEXT: [[TMP1:%.*]] = call i32 @__kmpc_master(ptr @[[GLOB1]], i32 [[OMP_GLOBAL_THREAD_NUM]])
1092 ; CHECK-NEXT: [[TMP2:%.*]] = icmp ne i32 [[TMP1]], 0
1093 ; CHECK-NEXT: br i1 [[TMP2]], label [[OMP_REGION_BODY:%.*]], label [[OMP_REGION_END:%.*]]
1094 ; CHECK: omp_region.end:
1095 ; CHECK-NEXT: [[OMP_GLOBAL_THREAD_NUM1:%.*]] = call i32 @__kmpc_global_thread_num(ptr @[[GLOB1]])
1096 ; CHECK-NEXT: call void @__kmpc_barrier(ptr @[[GLOB2]], i32 [[OMP_GLOBAL_THREAD_NUM1]])
1097 ; CHECK-NEXT: br label [[OMP_PAR_MERGED_SPLIT_SPLIT:%.*]]
1098 ; CHECK: omp.par.merged.split.split:
1099 ; CHECK-NEXT: [[A_CASTED_SROA_0_0_INSERT_EXT_SEQ_OUTPUT_LOAD:%.*]] = load i64, ptr [[A_CASTED_SROA_0_0_INSERT_EXT_SEQ_OUTPUT_ALLOC]], align 8
1100 ; CHECK-NEXT: call void @.omp_outlined..13(ptr [[TID_ADDR]], ptr [[ZERO_ADDR]], i64 [[A_CASTED_SROA_0_0_INSERT_EXT_SEQ_OUTPUT_LOAD]])
1101 ; CHECK-NEXT: br label [[ENTRY_SPLIT:%.*]]
1102 ; CHECK: entry.split:
1103 ; CHECK-NEXT: br label [[OMP_PAR_REGION_SPLIT:%.*]]
1104 ; CHECK: omp.par.region.split:
1105 ; CHECK-NEXT: br label [[OMP_PAR_PRE_FINALIZE:%.*]]
1106 ; CHECK: omp.par.pre_finalize:
1107 ; CHECK-NEXT: br label [[OMP_PAR_OUTLINED_EXIT_EXITSTUB:%.*]]
1108 ; CHECK: omp_region.body:
1109 ; CHECK-NEXT: br label [[SEQ_PAR_MERGED:%.*]]
1110 ; CHECK: seq.par.merged:
1111 ; CHECK-NEXT: [[TMP3:%.*]] = load i32, ptr [[A_ADDR]], align 4
1112 ; CHECK-NEXT: [[ADD:%.*]] = add nsw i32 [[TMP3]], 1
1113 ; CHECK-NEXT: store i32 [[ADD]], ptr [[A_ADDR]], align 4
1114 ; CHECK-NEXT: [[A_CASTED_SROA_0_0_INSERT_EXT:%.*]] = zext i32 [[ADD]] to i64
1115 ; CHECK-NEXT: store i64 [[A_CASTED_SROA_0_0_INSERT_EXT]], ptr [[A_CASTED_SROA_0_0_INSERT_EXT_SEQ_OUTPUT_ALLOC]], align 8
1116 ; CHECK-NEXT: br label [[OMP_PAR_MERGED_SPLIT:%.*]]
1117 ; CHECK: omp.par.merged.split:
1118 ; CHECK-NEXT: br label [[OMP_REGION_BODY_SPLIT:%.*]]
1119 ; CHECK: omp_region.body.split:
1120 ; CHECK-NEXT: call void @__kmpc_end_master(ptr @[[GLOB1]], i32 [[OMP_GLOBAL_THREAD_NUM]])
1121 ; CHECK-NEXT: br label [[OMP_REGION_END]]
1122 ; CHECK-LABEL: define {{[^@]+}}@.omp_outlined..12
1123 ; CHECK-SAME: (ptr noalias nocapture nofree readnone [[DOTGLOBAL_TID_:%.*]], ptr noalias nocapture nofree readnone [[DOTBOUND_TID_:%.*]], ptr nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[A:%.*]]) {
1124 ; CHECK-NEXT: entry:
1125 ; CHECK-NEXT: [[TMP0:%.*]] = load i32, ptr [[A]], align 4
1126 ; CHECK-NEXT: call void @use(i32 [[TMP0]])
1127 ; CHECK-NEXT: ret void
1128 ; CHECK-LABEL: define {{[^@]+}}@.omp_outlined..13
1129 ; CHECK-SAME: (ptr noalias nocapture nofree readnone [[DOTGLOBAL_TID_:%.*]], ptr noalias nocapture nofree readnone [[DOTBOUND_TID_:%.*]], i64 [[A:%.*]]) {
1130 ; CHECK-NEXT: entry:
1131 ; CHECK-NEXT: [[A_ADDR_SROA_0_0_EXTRACT_TRUNC:%.*]] = trunc i64 [[A]] to i32
1132 ; CHECK-NEXT: call void @use(i32 [[A_ADDR_SROA_0_0_EXTRACT_TRUNC]])
1133 ; CHECK-NEXT: ret void
1134 ; CHECK-LABEL: define {{[^@]+}}@merge_seq_sink_lt
1135 ; CHECK-SAME: (i32 [[A:%.*]]) local_unnamed_addr {
1136 ; CHECK-NEXT: entry:
1137 ; CHECK-NEXT: [[A_ADDR:%.*]] = alloca i32, align 4
1138 ; CHECK-NEXT: store i32 [[A]], ptr [[A_ADDR]], align 4
1139 ; CHECK-NEXT: [[OMP_GLOBAL_THREAD_NUM2:%.*]] = call i32 @__kmpc_global_thread_num(ptr @[[GLOB1]])
1140 ; CHECK-NEXT: br label [[OMP_PARALLEL:%.*]]
1141 ; CHECK: omp_parallel:
1142 ; CHECK-NEXT: call void (ptr, i32, ptr, ...) @__kmpc_fork_call(ptr @[[GLOB1]], i32 1, ptr @merge_seq_sink_lt..omp_par, ptr [[A_ADDR]])
1143 ; CHECK-NEXT: br label [[OMP_PAR_OUTLINED_EXIT:%.*]]
1144 ; CHECK: omp.par.outlined.exit:
1145 ; CHECK-NEXT: br label [[OMP_PAR_EXIT_SPLIT:%.*]]
1146 ; CHECK: omp.par.exit.split:
1147 ; CHECK-NEXT: br label [[ENTRY_SPLIT_SPLIT:%.*]]
1148 ; CHECK: entry.split.split:
1149 ; CHECK-NEXT: ret void
1150 ; CHECK-LABEL: define {{[^@]+}}@merge_seq_sink_lt..omp_par
1151 ; CHECK-SAME: (ptr noalias [[TID_ADDR:%.*]], ptr noalias [[ZERO_ADDR:%.*]], ptr [[A_ADDR:%.*]]) #[[ATTR0]] {
1152 ; CHECK-NEXT: omp.par.entry:
1153 ; CHECK-NEXT: [[B:%.*]] = alloca i32, align 4
1154 ; CHECK-NEXT: [[TID_ADDR_LOCAL:%.*]] = alloca i32, align 4
1155 ; CHECK-NEXT: [[TMP0:%.*]] = load i32, ptr [[TID_ADDR]], align 4
1156 ; CHECK-NEXT: store i32 [[TMP0]], ptr [[TID_ADDR_LOCAL]], align 4
1157 ; CHECK-NEXT: [[TID:%.*]] = load i32, ptr [[TID_ADDR_LOCAL]], align 4
1158 ; CHECK-NEXT: br label [[OMP_PAR_REGION:%.*]]
1159 ; CHECK: omp.par.outlined.exit.exitStub:
1160 ; CHECK-NEXT: ret void
1161 ; CHECK: omp.par.region:
1162 ; CHECK-NEXT: br label [[OMP_PAR_MERGED:%.*]]
1163 ; CHECK: omp.par.merged:
1164 ; CHECK-NEXT: call void @.omp_outlined..14(ptr [[TID_ADDR]], ptr [[ZERO_ADDR]], ptr nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[A_ADDR]])
1165 ; CHECK-NEXT: [[OMP_GLOBAL_THREAD_NUM2:%.*]] = call i32 @__kmpc_global_thread_num(ptr @[[GLOB1]])
1166 ; CHECK-NEXT: call void @__kmpc_barrier(ptr @[[GLOB2]], i32 [[OMP_GLOBAL_THREAD_NUM2]])
1167 ; CHECK-NEXT: [[OMP_GLOBAL_THREAD_NUM:%.*]] = call i32 @__kmpc_global_thread_num(ptr @[[GLOB1]])
1168 ; CHECK-NEXT: [[TMP1:%.*]] = call i32 @__kmpc_master(ptr @[[GLOB1]], i32 [[OMP_GLOBAL_THREAD_NUM]])
1169 ; CHECK-NEXT: [[TMP2:%.*]] = icmp ne i32 [[TMP1]], 0
1170 ; CHECK-NEXT: br i1 [[TMP2]], label [[OMP_REGION_BODY:%.*]], label [[OMP_REGION_END:%.*]]
1171 ; CHECK: omp_region.end:
1172 ; CHECK-NEXT: [[OMP_GLOBAL_THREAD_NUM1:%.*]] = call i32 @__kmpc_global_thread_num(ptr @[[GLOB1]])
1173 ; CHECK-NEXT: call void @__kmpc_barrier(ptr @[[GLOB2]], i32 [[OMP_GLOBAL_THREAD_NUM1]])
1174 ; CHECK-NEXT: br label [[OMP_PAR_MERGED_SPLIT_SPLIT:%.*]]
1175 ; CHECK: omp.par.merged.split.split:
1176 ; CHECK-NEXT: call void @.omp_outlined..15(ptr [[TID_ADDR]], ptr [[ZERO_ADDR]], ptr nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[A_ADDR]])
1177 ; CHECK-NEXT: br label [[ENTRY_SPLIT:%.*]]
1178 ; CHECK: entry.split:
1179 ; CHECK-NEXT: br label [[OMP_PAR_REGION_SPLIT:%.*]]
1180 ; CHECK: omp.par.region.split:
1181 ; CHECK-NEXT: br label [[OMP_PAR_PRE_FINALIZE:%.*]]
1182 ; CHECK: omp.par.pre_finalize:
1183 ; CHECK-NEXT: br label [[OMP_PAR_OUTLINED_EXIT_EXITSTUB:%.*]]
1184 ; CHECK: omp_region.body:
1185 ; CHECK-NEXT: br label [[SEQ_PAR_MERGED:%.*]]
1186 ; CHECK: seq.par.merged:
1187 ; CHECK-NEXT: call void @llvm.lifetime.start.p0(i64 noundef 4, ptr noundef nonnull [[B]])
1188 ; CHECK-NEXT: [[TMP4:%.*]] = ptrtoint ptr [[B]] to i64
1189 ; CHECK-NEXT: [[TMP5:%.*]] = trunc i64 [[TMP4]] to i32
1190 ; CHECK-NEXT: store i32 [[TMP5]], ptr [[B]], align 4
1191 ; CHECK-NEXT: call void @llvm.lifetime.end.p0(i64 noundef 4, ptr noundef nonnull [[B]])
1192 ; CHECK-NEXT: br label [[OMP_PAR_MERGED_SPLIT:%.*]]
1193 ; CHECK: omp.par.merged.split:
1194 ; CHECK-NEXT: br label [[OMP_REGION_BODY_SPLIT:%.*]]
1195 ; CHECK: omp_region.body.split:
1196 ; CHECK-NEXT: call void @__kmpc_end_master(ptr @[[GLOB1]], i32 [[OMP_GLOBAL_THREAD_NUM]])
1197 ; CHECK-NEXT: br label [[OMP_REGION_END]]
1198 ; CHECK-LABEL: define {{[^@]+}}@.omp_outlined..14
1199 ; CHECK-SAME: (ptr noalias nocapture nofree readnone [[DOTGLOBAL_TID_:%.*]], ptr noalias nocapture nofree readnone [[DOTBOUND_TID_:%.*]], ptr nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[A:%.*]]) {
1200 ; CHECK-NEXT: entry:
1201 ; CHECK-NEXT: [[TMP0:%.*]] = load i32, ptr [[A]], align 4
1202 ; CHECK-NEXT: call void @use(i32 [[TMP0]])
1203 ; CHECK-NEXT: ret void
1204 ; CHECK-LABEL: define {{[^@]+}}@.omp_outlined..15
1205 ; CHECK-SAME: (ptr noalias nocapture nofree readnone [[DOTGLOBAL_TID_:%.*]], ptr noalias nocapture nofree readnone [[DOTBOUND_TID_:%.*]], ptr nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[A:%.*]]) {
1206 ; CHECK-NEXT: entry:
1207 ; CHECK-NEXT: [[TMP0:%.*]] = load i32, ptr [[A]], align 4
1208 ; CHECK-NEXT: call void @use(i32 [[TMP0]])
1209 ; CHECK-NEXT: ret void
1210 ; CHECK-LABEL: define {{[^@]+}}@merge_seq_par_use
1211 ; CHECK-SAME: (i32 [[A:%.*]]) local_unnamed_addr {
1212 ; CHECK-NEXT: entry:
1213 ; CHECK-NEXT: [[A_ADDR:%.*]] = alloca i32, align 4
1214 ; CHECK-NEXT: [[B:%.*]] = alloca i32, align 4
1215 ; CHECK-NEXT: store i32 [[A]], ptr [[A_ADDR]], align 4
1216 ; CHECK-NEXT: [[OMP_GLOBAL_THREAD_NUM2:%.*]] = call i32 @__kmpc_global_thread_num(ptr @[[GLOB1]])
1217 ; CHECK-NEXT: br label [[OMP_PARALLEL:%.*]]
1218 ; CHECK: omp_parallel:
1219 ; CHECK-NEXT: call void @llvm.lifetime.start.p0(i64 -1, ptr [[B]])
1220 ; CHECK-NEXT: call void (ptr, i32, ptr, ...) @__kmpc_fork_call(ptr @[[GLOB1]], i32 2, ptr @merge_seq_par_use..omp_par, ptr [[A_ADDR]], ptr [[B]])
1221 ; CHECK-NEXT: br label [[OMP_PAR_OUTLINED_EXIT:%.*]]
1222 ; CHECK: omp.par.outlined.exit:
1223 ; CHECK-NEXT: br label [[OMP_PAR_EXIT_SPLIT:%.*]]
1224 ; CHECK: omp.par.exit.split:
1225 ; CHECK-NEXT: br label [[ENTRY_SPLIT_SPLIT:%.*]]
1226 ; CHECK: entry.split.split:
1227 ; CHECK-NEXT: call void @llvm.lifetime.end.p0(i64 noundef 4, ptr noundef nonnull [[B]])
1228 ; CHECK-NEXT: ret void
1229 ; CHECK-LABEL: define {{[^@]+}}@merge_seq_par_use..omp_par
1230 ; CHECK-SAME: (ptr noalias [[TID_ADDR:%.*]], ptr noalias [[ZERO_ADDR:%.*]], ptr [[A_ADDR:%.*]], ptr [[B:%.*]]) #[[ATTR0]] {
1231 ; CHECK-NEXT: omp.par.entry:
1232 ; CHECK-NEXT: [[TID_ADDR_LOCAL:%.*]] = alloca i32, align 4
1233 ; CHECK-NEXT: [[TMP0:%.*]] = load i32, ptr [[TID_ADDR]], align 4
1234 ; CHECK-NEXT: store i32 [[TMP0]], ptr [[TID_ADDR_LOCAL]], align 4
1235 ; CHECK-NEXT: [[TID:%.*]] = load i32, ptr [[TID_ADDR_LOCAL]], align 4
1236 ; CHECK-NEXT: br label [[OMP_PAR_REGION:%.*]]
1237 ; CHECK: omp.par.outlined.exit.exitStub:
1238 ; CHECK-NEXT: ret void
1239 ; CHECK: omp.par.region:
1240 ; CHECK-NEXT: br label [[OMP_PAR_MERGED:%.*]]
1241 ; CHECK: omp.par.merged:
1242 ; CHECK-NEXT: call void @.omp_outlined..16(ptr [[TID_ADDR]], ptr [[ZERO_ADDR]], ptr nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[A_ADDR]])
1243 ; CHECK-NEXT: [[OMP_GLOBAL_THREAD_NUM2:%.*]] = call i32 @__kmpc_global_thread_num(ptr @[[GLOB1]])
1244 ; CHECK-NEXT: call void @__kmpc_barrier(ptr @[[GLOB2]], i32 [[OMP_GLOBAL_THREAD_NUM2]])
1245 ; CHECK-NEXT: [[OMP_GLOBAL_THREAD_NUM:%.*]] = call i32 @__kmpc_global_thread_num(ptr @[[GLOB1]])
1246 ; CHECK-NEXT: [[TMP1:%.*]] = call i32 @__kmpc_master(ptr @[[GLOB1]], i32 [[OMP_GLOBAL_THREAD_NUM]])
1247 ; CHECK-NEXT: [[TMP2:%.*]] = icmp ne i32 [[TMP1]], 0
1248 ; CHECK-NEXT: br i1 [[TMP2]], label [[OMP_REGION_BODY:%.*]], label [[OMP_REGION_END:%.*]]
1249 ; CHECK: omp_region.end:
1250 ; CHECK-NEXT: [[OMP_GLOBAL_THREAD_NUM1:%.*]] = call i32 @__kmpc_global_thread_num(ptr @[[GLOB1]])
1251 ; CHECK-NEXT: call void @__kmpc_barrier(ptr @[[GLOB2]], i32 [[OMP_GLOBAL_THREAD_NUM1]])
1252 ; CHECK-NEXT: br label [[OMP_PAR_MERGED_SPLIT_SPLIT:%.*]]
1253 ; CHECK: omp.par.merged.split.split:
1254 ; CHECK-NEXT: call void @.omp_outlined..17(ptr [[TID_ADDR]], ptr [[ZERO_ADDR]], ptr nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[A_ADDR]], ptr nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[B]])
1255 ; CHECK-NEXT: br label [[ENTRY_SPLIT:%.*]]
1256 ; CHECK: entry.split:
1257 ; CHECK-NEXT: br label [[OMP_PAR_REGION_SPLIT:%.*]]
1258 ; CHECK: omp.par.region.split:
1259 ; CHECK-NEXT: br label [[OMP_PAR_PRE_FINALIZE:%.*]]
1260 ; CHECK: omp.par.pre_finalize:
1261 ; CHECK-NEXT: br label [[OMP_PAR_OUTLINED_EXIT_EXITSTUB:%.*]]
1262 ; CHECK: omp_region.body:
1263 ; CHECK-NEXT: br label [[SEQ_PAR_MERGED:%.*]]
1264 ; CHECK: seq.par.merged:
1265 ; CHECK-NEXT: [[TMP4:%.*]] = load i32, ptr [[A_ADDR]], align 4
1266 ; CHECK-NEXT: [[ADD:%.*]] = add nsw i32 [[TMP4]], 1
1267 ; CHECK-NEXT: store i32 [[ADD]], ptr [[B]], align 4
1268 ; CHECK-NEXT: br label [[OMP_PAR_MERGED_SPLIT:%.*]]
1269 ; CHECK: omp.par.merged.split:
1270 ; CHECK-NEXT: br label [[OMP_REGION_BODY_SPLIT:%.*]]
1271 ; CHECK: omp_region.body.split:
1272 ; CHECK-NEXT: call void @__kmpc_end_master(ptr @[[GLOB1]], i32 [[OMP_GLOBAL_THREAD_NUM]])
1273 ; CHECK-NEXT: br label [[OMP_REGION_END]]
1274 ; CHECK-LABEL: define {{[^@]+}}@.omp_outlined..16
1275 ; CHECK-SAME: (ptr noalias nocapture nofree readnone [[DOTGLOBAL_TID_:%.*]], ptr noalias nocapture nofree readnone [[DOTBOUND_TID_:%.*]], ptr nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[A:%.*]]) {
1276 ; CHECK-NEXT: entry:
1277 ; CHECK-NEXT: [[TMP0:%.*]] = load i32, ptr [[A]], align 4
1278 ; CHECK-NEXT: call void @use(i32 [[TMP0]])
1279 ; CHECK-NEXT: ret void
1280 ; CHECK-LABEL: define {{[^@]+}}@.omp_outlined..17
1281 ; CHECK-SAME: (ptr noalias nocapture nofree readnone [[DOTGLOBAL_TID_:%.*]], ptr noalias nocapture nofree readnone [[DOTBOUND_TID_:%.*]], ptr nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[A:%.*]], ptr nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[B:%.*]]) {
1282 ; CHECK-NEXT: entry:
1283 ; CHECK-NEXT: [[TMP0:%.*]] = load i32, ptr [[A]], align 4
1284 ; CHECK-NEXT: call void @use(i32 [[TMP0]])
1285 ; CHECK-NEXT: [[TMP1:%.*]] = load i32, ptr [[B]], align 4
1286 ; CHECK-NEXT: call void @use(i32 [[TMP1]])
1287 ; CHECK-NEXT: ret void
1288 ; CHECK-LABEL: define {{[^@]+}}@merge_cancellable_regions
1289 ; CHECK-SAME: (i32 [[CANCEL1:%.*]], i32 [[CANCEL2:%.*]]) local_unnamed_addr {
1290 ; CHECK-NEXT: entry:
1291 ; CHECK-NEXT: [[CANCEL1_ADDR:%.*]] = alloca i32, align 4
1292 ; CHECK-NEXT: [[CANCEL2_ADDR:%.*]] = alloca i32, align 4
1293 ; CHECK-NEXT: store i32 [[CANCEL1]], ptr [[CANCEL1_ADDR]], align 4
1294 ; CHECK-NEXT: store i32 [[CANCEL2]], ptr [[CANCEL2_ADDR]], align 4
1295 ; CHECK-NEXT: [[OMP_GLOBAL_THREAD_NUM:%.*]] = call i32 @__kmpc_global_thread_num(ptr @[[GLOB1]])
1296 ; CHECK-NEXT: br label [[OMP_PARALLEL:%.*]]
1297 ; CHECK: omp_parallel:
1298 ; CHECK-NEXT: call void (ptr, i32, ptr, ...) @__kmpc_fork_call(ptr @[[GLOB1]], i32 2, ptr @merge_cancellable_regions..omp_par, ptr [[CANCEL1_ADDR]], ptr [[CANCEL2_ADDR]])
1299 ; CHECK-NEXT: br label [[OMP_PAR_OUTLINED_EXIT:%.*]]
1300 ; CHECK: omp.par.outlined.exit:
1301 ; CHECK-NEXT: br label [[OMP_PAR_EXIT_SPLIT:%.*]]
1302 ; CHECK: omp.par.exit.split:
1303 ; CHECK-NEXT: br label [[ENTRY_SPLIT_SPLIT:%.*]]
1304 ; CHECK: entry.split.split:
1305 ; CHECK-NEXT: ret void
1306 ; CHECK-LABEL: define {{[^@]+}}@merge_cancellable_regions..omp_par
1307 ; CHECK-SAME: (ptr noalias [[TID_ADDR:%.*]], ptr noalias [[ZERO_ADDR:%.*]], ptr [[CANCEL1_ADDR:%.*]], ptr [[CANCEL2_ADDR:%.*]]) #[[ATTR0]] {
1308 ; CHECK-NEXT: omp.par.entry:
1309 ; CHECK-NEXT: [[TID_ADDR_LOCAL:%.*]] = alloca i32, align 4
1310 ; CHECK-NEXT: [[TMP0:%.*]] = load i32, ptr [[TID_ADDR]], align 4
1311 ; CHECK-NEXT: store i32 [[TMP0]], ptr [[TID_ADDR_LOCAL]], align 4
1312 ; CHECK-NEXT: [[TID:%.*]] = load i32, ptr [[TID_ADDR_LOCAL]], align 4
1313 ; CHECK-NEXT: br label [[OMP_PAR_REGION:%.*]]
1314 ; CHECK: omp.par.outlined.exit.exitStub:
1315 ; CHECK-NEXT: ret void
1316 ; CHECK: omp.par.region:
1317 ; CHECK-NEXT: br label [[OMP_PAR_MERGED:%.*]]
1318 ; CHECK: omp.par.merged:
1319 ; CHECK-NEXT: call void @.omp_outlined..18(ptr [[TID_ADDR]], ptr [[ZERO_ADDR]], ptr nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[CANCEL1_ADDR]])
1320 ; CHECK-NEXT: [[OMP_GLOBAL_THREAD_NUM:%.*]] = call i32 @__kmpc_global_thread_num(ptr @[[GLOB1]])
1321 ; CHECK-NEXT: call void @__kmpc_barrier(ptr @[[GLOB2]], i32 [[OMP_GLOBAL_THREAD_NUM]])
1322 ; CHECK-NEXT: call void @.omp_outlined..19(ptr [[TID_ADDR]], ptr [[ZERO_ADDR]], ptr nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[CANCEL2_ADDR]])
1323 ; CHECK-NEXT: br label [[ENTRY_SPLIT:%.*]]
1324 ; CHECK: entry.split:
1325 ; CHECK-NEXT: br label [[OMP_PAR_REGION_SPLIT:%.*]]
1326 ; CHECK: omp.par.region.split:
1327 ; CHECK-NEXT: br label [[OMP_PAR_PRE_FINALIZE:%.*]]
1328 ; CHECK: omp.par.pre_finalize:
1329 ; CHECK-NEXT: br label [[OMP_PAR_OUTLINED_EXIT_EXITSTUB:%.*]]
1330 ; CHECK-LABEL: define {{[^@]+}}@.omp_outlined..18
1331 ; CHECK-SAME: (ptr noalias nocapture nofree readonly [[DOTGLOBAL_TID_:%.*]], ptr noalias nocapture nofree readnone [[DOTBOUND_TID_:%.*]], ptr nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[CANCEL1:%.*]]) {
1332 ; CHECK-NEXT: entry:
1333 ; CHECK-NEXT: [[TMP0:%.*]] = load i32, ptr [[CANCEL1]], align 4
1334 ; CHECK-NEXT: [[TOBOOL_NOT:%.*]] = icmp eq i32 [[TMP0]], 0
1335 ; CHECK-NEXT: br i1 [[TOBOOL_NOT]], label [[IF_END:%.*]], label [[IF_THEN:%.*]]
1337 ; CHECK-NEXT: [[TMP1:%.*]] = load i32, ptr [[DOTGLOBAL_TID_]], align 4
1338 ; CHECK-NEXT: [[TMP2:%.*]] = call i32 @__kmpc_cancel(ptr noundef nonnull @[[GLOB1]], i32 [[TMP1]], i32 noundef 1)
1339 ; CHECK-NEXT: ret void
1341 ; CHECK-NEXT: ret void
1342 ; CHECK-LABEL: define {{[^@]+}}@.omp_outlined..19
1343 ; CHECK-SAME: (ptr noalias nocapture nofree readonly [[DOTGLOBAL_TID_:%.*]], ptr noalias nocapture nofree readnone [[DOTBOUND_TID_:%.*]], ptr nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[CANCEL2:%.*]]) {
1344 ; CHECK-NEXT: entry:
1345 ; CHECK-NEXT: [[TMP0:%.*]] = load i32, ptr [[CANCEL2]], align 4
1346 ; CHECK-NEXT: [[TOBOOL_NOT:%.*]] = icmp eq i32 [[TMP0]], 0
1347 ; CHECK-NEXT: br i1 [[TOBOOL_NOT]], label [[IF_END:%.*]], label [[IF_THEN:%.*]]
1349 ; CHECK-NEXT: [[TMP1:%.*]] = load i32, ptr [[DOTGLOBAL_TID_]], align 4
1350 ; CHECK-NEXT: [[TMP2:%.*]] = call i32 @__kmpc_cancel(ptr noundef nonnull @[[GLOB1]], i32 [[TMP1]], i32 noundef 1)
1351 ; CHECK-NEXT: ret void
1353 ; CHECK-NEXT: ret void
1354 ; CHECK-LABEL: define {{[^@]+}}@merge_cancellable_regions_seq
1355 ; CHECK-SAME: (i32 [[CANCEL1:%.*]], i32 [[CANCEL2:%.*]]) local_unnamed_addr {
1356 ; CHECK-NEXT: entry:
1357 ; CHECK-NEXT: [[CANCEL1_ADDR:%.*]] = alloca i32, align 4
1358 ; CHECK-NEXT: [[CANCEL2_ADDR:%.*]] = alloca i32, align 4
1359 ; CHECK-NEXT: store i32 [[CANCEL1]], ptr [[CANCEL1_ADDR]], align 4
1360 ; CHECK-NEXT: store i32 [[CANCEL2]], ptr [[CANCEL2_ADDR]], align 4
1361 ; CHECK-NEXT: [[OMP_GLOBAL_THREAD_NUM2:%.*]] = call i32 @__kmpc_global_thread_num(ptr @[[GLOB1]])
1362 ; CHECK-NEXT: br label [[OMP_PARALLEL:%.*]]
1363 ; CHECK: omp_parallel:
1364 ; CHECK-NEXT: call void (ptr, i32, ptr, ...) @__kmpc_fork_call(ptr @[[GLOB1]], i32 2, ptr @merge_cancellable_regions_seq..omp_par, ptr [[CANCEL1_ADDR]], ptr [[CANCEL2_ADDR]])
1365 ; CHECK-NEXT: br label [[OMP_PAR_OUTLINED_EXIT:%.*]]
1366 ; CHECK: omp.par.outlined.exit:
1367 ; CHECK-NEXT: br label [[OMP_PAR_EXIT_SPLIT:%.*]]
1368 ; CHECK: omp.par.exit.split:
1369 ; CHECK-NEXT: br label [[ENTRY_SPLIT_SPLIT:%.*]]
1370 ; CHECK: entry.split.split:
1371 ; CHECK-NEXT: ret void
1372 ; CHECK-LABEL: define {{[^@]+}}@merge_cancellable_regions_seq..omp_par
1373 ; CHECK-SAME: (ptr noalias [[TID_ADDR:%.*]], ptr noalias [[ZERO_ADDR:%.*]], ptr [[CANCEL1_ADDR:%.*]], ptr [[CANCEL2_ADDR:%.*]]) #[[ATTR0]] {
1374 ; CHECK-NEXT: omp.par.entry:
1375 ; CHECK-NEXT: [[TID_ADDR_LOCAL:%.*]] = alloca i32, align 4
1376 ; CHECK-NEXT: [[TMP0:%.*]] = load i32, ptr [[TID_ADDR]], align 4
1377 ; CHECK-NEXT: store i32 [[TMP0]], ptr [[TID_ADDR_LOCAL]], align 4
1378 ; CHECK-NEXT: [[TID:%.*]] = load i32, ptr [[TID_ADDR_LOCAL]], align 4
1379 ; CHECK-NEXT: br label [[OMP_PAR_REGION:%.*]]
1380 ; CHECK: omp.par.outlined.exit.exitStub:
1381 ; CHECK-NEXT: ret void
1382 ; CHECK: omp.par.region:
1383 ; CHECK-NEXT: br label [[OMP_PAR_MERGED:%.*]]
1384 ; CHECK: omp.par.merged:
1385 ; CHECK-NEXT: call void @.omp_outlined..20(ptr [[TID_ADDR]], ptr [[ZERO_ADDR]], ptr nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[CANCEL1_ADDR]])
1386 ; CHECK-NEXT: [[OMP_GLOBAL_THREAD_NUM2:%.*]] = call i32 @__kmpc_global_thread_num(ptr @[[GLOB1]])
1387 ; CHECK-NEXT: call void @__kmpc_barrier(ptr @[[GLOB2]], i32 [[OMP_GLOBAL_THREAD_NUM2]])
1388 ; CHECK-NEXT: [[OMP_GLOBAL_THREAD_NUM:%.*]] = call i32 @__kmpc_global_thread_num(ptr @[[GLOB1]])
1389 ; CHECK-NEXT: [[TMP1:%.*]] = call i32 @__kmpc_master(ptr @[[GLOB1]], i32 [[OMP_GLOBAL_THREAD_NUM]])
1390 ; CHECK-NEXT: [[TMP2:%.*]] = icmp ne i32 [[TMP1]], 0
1391 ; CHECK-NEXT: br i1 [[TMP2]], label [[OMP_REGION_BODY:%.*]], label [[OMP_REGION_END:%.*]]
1392 ; CHECK: omp_region.end:
1393 ; CHECK-NEXT: [[OMP_GLOBAL_THREAD_NUM1:%.*]] = call i32 @__kmpc_global_thread_num(ptr @[[GLOB1]])
1394 ; CHECK-NEXT: call void @__kmpc_barrier(ptr @[[GLOB2]], i32 [[OMP_GLOBAL_THREAD_NUM1]])
1395 ; CHECK-NEXT: br label [[OMP_PAR_MERGED_SPLIT_SPLIT:%.*]]
1396 ; CHECK: omp.par.merged.split.split:
1397 ; CHECK-NEXT: call void @.omp_outlined..21(ptr [[TID_ADDR]], ptr [[ZERO_ADDR]], ptr nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[CANCEL2_ADDR]])
1398 ; CHECK-NEXT: br label [[ENTRY_SPLIT:%.*]]
1399 ; CHECK: entry.split:
1400 ; CHECK-NEXT: br label [[OMP_PAR_REGION_SPLIT:%.*]]
1401 ; CHECK: omp.par.region.split:
1402 ; CHECK-NEXT: br label [[OMP_PAR_PRE_FINALIZE:%.*]]
1403 ; CHECK: omp.par.pre_finalize:
1404 ; CHECK-NEXT: br label [[OMP_PAR_OUTLINED_EXIT_EXITSTUB:%.*]]
1405 ; CHECK: omp_region.body:
1406 ; CHECK-NEXT: br label [[SEQ_PAR_MERGED:%.*]]
1407 ; CHECK: seq.par.merged:
1408 ; CHECK-NEXT: [[TMP3:%.*]] = load i32, ptr [[CANCEL1_ADDR]], align 4
1409 ; CHECK-NEXT: [[TOBOOL_NOT:%.*]] = icmp eq i32 [[TMP3]], 0
1410 ; CHECK-NEXT: [[LNOT_EXT:%.*]] = zext i1 [[TOBOOL_NOT]] to i32
1411 ; CHECK-NEXT: store i32 [[LNOT_EXT]], ptr [[CANCEL2_ADDR]], align 4
1412 ; CHECK-NEXT: br label [[OMP_PAR_MERGED_SPLIT:%.*]]
1413 ; CHECK: omp.par.merged.split:
1414 ; CHECK-NEXT: br label [[OMP_REGION_BODY_SPLIT:%.*]]
1415 ; CHECK: omp_region.body.split:
1416 ; CHECK-NEXT: call void @__kmpc_end_master(ptr @[[GLOB1]], i32 [[OMP_GLOBAL_THREAD_NUM]])
1417 ; CHECK-NEXT: br label [[OMP_REGION_END]]
1418 ; CHECK-LABEL: define {{[^@]+}}@.omp_outlined..20
1419 ; CHECK-SAME: (ptr noalias nocapture nofree readonly [[DOTGLOBAL_TID_:%.*]], ptr noalias nocapture nofree readnone [[DOTBOUND_TID_:%.*]], ptr nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[CANCEL1:%.*]]) {
1420 ; CHECK-NEXT: entry:
1421 ; CHECK-NEXT: [[TMP0:%.*]] = load i32, ptr [[CANCEL1]], align 4
1422 ; CHECK-NEXT: [[TOBOOL_NOT:%.*]] = icmp eq i32 [[TMP0]], 0
1423 ; CHECK-NEXT: br i1 [[TOBOOL_NOT]], label [[IF_END:%.*]], label [[IF_THEN:%.*]]
1425 ; CHECK-NEXT: [[TMP1:%.*]] = load i32, ptr [[DOTGLOBAL_TID_]], align 4
1426 ; CHECK-NEXT: [[TMP2:%.*]] = call i32 @__kmpc_cancel(ptr noundef nonnull @[[GLOB1]], i32 [[TMP1]], i32 noundef 1)
1427 ; CHECK-NEXT: ret void
1429 ; CHECK-NEXT: ret void
1430 ; CHECK-LABEL: define {{[^@]+}}@.omp_outlined..21
1431 ; CHECK-SAME: (ptr noalias nocapture nofree readonly [[DOTGLOBAL_TID_:%.*]], ptr noalias nocapture nofree readnone [[DOTBOUND_TID_:%.*]], ptr nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[CANCEL2:%.*]]) {
1432 ; CHECK-NEXT: entry:
1433 ; CHECK-NEXT: [[TMP0:%.*]] = load i32, ptr [[CANCEL2]], align 4
1434 ; CHECK-NEXT: [[TOBOOL_NOT:%.*]] = icmp eq i32 [[TMP0]], 0
1435 ; CHECK-NEXT: br i1 [[TOBOOL_NOT]], label [[IF_END:%.*]], label [[IF_THEN:%.*]]
1437 ; CHECK-NEXT: [[TMP1:%.*]] = load i32, ptr [[DOTGLOBAL_TID_]], align 4
1438 ; CHECK-NEXT: [[TMP2:%.*]] = call i32 @__kmpc_cancel(ptr noundef nonnull @[[GLOB1]], i32 [[TMP1]], i32 noundef 1)
1439 ; CHECK-NEXT: ret void
1441 ; CHECK-NEXT: ret void
1442 ; CHECK-LABEL: define {{[^@]+}}@merge_3
1443 ; CHECK-SAME: (i32 [[A:%.*]]) local_unnamed_addr {
1444 ; CHECK-NEXT: entry:
1445 ; CHECK-NEXT: [[A_ADDR:%.*]] = alloca i32, align 4
1446 ; CHECK-NEXT: store i32 [[A]], ptr [[A_ADDR]], align 4
1447 ; CHECK-NEXT: [[OMP_GLOBAL_THREAD_NUM:%.*]] = call i32 @__kmpc_global_thread_num(ptr @[[GLOB1]])
1448 ; CHECK-NEXT: br label [[OMP_PARALLEL:%.*]]
1449 ; CHECK: omp_parallel:
1450 ; CHECK-NEXT: call void (ptr, i32, ptr, ...) @__kmpc_fork_call(ptr @[[GLOB1]], i32 1, ptr @merge_3..omp_par, ptr [[A_ADDR]])
1451 ; CHECK-NEXT: br label [[OMP_PAR_OUTLINED_EXIT:%.*]]
1452 ; CHECK: omp.par.outlined.exit:
1453 ; CHECK-NEXT: br label [[OMP_PAR_EXIT_SPLIT:%.*]]
1454 ; CHECK: omp.par.exit.split:
1455 ; CHECK-NEXT: br label [[ENTRY_SPLIT_SPLIT:%.*]]
1456 ; CHECK: entry.split.split:
1457 ; CHECK-NEXT: ret void
1458 ; CHECK-LABEL: define {{[^@]+}}@merge_3..omp_par
1459 ; CHECK-SAME: (ptr noalias [[TID_ADDR:%.*]], ptr noalias [[ZERO_ADDR:%.*]], ptr [[A_ADDR:%.*]]) #[[ATTR0]] {
1460 ; CHECK-NEXT: omp.par.entry:
1461 ; CHECK-NEXT: [[TID_ADDR_LOCAL:%.*]] = alloca i32, align 4
1462 ; CHECK-NEXT: [[TMP0:%.*]] = load i32, ptr [[TID_ADDR]], align 4
1463 ; CHECK-NEXT: store i32 [[TMP0]], ptr [[TID_ADDR_LOCAL]], align 4
1464 ; CHECK-NEXT: [[TID:%.*]] = load i32, ptr [[TID_ADDR_LOCAL]], align 4
1465 ; CHECK-NEXT: br label [[OMP_PAR_REGION:%.*]]
1466 ; CHECK: omp.par.outlined.exit.exitStub:
1467 ; CHECK-NEXT: ret void
1468 ; CHECK: omp.par.region:
1469 ; CHECK-NEXT: br label [[OMP_PAR_MERGED:%.*]]
1470 ; CHECK: omp.par.merged:
1471 ; CHECK-NEXT: call void @.omp_outlined..22(ptr [[TID_ADDR]], ptr [[ZERO_ADDR]], ptr nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[A_ADDR]])
1472 ; CHECK-NEXT: [[OMP_GLOBAL_THREAD_NUM:%.*]] = call i32 @__kmpc_global_thread_num(ptr @[[GLOB1]])
1473 ; CHECK-NEXT: call void @__kmpc_barrier(ptr @[[GLOB2]], i32 [[OMP_GLOBAL_THREAD_NUM]])
1474 ; CHECK-NEXT: call void @.omp_outlined..23(ptr [[TID_ADDR]], ptr [[ZERO_ADDR]], ptr nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[A_ADDR]])
1475 ; CHECK-NEXT: [[OMP_GLOBAL_THREAD_NUM1:%.*]] = call i32 @__kmpc_global_thread_num(ptr @[[GLOB1]])
1476 ; CHECK-NEXT: call void @__kmpc_barrier(ptr @[[GLOB2]], i32 [[OMP_GLOBAL_THREAD_NUM1]])
1477 ; CHECK-NEXT: call void @.omp_outlined..24(ptr [[TID_ADDR]], ptr [[ZERO_ADDR]], ptr nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[A_ADDR]])
1478 ; CHECK-NEXT: br label [[ENTRY_SPLIT:%.*]]
1479 ; CHECK: entry.split:
1480 ; CHECK-NEXT: br label [[OMP_PAR_REGION_SPLIT:%.*]]
1481 ; CHECK: omp.par.region.split:
1482 ; CHECK-NEXT: br label [[OMP_PAR_PRE_FINALIZE:%.*]]
1483 ; CHECK: omp.par.pre_finalize:
1484 ; CHECK-NEXT: br label [[OMP_PAR_OUTLINED_EXIT_EXITSTUB:%.*]]
1485 ; CHECK-LABEL: define {{[^@]+}}@.omp_outlined..22
1486 ; CHECK-SAME: (ptr noalias nocapture nofree readnone [[DOTGLOBAL_TID_:%.*]], ptr noalias nocapture nofree readnone [[DOTBOUND_TID_:%.*]], ptr nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[A:%.*]]) {
1487 ; CHECK-NEXT: entry:
1488 ; CHECK-NEXT: [[TMP0:%.*]] = load i32, ptr [[A]], align 4
1489 ; CHECK-NEXT: call void @use(i32 [[TMP0]])
1490 ; CHECK-NEXT: ret void
1491 ; CHECK-LABEL: define {{[^@]+}}@.omp_outlined..23
1492 ; CHECK-SAME: (ptr noalias nocapture nofree readnone [[DOTGLOBAL_TID_:%.*]], ptr noalias nocapture nofree readnone [[DOTBOUND_TID_:%.*]], ptr nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[A:%.*]]) {
1493 ; CHECK-NEXT: entry:
1494 ; CHECK-NEXT: [[TMP0:%.*]] = load i32, ptr [[A]], align 4
1495 ; CHECK-NEXT: call void @use(i32 [[TMP0]])
1496 ; CHECK-NEXT: ret void
1497 ; CHECK-LABEL: define {{[^@]+}}@.omp_outlined..24
1498 ; CHECK-SAME: (ptr noalias nocapture nofree readnone [[DOTGLOBAL_TID_:%.*]], ptr noalias nocapture nofree readnone [[DOTBOUND_TID_:%.*]], ptr nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[A:%.*]]) {
1499 ; CHECK-NEXT: entry:
1500 ; CHECK-NEXT: [[TMP0:%.*]] = load i32, ptr [[A]], align 4
1501 ; CHECK-NEXT: call void @use(i32 [[TMP0]])
1502 ; CHECK-NEXT: ret void
1503 ; CHECK-LABEL: define {{[^@]+}}@merge_3_seq
1504 ; CHECK-SAME: (i32 [[A:%.*]], i32 [[B:%.*]]) local_unnamed_addr {
1505 ; CHECK-NEXT: entry:
1506 ; CHECK-NEXT: [[ADD1_SEQ_OUTPUT_ALLOC:%.*]] = alloca i32, align 4
1507 ; CHECK-NEXT: [[ADD_SEQ_OUTPUT_ALLOC:%.*]] = alloca i32, align 4
1508 ; CHECK-NEXT: [[A_ADDR:%.*]] = alloca i32, align 4
1509 ; CHECK-NEXT: store i32 [[A]], ptr [[A_ADDR]], align 4
1510 ; CHECK-NEXT: [[OMP_GLOBAL_THREAD_NUM7:%.*]] = call i32 @__kmpc_global_thread_num(ptr @[[GLOB1]])
1511 ; CHECK-NEXT: br label [[OMP_PARALLEL:%.*]]
1512 ; CHECK: omp_parallel:
1513 ; CHECK-NEXT: call void (ptr, i32, ptr, ...) @__kmpc_fork_call(ptr @[[GLOB1]], i32 3, ptr @merge_3_seq..omp_par, ptr [[A_ADDR]], ptr [[ADD_SEQ_OUTPUT_ALLOC]], ptr [[ADD1_SEQ_OUTPUT_ALLOC]])
1514 ; CHECK-NEXT: br label [[OMP_PAR_OUTLINED_EXIT:%.*]]
1515 ; CHECK: omp.par.outlined.exit:
1516 ; CHECK-NEXT: br label [[OMP_PAR_EXIT_SPLIT:%.*]]
1517 ; CHECK: omp.par.exit.split:
1518 ; CHECK-NEXT: br label [[ENTRY_SPLIT_SPLIT:%.*]]
1519 ; CHECK: entry.split.split:
1520 ; CHECK-NEXT: [[ADD1_SEQ_OUTPUT_LOAD:%.*]] = load i32, ptr [[ADD1_SEQ_OUTPUT_ALLOC]], align 4
1521 ; CHECK-NEXT: call void @use(i32 [[ADD1_SEQ_OUTPUT_LOAD]])
1522 ; CHECK-NEXT: ret void
1523 ; CHECK-LABEL: define {{[^@]+}}@merge_3_seq..omp_par
1524 ; CHECK-SAME: (ptr noalias [[TID_ADDR:%.*]], ptr noalias [[ZERO_ADDR:%.*]], ptr [[A_ADDR:%.*]], ptr [[ADD_SEQ_OUTPUT_ALLOC:%.*]], ptr [[ADD1_SEQ_OUTPUT_ALLOC:%.*]]) #[[ATTR0]] {
1525 ; CHECK-NEXT: omp.par.entry:
1526 ; CHECK-NEXT: [[TID_ADDR_LOCAL:%.*]] = alloca i32, align 4
1527 ; CHECK-NEXT: [[TMP0:%.*]] = load i32, ptr [[TID_ADDR]], align 4
1528 ; CHECK-NEXT: store i32 [[TMP0]], ptr [[TID_ADDR_LOCAL]], align 4
1529 ; CHECK-NEXT: [[TID:%.*]] = load i32, ptr [[TID_ADDR_LOCAL]], align 4
1530 ; CHECK-NEXT: br label [[OMP_PAR_REGION:%.*]]
1531 ; CHECK: omp.par.outlined.exit.exitStub:
1532 ; CHECK-NEXT: ret void
1533 ; CHECK: omp.par.region:
1534 ; CHECK-NEXT: br label [[OMP_PAR_MERGED:%.*]]
1535 ; CHECK: omp.par.merged:
1536 ; CHECK-NEXT: call void @.omp_outlined..25(ptr [[TID_ADDR]], ptr [[ZERO_ADDR]], ptr nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[A_ADDR]])
1537 ; CHECK-NEXT: [[OMP_GLOBAL_THREAD_NUM2:%.*]] = call i32 @__kmpc_global_thread_num(ptr @[[GLOB1]])
1538 ; CHECK-NEXT: call void @__kmpc_barrier(ptr @[[GLOB2]], i32 [[OMP_GLOBAL_THREAD_NUM2]])
1539 ; CHECK-NEXT: [[OMP_GLOBAL_THREAD_NUM:%.*]] = call i32 @__kmpc_global_thread_num(ptr @[[GLOB1]])
1540 ; CHECK-NEXT: [[TMP1:%.*]] = call i32 @__kmpc_master(ptr @[[GLOB1]], i32 [[OMP_GLOBAL_THREAD_NUM]])
1541 ; CHECK-NEXT: [[TMP2:%.*]] = icmp ne i32 [[TMP1]], 0
1542 ; CHECK-NEXT: br i1 [[TMP2]], label [[OMP_REGION_BODY:%.*]], label [[OMP_REGION_END:%.*]]
1543 ; CHECK: omp_region.end:
1544 ; CHECK-NEXT: [[OMP_GLOBAL_THREAD_NUM1:%.*]] = call i32 @__kmpc_global_thread_num(ptr @[[GLOB1]])
1545 ; CHECK-NEXT: call void @__kmpc_barrier(ptr @[[GLOB2]], i32 [[OMP_GLOBAL_THREAD_NUM1]])
1546 ; CHECK-NEXT: br label [[OMP_PAR_MERGED_SPLIT_SPLIT:%.*]]
1547 ; CHECK: omp.par.merged.split.split:
1548 ; CHECK-NEXT: call void @.omp_outlined..26(ptr [[TID_ADDR]], ptr [[ZERO_ADDR]], ptr nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[A_ADDR]])
1549 ; CHECK-NEXT: [[OMP_GLOBAL_THREAD_NUM4:%.*]] = call i32 @__kmpc_global_thread_num(ptr @[[GLOB1]])
1550 ; CHECK-NEXT: call void @__kmpc_barrier(ptr @[[GLOB2]], i32 [[OMP_GLOBAL_THREAD_NUM4]])
1551 ; CHECK-NEXT: [[OMP_GLOBAL_THREAD_NUM3:%.*]] = call i32 @__kmpc_global_thread_num(ptr @[[GLOB1]])
1552 ; CHECK-NEXT: [[TMP3:%.*]] = call i32 @__kmpc_master(ptr @[[GLOB1]], i32 [[OMP_GLOBAL_THREAD_NUM3]])
1553 ; CHECK-NEXT: [[TMP4:%.*]] = icmp ne i32 [[TMP3]], 0
1554 ; CHECK-NEXT: br i1 [[TMP4]], label [[OMP_REGION_BODY5:%.*]], label [[OMP_REGION_END4:%.*]]
1555 ; CHECK: omp_region.end4:
1556 ; CHECK-NEXT: [[OMP_GLOBAL_THREAD_NUM6:%.*]] = call i32 @__kmpc_global_thread_num(ptr @[[GLOB1]])
1557 ; CHECK-NEXT: call void @__kmpc_barrier(ptr @[[GLOB2]], i32 [[OMP_GLOBAL_THREAD_NUM6]])
1558 ; CHECK-NEXT: br label [[OMP_PAR_MERGED_SPLIT_SPLIT_SPLIT_SPLIT:%.*]]
1559 ; CHECK: omp.par.merged.split.split.split.split:
1560 ; CHECK-NEXT: call void @.omp_outlined..27(ptr [[TID_ADDR]], ptr [[ZERO_ADDR]], ptr nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[A_ADDR]])
1561 ; CHECK-NEXT: br label [[ENTRY_SPLIT:%.*]]
1562 ; CHECK: entry.split:
1563 ; CHECK-NEXT: br label [[OMP_PAR_REGION_SPLIT:%.*]]
1564 ; CHECK: omp.par.region.split:
1565 ; CHECK-NEXT: br label [[OMP_PAR_PRE_FINALIZE:%.*]]
1566 ; CHECK: omp.par.pre_finalize:
1567 ; CHECK-NEXT: br label [[OMP_PAR_OUTLINED_EXIT_EXITSTUB:%.*]]
1568 ; CHECK: omp_region.body5:
1569 ; CHECK-NEXT: br label [[SEQ_PAR_MERGED2:%.*]]
1570 ; CHECK: seq.par.merged2:
1571 ; CHECK-NEXT: [[TMP5:%.*]] = load i32, ptr [[A_ADDR]], align 4
1572 ; CHECK-NEXT: [[ADD_SEQ_OUTPUT_LOAD:%.*]] = load i32, ptr [[ADD_SEQ_OUTPUT_ALLOC]], align 4
1573 ; CHECK-NEXT: [[ADD1:%.*]] = add nsw i32 [[ADD_SEQ_OUTPUT_LOAD]], [[TMP5]]
1574 ; CHECK-NEXT: store i32 [[ADD1]], ptr [[ADD1_SEQ_OUTPUT_ALLOC]], align 4
1575 ; CHECK-NEXT: br label [[OMP_PAR_MERGED_SPLIT_SPLIT_SPLIT:%.*]]
1576 ; CHECK: omp.par.merged.split.split.split:
1577 ; CHECK-NEXT: br label [[OMP_REGION_BODY5_SPLIT:%.*]]
1578 ; CHECK: omp_region.body5.split:
1579 ; CHECK-NEXT: call void @__kmpc_end_master(ptr @[[GLOB1]], i32 [[OMP_GLOBAL_THREAD_NUM3]])
1580 ; CHECK-NEXT: br label [[OMP_REGION_END4]]
1581 ; CHECK: omp_region.body:
1582 ; CHECK-NEXT: br label [[SEQ_PAR_MERGED:%.*]]
1583 ; CHECK: seq.par.merged:
1584 ; CHECK-NEXT: [[TMP6:%.*]] = load i32, ptr [[A_ADDR]], align 4
1585 ; CHECK-NEXT: [[ADD:%.*]] = add nsw i32 [[TMP6]], 1
1586 ; CHECK-NEXT: store i32 [[ADD]], ptr [[ADD_SEQ_OUTPUT_ALLOC]], align 4
1587 ; CHECK-NEXT: br label [[OMP_PAR_MERGED_SPLIT:%.*]]
1588 ; CHECK: omp.par.merged.split:
1589 ; CHECK-NEXT: br label [[OMP_REGION_BODY_SPLIT:%.*]]
1590 ; CHECK: omp_region.body.split:
1591 ; CHECK-NEXT: call void @__kmpc_end_master(ptr @[[GLOB1]], i32 [[OMP_GLOBAL_THREAD_NUM]])
1592 ; CHECK-NEXT: br label [[OMP_REGION_END]]
1593 ; CHECK-LABEL: define {{[^@]+}}@.omp_outlined..25
1594 ; CHECK-SAME: (ptr noalias nocapture nofree readnone [[DOTGLOBAL_TID_:%.*]], ptr noalias nocapture nofree readnone [[DOTBOUND_TID_:%.*]], ptr nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[A:%.*]]) {
1595 ; CHECK-NEXT: entry:
1596 ; CHECK-NEXT: [[TMP0:%.*]] = load i32, ptr [[A]], align 4
1597 ; CHECK-NEXT: call void @use(i32 [[TMP0]])
1598 ; CHECK-NEXT: ret void
1599 ; CHECK-LABEL: define {{[^@]+}}@.omp_outlined..26
1600 ; CHECK-SAME: (ptr noalias nocapture nofree readnone [[DOTGLOBAL_TID_:%.*]], ptr noalias nocapture nofree readnone [[DOTBOUND_TID_:%.*]], ptr nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[A:%.*]]) {
1601 ; CHECK-NEXT: entry:
1602 ; CHECK-NEXT: [[TMP0:%.*]] = load i32, ptr [[A]], align 4
1603 ; CHECK-NEXT: call void @use(i32 [[TMP0]])
1604 ; CHECK-NEXT: ret void
1605 ; CHECK-LABEL: define {{[^@]+}}@.omp_outlined..27
1606 ; CHECK-SAME: (ptr noalias nocapture nofree readnone [[DOTGLOBAL_TID_:%.*]], ptr noalias nocapture nofree readnone [[DOTBOUND_TID_:%.*]], ptr nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[A:%.*]]) {
1607 ; CHECK-NEXT: entry:
1608 ; CHECK-NEXT: [[TMP0:%.*]] = load i32, ptr [[A]], align 4
1609 ; CHECK-NEXT: call void @use(i32 [[TMP0]])
1610 ; CHECK-NEXT: ret void
1611 ; CHECK-LABEL: define {{[^@]+}}@unmergable_3_seq_call
1612 ; CHECK-SAME: (i32 [[A:%.*]]) local_unnamed_addr {
1613 ; CHECK-NEXT: entry:
1614 ; CHECK-NEXT: [[A_ADDR:%.*]] = alloca i32, align 4
1615 ; CHECK-NEXT: store i32 [[A]], ptr [[A_ADDR]], align 4
1616 ; CHECK-NEXT: call void (ptr, i32, ptr, ...) @__kmpc_fork_call(ptr noundef nonnull align 8 dereferenceable(24) @[[GLOB1]], i32 noundef 1, ptr noundef @.omp_outlined..28, ptr nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[A_ADDR]])
1617 ; CHECK-NEXT: call void (...) @foo()
1618 ; CHECK-NEXT: call void (ptr, i32, ptr, ...) @__kmpc_fork_call(ptr noundef nonnull align 8 dereferenceable(24) @[[GLOB1]], i32 noundef 1, ptr noundef @.omp_outlined..29, ptr nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[A_ADDR]])
1619 ; CHECK-NEXT: call void (...) @foo()
1620 ; CHECK-NEXT: call void (ptr, i32, ptr, ...) @__kmpc_fork_call(ptr noundef nonnull align 8 dereferenceable(24) @[[GLOB1]], i32 noundef 1, ptr noundef @.omp_outlined..30, ptr nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[A_ADDR]])
1621 ; CHECK-NEXT: ret void
1622 ; CHECK-LABEL: define {{[^@]+}}@.omp_outlined..28
1623 ; CHECK-SAME: (ptr noalias nocapture nofree readnone [[DOTGLOBAL_TID_:%.*]], ptr noalias nocapture nofree readnone [[DOTBOUND_TID_:%.*]], ptr nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[A:%.*]]) {
1624 ; CHECK-NEXT: entry:
1625 ; CHECK-NEXT: [[TMP0:%.*]] = load i32, ptr [[A]], align 4
1626 ; CHECK-NEXT: call void @use(i32 [[TMP0]])
1627 ; CHECK-NEXT: ret void
1628 ; CHECK-LABEL: define {{[^@]+}}@.omp_outlined..29
1629 ; CHECK-SAME: (ptr noalias nocapture nofree readnone [[DOTGLOBAL_TID_:%.*]], ptr noalias nocapture nofree readnone [[DOTBOUND_TID_:%.*]], ptr nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[A:%.*]]) {
1630 ; CHECK-NEXT: entry:
1631 ; CHECK-NEXT: [[TMP0:%.*]] = load i32, ptr [[A]], align 4
1632 ; CHECK-NEXT: call void @use(i32 [[TMP0]])
1633 ; CHECK-NEXT: ret void
1634 ; CHECK-LABEL: define {{[^@]+}}@.omp_outlined..30
1635 ; CHECK-SAME: (ptr noalias nocapture nofree readnone [[DOTGLOBAL_TID_:%.*]], ptr noalias nocapture nofree readnone [[DOTBOUND_TID_:%.*]], ptr nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[A:%.*]]) {
1636 ; CHECK-NEXT: entry:
1637 ; CHECK-NEXT: [[TMP0:%.*]] = load i32, ptr [[A]], align 4
1638 ; CHECK-NEXT: call void @use(i32 [[TMP0]])
1639 ; CHECK-NEXT: ret void
1640 ; CHECK-LABEL: define {{[^@]+}}@unmergable_3_proc_bind
1641 ; CHECK-SAME: (i32 [[A:%.*]]) local_unnamed_addr {
1642 ; CHECK-NEXT: entry:
1643 ; CHECK-NEXT: [[A_ADDR:%.*]] = alloca i32, align 4
1644 ; CHECK-NEXT: [[TMP0:%.*]] = call i32 @__kmpc_global_thread_num(ptr noundef nonnull align 8 dereferenceable(24) @[[GLOB1]])
1645 ; CHECK-NEXT: store i32 [[A]], ptr [[A_ADDR]], align 4
1646 ; CHECK-NEXT: call void (ptr, i32, ptr, ...) @__kmpc_fork_call(ptr noundef nonnull align 8 dereferenceable(24) @[[GLOB1]], i32 noundef 1, ptr noundef @.omp_outlined..31, ptr nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[A_ADDR]])
1647 ; CHECK-NEXT: call void @__kmpc_push_proc_bind(ptr noundef nonnull align 8 dereferenceable(24) @[[GLOB1]], i32 [[TMP0]], i32 noundef 3)
1648 ; CHECK-NEXT: call void (ptr, i32, ptr, ...) @__kmpc_fork_call(ptr noundef nonnull align 8 dereferenceable(24) @[[GLOB1]], i32 noundef 1, ptr noundef @.omp_outlined..32, ptr nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[A_ADDR]])
1649 ; CHECK-NEXT: call void (ptr, i32, ptr, ...) @__kmpc_fork_call(ptr noundef nonnull align 8 dereferenceable(24) @[[GLOB1]], i32 noundef 1, ptr noundef @.omp_outlined..33, ptr nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[A_ADDR]])
1650 ; CHECK-NEXT: ret void
1651 ; CHECK-LABEL: define {{[^@]+}}@.omp_outlined..31
1652 ; CHECK-SAME: (ptr noalias nocapture nofree readnone [[DOTGLOBAL_TID_:%.*]], ptr noalias nocapture nofree readnone [[DOTBOUND_TID_:%.*]], ptr nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[A:%.*]]) {
1653 ; CHECK-NEXT: entry:
1654 ; CHECK-NEXT: [[TMP0:%.*]] = load i32, ptr [[A]], align 4
1655 ; CHECK-NEXT: call void @use(i32 [[TMP0]])
1656 ; CHECK-NEXT: ret void
1657 ; CHECK-LABEL: define {{[^@]+}}@.omp_outlined..32
1658 ; CHECK-SAME: (ptr noalias nocapture nofree readnone [[DOTGLOBAL_TID_:%.*]], ptr noalias nocapture nofree readnone [[DOTBOUND_TID_:%.*]], ptr nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[A:%.*]]) {
1659 ; CHECK-NEXT: entry:
1660 ; CHECK-NEXT: [[TMP0:%.*]] = load i32, ptr [[A]], align 4
1661 ; CHECK-NEXT: call void @use(i32 [[TMP0]])
1662 ; CHECK-NEXT: ret void
1663 ; CHECK-LABEL: define {{[^@]+}}@.omp_outlined..33
1664 ; CHECK-SAME: (ptr noalias nocapture nofree readnone [[DOTGLOBAL_TID_:%.*]], ptr noalias nocapture nofree readnone [[DOTBOUND_TID_:%.*]], ptr nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[A:%.*]]) {
1665 ; CHECK-NEXT: entry:
1666 ; CHECK-NEXT: [[TMP0:%.*]] = load i32, ptr [[A]], align 4
1667 ; CHECK-NEXT: call void @use(i32 [[TMP0]])
1668 ; CHECK-NEXT: ret void
1669 ; CHECK-LABEL: define {{[^@]+}}@unmergable_3_num_threads
1670 ; CHECK-SAME: (i32 [[A:%.*]]) local_unnamed_addr {
1671 ; CHECK-NEXT: entry:
1672 ; CHECK-NEXT: [[A_ADDR:%.*]] = alloca i32, align 4
1673 ; CHECK-NEXT: [[TMP0:%.*]] = call i32 @__kmpc_global_thread_num(ptr noundef nonnull align 8 dereferenceable(24) @[[GLOB1]])
1674 ; CHECK-NEXT: store i32 [[A]], ptr [[A_ADDR]], align 4
1675 ; CHECK-NEXT: call void (ptr, i32, ptr, ...) @__kmpc_fork_call(ptr noundef nonnull align 8 dereferenceable(24) @[[GLOB1]], i32 noundef 1, ptr noundef @.omp_outlined..34, ptr nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[A_ADDR]])
1676 ; CHECK-NEXT: [[TMP1:%.*]] = load i32, ptr [[A_ADDR]], align 4
1677 ; CHECK-NEXT: call void @__kmpc_push_num_threads(ptr noundef nonnull align 8 dereferenceable(24) @[[GLOB1]], i32 [[TMP0]], i32 [[TMP1]])
1678 ; CHECK-NEXT: call void (ptr, i32, ptr, ...) @__kmpc_fork_call(ptr noundef nonnull align 8 dereferenceable(24) @[[GLOB1]], i32 noundef 1, ptr noundef @.omp_outlined..35, ptr nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[A_ADDR]])
1679 ; CHECK-NEXT: call void (ptr, i32, ptr, ...) @__kmpc_fork_call(ptr noundef nonnull align 8 dereferenceable(24) @[[GLOB1]], i32 noundef 1, ptr noundef @.omp_outlined..36, ptr nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[A_ADDR]])
1680 ; CHECK-NEXT: ret void
1681 ; CHECK-LABEL: define {{[^@]+}}@.omp_outlined..34
1682 ; CHECK-SAME: (ptr noalias nocapture nofree readnone [[DOTGLOBAL_TID_:%.*]], ptr noalias nocapture nofree readnone [[DOTBOUND_TID_:%.*]], ptr nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[A:%.*]]) {
1683 ; CHECK-NEXT: entry:
1684 ; CHECK-NEXT: [[TMP0:%.*]] = load i32, ptr [[A]], align 4
1685 ; CHECK-NEXT: call void @use(i32 [[TMP0]])
1686 ; CHECK-NEXT: ret void
1687 ; CHECK-LABEL: define {{[^@]+}}@.omp_outlined..35
1688 ; CHECK-SAME: (ptr noalias nocapture nofree readnone [[DOTGLOBAL_TID_:%.*]], ptr noalias nocapture nofree readnone [[DOTBOUND_TID_:%.*]], ptr nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[A:%.*]]) {
1689 ; CHECK-NEXT: entry:
1690 ; CHECK-NEXT: [[TMP0:%.*]] = load i32, ptr [[A]], align 4
1691 ; CHECK-NEXT: call void @use(i32 [[TMP0]])
1692 ; CHECK-NEXT: ret void
1693 ; CHECK-LABEL: define {{[^@]+}}@.omp_outlined..36
1694 ; CHECK-SAME: (ptr noalias nocapture nofree readnone [[DOTGLOBAL_TID_:%.*]], ptr noalias nocapture nofree readnone [[DOTBOUND_TID_:%.*]], ptr nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[A:%.*]]) {
1695 ; CHECK-NEXT: entry:
1696 ; CHECK-NEXT: [[TMP0:%.*]] = load i32, ptr [[A]], align 4
1697 ; CHECK-NEXT: call void @use(i32 [[TMP0]])
1698 ; CHECK-NEXT: ret void
1699 ; CHECK-LABEL: define {{[^@]+}}@merge_2_unmergable_1
1700 ; CHECK-SAME: (i32 [[A:%.*]]) local_unnamed_addr {
1701 ; CHECK-NEXT: entry:
1702 ; CHECK-NEXT: [[A_ADDR:%.*]] = alloca i32, align 4
1703 ; CHECK-NEXT: store i32 [[A]], ptr [[A_ADDR]], align 4
1704 ; CHECK-NEXT: [[OMP_GLOBAL_THREAD_NUM:%.*]] = call i32 @__kmpc_global_thread_num(ptr @[[GLOB1]])
1705 ; CHECK-NEXT: br label [[OMP_PARALLEL:%.*]]
1706 ; CHECK: omp_parallel:
1707 ; CHECK-NEXT: call void (ptr, i32, ptr, ...) @__kmpc_fork_call(ptr @[[GLOB1]], i32 1, ptr @merge_2_unmergable_1..omp_par, ptr [[A_ADDR]])
1708 ; CHECK-NEXT: br label [[OMP_PAR_OUTLINED_EXIT:%.*]]
1709 ; CHECK: omp.par.outlined.exit:
1710 ; CHECK-NEXT: br label [[OMP_PAR_EXIT_SPLIT:%.*]]
1711 ; CHECK: omp.par.exit.split:
1712 ; CHECK-NEXT: br label [[ENTRY_SPLIT_SPLIT:%.*]]
1713 ; CHECK: entry.split.split:
1714 ; CHECK-NEXT: call void (...) @foo()
1715 ; CHECK-NEXT: call void (ptr, i32, ptr, ...) @__kmpc_fork_call(ptr noundef nonnull align 8 dereferenceable(24) @[[GLOB1]], i32 noundef 1, ptr noundef @.omp_outlined..39, ptr nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[A_ADDR]])
1716 ; CHECK-NEXT: ret void
1717 ; CHECK-LABEL: define {{[^@]+}}@merge_2_unmergable_1..omp_par
1718 ; CHECK-SAME: (ptr noalias [[TID_ADDR:%.*]], ptr noalias [[ZERO_ADDR:%.*]], ptr [[A_ADDR:%.*]]) #[[ATTR0]] {
1719 ; CHECK-NEXT: omp.par.entry:
1720 ; CHECK-NEXT: [[TID_ADDR_LOCAL:%.*]] = alloca i32, align 4
1721 ; CHECK-NEXT: [[TMP0:%.*]] = load i32, ptr [[TID_ADDR]], align 4
1722 ; CHECK-NEXT: store i32 [[TMP0]], ptr [[TID_ADDR_LOCAL]], align 4
1723 ; CHECK-NEXT: [[TID:%.*]] = load i32, ptr [[TID_ADDR_LOCAL]], align 4
1724 ; CHECK-NEXT: br label [[OMP_PAR_REGION:%.*]]
1725 ; CHECK: omp.par.outlined.exit.exitStub:
1726 ; CHECK-NEXT: ret void
1727 ; CHECK: omp.par.region:
1728 ; CHECK-NEXT: br label [[OMP_PAR_MERGED:%.*]]
1729 ; CHECK: omp.par.merged:
1730 ; CHECK-NEXT: call void @.omp_outlined..37(ptr [[TID_ADDR]], ptr [[ZERO_ADDR]], ptr nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[A_ADDR]])
1731 ; CHECK-NEXT: [[OMP_GLOBAL_THREAD_NUM:%.*]] = call i32 @__kmpc_global_thread_num(ptr @[[GLOB1]])
1732 ; CHECK-NEXT: call void @__kmpc_barrier(ptr @[[GLOB2]], i32 [[OMP_GLOBAL_THREAD_NUM]])
1733 ; CHECK-NEXT: call void @.omp_outlined..38(ptr [[TID_ADDR]], ptr [[ZERO_ADDR]], ptr nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[A_ADDR]])
1734 ; CHECK-NEXT: br label [[ENTRY_SPLIT:%.*]]
1735 ; CHECK: entry.split:
1736 ; CHECK-NEXT: br label [[OMP_PAR_REGION_SPLIT:%.*]]
1737 ; CHECK: omp.par.region.split:
1738 ; CHECK-NEXT: br label [[OMP_PAR_PRE_FINALIZE:%.*]]
1739 ; CHECK: omp.par.pre_finalize:
1740 ; CHECK-NEXT: br label [[OMP_PAR_OUTLINED_EXIT_EXITSTUB:%.*]]
1741 ; CHECK-LABEL: define {{[^@]+}}@.omp_outlined..37
1742 ; CHECK-SAME: (ptr noalias nocapture nofree readnone [[DOTGLOBAL_TID_:%.*]], ptr noalias nocapture nofree readnone [[DOTBOUND_TID_:%.*]], ptr nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[A:%.*]]) {
1743 ; CHECK-NEXT: entry:
1744 ; CHECK-NEXT: [[TMP0:%.*]] = load i32, ptr [[A]], align 4
1745 ; CHECK-NEXT: call void @use(i32 [[TMP0]])
1746 ; CHECK-NEXT: ret void
1747 ; CHECK-LABEL: define {{[^@]+}}@.omp_outlined..38
1748 ; CHECK-SAME: (ptr noalias nocapture nofree readnone [[DOTGLOBAL_TID_:%.*]], ptr noalias nocapture nofree readnone [[DOTBOUND_TID_:%.*]], ptr nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[A:%.*]]) {
1749 ; CHECK-NEXT: entry:
1750 ; CHECK-NEXT: [[TMP0:%.*]] = load i32, ptr [[A]], align 4
1751 ; CHECK-NEXT: call void @use(i32 [[TMP0]])
1752 ; CHECK-NEXT: ret void
1753 ; CHECK-LABEL: define {{[^@]+}}@.omp_outlined..39
1754 ; CHECK-SAME: (ptr noalias nocapture nofree readnone [[DOTGLOBAL_TID_:%.*]], ptr noalias nocapture nofree readnone [[DOTBOUND_TID_:%.*]], ptr nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[A:%.*]]) {
1755 ; CHECK-NEXT: entry:
1756 ; CHECK-NEXT: [[TMP0:%.*]] = load i32, ptr [[A]], align 4
1757 ; CHECK-NEXT: call void @use(i32 [[TMP0]])
1758 ; CHECK-NEXT: ret void
1759 ; CHECK-LABEL: define {{[^@]+}}@merge
1760 ; CHECK-SAME: (i32 [[A:%.*]]) local_unnamed_addr {
1761 ; CHECK-NEXT: entry:
1762 ; CHECK-NEXT: [[A_ADDR:%.*]] = alloca i32, align 4
1763 ; CHECK-NEXT: store i32 [[A]], ptr [[A_ADDR]], align 4
1764 ; CHECK-NEXT: [[OMP_GLOBAL_THREAD_NUM:%.*]] = call i32 @__kmpc_global_thread_num(ptr @[[GLOB1]])
1765 ; CHECK-NEXT: br label [[OMP_PARALLEL:%.*]]
1766 ; CHECK: omp_parallel:
1767 ; CHECK-NEXT: call void (ptr, i32, ptr, ...) @__kmpc_fork_call(ptr @[[GLOB1]], i32 1, ptr @merge..omp_par, ptr [[A_ADDR]])
1768 ; CHECK-NEXT: br label [[OMP_PAR_OUTLINED_EXIT:%.*]]
1769 ; CHECK: omp.par.outlined.exit:
1770 ; CHECK-NEXT: br label [[OMP_PAR_EXIT_SPLIT:%.*]]
1771 ; CHECK: omp.par.exit.split:
1772 ; CHECK-NEXT: br label [[ENTRY_SPLIT_SPLIT:%.*]]
1773 ; CHECK: entry.split.split:
1774 ; CHECK-NEXT: ret void
1775 ; CHECK-LABEL: define {{[^@]+}}@merge..omp_par
1776 ; CHECK-SAME: (ptr noalias [[TID_ADDR:%.*]], ptr noalias [[ZERO_ADDR:%.*]], ptr [[A_ADDR:%.*]]) #[[ATTR0]] {
1777 ; CHECK-NEXT: omp.par.entry:
1778 ; CHECK-NEXT: [[TID_ADDR_LOCAL:%.*]] = alloca i32, align 4
1779 ; CHECK-NEXT: [[TMP0:%.*]] = load i32, ptr [[TID_ADDR]], align 4
1780 ; CHECK-NEXT: store i32 [[TMP0]], ptr [[TID_ADDR_LOCAL]], align 4
1781 ; CHECK-NEXT: [[TID:%.*]] = load i32, ptr [[TID_ADDR_LOCAL]], align 4
1782 ; CHECK-NEXT: br label [[OMP_PAR_REGION:%.*]]
1783 ; CHECK: omp.par.outlined.exit.exitStub:
1784 ; CHECK-NEXT: ret void
1785 ; CHECK: omp.par.region:
1786 ; CHECK-NEXT: br label [[OMP_PAR_MERGED:%.*]]
1787 ; CHECK: omp.par.merged:
1788 ; CHECK-NEXT: call void @.omp_outlined.(ptr [[TID_ADDR]], ptr [[ZERO_ADDR]], ptr nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[A_ADDR]])
1789 ; CHECK-NEXT: [[OMP_GLOBAL_THREAD_NUM:%.*]] = call i32 @__kmpc_global_thread_num(ptr @[[GLOB1]])
1790 ; CHECK-NEXT: call void @__kmpc_barrier(ptr @[[GLOB2]], i32 [[OMP_GLOBAL_THREAD_NUM]])
1791 ; CHECK-NEXT: call void @.omp_outlined..1(ptr [[TID_ADDR]], ptr [[ZERO_ADDR]], ptr nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[A_ADDR]])
1792 ; CHECK-NEXT: br label [[ENTRY_SPLIT:%.*]]
1793 ; CHECK: entry.split:
1794 ; CHECK-NEXT: br label [[OMP_PAR_REGION_SPLIT:%.*]]
1795 ; CHECK: omp.par.region.split:
1796 ; CHECK-NEXT: br label [[OMP_PAR_PRE_FINALIZE:%.*]]
1797 ; CHECK: omp.par.pre_finalize:
1798 ; CHECK-NEXT: br label [[OMP_PAR_OUTLINED_EXIT_EXITSTUB:%.*]]
1799 ; CHECK-LABEL: define {{[^@]+}}@.omp_outlined.
1800 ; CHECK-SAME: (ptr noalias nocapture nofree readnone [[DOTGLOBAL_TID_:%.*]], ptr noalias nocapture nofree readnone [[DOTBOUND_TID_:%.*]], ptr nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[A:%.*]]) {
1801 ; CHECK-NEXT: entry:
1802 ; CHECK-NEXT: [[TMP0:%.*]] = load i32, ptr [[A]], align 4
1803 ; CHECK-NEXT: call void @use(i32 [[TMP0]])
1804 ; CHECK-NEXT: ret void
1805 ; CHECK-LABEL: define {{[^@]+}}@.omp_outlined..1
1806 ; CHECK-SAME: (ptr noalias nocapture nofree readnone [[DOTGLOBAL_TID_:%.*]], ptr noalias nocapture nofree readnone [[DOTBOUND_TID_:%.*]], ptr nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[A:%.*]]) {
1807 ; CHECK-NEXT: entry:
1808 ; CHECK-NEXT: [[TMP0:%.*]] = load i32, ptr [[A]], align 4
1809 ; CHECK-NEXT: call void @use(i32 [[TMP0]])
1810 ; CHECK-NEXT: ret void
1811 ; CHECK-LABEL: define {{[^@]+}}@unmergable_proc_bind
1812 ; CHECK-SAME: (i32 [[A:%.*]]) local_unnamed_addr {
1813 ; CHECK-NEXT: entry:
1814 ; CHECK-NEXT: [[A_ADDR:%.*]] = alloca i32, align 4
1815 ; CHECK-NEXT: [[TMP0:%.*]] = call i32 @__kmpc_global_thread_num(ptr noundef nonnull align 8 dereferenceable(24) @[[GLOB1]])
1816 ; CHECK-NEXT: store i32 [[A]], ptr [[A_ADDR]], align 4
1817 ; CHECK-NEXT: call void @__kmpc_push_proc_bind(ptr noundef nonnull align 8 dereferenceable(24) @[[GLOB1]], i32 [[TMP0]], i32 noundef 3)
1818 ; CHECK-NEXT: call void (ptr, i32, ptr, ...) @__kmpc_fork_call(ptr noundef nonnull align 8 dereferenceable(24) @[[GLOB1]], i32 noundef 1, ptr noundef @.omp_outlined..2, ptr nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[A_ADDR]])
1819 ; CHECK-NEXT: call void (ptr, i32, ptr, ...) @__kmpc_fork_call(ptr noundef nonnull align 8 dereferenceable(24) @[[GLOB1]], i32 noundef 1, ptr noundef @.omp_outlined..3, ptr nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[A_ADDR]])
1820 ; CHECK-NEXT: ret void
1821 ; CHECK-LABEL: define {{[^@]+}}@.omp_outlined..2
1822 ; CHECK-SAME: (ptr noalias nocapture nofree readnone [[DOTGLOBAL_TID_:%.*]], ptr noalias nocapture nofree readnone [[DOTBOUND_TID_:%.*]], ptr nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[A:%.*]]) {
1823 ; CHECK-NEXT: entry:
1824 ; CHECK-NEXT: [[TMP0:%.*]] = load i32, ptr [[A]], align 4
1825 ; CHECK-NEXT: call void @use(i32 [[TMP0]])
1826 ; CHECK-NEXT: ret void
1827 ; CHECK-LABEL: define {{[^@]+}}@.omp_outlined..3
1828 ; CHECK-SAME: (ptr noalias nocapture nofree readnone [[DOTGLOBAL_TID_:%.*]], ptr noalias nocapture nofree readnone [[DOTBOUND_TID_:%.*]], ptr nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[A:%.*]]) {
1829 ; CHECK-NEXT: entry:
1830 ; CHECK-NEXT: [[TMP0:%.*]] = load i32, ptr [[A]], align 4
1831 ; CHECK-NEXT: call void @use(i32 [[TMP0]])
1832 ; CHECK-NEXT: ret void
1833 ; CHECK-LABEL: define {{[^@]+}}@unmergable_num_threads
1834 ; CHECK-SAME: (i32 [[A:%.*]]) local_unnamed_addr {
1835 ; CHECK-NEXT: entry:
1836 ; CHECK-NEXT: [[A_ADDR:%.*]] = alloca i32, align 4
1837 ; CHECK-NEXT: [[TMP0:%.*]] = call i32 @__kmpc_global_thread_num(ptr noundef nonnull align 8 dereferenceable(24) @[[GLOB1]])
1838 ; CHECK-NEXT: store i32 [[A]], ptr [[A_ADDR]], align 4
1839 ; CHECK-NEXT: call void @__kmpc_push_num_threads(ptr noundef nonnull align 8 dereferenceable(24) @[[GLOB1]], i32 [[TMP0]], i32 [[A]])
1840 ; CHECK-NEXT: call void (ptr, i32, ptr, ...) @__kmpc_fork_call(ptr noundef nonnull align 8 dereferenceable(24) @[[GLOB1]], i32 noundef 1, ptr noundef @.omp_outlined..4, ptr nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[A_ADDR]])
1841 ; CHECK-NEXT: call void (ptr, i32, ptr, ...) @__kmpc_fork_call(ptr noundef nonnull align 8 dereferenceable(24) @[[GLOB1]], i32 noundef 1, ptr noundef @.omp_outlined..5, ptr nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[A_ADDR]])
1842 ; CHECK-NEXT: ret void
1843 ; CHECK-LABEL: define {{[^@]+}}@.omp_outlined..4
1844 ; CHECK-SAME: (ptr noalias nocapture nofree readnone [[DOTGLOBAL_TID_:%.*]], ptr noalias nocapture nofree readnone [[DOTBOUND_TID_:%.*]], ptr nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[A:%.*]]) {
1845 ; CHECK-NEXT: entry:
1846 ; CHECK-NEXT: [[TMP0:%.*]] = load i32, ptr [[A]], align 4
1847 ; CHECK-NEXT: call void @use(i32 [[TMP0]])
1848 ; CHECK-NEXT: ret void
1849 ; CHECK-LABEL: define {{[^@]+}}@.omp_outlined..5
1850 ; CHECK-SAME: (ptr noalias nocapture nofree readnone [[DOTGLOBAL_TID_:%.*]], ptr noalias nocapture nofree readnone [[DOTBOUND_TID_:%.*]], ptr nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[A:%.*]]) {
1851 ; CHECK-NEXT: entry:
1852 ; CHECK-NEXT: [[TMP0:%.*]] = load i32, ptr [[A]], align 4
1853 ; CHECK-NEXT: call void @use(i32 [[TMP0]])
1854 ; CHECK-NEXT: ret void
1855 ; CHECK-LABEL: define {{[^@]+}}@unmergable_seq_call
1856 ; CHECK-SAME: (i32 [[A:%.*]]) local_unnamed_addr {
1857 ; CHECK-NEXT: entry:
1858 ; CHECK-NEXT: [[A_ADDR:%.*]] = alloca i32, align 4
1859 ; CHECK-NEXT: store i32 [[A]], ptr [[A_ADDR]], align 4
1860 ; CHECK-NEXT: call void (ptr, i32, ptr, ...) @__kmpc_fork_call(ptr noundef nonnull align 8 dereferenceable(24) @[[GLOB1]], i32 noundef 1, ptr noundef @.omp_outlined..6, ptr nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[A_ADDR]])
1861 ; CHECK-NEXT: call void (...) @foo()
1862 ; CHECK-NEXT: call void (ptr, i32, ptr, ...) @__kmpc_fork_call(ptr noundef nonnull align 8 dereferenceable(24) @[[GLOB1]], i32 noundef 1, ptr noundef @.omp_outlined..7, ptr nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[A_ADDR]])
1863 ; CHECK-NEXT: ret void
1864 ; CHECK-LABEL: define {{[^@]+}}@.omp_outlined..6
1865 ; CHECK-SAME: (ptr noalias nocapture nofree readnone [[DOTGLOBAL_TID_:%.*]], ptr noalias nocapture nofree readnone [[DOTBOUND_TID_:%.*]], ptr nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[A:%.*]]) {
1866 ; CHECK-NEXT: entry:
1867 ; CHECK-NEXT: [[TMP0:%.*]] = load i32, ptr [[A]], align 4
1868 ; CHECK-NEXT: call void @use(i32 [[TMP0]])
1869 ; CHECK-NEXT: ret void
1870 ; CHECK-LABEL: define {{[^@]+}}@.omp_outlined..7
1871 ; CHECK-SAME: (ptr noalias nocapture nofree readnone [[DOTGLOBAL_TID_:%.*]], ptr noalias nocapture nofree readnone [[DOTBOUND_TID_:%.*]], ptr nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[A:%.*]]) {
1872 ; CHECK-NEXT: entry:
1873 ; CHECK-NEXT: [[TMP0:%.*]] = load i32, ptr [[A]], align 4
1874 ; CHECK-NEXT: call void @use(i32 [[TMP0]])
1875 ; CHECK-NEXT: ret void
1876 ; CHECK-LABEL: define {{[^@]+}}@merge_seq
1877 ; CHECK-SAME: (i32 [[A:%.*]]) local_unnamed_addr {
1878 ; CHECK-NEXT: entry:
1879 ; CHECK-NEXT: [[A_ADDR:%.*]] = alloca i32, align 4
1880 ; CHECK-NEXT: store i32 [[A]], ptr [[A_ADDR]], align 4
1881 ; CHECK-NEXT: [[OMP_GLOBAL_THREAD_NUM2:%.*]] = call i32 @__kmpc_global_thread_num(ptr @[[GLOB1]])
1882 ; CHECK-NEXT: br label [[OMP_PARALLEL:%.*]]
1883 ; CHECK: omp_parallel:
1884 ; CHECK-NEXT: call void (ptr, i32, ptr, ...) @__kmpc_fork_call(ptr @[[GLOB1]], i32 1, ptr @merge_seq..omp_par, ptr [[A_ADDR]])
1885 ; CHECK-NEXT: br label [[OMP_PAR_OUTLINED_EXIT:%.*]]
1886 ; CHECK: omp.par.outlined.exit:
1887 ; CHECK-NEXT: br label [[OMP_PAR_EXIT_SPLIT:%.*]]
1888 ; CHECK: omp.par.exit.split:
1889 ; CHECK-NEXT: br label [[ENTRY_SPLIT_SPLIT:%.*]]
1890 ; CHECK: entry.split.split:
1891 ; CHECK-NEXT: [[TMP0:%.*]] = load i32, ptr [[A_ADDR]], align 4
1892 ; CHECK-NEXT: call void @use(i32 [[TMP0]])
1893 ; CHECK-NEXT: ret void
1894 ; CHECK-LABEL: define {{[^@]+}}@merge_seq..omp_par
1895 ; CHECK-SAME: (ptr noalias [[TID_ADDR:%.*]], ptr noalias [[ZERO_ADDR:%.*]], ptr [[A_ADDR:%.*]]) #[[ATTR0]] {
1896 ; CHECK-NEXT: omp.par.entry:
1897 ; CHECK-NEXT: [[TID_ADDR_LOCAL:%.*]] = alloca i32, align 4
1898 ; CHECK-NEXT: [[TMP0:%.*]] = load i32, ptr [[TID_ADDR]], align 4
1899 ; CHECK-NEXT: store i32 [[TMP0]], ptr [[TID_ADDR_LOCAL]], align 4
1900 ; CHECK-NEXT: [[TID:%.*]] = load i32, ptr [[TID_ADDR_LOCAL]], align 4
1901 ; CHECK-NEXT: br label [[OMP_PAR_REGION:%.*]]
1902 ; CHECK: omp.par.outlined.exit.exitStub:
1903 ; CHECK-NEXT: ret void
1904 ; CHECK: omp.par.region:
1905 ; CHECK-NEXT: br label [[OMP_PAR_MERGED:%.*]]
1906 ; CHECK: omp.par.merged:
1907 ; CHECK-NEXT: call void @.omp_outlined..8(ptr [[TID_ADDR]], ptr [[ZERO_ADDR]], ptr nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[A_ADDR]])
1908 ; CHECK-NEXT: [[OMP_GLOBAL_THREAD_NUM2:%.*]] = call i32 @__kmpc_global_thread_num(ptr @[[GLOB1]])
1909 ; CHECK-NEXT: call void @__kmpc_barrier(ptr @[[GLOB2]], i32 [[OMP_GLOBAL_THREAD_NUM2]])
1910 ; CHECK-NEXT: [[OMP_GLOBAL_THREAD_NUM:%.*]] = call i32 @__kmpc_global_thread_num(ptr @[[GLOB1]])
1911 ; CHECK-NEXT: [[TMP1:%.*]] = call i32 @__kmpc_master(ptr @[[GLOB1]], i32 [[OMP_GLOBAL_THREAD_NUM]])
1912 ; CHECK-NEXT: [[TMP2:%.*]] = icmp ne i32 [[TMP1]], 0
1913 ; CHECK-NEXT: br i1 [[TMP2]], label [[OMP_REGION_BODY:%.*]], label [[OMP_REGION_END:%.*]]
1914 ; CHECK: omp_region.end:
1915 ; CHECK-NEXT: [[OMP_GLOBAL_THREAD_NUM1:%.*]] = call i32 @__kmpc_global_thread_num(ptr @[[GLOB1]])
1916 ; CHECK-NEXT: call void @__kmpc_barrier(ptr @[[GLOB2]], i32 [[OMP_GLOBAL_THREAD_NUM1]])
1917 ; CHECK-NEXT: br label [[OMP_PAR_MERGED_SPLIT_SPLIT:%.*]]
1918 ; CHECK: omp.par.merged.split.split:
1919 ; CHECK-NEXT: call void @.omp_outlined..9(ptr [[TID_ADDR]], ptr [[ZERO_ADDR]], ptr nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[A_ADDR]])
1920 ; CHECK-NEXT: br label [[ENTRY_SPLIT:%.*]]
1921 ; CHECK: entry.split:
1922 ; CHECK-NEXT: br label [[OMP_PAR_REGION_SPLIT:%.*]]
1923 ; CHECK: omp.par.region.split:
1924 ; CHECK-NEXT: br label [[OMP_PAR_PRE_FINALIZE:%.*]]
1925 ; CHECK: omp.par.pre_finalize:
1926 ; CHECK-NEXT: br label [[OMP_PAR_OUTLINED_EXIT_EXITSTUB:%.*]]
1927 ; CHECK: omp_region.body:
1928 ; CHECK-NEXT: br label [[SEQ_PAR_MERGED:%.*]]
1929 ; CHECK: seq.par.merged:
1930 ; CHECK-NEXT: [[TMP3:%.*]] = load i32, ptr [[A_ADDR]], align 4
1931 ; CHECK-NEXT: [[ADD:%.*]] = add nsw i32 [[TMP3]], 1
1932 ; CHECK-NEXT: store i32 [[ADD]], ptr [[A_ADDR]], align 4
1933 ; CHECK-NEXT: br label [[OMP_PAR_MERGED_SPLIT:%.*]]
1934 ; CHECK: omp.par.merged.split:
1935 ; CHECK-NEXT: br label [[OMP_REGION_BODY_SPLIT:%.*]]
1936 ; CHECK: omp_region.body.split:
1937 ; CHECK-NEXT: call void @__kmpc_end_master(ptr @[[GLOB1]], i32 [[OMP_GLOBAL_THREAD_NUM]])
1938 ; CHECK-NEXT: br label [[OMP_REGION_END]]
1939 ; CHECK-LABEL: define {{[^@]+}}@.omp_outlined..8
1940 ; CHECK-SAME: (ptr noalias nocapture nofree readnone [[DOTGLOBAL_TID_:%.*]], ptr noalias nocapture nofree readnone [[DOTBOUND_TID_:%.*]], ptr nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[A:%.*]]) {
1941 ; CHECK-NEXT: entry:
1942 ; CHECK-NEXT: [[TMP0:%.*]] = load i32, ptr [[A]], align 4
1943 ; CHECK-NEXT: call void @use(i32 [[TMP0]])
1944 ; CHECK-NEXT: ret void
1945 ; CHECK-LABEL: define {{[^@]+}}@.omp_outlined..9
1946 ; CHECK-SAME: (ptr noalias nocapture nofree readnone [[DOTGLOBAL_TID_:%.*]], ptr noalias nocapture nofree readnone [[DOTBOUND_TID_:%.*]], ptr nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[A:%.*]]) {
1947 ; CHECK-NEXT: entry:
1948 ; CHECK-NEXT: [[TMP0:%.*]] = load i32, ptr [[A]], align 4
1949 ; CHECK-NEXT: call void @use(i32 [[TMP0]])
1950 ; CHECK-NEXT: ret void
1951 ; CHECK-LABEL: define {{[^@]+}}@merge_seq_float
1952 ; CHECK-SAME: (float [[F:%.*]], ptr nocapture nofree writeonly [[P:%.*]]) local_unnamed_addr {
1953 ; CHECK-NEXT: entry:
1954 ; CHECK-NEXT: [[F_ADDR:%.*]] = alloca float, align 4
1955 ; CHECK-NEXT: store float [[F]], ptr [[F_ADDR]], align 4
1956 ; CHECK-NEXT: [[OMP_GLOBAL_THREAD_NUM2:%.*]] = call i32 @__kmpc_global_thread_num(ptr @[[GLOB1]])
1957 ; CHECK-NEXT: br label [[OMP_PARALLEL:%.*]]
1958 ; CHECK: omp_parallel:
1959 ; CHECK-NEXT: call void (ptr, i32, ptr, ...) @__kmpc_fork_call(ptr @[[GLOB1]], i32 2, ptr @merge_seq_float..omp_par, ptr [[F_ADDR]], ptr [[P]])
1960 ; CHECK-NEXT: br label [[OMP_PAR_OUTLINED_EXIT:%.*]]
1961 ; CHECK: omp.par.outlined.exit:
1962 ; CHECK-NEXT: br label [[OMP_PAR_EXIT_SPLIT:%.*]]
1963 ; CHECK: omp.par.exit.split:
1964 ; CHECK-NEXT: br label [[ENTRY_SPLIT_SPLIT:%.*]]
1965 ; CHECK: entry.split.split:
1966 ; CHECK-NEXT: ret void
1967 ; CHECK-LABEL: define {{[^@]+}}@merge_seq_float..omp_par
1968 ; CHECK-SAME: (ptr noalias [[TID_ADDR:%.*]], ptr noalias [[ZERO_ADDR:%.*]], ptr [[F_ADDR:%.*]], ptr [[P:%.*]]) #[[ATTR0]] {
1969 ; CHECK-NEXT: omp.par.entry:
1970 ; CHECK-NEXT: [[TID_ADDR_LOCAL:%.*]] = alloca i32, align 4
1971 ; CHECK-NEXT: [[TMP0:%.*]] = load i32, ptr [[TID_ADDR]], align 4
1972 ; CHECK-NEXT: store i32 [[TMP0]], ptr [[TID_ADDR_LOCAL]], align 4
1973 ; CHECK-NEXT: [[TID:%.*]] = load i32, ptr [[TID_ADDR_LOCAL]], align 4
1974 ; CHECK-NEXT: br label [[OMP_PAR_REGION:%.*]]
1975 ; CHECK: omp.par.outlined.exit.exitStub:
1976 ; CHECK-NEXT: ret void
1977 ; CHECK: omp.par.region:
1978 ; CHECK-NEXT: br label [[OMP_PAR_MERGED:%.*]]
1979 ; CHECK: omp.par.merged:
1980 ; CHECK-NEXT: call void @.omp_outlined..10(ptr [[TID_ADDR]], ptr [[ZERO_ADDR]], ptr nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[F_ADDR]])
1981 ; CHECK-NEXT: [[OMP_GLOBAL_THREAD_NUM2:%.*]] = call i32 @__kmpc_global_thread_num(ptr @[[GLOB1]])
1982 ; CHECK-NEXT: call void @__kmpc_barrier(ptr @[[GLOB2]], i32 [[OMP_GLOBAL_THREAD_NUM2]])
1983 ; CHECK-NEXT: [[OMP_GLOBAL_THREAD_NUM:%.*]] = call i32 @__kmpc_global_thread_num(ptr @[[GLOB1]])
1984 ; CHECK-NEXT: [[TMP1:%.*]] = call i32 @__kmpc_master(ptr @[[GLOB1]], i32 [[OMP_GLOBAL_THREAD_NUM]])
1985 ; CHECK-NEXT: [[TMP2:%.*]] = icmp ne i32 [[TMP1]], 0
1986 ; CHECK-NEXT: br i1 [[TMP2]], label [[OMP_REGION_BODY:%.*]], label [[OMP_REGION_END:%.*]]
1987 ; CHECK: omp_region.end:
1988 ; CHECK-NEXT: [[OMP_GLOBAL_THREAD_NUM1:%.*]] = call i32 @__kmpc_global_thread_num(ptr @[[GLOB1]])
1989 ; CHECK-NEXT: call void @__kmpc_barrier(ptr @[[GLOB2]], i32 [[OMP_GLOBAL_THREAD_NUM1]])
1990 ; CHECK-NEXT: br label [[OMP_PAR_MERGED_SPLIT_SPLIT:%.*]]
1991 ; CHECK: omp.par.merged.split.split:
1992 ; CHECK-NEXT: call void @.omp_outlined..11(ptr [[TID_ADDR]], ptr [[ZERO_ADDR]], ptr nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[F_ADDR]])
1993 ; CHECK-NEXT: br label [[ENTRY_SPLIT:%.*]]
1994 ; CHECK: entry.split:
1995 ; CHECK-NEXT: br label [[OMP_PAR_REGION_SPLIT:%.*]]
1996 ; CHECK: omp.par.region.split:
1997 ; CHECK-NEXT: br label [[OMP_PAR_PRE_FINALIZE:%.*]]
1998 ; CHECK: omp.par.pre_finalize:
1999 ; CHECK-NEXT: br label [[OMP_PAR_OUTLINED_EXIT_EXITSTUB:%.*]]
2000 ; CHECK: omp_region.body:
2001 ; CHECK-NEXT: br label [[SEQ_PAR_MERGED:%.*]]
2002 ; CHECK: seq.par.merged:
2003 ; CHECK-NEXT: [[TMP3:%.*]] = load float, ptr [[F_ADDR]], align 4
2004 ; CHECK-NEXT: [[ADD:%.*]] = fadd float [[TMP3]], 0x40091EB860000000
2005 ; CHECK-NEXT: store float [[ADD]], ptr [[P]], align 4
2006 ; CHECK-NEXT: br label [[OMP_PAR_MERGED_SPLIT:%.*]]
2007 ; CHECK: omp.par.merged.split:
2008 ; CHECK-NEXT: br label [[OMP_REGION_BODY_SPLIT:%.*]]
2009 ; CHECK: omp_region.body.split:
2010 ; CHECK-NEXT: call void @__kmpc_end_master(ptr @[[GLOB1]], i32 [[OMP_GLOBAL_THREAD_NUM]])
2011 ; CHECK-NEXT: br label [[OMP_REGION_END]]
2012 ; CHECK-LABEL: define {{[^@]+}}@.omp_outlined..10
2013 ; CHECK-SAME: (ptr noalias nocapture nofree readnone [[DOTGLOBAL_TID_:%.*]], ptr noalias nocapture nofree readnone [[DOTBOUND_TID_:%.*]], ptr nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[F:%.*]]) {
2014 ; CHECK-NEXT: entry:
2015 ; CHECK-NEXT: [[TMP0:%.*]] = load float, ptr [[F]], align 4
2016 ; CHECK-NEXT: [[CONV:%.*]] = fptosi float [[TMP0]] to i32
2017 ; CHECK-NEXT: call void @use(i32 [[CONV]])
2018 ; CHECK-NEXT: ret void
2019 ; CHECK-LABEL: define {{[^@]+}}@.omp_outlined..11
2020 ; CHECK-SAME: (ptr noalias nocapture nofree readnone [[DOTGLOBAL_TID_:%.*]], ptr noalias nocapture nofree readnone [[DOTBOUND_TID_:%.*]], ptr nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[F:%.*]]) {
2021 ; CHECK-NEXT: entry:
2022 ; CHECK-NEXT: [[TMP0:%.*]] = load float, ptr [[F]], align 4
2023 ; CHECK-NEXT: [[CONV:%.*]] = fptosi float [[TMP0]] to i32
2024 ; CHECK-NEXT: call void @use(i32 [[CONV]])
2025 ; CHECK-NEXT: ret void
2026 ; CHECK-LABEL: define {{[^@]+}}@merge_seq_firstprivate
2027 ; CHECK-SAME: (i32 [[A:%.*]]) local_unnamed_addr {
2028 ; CHECK-NEXT: entry:
2029 ; CHECK-NEXT: [[A_CASTED_SROA_0_0_INSERT_EXT_SEQ_OUTPUT_ALLOC:%.*]] = alloca i64, align 8
2030 ; CHECK-NEXT: [[A_ADDR:%.*]] = alloca i32, align 4
2031 ; CHECK-NEXT: store i32 [[A]], ptr [[A_ADDR]], align 4
2032 ; CHECK-NEXT: [[OMP_GLOBAL_THREAD_NUM2:%.*]] = call i32 @__kmpc_global_thread_num(ptr @[[GLOB1]])
2033 ; CHECK-NEXT: br label [[OMP_PARALLEL:%.*]]
2034 ; CHECK: omp_parallel:
2035 ; CHECK-NEXT: call void (ptr, i32, ptr, ...) @__kmpc_fork_call(ptr @[[GLOB1]], i32 2, ptr @merge_seq_firstprivate..omp_par, ptr [[A_ADDR]], ptr [[A_CASTED_SROA_0_0_INSERT_EXT_SEQ_OUTPUT_ALLOC]])
2036 ; CHECK-NEXT: br label [[OMP_PAR_OUTLINED_EXIT:%.*]]
2037 ; CHECK: omp.par.outlined.exit:
2038 ; CHECK-NEXT: br label [[OMP_PAR_EXIT_SPLIT:%.*]]
2039 ; CHECK: omp.par.exit.split:
2040 ; CHECK-NEXT: br label [[ENTRY_SPLIT_SPLIT:%.*]]
2041 ; CHECK: entry.split.split:
2042 ; CHECK-NEXT: [[TMP0:%.*]] = load i32, ptr [[A_ADDR]], align 4
2043 ; CHECK-NEXT: call void @use(i32 [[TMP0]])
2044 ; CHECK-NEXT: ret void
2045 ; CHECK-LABEL: define {{[^@]+}}@merge_seq_firstprivate..omp_par
2046 ; CHECK-SAME: (ptr noalias [[TID_ADDR:%.*]], ptr noalias [[ZERO_ADDR:%.*]], ptr [[A_ADDR:%.*]], ptr [[A_CASTED_SROA_0_0_INSERT_EXT_SEQ_OUTPUT_ALLOC:%.*]]) #[[ATTR0]] {
2047 ; CHECK-NEXT: omp.par.entry:
2048 ; CHECK-NEXT: [[TID_ADDR_LOCAL:%.*]] = alloca i32, align 4
2049 ; CHECK-NEXT: [[TMP0:%.*]] = load i32, ptr [[TID_ADDR]], align 4
2050 ; CHECK-NEXT: store i32 [[TMP0]], ptr [[TID_ADDR_LOCAL]], align 4
2051 ; CHECK-NEXT: [[TID:%.*]] = load i32, ptr [[TID_ADDR_LOCAL]], align 4
2052 ; CHECK-NEXT: br label [[OMP_PAR_REGION:%.*]]
2053 ; CHECK: omp.par.outlined.exit.exitStub:
2054 ; CHECK-NEXT: ret void
2055 ; CHECK: omp.par.region:
2056 ; CHECK-NEXT: br label [[OMP_PAR_MERGED:%.*]]
2057 ; CHECK: omp.par.merged:
2058 ; CHECK-NEXT: call void @.omp_outlined..12(ptr [[TID_ADDR]], ptr [[ZERO_ADDR]], ptr nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[A_ADDR]])
2059 ; CHECK-NEXT: [[OMP_GLOBAL_THREAD_NUM2:%.*]] = call i32 @__kmpc_global_thread_num(ptr @[[GLOB1]])
2060 ; CHECK-NEXT: call void @__kmpc_barrier(ptr @[[GLOB2]], i32 [[OMP_GLOBAL_THREAD_NUM2]])
2061 ; CHECK-NEXT: [[OMP_GLOBAL_THREAD_NUM:%.*]] = call i32 @__kmpc_global_thread_num(ptr @[[GLOB1]])
2062 ; CHECK-NEXT: [[TMP1:%.*]] = call i32 @__kmpc_master(ptr @[[GLOB1]], i32 [[OMP_GLOBAL_THREAD_NUM]])
2063 ; CHECK-NEXT: [[TMP2:%.*]] = icmp ne i32 [[TMP1]], 0
2064 ; CHECK-NEXT: br i1 [[TMP2]], label [[OMP_REGION_BODY:%.*]], label [[OMP_REGION_END:%.*]]
2065 ; CHECK: omp_region.end:
2066 ; CHECK-NEXT: [[OMP_GLOBAL_THREAD_NUM1:%.*]] = call i32 @__kmpc_global_thread_num(ptr @[[GLOB1]])
2067 ; CHECK-NEXT: call void @__kmpc_barrier(ptr @[[GLOB2]], i32 [[OMP_GLOBAL_THREAD_NUM1]])
2068 ; CHECK-NEXT: br label [[OMP_PAR_MERGED_SPLIT_SPLIT:%.*]]
2069 ; CHECK: omp.par.merged.split.split:
2070 ; CHECK-NEXT: [[A_CASTED_SROA_0_0_INSERT_EXT_SEQ_OUTPUT_LOAD:%.*]] = load i64, ptr [[A_CASTED_SROA_0_0_INSERT_EXT_SEQ_OUTPUT_ALLOC]], align 8
2071 ; CHECK-NEXT: call void @.omp_outlined..13(ptr [[TID_ADDR]], ptr [[ZERO_ADDR]], i64 [[A_CASTED_SROA_0_0_INSERT_EXT_SEQ_OUTPUT_LOAD]])
2072 ; CHECK-NEXT: br label [[ENTRY_SPLIT:%.*]]
2073 ; CHECK: entry.split:
2074 ; CHECK-NEXT: br label [[OMP_PAR_REGION_SPLIT:%.*]]
2075 ; CHECK: omp.par.region.split:
2076 ; CHECK-NEXT: br label [[OMP_PAR_PRE_FINALIZE:%.*]]
2077 ; CHECK: omp.par.pre_finalize:
2078 ; CHECK-NEXT: br label [[OMP_PAR_OUTLINED_EXIT_EXITSTUB:%.*]]
2079 ; CHECK: omp_region.body:
2080 ; CHECK-NEXT: br label [[SEQ_PAR_MERGED:%.*]]
2081 ; CHECK: seq.par.merged:
2082 ; CHECK-NEXT: [[TMP3:%.*]] = load i32, ptr [[A_ADDR]], align 4
2083 ; CHECK-NEXT: [[ADD:%.*]] = add nsw i32 [[TMP3]], 1
2084 ; CHECK-NEXT: store i32 [[ADD]], ptr [[A_ADDR]], align 4
2085 ; CHECK-NEXT: [[A_CASTED_SROA_0_0_INSERT_EXT:%.*]] = zext i32 [[ADD]] to i64
2086 ; CHECK-NEXT: store i64 [[A_CASTED_SROA_0_0_INSERT_EXT]], ptr [[A_CASTED_SROA_0_0_INSERT_EXT_SEQ_OUTPUT_ALLOC]], align 8
2087 ; CHECK-NEXT: br label [[OMP_PAR_MERGED_SPLIT:%.*]]
2088 ; CHECK: omp.par.merged.split:
2089 ; CHECK-NEXT: br label [[OMP_REGION_BODY_SPLIT:%.*]]
2090 ; CHECK: omp_region.body.split:
2091 ; CHECK-NEXT: call void @__kmpc_end_master(ptr @[[GLOB1]], i32 [[OMP_GLOBAL_THREAD_NUM]])
2092 ; CHECK-NEXT: br label [[OMP_REGION_END]]
2093 ; CHECK-LABEL: define {{[^@]+}}@.omp_outlined..12
2094 ; CHECK-SAME: (ptr noalias nocapture nofree readnone [[DOTGLOBAL_TID_:%.*]], ptr noalias nocapture nofree readnone [[DOTBOUND_TID_:%.*]], ptr nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[A:%.*]]) {
2095 ; CHECK-NEXT: entry:
2096 ; CHECK-NEXT: [[TMP0:%.*]] = load i32, ptr [[A]], align 4
2097 ; CHECK-NEXT: call void @use(i32 [[TMP0]])
2098 ; CHECK-NEXT: ret void
2099 ; CHECK-LABEL: define {{[^@]+}}@.omp_outlined..13
2100 ; CHECK-SAME: (ptr noalias nocapture nofree readnone [[DOTGLOBAL_TID_:%.*]], ptr noalias nocapture nofree readnone [[DOTBOUND_TID_:%.*]], i64 [[A:%.*]]) {
2101 ; CHECK-NEXT: entry:
2102 ; CHECK-NEXT: [[A_ADDR_SROA_0_0_EXTRACT_TRUNC:%.*]] = trunc i64 [[A]] to i32
2103 ; CHECK-NEXT: call void @use(i32 [[A_ADDR_SROA_0_0_EXTRACT_TRUNC]])
2104 ; CHECK-NEXT: ret void
2105 ; CHECK-LABEL: define {{[^@]+}}@merge_seq_sink_lt
2106 ; CHECK-SAME: (i32 [[A:%.*]]) local_unnamed_addr {
2107 ; CHECK-NEXT: entry:
2108 ; CHECK-NEXT: [[A_ADDR:%.*]] = alloca i32, align 4
2109 ; CHECK-NEXT: store i32 [[A]], ptr [[A_ADDR]], align 4
2110 ; CHECK-NEXT: [[OMP_GLOBAL_THREAD_NUM2:%.*]] = call i32 @__kmpc_global_thread_num(ptr @[[GLOB1]])
2111 ; CHECK-NEXT: br label [[OMP_PARALLEL:%.*]]
2112 ; CHECK: omp_parallel:
2113 ; CHECK-NEXT: call void (ptr, i32, ptr, ...) @__kmpc_fork_call(ptr @[[GLOB1]], i32 1, ptr @merge_seq_sink_lt..omp_par, ptr [[A_ADDR]])
2114 ; CHECK-NEXT: br label [[OMP_PAR_OUTLINED_EXIT:%.*]]
2115 ; CHECK: omp.par.outlined.exit:
2116 ; CHECK-NEXT: br label [[OMP_PAR_EXIT_SPLIT:%.*]]
2117 ; CHECK: omp.par.exit.split:
2118 ; CHECK-NEXT: br label [[ENTRY_SPLIT_SPLIT:%.*]]
2119 ; CHECK: entry.split.split:
2120 ; CHECK-NEXT: ret void
2121 ; CHECK-LABEL: define {{[^@]+}}@merge_seq_sink_lt..omp_par
2122 ; CHECK-SAME: (ptr noalias [[TID_ADDR:%.*]], ptr noalias [[ZERO_ADDR:%.*]], ptr [[A_ADDR:%.*]]) #[[ATTR0]] {
2123 ; CHECK-NEXT: omp.par.entry:
2124 ; CHECK-NEXT: [[B:%.*]] = alloca i32, align 4
2125 ; CHECK-NEXT: [[TID_ADDR_LOCAL:%.*]] = alloca i32, align 4
2126 ; CHECK-NEXT: [[TMP0:%.*]] = load i32, ptr [[TID_ADDR]], align 4
2127 ; CHECK-NEXT: store i32 [[TMP0]], ptr [[TID_ADDR_LOCAL]], align 4
2128 ; CHECK-NEXT: [[TID:%.*]] = load i32, ptr [[TID_ADDR_LOCAL]], align 4
2129 ; CHECK-NEXT: br label [[OMP_PAR_REGION:%.*]]
2130 ; CHECK: omp.par.outlined.exit.exitStub:
2131 ; CHECK-NEXT: ret void
2132 ; CHECK: omp.par.region:
2133 ; CHECK-NEXT: br label [[OMP_PAR_MERGED:%.*]]
2134 ; CHECK: omp.par.merged:
2135 ; CHECK-NEXT: call void @.omp_outlined..14(ptr [[TID_ADDR]], ptr [[ZERO_ADDR]], ptr nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[A_ADDR]])
2136 ; CHECK-NEXT: [[OMP_GLOBAL_THREAD_NUM2:%.*]] = call i32 @__kmpc_global_thread_num(ptr @[[GLOB1]])
2137 ; CHECK-NEXT: call void @__kmpc_barrier(ptr @[[GLOB2]], i32 [[OMP_GLOBAL_THREAD_NUM2]])
2138 ; CHECK-NEXT: [[OMP_GLOBAL_THREAD_NUM:%.*]] = call i32 @__kmpc_global_thread_num(ptr @[[GLOB1]])
2139 ; CHECK-NEXT: [[TMP1:%.*]] = call i32 @__kmpc_master(ptr @[[GLOB1]], i32 [[OMP_GLOBAL_THREAD_NUM]])
2140 ; CHECK-NEXT: [[TMP2:%.*]] = icmp ne i32 [[TMP1]], 0
2141 ; CHECK-NEXT: br i1 [[TMP2]], label [[OMP_REGION_BODY:%.*]], label [[OMP_REGION_END:%.*]]
2142 ; CHECK: omp_region.end:
2143 ; CHECK-NEXT: [[OMP_GLOBAL_THREAD_NUM1:%.*]] = call i32 @__kmpc_global_thread_num(ptr @[[GLOB1]])
2144 ; CHECK-NEXT: call void @__kmpc_barrier(ptr @[[GLOB2]], i32 [[OMP_GLOBAL_THREAD_NUM1]])
2145 ; CHECK-NEXT: br label [[OMP_PAR_MERGED_SPLIT_SPLIT:%.*]]
2146 ; CHECK: omp.par.merged.split.split:
2147 ; CHECK-NEXT: call void @.omp_outlined..15(ptr [[TID_ADDR]], ptr [[ZERO_ADDR]], ptr nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[A_ADDR]])
2148 ; CHECK-NEXT: br label [[ENTRY_SPLIT:%.*]]
2149 ; CHECK: entry.split:
2150 ; CHECK-NEXT: br label [[OMP_PAR_REGION_SPLIT:%.*]]
2151 ; CHECK: omp.par.region.split:
2152 ; CHECK-NEXT: br label [[OMP_PAR_PRE_FINALIZE:%.*]]
2153 ; CHECK: omp.par.pre_finalize:
2154 ; CHECK-NEXT: br label [[OMP_PAR_OUTLINED_EXIT_EXITSTUB:%.*]]
2155 ; CHECK: omp_region.body:
2156 ; CHECK-NEXT: br label [[SEQ_PAR_MERGED:%.*]]
2157 ; CHECK: seq.par.merged:
2158 ; CHECK-NEXT: call void @llvm.lifetime.start.p0(i64 noundef 4, ptr noundef nonnull [[B]])
2159 ; CHECK-NEXT: [[TMP4:%.*]] = ptrtoint ptr [[B]] to i64
2160 ; CHECK-NEXT: [[TMP5:%.*]] = trunc i64 [[TMP4]] to i32
2161 ; CHECK-NEXT: store i32 [[TMP5]], ptr [[B]], align 4
2162 ; CHECK-NEXT: call void @llvm.lifetime.end.p0(i64 noundef 4, ptr noundef nonnull [[B]])
2163 ; CHECK-NEXT: br label [[OMP_PAR_MERGED_SPLIT:%.*]]
2164 ; CHECK: omp.par.merged.split:
2165 ; CHECK-NEXT: br label [[OMP_REGION_BODY_SPLIT:%.*]]
2166 ; CHECK: omp_region.body.split:
2167 ; CHECK-NEXT: call void @__kmpc_end_master(ptr @[[GLOB1]], i32 [[OMP_GLOBAL_THREAD_NUM]])
2168 ; CHECK-NEXT: br label [[OMP_REGION_END]]
2169 ; CHECK-LABEL: define {{[^@]+}}@.omp_outlined..14
2170 ; CHECK-SAME: (ptr noalias nocapture nofree readnone [[DOTGLOBAL_TID_:%.*]], ptr noalias nocapture nofree readnone [[DOTBOUND_TID_:%.*]], ptr nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[A:%.*]]) {
2171 ; CHECK-NEXT: entry:
2172 ; CHECK-NEXT: [[TMP0:%.*]] = load i32, ptr [[A]], align 4
2173 ; CHECK-NEXT: call void @use(i32 [[TMP0]])
2174 ; CHECK-NEXT: ret void
2175 ; CHECK-LABEL: define {{[^@]+}}@.omp_outlined..15
2176 ; CHECK-SAME: (ptr noalias nocapture nofree readnone [[DOTGLOBAL_TID_:%.*]], ptr noalias nocapture nofree readnone [[DOTBOUND_TID_:%.*]], ptr nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[A:%.*]]) {
2177 ; CHECK-NEXT: entry:
2178 ; CHECK-NEXT: [[TMP0:%.*]] = load i32, ptr [[A]], align 4
2179 ; CHECK-NEXT: call void @use(i32 [[TMP0]])
2180 ; CHECK-NEXT: ret void
2181 ; CHECK-LABEL: define {{[^@]+}}@merge_seq_par_use
2182 ; CHECK-SAME: (i32 [[A:%.*]]) local_unnamed_addr {
2183 ; CHECK-NEXT: entry:
2184 ; CHECK-NEXT: [[A_ADDR:%.*]] = alloca i32, align 4
2185 ; CHECK-NEXT: [[B:%.*]] = alloca i32, align 4
2186 ; CHECK-NEXT: store i32 [[A]], ptr [[A_ADDR]], align 4
2187 ; CHECK-NEXT: [[OMP_GLOBAL_THREAD_NUM2:%.*]] = call i32 @__kmpc_global_thread_num(ptr @[[GLOB1]])
2188 ; CHECK-NEXT: br label [[OMP_PARALLEL:%.*]]
2189 ; CHECK: omp_parallel:
2190 ; CHECK-NEXT: call void @llvm.lifetime.start.p0(i64 -1, ptr [[B]])
2191 ; CHECK-NEXT: call void (ptr, i32, ptr, ...) @__kmpc_fork_call(ptr @[[GLOB1]], i32 2, ptr @merge_seq_par_use..omp_par, ptr [[A_ADDR]], ptr [[B]])
2192 ; CHECK-NEXT: br label [[OMP_PAR_OUTLINED_EXIT:%.*]]
2193 ; CHECK: omp.par.outlined.exit:
2194 ; CHECK-NEXT: br label [[OMP_PAR_EXIT_SPLIT:%.*]]
2195 ; CHECK: omp.par.exit.split:
2196 ; CHECK-NEXT: br label [[ENTRY_SPLIT_SPLIT:%.*]]
2197 ; CHECK: entry.split.split:
2198 ; CHECK-NEXT: call void @llvm.lifetime.end.p0(i64 noundef 4, ptr noundef nonnull [[B]])
2199 ; CHECK-NEXT: ret void
2200 ; CHECK-LABEL: define {{[^@]+}}@merge_seq_par_use..omp_par
2201 ; CHECK-SAME: (ptr noalias [[TID_ADDR:%.*]], ptr noalias [[ZERO_ADDR:%.*]], ptr [[A_ADDR:%.*]], ptr [[B:%.*]]) #[[ATTR0]] {
2202 ; CHECK-NEXT: omp.par.entry:
2203 ; CHECK-NEXT: [[TID_ADDR_LOCAL:%.*]] = alloca i32, align 4
2204 ; CHECK-NEXT: [[TMP0:%.*]] = load i32, ptr [[TID_ADDR]], align 4
2205 ; CHECK-NEXT: store i32 [[TMP0]], ptr [[TID_ADDR_LOCAL]], align 4
2206 ; CHECK-NEXT: [[TID:%.*]] = load i32, ptr [[TID_ADDR_LOCAL]], align 4
2207 ; CHECK-NEXT: br label [[OMP_PAR_REGION:%.*]]
2208 ; CHECK: omp.par.outlined.exit.exitStub:
2209 ; CHECK-NEXT: ret void
2210 ; CHECK: omp.par.region:
2211 ; CHECK-NEXT: br label [[OMP_PAR_MERGED:%.*]]
2212 ; CHECK: omp.par.merged:
2213 ; CHECK-NEXT: call void @.omp_outlined..16(ptr [[TID_ADDR]], ptr [[ZERO_ADDR]], ptr nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[A_ADDR]])
2214 ; CHECK-NEXT: [[OMP_GLOBAL_THREAD_NUM2:%.*]] = call i32 @__kmpc_global_thread_num(ptr @[[GLOB1]])
2215 ; CHECK-NEXT: call void @__kmpc_barrier(ptr @[[GLOB2]], i32 [[OMP_GLOBAL_THREAD_NUM2]])
2216 ; CHECK-NEXT: [[OMP_GLOBAL_THREAD_NUM:%.*]] = call i32 @__kmpc_global_thread_num(ptr @[[GLOB1]])
2217 ; CHECK-NEXT: [[TMP1:%.*]] = call i32 @__kmpc_master(ptr @[[GLOB1]], i32 [[OMP_GLOBAL_THREAD_NUM]])
2218 ; CHECK-NEXT: [[TMP2:%.*]] = icmp ne i32 [[TMP1]], 0
2219 ; CHECK-NEXT: br i1 [[TMP2]], label [[OMP_REGION_BODY:%.*]], label [[OMP_REGION_END:%.*]]
2220 ; CHECK: omp_region.end:
2221 ; CHECK-NEXT: [[OMP_GLOBAL_THREAD_NUM1:%.*]] = call i32 @__kmpc_global_thread_num(ptr @[[GLOB1]])
2222 ; CHECK-NEXT: call void @__kmpc_barrier(ptr @[[GLOB2]], i32 [[OMP_GLOBAL_THREAD_NUM1]])
2223 ; CHECK-NEXT: br label [[OMP_PAR_MERGED_SPLIT_SPLIT:%.*]]
2224 ; CHECK: omp.par.merged.split.split:
2225 ; CHECK-NEXT: call void @.omp_outlined..17(ptr [[TID_ADDR]], ptr [[ZERO_ADDR]], ptr nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[A_ADDR]], ptr nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[B]])
2226 ; CHECK-NEXT: br label [[ENTRY_SPLIT:%.*]]
2227 ; CHECK: entry.split:
2228 ; CHECK-NEXT: br label [[OMP_PAR_REGION_SPLIT:%.*]]
2229 ; CHECK: omp.par.region.split:
2230 ; CHECK-NEXT: br label [[OMP_PAR_PRE_FINALIZE:%.*]]
2231 ; CHECK: omp.par.pre_finalize:
2232 ; CHECK-NEXT: br label [[OMP_PAR_OUTLINED_EXIT_EXITSTUB:%.*]]
2233 ; CHECK: omp_region.body:
2234 ; CHECK-NEXT: br label [[SEQ_PAR_MERGED:%.*]]
2235 ; CHECK: seq.par.merged:
2236 ; CHECK-NEXT: [[TMP4:%.*]] = load i32, ptr [[A_ADDR]], align 4
2237 ; CHECK-NEXT: [[ADD:%.*]] = add nsw i32 [[TMP4]], 1
2238 ; CHECK-NEXT: store i32 [[ADD]], ptr [[B]], align 4
2239 ; CHECK-NEXT: br label [[OMP_PAR_MERGED_SPLIT:%.*]]
2240 ; CHECK: omp.par.merged.split:
2241 ; CHECK-NEXT: br label [[OMP_REGION_BODY_SPLIT:%.*]]
2242 ; CHECK: omp_region.body.split:
2243 ; CHECK-NEXT: call void @__kmpc_end_master(ptr @[[GLOB1]], i32 [[OMP_GLOBAL_THREAD_NUM]])
2244 ; CHECK-NEXT: br label [[OMP_REGION_END]]
2245 ; CHECK-LABEL: define {{[^@]+}}@.omp_outlined..16
2246 ; CHECK-SAME: (ptr noalias nocapture nofree readnone [[DOTGLOBAL_TID_:%.*]], ptr noalias nocapture nofree readnone [[DOTBOUND_TID_:%.*]], ptr nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[A:%.*]]) {
2247 ; CHECK-NEXT: entry:
2248 ; CHECK-NEXT: [[TMP0:%.*]] = load i32, ptr [[A]], align 4
2249 ; CHECK-NEXT: call void @use(i32 [[TMP0]])
2250 ; CHECK-NEXT: ret void
2251 ; CHECK-LABEL: define {{[^@]+}}@.omp_outlined..17
2252 ; CHECK-SAME: (ptr noalias nocapture nofree readnone [[DOTGLOBAL_TID_:%.*]], ptr noalias nocapture nofree readnone [[DOTBOUND_TID_:%.*]], ptr nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[A:%.*]], ptr nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[B:%.*]]) {
2253 ; CHECK-NEXT: entry:
2254 ; CHECK-NEXT: [[TMP0:%.*]] = load i32, ptr [[A]], align 4
2255 ; CHECK-NEXT: call void @use(i32 [[TMP0]])
2256 ; CHECK-NEXT: [[TMP1:%.*]] = load i32, ptr [[B]], align 4
2257 ; CHECK-NEXT: call void @use(i32 [[TMP1]])
2258 ; CHECK-NEXT: ret void
2259 ; CHECK-LABEL: define {{[^@]+}}@merge_cancellable_regions
2260 ; CHECK-SAME: (i32 [[CANCEL1:%.*]], i32 [[CANCEL2:%.*]]) local_unnamed_addr {
2261 ; CHECK-NEXT: entry:
2262 ; CHECK-NEXT: [[CANCEL1_ADDR:%.*]] = alloca i32, align 4
2263 ; CHECK-NEXT: [[CANCEL2_ADDR:%.*]] = alloca i32, align 4
2264 ; CHECK-NEXT: store i32 [[CANCEL1]], ptr [[CANCEL1_ADDR]], align 4
2265 ; CHECK-NEXT: store i32 [[CANCEL2]], ptr [[CANCEL2_ADDR]], align 4
2266 ; CHECK-NEXT: [[OMP_GLOBAL_THREAD_NUM:%.*]] = call i32 @__kmpc_global_thread_num(ptr @[[GLOB1]])
2267 ; CHECK-NEXT: br label [[OMP_PARALLEL:%.*]]
2268 ; CHECK: omp_parallel:
2269 ; CHECK-NEXT: call void (ptr, i32, ptr, ...) @__kmpc_fork_call(ptr @[[GLOB1]], i32 2, ptr @merge_cancellable_regions..omp_par, ptr [[CANCEL1_ADDR]], ptr [[CANCEL2_ADDR]])
2270 ; CHECK-NEXT: br label [[OMP_PAR_OUTLINED_EXIT:%.*]]
2271 ; CHECK: omp.par.outlined.exit:
2272 ; CHECK-NEXT: br label [[OMP_PAR_EXIT_SPLIT:%.*]]
2273 ; CHECK: omp.par.exit.split:
2274 ; CHECK-NEXT: br label [[ENTRY_SPLIT_SPLIT:%.*]]
2275 ; CHECK: entry.split.split:
2276 ; CHECK-NEXT: ret void
2277 ; CHECK-LABEL: define {{[^@]+}}@merge_cancellable_regions..omp_par
2278 ; CHECK-SAME: (ptr noalias [[TID_ADDR:%.*]], ptr noalias [[ZERO_ADDR:%.*]], ptr [[CANCEL1_ADDR:%.*]], ptr [[CANCEL2_ADDR:%.*]]) #[[ATTR0]] {
2279 ; CHECK-NEXT: omp.par.entry:
2280 ; CHECK-NEXT: [[TID_ADDR_LOCAL:%.*]] = alloca i32, align 4
2281 ; CHECK-NEXT: [[TMP0:%.*]] = load i32, ptr [[TID_ADDR]], align 4
2282 ; CHECK-NEXT: store i32 [[TMP0]], ptr [[TID_ADDR_LOCAL]], align 4
2283 ; CHECK-NEXT: [[TID:%.*]] = load i32, ptr [[TID_ADDR_LOCAL]], align 4
2284 ; CHECK-NEXT: br label [[OMP_PAR_REGION:%.*]]
2285 ; CHECK: omp.par.outlined.exit.exitStub:
2286 ; CHECK-NEXT: ret void
2287 ; CHECK: omp.par.region:
2288 ; CHECK-NEXT: br label [[OMP_PAR_MERGED:%.*]]
2289 ; CHECK: omp.par.merged:
2290 ; CHECK-NEXT: call void @.omp_outlined..18(ptr [[TID_ADDR]], ptr [[ZERO_ADDR]], ptr nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[CANCEL1_ADDR]])
2291 ; CHECK-NEXT: [[OMP_GLOBAL_THREAD_NUM:%.*]] = call i32 @__kmpc_global_thread_num(ptr @[[GLOB1]])
2292 ; CHECK-NEXT: call void @__kmpc_barrier(ptr @[[GLOB2]], i32 [[OMP_GLOBAL_THREAD_NUM]])
2293 ; CHECK-NEXT: call void @.omp_outlined..19(ptr [[TID_ADDR]], ptr [[ZERO_ADDR]], ptr nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[CANCEL2_ADDR]])
2294 ; CHECK-NEXT: br label [[ENTRY_SPLIT:%.*]]
2295 ; CHECK: entry.split:
2296 ; CHECK-NEXT: br label [[OMP_PAR_REGION_SPLIT:%.*]]
2297 ; CHECK: omp.par.region.split:
2298 ; CHECK-NEXT: br label [[OMP_PAR_PRE_FINALIZE:%.*]]
2299 ; CHECK: omp.par.pre_finalize:
2300 ; CHECK-NEXT: br label [[OMP_PAR_OUTLINED_EXIT_EXITSTUB:%.*]]
2301 ; CHECK-LABEL: define {{[^@]+}}@.omp_outlined..18
2302 ; CHECK-SAME: (ptr noalias nocapture nofree readonly [[DOTGLOBAL_TID_:%.*]], ptr noalias nocapture nofree readnone [[DOTBOUND_TID_:%.*]], ptr nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[CANCEL1:%.*]]) {
2303 ; CHECK-NEXT: entry:
2304 ; CHECK-NEXT: [[TMP0:%.*]] = load i32, ptr [[CANCEL1]], align 4
2305 ; CHECK-NEXT: [[TOBOOL_NOT:%.*]] = icmp eq i32 [[TMP0]], 0
2306 ; CHECK-NEXT: br i1 [[TOBOOL_NOT]], label [[IF_END:%.*]], label [[IF_THEN:%.*]]
2308 ; CHECK-NEXT: [[TMP1:%.*]] = load i32, ptr [[DOTGLOBAL_TID_]], align 4
2309 ; CHECK-NEXT: [[TMP2:%.*]] = call i32 @__kmpc_cancel(ptr noundef nonnull @[[GLOB1]], i32 [[TMP1]], i32 noundef 1)
2310 ; CHECK-NEXT: ret void
2312 ; CHECK-NEXT: ret void
2313 ; CHECK-LABEL: define {{[^@]+}}@.omp_outlined..19
2314 ; CHECK-SAME: (ptr noalias nocapture nofree readonly [[DOTGLOBAL_TID_:%.*]], ptr noalias nocapture nofree readnone [[DOTBOUND_TID_:%.*]], ptr nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[CANCEL2:%.*]]) {
2315 ; CHECK-NEXT: entry:
2316 ; CHECK-NEXT: [[TMP0:%.*]] = load i32, ptr [[CANCEL2]], align 4
2317 ; CHECK-NEXT: [[TOBOOL_NOT:%.*]] = icmp eq i32 [[TMP0]], 0
2318 ; CHECK-NEXT: br i1 [[TOBOOL_NOT]], label [[IF_END:%.*]], label [[IF_THEN:%.*]]
2320 ; CHECK-NEXT: [[TMP1:%.*]] = load i32, ptr [[DOTGLOBAL_TID_]], align 4
2321 ; CHECK-NEXT: [[TMP2:%.*]] = call i32 @__kmpc_cancel(ptr noundef nonnull @[[GLOB1]], i32 [[TMP1]], i32 noundef 1)
2322 ; CHECK-NEXT: ret void
2324 ; CHECK-NEXT: ret void
2325 ; CHECK-LABEL: define {{[^@]+}}@merge_cancellable_regions_seq
2326 ; CHECK-SAME: (i32 [[CANCEL1:%.*]], i32 [[CANCEL2:%.*]]) local_unnamed_addr {
2327 ; CHECK-NEXT: entry:
2328 ; CHECK-NEXT: [[CANCEL1_ADDR:%.*]] = alloca i32, align 4
2329 ; CHECK-NEXT: [[CANCEL2_ADDR:%.*]] = alloca i32, align 4
2330 ; CHECK-NEXT: store i32 [[CANCEL1]], ptr [[CANCEL1_ADDR]], align 4
2331 ; CHECK-NEXT: store i32 [[CANCEL2]], ptr [[CANCEL2_ADDR]], align 4
2332 ; CHECK-NEXT: [[OMP_GLOBAL_THREAD_NUM2:%.*]] = call i32 @__kmpc_global_thread_num(ptr @[[GLOB1]])
2333 ; CHECK-NEXT: br label [[OMP_PARALLEL:%.*]]
2334 ; CHECK: omp_parallel:
2335 ; CHECK-NEXT: call void (ptr, i32, ptr, ...) @__kmpc_fork_call(ptr @[[GLOB1]], i32 2, ptr @merge_cancellable_regions_seq..omp_par, ptr [[CANCEL1_ADDR]], ptr [[CANCEL2_ADDR]])
2336 ; CHECK-NEXT: br label [[OMP_PAR_OUTLINED_EXIT:%.*]]
2337 ; CHECK: omp.par.outlined.exit:
2338 ; CHECK-NEXT: br label [[OMP_PAR_EXIT_SPLIT:%.*]]
2339 ; CHECK: omp.par.exit.split:
2340 ; CHECK-NEXT: br label [[ENTRY_SPLIT_SPLIT:%.*]]
2341 ; CHECK: entry.split.split:
2342 ; CHECK-NEXT: ret void
2343 ; CHECK-LABEL: define {{[^@]+}}@merge_cancellable_regions_seq..omp_par
2344 ; CHECK-SAME: (ptr noalias [[TID_ADDR:%.*]], ptr noalias [[ZERO_ADDR:%.*]], ptr [[CANCEL1_ADDR:%.*]], ptr [[CANCEL2_ADDR:%.*]]) #[[ATTR0]] {
2345 ; CHECK-NEXT: omp.par.entry:
2346 ; CHECK-NEXT: [[TID_ADDR_LOCAL:%.*]] = alloca i32, align 4
2347 ; CHECK-NEXT: [[TMP0:%.*]] = load i32, ptr [[TID_ADDR]], align 4
2348 ; CHECK-NEXT: store i32 [[TMP0]], ptr [[TID_ADDR_LOCAL]], align 4
2349 ; CHECK-NEXT: [[TID:%.*]] = load i32, ptr [[TID_ADDR_LOCAL]], align 4
2350 ; CHECK-NEXT: br label [[OMP_PAR_REGION:%.*]]
2351 ; CHECK: omp.par.outlined.exit.exitStub:
2352 ; CHECK-NEXT: ret void
2353 ; CHECK: omp.par.region:
2354 ; CHECK-NEXT: br label [[OMP_PAR_MERGED:%.*]]
2355 ; CHECK: omp.par.merged:
2356 ; CHECK-NEXT: call void @.omp_outlined..20(ptr [[TID_ADDR]], ptr [[ZERO_ADDR]], ptr nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[CANCEL1_ADDR]])
2357 ; CHECK-NEXT: [[OMP_GLOBAL_THREAD_NUM2:%.*]] = call i32 @__kmpc_global_thread_num(ptr @[[GLOB1]])
2358 ; CHECK-NEXT: call void @__kmpc_barrier(ptr @[[GLOB2]], i32 [[OMP_GLOBAL_THREAD_NUM2]])
2359 ; CHECK-NEXT: [[OMP_GLOBAL_THREAD_NUM:%.*]] = call i32 @__kmpc_global_thread_num(ptr @[[GLOB1]])
2360 ; CHECK-NEXT: [[TMP1:%.*]] = call i32 @__kmpc_master(ptr @[[GLOB1]], i32 [[OMP_GLOBAL_THREAD_NUM]])
2361 ; CHECK-NEXT: [[TMP2:%.*]] = icmp ne i32 [[TMP1]], 0
2362 ; CHECK-NEXT: br i1 [[TMP2]], label [[OMP_REGION_BODY:%.*]], label [[OMP_REGION_END:%.*]]
2363 ; CHECK: omp_region.end:
2364 ; CHECK-NEXT: [[OMP_GLOBAL_THREAD_NUM1:%.*]] = call i32 @__kmpc_global_thread_num(ptr @[[GLOB1]])
2365 ; CHECK-NEXT: call void @__kmpc_barrier(ptr @[[GLOB2]], i32 [[OMP_GLOBAL_THREAD_NUM1]])
2366 ; CHECK-NEXT: br label [[OMP_PAR_MERGED_SPLIT_SPLIT:%.*]]
2367 ; CHECK: omp.par.merged.split.split:
2368 ; CHECK-NEXT: call void @.omp_outlined..21(ptr [[TID_ADDR]], ptr [[ZERO_ADDR]], ptr nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[CANCEL2_ADDR]])
2369 ; CHECK-NEXT: br label [[ENTRY_SPLIT:%.*]]
2370 ; CHECK: entry.split:
2371 ; CHECK-NEXT: br label [[OMP_PAR_REGION_SPLIT:%.*]]
2372 ; CHECK: omp.par.region.split:
2373 ; CHECK-NEXT: br label [[OMP_PAR_PRE_FINALIZE:%.*]]
2374 ; CHECK: omp.par.pre_finalize:
2375 ; CHECK-NEXT: br label [[OMP_PAR_OUTLINED_EXIT_EXITSTUB:%.*]]
2376 ; CHECK: omp_region.body:
2377 ; CHECK-NEXT: br label [[SEQ_PAR_MERGED:%.*]]
2378 ; CHECK: seq.par.merged:
2379 ; CHECK-NEXT: [[TMP3:%.*]] = load i32, ptr [[CANCEL1_ADDR]], align 4
2380 ; CHECK-NEXT: [[TOBOOL_NOT:%.*]] = icmp eq i32 [[TMP3]], 0
2381 ; CHECK-NEXT: [[LNOT_EXT:%.*]] = zext i1 [[TOBOOL_NOT]] to i32
2382 ; CHECK-NEXT: store i32 [[LNOT_EXT]], ptr [[CANCEL2_ADDR]], align 4
2383 ; CHECK-NEXT: br label [[OMP_PAR_MERGED_SPLIT:%.*]]
2384 ; CHECK: omp.par.merged.split:
2385 ; CHECK-NEXT: br label [[OMP_REGION_BODY_SPLIT:%.*]]
2386 ; CHECK: omp_region.body.split:
2387 ; CHECK-NEXT: call void @__kmpc_end_master(ptr @[[GLOB1]], i32 [[OMP_GLOBAL_THREAD_NUM]])
2388 ; CHECK-NEXT: br label [[OMP_REGION_END]]
2389 ; CHECK-LABEL: define {{[^@]+}}@.omp_outlined..20
2390 ; CHECK-SAME: (ptr noalias nocapture nofree readonly [[DOTGLOBAL_TID_:%.*]], ptr noalias nocapture nofree readnone [[DOTBOUND_TID_:%.*]], ptr nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[CANCEL1:%.*]]) {
2391 ; CHECK-NEXT: entry:
2392 ; CHECK-NEXT: [[TMP0:%.*]] = load i32, ptr [[CANCEL1]], align 4
2393 ; CHECK-NEXT: [[TOBOOL_NOT:%.*]] = icmp eq i32 [[TMP0]], 0
2394 ; CHECK-NEXT: br i1 [[TOBOOL_NOT]], label [[IF_END:%.*]], label [[IF_THEN:%.*]]
2396 ; CHECK-NEXT: [[TMP1:%.*]] = load i32, ptr [[DOTGLOBAL_TID_]], align 4
2397 ; CHECK-NEXT: [[TMP2:%.*]] = call i32 @__kmpc_cancel(ptr noundef nonnull @[[GLOB1]], i32 [[TMP1]], i32 noundef 1)
2398 ; CHECK-NEXT: ret void
2400 ; CHECK-NEXT: ret void
2401 ; CHECK-LABEL: define {{[^@]+}}@.omp_outlined..21
2402 ; CHECK-SAME: (ptr noalias nocapture nofree readonly [[DOTGLOBAL_TID_:%.*]], ptr noalias nocapture nofree readnone [[DOTBOUND_TID_:%.*]], ptr nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[CANCEL2:%.*]]) {
2403 ; CHECK-NEXT: entry:
2404 ; CHECK-NEXT: [[TMP0:%.*]] = load i32, ptr [[CANCEL2]], align 4
2405 ; CHECK-NEXT: [[TOBOOL_NOT:%.*]] = icmp eq i32 [[TMP0]], 0
2406 ; CHECK-NEXT: br i1 [[TOBOOL_NOT]], label [[IF_END:%.*]], label [[IF_THEN:%.*]]
2408 ; CHECK-NEXT: [[TMP1:%.*]] = load i32, ptr [[DOTGLOBAL_TID_]], align 4
2409 ; CHECK-NEXT: [[TMP2:%.*]] = call i32 @__kmpc_cancel(ptr noundef nonnull @[[GLOB1]], i32 [[TMP1]], i32 noundef 1)
2410 ; CHECK-NEXT: ret void
2412 ; CHECK-NEXT: ret void
2413 ; CHECK-LABEL: define {{[^@]+}}@merge_3
2414 ; CHECK-SAME: (i32 [[A:%.*]]) local_unnamed_addr {
2415 ; CHECK-NEXT: entry:
2416 ; CHECK-NEXT: [[A_ADDR:%.*]] = alloca i32, align 4
2417 ; CHECK-NEXT: store i32 [[A]], ptr [[A_ADDR]], align 4
2418 ; CHECK-NEXT: [[OMP_GLOBAL_THREAD_NUM:%.*]] = call i32 @__kmpc_global_thread_num(ptr @[[GLOB1]])
2419 ; CHECK-NEXT: br label [[OMP_PARALLEL:%.*]]
2420 ; CHECK: omp_parallel:
2421 ; CHECK-NEXT: call void (ptr, i32, ptr, ...) @__kmpc_fork_call(ptr @[[GLOB1]], i32 1, ptr @merge_3..omp_par, ptr [[A_ADDR]])
2422 ; CHECK-NEXT: br label [[OMP_PAR_OUTLINED_EXIT:%.*]]
2423 ; CHECK: omp.par.outlined.exit:
2424 ; CHECK-NEXT: br label [[OMP_PAR_EXIT_SPLIT:%.*]]
2425 ; CHECK: omp.par.exit.split:
2426 ; CHECK-NEXT: br label [[ENTRY_SPLIT_SPLIT:%.*]]
2427 ; CHECK: entry.split.split:
2428 ; CHECK-NEXT: ret void
2429 ; CHECK-LABEL: define {{[^@]+}}@merge_3..omp_par
2430 ; CHECK-SAME: (ptr noalias [[TID_ADDR:%.*]], ptr noalias [[ZERO_ADDR:%.*]], ptr [[A_ADDR:%.*]]) #[[ATTR0]] {
2431 ; CHECK-NEXT: omp.par.entry:
2432 ; CHECK-NEXT: [[TID_ADDR_LOCAL:%.*]] = alloca i32, align 4
2433 ; CHECK-NEXT: [[TMP0:%.*]] = load i32, ptr [[TID_ADDR]], align 4
2434 ; CHECK-NEXT: store i32 [[TMP0]], ptr [[TID_ADDR_LOCAL]], align 4
2435 ; CHECK-NEXT: [[TID:%.*]] = load i32, ptr [[TID_ADDR_LOCAL]], align 4
2436 ; CHECK-NEXT: br label [[OMP_PAR_REGION:%.*]]
2437 ; CHECK: omp.par.outlined.exit.exitStub:
2438 ; CHECK-NEXT: ret void
2439 ; CHECK: omp.par.region:
2440 ; CHECK-NEXT: br label [[OMP_PAR_MERGED:%.*]]
2441 ; CHECK: omp.par.merged:
2442 ; CHECK-NEXT: call void @.omp_outlined..22(ptr [[TID_ADDR]], ptr [[ZERO_ADDR]], ptr nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[A_ADDR]])
2443 ; CHECK-NEXT: [[OMP_GLOBAL_THREAD_NUM:%.*]] = call i32 @__kmpc_global_thread_num(ptr @[[GLOB1]])
2444 ; CHECK-NEXT: call void @__kmpc_barrier(ptr @[[GLOB2]], i32 [[OMP_GLOBAL_THREAD_NUM]])
2445 ; CHECK-NEXT: call void @.omp_outlined..23(ptr [[TID_ADDR]], ptr [[ZERO_ADDR]], ptr nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[A_ADDR]])
2446 ; CHECK-NEXT: [[OMP_GLOBAL_THREAD_NUM1:%.*]] = call i32 @__kmpc_global_thread_num(ptr @[[GLOB1]])
2447 ; CHECK-NEXT: call void @__kmpc_barrier(ptr @[[GLOB2]], i32 [[OMP_GLOBAL_THREAD_NUM1]])
2448 ; CHECK-NEXT: call void @.omp_outlined..24(ptr [[TID_ADDR]], ptr [[ZERO_ADDR]], ptr nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[A_ADDR]])
2449 ; CHECK-NEXT: br label [[ENTRY_SPLIT:%.*]]
2450 ; CHECK: entry.split:
2451 ; CHECK-NEXT: br label [[OMP_PAR_REGION_SPLIT:%.*]]
2452 ; CHECK: omp.par.region.split:
2453 ; CHECK-NEXT: br label [[OMP_PAR_PRE_FINALIZE:%.*]]
2454 ; CHECK: omp.par.pre_finalize:
2455 ; CHECK-NEXT: br label [[OMP_PAR_OUTLINED_EXIT_EXITSTUB:%.*]]
2456 ; CHECK-LABEL: define {{[^@]+}}@.omp_outlined..22
2457 ; CHECK-SAME: (ptr noalias nocapture nofree readnone [[DOTGLOBAL_TID_:%.*]], ptr noalias nocapture nofree readnone [[DOTBOUND_TID_:%.*]], ptr nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[A:%.*]]) {
2458 ; CHECK-NEXT: entry:
2459 ; CHECK-NEXT: [[TMP0:%.*]] = load i32, ptr [[A]], align 4
2460 ; CHECK-NEXT: call void @use(i32 [[TMP0]])
2461 ; CHECK-NEXT: ret void
2462 ; CHECK-LABEL: define {{[^@]+}}@.omp_outlined..23
2463 ; CHECK-SAME: (ptr noalias nocapture nofree readnone [[DOTGLOBAL_TID_:%.*]], ptr noalias nocapture nofree readnone [[DOTBOUND_TID_:%.*]], ptr nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[A:%.*]]) {
2464 ; CHECK-NEXT: entry:
2465 ; CHECK-NEXT: [[TMP0:%.*]] = load i32, ptr [[A]], align 4
2466 ; CHECK-NEXT: call void @use(i32 [[TMP0]])
2467 ; CHECK-NEXT: ret void
2468 ; CHECK-LABEL: define {{[^@]+}}@.omp_outlined..24
2469 ; CHECK-SAME: (ptr noalias nocapture nofree readnone [[DOTGLOBAL_TID_:%.*]], ptr noalias nocapture nofree readnone [[DOTBOUND_TID_:%.*]], ptr nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[A:%.*]]) {
2470 ; CHECK-NEXT: entry:
2471 ; CHECK-NEXT: [[TMP0:%.*]] = load i32, ptr [[A]], align 4
2472 ; CHECK-NEXT: call void @use(i32 [[TMP0]])
2473 ; CHECK-NEXT: ret void
2474 ; CHECK-LABEL: define {{[^@]+}}@merge_3_seq
2475 ; CHECK-SAME: (i32 [[A:%.*]], i32 [[B:%.*]]) local_unnamed_addr {
2476 ; CHECK-NEXT: entry:
2477 ; CHECK-NEXT: [[ADD1_SEQ_OUTPUT_ALLOC:%.*]] = alloca i32, align 4
2478 ; CHECK-NEXT: [[ADD_SEQ_OUTPUT_ALLOC:%.*]] = alloca i32, align 4
2479 ; CHECK-NEXT: [[A_ADDR:%.*]] = alloca i32, align 4
2480 ; CHECK-NEXT: store i32 [[A]], ptr [[A_ADDR]], align 4
2481 ; CHECK-NEXT: [[OMP_GLOBAL_THREAD_NUM7:%.*]] = call i32 @__kmpc_global_thread_num(ptr @[[GLOB1]])
2482 ; CHECK-NEXT: br label [[OMP_PARALLEL:%.*]]
2483 ; CHECK: omp_parallel:
2484 ; CHECK-NEXT: call void (ptr, i32, ptr, ...) @__kmpc_fork_call(ptr @[[GLOB1]], i32 3, ptr @merge_3_seq..omp_par, ptr [[A_ADDR]], ptr [[ADD_SEQ_OUTPUT_ALLOC]], ptr [[ADD1_SEQ_OUTPUT_ALLOC]])
2485 ; CHECK-NEXT: br label [[OMP_PAR_OUTLINED_EXIT:%.*]]
2486 ; CHECK: omp.par.outlined.exit:
2487 ; CHECK-NEXT: br label [[OMP_PAR_EXIT_SPLIT:%.*]]
2488 ; CHECK: omp.par.exit.split:
2489 ; CHECK-NEXT: br label [[ENTRY_SPLIT_SPLIT:%.*]]
2490 ; CHECK: entry.split.split:
2491 ; CHECK-NEXT: [[ADD1_SEQ_OUTPUT_LOAD:%.*]] = load i32, ptr [[ADD1_SEQ_OUTPUT_ALLOC]], align 4
2492 ; CHECK-NEXT: call void @use(i32 [[ADD1_SEQ_OUTPUT_LOAD]])
2493 ; CHECK-NEXT: ret void
2494 ; CHECK-LABEL: define {{[^@]+}}@merge_3_seq..omp_par
2495 ; CHECK-SAME: (ptr noalias [[TID_ADDR:%.*]], ptr noalias [[ZERO_ADDR:%.*]], ptr [[A_ADDR:%.*]], ptr [[ADD_SEQ_OUTPUT_ALLOC:%.*]], ptr [[ADD1_SEQ_OUTPUT_ALLOC:%.*]]) #[[ATTR0]] {
2496 ; CHECK-NEXT: omp.par.entry:
2497 ; CHECK-NEXT: [[TID_ADDR_LOCAL:%.*]] = alloca i32, align 4
2498 ; CHECK-NEXT: [[TMP0:%.*]] = load i32, ptr [[TID_ADDR]], align 4
2499 ; CHECK-NEXT: store i32 [[TMP0]], ptr [[TID_ADDR_LOCAL]], align 4
2500 ; CHECK-NEXT: [[TID:%.*]] = load i32, ptr [[TID_ADDR_LOCAL]], align 4
2501 ; CHECK-NEXT: br label [[OMP_PAR_REGION:%.*]]
2502 ; CHECK: omp.par.outlined.exit.exitStub:
2503 ; CHECK-NEXT: ret void
2504 ; CHECK: omp.par.region:
2505 ; CHECK-NEXT: br label [[OMP_PAR_MERGED:%.*]]
2506 ; CHECK: omp.par.merged:
2507 ; CHECK-NEXT: call void @.omp_outlined..25(ptr [[TID_ADDR]], ptr [[ZERO_ADDR]], ptr nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[A_ADDR]])
2508 ; CHECK-NEXT: [[OMP_GLOBAL_THREAD_NUM2:%.*]] = call i32 @__kmpc_global_thread_num(ptr @[[GLOB1]])
2509 ; CHECK-NEXT: call void @__kmpc_barrier(ptr @[[GLOB2]], i32 [[OMP_GLOBAL_THREAD_NUM2]])
2510 ; CHECK-NEXT: [[OMP_GLOBAL_THREAD_NUM:%.*]] = call i32 @__kmpc_global_thread_num(ptr @[[GLOB1]])
2511 ; CHECK-NEXT: [[TMP1:%.*]] = call i32 @__kmpc_master(ptr @[[GLOB1]], i32 [[OMP_GLOBAL_THREAD_NUM]])
2512 ; CHECK-NEXT: [[TMP2:%.*]] = icmp ne i32 [[TMP1]], 0
2513 ; CHECK-NEXT: br i1 [[TMP2]], label [[OMP_REGION_BODY:%.*]], label [[OMP_REGION_END:%.*]]
2514 ; CHECK: omp_region.end:
2515 ; CHECK-NEXT: [[OMP_GLOBAL_THREAD_NUM1:%.*]] = call i32 @__kmpc_global_thread_num(ptr @[[GLOB1]])
2516 ; CHECK-NEXT: call void @__kmpc_barrier(ptr @[[GLOB2]], i32 [[OMP_GLOBAL_THREAD_NUM1]])
2517 ; CHECK-NEXT: br label [[OMP_PAR_MERGED_SPLIT_SPLIT:%.*]]
2518 ; CHECK: omp.par.merged.split.split:
2519 ; CHECK-NEXT: call void @.omp_outlined..26(ptr [[TID_ADDR]], ptr [[ZERO_ADDR]], ptr nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[A_ADDR]])
2520 ; CHECK-NEXT: [[OMP_GLOBAL_THREAD_NUM4:%.*]] = call i32 @__kmpc_global_thread_num(ptr @[[GLOB1]])
2521 ; CHECK-NEXT: call void @__kmpc_barrier(ptr @[[GLOB2]], i32 [[OMP_GLOBAL_THREAD_NUM4]])
2522 ; CHECK-NEXT: [[OMP_GLOBAL_THREAD_NUM3:%.*]] = call i32 @__kmpc_global_thread_num(ptr @[[GLOB1]])
2523 ; CHECK-NEXT: [[TMP3:%.*]] = call i32 @__kmpc_master(ptr @[[GLOB1]], i32 [[OMP_GLOBAL_THREAD_NUM3]])
2524 ; CHECK-NEXT: [[TMP4:%.*]] = icmp ne i32 [[TMP3]], 0
2525 ; CHECK-NEXT: br i1 [[TMP4]], label [[OMP_REGION_BODY5:%.*]], label [[OMP_REGION_END4:%.*]]
2526 ; CHECK: omp_region.end4:
2527 ; CHECK-NEXT: [[OMP_GLOBAL_THREAD_NUM6:%.*]] = call i32 @__kmpc_global_thread_num(ptr @[[GLOB1]])
2528 ; CHECK-NEXT: call void @__kmpc_barrier(ptr @[[GLOB2]], i32 [[OMP_GLOBAL_THREAD_NUM6]])
2529 ; CHECK-NEXT: br label [[OMP_PAR_MERGED_SPLIT_SPLIT_SPLIT_SPLIT:%.*]]
2530 ; CHECK: omp.par.merged.split.split.split.split:
2531 ; CHECK-NEXT: call void @.omp_outlined..27(ptr [[TID_ADDR]], ptr [[ZERO_ADDR]], ptr nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[A_ADDR]])
2532 ; CHECK-NEXT: br label [[ENTRY_SPLIT:%.*]]
2533 ; CHECK: entry.split:
2534 ; CHECK-NEXT: br label [[OMP_PAR_REGION_SPLIT:%.*]]
2535 ; CHECK: omp.par.region.split:
2536 ; CHECK-NEXT: br label [[OMP_PAR_PRE_FINALIZE:%.*]]
2537 ; CHECK: omp.par.pre_finalize:
2538 ; CHECK-NEXT: br label [[OMP_PAR_OUTLINED_EXIT_EXITSTUB:%.*]]
2539 ; CHECK: omp_region.body5:
2540 ; CHECK-NEXT: br label [[SEQ_PAR_MERGED2:%.*]]
2541 ; CHECK: seq.par.merged2:
2542 ; CHECK-NEXT: [[TMP5:%.*]] = load i32, ptr [[A_ADDR]], align 4
2543 ; CHECK-NEXT: [[ADD_SEQ_OUTPUT_LOAD:%.*]] = load i32, ptr [[ADD_SEQ_OUTPUT_ALLOC]], align 4
2544 ; CHECK-NEXT: [[ADD1:%.*]] = add nsw i32 [[ADD_SEQ_OUTPUT_LOAD]], [[TMP5]]
2545 ; CHECK-NEXT: store i32 [[ADD1]], ptr [[ADD1_SEQ_OUTPUT_ALLOC]], align 4
2546 ; CHECK-NEXT: br label [[OMP_PAR_MERGED_SPLIT_SPLIT_SPLIT:%.*]]
2547 ; CHECK: omp.par.merged.split.split.split:
2548 ; CHECK-NEXT: br label [[OMP_REGION_BODY5_SPLIT:%.*]]
2549 ; CHECK: omp_region.body5.split:
2550 ; CHECK-NEXT: call void @__kmpc_end_master(ptr @[[GLOB1]], i32 [[OMP_GLOBAL_THREAD_NUM3]])
2551 ; CHECK-NEXT: br label [[OMP_REGION_END4]]
2552 ; CHECK: omp_region.body:
2553 ; CHECK-NEXT: br label [[SEQ_PAR_MERGED:%.*]]
2554 ; CHECK: seq.par.merged:
2555 ; CHECK-NEXT: [[TMP6:%.*]] = load i32, ptr [[A_ADDR]], align 4
2556 ; CHECK-NEXT: [[ADD:%.*]] = add nsw i32 [[TMP6]], 1
2557 ; CHECK-NEXT: store i32 [[ADD]], ptr [[ADD_SEQ_OUTPUT_ALLOC]], align 4
2558 ; CHECK-NEXT: br label [[OMP_PAR_MERGED_SPLIT:%.*]]
2559 ; CHECK: omp.par.merged.split:
2560 ; CHECK-NEXT: br label [[OMP_REGION_BODY_SPLIT:%.*]]
2561 ; CHECK: omp_region.body.split:
2562 ; CHECK-NEXT: call void @__kmpc_end_master(ptr @[[GLOB1]], i32 [[OMP_GLOBAL_THREAD_NUM]])
2563 ; CHECK-NEXT: br label [[OMP_REGION_END]]
2564 ; CHECK-LABEL: define {{[^@]+}}@.omp_outlined..25
2565 ; CHECK-SAME: (ptr noalias nocapture nofree readnone [[DOTGLOBAL_TID_:%.*]], ptr noalias nocapture nofree readnone [[DOTBOUND_TID_:%.*]], ptr nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[A:%.*]]) {
2566 ; CHECK-NEXT: entry:
2567 ; CHECK-NEXT: [[TMP0:%.*]] = load i32, ptr [[A]], align 4
2568 ; CHECK-NEXT: call void @use(i32 [[TMP0]])
2569 ; CHECK-NEXT: ret void
2570 ; CHECK-LABEL: define {{[^@]+}}@.omp_outlined..26
2571 ; CHECK-SAME: (ptr noalias nocapture nofree readnone [[DOTGLOBAL_TID_:%.*]], ptr noalias nocapture nofree readnone [[DOTBOUND_TID_:%.*]], ptr nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[A:%.*]]) {
2572 ; CHECK-NEXT: entry:
2573 ; CHECK-NEXT: [[TMP0:%.*]] = load i32, ptr [[A]], align 4
2574 ; CHECK-NEXT: call void @use(i32 [[TMP0]])
2575 ; CHECK-NEXT: ret void
2576 ; CHECK-LABEL: define {{[^@]+}}@.omp_outlined..27
2577 ; CHECK-SAME: (ptr noalias nocapture nofree readnone [[DOTGLOBAL_TID_:%.*]], ptr noalias nocapture nofree readnone [[DOTBOUND_TID_:%.*]], ptr nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[A:%.*]]) {
2578 ; CHECK-NEXT: entry:
2579 ; CHECK-NEXT: [[TMP0:%.*]] = load i32, ptr [[A]], align 4
2580 ; CHECK-NEXT: call void @use(i32 [[TMP0]])
2581 ; CHECK-NEXT: ret void
2582 ; CHECK-LABEL: define {{[^@]+}}@unmergable_3_seq_call
2583 ; CHECK-SAME: (i32 [[A:%.*]]) local_unnamed_addr {
2584 ; CHECK-NEXT: entry:
2585 ; CHECK-NEXT: [[A_ADDR:%.*]] = alloca i32, align 4
2586 ; CHECK-NEXT: store i32 [[A]], ptr [[A_ADDR]], align 4
2587 ; CHECK-NEXT: call void (ptr, i32, ptr, ...) @__kmpc_fork_call(ptr noundef nonnull align 8 dereferenceable(24) @[[GLOB1]], i32 noundef 1, ptr noundef @.omp_outlined..28, ptr nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[A_ADDR]])
2588 ; CHECK-NEXT: call void (...) @foo()
2589 ; CHECK-NEXT: call void (ptr, i32, ptr, ...) @__kmpc_fork_call(ptr noundef nonnull align 8 dereferenceable(24) @[[GLOB1]], i32 noundef 1, ptr noundef @.omp_outlined..29, ptr nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[A_ADDR]])
2590 ; CHECK-NEXT: call void (...) @foo()
2591 ; CHECK-NEXT: call void (ptr, i32, ptr, ...) @__kmpc_fork_call(ptr noundef nonnull align 8 dereferenceable(24) @[[GLOB1]], i32 noundef 1, ptr noundef @.omp_outlined..30, ptr nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[A_ADDR]])
2592 ; CHECK-NEXT: ret void
2593 ; CHECK-LABEL: define {{[^@]+}}@.omp_outlined..28
2594 ; CHECK-SAME: (ptr noalias nocapture nofree readnone [[DOTGLOBAL_TID_:%.*]], ptr noalias nocapture nofree readnone [[DOTBOUND_TID_:%.*]], ptr nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[A:%.*]]) {
2595 ; CHECK-NEXT: entry:
2596 ; CHECK-NEXT: [[TMP0:%.*]] = load i32, ptr [[A]], align 4
2597 ; CHECK-NEXT: call void @use(i32 [[TMP0]])
2598 ; CHECK-NEXT: ret void
2599 ; CHECK-LABEL: define {{[^@]+}}@.omp_outlined..29
2600 ; CHECK-SAME: (ptr noalias nocapture nofree readnone [[DOTGLOBAL_TID_:%.*]], ptr noalias nocapture nofree readnone [[DOTBOUND_TID_:%.*]], ptr nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[A:%.*]]) {
2601 ; CHECK-NEXT: entry:
2602 ; CHECK-NEXT: [[TMP0:%.*]] = load i32, ptr [[A]], align 4
2603 ; CHECK-NEXT: call void @use(i32 [[TMP0]])
2604 ; CHECK-NEXT: ret void
2605 ; CHECK-LABEL: define {{[^@]+}}@.omp_outlined..30
2606 ; CHECK-SAME: (ptr noalias nocapture nofree readnone [[DOTGLOBAL_TID_:%.*]], ptr noalias nocapture nofree readnone [[DOTBOUND_TID_:%.*]], ptr nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[A:%.*]]) {
2607 ; CHECK-NEXT: entry:
2608 ; CHECK-NEXT: [[TMP0:%.*]] = load i32, ptr [[A]], align 4
2609 ; CHECK-NEXT: call void @use(i32 [[TMP0]])
2610 ; CHECK-NEXT: ret void
2611 ; CHECK-LABEL: define {{[^@]+}}@unmergable_3_proc_bind
2612 ; CHECK-SAME: (i32 [[A:%.*]]) local_unnamed_addr {
2613 ; CHECK-NEXT: entry:
2614 ; CHECK-NEXT: [[A_ADDR:%.*]] = alloca i32, align 4
2615 ; CHECK-NEXT: [[TMP0:%.*]] = call i32 @__kmpc_global_thread_num(ptr noundef nonnull align 8 dereferenceable(24) @[[GLOB1]])
2616 ; CHECK-NEXT: store i32 [[A]], ptr [[A_ADDR]], align 4
2617 ; CHECK-NEXT: call void (ptr, i32, ptr, ...) @__kmpc_fork_call(ptr noundef nonnull align 8 dereferenceable(24) @[[GLOB1]], i32 noundef 1, ptr noundef @.omp_outlined..31, ptr nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[A_ADDR]])
2618 ; CHECK-NEXT: call void @__kmpc_push_proc_bind(ptr noundef nonnull align 8 dereferenceable(24) @[[GLOB1]], i32 [[TMP0]], i32 noundef 3)
2619 ; CHECK-NEXT: call void (ptr, i32, ptr, ...) @__kmpc_fork_call(ptr noundef nonnull align 8 dereferenceable(24) @[[GLOB1]], i32 noundef 1, ptr noundef @.omp_outlined..32, ptr nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[A_ADDR]])
2620 ; CHECK-NEXT: call void (ptr, i32, ptr, ...) @__kmpc_fork_call(ptr noundef nonnull align 8 dereferenceable(24) @[[GLOB1]], i32 noundef 1, ptr noundef @.omp_outlined..33, ptr nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[A_ADDR]])
2621 ; CHECK-NEXT: ret void
2622 ; CHECK-LABEL: define {{[^@]+}}@.omp_outlined..31
2623 ; CHECK-SAME: (ptr noalias nocapture nofree readnone [[DOTGLOBAL_TID_:%.*]], ptr noalias nocapture nofree readnone [[DOTBOUND_TID_:%.*]], ptr nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[A:%.*]]) {
2624 ; CHECK-NEXT: entry:
2625 ; CHECK-NEXT: [[TMP0:%.*]] = load i32, ptr [[A]], align 4
2626 ; CHECK-NEXT: call void @use(i32 [[TMP0]])
2627 ; CHECK-NEXT: ret void
2628 ; CHECK-LABEL: define {{[^@]+}}@.omp_outlined..32
2629 ; CHECK-SAME: (ptr noalias nocapture nofree readnone [[DOTGLOBAL_TID_:%.*]], ptr noalias nocapture nofree readnone [[DOTBOUND_TID_:%.*]], ptr nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[A:%.*]]) {
2630 ; CHECK-NEXT: entry:
2631 ; CHECK-NEXT: [[TMP0:%.*]] = load i32, ptr [[A]], align 4
2632 ; CHECK-NEXT: call void @use(i32 [[TMP0]])
2633 ; CHECK-NEXT: ret void
2634 ; CHECK-LABEL: define {{[^@]+}}@.omp_outlined..33
2635 ; CHECK-SAME: (ptr noalias nocapture nofree readnone [[DOTGLOBAL_TID_:%.*]], ptr noalias nocapture nofree readnone [[DOTBOUND_TID_:%.*]], ptr nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[A:%.*]]) {
2636 ; CHECK-NEXT: entry:
2637 ; CHECK-NEXT: [[TMP0:%.*]] = load i32, ptr [[A]], align 4
2638 ; CHECK-NEXT: call void @use(i32 [[TMP0]])
2639 ; CHECK-NEXT: ret void
2640 ; CHECK-LABEL: define {{[^@]+}}@unmergable_3_num_threads
2641 ; CHECK-SAME: (i32 [[A:%.*]]) local_unnamed_addr {
2642 ; CHECK-NEXT: entry:
2643 ; CHECK-NEXT: [[A_ADDR:%.*]] = alloca i32, align 4
2644 ; CHECK-NEXT: [[TMP0:%.*]] = call i32 @__kmpc_global_thread_num(ptr noundef nonnull align 8 dereferenceable(24) @[[GLOB1]])
2645 ; CHECK-NEXT: store i32 [[A]], ptr [[A_ADDR]], align 4
2646 ; CHECK-NEXT: call void (ptr, i32, ptr, ...) @__kmpc_fork_call(ptr noundef nonnull align 8 dereferenceable(24) @[[GLOB1]], i32 noundef 1, ptr noundef @.omp_outlined..34, ptr nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[A_ADDR]])
2647 ; CHECK-NEXT: [[TMP1:%.*]] = load i32, ptr [[A_ADDR]], align 4
2648 ; CHECK-NEXT: call void @__kmpc_push_num_threads(ptr noundef nonnull align 8 dereferenceable(24) @[[GLOB1]], i32 [[TMP0]], i32 [[TMP1]])
2649 ; CHECK-NEXT: call void (ptr, i32, ptr, ...) @__kmpc_fork_call(ptr noundef nonnull align 8 dereferenceable(24) @[[GLOB1]], i32 noundef 1, ptr noundef @.omp_outlined..35, ptr nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[A_ADDR]])
2650 ; CHECK-NEXT: call void (ptr, i32, ptr, ...) @__kmpc_fork_call(ptr noundef nonnull align 8 dereferenceable(24) @[[GLOB1]], i32 noundef 1, ptr noundef @.omp_outlined..36, ptr nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[A_ADDR]])
2651 ; CHECK-NEXT: ret void
2652 ; CHECK-LABEL: define {{[^@]+}}@.omp_outlined..34
2653 ; CHECK-SAME: (ptr noalias nocapture nofree readnone [[DOTGLOBAL_TID_:%.*]], ptr noalias nocapture nofree readnone [[DOTBOUND_TID_:%.*]], ptr nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[A:%.*]]) {
2654 ; CHECK-NEXT: entry:
2655 ; CHECK-NEXT: [[TMP0:%.*]] = load i32, ptr [[A]], align 4
2656 ; CHECK-NEXT: call void @use(i32 [[TMP0]])
2657 ; CHECK-NEXT: ret void
2658 ; CHECK-LABEL: define {{[^@]+}}@.omp_outlined..35
2659 ; CHECK-SAME: (ptr noalias nocapture nofree readnone [[DOTGLOBAL_TID_:%.*]], ptr noalias nocapture nofree readnone [[DOTBOUND_TID_:%.*]], ptr nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[A:%.*]]) {
2660 ; CHECK-NEXT: entry:
2661 ; CHECK-NEXT: [[TMP0:%.*]] = load i32, ptr [[A]], align 4
2662 ; CHECK-NEXT: call void @use(i32 [[TMP0]])
2663 ; CHECK-NEXT: ret void
2664 ; CHECK-LABEL: define {{[^@]+}}@.omp_outlined..36
2665 ; CHECK-SAME: (ptr noalias nocapture nofree readnone [[DOTGLOBAL_TID_:%.*]], ptr noalias nocapture nofree readnone [[DOTBOUND_TID_:%.*]], ptr nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[A:%.*]]) {
2666 ; CHECK-NEXT: entry:
2667 ; CHECK-NEXT: [[TMP0:%.*]] = load i32, ptr [[A]], align 4
2668 ; CHECK-NEXT: call void @use(i32 [[TMP0]])
2669 ; CHECK-NEXT: ret void
2670 ; CHECK-LABEL: define {{[^@]+}}@merge_2_unmergable_1
2671 ; CHECK-SAME: (i32 [[A:%.*]]) local_unnamed_addr {
2672 ; CHECK-NEXT: entry:
2673 ; CHECK-NEXT: [[A_ADDR:%.*]] = alloca i32, align 4
2674 ; CHECK-NEXT: store i32 [[A]], ptr [[A_ADDR]], align 4
2675 ; CHECK-NEXT: [[OMP_GLOBAL_THREAD_NUM:%.*]] = call i32 @__kmpc_global_thread_num(ptr @[[GLOB1]])
2676 ; CHECK-NEXT: br label [[OMP_PARALLEL:%.*]]
2677 ; CHECK: omp_parallel:
2678 ; CHECK-NEXT: call void (ptr, i32, ptr, ...) @__kmpc_fork_call(ptr @[[GLOB1]], i32 1, ptr @merge_2_unmergable_1..omp_par, ptr [[A_ADDR]])
2679 ; CHECK-NEXT: br label [[OMP_PAR_OUTLINED_EXIT:%.*]]
2680 ; CHECK: omp.par.outlined.exit:
2681 ; CHECK-NEXT: br label [[OMP_PAR_EXIT_SPLIT:%.*]]
2682 ; CHECK: omp.par.exit.split:
2683 ; CHECK-NEXT: br label [[ENTRY_SPLIT_SPLIT:%.*]]
2684 ; CHECK: entry.split.split:
2685 ; CHECK-NEXT: call void (...) @foo()
2686 ; CHECK-NEXT: call void (ptr, i32, ptr, ...) @__kmpc_fork_call(ptr noundef nonnull align 8 dereferenceable(24) @[[GLOB1]], i32 noundef 1, ptr noundef @.omp_outlined..39, ptr nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[A_ADDR]])
2687 ; CHECK-NEXT: ret void
2688 ; CHECK-LABEL: define {{[^@]+}}@merge_2_unmergable_1..omp_par
2689 ; CHECK-SAME: (ptr noalias [[TID_ADDR:%.*]], ptr noalias [[ZERO_ADDR:%.*]], ptr [[A_ADDR:%.*]]) #[[ATTR0]] {
2690 ; CHECK-NEXT: omp.par.entry:
2691 ; CHECK-NEXT: [[TID_ADDR_LOCAL:%.*]] = alloca i32, align 4
2692 ; CHECK-NEXT: [[TMP0:%.*]] = load i32, ptr [[TID_ADDR]], align 4
2693 ; CHECK-NEXT: store i32 [[TMP0]], ptr [[TID_ADDR_LOCAL]], align 4
2694 ; CHECK-NEXT: [[TID:%.*]] = load i32, ptr [[TID_ADDR_LOCAL]], align 4
2695 ; CHECK-NEXT: br label [[OMP_PAR_REGION:%.*]]
2696 ; CHECK: omp.par.outlined.exit.exitStub:
2697 ; CHECK-NEXT: ret void
2698 ; CHECK: omp.par.region:
2699 ; CHECK-NEXT: br label [[OMP_PAR_MERGED:%.*]]
2700 ; CHECK: omp.par.merged:
2701 ; CHECK-NEXT: call void @.omp_outlined..37(ptr [[TID_ADDR]], ptr [[ZERO_ADDR]], ptr nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[A_ADDR]])
2702 ; CHECK-NEXT: [[OMP_GLOBAL_THREAD_NUM:%.*]] = call i32 @__kmpc_global_thread_num(ptr @[[GLOB1]])
2703 ; CHECK-NEXT: call void @__kmpc_barrier(ptr @[[GLOB2]], i32 [[OMP_GLOBAL_THREAD_NUM]])
2704 ; CHECK-NEXT: call void @.omp_outlined..38(ptr [[TID_ADDR]], ptr [[ZERO_ADDR]], ptr nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[A_ADDR]])
2705 ; CHECK-NEXT: br label [[ENTRY_SPLIT:%.*]]
2706 ; CHECK: entry.split:
2707 ; CHECK-NEXT: br label [[OMP_PAR_REGION_SPLIT:%.*]]
2708 ; CHECK: omp.par.region.split:
2709 ; CHECK-NEXT: br label [[OMP_PAR_PRE_FINALIZE:%.*]]
2710 ; CHECK: omp.par.pre_finalize:
2711 ; CHECK-NEXT: br label [[OMP_PAR_OUTLINED_EXIT_EXITSTUB:%.*]]
2712 ; CHECK-LABEL: define {{[^@]+}}@.omp_outlined..37
2713 ; CHECK-SAME: (ptr noalias nocapture nofree readnone [[DOTGLOBAL_TID_:%.*]], ptr noalias nocapture nofree readnone [[DOTBOUND_TID_:%.*]], ptr nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[A:%.*]]) {
2714 ; CHECK-NEXT: entry:
2715 ; CHECK-NEXT: [[TMP0:%.*]] = load i32, ptr [[A]], align 4
2716 ; CHECK-NEXT: call void @use(i32 [[TMP0]])
2717 ; CHECK-NEXT: ret void
2718 ; CHECK-LABEL: define {{[^@]+}}@.omp_outlined..38
2719 ; CHECK-SAME: (ptr noalias nocapture nofree readnone [[DOTGLOBAL_TID_:%.*]], ptr noalias nocapture nofree readnone [[DOTBOUND_TID_:%.*]], ptr nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[A:%.*]]) {
2720 ; CHECK-NEXT: entry:
2721 ; CHECK-NEXT: [[TMP0:%.*]] = load i32, ptr [[A]], align 4
2722 ; CHECK-NEXT: call void @use(i32 [[TMP0]])
2723 ; CHECK-NEXT: ret void
2724 ; CHECK-LABEL: define {{[^@]+}}@.omp_outlined..39
2725 ; CHECK-SAME: (ptr noalias nocapture nofree readnone [[DOTGLOBAL_TID_:%.*]], ptr noalias nocapture nofree readnone [[DOTBOUND_TID_:%.*]], ptr nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[A:%.*]]) {
2726 ; CHECK-NEXT: entry:
2727 ; CHECK-NEXT: [[TMP0:%.*]] = load i32, ptr [[A]], align 4
2728 ; CHECK-NEXT: call void @use(i32 [[TMP0]])
2729 ; CHECK-NEXT: ret void
2730 ; CHECK-LABEL: define {{[^@]+}}@merge
2731 ; CHECK-SAME: (i32 [[A:%.*]]) local_unnamed_addr {
2732 ; CHECK-NEXT: entry:
2733 ; CHECK-NEXT: [[A_ADDR:%.*]] = alloca i32, align 4
2734 ; CHECK-NEXT: store i32 [[A]], ptr [[A_ADDR]], align 4
2735 ; CHECK-NEXT: [[OMP_GLOBAL_THREAD_NUM:%.*]] = call i32 @__kmpc_global_thread_num(ptr @[[GLOB1]])
2736 ; CHECK-NEXT: br label [[OMP_PARALLEL:%.*]]
2737 ; CHECK: omp_parallel:
2738 ; CHECK-NEXT: call void (ptr, i32, ptr, ...) @__kmpc_fork_call(ptr @[[GLOB1]], i32 1, ptr @merge..omp_par, ptr [[A_ADDR]])
2739 ; CHECK-NEXT: br label [[OMP_PAR_OUTLINED_EXIT:%.*]]
2740 ; CHECK: omp.par.outlined.exit:
2741 ; CHECK-NEXT: br label [[OMP_PAR_EXIT_SPLIT:%.*]]
2742 ; CHECK: omp.par.exit.split:
2743 ; CHECK-NEXT: br label [[ENTRY_SPLIT_SPLIT:%.*]]
2744 ; CHECK: entry.split.split:
2745 ; CHECK-NEXT: ret void
2746 ; CHECK-LABEL: define {{[^@]+}}@merge..omp_par
2747 ; CHECK-SAME: (ptr noalias [[TID_ADDR:%.*]], ptr noalias [[ZERO_ADDR:%.*]], ptr [[A_ADDR:%.*]]) #[[ATTR0]] {
2748 ; CHECK-NEXT: omp.par.entry:
2749 ; CHECK-NEXT: [[TID_ADDR_LOCAL:%.*]] = alloca i32, align 4
2750 ; CHECK-NEXT: [[TMP0:%.*]] = load i32, ptr [[TID_ADDR]], align 4
2751 ; CHECK-NEXT: store i32 [[TMP0]], ptr [[TID_ADDR_LOCAL]], align 4
2752 ; CHECK-NEXT: [[TID:%.*]] = load i32, ptr [[TID_ADDR_LOCAL]], align 4
2753 ; CHECK-NEXT: br label [[OMP_PAR_REGION:%.*]]
2754 ; CHECK: omp.par.outlined.exit.exitStub:
2755 ; CHECK-NEXT: ret void
2756 ; CHECK: omp.par.region:
2757 ; CHECK-NEXT: br label [[OMP_PAR_MERGED:%.*]]
2758 ; CHECK: omp.par.merged:
2759 ; CHECK-NEXT: call void @.omp_outlined.(ptr [[TID_ADDR]], ptr [[ZERO_ADDR]], ptr nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[A_ADDR]])
2760 ; CHECK-NEXT: [[OMP_GLOBAL_THREAD_NUM:%.*]] = call i32 @__kmpc_global_thread_num(ptr @[[GLOB1]])
2761 ; CHECK-NEXT: call void @__kmpc_barrier(ptr @[[GLOB2]], i32 [[OMP_GLOBAL_THREAD_NUM]])
2762 ; CHECK-NEXT: call void @.omp_outlined..1(ptr [[TID_ADDR]], ptr [[ZERO_ADDR]], ptr nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[A_ADDR]])
2763 ; CHECK-NEXT: br label [[ENTRY_SPLIT:%.*]]
2764 ; CHECK: entry.split:
2765 ; CHECK-NEXT: br label [[OMP_PAR_REGION_SPLIT:%.*]]
2766 ; CHECK: omp.par.region.split:
2767 ; CHECK-NEXT: br label [[OMP_PAR_PRE_FINALIZE:%.*]]
2768 ; CHECK: omp.par.pre_finalize:
2769 ; CHECK-NEXT: br label [[OMP_PAR_OUTLINED_EXIT_EXITSTUB:%.*]]
2770 ; CHECK-LABEL: define {{[^@]+}}@.omp_outlined.
2771 ; CHECK-SAME: (ptr noalias nocapture nofree readnone [[DOTGLOBAL_TID_:%.*]], ptr noalias nocapture nofree readnone [[DOTBOUND_TID_:%.*]], ptr nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[A:%.*]]) {
2772 ; CHECK-NEXT: entry:
2773 ; CHECK-NEXT: [[TMP0:%.*]] = load i32, ptr [[A]], align 4
2774 ; CHECK-NEXT: call void @use(i32 [[TMP0]])
2775 ; CHECK-NEXT: ret void
2776 ; CHECK-LABEL: define {{[^@]+}}@.omp_outlined..1
2777 ; CHECK-SAME: (ptr noalias nocapture nofree readnone [[DOTGLOBAL_TID_:%.*]], ptr noalias nocapture nofree readnone [[DOTBOUND_TID_:%.*]], ptr nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[A:%.*]]) {
2778 ; CHECK-NEXT: entry:
2779 ; CHECK-NEXT: [[TMP0:%.*]] = load i32, ptr [[A]], align 4
2780 ; CHECK-NEXT: call void @use(i32 [[TMP0]])
2781 ; CHECK-NEXT: ret void
2782 ; CHECK-LABEL: define {{[^@]+}}@unmergable_proc_bind
2783 ; CHECK-SAME: (i32 [[A:%.*]]) local_unnamed_addr {
2784 ; CHECK-NEXT: entry:
2785 ; CHECK-NEXT: [[A_ADDR:%.*]] = alloca i32, align 4
2786 ; CHECK-NEXT: [[TMP0:%.*]] = call i32 @__kmpc_global_thread_num(ptr noundef nonnull align 8 dereferenceable(24) @[[GLOB1]])
2787 ; CHECK-NEXT: store i32 [[A]], ptr [[A_ADDR]], align 4
2788 ; CHECK-NEXT: call void @__kmpc_push_proc_bind(ptr noundef nonnull align 8 dereferenceable(24) @[[GLOB1]], i32 [[TMP0]], i32 noundef 3)
2789 ; CHECK-NEXT: call void (ptr, i32, ptr, ...) @__kmpc_fork_call(ptr noundef nonnull align 8 dereferenceable(24) @[[GLOB1]], i32 noundef 1, ptr noundef @.omp_outlined..2, ptr nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[A_ADDR]])
2790 ; CHECK-NEXT: call void (ptr, i32, ptr, ...) @__kmpc_fork_call(ptr noundef nonnull align 8 dereferenceable(24) @[[GLOB1]], i32 noundef 1, ptr noundef @.omp_outlined..3, ptr nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[A_ADDR]])
2791 ; CHECK-NEXT: ret void
2792 ; CHECK-LABEL: define {{[^@]+}}@.omp_outlined..2
2793 ; CHECK-SAME: (ptr noalias nocapture nofree readnone [[DOTGLOBAL_TID_:%.*]], ptr noalias nocapture nofree readnone [[DOTBOUND_TID_:%.*]], ptr nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[A:%.*]]) {
2794 ; CHECK-NEXT: entry:
2795 ; CHECK-NEXT: [[TMP0:%.*]] = load i32, ptr [[A]], align 4
2796 ; CHECK-NEXT: call void @use(i32 [[TMP0]])
2797 ; CHECK-NEXT: ret void
2798 ; CHECK-LABEL: define {{[^@]+}}@.omp_outlined..3
2799 ; CHECK-SAME: (ptr noalias nocapture nofree readnone [[DOTGLOBAL_TID_:%.*]], ptr noalias nocapture nofree readnone [[DOTBOUND_TID_:%.*]], ptr nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[A:%.*]]) {
2800 ; CHECK-NEXT: entry:
2801 ; CHECK-NEXT: [[TMP0:%.*]] = load i32, ptr [[A]], align 4
2802 ; CHECK-NEXT: call void @use(i32 [[TMP0]])
2803 ; CHECK-NEXT: ret void
2804 ; CHECK-LABEL: define {{[^@]+}}@unmergable_num_threads
2805 ; CHECK-SAME: (i32 [[A:%.*]]) local_unnamed_addr {
2806 ; CHECK-NEXT: entry:
2807 ; CHECK-NEXT: [[A_ADDR:%.*]] = alloca i32, align 4
2808 ; CHECK-NEXT: [[TMP0:%.*]] = call i32 @__kmpc_global_thread_num(ptr noundef nonnull align 8 dereferenceable(24) @[[GLOB1]])
2809 ; CHECK-NEXT: store i32 [[A]], ptr [[A_ADDR]], align 4
2810 ; CHECK-NEXT: call void @__kmpc_push_num_threads(ptr noundef nonnull align 8 dereferenceable(24) @[[GLOB1]], i32 [[TMP0]], i32 [[A]])
2811 ; CHECK-NEXT: call void (ptr, i32, ptr, ...) @__kmpc_fork_call(ptr noundef nonnull align 8 dereferenceable(24) @[[GLOB1]], i32 noundef 1, ptr noundef @.omp_outlined..4, ptr nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[A_ADDR]])
2812 ; CHECK-NEXT: call void (ptr, i32, ptr, ...) @__kmpc_fork_call(ptr noundef nonnull align 8 dereferenceable(24) @[[GLOB1]], i32 noundef 1, ptr noundef @.omp_outlined..5, ptr nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[A_ADDR]])
2813 ; CHECK-NEXT: ret void
2814 ; CHECK-LABEL: define {{[^@]+}}@.omp_outlined..4
2815 ; CHECK-SAME: (ptr noalias nocapture nofree readnone [[DOTGLOBAL_TID_:%.*]], ptr noalias nocapture nofree readnone [[DOTBOUND_TID_:%.*]], ptr nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[A:%.*]]) {
2816 ; CHECK-NEXT: entry:
2817 ; CHECK-NEXT: [[TMP0:%.*]] = load i32, ptr [[A]], align 4
2818 ; CHECK-NEXT: call void @use(i32 [[TMP0]])
2819 ; CHECK-NEXT: ret void
2820 ; CHECK-LABEL: define {{[^@]+}}@.omp_outlined..5
2821 ; CHECK-SAME: (ptr noalias nocapture nofree readnone [[DOTGLOBAL_TID_:%.*]], ptr noalias nocapture nofree readnone [[DOTBOUND_TID_:%.*]], ptr nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[A:%.*]]) {
2822 ; CHECK-NEXT: entry:
2823 ; CHECK-NEXT: [[TMP0:%.*]] = load i32, ptr [[A]], align 4
2824 ; CHECK-NEXT: call void @use(i32 [[TMP0]])
2825 ; CHECK-NEXT: ret void
2826 ; CHECK-LABEL: define {{[^@]+}}@unmergable_seq_call
2827 ; CHECK-SAME: (i32 [[A:%.*]]) local_unnamed_addr {
2828 ; CHECK-NEXT: entry:
2829 ; CHECK-NEXT: [[A_ADDR:%.*]] = alloca i32, align 4
2830 ; CHECK-NEXT: store i32 [[A]], ptr [[A_ADDR]], align 4
2831 ; CHECK-NEXT: call void (ptr, i32, ptr, ...) @__kmpc_fork_call(ptr noundef nonnull align 8 dereferenceable(24) @[[GLOB1]], i32 noundef 1, ptr noundef @.omp_outlined..6, ptr nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[A_ADDR]])
2832 ; CHECK-NEXT: call void (...) @foo()
2833 ; CHECK-NEXT: call void (ptr, i32, ptr, ...) @__kmpc_fork_call(ptr noundef nonnull align 8 dereferenceable(24) @[[GLOB1]], i32 noundef 1, ptr noundef @.omp_outlined..7, ptr nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[A_ADDR]])
2834 ; CHECK-NEXT: ret void
2835 ; CHECK-LABEL: define {{[^@]+}}@.omp_outlined..6
2836 ; CHECK-SAME: (ptr noalias nocapture nofree readnone [[DOTGLOBAL_TID_:%.*]], ptr noalias nocapture nofree readnone [[DOTBOUND_TID_:%.*]], ptr nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[A:%.*]]) {
2837 ; CHECK-NEXT: entry:
2838 ; CHECK-NEXT: [[TMP0:%.*]] = load i32, ptr [[A]], align 4
2839 ; CHECK-NEXT: call void @use(i32 [[TMP0]])
2840 ; CHECK-NEXT: ret void
2841 ; CHECK-LABEL: define {{[^@]+}}@.omp_outlined..7
2842 ; CHECK-SAME: (ptr noalias nocapture nofree readnone [[DOTGLOBAL_TID_:%.*]], ptr noalias nocapture nofree readnone [[DOTBOUND_TID_:%.*]], ptr nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[A:%.*]]) {
2843 ; CHECK-NEXT: entry:
2844 ; CHECK-NEXT: [[TMP0:%.*]] = load i32, ptr [[A]], align 4
2845 ; CHECK-NEXT: call void @use(i32 [[TMP0]])
2846 ; CHECK-NEXT: ret void
2847 ; CHECK-LABEL: define {{[^@]+}}@merge_seq
2848 ; CHECK-SAME: (i32 [[A:%.*]]) local_unnamed_addr {
2849 ; CHECK-NEXT: entry:
2850 ; CHECK-NEXT: [[A_ADDR:%.*]] = alloca i32, align 4
2851 ; CHECK-NEXT: store i32 [[A]], ptr [[A_ADDR]], align 4
2852 ; CHECK-NEXT: [[OMP_GLOBAL_THREAD_NUM2:%.*]] = call i32 @__kmpc_global_thread_num(ptr @[[GLOB1]])
2853 ; CHECK-NEXT: br label [[OMP_PARALLEL:%.*]]
2854 ; CHECK: omp_parallel:
2855 ; CHECK-NEXT: call void (ptr, i32, ptr, ...) @__kmpc_fork_call(ptr @[[GLOB1]], i32 1, ptr @merge_seq..omp_par, ptr [[A_ADDR]])
2856 ; CHECK-NEXT: br label [[OMP_PAR_OUTLINED_EXIT:%.*]]
2857 ; CHECK: omp.par.outlined.exit:
2858 ; CHECK-NEXT: br label [[OMP_PAR_EXIT_SPLIT:%.*]]
2859 ; CHECK: omp.par.exit.split:
2860 ; CHECK-NEXT: br label [[ENTRY_SPLIT_SPLIT:%.*]]
2861 ; CHECK: entry.split.split:
2862 ; CHECK-NEXT: [[TMP0:%.*]] = load i32, ptr [[A_ADDR]], align 4
2863 ; CHECK-NEXT: call void @use(i32 [[TMP0]])
2864 ; CHECK-NEXT: ret void
2865 ; CHECK-LABEL: define {{[^@]+}}@merge_seq..omp_par
2866 ; CHECK-SAME: (ptr noalias [[TID_ADDR:%.*]], ptr noalias [[ZERO_ADDR:%.*]], ptr [[A_ADDR:%.*]]) #[[ATTR0]] {
2867 ; CHECK-NEXT: omp.par.entry:
2868 ; CHECK-NEXT: [[TID_ADDR_LOCAL:%.*]] = alloca i32, align 4
2869 ; CHECK-NEXT: [[TMP0:%.*]] = load i32, ptr [[TID_ADDR]], align 4
2870 ; CHECK-NEXT: store i32 [[TMP0]], ptr [[TID_ADDR_LOCAL]], align 4
2871 ; CHECK-NEXT: [[TID:%.*]] = load i32, ptr [[TID_ADDR_LOCAL]], align 4
2872 ; CHECK-NEXT: br label [[OMP_PAR_REGION:%.*]]
2873 ; CHECK: omp.par.outlined.exit.exitStub:
2874 ; CHECK-NEXT: ret void
2875 ; CHECK: omp.par.region:
2876 ; CHECK-NEXT: br label [[OMP_PAR_MERGED:%.*]]
2877 ; CHECK: omp.par.merged:
2878 ; CHECK-NEXT: call void @.omp_outlined..8(ptr [[TID_ADDR]], ptr [[ZERO_ADDR]], ptr nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[A_ADDR]])
2879 ; CHECK-NEXT: [[OMP_GLOBAL_THREAD_NUM2:%.*]] = call i32 @__kmpc_global_thread_num(ptr @[[GLOB1]])
2880 ; CHECK-NEXT: call void @__kmpc_barrier(ptr @[[GLOB2]], i32 [[OMP_GLOBAL_THREAD_NUM2]])
2881 ; CHECK-NEXT: [[OMP_GLOBAL_THREAD_NUM:%.*]] = call i32 @__kmpc_global_thread_num(ptr @[[GLOB1]])
2882 ; CHECK-NEXT: [[TMP1:%.*]] = call i32 @__kmpc_master(ptr @[[GLOB1]], i32 [[OMP_GLOBAL_THREAD_NUM]])
2883 ; CHECK-NEXT: [[TMP2:%.*]] = icmp ne i32 [[TMP1]], 0
2884 ; CHECK-NEXT: br i1 [[TMP2]], label [[OMP_REGION_BODY:%.*]], label [[OMP_REGION_END:%.*]]
2885 ; CHECK: omp_region.end:
2886 ; CHECK-NEXT: [[OMP_GLOBAL_THREAD_NUM1:%.*]] = call i32 @__kmpc_global_thread_num(ptr @[[GLOB1]])
2887 ; CHECK-NEXT: call void @__kmpc_barrier(ptr @[[GLOB2]], i32 [[OMP_GLOBAL_THREAD_NUM1]])
2888 ; CHECK-NEXT: br label [[OMP_PAR_MERGED_SPLIT_SPLIT:%.*]]
2889 ; CHECK: omp.par.merged.split.split:
2890 ; CHECK-NEXT: call void @.omp_outlined..9(ptr [[TID_ADDR]], ptr [[ZERO_ADDR]], ptr nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[A_ADDR]])
2891 ; CHECK-NEXT: br label [[ENTRY_SPLIT:%.*]]
2892 ; CHECK: entry.split:
2893 ; CHECK-NEXT: br label [[OMP_PAR_REGION_SPLIT:%.*]]
2894 ; CHECK: omp.par.region.split:
2895 ; CHECK-NEXT: br label [[OMP_PAR_PRE_FINALIZE:%.*]]
2896 ; CHECK: omp.par.pre_finalize:
2897 ; CHECK-NEXT: br label [[OMP_PAR_OUTLINED_EXIT_EXITSTUB:%.*]]
2898 ; CHECK: omp_region.body:
2899 ; CHECK-NEXT: br label [[SEQ_PAR_MERGED:%.*]]
2900 ; CHECK: seq.par.merged:
2901 ; CHECK-NEXT: [[TMP3:%.*]] = load i32, ptr [[A_ADDR]], align 4
2902 ; CHECK-NEXT: [[ADD:%.*]] = add nsw i32 [[TMP3]], 1
2903 ; CHECK-NEXT: store i32 [[ADD]], ptr [[A_ADDR]], align 4
2904 ; CHECK-NEXT: br label [[OMP_PAR_MERGED_SPLIT:%.*]]
2905 ; CHECK: omp.par.merged.split:
2906 ; CHECK-NEXT: br label [[OMP_REGION_BODY_SPLIT:%.*]]
2907 ; CHECK: omp_region.body.split:
2908 ; CHECK-NEXT: call void @__kmpc_end_master(ptr @[[GLOB1]], i32 [[OMP_GLOBAL_THREAD_NUM]])
2909 ; CHECK-NEXT: br label [[OMP_REGION_END]]
2910 ; CHECK-LABEL: define {{[^@]+}}@.omp_outlined..8
2911 ; CHECK-SAME: (ptr noalias nocapture nofree readnone [[DOTGLOBAL_TID_:%.*]], ptr noalias nocapture nofree readnone [[DOTBOUND_TID_:%.*]], ptr nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[A:%.*]]) {
2912 ; CHECK-NEXT: entry:
2913 ; CHECK-NEXT: [[TMP0:%.*]] = load i32, ptr [[A]], align 4
2914 ; CHECK-NEXT: call void @use(i32 [[TMP0]])
2915 ; CHECK-NEXT: ret void
2916 ; CHECK-LABEL: define {{[^@]+}}@.omp_outlined..9
2917 ; CHECK-SAME: (ptr noalias nocapture nofree readnone [[DOTGLOBAL_TID_:%.*]], ptr noalias nocapture nofree readnone [[DOTBOUND_TID_:%.*]], ptr nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[A:%.*]]) {
2918 ; CHECK-NEXT: entry:
2919 ; CHECK-NEXT: [[TMP0:%.*]] = load i32, ptr [[A]], align 4
2920 ; CHECK-NEXT: call void @use(i32 [[TMP0]])
2921 ; CHECK-NEXT: ret void
2922 ; CHECK-LABEL: define {{[^@]+}}@merge_seq_float
2923 ; CHECK-SAME: (float [[F:%.*]], ptr nocapture nofree writeonly [[P:%.*]]) local_unnamed_addr {
2924 ; CHECK-NEXT: entry:
2925 ; CHECK-NEXT: [[F_ADDR:%.*]] = alloca float, align 4
2926 ; CHECK-NEXT: store float [[F]], ptr [[F_ADDR]], align 4
2927 ; CHECK-NEXT: [[OMP_GLOBAL_THREAD_NUM2:%.*]] = call i32 @__kmpc_global_thread_num(ptr @[[GLOB1]])
2928 ; CHECK-NEXT: br label [[OMP_PARALLEL:%.*]]
2929 ; CHECK: omp_parallel:
2930 ; CHECK-NEXT: call void (ptr, i32, ptr, ...) @__kmpc_fork_call(ptr @[[GLOB1]], i32 2, ptr @merge_seq_float..omp_par, ptr [[F_ADDR]], ptr [[P]])
2931 ; CHECK-NEXT: br label [[OMP_PAR_OUTLINED_EXIT:%.*]]
2932 ; CHECK: omp.par.outlined.exit:
2933 ; CHECK-NEXT: br label [[OMP_PAR_EXIT_SPLIT:%.*]]
2934 ; CHECK: omp.par.exit.split:
2935 ; CHECK-NEXT: br label [[ENTRY_SPLIT_SPLIT:%.*]]
2936 ; CHECK: entry.split.split:
2937 ; CHECK-NEXT: ret void
2938 ; CHECK-LABEL: define {{[^@]+}}@merge_seq_float..omp_par
2939 ; CHECK-SAME: (ptr noalias [[TID_ADDR:%.*]], ptr noalias [[ZERO_ADDR:%.*]], ptr [[F_ADDR:%.*]], ptr [[P:%.*]]) #[[ATTR0]] {
2940 ; CHECK-NEXT: omp.par.entry:
2941 ; CHECK-NEXT: [[TID_ADDR_LOCAL:%.*]] = alloca i32, align 4
2942 ; CHECK-NEXT: [[TMP0:%.*]] = load i32, ptr [[TID_ADDR]], align 4
2943 ; CHECK-NEXT: store i32 [[TMP0]], ptr [[TID_ADDR_LOCAL]], align 4
2944 ; CHECK-NEXT: [[TID:%.*]] = load i32, ptr [[TID_ADDR_LOCAL]], align 4
2945 ; CHECK-NEXT: br label [[OMP_PAR_REGION:%.*]]
2946 ; CHECK: omp.par.outlined.exit.exitStub:
2947 ; CHECK-NEXT: ret void
2948 ; CHECK: omp.par.region:
2949 ; CHECK-NEXT: br label [[OMP_PAR_MERGED:%.*]]
2950 ; CHECK: omp.par.merged:
2951 ; CHECK-NEXT: call void @.omp_outlined..10(ptr [[TID_ADDR]], ptr [[ZERO_ADDR]], ptr nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[F_ADDR]])
2952 ; CHECK-NEXT: [[OMP_GLOBAL_THREAD_NUM2:%.*]] = call i32 @__kmpc_global_thread_num(ptr @[[GLOB1]])
2953 ; CHECK-NEXT: call void @__kmpc_barrier(ptr @[[GLOB2]], i32 [[OMP_GLOBAL_THREAD_NUM2]])
2954 ; CHECK-NEXT: [[OMP_GLOBAL_THREAD_NUM:%.*]] = call i32 @__kmpc_global_thread_num(ptr @[[GLOB1]])
2955 ; CHECK-NEXT: [[TMP1:%.*]] = call i32 @__kmpc_master(ptr @[[GLOB1]], i32 [[OMP_GLOBAL_THREAD_NUM]])
2956 ; CHECK-NEXT: [[TMP2:%.*]] = icmp ne i32 [[TMP1]], 0
2957 ; CHECK-NEXT: br i1 [[TMP2]], label [[OMP_REGION_BODY:%.*]], label [[OMP_REGION_END:%.*]]
2958 ; CHECK: omp_region.end:
2959 ; CHECK-NEXT: [[OMP_GLOBAL_THREAD_NUM1:%.*]] = call i32 @__kmpc_global_thread_num(ptr @[[GLOB1]])
2960 ; CHECK-NEXT: call void @__kmpc_barrier(ptr @[[GLOB2]], i32 [[OMP_GLOBAL_THREAD_NUM1]])
2961 ; CHECK-NEXT: br label [[OMP_PAR_MERGED_SPLIT_SPLIT:%.*]]
2962 ; CHECK: omp.par.merged.split.split:
2963 ; CHECK-NEXT: call void @.omp_outlined..11(ptr [[TID_ADDR]], ptr [[ZERO_ADDR]], ptr nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[F_ADDR]])
2964 ; CHECK-NEXT: br label [[ENTRY_SPLIT:%.*]]
2965 ; CHECK: entry.split:
2966 ; CHECK-NEXT: br label [[OMP_PAR_REGION_SPLIT:%.*]]
2967 ; CHECK: omp.par.region.split:
2968 ; CHECK-NEXT: br label [[OMP_PAR_PRE_FINALIZE:%.*]]
2969 ; CHECK: omp.par.pre_finalize:
2970 ; CHECK-NEXT: br label [[OMP_PAR_OUTLINED_EXIT_EXITSTUB:%.*]]
2971 ; CHECK: omp_region.body:
2972 ; CHECK-NEXT: br label [[SEQ_PAR_MERGED:%.*]]
2973 ; CHECK: seq.par.merged:
2974 ; CHECK-NEXT: [[TMP3:%.*]] = load float, ptr [[F_ADDR]], align 4
2975 ; CHECK-NEXT: [[ADD:%.*]] = fadd float [[TMP3]], 0x40091EB860000000
2976 ; CHECK-NEXT: store float [[ADD]], ptr [[P]], align 4
2977 ; CHECK-NEXT: br label [[OMP_PAR_MERGED_SPLIT:%.*]]
2978 ; CHECK: omp.par.merged.split:
2979 ; CHECK-NEXT: br label [[OMP_REGION_BODY_SPLIT:%.*]]
2980 ; CHECK: omp_region.body.split:
2981 ; CHECK-NEXT: call void @__kmpc_end_master(ptr @[[GLOB1]], i32 [[OMP_GLOBAL_THREAD_NUM]])
2982 ; CHECK-NEXT: br label [[OMP_REGION_END]]
2983 ; CHECK-LABEL: define {{[^@]+}}@.omp_outlined..10
2984 ; CHECK-SAME: (ptr noalias nocapture nofree readnone [[DOTGLOBAL_TID_:%.*]], ptr noalias nocapture nofree readnone [[DOTBOUND_TID_:%.*]], ptr nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[F:%.*]]) {
2985 ; CHECK-NEXT: entry:
2986 ; CHECK-NEXT: [[TMP0:%.*]] = load float, ptr [[F]], align 4
2987 ; CHECK-NEXT: [[CONV:%.*]] = fptosi float [[TMP0]] to i32
2988 ; CHECK-NEXT: call void @use(i32 [[CONV]])
2989 ; CHECK-NEXT: ret void
2990 ; CHECK-LABEL: define {{[^@]+}}@.omp_outlined..11
2991 ; CHECK-SAME: (ptr noalias nocapture nofree readnone [[DOTGLOBAL_TID_:%.*]], ptr noalias nocapture nofree readnone [[DOTBOUND_TID_:%.*]], ptr nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[F:%.*]]) {
2992 ; CHECK-NEXT: entry:
2993 ; CHECK-NEXT: [[TMP0:%.*]] = load float, ptr [[F]], align 4
2994 ; CHECK-NEXT: [[CONV:%.*]] = fptosi float [[TMP0]] to i32
2995 ; CHECK-NEXT: call void @use(i32 [[CONV]])
2996 ; CHECK-NEXT: ret void
2997 ; CHECK-LABEL: define {{[^@]+}}@merge_seq_firstprivate
2998 ; CHECK-SAME: (i32 [[A:%.*]]) local_unnamed_addr {
2999 ; CHECK-NEXT: entry:
3000 ; CHECK-NEXT: [[A_CASTED_SROA_0_0_INSERT_EXT_SEQ_OUTPUT_ALLOC:%.*]] = alloca i64, align 8
3001 ; CHECK-NEXT: [[A_ADDR:%.*]] = alloca i32, align 4
3002 ; CHECK-NEXT: store i32 [[A]], ptr [[A_ADDR]], align 4
3003 ; CHECK-NEXT: [[OMP_GLOBAL_THREAD_NUM2:%.*]] = call i32 @__kmpc_global_thread_num(ptr @[[GLOB1]])
3004 ; CHECK-NEXT: br label [[OMP_PARALLEL:%.*]]
3005 ; CHECK: omp_parallel:
3006 ; CHECK-NEXT: call void (ptr, i32, ptr, ...) @__kmpc_fork_call(ptr @[[GLOB1]], i32 2, ptr @merge_seq_firstprivate..omp_par, ptr [[A_ADDR]], ptr [[A_CASTED_SROA_0_0_INSERT_EXT_SEQ_OUTPUT_ALLOC]])
3007 ; CHECK-NEXT: br label [[OMP_PAR_OUTLINED_EXIT:%.*]]
3008 ; CHECK: omp.par.outlined.exit:
3009 ; CHECK-NEXT: br label [[OMP_PAR_EXIT_SPLIT:%.*]]
3010 ; CHECK: omp.par.exit.split:
3011 ; CHECK-NEXT: br label [[ENTRY_SPLIT_SPLIT:%.*]]
3012 ; CHECK: entry.split.split:
3013 ; CHECK-NEXT: [[TMP0:%.*]] = load i32, ptr [[A_ADDR]], align 4
3014 ; CHECK-NEXT: call void @use(i32 [[TMP0]])
3015 ; CHECK-NEXT: ret void
3016 ; CHECK-LABEL: define {{[^@]+}}@merge_seq_firstprivate..omp_par
3017 ; CHECK-SAME: (ptr noalias [[TID_ADDR:%.*]], ptr noalias [[ZERO_ADDR:%.*]], ptr [[A_ADDR:%.*]], ptr [[A_CASTED_SROA_0_0_INSERT_EXT_SEQ_OUTPUT_ALLOC:%.*]]) #[[ATTR0]] {
3018 ; CHECK-NEXT: omp.par.entry:
3019 ; CHECK-NEXT: [[TID_ADDR_LOCAL:%.*]] = alloca i32, align 4
3020 ; CHECK-NEXT: [[TMP0:%.*]] = load i32, ptr [[TID_ADDR]], align 4
3021 ; CHECK-NEXT: store i32 [[TMP0]], ptr [[TID_ADDR_LOCAL]], align 4
3022 ; CHECK-NEXT: [[TID:%.*]] = load i32, ptr [[TID_ADDR_LOCAL]], align 4
3023 ; CHECK-NEXT: br label [[OMP_PAR_REGION:%.*]]
3024 ; CHECK: omp.par.outlined.exit.exitStub:
3025 ; CHECK-NEXT: ret void
3026 ; CHECK: omp.par.region:
3027 ; CHECK-NEXT: br label [[OMP_PAR_MERGED:%.*]]
3028 ; CHECK: omp.par.merged:
3029 ; CHECK-NEXT: call void @.omp_outlined..12(ptr [[TID_ADDR]], ptr [[ZERO_ADDR]], ptr nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[A_ADDR]])
3030 ; CHECK-NEXT: [[OMP_GLOBAL_THREAD_NUM2:%.*]] = call i32 @__kmpc_global_thread_num(ptr @[[GLOB1]])
3031 ; CHECK-NEXT: call void @__kmpc_barrier(ptr @[[GLOB2]], i32 [[OMP_GLOBAL_THREAD_NUM2]])
3032 ; CHECK-NEXT: [[OMP_GLOBAL_THREAD_NUM:%.*]] = call i32 @__kmpc_global_thread_num(ptr @[[GLOB1]])
3033 ; CHECK-NEXT: [[TMP1:%.*]] = call i32 @__kmpc_master(ptr @[[GLOB1]], i32 [[OMP_GLOBAL_THREAD_NUM]])
3034 ; CHECK-NEXT: [[TMP2:%.*]] = icmp ne i32 [[TMP1]], 0
3035 ; CHECK-NEXT: br i1 [[TMP2]], label [[OMP_REGION_BODY:%.*]], label [[OMP_REGION_END:%.*]]
3036 ; CHECK: omp_region.end:
3037 ; CHECK-NEXT: [[OMP_GLOBAL_THREAD_NUM1:%.*]] = call i32 @__kmpc_global_thread_num(ptr @[[GLOB1]])
3038 ; CHECK-NEXT: call void @__kmpc_barrier(ptr @[[GLOB2]], i32 [[OMP_GLOBAL_THREAD_NUM1]])
3039 ; CHECK-NEXT: br label [[OMP_PAR_MERGED_SPLIT_SPLIT:%.*]]
3040 ; CHECK: omp.par.merged.split.split:
3041 ; CHECK-NEXT: [[A_CASTED_SROA_0_0_INSERT_EXT_SEQ_OUTPUT_LOAD:%.*]] = load i64, ptr [[A_CASTED_SROA_0_0_INSERT_EXT_SEQ_OUTPUT_ALLOC]], align 8
3042 ; CHECK-NEXT: call void @.omp_outlined..13(ptr [[TID_ADDR]], ptr [[ZERO_ADDR]], i64 [[A_CASTED_SROA_0_0_INSERT_EXT_SEQ_OUTPUT_LOAD]])
3043 ; CHECK-NEXT: br label [[ENTRY_SPLIT:%.*]]
3044 ; CHECK: entry.split:
3045 ; CHECK-NEXT: br label [[OMP_PAR_REGION_SPLIT:%.*]]
3046 ; CHECK: omp.par.region.split:
3047 ; CHECK-NEXT: br label [[OMP_PAR_PRE_FINALIZE:%.*]]
3048 ; CHECK: omp.par.pre_finalize:
3049 ; CHECK-NEXT: br label [[OMP_PAR_OUTLINED_EXIT_EXITSTUB:%.*]]
3050 ; CHECK: omp_region.body:
3051 ; CHECK-NEXT: br label [[SEQ_PAR_MERGED:%.*]]
3052 ; CHECK: seq.par.merged:
3053 ; CHECK-NEXT: [[TMP3:%.*]] = load i32, ptr [[A_ADDR]], align 4
3054 ; CHECK-NEXT: [[ADD:%.*]] = add nsw i32 [[TMP3]], 1
3055 ; CHECK-NEXT: store i32 [[ADD]], ptr [[A_ADDR]], align 4
3056 ; CHECK-NEXT: [[A_CASTED_SROA_0_0_INSERT_EXT:%.*]] = zext i32 [[ADD]] to i64
3057 ; CHECK-NEXT: store i64 [[A_CASTED_SROA_0_0_INSERT_EXT]], ptr [[A_CASTED_SROA_0_0_INSERT_EXT_SEQ_OUTPUT_ALLOC]], align 8
3058 ; CHECK-NEXT: br label [[OMP_PAR_MERGED_SPLIT:%.*]]
3059 ; CHECK: omp.par.merged.split:
3060 ; CHECK-NEXT: br label [[OMP_REGION_BODY_SPLIT:%.*]]
3061 ; CHECK: omp_region.body.split:
3062 ; CHECK-NEXT: call void @__kmpc_end_master(ptr @[[GLOB1]], i32 [[OMP_GLOBAL_THREAD_NUM]])
3063 ; CHECK-NEXT: br label [[OMP_REGION_END]]
3064 ; CHECK-LABEL: define {{[^@]+}}@.omp_outlined..12
3065 ; CHECK-SAME: (ptr noalias nocapture nofree readnone [[DOTGLOBAL_TID_:%.*]], ptr noalias nocapture nofree readnone [[DOTBOUND_TID_:%.*]], ptr nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[A:%.*]]) {
3066 ; CHECK-NEXT: entry:
3067 ; CHECK-NEXT: [[TMP0:%.*]] = load i32, ptr [[A]], align 4
3068 ; CHECK-NEXT: call void @use(i32 [[TMP0]])
3069 ; CHECK-NEXT: ret void
3070 ; CHECK-LABEL: define {{[^@]+}}@.omp_outlined..13
3071 ; CHECK-SAME: (ptr noalias nocapture nofree readnone [[DOTGLOBAL_TID_:%.*]], ptr noalias nocapture nofree readnone [[DOTBOUND_TID_:%.*]], i64 [[A:%.*]]) {
3072 ; CHECK-NEXT: entry:
3073 ; CHECK-NEXT: [[A_ADDR_SROA_0_0_EXTRACT_TRUNC:%.*]] = trunc i64 [[A]] to i32
3074 ; CHECK-NEXT: call void @use(i32 [[A_ADDR_SROA_0_0_EXTRACT_TRUNC]])
3075 ; CHECK-NEXT: ret void
3076 ; CHECK-LABEL: define {{[^@]+}}@merge_seq_sink_lt
3077 ; CHECK-SAME: (i32 [[A:%.*]]) local_unnamed_addr {
3078 ; CHECK-NEXT: entry:
3079 ; CHECK-NEXT: [[A_ADDR:%.*]] = alloca i32, align 4
3080 ; CHECK-NEXT: store i32 [[A]], ptr [[A_ADDR]], align 4
3081 ; CHECK-NEXT: [[OMP_GLOBAL_THREAD_NUM2:%.*]] = call i32 @__kmpc_global_thread_num(ptr @[[GLOB1]])
3082 ; CHECK-NEXT: br label [[OMP_PARALLEL:%.*]]
3083 ; CHECK: omp_parallel:
3084 ; CHECK-NEXT: call void (ptr, i32, ptr, ...) @__kmpc_fork_call(ptr @[[GLOB1]], i32 1, ptr @merge_seq_sink_lt..omp_par, ptr [[A_ADDR]])
3085 ; CHECK-NEXT: br label [[OMP_PAR_OUTLINED_EXIT:%.*]]
3086 ; CHECK: omp.par.outlined.exit:
3087 ; CHECK-NEXT: br label [[OMP_PAR_EXIT_SPLIT:%.*]]
3088 ; CHECK: omp.par.exit.split:
3089 ; CHECK-NEXT: br label [[ENTRY_SPLIT_SPLIT:%.*]]
3090 ; CHECK: entry.split.split:
3091 ; CHECK-NEXT: ret void
3092 ; CHECK-LABEL: define {{[^@]+}}@merge_seq_sink_lt..omp_par
3093 ; CHECK-SAME: (ptr noalias [[TID_ADDR:%.*]], ptr noalias [[ZERO_ADDR:%.*]], ptr [[A_ADDR:%.*]]) #[[ATTR0]] {
3094 ; CHECK-NEXT: omp.par.entry:
3095 ; CHECK-NEXT: [[B:%.*]] = alloca i32, align 4
3096 ; CHECK-NEXT: [[TID_ADDR_LOCAL:%.*]] = alloca i32, align 4
3097 ; CHECK-NEXT: [[TMP0:%.*]] = load i32, ptr [[TID_ADDR]], align 4
3098 ; CHECK-NEXT: store i32 [[TMP0]], ptr [[TID_ADDR_LOCAL]], align 4
3099 ; CHECK-NEXT: [[TID:%.*]] = load i32, ptr [[TID_ADDR_LOCAL]], align 4
3100 ; CHECK-NEXT: br label [[OMP_PAR_REGION:%.*]]
3101 ; CHECK: omp.par.outlined.exit.exitStub:
3102 ; CHECK-NEXT: ret void
3103 ; CHECK: omp.par.region:
3104 ; CHECK-NEXT: br label [[OMP_PAR_MERGED:%.*]]
3105 ; CHECK: omp.par.merged:
3106 ; CHECK-NEXT: call void @.omp_outlined..14(ptr [[TID_ADDR]], ptr [[ZERO_ADDR]], ptr nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[A_ADDR]])
3107 ; CHECK-NEXT: [[OMP_GLOBAL_THREAD_NUM2:%.*]] = call i32 @__kmpc_global_thread_num(ptr @[[GLOB1]])
3108 ; CHECK-NEXT: call void @__kmpc_barrier(ptr @[[GLOB2]], i32 [[OMP_GLOBAL_THREAD_NUM2]])
3109 ; CHECK-NEXT: [[OMP_GLOBAL_THREAD_NUM:%.*]] = call i32 @__kmpc_global_thread_num(ptr @[[GLOB1]])
3110 ; CHECK-NEXT: [[TMP1:%.*]] = call i32 @__kmpc_master(ptr @[[GLOB1]], i32 [[OMP_GLOBAL_THREAD_NUM]])
3111 ; CHECK-NEXT: [[TMP2:%.*]] = icmp ne i32 [[TMP1]], 0
3112 ; CHECK-NEXT: br i1 [[TMP2]], label [[OMP_REGION_BODY:%.*]], label [[OMP_REGION_END:%.*]]
3113 ; CHECK: omp_region.end:
3114 ; CHECK-NEXT: [[OMP_GLOBAL_THREAD_NUM1:%.*]] = call i32 @__kmpc_global_thread_num(ptr @[[GLOB1]])
3115 ; CHECK-NEXT: call void @__kmpc_barrier(ptr @[[GLOB2]], i32 [[OMP_GLOBAL_THREAD_NUM1]])
3116 ; CHECK-NEXT: br label [[OMP_PAR_MERGED_SPLIT_SPLIT:%.*]]
3117 ; CHECK: omp.par.merged.split.split:
3118 ; CHECK-NEXT: call void @.omp_outlined..15(ptr [[TID_ADDR]], ptr [[ZERO_ADDR]], ptr nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[A_ADDR]])
3119 ; CHECK-NEXT: br label [[ENTRY_SPLIT:%.*]]
3120 ; CHECK: entry.split:
3121 ; CHECK-NEXT: br label [[OMP_PAR_REGION_SPLIT:%.*]]
3122 ; CHECK: omp.par.region.split:
3123 ; CHECK-NEXT: br label [[OMP_PAR_PRE_FINALIZE:%.*]]
3124 ; CHECK: omp.par.pre_finalize:
3125 ; CHECK-NEXT: br label [[OMP_PAR_OUTLINED_EXIT_EXITSTUB:%.*]]
3126 ; CHECK: omp_region.body:
3127 ; CHECK-NEXT: br label [[SEQ_PAR_MERGED:%.*]]
3128 ; CHECK: seq.par.merged:
3129 ; CHECK-NEXT: call void @llvm.lifetime.start.p0(i64 noundef 4, ptr noundef nonnull [[B]])
3130 ; CHECK-NEXT: [[TMP4:%.*]] = ptrtoint ptr [[B]] to i64
3131 ; CHECK-NEXT: [[TMP5:%.*]] = trunc i64 [[TMP4]] to i32
3132 ; CHECK-NEXT: store i32 [[TMP5]], ptr [[B]], align 4
3133 ; CHECK-NEXT: call void @llvm.lifetime.end.p0(i64 noundef 4, ptr noundef nonnull [[B]])
3134 ; CHECK-NEXT: br label [[OMP_PAR_MERGED_SPLIT:%.*]]
3135 ; CHECK: omp.par.merged.split:
3136 ; CHECK-NEXT: br label [[OMP_REGION_BODY_SPLIT:%.*]]
3137 ; CHECK: omp_region.body.split:
3138 ; CHECK-NEXT: call void @__kmpc_end_master(ptr @[[GLOB1]], i32 [[OMP_GLOBAL_THREAD_NUM]])
3139 ; CHECK-NEXT: br label [[OMP_REGION_END]]
3140 ; CHECK-LABEL: define {{[^@]+}}@.omp_outlined..14
3141 ; CHECK-SAME: (ptr noalias nocapture nofree readnone [[DOTGLOBAL_TID_:%.*]], ptr noalias nocapture nofree readnone [[DOTBOUND_TID_:%.*]], ptr nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[A:%.*]]) {
3142 ; CHECK-NEXT: entry:
3143 ; CHECK-NEXT: [[TMP0:%.*]] = load i32, ptr [[A]], align 4
3144 ; CHECK-NEXT: call void @use(i32 [[TMP0]])
3145 ; CHECK-NEXT: ret void
3146 ; CHECK-LABEL: define {{[^@]+}}@.omp_outlined..15
3147 ; CHECK-SAME: (ptr noalias nocapture nofree readnone [[DOTGLOBAL_TID_:%.*]], ptr noalias nocapture nofree readnone [[DOTBOUND_TID_:%.*]], ptr nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[A:%.*]]) {
3148 ; CHECK-NEXT: entry:
3149 ; CHECK-NEXT: [[TMP0:%.*]] = load i32, ptr [[A]], align 4
3150 ; CHECK-NEXT: call void @use(i32 [[TMP0]])
3151 ; CHECK-NEXT: ret void
3152 ; CHECK-LABEL: define {{[^@]+}}@merge_seq_par_use
3153 ; CHECK-SAME: (i32 [[A:%.*]]) local_unnamed_addr {
3154 ; CHECK-NEXT: entry:
3155 ; CHECK-NEXT: [[A_ADDR:%.*]] = alloca i32, align 4
3156 ; CHECK-NEXT: [[B:%.*]] = alloca i32, align 4
3157 ; CHECK-NEXT: store i32 [[A]], ptr [[A_ADDR]], align 4
3158 ; CHECK-NEXT: [[OMP_GLOBAL_THREAD_NUM2:%.*]] = call i32 @__kmpc_global_thread_num(ptr @[[GLOB1]])
3159 ; CHECK-NEXT: br label [[OMP_PARALLEL:%.*]]
3160 ; CHECK: omp_parallel:
3161 ; CHECK-NEXT: call void @llvm.lifetime.start.p0(i64 -1, ptr [[B]])
3162 ; CHECK-NEXT: call void (ptr, i32, ptr, ...) @__kmpc_fork_call(ptr @[[GLOB1]], i32 2, ptr @merge_seq_par_use..omp_par, ptr [[A_ADDR]], ptr [[B]])
3163 ; CHECK-NEXT: br label [[OMP_PAR_OUTLINED_EXIT:%.*]]
3164 ; CHECK: omp.par.outlined.exit:
3165 ; CHECK-NEXT: br label [[OMP_PAR_EXIT_SPLIT:%.*]]
3166 ; CHECK: omp.par.exit.split:
3167 ; CHECK-NEXT: br label [[ENTRY_SPLIT_SPLIT:%.*]]
3168 ; CHECK: entry.split.split:
3169 ; CHECK-NEXT: call void @llvm.lifetime.end.p0(i64 noundef 4, ptr noundef nonnull [[B]])
3170 ; CHECK-NEXT: ret void
3171 ; CHECK-LABEL: define {{[^@]+}}@merge_seq_par_use..omp_par
3172 ; CHECK-SAME: (ptr noalias [[TID_ADDR:%.*]], ptr noalias [[ZERO_ADDR:%.*]], ptr [[A_ADDR:%.*]], ptr [[B:%.*]]) #[[ATTR0]] {
3173 ; CHECK-NEXT: omp.par.entry:
3174 ; CHECK-NEXT: [[TID_ADDR_LOCAL:%.*]] = alloca i32, align 4
3175 ; CHECK-NEXT: [[TMP0:%.*]] = load i32, ptr [[TID_ADDR]], align 4
3176 ; CHECK-NEXT: store i32 [[TMP0]], ptr [[TID_ADDR_LOCAL]], align 4
3177 ; CHECK-NEXT: [[TID:%.*]] = load i32, ptr [[TID_ADDR_LOCAL]], align 4
3178 ; CHECK-NEXT: br label [[OMP_PAR_REGION:%.*]]
3179 ; CHECK: omp.par.outlined.exit.exitStub:
3180 ; CHECK-NEXT: ret void
3181 ; CHECK: omp.par.region:
3182 ; CHECK-NEXT: br label [[OMP_PAR_MERGED:%.*]]
3183 ; CHECK: omp.par.merged:
3184 ; CHECK-NEXT: call void @.omp_outlined..16(ptr [[TID_ADDR]], ptr [[ZERO_ADDR]], ptr nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[A_ADDR]])
3185 ; CHECK-NEXT: [[OMP_GLOBAL_THREAD_NUM2:%.*]] = call i32 @__kmpc_global_thread_num(ptr @[[GLOB1]])
3186 ; CHECK-NEXT: call void @__kmpc_barrier(ptr @[[GLOB2]], i32 [[OMP_GLOBAL_THREAD_NUM2]])
3187 ; CHECK-NEXT: [[OMP_GLOBAL_THREAD_NUM:%.*]] = call i32 @__kmpc_global_thread_num(ptr @[[GLOB1]])
3188 ; CHECK-NEXT: [[TMP1:%.*]] = call i32 @__kmpc_master(ptr @[[GLOB1]], i32 [[OMP_GLOBAL_THREAD_NUM]])
3189 ; CHECK-NEXT: [[TMP2:%.*]] = icmp ne i32 [[TMP1]], 0
3190 ; CHECK-NEXT: br i1 [[TMP2]], label [[OMP_REGION_BODY:%.*]], label [[OMP_REGION_END:%.*]]
3191 ; CHECK: omp_region.end:
3192 ; CHECK-NEXT: [[OMP_GLOBAL_THREAD_NUM1:%.*]] = call i32 @__kmpc_global_thread_num(ptr @[[GLOB1]])
3193 ; CHECK-NEXT: call void @__kmpc_barrier(ptr @[[GLOB2]], i32 [[OMP_GLOBAL_THREAD_NUM1]])
3194 ; CHECK-NEXT: br label [[OMP_PAR_MERGED_SPLIT_SPLIT:%.*]]
3195 ; CHECK: omp.par.merged.split.split:
3196 ; CHECK-NEXT: call void @.omp_outlined..17(ptr [[TID_ADDR]], ptr [[ZERO_ADDR]], ptr nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[A_ADDR]], ptr nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[B]])
3197 ; CHECK-NEXT: br label [[ENTRY_SPLIT:%.*]]
3198 ; CHECK: entry.split:
3199 ; CHECK-NEXT: br label [[OMP_PAR_REGION_SPLIT:%.*]]
3200 ; CHECK: omp.par.region.split:
3201 ; CHECK-NEXT: br label [[OMP_PAR_PRE_FINALIZE:%.*]]
3202 ; CHECK: omp.par.pre_finalize:
3203 ; CHECK-NEXT: br label [[OMP_PAR_OUTLINED_EXIT_EXITSTUB:%.*]]
3204 ; CHECK: omp_region.body:
3205 ; CHECK-NEXT: br label [[SEQ_PAR_MERGED:%.*]]
3206 ; CHECK: seq.par.merged:
3207 ; CHECK-NEXT: [[TMP4:%.*]] = load i32, ptr [[A_ADDR]], align 4
3208 ; CHECK-NEXT: [[ADD:%.*]] = add nsw i32 [[TMP4]], 1
3209 ; CHECK-NEXT: store i32 [[ADD]], ptr [[B]], align 4
3210 ; CHECK-NEXT: br label [[OMP_PAR_MERGED_SPLIT:%.*]]
3211 ; CHECK: omp.par.merged.split:
3212 ; CHECK-NEXT: br label [[OMP_REGION_BODY_SPLIT:%.*]]
3213 ; CHECK: omp_region.body.split:
3214 ; CHECK-NEXT: call void @__kmpc_end_master(ptr @[[GLOB1]], i32 [[OMP_GLOBAL_THREAD_NUM]])
3215 ; CHECK-NEXT: br label [[OMP_REGION_END]]
3216 ; CHECK-LABEL: define {{[^@]+}}@.omp_outlined..16
3217 ; CHECK-SAME: (ptr noalias nocapture nofree readnone [[DOTGLOBAL_TID_:%.*]], ptr noalias nocapture nofree readnone [[DOTBOUND_TID_:%.*]], ptr nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[A:%.*]]) {
3218 ; CHECK-NEXT: entry:
3219 ; CHECK-NEXT: [[TMP0:%.*]] = load i32, ptr [[A]], align 4
3220 ; CHECK-NEXT: call void @use(i32 [[TMP0]])
3221 ; CHECK-NEXT: ret void
3222 ; CHECK-LABEL: define {{[^@]+}}@.omp_outlined..17
3223 ; CHECK-SAME: (ptr noalias nocapture nofree readnone [[DOTGLOBAL_TID_:%.*]], ptr noalias nocapture nofree readnone [[DOTBOUND_TID_:%.*]], ptr nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[A:%.*]], ptr nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[B:%.*]]) {
3224 ; CHECK-NEXT: entry:
3225 ; CHECK-NEXT: [[TMP0:%.*]] = load i32, ptr [[A]], align 4
3226 ; CHECK-NEXT: call void @use(i32 [[TMP0]])
3227 ; CHECK-NEXT: [[TMP1:%.*]] = load i32, ptr [[B]], align 4
3228 ; CHECK-NEXT: call void @use(i32 [[TMP1]])
3229 ; CHECK-NEXT: ret void
3230 ; CHECK-LABEL: define {{[^@]+}}@merge_cancellable_regions
3231 ; CHECK-SAME: (i32 [[CANCEL1:%.*]], i32 [[CANCEL2:%.*]]) local_unnamed_addr {
3232 ; CHECK-NEXT: entry:
3233 ; CHECK-NEXT: [[CANCEL1_ADDR:%.*]] = alloca i32, align 4
3234 ; CHECK-NEXT: [[CANCEL2_ADDR:%.*]] = alloca i32, align 4
3235 ; CHECK-NEXT: store i32 [[CANCEL1]], ptr [[CANCEL1_ADDR]], align 4
3236 ; CHECK-NEXT: store i32 [[CANCEL2]], ptr [[CANCEL2_ADDR]], align 4
3237 ; CHECK-NEXT: [[OMP_GLOBAL_THREAD_NUM:%.*]] = call i32 @__kmpc_global_thread_num(ptr @[[GLOB1]])
3238 ; CHECK-NEXT: br label [[OMP_PARALLEL:%.*]]
3239 ; CHECK: omp_parallel:
3240 ; CHECK-NEXT: call void (ptr, i32, ptr, ...) @__kmpc_fork_call(ptr @[[GLOB1]], i32 2, ptr @merge_cancellable_regions..omp_par, ptr [[CANCEL1_ADDR]], ptr [[CANCEL2_ADDR]])
3241 ; CHECK-NEXT: br label [[OMP_PAR_OUTLINED_EXIT:%.*]]
3242 ; CHECK: omp.par.outlined.exit:
3243 ; CHECK-NEXT: br label [[OMP_PAR_EXIT_SPLIT:%.*]]
3244 ; CHECK: omp.par.exit.split:
3245 ; CHECK-NEXT: br label [[ENTRY_SPLIT_SPLIT:%.*]]
3246 ; CHECK: entry.split.split:
3247 ; CHECK-NEXT: ret void
3248 ; CHECK-LABEL: define {{[^@]+}}@merge_cancellable_regions..omp_par
3249 ; CHECK-SAME: (ptr noalias [[TID_ADDR:%.*]], ptr noalias [[ZERO_ADDR:%.*]], ptr [[CANCEL1_ADDR:%.*]], ptr [[CANCEL2_ADDR:%.*]]) #[[ATTR0]] {
3250 ; CHECK-NEXT: omp.par.entry:
3251 ; CHECK-NEXT: [[TID_ADDR_LOCAL:%.*]] = alloca i32, align 4
3252 ; CHECK-NEXT: [[TMP0:%.*]] = load i32, ptr [[TID_ADDR]], align 4
3253 ; CHECK-NEXT: store i32 [[TMP0]], ptr [[TID_ADDR_LOCAL]], align 4
3254 ; CHECK-NEXT: [[TID:%.*]] = load i32, ptr [[TID_ADDR_LOCAL]], align 4
3255 ; CHECK-NEXT: br label [[OMP_PAR_REGION:%.*]]
3256 ; CHECK: omp.par.outlined.exit.exitStub:
3257 ; CHECK-NEXT: ret void
3258 ; CHECK: omp.par.region:
3259 ; CHECK-NEXT: br label [[OMP_PAR_MERGED:%.*]]
3260 ; CHECK: omp.par.merged:
3261 ; CHECK-NEXT: call void @.omp_outlined..18(ptr [[TID_ADDR]], ptr [[ZERO_ADDR]], ptr nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[CANCEL1_ADDR]])
3262 ; CHECK-NEXT: [[OMP_GLOBAL_THREAD_NUM:%.*]] = call i32 @__kmpc_global_thread_num(ptr @[[GLOB1]])
3263 ; CHECK-NEXT: call void @__kmpc_barrier(ptr @[[GLOB2]], i32 [[OMP_GLOBAL_THREAD_NUM]])
3264 ; CHECK-NEXT: call void @.omp_outlined..19(ptr [[TID_ADDR]], ptr [[ZERO_ADDR]], ptr nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[CANCEL2_ADDR]])
3265 ; CHECK-NEXT: br label [[ENTRY_SPLIT:%.*]]
3266 ; CHECK: entry.split:
3267 ; CHECK-NEXT: br label [[OMP_PAR_REGION_SPLIT:%.*]]
3268 ; CHECK: omp.par.region.split:
3269 ; CHECK-NEXT: br label [[OMP_PAR_PRE_FINALIZE:%.*]]
3270 ; CHECK: omp.par.pre_finalize:
3271 ; CHECK-NEXT: br label [[OMP_PAR_OUTLINED_EXIT_EXITSTUB:%.*]]
3272 ; CHECK-LABEL: define {{[^@]+}}@.omp_outlined..18
3273 ; CHECK-SAME: (ptr noalias nocapture nofree readonly [[DOTGLOBAL_TID_:%.*]], ptr noalias nocapture nofree readnone [[DOTBOUND_TID_:%.*]], ptr nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[CANCEL1:%.*]]) {
3274 ; CHECK-NEXT: entry:
3275 ; CHECK-NEXT: [[TMP0:%.*]] = load i32, ptr [[CANCEL1]], align 4
3276 ; CHECK-NEXT: [[TOBOOL_NOT:%.*]] = icmp eq i32 [[TMP0]], 0
3277 ; CHECK-NEXT: br i1 [[TOBOOL_NOT]], label [[IF_END:%.*]], label [[IF_THEN:%.*]]
3279 ; CHECK-NEXT: [[TMP1:%.*]] = load i32, ptr [[DOTGLOBAL_TID_]], align 4
3280 ; CHECK-NEXT: [[TMP2:%.*]] = call i32 @__kmpc_cancel(ptr noundef nonnull @[[GLOB1]], i32 [[TMP1]], i32 noundef 1)
3281 ; CHECK-NEXT: ret void
3283 ; CHECK-NEXT: ret void
3284 ; CHECK-LABEL: define {{[^@]+}}@.omp_outlined..19
3285 ; CHECK-SAME: (ptr noalias nocapture nofree readonly [[DOTGLOBAL_TID_:%.*]], ptr noalias nocapture nofree readnone [[DOTBOUND_TID_:%.*]], ptr nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[CANCEL2:%.*]]) {
3286 ; CHECK-NEXT: entry:
3287 ; CHECK-NEXT: [[TMP0:%.*]] = load i32, ptr [[CANCEL2]], align 4
3288 ; CHECK-NEXT: [[TOBOOL_NOT:%.*]] = icmp eq i32 [[TMP0]], 0
3289 ; CHECK-NEXT: br i1 [[TOBOOL_NOT]], label [[IF_END:%.*]], label [[IF_THEN:%.*]]
3291 ; CHECK-NEXT: [[TMP1:%.*]] = load i32, ptr [[DOTGLOBAL_TID_]], align 4
3292 ; CHECK-NEXT: [[TMP2:%.*]] = call i32 @__kmpc_cancel(ptr noundef nonnull @[[GLOB1]], i32 [[TMP1]], i32 noundef 1)
3293 ; CHECK-NEXT: ret void
3295 ; CHECK-NEXT: ret void
3296 ; CHECK-LABEL: define {{[^@]+}}@merge_cancellable_regions_seq
3297 ; CHECK-SAME: (i32 [[CANCEL1:%.*]], i32 [[CANCEL2:%.*]]) local_unnamed_addr {
3298 ; CHECK-NEXT: entry:
3299 ; CHECK-NEXT: [[CANCEL1_ADDR:%.*]] = alloca i32, align 4
3300 ; CHECK-NEXT: [[CANCEL2_ADDR:%.*]] = alloca i32, align 4
3301 ; CHECK-NEXT: store i32 [[CANCEL1]], ptr [[CANCEL1_ADDR]], align 4
3302 ; CHECK-NEXT: store i32 [[CANCEL2]], ptr [[CANCEL2_ADDR]], align 4
3303 ; CHECK-NEXT: [[OMP_GLOBAL_THREAD_NUM2:%.*]] = call i32 @__kmpc_global_thread_num(ptr @[[GLOB1]])
3304 ; CHECK-NEXT: br label [[OMP_PARALLEL:%.*]]
3305 ; CHECK: omp_parallel:
3306 ; CHECK-NEXT: call void (ptr, i32, ptr, ...) @__kmpc_fork_call(ptr @[[GLOB1]], i32 2, ptr @merge_cancellable_regions_seq..omp_par, ptr [[CANCEL1_ADDR]], ptr [[CANCEL2_ADDR]])
3307 ; CHECK-NEXT: br label [[OMP_PAR_OUTLINED_EXIT:%.*]]
3308 ; CHECK: omp.par.outlined.exit:
3309 ; CHECK-NEXT: br label [[OMP_PAR_EXIT_SPLIT:%.*]]
3310 ; CHECK: omp.par.exit.split:
3311 ; CHECK-NEXT: br label [[ENTRY_SPLIT_SPLIT:%.*]]
3312 ; CHECK: entry.split.split:
3313 ; CHECK-NEXT: ret void
3314 ; CHECK-LABEL: define {{[^@]+}}@merge_cancellable_regions_seq..omp_par
3315 ; CHECK-SAME: (ptr noalias [[TID_ADDR:%.*]], ptr noalias [[ZERO_ADDR:%.*]], ptr [[CANCEL1_ADDR:%.*]], ptr [[CANCEL2_ADDR:%.*]]) #[[ATTR0]] {
3316 ; CHECK-NEXT: omp.par.entry:
3317 ; CHECK-NEXT: [[TID_ADDR_LOCAL:%.*]] = alloca i32, align 4
3318 ; CHECK-NEXT: [[TMP0:%.*]] = load i32, ptr [[TID_ADDR]], align 4
3319 ; CHECK-NEXT: store i32 [[TMP0]], ptr [[TID_ADDR_LOCAL]], align 4
3320 ; CHECK-NEXT: [[TID:%.*]] = load i32, ptr [[TID_ADDR_LOCAL]], align 4
3321 ; CHECK-NEXT: br label [[OMP_PAR_REGION:%.*]]
3322 ; CHECK: omp.par.outlined.exit.exitStub:
3323 ; CHECK-NEXT: ret void
3324 ; CHECK: omp.par.region:
3325 ; CHECK-NEXT: br label [[OMP_PAR_MERGED:%.*]]
3326 ; CHECK: omp.par.merged:
3327 ; CHECK-NEXT: call void @.omp_outlined..20(ptr [[TID_ADDR]], ptr [[ZERO_ADDR]], ptr nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[CANCEL1_ADDR]])
3328 ; CHECK-NEXT: [[OMP_GLOBAL_THREAD_NUM2:%.*]] = call i32 @__kmpc_global_thread_num(ptr @[[GLOB1]])
3329 ; CHECK-NEXT: call void @__kmpc_barrier(ptr @[[GLOB2]], i32 [[OMP_GLOBAL_THREAD_NUM2]])
3330 ; CHECK-NEXT: [[OMP_GLOBAL_THREAD_NUM:%.*]] = call i32 @__kmpc_global_thread_num(ptr @[[GLOB1]])
3331 ; CHECK-NEXT: [[TMP1:%.*]] = call i32 @__kmpc_master(ptr @[[GLOB1]], i32 [[OMP_GLOBAL_THREAD_NUM]])
3332 ; CHECK-NEXT: [[TMP2:%.*]] = icmp ne i32 [[TMP1]], 0
3333 ; CHECK-NEXT: br i1 [[TMP2]], label [[OMP_REGION_BODY:%.*]], label [[OMP_REGION_END:%.*]]
3334 ; CHECK: omp_region.end:
3335 ; CHECK-NEXT: [[OMP_GLOBAL_THREAD_NUM1:%.*]] = call i32 @__kmpc_global_thread_num(ptr @[[GLOB1]])
3336 ; CHECK-NEXT: call void @__kmpc_barrier(ptr @[[GLOB2]], i32 [[OMP_GLOBAL_THREAD_NUM1]])
3337 ; CHECK-NEXT: br label [[OMP_PAR_MERGED_SPLIT_SPLIT:%.*]]
3338 ; CHECK: omp.par.merged.split.split:
3339 ; CHECK-NEXT: call void @.omp_outlined..21(ptr [[TID_ADDR]], ptr [[ZERO_ADDR]], ptr nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[CANCEL2_ADDR]])
3340 ; CHECK-NEXT: br label [[ENTRY_SPLIT:%.*]]
3341 ; CHECK: entry.split:
3342 ; CHECK-NEXT: br label [[OMP_PAR_REGION_SPLIT:%.*]]
3343 ; CHECK: omp.par.region.split:
3344 ; CHECK-NEXT: br label [[OMP_PAR_PRE_FINALIZE:%.*]]
3345 ; CHECK: omp.par.pre_finalize:
3346 ; CHECK-NEXT: br label [[OMP_PAR_OUTLINED_EXIT_EXITSTUB:%.*]]
3347 ; CHECK: omp_region.body:
3348 ; CHECK-NEXT: br label [[SEQ_PAR_MERGED:%.*]]
3349 ; CHECK: seq.par.merged:
3350 ; CHECK-NEXT: [[TMP3:%.*]] = load i32, ptr [[CANCEL1_ADDR]], align 4
3351 ; CHECK-NEXT: [[TOBOOL_NOT:%.*]] = icmp eq i32 [[TMP3]], 0
3352 ; CHECK-NEXT: [[LNOT_EXT:%.*]] = zext i1 [[TOBOOL_NOT]] to i32
3353 ; CHECK-NEXT: store i32 [[LNOT_EXT]], ptr [[CANCEL2_ADDR]], align 4
3354 ; CHECK-NEXT: br label [[OMP_PAR_MERGED_SPLIT:%.*]]
3355 ; CHECK: omp.par.merged.split:
3356 ; CHECK-NEXT: br label [[OMP_REGION_BODY_SPLIT:%.*]]
3357 ; CHECK: omp_region.body.split:
3358 ; CHECK-NEXT: call void @__kmpc_end_master(ptr @[[GLOB1]], i32 [[OMP_GLOBAL_THREAD_NUM]])
3359 ; CHECK-NEXT: br label [[OMP_REGION_END]]
3360 ; CHECK-LABEL: define {{[^@]+}}@.omp_outlined..20
3361 ; CHECK-SAME: (ptr noalias nocapture nofree readonly [[DOTGLOBAL_TID_:%.*]], ptr noalias nocapture nofree readnone [[DOTBOUND_TID_:%.*]], ptr nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[CANCEL1:%.*]]) {
3362 ; CHECK-NEXT: entry:
3363 ; CHECK-NEXT: [[TMP0:%.*]] = load i32, ptr [[CANCEL1]], align 4
3364 ; CHECK-NEXT: [[TOBOOL_NOT:%.*]] = icmp eq i32 [[TMP0]], 0
3365 ; CHECK-NEXT: br i1 [[TOBOOL_NOT]], label [[IF_END:%.*]], label [[IF_THEN:%.*]]
3367 ; CHECK-NEXT: [[TMP1:%.*]] = load i32, ptr [[DOTGLOBAL_TID_]], align 4
3368 ; CHECK-NEXT: [[TMP2:%.*]] = call i32 @__kmpc_cancel(ptr noundef nonnull @[[GLOB1]], i32 [[TMP1]], i32 noundef 1)
3369 ; CHECK-NEXT: ret void
3371 ; CHECK-NEXT: ret void
3372 ; CHECK-LABEL: define {{[^@]+}}@.omp_outlined..21
3373 ; CHECK-SAME: (ptr noalias nocapture nofree readonly [[DOTGLOBAL_TID_:%.*]], ptr noalias nocapture nofree readnone [[DOTBOUND_TID_:%.*]], ptr nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[CANCEL2:%.*]]) {
3374 ; CHECK-NEXT: entry:
3375 ; CHECK-NEXT: [[TMP0:%.*]] = load i32, ptr [[CANCEL2]], align 4
3376 ; CHECK-NEXT: [[TOBOOL_NOT:%.*]] = icmp eq i32 [[TMP0]], 0
3377 ; CHECK-NEXT: br i1 [[TOBOOL_NOT]], label [[IF_END:%.*]], label [[IF_THEN:%.*]]
3379 ; CHECK-NEXT: [[TMP1:%.*]] = load i32, ptr [[DOTGLOBAL_TID_]], align 4
3380 ; CHECK-NEXT: [[TMP2:%.*]] = call i32 @__kmpc_cancel(ptr noundef nonnull @[[GLOB1]], i32 [[TMP1]], i32 noundef 1)
3381 ; CHECK-NEXT: ret void
3383 ; CHECK-NEXT: ret void
3384 ; CHECK-LABEL: define {{[^@]+}}@merge_3
3385 ; CHECK-SAME: (i32 [[A:%.*]]) local_unnamed_addr {
3386 ; CHECK-NEXT: entry:
3387 ; CHECK-NEXT: [[A_ADDR:%.*]] = alloca i32, align 4
3388 ; CHECK-NEXT: store i32 [[A]], ptr [[A_ADDR]], align 4
3389 ; CHECK-NEXT: [[OMP_GLOBAL_THREAD_NUM:%.*]] = call i32 @__kmpc_global_thread_num(ptr @[[GLOB1]])
3390 ; CHECK-NEXT: br label [[OMP_PARALLEL:%.*]]
3391 ; CHECK: omp_parallel:
3392 ; CHECK-NEXT: call void (ptr, i32, ptr, ...) @__kmpc_fork_call(ptr @[[GLOB1]], i32 1, ptr @merge_3..omp_par, ptr [[A_ADDR]])
3393 ; CHECK-NEXT: br label [[OMP_PAR_OUTLINED_EXIT:%.*]]
3394 ; CHECK: omp.par.outlined.exit:
3395 ; CHECK-NEXT: br label [[OMP_PAR_EXIT_SPLIT:%.*]]
3396 ; CHECK: omp.par.exit.split:
3397 ; CHECK-NEXT: br label [[ENTRY_SPLIT_SPLIT:%.*]]
3398 ; CHECK: entry.split.split:
3399 ; CHECK-NEXT: ret void
3400 ; CHECK-LABEL: define {{[^@]+}}@merge_3..omp_par
3401 ; CHECK-SAME: (ptr noalias [[TID_ADDR:%.*]], ptr noalias [[ZERO_ADDR:%.*]], ptr [[A_ADDR:%.*]]) #[[ATTR0]] {
3402 ; CHECK-NEXT: omp.par.entry:
3403 ; CHECK-NEXT: [[TID_ADDR_LOCAL:%.*]] = alloca i32, align 4
3404 ; CHECK-NEXT: [[TMP0:%.*]] = load i32, ptr [[TID_ADDR]], align 4
3405 ; CHECK-NEXT: store i32 [[TMP0]], ptr [[TID_ADDR_LOCAL]], align 4
3406 ; CHECK-NEXT: [[TID:%.*]] = load i32, ptr [[TID_ADDR_LOCAL]], align 4
3407 ; CHECK-NEXT: br label [[OMP_PAR_REGION:%.*]]
3408 ; CHECK: omp.par.outlined.exit.exitStub:
3409 ; CHECK-NEXT: ret void
3410 ; CHECK: omp.par.region:
3411 ; CHECK-NEXT: br label [[OMP_PAR_MERGED:%.*]]
3412 ; CHECK: omp.par.merged:
3413 ; CHECK-NEXT: call void @.omp_outlined..22(ptr [[TID_ADDR]], ptr [[ZERO_ADDR]], ptr nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[A_ADDR]])
3414 ; CHECK-NEXT: [[OMP_GLOBAL_THREAD_NUM:%.*]] = call i32 @__kmpc_global_thread_num(ptr @[[GLOB1]])
3415 ; CHECK-NEXT: call void @__kmpc_barrier(ptr @[[GLOB2]], i32 [[OMP_GLOBAL_THREAD_NUM]])
3416 ; CHECK-NEXT: call void @.omp_outlined..23(ptr [[TID_ADDR]], ptr [[ZERO_ADDR]], ptr nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[A_ADDR]])
3417 ; CHECK-NEXT: [[OMP_GLOBAL_THREAD_NUM1:%.*]] = call i32 @__kmpc_global_thread_num(ptr @[[GLOB1]])
3418 ; CHECK-NEXT: call void @__kmpc_barrier(ptr @[[GLOB2]], i32 [[OMP_GLOBAL_THREAD_NUM1]])
3419 ; CHECK-NEXT: call void @.omp_outlined..24(ptr [[TID_ADDR]], ptr [[ZERO_ADDR]], ptr nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[A_ADDR]])
3420 ; CHECK-NEXT: br label [[ENTRY_SPLIT:%.*]]
3421 ; CHECK: entry.split:
3422 ; CHECK-NEXT: br label [[OMP_PAR_REGION_SPLIT:%.*]]
3423 ; CHECK: omp.par.region.split:
3424 ; CHECK-NEXT: br label [[OMP_PAR_PRE_FINALIZE:%.*]]
3425 ; CHECK: omp.par.pre_finalize:
3426 ; CHECK-NEXT: br label [[OMP_PAR_OUTLINED_EXIT_EXITSTUB:%.*]]
3427 ; CHECK-LABEL: define {{[^@]+}}@.omp_outlined..22
3428 ; CHECK-SAME: (ptr noalias nocapture nofree readnone [[DOTGLOBAL_TID_:%.*]], ptr noalias nocapture nofree readnone [[DOTBOUND_TID_:%.*]], ptr nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[A:%.*]]) {
3429 ; CHECK-NEXT: entry:
3430 ; CHECK-NEXT: [[TMP0:%.*]] = load i32, ptr [[A]], align 4
3431 ; CHECK-NEXT: call void @use(i32 [[TMP0]])
3432 ; CHECK-NEXT: ret void
3433 ; CHECK-LABEL: define {{[^@]+}}@.omp_outlined..23
3434 ; CHECK-SAME: (ptr noalias nocapture nofree readnone [[DOTGLOBAL_TID_:%.*]], ptr noalias nocapture nofree readnone [[DOTBOUND_TID_:%.*]], ptr nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[A:%.*]]) {
3435 ; CHECK-NEXT: entry:
3436 ; CHECK-NEXT: [[TMP0:%.*]] = load i32, ptr [[A]], align 4
3437 ; CHECK-NEXT: call void @use(i32 [[TMP0]])
3438 ; CHECK-NEXT: ret void
3439 ; CHECK-LABEL: define {{[^@]+}}@.omp_outlined..24
3440 ; CHECK-SAME: (ptr noalias nocapture nofree readnone [[DOTGLOBAL_TID_:%.*]], ptr noalias nocapture nofree readnone [[DOTBOUND_TID_:%.*]], ptr nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[A:%.*]]) {
3441 ; CHECK-NEXT: entry:
3442 ; CHECK-NEXT: [[TMP0:%.*]] = load i32, ptr [[A]], align 4
3443 ; CHECK-NEXT: call void @use(i32 [[TMP0]])
3444 ; CHECK-NEXT: ret void
3445 ; CHECK-LABEL: define {{[^@]+}}@merge_3_seq
3446 ; CHECK-SAME: (i32 [[A:%.*]], i32 [[B:%.*]]) local_unnamed_addr {
3447 ; CHECK-NEXT: entry:
3448 ; CHECK-NEXT: [[ADD1_SEQ_OUTPUT_ALLOC:%.*]] = alloca i32, align 4
3449 ; CHECK-NEXT: [[ADD_SEQ_OUTPUT_ALLOC:%.*]] = alloca i32, align 4
3450 ; CHECK-NEXT: [[A_ADDR:%.*]] = alloca i32, align 4
3451 ; CHECK-NEXT: store i32 [[A]], ptr [[A_ADDR]], align 4
3452 ; CHECK-NEXT: [[OMP_GLOBAL_THREAD_NUM7:%.*]] = call i32 @__kmpc_global_thread_num(ptr @[[GLOB1]])
3453 ; CHECK-NEXT: br label [[OMP_PARALLEL:%.*]]
3454 ; CHECK: omp_parallel:
3455 ; CHECK-NEXT: call void (ptr, i32, ptr, ...) @__kmpc_fork_call(ptr @[[GLOB1]], i32 3, ptr @merge_3_seq..omp_par, ptr [[A_ADDR]], ptr [[ADD_SEQ_OUTPUT_ALLOC]], ptr [[ADD1_SEQ_OUTPUT_ALLOC]])
3456 ; CHECK-NEXT: br label [[OMP_PAR_OUTLINED_EXIT:%.*]]
3457 ; CHECK: omp.par.outlined.exit:
3458 ; CHECK-NEXT: br label [[OMP_PAR_EXIT_SPLIT:%.*]]
3459 ; CHECK: omp.par.exit.split:
3460 ; CHECK-NEXT: br label [[ENTRY_SPLIT_SPLIT:%.*]]
3461 ; CHECK: entry.split.split:
3462 ; CHECK-NEXT: [[ADD1_SEQ_OUTPUT_LOAD:%.*]] = load i32, ptr [[ADD1_SEQ_OUTPUT_ALLOC]], align 4
3463 ; CHECK-NEXT: call void @use(i32 [[ADD1_SEQ_OUTPUT_LOAD]])
3464 ; CHECK-NEXT: ret void
3465 ; CHECK-LABEL: define {{[^@]+}}@merge_3_seq..omp_par
3466 ; CHECK-SAME: (ptr noalias [[TID_ADDR:%.*]], ptr noalias [[ZERO_ADDR:%.*]], ptr [[A_ADDR:%.*]], ptr [[ADD_SEQ_OUTPUT_ALLOC:%.*]], ptr [[ADD1_SEQ_OUTPUT_ALLOC:%.*]]) #[[ATTR0]] {
3467 ; CHECK-NEXT: omp.par.entry:
3468 ; CHECK-NEXT: [[TID_ADDR_LOCAL:%.*]] = alloca i32, align 4
3469 ; CHECK-NEXT: [[TMP0:%.*]] = load i32, ptr [[TID_ADDR]], align 4
3470 ; CHECK-NEXT: store i32 [[TMP0]], ptr [[TID_ADDR_LOCAL]], align 4
3471 ; CHECK-NEXT: [[TID:%.*]] = load i32, ptr [[TID_ADDR_LOCAL]], align 4
3472 ; CHECK-NEXT: br label [[OMP_PAR_REGION:%.*]]
3473 ; CHECK: omp.par.outlined.exit.exitStub:
3474 ; CHECK-NEXT: ret void
3475 ; CHECK: omp.par.region:
3476 ; CHECK-NEXT: br label [[OMP_PAR_MERGED:%.*]]
3477 ; CHECK: omp.par.merged:
3478 ; CHECK-NEXT: call void @.omp_outlined..25(ptr [[TID_ADDR]], ptr [[ZERO_ADDR]], ptr nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[A_ADDR]])
3479 ; CHECK-NEXT: [[OMP_GLOBAL_THREAD_NUM2:%.*]] = call i32 @__kmpc_global_thread_num(ptr @[[GLOB1]])
3480 ; CHECK-NEXT: call void @__kmpc_barrier(ptr @[[GLOB2]], i32 [[OMP_GLOBAL_THREAD_NUM2]])
3481 ; CHECK-NEXT: [[OMP_GLOBAL_THREAD_NUM:%.*]] = call i32 @__kmpc_global_thread_num(ptr @[[GLOB1]])
3482 ; CHECK-NEXT: [[TMP1:%.*]] = call i32 @__kmpc_master(ptr @[[GLOB1]], i32 [[OMP_GLOBAL_THREAD_NUM]])
3483 ; CHECK-NEXT: [[TMP2:%.*]] = icmp ne i32 [[TMP1]], 0
3484 ; CHECK-NEXT: br i1 [[TMP2]], label [[OMP_REGION_BODY:%.*]], label [[OMP_REGION_END:%.*]]
3485 ; CHECK: omp_region.end:
3486 ; CHECK-NEXT: [[OMP_GLOBAL_THREAD_NUM1:%.*]] = call i32 @__kmpc_global_thread_num(ptr @[[GLOB1]])
3487 ; CHECK-NEXT: call void @__kmpc_barrier(ptr @[[GLOB2]], i32 [[OMP_GLOBAL_THREAD_NUM1]])
3488 ; CHECK-NEXT: br label [[OMP_PAR_MERGED_SPLIT_SPLIT:%.*]]
3489 ; CHECK: omp.par.merged.split.split:
3490 ; CHECK-NEXT: call void @.omp_outlined..26(ptr [[TID_ADDR]], ptr [[ZERO_ADDR]], ptr nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[A_ADDR]])
3491 ; CHECK-NEXT: [[OMP_GLOBAL_THREAD_NUM4:%.*]] = call i32 @__kmpc_global_thread_num(ptr @[[GLOB1]])
3492 ; CHECK-NEXT: call void @__kmpc_barrier(ptr @[[GLOB2]], i32 [[OMP_GLOBAL_THREAD_NUM4]])
3493 ; CHECK-NEXT: [[OMP_GLOBAL_THREAD_NUM3:%.*]] = call i32 @__kmpc_global_thread_num(ptr @[[GLOB1]])
3494 ; CHECK-NEXT: [[TMP3:%.*]] = call i32 @__kmpc_master(ptr @[[GLOB1]], i32 [[OMP_GLOBAL_THREAD_NUM3]])
3495 ; CHECK-NEXT: [[TMP4:%.*]] = icmp ne i32 [[TMP3]], 0
3496 ; CHECK-NEXT: br i1 [[TMP4]], label [[OMP_REGION_BODY5:%.*]], label [[OMP_REGION_END4:%.*]]
3497 ; CHECK: omp_region.end4:
3498 ; CHECK-NEXT: [[OMP_GLOBAL_THREAD_NUM6:%.*]] = call i32 @__kmpc_global_thread_num(ptr @[[GLOB1]])
3499 ; CHECK-NEXT: call void @__kmpc_barrier(ptr @[[GLOB2]], i32 [[OMP_GLOBAL_THREAD_NUM6]])
3500 ; CHECK-NEXT: br label [[OMP_PAR_MERGED_SPLIT_SPLIT_SPLIT_SPLIT:%.*]]
3501 ; CHECK: omp.par.merged.split.split.split.split:
3502 ; CHECK-NEXT: call void @.omp_outlined..27(ptr [[TID_ADDR]], ptr [[ZERO_ADDR]], ptr nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[A_ADDR]])
3503 ; CHECK-NEXT: br label [[ENTRY_SPLIT:%.*]]
3504 ; CHECK: entry.split:
3505 ; CHECK-NEXT: br label [[OMP_PAR_REGION_SPLIT:%.*]]
3506 ; CHECK: omp.par.region.split:
3507 ; CHECK-NEXT: br label [[OMP_PAR_PRE_FINALIZE:%.*]]
3508 ; CHECK: omp.par.pre_finalize:
3509 ; CHECK-NEXT: br label [[OMP_PAR_OUTLINED_EXIT_EXITSTUB:%.*]]
3510 ; CHECK: omp_region.body5:
3511 ; CHECK-NEXT: br label [[SEQ_PAR_MERGED2:%.*]]
3512 ; CHECK: seq.par.merged2:
3513 ; CHECK-NEXT: [[TMP5:%.*]] = load i32, ptr [[A_ADDR]], align 4
3514 ; CHECK-NEXT: [[ADD_SEQ_OUTPUT_LOAD:%.*]] = load i32, ptr [[ADD_SEQ_OUTPUT_ALLOC]], align 4
3515 ; CHECK-NEXT: [[ADD1:%.*]] = add nsw i32 [[ADD_SEQ_OUTPUT_LOAD]], [[TMP5]]
3516 ; CHECK-NEXT: store i32 [[ADD1]], ptr [[ADD1_SEQ_OUTPUT_ALLOC]], align 4
3517 ; CHECK-NEXT: br label [[OMP_PAR_MERGED_SPLIT_SPLIT_SPLIT:%.*]]
3518 ; CHECK: omp.par.merged.split.split.split:
3519 ; CHECK-NEXT: br label [[OMP_REGION_BODY5_SPLIT:%.*]]
3520 ; CHECK: omp_region.body5.split:
3521 ; CHECK-NEXT: call void @__kmpc_end_master(ptr @[[GLOB1]], i32 [[OMP_GLOBAL_THREAD_NUM3]])
3522 ; CHECK-NEXT: br label [[OMP_REGION_END4]]
3523 ; CHECK: omp_region.body:
3524 ; CHECK-NEXT: br label [[SEQ_PAR_MERGED:%.*]]
3525 ; CHECK: seq.par.merged:
3526 ; CHECK-NEXT: [[TMP6:%.*]] = load i32, ptr [[A_ADDR]], align 4
3527 ; CHECK-NEXT: [[ADD:%.*]] = add nsw i32 [[TMP6]], 1
3528 ; CHECK-NEXT: store i32 [[ADD]], ptr [[ADD_SEQ_OUTPUT_ALLOC]], align 4
3529 ; CHECK-NEXT: br label [[OMP_PAR_MERGED_SPLIT:%.*]]
3530 ; CHECK: omp.par.merged.split:
3531 ; CHECK-NEXT: br label [[OMP_REGION_BODY_SPLIT:%.*]]
3532 ; CHECK: omp_region.body.split:
3533 ; CHECK-NEXT: call void @__kmpc_end_master(ptr @[[GLOB1]], i32 [[OMP_GLOBAL_THREAD_NUM]])
3534 ; CHECK-NEXT: br label [[OMP_REGION_END]]
3535 ; CHECK-LABEL: define {{[^@]+}}@.omp_outlined..25
3536 ; CHECK-SAME: (ptr noalias nocapture nofree readnone [[DOTGLOBAL_TID_:%.*]], ptr noalias nocapture nofree readnone [[DOTBOUND_TID_:%.*]], ptr nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[A:%.*]]) {
3537 ; CHECK-NEXT: entry:
3538 ; CHECK-NEXT: [[TMP0:%.*]] = load i32, ptr [[A]], align 4
3539 ; CHECK-NEXT: call void @use(i32 [[TMP0]])
3540 ; CHECK-NEXT: ret void
3541 ; CHECK-LABEL: define {{[^@]+}}@.omp_outlined..26
3542 ; CHECK-SAME: (ptr noalias nocapture nofree readnone [[DOTGLOBAL_TID_:%.*]], ptr noalias nocapture nofree readnone [[DOTBOUND_TID_:%.*]], ptr nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[A:%.*]]) {
3543 ; CHECK-NEXT: entry:
3544 ; CHECK-NEXT: [[TMP0:%.*]] = load i32, ptr [[A]], align 4
3545 ; CHECK-NEXT: call void @use(i32 [[TMP0]])
3546 ; CHECK-NEXT: ret void
3547 ; CHECK-LABEL: define {{[^@]+}}@.omp_outlined..27
3548 ; CHECK-SAME: (ptr noalias nocapture nofree readnone [[DOTGLOBAL_TID_:%.*]], ptr noalias nocapture nofree readnone [[DOTBOUND_TID_:%.*]], ptr nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[A:%.*]]) {
3549 ; CHECK-NEXT: entry:
3550 ; CHECK-NEXT: [[TMP0:%.*]] = load i32, ptr [[A]], align 4
3551 ; CHECK-NEXT: call void @use(i32 [[TMP0]])
3552 ; CHECK-NEXT: ret void
3553 ; CHECK-LABEL: define {{[^@]+}}@unmergable_3_seq_call
3554 ; CHECK-SAME: (i32 [[A:%.*]]) local_unnamed_addr {
3555 ; CHECK-NEXT: entry:
3556 ; CHECK-NEXT: [[A_ADDR:%.*]] = alloca i32, align 4
3557 ; CHECK-NEXT: store i32 [[A]], ptr [[A_ADDR]], align 4
3558 ; CHECK-NEXT: call void (ptr, i32, ptr, ...) @__kmpc_fork_call(ptr noundef nonnull align 8 dereferenceable(24) @[[GLOB1]], i32 noundef 1, ptr noundef @.omp_outlined..28, ptr nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[A_ADDR]])
3559 ; CHECK-NEXT: call void (...) @foo()
3560 ; CHECK-NEXT: call void (ptr, i32, ptr, ...) @__kmpc_fork_call(ptr noundef nonnull align 8 dereferenceable(24) @[[GLOB1]], i32 noundef 1, ptr noundef @.omp_outlined..29, ptr nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[A_ADDR]])
3561 ; CHECK-NEXT: call void (...) @foo()
3562 ; CHECK-NEXT: call void (ptr, i32, ptr, ...) @__kmpc_fork_call(ptr noundef nonnull align 8 dereferenceable(24) @[[GLOB1]], i32 noundef 1, ptr noundef @.omp_outlined..30, ptr nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[A_ADDR]])
3563 ; CHECK-NEXT: ret void
3564 ; CHECK-LABEL: define {{[^@]+}}@.omp_outlined..28
3565 ; CHECK-SAME: (ptr noalias nocapture nofree readnone [[DOTGLOBAL_TID_:%.*]], ptr noalias nocapture nofree readnone [[DOTBOUND_TID_:%.*]], ptr nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[A:%.*]]) {
3566 ; CHECK-NEXT: entry:
3567 ; CHECK-NEXT: [[TMP0:%.*]] = load i32, ptr [[A]], align 4
3568 ; CHECK-NEXT: call void @use(i32 [[TMP0]])
3569 ; CHECK-NEXT: ret void
3570 ; CHECK-LABEL: define {{[^@]+}}@.omp_outlined..29
3571 ; CHECK-SAME: (ptr noalias nocapture nofree readnone [[DOTGLOBAL_TID_:%.*]], ptr noalias nocapture nofree readnone [[DOTBOUND_TID_:%.*]], ptr nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[A:%.*]]) {
3572 ; CHECK-NEXT: entry:
3573 ; CHECK-NEXT: [[TMP0:%.*]] = load i32, ptr [[A]], align 4
3574 ; CHECK-NEXT: call void @use(i32 [[TMP0]])
3575 ; CHECK-NEXT: ret void
3576 ; CHECK-LABEL: define {{[^@]+}}@.omp_outlined..30
3577 ; CHECK-SAME: (ptr noalias nocapture nofree readnone [[DOTGLOBAL_TID_:%.*]], ptr noalias nocapture nofree readnone [[DOTBOUND_TID_:%.*]], ptr nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[A:%.*]]) {
3578 ; CHECK-NEXT: entry:
3579 ; CHECK-NEXT: [[TMP0:%.*]] = load i32, ptr [[A]], align 4
3580 ; CHECK-NEXT: call void @use(i32 [[TMP0]])
3581 ; CHECK-NEXT: ret void
3582 ; CHECK-LABEL: define {{[^@]+}}@unmergable_3_proc_bind
3583 ; CHECK-SAME: (i32 [[A:%.*]]) local_unnamed_addr {
3584 ; CHECK-NEXT: entry:
3585 ; CHECK-NEXT: [[A_ADDR:%.*]] = alloca i32, align 4
3586 ; CHECK-NEXT: [[TMP0:%.*]] = call i32 @__kmpc_global_thread_num(ptr noundef nonnull align 8 dereferenceable(24) @[[GLOB1]])
3587 ; CHECK-NEXT: store i32 [[A]], ptr [[A_ADDR]], align 4
3588 ; CHECK-NEXT: call void (ptr, i32, ptr, ...) @__kmpc_fork_call(ptr noundef nonnull align 8 dereferenceable(24) @[[GLOB1]], i32 noundef 1, ptr noundef @.omp_outlined..31, ptr nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[A_ADDR]])
3589 ; CHECK-NEXT: call void @__kmpc_push_proc_bind(ptr noundef nonnull align 8 dereferenceable(24) @[[GLOB1]], i32 [[TMP0]], i32 noundef 3)
3590 ; CHECK-NEXT: call void (ptr, i32, ptr, ...) @__kmpc_fork_call(ptr noundef nonnull align 8 dereferenceable(24) @[[GLOB1]], i32 noundef 1, ptr noundef @.omp_outlined..32, ptr nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[A_ADDR]])
3591 ; CHECK-NEXT: call void (ptr, i32, ptr, ...) @__kmpc_fork_call(ptr noundef nonnull align 8 dereferenceable(24) @[[GLOB1]], i32 noundef 1, ptr noundef @.omp_outlined..33, ptr nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[A_ADDR]])
3592 ; CHECK-NEXT: ret void
3593 ; CHECK-LABEL: define {{[^@]+}}@.omp_outlined..31
3594 ; CHECK-SAME: (ptr noalias nocapture nofree readnone [[DOTGLOBAL_TID_:%.*]], ptr noalias nocapture nofree readnone [[DOTBOUND_TID_:%.*]], ptr nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[A:%.*]]) {
3595 ; CHECK-NEXT: entry:
3596 ; CHECK-NEXT: [[TMP0:%.*]] = load i32, ptr [[A]], align 4
3597 ; CHECK-NEXT: call void @use(i32 [[TMP0]])
3598 ; CHECK-NEXT: ret void
3599 ; CHECK-LABEL: define {{[^@]+}}@.omp_outlined..32
3600 ; CHECK-SAME: (ptr noalias nocapture nofree readnone [[DOTGLOBAL_TID_:%.*]], ptr noalias nocapture nofree readnone [[DOTBOUND_TID_:%.*]], ptr nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[A:%.*]]) {
3601 ; CHECK-NEXT: entry:
3602 ; CHECK-NEXT: [[TMP0:%.*]] = load i32, ptr [[A]], align 4
3603 ; CHECK-NEXT: call void @use(i32 [[TMP0]])
3604 ; CHECK-NEXT: ret void
3605 ; CHECK-LABEL: define {{[^@]+}}@.omp_outlined..33
3606 ; CHECK-SAME: (ptr noalias nocapture nofree readnone [[DOTGLOBAL_TID_:%.*]], ptr noalias nocapture nofree readnone [[DOTBOUND_TID_:%.*]], ptr nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[A:%.*]]) {
3607 ; CHECK-NEXT: entry:
3608 ; CHECK-NEXT: [[TMP0:%.*]] = load i32, ptr [[A]], align 4
3609 ; CHECK-NEXT: call void @use(i32 [[TMP0]])
3610 ; CHECK-NEXT: ret void
3611 ; CHECK-LABEL: define {{[^@]+}}@unmergable_3_num_threads
3612 ; CHECK-SAME: (i32 [[A:%.*]]) local_unnamed_addr {
3613 ; CHECK-NEXT: entry:
3614 ; CHECK-NEXT: [[A_ADDR:%.*]] = alloca i32, align 4
3615 ; CHECK-NEXT: [[TMP0:%.*]] = call i32 @__kmpc_global_thread_num(ptr noundef nonnull align 8 dereferenceable(24) @[[GLOB1]])
3616 ; CHECK-NEXT: store i32 [[A]], ptr [[A_ADDR]], align 4
3617 ; CHECK-NEXT: call void (ptr, i32, ptr, ...) @__kmpc_fork_call(ptr noundef nonnull align 8 dereferenceable(24) @[[GLOB1]], i32 noundef 1, ptr noundef @.omp_outlined..34, ptr nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[A_ADDR]])
3618 ; CHECK-NEXT: [[TMP1:%.*]] = load i32, ptr [[A_ADDR]], align 4
3619 ; CHECK-NEXT: call void @__kmpc_push_num_threads(ptr noundef nonnull align 8 dereferenceable(24) @[[GLOB1]], i32 [[TMP0]], i32 [[TMP1]])
3620 ; CHECK-NEXT: call void (ptr, i32, ptr, ...) @__kmpc_fork_call(ptr noundef nonnull align 8 dereferenceable(24) @[[GLOB1]], i32 noundef 1, ptr noundef @.omp_outlined..35, ptr nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[A_ADDR]])
3621 ; CHECK-NEXT: call void (ptr, i32, ptr, ...) @__kmpc_fork_call(ptr noundef nonnull align 8 dereferenceable(24) @[[GLOB1]], i32 noundef 1, ptr noundef @.omp_outlined..36, ptr nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[A_ADDR]])
3622 ; CHECK-NEXT: ret void
3623 ; CHECK-LABEL: define {{[^@]+}}@.omp_outlined..34
3624 ; CHECK-SAME: (ptr noalias nocapture nofree readnone [[DOTGLOBAL_TID_:%.*]], ptr noalias nocapture nofree readnone [[DOTBOUND_TID_:%.*]], ptr nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[A:%.*]]) {
3625 ; CHECK-NEXT: entry:
3626 ; CHECK-NEXT: [[TMP0:%.*]] = load i32, ptr [[A]], align 4
3627 ; CHECK-NEXT: call void @use(i32 [[TMP0]])
3628 ; CHECK-NEXT: ret void
3629 ; CHECK-LABEL: define {{[^@]+}}@.omp_outlined..35
3630 ; CHECK-SAME: (ptr noalias nocapture nofree readnone [[DOTGLOBAL_TID_:%.*]], ptr noalias nocapture nofree readnone [[DOTBOUND_TID_:%.*]], ptr nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[A:%.*]]) {
3631 ; CHECK-NEXT: entry:
3632 ; CHECK-NEXT: [[TMP0:%.*]] = load i32, ptr [[A]], align 4
3633 ; CHECK-NEXT: call void @use(i32 [[TMP0]])
3634 ; CHECK-NEXT: ret void
3635 ; CHECK-LABEL: define {{[^@]+}}@.omp_outlined..36
3636 ; CHECK-SAME: (ptr noalias nocapture nofree readnone [[DOTGLOBAL_TID_:%.*]], ptr noalias nocapture nofree readnone [[DOTBOUND_TID_:%.*]], ptr nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[A:%.*]]) {
3637 ; CHECK-NEXT: entry:
3638 ; CHECK-NEXT: [[TMP0:%.*]] = load i32, ptr [[A]], align 4
3639 ; CHECK-NEXT: call void @use(i32 [[TMP0]])
3640 ; CHECK-NEXT: ret void
3641 ; CHECK-LABEL: define {{[^@]+}}@merge_2_unmergable_1
3642 ; CHECK-SAME: (i32 [[A:%.*]]) local_unnamed_addr {
3643 ; CHECK-NEXT: entry:
3644 ; CHECK-NEXT: [[A_ADDR:%.*]] = alloca i32, align 4
3645 ; CHECK-NEXT: store i32 [[A]], ptr [[A_ADDR]], align 4
3646 ; CHECK-NEXT: [[OMP_GLOBAL_THREAD_NUM:%.*]] = call i32 @__kmpc_global_thread_num(ptr @[[GLOB1]])
3647 ; CHECK-NEXT: br label [[OMP_PARALLEL:%.*]]
3648 ; CHECK: omp_parallel:
3649 ; CHECK-NEXT: call void (ptr, i32, ptr, ...) @__kmpc_fork_call(ptr @[[GLOB1]], i32 1, ptr @merge_2_unmergable_1..omp_par, ptr [[A_ADDR]])
3650 ; CHECK-NEXT: br label [[OMP_PAR_OUTLINED_EXIT:%.*]]
3651 ; CHECK: omp.par.outlined.exit:
3652 ; CHECK-NEXT: br label [[OMP_PAR_EXIT_SPLIT:%.*]]
3653 ; CHECK: omp.par.exit.split:
3654 ; CHECK-NEXT: br label [[ENTRY_SPLIT_SPLIT:%.*]]
3655 ; CHECK: entry.split.split:
3656 ; CHECK-NEXT: call void (...) @foo()
3657 ; CHECK-NEXT: call void (ptr, i32, ptr, ...) @__kmpc_fork_call(ptr noundef nonnull align 8 dereferenceable(24) @[[GLOB1]], i32 noundef 1, ptr noundef @.omp_outlined..39, ptr nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[A_ADDR]])
3658 ; CHECK-NEXT: ret void
3659 ; CHECK-LABEL: define {{[^@]+}}@merge_2_unmergable_1..omp_par
3660 ; CHECK-SAME: (ptr noalias [[TID_ADDR:%.*]], ptr noalias [[ZERO_ADDR:%.*]], ptr [[A_ADDR:%.*]]) #[[ATTR0]] {
3661 ; CHECK-NEXT: omp.par.entry:
3662 ; CHECK-NEXT: [[TID_ADDR_LOCAL:%.*]] = alloca i32, align 4
3663 ; CHECK-NEXT: [[TMP0:%.*]] = load i32, ptr [[TID_ADDR]], align 4
3664 ; CHECK-NEXT: store i32 [[TMP0]], ptr [[TID_ADDR_LOCAL]], align 4
3665 ; CHECK-NEXT: [[TID:%.*]] = load i32, ptr [[TID_ADDR_LOCAL]], align 4
3666 ; CHECK-NEXT: br label [[OMP_PAR_REGION:%.*]]
3667 ; CHECK: omp.par.outlined.exit.exitStub:
3668 ; CHECK-NEXT: ret void
3669 ; CHECK: omp.par.region:
3670 ; CHECK-NEXT: br label [[OMP_PAR_MERGED:%.*]]
3671 ; CHECK: omp.par.merged:
3672 ; CHECK-NEXT: call void @.omp_outlined..37(ptr [[TID_ADDR]], ptr [[ZERO_ADDR]], ptr nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[A_ADDR]])
3673 ; CHECK-NEXT: [[OMP_GLOBAL_THREAD_NUM:%.*]] = call i32 @__kmpc_global_thread_num(ptr @[[GLOB1]])
3674 ; CHECK-NEXT: call void @__kmpc_barrier(ptr @[[GLOB2]], i32 [[OMP_GLOBAL_THREAD_NUM]])
3675 ; CHECK-NEXT: call void @.omp_outlined..38(ptr [[TID_ADDR]], ptr [[ZERO_ADDR]], ptr nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[A_ADDR]])
3676 ; CHECK-NEXT: br label [[ENTRY_SPLIT:%.*]]
3677 ; CHECK: entry.split:
3678 ; CHECK-NEXT: br label [[OMP_PAR_REGION_SPLIT:%.*]]
3679 ; CHECK: omp.par.region.split:
3680 ; CHECK-NEXT: br label [[OMP_PAR_PRE_FINALIZE:%.*]]
3681 ; CHECK: omp.par.pre_finalize:
3682 ; CHECK-NEXT: br label [[OMP_PAR_OUTLINED_EXIT_EXITSTUB:%.*]]
3683 ; CHECK-LABEL: define {{[^@]+}}@.omp_outlined..37
3684 ; CHECK-SAME: (ptr noalias nocapture nofree readnone [[DOTGLOBAL_TID_:%.*]], ptr noalias nocapture nofree readnone [[DOTBOUND_TID_:%.*]], ptr nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[A:%.*]]) {
3685 ; CHECK-NEXT: entry:
3686 ; CHECK-NEXT: [[TMP0:%.*]] = load i32, ptr [[A]], align 4
3687 ; CHECK-NEXT: call void @use(i32 [[TMP0]])
3688 ; CHECK-NEXT: ret void
3689 ; CHECK-LABEL: define {{[^@]+}}@.omp_outlined..38
3690 ; CHECK-SAME: (ptr noalias nocapture nofree readnone [[DOTGLOBAL_TID_:%.*]], ptr noalias nocapture nofree readnone [[DOTBOUND_TID_:%.*]], ptr nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[A:%.*]]) {
3691 ; CHECK-NEXT: entry:
3692 ; CHECK-NEXT: [[TMP0:%.*]] = load i32, ptr [[A]], align 4
3693 ; CHECK-NEXT: call void @use(i32 [[TMP0]])
3694 ; CHECK-NEXT: ret void
3695 ; CHECK-LABEL: define {{[^@]+}}@.omp_outlined..39
3696 ; CHECK-SAME: (ptr noalias nocapture nofree readnone [[DOTGLOBAL_TID_:%.*]], ptr noalias nocapture nofree readnone [[DOTBOUND_TID_:%.*]], ptr nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[A:%.*]]) {
3697 ; CHECK-NEXT: entry:
3698 ; CHECK-NEXT: [[TMP0:%.*]] = load i32, ptr [[A]], align 4
3699 ; CHECK-NEXT: call void @use(i32 [[TMP0]])
3700 ; CHECK-NEXT: ret void
3701 ; CHECK-LABEL: define {{[^@]+}}@merge
3702 ; CHECK-SAME: (i32 [[A:%.*]]) local_unnamed_addr {
3703 ; CHECK-NEXT: entry:
3704 ; CHECK-NEXT: [[A_ADDR:%.*]] = alloca i32, align 4
3705 ; CHECK-NEXT: store i32 [[A]], ptr [[A_ADDR]], align 4
3706 ; CHECK-NEXT: [[OMP_GLOBAL_THREAD_NUM:%.*]] = call i32 @__kmpc_global_thread_num(ptr @[[GLOB1]])
3707 ; CHECK-NEXT: br label [[OMP_PARALLEL:%.*]]
3708 ; CHECK: omp_parallel:
3709 ; CHECK-NEXT: call void (ptr, i32, ptr, ...) @__kmpc_fork_call(ptr @[[GLOB1]], i32 1, ptr @merge..omp_par, ptr [[A_ADDR]])
3710 ; CHECK-NEXT: br label [[OMP_PAR_OUTLINED_EXIT:%.*]]
3711 ; CHECK: omp.par.outlined.exit:
3712 ; CHECK-NEXT: br label [[OMP_PAR_EXIT_SPLIT:%.*]]
3713 ; CHECK: omp.par.exit.split:
3714 ; CHECK-NEXT: br label [[ENTRY_SPLIT_SPLIT:%.*]]
3715 ; CHECK: entry.split.split:
3716 ; CHECK-NEXT: ret void
3717 ; CHECK-LABEL: define {{[^@]+}}@merge..omp_par
3718 ; CHECK-SAME: (ptr noalias [[TID_ADDR:%.*]], ptr noalias [[ZERO_ADDR:%.*]], ptr [[A_ADDR:%.*]]) #[[ATTR0]] {
3719 ; CHECK-NEXT: omp.par.entry:
3720 ; CHECK-NEXT: [[TID_ADDR_LOCAL:%.*]] = alloca i32, align 4
3721 ; CHECK-NEXT: [[TMP0:%.*]] = load i32, ptr [[TID_ADDR]], align 4
3722 ; CHECK-NEXT: store i32 [[TMP0]], ptr [[TID_ADDR_LOCAL]], align 4
3723 ; CHECK-NEXT: [[TID:%.*]] = load i32, ptr [[TID_ADDR_LOCAL]], align 4
3724 ; CHECK-NEXT: br label [[OMP_PAR_REGION:%.*]]
3725 ; CHECK: omp.par.outlined.exit.exitStub:
3726 ; CHECK-NEXT: ret void
3727 ; CHECK: omp.par.region:
3728 ; CHECK-NEXT: br label [[OMP_PAR_MERGED:%.*]]
3729 ; CHECK: omp.par.merged:
3730 ; CHECK-NEXT: call void @.omp_outlined.(ptr [[TID_ADDR]], ptr [[ZERO_ADDR]], ptr nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[A_ADDR]])
3731 ; CHECK-NEXT: [[OMP_GLOBAL_THREAD_NUM:%.*]] = call i32 @__kmpc_global_thread_num(ptr @[[GLOB1]])
3732 ; CHECK-NEXT: call void @__kmpc_barrier(ptr @[[GLOB2]], i32 [[OMP_GLOBAL_THREAD_NUM]])
3733 ; CHECK-NEXT: call void @.omp_outlined..1(ptr [[TID_ADDR]], ptr [[ZERO_ADDR]], ptr nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[A_ADDR]])
3734 ; CHECK-NEXT: br label [[ENTRY_SPLIT:%.*]]
3735 ; CHECK: entry.split:
3736 ; CHECK-NEXT: br label [[OMP_PAR_REGION_SPLIT:%.*]]
3737 ; CHECK: omp.par.region.split:
3738 ; CHECK-NEXT: br label [[OMP_PAR_PRE_FINALIZE:%.*]]
3739 ; CHECK: omp.par.pre_finalize:
3740 ; CHECK-NEXT: br label [[OMP_PAR_OUTLINED_EXIT_EXITSTUB:%.*]]
3741 ; CHECK-LABEL: define {{[^@]+}}@.omp_outlined.
3742 ; CHECK-SAME: (ptr noalias nocapture nofree readnone [[DOTGLOBAL_TID_:%.*]], ptr noalias nocapture nofree readnone [[DOTBOUND_TID_:%.*]], ptr nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[A:%.*]]) {
3743 ; CHECK-NEXT: entry:
3744 ; CHECK-NEXT: [[TMP0:%.*]] = load i32, ptr [[A]], align 4
3745 ; CHECK-NEXT: call void @use(i32 [[TMP0]])
3746 ; CHECK-NEXT: ret void
3747 ; CHECK-LABEL: define {{[^@]+}}@.omp_outlined..1
3748 ; CHECK-SAME: (ptr noalias nocapture nofree readnone [[DOTGLOBAL_TID_:%.*]], ptr noalias nocapture nofree readnone [[DOTBOUND_TID_:%.*]], ptr nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[A:%.*]]) {
3749 ; CHECK-NEXT: entry:
3750 ; CHECK-NEXT: [[TMP0:%.*]] = load i32, ptr [[A]], align 4
3751 ; CHECK-NEXT: call void @use(i32 [[TMP0]])
3752 ; CHECK-NEXT: ret void
3753 ; CHECK-LABEL: define {{[^@]+}}@unmergable_proc_bind
3754 ; CHECK-SAME: (i32 [[A:%.*]]) local_unnamed_addr {
3755 ; CHECK-NEXT: entry:
3756 ; CHECK-NEXT: [[A_ADDR:%.*]] = alloca i32, align 4
3757 ; CHECK-NEXT: [[TMP0:%.*]] = call i32 @__kmpc_global_thread_num(ptr noundef nonnull align 8 dereferenceable(24) @[[GLOB1]])
3758 ; CHECK-NEXT: store i32 [[A]], ptr [[A_ADDR]], align 4
3759 ; CHECK-NEXT: call void @__kmpc_push_proc_bind(ptr noundef nonnull align 8 dereferenceable(24) @[[GLOB1]], i32 [[TMP0]], i32 noundef 3)
3760 ; CHECK-NEXT: call void (ptr, i32, ptr, ...) @__kmpc_fork_call(ptr noundef nonnull align 8 dereferenceable(24) @[[GLOB1]], i32 noundef 1, ptr noundef @.omp_outlined..2, ptr nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[A_ADDR]])
3761 ; CHECK-NEXT: call void (ptr, i32, ptr, ...) @__kmpc_fork_call(ptr noundef nonnull align 8 dereferenceable(24) @[[GLOB1]], i32 noundef 1, ptr noundef @.omp_outlined..3, ptr nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[A_ADDR]])
3762 ; CHECK-NEXT: ret void
3763 ; CHECK-LABEL: define {{[^@]+}}@.omp_outlined..2
3764 ; CHECK-SAME: (ptr noalias nocapture nofree readnone [[DOTGLOBAL_TID_:%.*]], ptr noalias nocapture nofree readnone [[DOTBOUND_TID_:%.*]], ptr nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[A:%.*]]) {
3765 ; CHECK-NEXT: entry:
3766 ; CHECK-NEXT: [[TMP0:%.*]] = load i32, ptr [[A]], align 4
3767 ; CHECK-NEXT: call void @use(i32 [[TMP0]])
3768 ; CHECK-NEXT: ret void
3769 ; CHECK-LABEL: define {{[^@]+}}@.omp_outlined..3
3770 ; CHECK-SAME: (ptr noalias nocapture nofree readnone [[DOTGLOBAL_TID_:%.*]], ptr noalias nocapture nofree readnone [[DOTBOUND_TID_:%.*]], ptr nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[A:%.*]]) {
3771 ; CHECK-NEXT: entry:
3772 ; CHECK-NEXT: [[TMP0:%.*]] = load i32, ptr [[A]], align 4
3773 ; CHECK-NEXT: call void @use(i32 [[TMP0]])
3774 ; CHECK-NEXT: ret void
3775 ; CHECK-LABEL: define {{[^@]+}}@unmergable_num_threads
3776 ; CHECK-SAME: (i32 [[A:%.*]]) local_unnamed_addr {
3777 ; CHECK-NEXT: entry:
3778 ; CHECK-NEXT: [[A_ADDR:%.*]] = alloca i32, align 4
3779 ; CHECK-NEXT: [[TMP0:%.*]] = call i32 @__kmpc_global_thread_num(ptr noundef nonnull align 8 dereferenceable(24) @[[GLOB1]])
3780 ; CHECK-NEXT: store i32 [[A]], ptr [[A_ADDR]], align 4
3781 ; CHECK-NEXT: call void @__kmpc_push_num_threads(ptr noundef nonnull align 8 dereferenceable(24) @[[GLOB1]], i32 [[TMP0]], i32 [[A]])
3782 ; CHECK-NEXT: call void (ptr, i32, ptr, ...) @__kmpc_fork_call(ptr noundef nonnull align 8 dereferenceable(24) @[[GLOB1]], i32 noundef 1, ptr noundef @.omp_outlined..4, ptr nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[A_ADDR]])
3783 ; CHECK-NEXT: call void (ptr, i32, ptr, ...) @__kmpc_fork_call(ptr noundef nonnull align 8 dereferenceable(24) @[[GLOB1]], i32 noundef 1, ptr noundef @.omp_outlined..5, ptr nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[A_ADDR]])
3784 ; CHECK-NEXT: ret void
3785 ; CHECK-LABEL: define {{[^@]+}}@.omp_outlined..4
3786 ; CHECK-SAME: (ptr noalias nocapture nofree readnone [[DOTGLOBAL_TID_:%.*]], ptr noalias nocapture nofree readnone [[DOTBOUND_TID_:%.*]], ptr nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[A:%.*]]) {
3787 ; CHECK-NEXT: entry:
3788 ; CHECK-NEXT: [[TMP0:%.*]] = load i32, ptr [[A]], align 4
3789 ; CHECK-NEXT: call void @use(i32 [[TMP0]])
3790 ; CHECK-NEXT: ret void
3791 ; CHECK-LABEL: define {{[^@]+}}@.omp_outlined..5
3792 ; CHECK-SAME: (ptr noalias nocapture nofree readnone [[DOTGLOBAL_TID_:%.*]], ptr noalias nocapture nofree readnone [[DOTBOUND_TID_:%.*]], ptr nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[A:%.*]]) {
3793 ; CHECK-NEXT: entry:
3794 ; CHECK-NEXT: [[TMP0:%.*]] = load i32, ptr [[A]], align 4
3795 ; CHECK-NEXT: call void @use(i32 [[TMP0]])
3796 ; CHECK-NEXT: ret void
3797 ; CHECK-LABEL: define {{[^@]+}}@unmergable_seq_call
3798 ; CHECK-SAME: (i32 [[A:%.*]]) local_unnamed_addr {
3799 ; CHECK-NEXT: entry:
3800 ; CHECK-NEXT: [[A_ADDR:%.*]] = alloca i32, align 4
3801 ; CHECK-NEXT: store i32 [[A]], ptr [[A_ADDR]], align 4
3802 ; CHECK-NEXT: call void (ptr, i32, ptr, ...) @__kmpc_fork_call(ptr noundef nonnull align 8 dereferenceable(24) @[[GLOB1]], i32 noundef 1, ptr noundef @.omp_outlined..6, ptr nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[A_ADDR]])
3803 ; CHECK-NEXT: call void (...) @foo()
3804 ; CHECK-NEXT: call void (ptr, i32, ptr, ...) @__kmpc_fork_call(ptr noundef nonnull align 8 dereferenceable(24) @[[GLOB1]], i32 noundef 1, ptr noundef @.omp_outlined..7, ptr nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[A_ADDR]])
3805 ; CHECK-NEXT: ret void
3806 ; CHECK-LABEL: define {{[^@]+}}@.omp_outlined..6
3807 ; CHECK-SAME: (ptr noalias nocapture nofree readnone [[DOTGLOBAL_TID_:%.*]], ptr noalias nocapture nofree readnone [[DOTBOUND_TID_:%.*]], ptr nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[A:%.*]]) {
3808 ; CHECK-NEXT: entry:
3809 ; CHECK-NEXT: [[TMP0:%.*]] = load i32, ptr [[A]], align 4
3810 ; CHECK-NEXT: call void @use(i32 [[TMP0]])
3811 ; CHECK-NEXT: ret void
3812 ; CHECK-LABEL: define {{[^@]+}}@.omp_outlined..7
3813 ; CHECK-SAME: (ptr noalias nocapture nofree readnone [[DOTGLOBAL_TID_:%.*]], ptr noalias nocapture nofree readnone [[DOTBOUND_TID_:%.*]], ptr nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[A:%.*]]) {
3814 ; CHECK-NEXT: entry:
3815 ; CHECK-NEXT: [[TMP0:%.*]] = load i32, ptr [[A]], align 4
3816 ; CHECK-NEXT: call void @use(i32 [[TMP0]])
3817 ; CHECK-NEXT: ret void
3818 ; CHECK-LABEL: define {{[^@]+}}@merge_seq
3819 ; CHECK-SAME: (i32 [[A:%.*]]) local_unnamed_addr {
3820 ; CHECK-NEXT: entry:
3821 ; CHECK-NEXT: [[A_ADDR:%.*]] = alloca i32, align 4
3822 ; CHECK-NEXT: store i32 [[A]], ptr [[A_ADDR]], align 4
3823 ; CHECK-NEXT: [[OMP_GLOBAL_THREAD_NUM2:%.*]] = call i32 @__kmpc_global_thread_num(ptr @[[GLOB1]])
3824 ; CHECK-NEXT: br label [[OMP_PARALLEL:%.*]]
3825 ; CHECK: omp_parallel:
3826 ; CHECK-NEXT: call void (ptr, i32, ptr, ...) @__kmpc_fork_call(ptr @[[GLOB1]], i32 1, ptr @merge_seq..omp_par, ptr [[A_ADDR]])
3827 ; CHECK-NEXT: br label [[OMP_PAR_OUTLINED_EXIT:%.*]]
3828 ; CHECK: omp.par.outlined.exit:
3829 ; CHECK-NEXT: br label [[OMP_PAR_EXIT_SPLIT:%.*]]
3830 ; CHECK: omp.par.exit.split:
3831 ; CHECK-NEXT: br label [[ENTRY_SPLIT_SPLIT:%.*]]
3832 ; CHECK: entry.split.split:
3833 ; CHECK-NEXT: [[TMP0:%.*]] = load i32, ptr [[A_ADDR]], align 4
3834 ; CHECK-NEXT: call void @use(i32 [[TMP0]])
3835 ; CHECK-NEXT: ret void
3836 ; CHECK-LABEL: define {{[^@]+}}@merge_seq..omp_par
3837 ; CHECK-SAME: (ptr noalias [[TID_ADDR:%.*]], ptr noalias [[ZERO_ADDR:%.*]], ptr [[A_ADDR:%.*]]) #[[ATTR0]] {
3838 ; CHECK-NEXT: omp.par.entry:
3839 ; CHECK-NEXT: [[TID_ADDR_LOCAL:%.*]] = alloca i32, align 4
3840 ; CHECK-NEXT: [[TMP0:%.*]] = load i32, ptr [[TID_ADDR]], align 4
3841 ; CHECK-NEXT: store i32 [[TMP0]], ptr [[TID_ADDR_LOCAL]], align 4
3842 ; CHECK-NEXT: [[TID:%.*]] = load i32, ptr [[TID_ADDR_LOCAL]], align 4
3843 ; CHECK-NEXT: br label [[OMP_PAR_REGION:%.*]]
3844 ; CHECK: omp.par.outlined.exit.exitStub:
3845 ; CHECK-NEXT: ret void
3846 ; CHECK: omp.par.region:
3847 ; CHECK-NEXT: br label [[OMP_PAR_MERGED:%.*]]
3848 ; CHECK: omp.par.merged:
3849 ; CHECK-NEXT: call void @.omp_outlined..8(ptr [[TID_ADDR]], ptr [[ZERO_ADDR]], ptr nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[A_ADDR]])
3850 ; CHECK-NEXT: [[OMP_GLOBAL_THREAD_NUM2:%.*]] = call i32 @__kmpc_global_thread_num(ptr @[[GLOB1]])
3851 ; CHECK-NEXT: call void @__kmpc_barrier(ptr @[[GLOB2]], i32 [[OMP_GLOBAL_THREAD_NUM2]])
3852 ; CHECK-NEXT: [[OMP_GLOBAL_THREAD_NUM:%.*]] = call i32 @__kmpc_global_thread_num(ptr @[[GLOB1]])
3853 ; CHECK-NEXT: [[TMP1:%.*]] = call i32 @__kmpc_master(ptr @[[GLOB1]], i32 [[OMP_GLOBAL_THREAD_NUM]])
3854 ; CHECK-NEXT: [[TMP2:%.*]] = icmp ne i32 [[TMP1]], 0
3855 ; CHECK-NEXT: br i1 [[TMP2]], label [[OMP_REGION_BODY:%.*]], label [[OMP_REGION_END:%.*]]
3856 ; CHECK: omp_region.end:
3857 ; CHECK-NEXT: [[OMP_GLOBAL_THREAD_NUM1:%.*]] = call i32 @__kmpc_global_thread_num(ptr @[[GLOB1]])
3858 ; CHECK-NEXT: call void @__kmpc_barrier(ptr @[[GLOB2]], i32 [[OMP_GLOBAL_THREAD_NUM1]])
3859 ; CHECK-NEXT: br label [[OMP_PAR_MERGED_SPLIT_SPLIT:%.*]]
3860 ; CHECK: omp.par.merged.split.split:
3861 ; CHECK-NEXT: call void @.omp_outlined..9(ptr [[TID_ADDR]], ptr [[ZERO_ADDR]], ptr nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[A_ADDR]])
3862 ; CHECK-NEXT: br label [[ENTRY_SPLIT:%.*]]
3863 ; CHECK: entry.split:
3864 ; CHECK-NEXT: br label [[OMP_PAR_REGION_SPLIT:%.*]]
3865 ; CHECK: omp.par.region.split:
3866 ; CHECK-NEXT: br label [[OMP_PAR_PRE_FINALIZE:%.*]]
3867 ; CHECK: omp.par.pre_finalize:
3868 ; CHECK-NEXT: br label [[OMP_PAR_OUTLINED_EXIT_EXITSTUB:%.*]]
3869 ; CHECK: omp_region.body:
3870 ; CHECK-NEXT: br label [[SEQ_PAR_MERGED:%.*]]
3871 ; CHECK: seq.par.merged:
3872 ; CHECK-NEXT: [[TMP3:%.*]] = load i32, ptr [[A_ADDR]], align 4
3873 ; CHECK-NEXT: [[ADD:%.*]] = add nsw i32 [[TMP3]], 1
3874 ; CHECK-NEXT: store i32 [[ADD]], ptr [[A_ADDR]], align 4
3875 ; CHECK-NEXT: br label [[OMP_PAR_MERGED_SPLIT:%.*]]
3876 ; CHECK: omp.par.merged.split:
3877 ; CHECK-NEXT: br label [[OMP_REGION_BODY_SPLIT:%.*]]
3878 ; CHECK: omp_region.body.split:
3879 ; CHECK-NEXT: call void @__kmpc_end_master(ptr @[[GLOB1]], i32 [[OMP_GLOBAL_THREAD_NUM]])
3880 ; CHECK-NEXT: br label [[OMP_REGION_END]]
3881 ; CHECK-LABEL: define {{[^@]+}}@.omp_outlined..8
3882 ; CHECK-SAME: (ptr noalias nocapture nofree readnone [[DOTGLOBAL_TID_:%.*]], ptr noalias nocapture nofree readnone [[DOTBOUND_TID_:%.*]], ptr nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[A:%.*]]) {
3883 ; CHECK-NEXT: entry:
3884 ; CHECK-NEXT: [[TMP0:%.*]] = load i32, ptr [[A]], align 4
3885 ; CHECK-NEXT: call void @use(i32 [[TMP0]])
3886 ; CHECK-NEXT: ret void
3887 ; CHECK-LABEL: define {{[^@]+}}@.omp_outlined..9
3888 ; CHECK-SAME: (ptr noalias nocapture nofree readnone [[DOTGLOBAL_TID_:%.*]], ptr noalias nocapture nofree readnone [[DOTBOUND_TID_:%.*]], ptr nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[A:%.*]]) {
3889 ; CHECK-NEXT: entry:
3890 ; CHECK-NEXT: [[TMP0:%.*]] = load i32, ptr [[A]], align 4
3891 ; CHECK-NEXT: call void @use(i32 [[TMP0]])
3892 ; CHECK-NEXT: ret void
3893 ; CHECK-LABEL: define {{[^@]+}}@merge_seq_float
3894 ; CHECK-SAME: (float [[F:%.*]], ptr nocapture nofree writeonly [[P:%.*]]) local_unnamed_addr {
3895 ; CHECK-NEXT: entry:
3896 ; CHECK-NEXT: [[F_ADDR:%.*]] = alloca float, align 4
3897 ; CHECK-NEXT: store float [[F]], ptr [[F_ADDR]], align 4
3898 ; CHECK-NEXT: [[OMP_GLOBAL_THREAD_NUM2:%.*]] = call i32 @__kmpc_global_thread_num(ptr @[[GLOB1]])
3899 ; CHECK-NEXT: br label [[OMP_PARALLEL:%.*]]
3900 ; CHECK: omp_parallel:
3901 ; CHECK-NEXT: call void (ptr, i32, ptr, ...) @__kmpc_fork_call(ptr @[[GLOB1]], i32 2, ptr @merge_seq_float..omp_par, ptr [[F_ADDR]], ptr [[P]])
3902 ; CHECK-NEXT: br label [[OMP_PAR_OUTLINED_EXIT:%.*]]
3903 ; CHECK: omp.par.outlined.exit:
3904 ; CHECK-NEXT: br label [[OMP_PAR_EXIT_SPLIT:%.*]]
3905 ; CHECK: omp.par.exit.split:
3906 ; CHECK-NEXT: br label [[ENTRY_SPLIT_SPLIT:%.*]]
3907 ; CHECK: entry.split.split:
3908 ; CHECK-NEXT: ret void
3909 ; CHECK-LABEL: define {{[^@]+}}@merge_seq_float..omp_par
3910 ; CHECK-SAME: (ptr noalias [[TID_ADDR:%.*]], ptr noalias [[ZERO_ADDR:%.*]], ptr [[F_ADDR:%.*]], ptr [[P:%.*]]) #[[ATTR0]] {
3911 ; CHECK-NEXT: omp.par.entry:
3912 ; CHECK-NEXT: [[TID_ADDR_LOCAL:%.*]] = alloca i32, align 4
3913 ; CHECK-NEXT: [[TMP0:%.*]] = load i32, ptr [[TID_ADDR]], align 4
3914 ; CHECK-NEXT: store i32 [[TMP0]], ptr [[TID_ADDR_LOCAL]], align 4
3915 ; CHECK-NEXT: [[TID:%.*]] = load i32, ptr [[TID_ADDR_LOCAL]], align 4
3916 ; CHECK-NEXT: br label [[OMP_PAR_REGION:%.*]]
3917 ; CHECK: omp.par.outlined.exit.exitStub:
3918 ; CHECK-NEXT: ret void
3919 ; CHECK: omp.par.region:
3920 ; CHECK-NEXT: br label [[OMP_PAR_MERGED:%.*]]
3921 ; CHECK: omp.par.merged:
3922 ; CHECK-NEXT: call void @.omp_outlined..10(ptr [[TID_ADDR]], ptr [[ZERO_ADDR]], ptr nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[F_ADDR]])
3923 ; CHECK-NEXT: [[OMP_GLOBAL_THREAD_NUM2:%.*]] = call i32 @__kmpc_global_thread_num(ptr @[[GLOB1]])
3924 ; CHECK-NEXT: call void @__kmpc_barrier(ptr @[[GLOB2]], i32 [[OMP_GLOBAL_THREAD_NUM2]])
3925 ; CHECK-NEXT: [[OMP_GLOBAL_THREAD_NUM:%.*]] = call i32 @__kmpc_global_thread_num(ptr @[[GLOB1]])
3926 ; CHECK-NEXT: [[TMP1:%.*]] = call i32 @__kmpc_master(ptr @[[GLOB1]], i32 [[OMP_GLOBAL_THREAD_NUM]])
3927 ; CHECK-NEXT: [[TMP2:%.*]] = icmp ne i32 [[TMP1]], 0
3928 ; CHECK-NEXT: br i1 [[TMP2]], label [[OMP_REGION_BODY:%.*]], label [[OMP_REGION_END:%.*]]
3929 ; CHECK: omp_region.end:
3930 ; CHECK-NEXT: [[OMP_GLOBAL_THREAD_NUM1:%.*]] = call i32 @__kmpc_global_thread_num(ptr @[[GLOB1]])
3931 ; CHECK-NEXT: call void @__kmpc_barrier(ptr @[[GLOB2]], i32 [[OMP_GLOBAL_THREAD_NUM1]])
3932 ; CHECK-NEXT: br label [[OMP_PAR_MERGED_SPLIT_SPLIT:%.*]]
3933 ; CHECK: omp.par.merged.split.split:
3934 ; CHECK-NEXT: call void @.omp_outlined..11(ptr [[TID_ADDR]], ptr [[ZERO_ADDR]], ptr nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[F_ADDR]])
3935 ; CHECK-NEXT: br label [[ENTRY_SPLIT:%.*]]
3936 ; CHECK: entry.split:
3937 ; CHECK-NEXT: br label [[OMP_PAR_REGION_SPLIT:%.*]]
3938 ; CHECK: omp.par.region.split:
3939 ; CHECK-NEXT: br label [[OMP_PAR_PRE_FINALIZE:%.*]]
3940 ; CHECK: omp.par.pre_finalize:
3941 ; CHECK-NEXT: br label [[OMP_PAR_OUTLINED_EXIT_EXITSTUB:%.*]]
3942 ; CHECK: omp_region.body:
3943 ; CHECK-NEXT: br label [[SEQ_PAR_MERGED:%.*]]
3944 ; CHECK: seq.par.merged:
3945 ; CHECK-NEXT: [[TMP3:%.*]] = load float, ptr [[F_ADDR]], align 4
3946 ; CHECK-NEXT: [[ADD:%.*]] = fadd float [[TMP3]], 0x40091EB860000000
3947 ; CHECK-NEXT: store float [[ADD]], ptr [[P]], align 4
3948 ; CHECK-NEXT: br label [[OMP_PAR_MERGED_SPLIT:%.*]]
3949 ; CHECK: omp.par.merged.split:
3950 ; CHECK-NEXT: br label [[OMP_REGION_BODY_SPLIT:%.*]]
3951 ; CHECK: omp_region.body.split:
3952 ; CHECK-NEXT: call void @__kmpc_end_master(ptr @[[GLOB1]], i32 [[OMP_GLOBAL_THREAD_NUM]])
3953 ; CHECK-NEXT: br label [[OMP_REGION_END]]
3954 ; CHECK-LABEL: define {{[^@]+}}@.omp_outlined..10
3955 ; CHECK-SAME: (ptr noalias nocapture nofree readnone [[DOTGLOBAL_TID_:%.*]], ptr noalias nocapture nofree readnone [[DOTBOUND_TID_:%.*]], ptr nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[F:%.*]]) {
3956 ; CHECK-NEXT: entry:
3957 ; CHECK-NEXT: [[TMP0:%.*]] = load float, ptr [[F]], align 4
3958 ; CHECK-NEXT: [[CONV:%.*]] = fptosi float [[TMP0]] to i32
3959 ; CHECK-NEXT: call void @use(i32 [[CONV]])
3960 ; CHECK-NEXT: ret void
3961 ; CHECK-LABEL: define {{[^@]+}}@.omp_outlined..11
3962 ; CHECK-SAME: (ptr noalias nocapture nofree readnone [[DOTGLOBAL_TID_:%.*]], ptr noalias nocapture nofree readnone [[DOTBOUND_TID_:%.*]], ptr nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[F:%.*]]) {
3963 ; CHECK-NEXT: entry:
3964 ; CHECK-NEXT: [[TMP0:%.*]] = load float, ptr [[F]], align 4
3965 ; CHECK-NEXT: [[CONV:%.*]] = fptosi float [[TMP0]] to i32
3966 ; CHECK-NEXT: call void @use(i32 [[CONV]])
3967 ; CHECK-NEXT: ret void
3968 ; CHECK-LABEL: define {{[^@]+}}@merge_seq_firstprivate
3969 ; CHECK-SAME: (i32 [[A:%.*]]) local_unnamed_addr {
3970 ; CHECK-NEXT: entry:
3971 ; CHECK-NEXT: [[A_CASTED_SROA_0_0_INSERT_EXT_SEQ_OUTPUT_ALLOC:%.*]] = alloca i64, align 8
3972 ; CHECK-NEXT: [[A_ADDR:%.*]] = alloca i32, align 4
3973 ; CHECK-NEXT: store i32 [[A]], ptr [[A_ADDR]], align 4
3974 ; CHECK-NEXT: [[OMP_GLOBAL_THREAD_NUM2:%.*]] = call i32 @__kmpc_global_thread_num(ptr @[[GLOB1]])
3975 ; CHECK-NEXT: br label [[OMP_PARALLEL:%.*]]
3976 ; CHECK: omp_parallel:
3977 ; CHECK-NEXT: call void (ptr, i32, ptr, ...) @__kmpc_fork_call(ptr @[[GLOB1]], i32 2, ptr @merge_seq_firstprivate..omp_par, ptr [[A_ADDR]], ptr [[A_CASTED_SROA_0_0_INSERT_EXT_SEQ_OUTPUT_ALLOC]])
3978 ; CHECK-NEXT: br label [[OMP_PAR_OUTLINED_EXIT:%.*]]
3979 ; CHECK: omp.par.outlined.exit:
3980 ; CHECK-NEXT: br label [[OMP_PAR_EXIT_SPLIT:%.*]]
3981 ; CHECK: omp.par.exit.split:
3982 ; CHECK-NEXT: br label [[ENTRY_SPLIT_SPLIT:%.*]]
3983 ; CHECK: entry.split.split:
3984 ; CHECK-NEXT: [[TMP0:%.*]] = load i32, ptr [[A_ADDR]], align 4
3985 ; CHECK-NEXT: call void @use(i32 [[TMP0]])
3986 ; CHECK-NEXT: ret void
3987 ; CHECK-LABEL: define {{[^@]+}}@merge_seq_firstprivate..omp_par
3988 ; CHECK-SAME: (ptr noalias [[TID_ADDR:%.*]], ptr noalias [[ZERO_ADDR:%.*]], ptr [[A_ADDR:%.*]], ptr [[A_CASTED_SROA_0_0_INSERT_EXT_SEQ_OUTPUT_ALLOC:%.*]]) #[[ATTR0]] {
3989 ; CHECK-NEXT: omp.par.entry:
3990 ; CHECK-NEXT: [[TID_ADDR_LOCAL:%.*]] = alloca i32, align 4
3991 ; CHECK-NEXT: [[TMP0:%.*]] = load i32, ptr [[TID_ADDR]], align 4
3992 ; CHECK-NEXT: store i32 [[TMP0]], ptr [[TID_ADDR_LOCAL]], align 4
3993 ; CHECK-NEXT: [[TID:%.*]] = load i32, ptr [[TID_ADDR_LOCAL]], align 4
3994 ; CHECK-NEXT: br label [[OMP_PAR_REGION:%.*]]
3995 ; CHECK: omp.par.outlined.exit.exitStub:
3996 ; CHECK-NEXT: ret void
3997 ; CHECK: omp.par.region:
3998 ; CHECK-NEXT: br label [[OMP_PAR_MERGED:%.*]]
3999 ; CHECK: omp.par.merged:
4000 ; CHECK-NEXT: call void @.omp_outlined..12(ptr [[TID_ADDR]], ptr [[ZERO_ADDR]], ptr nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[A_ADDR]])
4001 ; CHECK-NEXT: [[OMP_GLOBAL_THREAD_NUM2:%.*]] = call i32 @__kmpc_global_thread_num(ptr @[[GLOB1]])
4002 ; CHECK-NEXT: call void @__kmpc_barrier(ptr @[[GLOB2]], i32 [[OMP_GLOBAL_THREAD_NUM2]])
4003 ; CHECK-NEXT: [[OMP_GLOBAL_THREAD_NUM:%.*]] = call i32 @__kmpc_global_thread_num(ptr @[[GLOB1]])
4004 ; CHECK-NEXT: [[TMP1:%.*]] = call i32 @__kmpc_master(ptr @[[GLOB1]], i32 [[OMP_GLOBAL_THREAD_NUM]])
4005 ; CHECK-NEXT: [[TMP2:%.*]] = icmp ne i32 [[TMP1]], 0
4006 ; CHECK-NEXT: br i1 [[TMP2]], label [[OMP_REGION_BODY:%.*]], label [[OMP_REGION_END:%.*]]
4007 ; CHECK: omp_region.end:
4008 ; CHECK-NEXT: [[OMP_GLOBAL_THREAD_NUM1:%.*]] = call i32 @__kmpc_global_thread_num(ptr @[[GLOB1]])
4009 ; CHECK-NEXT: call void @__kmpc_barrier(ptr @[[GLOB2]], i32 [[OMP_GLOBAL_THREAD_NUM1]])
4010 ; CHECK-NEXT: br label [[OMP_PAR_MERGED_SPLIT_SPLIT:%.*]]
4011 ; CHECK: omp.par.merged.split.split:
4012 ; CHECK-NEXT: [[A_CASTED_SROA_0_0_INSERT_EXT_SEQ_OUTPUT_LOAD:%.*]] = load i64, ptr [[A_CASTED_SROA_0_0_INSERT_EXT_SEQ_OUTPUT_ALLOC]], align 8
4013 ; CHECK-NEXT: call void @.omp_outlined..13(ptr [[TID_ADDR]], ptr [[ZERO_ADDR]], i64 [[A_CASTED_SROA_0_0_INSERT_EXT_SEQ_OUTPUT_LOAD]])
4014 ; CHECK-NEXT: br label [[ENTRY_SPLIT:%.*]]
4015 ; CHECK: entry.split:
4016 ; CHECK-NEXT: br label [[OMP_PAR_REGION_SPLIT:%.*]]
4017 ; CHECK: omp.par.region.split:
4018 ; CHECK-NEXT: br label [[OMP_PAR_PRE_FINALIZE:%.*]]
4019 ; CHECK: omp.par.pre_finalize:
4020 ; CHECK-NEXT: br label [[OMP_PAR_OUTLINED_EXIT_EXITSTUB:%.*]]
4021 ; CHECK: omp_region.body:
4022 ; CHECK-NEXT: br label [[SEQ_PAR_MERGED:%.*]]
4023 ; CHECK: seq.par.merged:
4024 ; CHECK-NEXT: [[TMP3:%.*]] = load i32, ptr [[A_ADDR]], align 4
4025 ; CHECK-NEXT: [[ADD:%.*]] = add nsw i32 [[TMP3]], 1
4026 ; CHECK-NEXT: store i32 [[ADD]], ptr [[A_ADDR]], align 4
4027 ; CHECK-NEXT: [[A_CASTED_SROA_0_0_INSERT_EXT:%.*]] = zext i32 [[ADD]] to i64
4028 ; CHECK-NEXT: store i64 [[A_CASTED_SROA_0_0_INSERT_EXT]], ptr [[A_CASTED_SROA_0_0_INSERT_EXT_SEQ_OUTPUT_ALLOC]], align 8
4029 ; CHECK-NEXT: br label [[OMP_PAR_MERGED_SPLIT:%.*]]
4030 ; CHECK: omp.par.merged.split:
4031 ; CHECK-NEXT: br label [[OMP_REGION_BODY_SPLIT:%.*]]
4032 ; CHECK: omp_region.body.split:
4033 ; CHECK-NEXT: call void @__kmpc_end_master(ptr @[[GLOB1]], i32 [[OMP_GLOBAL_THREAD_NUM]])
4034 ; CHECK-NEXT: br label [[OMP_REGION_END]]
4035 ; CHECK-LABEL: define {{[^@]+}}@.omp_outlined..12
4036 ; CHECK-SAME: (ptr noalias nocapture nofree readnone [[DOTGLOBAL_TID_:%.*]], ptr noalias nocapture nofree readnone [[DOTBOUND_TID_:%.*]], ptr nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[A:%.*]]) {
4037 ; CHECK-NEXT: entry:
4038 ; CHECK-NEXT: [[TMP0:%.*]] = load i32, ptr [[A]], align 4
4039 ; CHECK-NEXT: call void @use(i32 [[TMP0]])
4040 ; CHECK-NEXT: ret void
4041 ; CHECK-LABEL: define {{[^@]+}}@.omp_outlined..13
4042 ; CHECK-SAME: (ptr noalias nocapture nofree readnone [[DOTGLOBAL_TID_:%.*]], ptr noalias nocapture nofree readnone [[DOTBOUND_TID_:%.*]], i64 [[A:%.*]]) {
4043 ; CHECK-NEXT: entry:
4044 ; CHECK-NEXT: [[A_ADDR_SROA_0_0_EXTRACT_TRUNC:%.*]] = trunc i64 [[A]] to i32
4045 ; CHECK-NEXT: call void @use(i32 [[A_ADDR_SROA_0_0_EXTRACT_TRUNC]])
4046 ; CHECK-NEXT: ret void
4047 ; CHECK-LABEL: define {{[^@]+}}@merge_seq_sink_lt
4048 ; CHECK-SAME: (i32 [[A:%.*]]) local_unnamed_addr {
4049 ; CHECK-NEXT: entry:
4050 ; CHECK-NEXT: [[A_ADDR:%.*]] = alloca i32, align 4
4051 ; CHECK-NEXT: store i32 [[A]], ptr [[A_ADDR]], align 4
4052 ; CHECK-NEXT: [[OMP_GLOBAL_THREAD_NUM2:%.*]] = call i32 @__kmpc_global_thread_num(ptr @[[GLOB1]])
4053 ; CHECK-NEXT: br label [[OMP_PARALLEL:%.*]]
4054 ; CHECK: omp_parallel:
4055 ; CHECK-NEXT: call void (ptr, i32, ptr, ...) @__kmpc_fork_call(ptr @[[GLOB1]], i32 1, ptr @merge_seq_sink_lt..omp_par, ptr [[A_ADDR]])
4056 ; CHECK-NEXT: br label [[OMP_PAR_OUTLINED_EXIT:%.*]]
4057 ; CHECK: omp.par.outlined.exit:
4058 ; CHECK-NEXT: br label [[OMP_PAR_EXIT_SPLIT:%.*]]
4059 ; CHECK: omp.par.exit.split:
4060 ; CHECK-NEXT: br label [[ENTRY_SPLIT_SPLIT:%.*]]
4061 ; CHECK: entry.split.split:
4062 ; CHECK-NEXT: ret void
4063 ; CHECK-LABEL: define {{[^@]+}}@merge_seq_sink_lt..omp_par
4064 ; CHECK-SAME: (ptr noalias [[TID_ADDR:%.*]], ptr noalias [[ZERO_ADDR:%.*]], ptr [[A_ADDR:%.*]]) #[[ATTR0]] {
4065 ; CHECK-NEXT: omp.par.entry:
4066 ; CHECK-NEXT: [[B:%.*]] = alloca i32, align 4
4067 ; CHECK-NEXT: [[TID_ADDR_LOCAL:%.*]] = alloca i32, align 4
4068 ; CHECK-NEXT: [[TMP0:%.*]] = load i32, ptr [[TID_ADDR]], align 4
4069 ; CHECK-NEXT: store i32 [[TMP0]], ptr [[TID_ADDR_LOCAL]], align 4
4070 ; CHECK-NEXT: [[TID:%.*]] = load i32, ptr [[TID_ADDR_LOCAL]], align 4
4071 ; CHECK-NEXT: br label [[OMP_PAR_REGION:%.*]]
4072 ; CHECK: omp.par.outlined.exit.exitStub:
4073 ; CHECK-NEXT: ret void
4074 ; CHECK: omp.par.region:
4075 ; CHECK-NEXT: br label [[OMP_PAR_MERGED:%.*]]
4076 ; CHECK: omp.par.merged:
4077 ; CHECK-NEXT: call void @.omp_outlined..14(ptr [[TID_ADDR]], ptr [[ZERO_ADDR]], ptr nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[A_ADDR]])
4078 ; CHECK-NEXT: [[OMP_GLOBAL_THREAD_NUM2:%.*]] = call i32 @__kmpc_global_thread_num(ptr @[[GLOB1]])
4079 ; CHECK-NEXT: call void @__kmpc_barrier(ptr @[[GLOB2]], i32 [[OMP_GLOBAL_THREAD_NUM2]])
4080 ; CHECK-NEXT: [[OMP_GLOBAL_THREAD_NUM:%.*]] = call i32 @__kmpc_global_thread_num(ptr @[[GLOB1]])
4081 ; CHECK-NEXT: [[TMP1:%.*]] = call i32 @__kmpc_master(ptr @[[GLOB1]], i32 [[OMP_GLOBAL_THREAD_NUM]])
4082 ; CHECK-NEXT: [[TMP2:%.*]] = icmp ne i32 [[TMP1]], 0
4083 ; CHECK-NEXT: br i1 [[TMP2]], label [[OMP_REGION_BODY:%.*]], label [[OMP_REGION_END:%.*]]
4084 ; CHECK: omp_region.end:
4085 ; CHECK-NEXT: [[OMP_GLOBAL_THREAD_NUM1:%.*]] = call i32 @__kmpc_global_thread_num(ptr @[[GLOB1]])
4086 ; CHECK-NEXT: call void @__kmpc_barrier(ptr @[[GLOB2]], i32 [[OMP_GLOBAL_THREAD_NUM1]])
4087 ; CHECK-NEXT: br label [[OMP_PAR_MERGED_SPLIT_SPLIT:%.*]]
4088 ; CHECK: omp.par.merged.split.split:
4089 ; CHECK-NEXT: call void @.omp_outlined..15(ptr [[TID_ADDR]], ptr [[ZERO_ADDR]], ptr nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[A_ADDR]])
4090 ; CHECK-NEXT: br label [[ENTRY_SPLIT:%.*]]
4091 ; CHECK: entry.split:
4092 ; CHECK-NEXT: br label [[OMP_PAR_REGION_SPLIT:%.*]]
4093 ; CHECK: omp.par.region.split:
4094 ; CHECK-NEXT: br label [[OMP_PAR_PRE_FINALIZE:%.*]]
4095 ; CHECK: omp.par.pre_finalize:
4096 ; CHECK-NEXT: br label [[OMP_PAR_OUTLINED_EXIT_EXITSTUB:%.*]]
4097 ; CHECK: omp_region.body:
4098 ; CHECK-NEXT: br label [[SEQ_PAR_MERGED:%.*]]
4099 ; CHECK: seq.par.merged:
4100 ; CHECK-NEXT: call void @llvm.lifetime.start.p0(i64 noundef 4, ptr noundef nonnull [[B]])
4101 ; CHECK-NEXT: [[TMP4:%.*]] = ptrtoint ptr [[B]] to i64
4102 ; CHECK-NEXT: [[TMP5:%.*]] = trunc i64 [[TMP4]] to i32
4103 ; CHECK-NEXT: store i32 [[TMP5]], ptr [[B]], align 4
4104 ; CHECK-NEXT: call void @llvm.lifetime.end.p0(i64 noundef 4, ptr noundef nonnull [[B]])
4105 ; CHECK-NEXT: br label [[OMP_PAR_MERGED_SPLIT:%.*]]
4106 ; CHECK: omp.par.merged.split:
4107 ; CHECK-NEXT: br label [[OMP_REGION_BODY_SPLIT:%.*]]
4108 ; CHECK: omp_region.body.split:
4109 ; CHECK-NEXT: call void @__kmpc_end_master(ptr @[[GLOB1]], i32 [[OMP_GLOBAL_THREAD_NUM]])
4110 ; CHECK-NEXT: br label [[OMP_REGION_END]]
4111 ; CHECK-LABEL: define {{[^@]+}}@.omp_outlined..14
4112 ; CHECK-SAME: (ptr noalias nocapture nofree readnone [[DOTGLOBAL_TID_:%.*]], ptr noalias nocapture nofree readnone [[DOTBOUND_TID_:%.*]], ptr nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[A:%.*]]) {
4113 ; CHECK-NEXT: entry:
4114 ; CHECK-NEXT: [[TMP0:%.*]] = load i32, ptr [[A]], align 4
4115 ; CHECK-NEXT: call void @use(i32 [[TMP0]])
4116 ; CHECK-NEXT: ret void
4117 ; CHECK-LABEL: define {{[^@]+}}@.omp_outlined..15
4118 ; CHECK-SAME: (ptr noalias nocapture nofree readnone [[DOTGLOBAL_TID_:%.*]], ptr noalias nocapture nofree readnone [[DOTBOUND_TID_:%.*]], ptr nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[A:%.*]]) {
4119 ; CHECK-NEXT: entry:
4120 ; CHECK-NEXT: [[TMP0:%.*]] = load i32, ptr [[A]], align 4
4121 ; CHECK-NEXT: call void @use(i32 [[TMP0]])
4122 ; CHECK-NEXT: ret void
4123 ; CHECK-LABEL: define {{[^@]+}}@merge_seq_par_use
4124 ; CHECK-SAME: (i32 [[A:%.*]]) local_unnamed_addr {
4125 ; CHECK-NEXT: entry:
4126 ; CHECK-NEXT: [[A_ADDR:%.*]] = alloca i32, align 4
4127 ; CHECK-NEXT: [[B:%.*]] = alloca i32, align 4
4128 ; CHECK-NEXT: store i32 [[A]], ptr [[A_ADDR]], align 4
4129 ; CHECK-NEXT: [[OMP_GLOBAL_THREAD_NUM2:%.*]] = call i32 @__kmpc_global_thread_num(ptr @[[GLOB1]])
4130 ; CHECK-NEXT: br label [[OMP_PARALLEL:%.*]]
4131 ; CHECK: omp_parallel:
4132 ; CHECK-NEXT: call void @llvm.lifetime.start.p0(i64 -1, ptr [[B]])
4133 ; CHECK-NEXT: call void (ptr, i32, ptr, ...) @__kmpc_fork_call(ptr @[[GLOB1]], i32 2, ptr @merge_seq_par_use..omp_par, ptr [[A_ADDR]], ptr [[B]])
4134 ; CHECK-NEXT: br label [[OMP_PAR_OUTLINED_EXIT:%.*]]
4135 ; CHECK: omp.par.outlined.exit:
4136 ; CHECK-NEXT: br label [[OMP_PAR_EXIT_SPLIT:%.*]]
4137 ; CHECK: omp.par.exit.split:
4138 ; CHECK-NEXT: br label [[ENTRY_SPLIT_SPLIT:%.*]]
4139 ; CHECK: entry.split.split:
4140 ; CHECK-NEXT: call void @llvm.lifetime.end.p0(i64 noundef 4, ptr noundef nonnull [[B]])
4141 ; CHECK-NEXT: ret void
4142 ; CHECK-LABEL: define {{[^@]+}}@merge_seq_par_use..omp_par
4143 ; CHECK-SAME: (ptr noalias [[TID_ADDR:%.*]], ptr noalias [[ZERO_ADDR:%.*]], ptr [[A_ADDR:%.*]], ptr [[B:%.*]]) #[[ATTR0]] {
4144 ; CHECK-NEXT: omp.par.entry:
4145 ; CHECK-NEXT: [[TID_ADDR_LOCAL:%.*]] = alloca i32, align 4
4146 ; CHECK-NEXT: [[TMP0:%.*]] = load i32, ptr [[TID_ADDR]], align 4
4147 ; CHECK-NEXT: store i32 [[TMP0]], ptr [[TID_ADDR_LOCAL]], align 4
4148 ; CHECK-NEXT: [[TID:%.*]] = load i32, ptr [[TID_ADDR_LOCAL]], align 4
4149 ; CHECK-NEXT: br label [[OMP_PAR_REGION:%.*]]
4150 ; CHECK: omp.par.outlined.exit.exitStub:
4151 ; CHECK-NEXT: ret void
4152 ; CHECK: omp.par.region:
4153 ; CHECK-NEXT: br label [[OMP_PAR_MERGED:%.*]]
4154 ; CHECK: omp.par.merged:
4155 ; CHECK-NEXT: call void @.omp_outlined..16(ptr [[TID_ADDR]], ptr [[ZERO_ADDR]], ptr nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[A_ADDR]])
4156 ; CHECK-NEXT: [[OMP_GLOBAL_THREAD_NUM2:%.*]] = call i32 @__kmpc_global_thread_num(ptr @[[GLOB1]])
4157 ; CHECK-NEXT: call void @__kmpc_barrier(ptr @[[GLOB2]], i32 [[OMP_GLOBAL_THREAD_NUM2]])
4158 ; CHECK-NEXT: [[OMP_GLOBAL_THREAD_NUM:%.*]] = call i32 @__kmpc_global_thread_num(ptr @[[GLOB1]])
4159 ; CHECK-NEXT: [[TMP1:%.*]] = call i32 @__kmpc_master(ptr @[[GLOB1]], i32 [[OMP_GLOBAL_THREAD_NUM]])
4160 ; CHECK-NEXT: [[TMP2:%.*]] = icmp ne i32 [[TMP1]], 0
4161 ; CHECK-NEXT: br i1 [[TMP2]], label [[OMP_REGION_BODY:%.*]], label [[OMP_REGION_END:%.*]]
4162 ; CHECK: omp_region.end:
4163 ; CHECK-NEXT: [[OMP_GLOBAL_THREAD_NUM1:%.*]] = call i32 @__kmpc_global_thread_num(ptr @[[GLOB1]])
4164 ; CHECK-NEXT: call void @__kmpc_barrier(ptr @[[GLOB2]], i32 [[OMP_GLOBAL_THREAD_NUM1]])
4165 ; CHECK-NEXT: br label [[OMP_PAR_MERGED_SPLIT_SPLIT:%.*]]
4166 ; CHECK: omp.par.merged.split.split:
4167 ; CHECK-NEXT: call void @.omp_outlined..17(ptr [[TID_ADDR]], ptr [[ZERO_ADDR]], ptr nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[A_ADDR]], ptr nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[B]])
4168 ; CHECK-NEXT: br label [[ENTRY_SPLIT:%.*]]
4169 ; CHECK: entry.split:
4170 ; CHECK-NEXT: br label [[OMP_PAR_REGION_SPLIT:%.*]]
4171 ; CHECK: omp.par.region.split:
4172 ; CHECK-NEXT: br label [[OMP_PAR_PRE_FINALIZE:%.*]]
4173 ; CHECK: omp.par.pre_finalize:
4174 ; CHECK-NEXT: br label [[OMP_PAR_OUTLINED_EXIT_EXITSTUB:%.*]]
4175 ; CHECK: omp_region.body:
4176 ; CHECK-NEXT: br label [[SEQ_PAR_MERGED:%.*]]
4177 ; CHECK: seq.par.merged:
4178 ; CHECK-NEXT: [[TMP4:%.*]] = load i32, ptr [[A_ADDR]], align 4
4179 ; CHECK-NEXT: [[ADD:%.*]] = add nsw i32 [[TMP4]], 1
4180 ; CHECK-NEXT: store i32 [[ADD]], ptr [[B]], align 4
4181 ; CHECK-NEXT: br label [[OMP_PAR_MERGED_SPLIT:%.*]]
4182 ; CHECK: omp.par.merged.split:
4183 ; CHECK-NEXT: br label [[OMP_REGION_BODY_SPLIT:%.*]]
4184 ; CHECK: omp_region.body.split:
4185 ; CHECK-NEXT: call void @__kmpc_end_master(ptr @[[GLOB1]], i32 [[OMP_GLOBAL_THREAD_NUM]])
4186 ; CHECK-NEXT: br label [[OMP_REGION_END]]
4187 ; CHECK-LABEL: define {{[^@]+}}@.omp_outlined..16
4188 ; CHECK-SAME: (ptr noalias nocapture nofree readnone [[DOTGLOBAL_TID_:%.*]], ptr noalias nocapture nofree readnone [[DOTBOUND_TID_:%.*]], ptr nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[A:%.*]]) {
4189 ; CHECK-NEXT: entry:
4190 ; CHECK-NEXT: [[TMP0:%.*]] = load i32, ptr [[A]], align 4
4191 ; CHECK-NEXT: call void @use(i32 [[TMP0]])
4192 ; CHECK-NEXT: ret void
4193 ; CHECK-LABEL: define {{[^@]+}}@.omp_outlined..17
4194 ; CHECK-SAME: (ptr noalias nocapture nofree readnone [[DOTGLOBAL_TID_:%.*]], ptr noalias nocapture nofree readnone [[DOTBOUND_TID_:%.*]], ptr nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[A:%.*]], ptr nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[B:%.*]]) {
4195 ; CHECK-NEXT: entry:
4196 ; CHECK-NEXT: [[TMP0:%.*]] = load i32, ptr [[A]], align 4
4197 ; CHECK-NEXT: call void @use(i32 [[TMP0]])
4198 ; CHECK-NEXT: [[TMP1:%.*]] = load i32, ptr [[B]], align 4
4199 ; CHECK-NEXT: call void @use(i32 [[TMP1]])
4200 ; CHECK-NEXT: ret void
4201 ; CHECK-LABEL: define {{[^@]+}}@merge_cancellable_regions
4202 ; CHECK-SAME: (i32 [[CANCEL1:%.*]], i32 [[CANCEL2:%.*]]) local_unnamed_addr {
4203 ; CHECK-NEXT: entry:
4204 ; CHECK-NEXT: [[CANCEL1_ADDR:%.*]] = alloca i32, align 4
4205 ; CHECK-NEXT: [[CANCEL2_ADDR:%.*]] = alloca i32, align 4
4206 ; CHECK-NEXT: store i32 [[CANCEL1]], ptr [[CANCEL1_ADDR]], align 4
4207 ; CHECK-NEXT: store i32 [[CANCEL2]], ptr [[CANCEL2_ADDR]], align 4
4208 ; CHECK-NEXT: [[OMP_GLOBAL_THREAD_NUM:%.*]] = call i32 @__kmpc_global_thread_num(ptr @[[GLOB1]])
4209 ; CHECK-NEXT: br label [[OMP_PARALLEL:%.*]]
4210 ; CHECK: omp_parallel:
4211 ; CHECK-NEXT: call void (ptr, i32, ptr, ...) @__kmpc_fork_call(ptr @[[GLOB1]], i32 2, ptr @merge_cancellable_regions..omp_par, ptr [[CANCEL1_ADDR]], ptr [[CANCEL2_ADDR]])
4212 ; CHECK-NEXT: br label [[OMP_PAR_OUTLINED_EXIT:%.*]]
4213 ; CHECK: omp.par.outlined.exit:
4214 ; CHECK-NEXT: br label [[OMP_PAR_EXIT_SPLIT:%.*]]
4215 ; CHECK: omp.par.exit.split:
4216 ; CHECK-NEXT: br label [[ENTRY_SPLIT_SPLIT:%.*]]
4217 ; CHECK: entry.split.split:
4218 ; CHECK-NEXT: ret void
4219 ; CHECK-LABEL: define {{[^@]+}}@merge_cancellable_regions..omp_par
4220 ; CHECK-SAME: (ptr noalias [[TID_ADDR:%.*]], ptr noalias [[ZERO_ADDR:%.*]], ptr [[CANCEL1_ADDR:%.*]], ptr [[CANCEL2_ADDR:%.*]]) #[[ATTR0]] {
4221 ; CHECK-NEXT: omp.par.entry:
4222 ; CHECK-NEXT: [[TID_ADDR_LOCAL:%.*]] = alloca i32, align 4
4223 ; CHECK-NEXT: [[TMP0:%.*]] = load i32, ptr [[TID_ADDR]], align 4
4224 ; CHECK-NEXT: store i32 [[TMP0]], ptr [[TID_ADDR_LOCAL]], align 4
4225 ; CHECK-NEXT: [[TID:%.*]] = load i32, ptr [[TID_ADDR_LOCAL]], align 4
4226 ; CHECK-NEXT: br label [[OMP_PAR_REGION:%.*]]
4227 ; CHECK: omp.par.outlined.exit.exitStub:
4228 ; CHECK-NEXT: ret void
4229 ; CHECK: omp.par.region:
4230 ; CHECK-NEXT: br label [[OMP_PAR_MERGED:%.*]]
4231 ; CHECK: omp.par.merged:
4232 ; CHECK-NEXT: call void @.omp_outlined..18(ptr [[TID_ADDR]], ptr [[ZERO_ADDR]], ptr nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[CANCEL1_ADDR]])
4233 ; CHECK-NEXT: [[OMP_GLOBAL_THREAD_NUM:%.*]] = call i32 @__kmpc_global_thread_num(ptr @[[GLOB1]])
4234 ; CHECK-NEXT: call void @__kmpc_barrier(ptr @[[GLOB2]], i32 [[OMP_GLOBAL_THREAD_NUM]])
4235 ; CHECK-NEXT: call void @.omp_outlined..19(ptr [[TID_ADDR]], ptr [[ZERO_ADDR]], ptr nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[CANCEL2_ADDR]])
4236 ; CHECK-NEXT: br label [[ENTRY_SPLIT:%.*]]
4237 ; CHECK: entry.split:
4238 ; CHECK-NEXT: br label [[OMP_PAR_REGION_SPLIT:%.*]]
4239 ; CHECK: omp.par.region.split:
4240 ; CHECK-NEXT: br label [[OMP_PAR_PRE_FINALIZE:%.*]]
4241 ; CHECK: omp.par.pre_finalize:
4242 ; CHECK-NEXT: br label [[OMP_PAR_OUTLINED_EXIT_EXITSTUB:%.*]]
4243 ; CHECK-LABEL: define {{[^@]+}}@.omp_outlined..18
4244 ; CHECK-SAME: (ptr noalias nocapture nofree readonly [[DOTGLOBAL_TID_:%.*]], ptr noalias nocapture nofree readnone [[DOTBOUND_TID_:%.*]], ptr nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[CANCEL1:%.*]]) {
4245 ; CHECK-NEXT: entry:
4246 ; CHECK-NEXT: [[TMP0:%.*]] = load i32, ptr [[CANCEL1]], align 4
4247 ; CHECK-NEXT: [[TOBOOL_NOT:%.*]] = icmp eq i32 [[TMP0]], 0
4248 ; CHECK-NEXT: br i1 [[TOBOOL_NOT]], label [[IF_END:%.*]], label [[IF_THEN:%.*]]
4250 ; CHECK-NEXT: [[TMP1:%.*]] = load i32, ptr [[DOTGLOBAL_TID_]], align 4
4251 ; CHECK-NEXT: [[TMP2:%.*]] = call i32 @__kmpc_cancel(ptr noundef nonnull @[[GLOB1]], i32 [[TMP1]], i32 noundef 1)
4252 ; CHECK-NEXT: ret void
4254 ; CHECK-NEXT: ret void
4255 ; CHECK-LABEL: define {{[^@]+}}@.omp_outlined..19
4256 ; CHECK-SAME: (ptr noalias nocapture nofree readonly [[DOTGLOBAL_TID_:%.*]], ptr noalias nocapture nofree readnone [[DOTBOUND_TID_:%.*]], ptr nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[CANCEL2:%.*]]) {
4257 ; CHECK-NEXT: entry:
4258 ; CHECK-NEXT: [[TMP0:%.*]] = load i32, ptr [[CANCEL2]], align 4
4259 ; CHECK-NEXT: [[TOBOOL_NOT:%.*]] = icmp eq i32 [[TMP0]], 0
4260 ; CHECK-NEXT: br i1 [[TOBOOL_NOT]], label [[IF_END:%.*]], label [[IF_THEN:%.*]]
4262 ; CHECK-NEXT: [[TMP1:%.*]] = load i32, ptr [[DOTGLOBAL_TID_]], align 4
4263 ; CHECK-NEXT: [[TMP2:%.*]] = call i32 @__kmpc_cancel(ptr noundef nonnull @[[GLOB1]], i32 [[TMP1]], i32 noundef 1)
4264 ; CHECK-NEXT: ret void
4266 ; CHECK-NEXT: ret void
4267 ; CHECK-LABEL: define {{[^@]+}}@merge_cancellable_regions_seq
4268 ; CHECK-SAME: (i32 [[CANCEL1:%.*]], i32 [[CANCEL2:%.*]]) local_unnamed_addr {
4269 ; CHECK-NEXT: entry:
4270 ; CHECK-NEXT: [[CANCEL1_ADDR:%.*]] = alloca i32, align 4
4271 ; CHECK-NEXT: [[CANCEL2_ADDR:%.*]] = alloca i32, align 4
4272 ; CHECK-NEXT: store i32 [[CANCEL1]], ptr [[CANCEL1_ADDR]], align 4
4273 ; CHECK-NEXT: store i32 [[CANCEL2]], ptr [[CANCEL2_ADDR]], align 4
4274 ; CHECK-NEXT: [[OMP_GLOBAL_THREAD_NUM2:%.*]] = call i32 @__kmpc_global_thread_num(ptr @[[GLOB1]])
4275 ; CHECK-NEXT: br label [[OMP_PARALLEL:%.*]]
4276 ; CHECK: omp_parallel:
4277 ; CHECK-NEXT: call void (ptr, i32, ptr, ...) @__kmpc_fork_call(ptr @[[GLOB1]], i32 2, ptr @merge_cancellable_regions_seq..omp_par, ptr [[CANCEL1_ADDR]], ptr [[CANCEL2_ADDR]])
4278 ; CHECK-NEXT: br label [[OMP_PAR_OUTLINED_EXIT:%.*]]
4279 ; CHECK: omp.par.outlined.exit:
4280 ; CHECK-NEXT: br label [[OMP_PAR_EXIT_SPLIT:%.*]]
4281 ; CHECK: omp.par.exit.split:
4282 ; CHECK-NEXT: br label [[ENTRY_SPLIT_SPLIT:%.*]]
4283 ; CHECK: entry.split.split:
4284 ; CHECK-NEXT: ret void
4285 ; CHECK-LABEL: define {{[^@]+}}@merge_cancellable_regions_seq..omp_par
4286 ; CHECK-SAME: (ptr noalias [[TID_ADDR:%.*]], ptr noalias [[ZERO_ADDR:%.*]], ptr [[CANCEL1_ADDR:%.*]], ptr [[CANCEL2_ADDR:%.*]]) #[[ATTR0]] {
4287 ; CHECK-NEXT: omp.par.entry:
4288 ; CHECK-NEXT: [[TID_ADDR_LOCAL:%.*]] = alloca i32, align 4
4289 ; CHECK-NEXT: [[TMP0:%.*]] = load i32, ptr [[TID_ADDR]], align 4
4290 ; CHECK-NEXT: store i32 [[TMP0]], ptr [[TID_ADDR_LOCAL]], align 4
4291 ; CHECK-NEXT: [[TID:%.*]] = load i32, ptr [[TID_ADDR_LOCAL]], align 4
4292 ; CHECK-NEXT: br label [[OMP_PAR_REGION:%.*]]
4293 ; CHECK: omp.par.outlined.exit.exitStub:
4294 ; CHECK-NEXT: ret void
4295 ; CHECK: omp.par.region:
4296 ; CHECK-NEXT: br label [[OMP_PAR_MERGED:%.*]]
4297 ; CHECK: omp.par.merged:
4298 ; CHECK-NEXT: call void @.omp_outlined..20(ptr [[TID_ADDR]], ptr [[ZERO_ADDR]], ptr nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[CANCEL1_ADDR]])
4299 ; CHECK-NEXT: [[OMP_GLOBAL_THREAD_NUM2:%.*]] = call i32 @__kmpc_global_thread_num(ptr @[[GLOB1]])
4300 ; CHECK-NEXT: call void @__kmpc_barrier(ptr @[[GLOB2]], i32 [[OMP_GLOBAL_THREAD_NUM2]])
4301 ; CHECK-NEXT: [[OMP_GLOBAL_THREAD_NUM:%.*]] = call i32 @__kmpc_global_thread_num(ptr @[[GLOB1]])
4302 ; CHECK-NEXT: [[TMP1:%.*]] = call i32 @__kmpc_master(ptr @[[GLOB1]], i32 [[OMP_GLOBAL_THREAD_NUM]])
4303 ; CHECK-NEXT: [[TMP2:%.*]] = icmp ne i32 [[TMP1]], 0
4304 ; CHECK-NEXT: br i1 [[TMP2]], label [[OMP_REGION_BODY:%.*]], label [[OMP_REGION_END:%.*]]
4305 ; CHECK: omp_region.end:
4306 ; CHECK-NEXT: [[OMP_GLOBAL_THREAD_NUM1:%.*]] = call i32 @__kmpc_global_thread_num(ptr @[[GLOB1]])
4307 ; CHECK-NEXT: call void @__kmpc_barrier(ptr @[[GLOB2]], i32 [[OMP_GLOBAL_THREAD_NUM1]])
4308 ; CHECK-NEXT: br label [[OMP_PAR_MERGED_SPLIT_SPLIT:%.*]]
4309 ; CHECK: omp.par.merged.split.split:
4310 ; CHECK-NEXT: call void @.omp_outlined..21(ptr [[TID_ADDR]], ptr [[ZERO_ADDR]], ptr nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[CANCEL2_ADDR]])
4311 ; CHECK-NEXT: br label [[ENTRY_SPLIT:%.*]]
4312 ; CHECK: entry.split:
4313 ; CHECK-NEXT: br label [[OMP_PAR_REGION_SPLIT:%.*]]
4314 ; CHECK: omp.par.region.split:
4315 ; CHECK-NEXT: br label [[OMP_PAR_PRE_FINALIZE:%.*]]
4316 ; CHECK: omp.par.pre_finalize:
4317 ; CHECK-NEXT: br label [[OMP_PAR_OUTLINED_EXIT_EXITSTUB:%.*]]
4318 ; CHECK: omp_region.body:
4319 ; CHECK-NEXT: br label [[SEQ_PAR_MERGED:%.*]]
4320 ; CHECK: seq.par.merged:
4321 ; CHECK-NEXT: [[TMP3:%.*]] = load i32, ptr [[CANCEL1_ADDR]], align 4
4322 ; CHECK-NEXT: [[TOBOOL_NOT:%.*]] = icmp eq i32 [[TMP3]], 0
4323 ; CHECK-NEXT: [[LNOT_EXT:%.*]] = zext i1 [[TOBOOL_NOT]] to i32
4324 ; CHECK-NEXT: store i32 [[LNOT_EXT]], ptr [[CANCEL2_ADDR]], align 4
4325 ; CHECK-NEXT: br label [[OMP_PAR_MERGED_SPLIT:%.*]]
4326 ; CHECK: omp.par.merged.split:
4327 ; CHECK-NEXT: br label [[OMP_REGION_BODY_SPLIT:%.*]]
4328 ; CHECK: omp_region.body.split:
4329 ; CHECK-NEXT: call void @__kmpc_end_master(ptr @[[GLOB1]], i32 [[OMP_GLOBAL_THREAD_NUM]])
4330 ; CHECK-NEXT: br label [[OMP_REGION_END]]
4331 ; CHECK-LABEL: define {{[^@]+}}@.omp_outlined..20
4332 ; CHECK-SAME: (ptr noalias nocapture nofree readonly [[DOTGLOBAL_TID_:%.*]], ptr noalias nocapture nofree readnone [[DOTBOUND_TID_:%.*]], ptr nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[CANCEL1:%.*]]) {
4333 ; CHECK-NEXT: entry:
4334 ; CHECK-NEXT: [[TMP0:%.*]] = load i32, ptr [[CANCEL1]], align 4
4335 ; CHECK-NEXT: [[TOBOOL_NOT:%.*]] = icmp eq i32 [[TMP0]], 0
4336 ; CHECK-NEXT: br i1 [[TOBOOL_NOT]], label [[IF_END:%.*]], label [[IF_THEN:%.*]]
4338 ; CHECK-NEXT: [[TMP1:%.*]] = load i32, ptr [[DOTGLOBAL_TID_]], align 4
4339 ; CHECK-NEXT: [[TMP2:%.*]] = call i32 @__kmpc_cancel(ptr noundef nonnull @[[GLOB1]], i32 [[TMP1]], i32 noundef 1)
4340 ; CHECK-NEXT: ret void
4342 ; CHECK-NEXT: ret void
4343 ; CHECK-LABEL: define {{[^@]+}}@.omp_outlined..21
4344 ; CHECK-SAME: (ptr noalias nocapture nofree readonly [[DOTGLOBAL_TID_:%.*]], ptr noalias nocapture nofree readnone [[DOTBOUND_TID_:%.*]], ptr nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[CANCEL2:%.*]]) {
4345 ; CHECK-NEXT: entry:
4346 ; CHECK-NEXT: [[TMP0:%.*]] = load i32, ptr [[CANCEL2]], align 4
4347 ; CHECK-NEXT: [[TOBOOL_NOT:%.*]] = icmp eq i32 [[TMP0]], 0
4348 ; CHECK-NEXT: br i1 [[TOBOOL_NOT]], label [[IF_END:%.*]], label [[IF_THEN:%.*]]
4350 ; CHECK-NEXT: [[TMP1:%.*]] = load i32, ptr [[DOTGLOBAL_TID_]], align 4
4351 ; CHECK-NEXT: [[TMP2:%.*]] = call i32 @__kmpc_cancel(ptr noundef nonnull @[[GLOB1]], i32 [[TMP1]], i32 noundef 1)
4352 ; CHECK-NEXT: ret void
4354 ; CHECK-NEXT: ret void
4355 ; CHECK-LABEL: define {{[^@]+}}@merge_3
4356 ; CHECK-SAME: (i32 [[A:%.*]]) local_unnamed_addr {
4357 ; CHECK-NEXT: entry:
4358 ; CHECK-NEXT: [[A_ADDR:%.*]] = alloca i32, align 4
4359 ; CHECK-NEXT: store i32 [[A]], ptr [[A_ADDR]], align 4
4360 ; CHECK-NEXT: [[OMP_GLOBAL_THREAD_NUM:%.*]] = call i32 @__kmpc_global_thread_num(ptr @[[GLOB1]])
4361 ; CHECK-NEXT: br label [[OMP_PARALLEL:%.*]]
4362 ; CHECK: omp_parallel:
4363 ; CHECK-NEXT: call void (ptr, i32, ptr, ...) @__kmpc_fork_call(ptr @[[GLOB1]], i32 1, ptr @merge_3..omp_par, ptr [[A_ADDR]])
4364 ; CHECK-NEXT: br label [[OMP_PAR_OUTLINED_EXIT:%.*]]
4365 ; CHECK: omp.par.outlined.exit:
4366 ; CHECK-NEXT: br label [[OMP_PAR_EXIT_SPLIT:%.*]]
4367 ; CHECK: omp.par.exit.split:
4368 ; CHECK-NEXT: br label [[ENTRY_SPLIT_SPLIT:%.*]]
4369 ; CHECK: entry.split.split:
4370 ; CHECK-NEXT: ret void
4371 ; CHECK-LABEL: define {{[^@]+}}@merge_3..omp_par
4372 ; CHECK-SAME: (ptr noalias [[TID_ADDR:%.*]], ptr noalias [[ZERO_ADDR:%.*]], ptr [[A_ADDR:%.*]]) #[[ATTR0]] {
4373 ; CHECK-NEXT: omp.par.entry:
4374 ; CHECK-NEXT: [[TID_ADDR_LOCAL:%.*]] = alloca i32, align 4
4375 ; CHECK-NEXT: [[TMP0:%.*]] = load i32, ptr [[TID_ADDR]], align 4
4376 ; CHECK-NEXT: store i32 [[TMP0]], ptr [[TID_ADDR_LOCAL]], align 4
4377 ; CHECK-NEXT: [[TID:%.*]] = load i32, ptr [[TID_ADDR_LOCAL]], align 4
4378 ; CHECK-NEXT: br label [[OMP_PAR_REGION:%.*]]
4379 ; CHECK: omp.par.outlined.exit.exitStub:
4380 ; CHECK-NEXT: ret void
4381 ; CHECK: omp.par.region:
4382 ; CHECK-NEXT: br label [[OMP_PAR_MERGED:%.*]]
4383 ; CHECK: omp.par.merged:
4384 ; CHECK-NEXT: call void @.omp_outlined..22(ptr [[TID_ADDR]], ptr [[ZERO_ADDR]], ptr nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[A_ADDR]])
4385 ; CHECK-NEXT: [[OMP_GLOBAL_THREAD_NUM:%.*]] = call i32 @__kmpc_global_thread_num(ptr @[[GLOB1]])
4386 ; CHECK-NEXT: call void @__kmpc_barrier(ptr @[[GLOB2]], i32 [[OMP_GLOBAL_THREAD_NUM]])
4387 ; CHECK-NEXT: call void @.omp_outlined..23(ptr [[TID_ADDR]], ptr [[ZERO_ADDR]], ptr nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[A_ADDR]])
4388 ; CHECK-NEXT: [[OMP_GLOBAL_THREAD_NUM1:%.*]] = call i32 @__kmpc_global_thread_num(ptr @[[GLOB1]])
4389 ; CHECK-NEXT: call void @__kmpc_barrier(ptr @[[GLOB2]], i32 [[OMP_GLOBAL_THREAD_NUM1]])
4390 ; CHECK-NEXT: call void @.omp_outlined..24(ptr [[TID_ADDR]], ptr [[ZERO_ADDR]], ptr nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[A_ADDR]])
4391 ; CHECK-NEXT: br label [[ENTRY_SPLIT:%.*]]
4392 ; CHECK: entry.split:
4393 ; CHECK-NEXT: br label [[OMP_PAR_REGION_SPLIT:%.*]]
4394 ; CHECK: omp.par.region.split:
4395 ; CHECK-NEXT: br label [[OMP_PAR_PRE_FINALIZE:%.*]]
4396 ; CHECK: omp.par.pre_finalize:
4397 ; CHECK-NEXT: br label [[OMP_PAR_OUTLINED_EXIT_EXITSTUB:%.*]]
4398 ; CHECK-LABEL: define {{[^@]+}}@.omp_outlined..22
4399 ; CHECK-SAME: (ptr noalias nocapture nofree readnone [[DOTGLOBAL_TID_:%.*]], ptr noalias nocapture nofree readnone [[DOTBOUND_TID_:%.*]], ptr nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[A:%.*]]) {
4400 ; CHECK-NEXT: entry:
4401 ; CHECK-NEXT: [[TMP0:%.*]] = load i32, ptr [[A]], align 4
4402 ; CHECK-NEXT: call void @use(i32 [[TMP0]])
4403 ; CHECK-NEXT: ret void
4404 ; CHECK-LABEL: define {{[^@]+}}@.omp_outlined..23
4405 ; CHECK-SAME: (ptr noalias nocapture nofree readnone [[DOTGLOBAL_TID_:%.*]], ptr noalias nocapture nofree readnone [[DOTBOUND_TID_:%.*]], ptr nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[A:%.*]]) {
4406 ; CHECK-NEXT: entry:
4407 ; CHECK-NEXT: [[TMP0:%.*]] = load i32, ptr [[A]], align 4
4408 ; CHECK-NEXT: call void @use(i32 [[TMP0]])
4409 ; CHECK-NEXT: ret void
4410 ; CHECK-LABEL: define {{[^@]+}}@.omp_outlined..24
4411 ; CHECK-SAME: (ptr noalias nocapture nofree readnone [[DOTGLOBAL_TID_:%.*]], ptr noalias nocapture nofree readnone [[DOTBOUND_TID_:%.*]], ptr nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[A:%.*]]) {
4412 ; CHECK-NEXT: entry:
4413 ; CHECK-NEXT: [[TMP0:%.*]] = load i32, ptr [[A]], align 4
4414 ; CHECK-NEXT: call void @use(i32 [[TMP0]])
4415 ; CHECK-NEXT: ret void
4416 ; CHECK-LABEL: define {{[^@]+}}@merge_3_seq
4417 ; CHECK-SAME: (i32 [[A:%.*]], i32 [[B:%.*]]) local_unnamed_addr {
4418 ; CHECK-NEXT: entry:
4419 ; CHECK-NEXT: [[ADD1_SEQ_OUTPUT_ALLOC:%.*]] = alloca i32, align 4
4420 ; CHECK-NEXT: [[ADD_SEQ_OUTPUT_ALLOC:%.*]] = alloca i32, align 4
4421 ; CHECK-NEXT: [[A_ADDR:%.*]] = alloca i32, align 4
4422 ; CHECK-NEXT: store i32 [[A]], ptr [[A_ADDR]], align 4
4423 ; CHECK-NEXT: [[OMP_GLOBAL_THREAD_NUM7:%.*]] = call i32 @__kmpc_global_thread_num(ptr @[[GLOB1]])
4424 ; CHECK-NEXT: br label [[OMP_PARALLEL:%.*]]
4425 ; CHECK: omp_parallel:
4426 ; CHECK-NEXT: call void (ptr, i32, ptr, ...) @__kmpc_fork_call(ptr @[[GLOB1]], i32 3, ptr @merge_3_seq..omp_par, ptr [[A_ADDR]], ptr [[ADD_SEQ_OUTPUT_ALLOC]], ptr [[ADD1_SEQ_OUTPUT_ALLOC]])
4427 ; CHECK-NEXT: br label [[OMP_PAR_OUTLINED_EXIT:%.*]]
4428 ; CHECK: omp.par.outlined.exit:
4429 ; CHECK-NEXT: br label [[OMP_PAR_EXIT_SPLIT:%.*]]
4430 ; CHECK: omp.par.exit.split:
4431 ; CHECK-NEXT: br label [[ENTRY_SPLIT_SPLIT:%.*]]
4432 ; CHECK: entry.split.split:
4433 ; CHECK-NEXT: [[ADD1_SEQ_OUTPUT_LOAD:%.*]] = load i32, ptr [[ADD1_SEQ_OUTPUT_ALLOC]], align 4
4434 ; CHECK-NEXT: call void @use(i32 [[ADD1_SEQ_OUTPUT_LOAD]])
4435 ; CHECK-NEXT: ret void
4436 ; CHECK-LABEL: define {{[^@]+}}@merge_3_seq..omp_par
4437 ; CHECK-SAME: (ptr noalias [[TID_ADDR:%.*]], ptr noalias [[ZERO_ADDR:%.*]], ptr [[A_ADDR:%.*]], ptr [[ADD_SEQ_OUTPUT_ALLOC:%.*]], ptr [[ADD1_SEQ_OUTPUT_ALLOC:%.*]]) #[[ATTR0]] {
4438 ; CHECK-NEXT: omp.par.entry:
4439 ; CHECK-NEXT: [[TID_ADDR_LOCAL:%.*]] = alloca i32, align 4
4440 ; CHECK-NEXT: [[TMP0:%.*]] = load i32, ptr [[TID_ADDR]], align 4
4441 ; CHECK-NEXT: store i32 [[TMP0]], ptr [[TID_ADDR_LOCAL]], align 4
4442 ; CHECK-NEXT: [[TID:%.*]] = load i32, ptr [[TID_ADDR_LOCAL]], align 4
4443 ; CHECK-NEXT: br label [[OMP_PAR_REGION:%.*]]
4444 ; CHECK: omp.par.outlined.exit.exitStub:
4445 ; CHECK-NEXT: ret void
4446 ; CHECK: omp.par.region:
4447 ; CHECK-NEXT: br label [[OMP_PAR_MERGED:%.*]]
4448 ; CHECK: omp.par.merged:
4449 ; CHECK-NEXT: call void @.omp_outlined..25(ptr [[TID_ADDR]], ptr [[ZERO_ADDR]], ptr nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[A_ADDR]])
4450 ; CHECK-NEXT: [[OMP_GLOBAL_THREAD_NUM2:%.*]] = call i32 @__kmpc_global_thread_num(ptr @[[GLOB1]])
4451 ; CHECK-NEXT: call void @__kmpc_barrier(ptr @[[GLOB2]], i32 [[OMP_GLOBAL_THREAD_NUM2]])
4452 ; CHECK-NEXT: [[OMP_GLOBAL_THREAD_NUM:%.*]] = call i32 @__kmpc_global_thread_num(ptr @[[GLOB1]])
4453 ; CHECK-NEXT: [[TMP1:%.*]] = call i32 @__kmpc_master(ptr @[[GLOB1]], i32 [[OMP_GLOBAL_THREAD_NUM]])
4454 ; CHECK-NEXT: [[TMP2:%.*]] = icmp ne i32 [[TMP1]], 0
4455 ; CHECK-NEXT: br i1 [[TMP2]], label [[OMP_REGION_BODY:%.*]], label [[OMP_REGION_END:%.*]]
4456 ; CHECK: omp_region.end:
4457 ; CHECK-NEXT: [[OMP_GLOBAL_THREAD_NUM1:%.*]] = call i32 @__kmpc_global_thread_num(ptr @[[GLOB1]])
4458 ; CHECK-NEXT: call void @__kmpc_barrier(ptr @[[GLOB2]], i32 [[OMP_GLOBAL_THREAD_NUM1]])
4459 ; CHECK-NEXT: br label [[OMP_PAR_MERGED_SPLIT_SPLIT:%.*]]
4460 ; CHECK: omp.par.merged.split.split:
4461 ; CHECK-NEXT: call void @.omp_outlined..26(ptr [[TID_ADDR]], ptr [[ZERO_ADDR]], ptr nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[A_ADDR]])
4462 ; CHECK-NEXT: [[OMP_GLOBAL_THREAD_NUM4:%.*]] = call i32 @__kmpc_global_thread_num(ptr @[[GLOB1]])
4463 ; CHECK-NEXT: call void @__kmpc_barrier(ptr @[[GLOB2]], i32 [[OMP_GLOBAL_THREAD_NUM4]])
4464 ; CHECK-NEXT: [[OMP_GLOBAL_THREAD_NUM3:%.*]] = call i32 @__kmpc_global_thread_num(ptr @[[GLOB1]])
4465 ; CHECK-NEXT: [[TMP3:%.*]] = call i32 @__kmpc_master(ptr @[[GLOB1]], i32 [[OMP_GLOBAL_THREAD_NUM3]])
4466 ; CHECK-NEXT: [[TMP4:%.*]] = icmp ne i32 [[TMP3]], 0
4467 ; CHECK-NEXT: br i1 [[TMP4]], label [[OMP_REGION_BODY5:%.*]], label [[OMP_REGION_END4:%.*]]
4468 ; CHECK: omp_region.end4:
4469 ; CHECK-NEXT: [[OMP_GLOBAL_THREAD_NUM6:%.*]] = call i32 @__kmpc_global_thread_num(ptr @[[GLOB1]])
4470 ; CHECK-NEXT: call void @__kmpc_barrier(ptr @[[GLOB2]], i32 [[OMP_GLOBAL_THREAD_NUM6]])
4471 ; CHECK-NEXT: br label [[OMP_PAR_MERGED_SPLIT_SPLIT_SPLIT_SPLIT:%.*]]
4472 ; CHECK: omp.par.merged.split.split.split.split:
4473 ; CHECK-NEXT: call void @.omp_outlined..27(ptr [[TID_ADDR]], ptr [[ZERO_ADDR]], ptr nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[A_ADDR]])
4474 ; CHECK-NEXT: br label [[ENTRY_SPLIT:%.*]]
4475 ; CHECK: entry.split:
4476 ; CHECK-NEXT: br label [[OMP_PAR_REGION_SPLIT:%.*]]
4477 ; CHECK: omp.par.region.split:
4478 ; CHECK-NEXT: br label [[OMP_PAR_PRE_FINALIZE:%.*]]
4479 ; CHECK: omp.par.pre_finalize:
4480 ; CHECK-NEXT: br label [[OMP_PAR_OUTLINED_EXIT_EXITSTUB:%.*]]
4481 ; CHECK: omp_region.body5:
4482 ; CHECK-NEXT: br label [[SEQ_PAR_MERGED2:%.*]]
4483 ; CHECK: seq.par.merged2:
4484 ; CHECK-NEXT: [[TMP5:%.*]] = load i32, ptr [[A_ADDR]], align 4
4485 ; CHECK-NEXT: [[ADD_SEQ_OUTPUT_LOAD:%.*]] = load i32, ptr [[ADD_SEQ_OUTPUT_ALLOC]], align 4
4486 ; CHECK-NEXT: [[ADD1:%.*]] = add nsw i32 [[ADD_SEQ_OUTPUT_LOAD]], [[TMP5]]
4487 ; CHECK-NEXT: store i32 [[ADD1]], ptr [[ADD1_SEQ_OUTPUT_ALLOC]], align 4
4488 ; CHECK-NEXT: br label [[OMP_PAR_MERGED_SPLIT_SPLIT_SPLIT:%.*]]
4489 ; CHECK: omp.par.merged.split.split.split:
4490 ; CHECK-NEXT: br label [[OMP_REGION_BODY5_SPLIT:%.*]]
4491 ; CHECK: omp_region.body5.split:
4492 ; CHECK-NEXT: call void @__kmpc_end_master(ptr @[[GLOB1]], i32 [[OMP_GLOBAL_THREAD_NUM3]])
4493 ; CHECK-NEXT: br label [[OMP_REGION_END4]]
4494 ; CHECK: omp_region.body:
4495 ; CHECK-NEXT: br label [[SEQ_PAR_MERGED:%.*]]
4496 ; CHECK: seq.par.merged:
4497 ; CHECK-NEXT: [[TMP6:%.*]] = load i32, ptr [[A_ADDR]], align 4
4498 ; CHECK-NEXT: [[ADD:%.*]] = add nsw i32 [[TMP6]], 1
4499 ; CHECK-NEXT: store i32 [[ADD]], ptr [[ADD_SEQ_OUTPUT_ALLOC]], align 4
4500 ; CHECK-NEXT: br label [[OMP_PAR_MERGED_SPLIT:%.*]]
4501 ; CHECK: omp.par.merged.split:
4502 ; CHECK-NEXT: br label [[OMP_REGION_BODY_SPLIT:%.*]]
4503 ; CHECK: omp_region.body.split:
4504 ; CHECK-NEXT: call void @__kmpc_end_master(ptr @[[GLOB1]], i32 [[OMP_GLOBAL_THREAD_NUM]])
4505 ; CHECK-NEXT: br label [[OMP_REGION_END]]
4506 ; CHECK-LABEL: define {{[^@]+}}@.omp_outlined..25
4507 ; CHECK-SAME: (ptr noalias nocapture nofree readnone [[DOTGLOBAL_TID_:%.*]], ptr noalias nocapture nofree readnone [[DOTBOUND_TID_:%.*]], ptr nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[A:%.*]]) {
4508 ; CHECK-NEXT: entry:
4509 ; CHECK-NEXT: [[TMP0:%.*]] = load i32, ptr [[A]], align 4
4510 ; CHECK-NEXT: call void @use(i32 [[TMP0]])
4511 ; CHECK-NEXT: ret void
4512 ; CHECK-LABEL: define {{[^@]+}}@.omp_outlined..26
4513 ; CHECK-SAME: (ptr noalias nocapture nofree readnone [[DOTGLOBAL_TID_:%.*]], ptr noalias nocapture nofree readnone [[DOTBOUND_TID_:%.*]], ptr nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[A:%.*]]) {
4514 ; CHECK-NEXT: entry:
4515 ; CHECK-NEXT: [[TMP0:%.*]] = load i32, ptr [[A]], align 4
4516 ; CHECK-NEXT: call void @use(i32 [[TMP0]])
4517 ; CHECK-NEXT: ret void
4518 ; CHECK-LABEL: define {{[^@]+}}@.omp_outlined..27
4519 ; CHECK-SAME: (ptr noalias nocapture nofree readnone [[DOTGLOBAL_TID_:%.*]], ptr noalias nocapture nofree readnone [[DOTBOUND_TID_:%.*]], ptr nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[A:%.*]]) {
4520 ; CHECK-NEXT: entry:
4521 ; CHECK-NEXT: [[TMP0:%.*]] = load i32, ptr [[A]], align 4
4522 ; CHECK-NEXT: call void @use(i32 [[TMP0]])
4523 ; CHECK-NEXT: ret void
4524 ; CHECK-LABEL: define {{[^@]+}}@unmergable_3_seq_call
4525 ; CHECK-SAME: (i32 [[A:%.*]]) local_unnamed_addr {
4526 ; CHECK-NEXT: entry:
4527 ; CHECK-NEXT: [[A_ADDR:%.*]] = alloca i32, align 4
4528 ; CHECK-NEXT: store i32 [[A]], ptr [[A_ADDR]], align 4
4529 ; CHECK-NEXT: call void (ptr, i32, ptr, ...) @__kmpc_fork_call(ptr noundef nonnull align 8 dereferenceable(24) @[[GLOB1]], i32 noundef 1, ptr noundef @.omp_outlined..28, ptr nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[A_ADDR]])
4530 ; CHECK-NEXT: call void (...) @foo()
4531 ; CHECK-NEXT: call void (ptr, i32, ptr, ...) @__kmpc_fork_call(ptr noundef nonnull align 8 dereferenceable(24) @[[GLOB1]], i32 noundef 1, ptr noundef @.omp_outlined..29, ptr nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[A_ADDR]])
4532 ; CHECK-NEXT: call void (...) @foo()
4533 ; CHECK-NEXT: call void (ptr, i32, ptr, ...) @__kmpc_fork_call(ptr noundef nonnull align 8 dereferenceable(24) @[[GLOB1]], i32 noundef 1, ptr noundef @.omp_outlined..30, ptr nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[A_ADDR]])
4534 ; CHECK-NEXT: ret void
4535 ; CHECK-LABEL: define {{[^@]+}}@.omp_outlined..28
4536 ; CHECK-SAME: (ptr noalias nocapture nofree readnone [[DOTGLOBAL_TID_:%.*]], ptr noalias nocapture nofree readnone [[DOTBOUND_TID_:%.*]], ptr nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[A:%.*]]) {
4537 ; CHECK-NEXT: entry:
4538 ; CHECK-NEXT: [[TMP0:%.*]] = load i32, ptr [[A]], align 4
4539 ; CHECK-NEXT: call void @use(i32 [[TMP0]])
4540 ; CHECK-NEXT: ret void
4541 ; CHECK-LABEL: define {{[^@]+}}@.omp_outlined..29
4542 ; CHECK-SAME: (ptr noalias nocapture nofree readnone [[DOTGLOBAL_TID_:%.*]], ptr noalias nocapture nofree readnone [[DOTBOUND_TID_:%.*]], ptr nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[A:%.*]]) {
4543 ; CHECK-NEXT: entry:
4544 ; CHECK-NEXT: [[TMP0:%.*]] = load i32, ptr [[A]], align 4
4545 ; CHECK-NEXT: call void @use(i32 [[TMP0]])
4546 ; CHECK-NEXT: ret void
4547 ; CHECK-LABEL: define {{[^@]+}}@.omp_outlined..30
4548 ; CHECK-SAME: (ptr noalias nocapture nofree readnone [[DOTGLOBAL_TID_:%.*]], ptr noalias nocapture nofree readnone [[DOTBOUND_TID_:%.*]], ptr nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[A:%.*]]) {
4549 ; CHECK-NEXT: entry:
4550 ; CHECK-NEXT: [[TMP0:%.*]] = load i32, ptr [[A]], align 4
4551 ; CHECK-NEXT: call void @use(i32 [[TMP0]])
4552 ; CHECK-NEXT: ret void
4553 ; CHECK-LABEL: define {{[^@]+}}@unmergable_3_proc_bind
4554 ; CHECK-SAME: (i32 [[A:%.*]]) local_unnamed_addr {
4555 ; CHECK-NEXT: entry:
4556 ; CHECK-NEXT: [[A_ADDR:%.*]] = alloca i32, align 4
4557 ; CHECK-NEXT: [[TMP0:%.*]] = call i32 @__kmpc_global_thread_num(ptr noundef nonnull align 8 dereferenceable(24) @[[GLOB1]])
4558 ; CHECK-NEXT: store i32 [[A]], ptr [[A_ADDR]], align 4
4559 ; CHECK-NEXT: call void (ptr, i32, ptr, ...) @__kmpc_fork_call(ptr noundef nonnull align 8 dereferenceable(24) @[[GLOB1]], i32 noundef 1, ptr noundef @.omp_outlined..31, ptr nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[A_ADDR]])
4560 ; CHECK-NEXT: call void @__kmpc_push_proc_bind(ptr noundef nonnull align 8 dereferenceable(24) @[[GLOB1]], i32 [[TMP0]], i32 noundef 3)
4561 ; CHECK-NEXT: call void (ptr, i32, ptr, ...) @__kmpc_fork_call(ptr noundef nonnull align 8 dereferenceable(24) @[[GLOB1]], i32 noundef 1, ptr noundef @.omp_outlined..32, ptr nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[A_ADDR]])
4562 ; CHECK-NEXT: call void (ptr, i32, ptr, ...) @__kmpc_fork_call(ptr noundef nonnull align 8 dereferenceable(24) @[[GLOB1]], i32 noundef 1, ptr noundef @.omp_outlined..33, ptr nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[A_ADDR]])
4563 ; CHECK-NEXT: ret void
4564 ; CHECK-LABEL: define {{[^@]+}}@.omp_outlined..31
4565 ; CHECK-SAME: (ptr noalias nocapture nofree readnone [[DOTGLOBAL_TID_:%.*]], ptr noalias nocapture nofree readnone [[DOTBOUND_TID_:%.*]], ptr nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[A:%.*]]) {
4566 ; CHECK-NEXT: entry:
4567 ; CHECK-NEXT: [[TMP0:%.*]] = load i32, ptr [[A]], align 4
4568 ; CHECK-NEXT: call void @use(i32 [[TMP0]])
4569 ; CHECK-NEXT: ret void
4570 ; CHECK-LABEL: define {{[^@]+}}@.omp_outlined..32
4571 ; CHECK-SAME: (ptr noalias nocapture nofree readnone [[DOTGLOBAL_TID_:%.*]], ptr noalias nocapture nofree readnone [[DOTBOUND_TID_:%.*]], ptr nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[A:%.*]]) {
4572 ; CHECK-NEXT: entry:
4573 ; CHECK-NEXT: [[TMP0:%.*]] = load i32, ptr [[A]], align 4
4574 ; CHECK-NEXT: call void @use(i32 [[TMP0]])
4575 ; CHECK-NEXT: ret void
4576 ; CHECK-LABEL: define {{[^@]+}}@.omp_outlined..33
4577 ; CHECK-SAME: (ptr noalias nocapture nofree readnone [[DOTGLOBAL_TID_:%.*]], ptr noalias nocapture nofree readnone [[DOTBOUND_TID_:%.*]], ptr nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[A:%.*]]) {
4578 ; CHECK-NEXT: entry:
4579 ; CHECK-NEXT: [[TMP0:%.*]] = load i32, ptr [[A]], align 4
4580 ; CHECK-NEXT: call void @use(i32 [[TMP0]])
4581 ; CHECK-NEXT: ret void
4582 ; CHECK-LABEL: define {{[^@]+}}@unmergable_3_num_threads
4583 ; CHECK-SAME: (i32 [[A:%.*]]) local_unnamed_addr {
4584 ; CHECK-NEXT: entry:
4585 ; CHECK-NEXT: [[A_ADDR:%.*]] = alloca i32, align 4
4586 ; CHECK-NEXT: [[TMP0:%.*]] = call i32 @__kmpc_global_thread_num(ptr noundef nonnull align 8 dereferenceable(24) @[[GLOB1]])
4587 ; CHECK-NEXT: store i32 [[A]], ptr [[A_ADDR]], align 4
4588 ; CHECK-NEXT: call void (ptr, i32, ptr, ...) @__kmpc_fork_call(ptr noundef nonnull align 8 dereferenceable(24) @[[GLOB1]], i32 noundef 1, ptr noundef @.omp_outlined..34, ptr nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[A_ADDR]])
4589 ; CHECK-NEXT: [[TMP1:%.*]] = load i32, ptr [[A_ADDR]], align 4
4590 ; CHECK-NEXT: call void @__kmpc_push_num_threads(ptr noundef nonnull align 8 dereferenceable(24) @[[GLOB1]], i32 [[TMP0]], i32 [[TMP1]])
4591 ; CHECK-NEXT: call void (ptr, i32, ptr, ...) @__kmpc_fork_call(ptr noundef nonnull align 8 dereferenceable(24) @[[GLOB1]], i32 noundef 1, ptr noundef @.omp_outlined..35, ptr nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[A_ADDR]])
4592 ; CHECK-NEXT: call void (ptr, i32, ptr, ...) @__kmpc_fork_call(ptr noundef nonnull align 8 dereferenceable(24) @[[GLOB1]], i32 noundef 1, ptr noundef @.omp_outlined..36, ptr nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[A_ADDR]])
4593 ; CHECK-NEXT: ret void
4594 ; CHECK-LABEL: define {{[^@]+}}@.omp_outlined..34
4595 ; CHECK-SAME: (ptr noalias nocapture nofree readnone [[DOTGLOBAL_TID_:%.*]], ptr noalias nocapture nofree readnone [[DOTBOUND_TID_:%.*]], ptr nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[A:%.*]]) {
4596 ; CHECK-NEXT: entry:
4597 ; CHECK-NEXT: [[TMP0:%.*]] = load i32, ptr [[A]], align 4
4598 ; CHECK-NEXT: call void @use(i32 [[TMP0]])
4599 ; CHECK-NEXT: ret void
4600 ; CHECK-LABEL: define {{[^@]+}}@.omp_outlined..35
4601 ; CHECK-SAME: (ptr noalias nocapture nofree readnone [[DOTGLOBAL_TID_:%.*]], ptr noalias nocapture nofree readnone [[DOTBOUND_TID_:%.*]], ptr nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[A:%.*]]) {
4602 ; CHECK-NEXT: entry:
4603 ; CHECK-NEXT: [[TMP0:%.*]] = load i32, ptr [[A]], align 4
4604 ; CHECK-NEXT: call void @use(i32 [[TMP0]])
4605 ; CHECK-NEXT: ret void
4606 ; CHECK-LABEL: define {{[^@]+}}@.omp_outlined..36
4607 ; CHECK-SAME: (ptr noalias nocapture nofree readnone [[DOTGLOBAL_TID_:%.*]], ptr noalias nocapture nofree readnone [[DOTBOUND_TID_:%.*]], ptr nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[A:%.*]]) {
4608 ; CHECK-NEXT: entry:
4609 ; CHECK-NEXT: [[TMP0:%.*]] = load i32, ptr [[A]], align 4
4610 ; CHECK-NEXT: call void @use(i32 [[TMP0]])
4611 ; CHECK-NEXT: ret void
4612 ; CHECK-LABEL: define {{[^@]+}}@merge_2_unmergable_1
4613 ; CHECK-SAME: (i32 [[A:%.*]]) local_unnamed_addr {
4614 ; CHECK-NEXT: entry:
4615 ; CHECK-NEXT: [[A_ADDR:%.*]] = alloca i32, align 4
4616 ; CHECK-NEXT: store i32 [[A]], ptr [[A_ADDR]], align 4
4617 ; CHECK-NEXT: [[OMP_GLOBAL_THREAD_NUM:%.*]] = call i32 @__kmpc_global_thread_num(ptr @[[GLOB1]])
4618 ; CHECK-NEXT: br label [[OMP_PARALLEL:%.*]]
4619 ; CHECK: omp_parallel:
4620 ; CHECK-NEXT: call void (ptr, i32, ptr, ...) @__kmpc_fork_call(ptr @[[GLOB1]], i32 1, ptr @merge_2_unmergable_1..omp_par, ptr [[A_ADDR]])
4621 ; CHECK-NEXT: br label [[OMP_PAR_OUTLINED_EXIT:%.*]]
4622 ; CHECK: omp.par.outlined.exit:
4623 ; CHECK-NEXT: br label [[OMP_PAR_EXIT_SPLIT:%.*]]
4624 ; CHECK: omp.par.exit.split:
4625 ; CHECK-NEXT: br label [[ENTRY_SPLIT_SPLIT:%.*]]
4626 ; CHECK: entry.split.split:
4627 ; CHECK-NEXT: call void (...) @foo()
4628 ; CHECK-NEXT: call void (ptr, i32, ptr, ...) @__kmpc_fork_call(ptr noundef nonnull align 8 dereferenceable(24) @[[GLOB1]], i32 noundef 1, ptr noundef @.omp_outlined..39, ptr nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[A_ADDR]])
4629 ; CHECK-NEXT: ret void
4630 ; CHECK-LABEL: define {{[^@]+}}@merge_2_unmergable_1..omp_par
4631 ; CHECK-SAME: (ptr noalias [[TID_ADDR:%.*]], ptr noalias [[ZERO_ADDR:%.*]], ptr [[A_ADDR:%.*]]) #[[ATTR0]] {
4632 ; CHECK-NEXT: omp.par.entry:
4633 ; CHECK-NEXT: [[TID_ADDR_LOCAL:%.*]] = alloca i32, align 4
4634 ; CHECK-NEXT: [[TMP0:%.*]] = load i32, ptr [[TID_ADDR]], align 4
4635 ; CHECK-NEXT: store i32 [[TMP0]], ptr [[TID_ADDR_LOCAL]], align 4
4636 ; CHECK-NEXT: [[TID:%.*]] = load i32, ptr [[TID_ADDR_LOCAL]], align 4
4637 ; CHECK-NEXT: br label [[OMP_PAR_REGION:%.*]]
4638 ; CHECK: omp.par.outlined.exit.exitStub:
4639 ; CHECK-NEXT: ret void
4640 ; CHECK: omp.par.region:
4641 ; CHECK-NEXT: br label [[OMP_PAR_MERGED:%.*]]
4642 ; CHECK: omp.par.merged:
4643 ; CHECK-NEXT: call void @.omp_outlined..37(ptr [[TID_ADDR]], ptr [[ZERO_ADDR]], ptr nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[A_ADDR]])
4644 ; CHECK-NEXT: [[OMP_GLOBAL_THREAD_NUM:%.*]] = call i32 @__kmpc_global_thread_num(ptr @[[GLOB1]])
4645 ; CHECK-NEXT: call void @__kmpc_barrier(ptr @[[GLOB2]], i32 [[OMP_GLOBAL_THREAD_NUM]])
4646 ; CHECK-NEXT: call void @.omp_outlined..38(ptr [[TID_ADDR]], ptr [[ZERO_ADDR]], ptr nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[A_ADDR]])
4647 ; CHECK-NEXT: br label [[ENTRY_SPLIT:%.*]]
4648 ; CHECK: entry.split:
4649 ; CHECK-NEXT: br label [[OMP_PAR_REGION_SPLIT:%.*]]
4650 ; CHECK: omp.par.region.split:
4651 ; CHECK-NEXT: br label [[OMP_PAR_PRE_FINALIZE:%.*]]
4652 ; CHECK: omp.par.pre_finalize:
4653 ; CHECK-NEXT: br label [[OMP_PAR_OUTLINED_EXIT_EXITSTUB:%.*]]
4654 ; CHECK-LABEL: define {{[^@]+}}@.omp_outlined..37
4655 ; CHECK-SAME: (ptr noalias nocapture nofree readnone [[DOTGLOBAL_TID_:%.*]], ptr noalias nocapture nofree readnone [[DOTBOUND_TID_:%.*]], ptr nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[A:%.*]]) {
4656 ; CHECK-NEXT: entry:
4657 ; CHECK-NEXT: [[TMP0:%.*]] = load i32, ptr [[A]], align 4
4658 ; CHECK-NEXT: call void @use(i32 [[TMP0]])
4659 ; CHECK-NEXT: ret void
4660 ; CHECK-LABEL: define {{[^@]+}}@.omp_outlined..38
4661 ; CHECK-SAME: (ptr noalias nocapture nofree readnone [[DOTGLOBAL_TID_:%.*]], ptr noalias nocapture nofree readnone [[DOTBOUND_TID_:%.*]], ptr nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[A:%.*]]) {
4662 ; CHECK-NEXT: entry:
4663 ; CHECK-NEXT: [[TMP0:%.*]] = load i32, ptr [[A]], align 4
4664 ; CHECK-NEXT: call void @use(i32 [[TMP0]])
4665 ; CHECK-NEXT: ret void
4666 ; CHECK-LABEL: define {{[^@]+}}@.omp_outlined..39
4667 ; CHECK-SAME: (ptr noalias nocapture nofree readnone [[DOTGLOBAL_TID_:%.*]], ptr noalias nocapture nofree readnone [[DOTBOUND_TID_:%.*]], ptr nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[A:%.*]]) {
4668 ; CHECK-NEXT: entry:
4669 ; CHECK-NEXT: [[TMP0:%.*]] = load i32, ptr [[A]], align 4
4670 ; CHECK-NEXT: call void @use(i32 [[TMP0]])
4671 ; CHECK-NEXT: ret void
4673 ; CHECK2-LABEL: define {{[^@]+}}@merge
4674 ; CHECK2-SAME: (i32 [[A:%.*]]) local_unnamed_addr {
4675 ; CHECK2-NEXT: entry:
4676 ; CHECK2-NEXT: [[STRUCTARG:%.*]] = alloca { ptr }, align 8
4677 ; CHECK2-NEXT: [[A_ADDR:%.*]] = alloca i32, align 4
4678 ; CHECK2-NEXT: store i32 [[A]], ptr [[A_ADDR]], align 4
4679 ; CHECK2-NEXT: [[OMP_GLOBAL_THREAD_NUM:%.*]] = call i32 @__kmpc_global_thread_num(ptr @[[GLOB2:[0-9]+]])
4680 ; CHECK2-NEXT: br label [[OMP_PARALLEL:%.*]]
4681 ; CHECK2: omp_parallel:
4682 ; CHECK2-NEXT: [[GEP_A_ADDR:%.*]] = getelementptr { ptr }, ptr [[STRUCTARG]], i32 0, i32 0
4683 ; CHECK2-NEXT: store ptr [[A_ADDR]], ptr [[GEP_A_ADDR]], align 8
4684 ; CHECK2-NEXT: call void (ptr, i32, ptr, ...) @__kmpc_fork_call(ptr @[[GLOB2]], i32 1, ptr @merge..omp_par, ptr [[STRUCTARG]])
4685 ; CHECK2-NEXT: br label [[OMP_PAR_OUTLINED_EXIT:%.*]]
4686 ; CHECK2: omp.par.outlined.exit:
4687 ; CHECK2-NEXT: br label [[OMP_PAR_EXIT_SPLIT:%.*]]
4688 ; CHECK2: omp.par.exit.split:
4689 ; CHECK2-NEXT: br label [[ENTRY_SPLIT_SPLIT:%.*]]
4690 ; CHECK2: entry.split.split:
4691 ; CHECK2-NEXT: ret void
4694 ; CHECK2-LABEL: define {{[^@]+}}@merge..omp_par
4695 ; CHECK2-SAME: (ptr noalias [[TID_ADDR:%.*]], ptr noalias [[ZERO_ADDR:%.*]], ptr [[TMP0:%.*]]) #[[ATTR0:[0-9]+]] {
4696 ; CHECK2-NEXT: omp.par.entry:
4697 ; CHECK2-NEXT: [[GEP_A_ADDR:%.*]] = getelementptr { ptr }, ptr [[TMP0]], i32 0, i32 0
4698 ; CHECK2-NEXT: [[LOADGEP_A_ADDR:%.*]] = load ptr, ptr [[GEP_A_ADDR]], align 8
4699 ; CHECK2-NEXT: [[TID_ADDR_LOCAL:%.*]] = alloca i32, align 4
4700 ; CHECK2-NEXT: [[TMP1:%.*]] = load i32, ptr [[TID_ADDR]], align 4
4701 ; CHECK2-NEXT: store i32 [[TMP1]], ptr [[TID_ADDR_LOCAL]], align 4
4702 ; CHECK2-NEXT: [[TID:%.*]] = load i32, ptr [[TID_ADDR_LOCAL]], align 4
4703 ; CHECK2-NEXT: br label [[OMP_PAR_REGION:%.*]]
4704 ; CHECK2: omp.par.region:
4705 ; CHECK2-NEXT: br label [[OMP_PAR_MERGED:%.*]]
4706 ; CHECK2: omp.par.merged:
4707 ; CHECK2-NEXT: call void (ptr, ptr, ...) @.omp_outlined.(ptr [[TID_ADDR]], ptr [[ZERO_ADDR]], ptr nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[LOADGEP_A_ADDR]])
4708 ; CHECK2-NEXT: [[OMP_GLOBAL_THREAD_NUM:%.*]] = call i32 @__kmpc_global_thread_num(ptr @[[GLOB2]])
4709 ; CHECK2-NEXT: call void @__kmpc_barrier(ptr @[[GLOB3:[0-9]+]], i32 [[OMP_GLOBAL_THREAD_NUM]])
4710 ; CHECK2-NEXT: call void (ptr, ptr, ...) @.omp_outlined..1(ptr [[TID_ADDR]], ptr [[ZERO_ADDR]], ptr nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[LOADGEP_A_ADDR]])
4711 ; CHECK2-NEXT: br label [[ENTRY_SPLIT:%.*]]
4712 ; CHECK2: entry.split:
4713 ; CHECK2-NEXT: br label [[OMP_PAR_REGION_SPLIT:%.*]]
4714 ; CHECK2: omp.par.region.split:
4715 ; CHECK2-NEXT: br label [[OMP_PAR_PRE_FINALIZE:%.*]]
4716 ; CHECK2: omp.par.pre_finalize:
4717 ; CHECK2-NEXT: br label [[OMP_PAR_OUTLINED_EXIT_EXITSTUB:%.*]]
4718 ; CHECK2: omp.par.outlined.exit.exitStub:
4719 ; CHECK2-NEXT: ret void
4722 ; CHECK2-LABEL: define {{[^@]+}}@.omp_outlined.
4723 ; CHECK2-SAME: (ptr noalias nocapture nofree readnone [[DOTGLOBAL_TID_:%.*]], ptr noalias nocapture nofree readnone [[DOTBOUND_TID_:%.*]], ptr nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[A:%.*]]) {
4724 ; CHECK2-NEXT: entry:
4725 ; CHECK2-NEXT: [[TMP0:%.*]] = load i32, ptr [[A]], align 4
4726 ; CHECK2-NEXT: call void @use(i32 [[TMP0]])
4727 ; CHECK2-NEXT: ret void
4730 ; CHECK2-LABEL: define {{[^@]+}}@.omp_outlined..1
4731 ; CHECK2-SAME: (ptr noalias nocapture nofree readnone [[DOTGLOBAL_TID_:%.*]], ptr noalias nocapture nofree readnone [[DOTBOUND_TID_:%.*]], ptr nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[A:%.*]]) {
4732 ; CHECK2-NEXT: entry:
4733 ; CHECK2-NEXT: [[TMP0:%.*]] = load i32, ptr [[A]], align 4
4734 ; CHECK2-NEXT: call void @use(i32 [[TMP0]])
4735 ; CHECK2-NEXT: ret void
4738 ; CHECK2-LABEL: define {{[^@]+}}@unmergable_proc_bind
4739 ; CHECK2-SAME: (i32 [[A:%.*]]) local_unnamed_addr {
4740 ; CHECK2-NEXT: entry:
4741 ; CHECK2-NEXT: [[A_ADDR:%.*]] = alloca i32, align 4
4742 ; CHECK2-NEXT: [[TMP0:%.*]] = call i32 @__kmpc_global_thread_num(ptr noundef nonnull align 8 dereferenceable(24) @[[GLOB1:[0-9]+]])
4743 ; CHECK2-NEXT: store i32 [[A]], ptr [[A_ADDR]], align 4
4744 ; CHECK2-NEXT: call void @__kmpc_push_proc_bind(ptr noundef nonnull align 8 dereferenceable(24) @[[GLOB1]], i32 [[TMP0]], i32 noundef 3)
4745 ; CHECK2-NEXT: call void (ptr, i32, ptr, ...) @__kmpc_fork_call(ptr noundef nonnull align 8 dereferenceable(24) @[[GLOB1]], i32 noundef 1, ptr noundef nonnull @.omp_outlined..2, ptr nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[A_ADDR]])
4746 ; CHECK2-NEXT: call void (ptr, i32, ptr, ...) @__kmpc_fork_call(ptr noundef nonnull align 8 dereferenceable(24) @[[GLOB1]], i32 noundef 1, ptr noundef nonnull @.omp_outlined..3, ptr nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[A_ADDR]])
4747 ; CHECK2-NEXT: ret void
4750 ; CHECK2-LABEL: define {{[^@]+}}@.omp_outlined..2
4751 ; CHECK2-SAME: (ptr noalias nocapture nofree readnone [[DOTGLOBAL_TID_:%.*]], ptr noalias nocapture nofree readnone [[DOTBOUND_TID_:%.*]], ptr nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[A:%.*]]) {
4752 ; CHECK2-NEXT: entry:
4753 ; CHECK2-NEXT: [[TMP0:%.*]] = load i32, ptr [[A]], align 4
4754 ; CHECK2-NEXT: call void @use(i32 [[TMP0]])
4755 ; CHECK2-NEXT: ret void
4758 ; CHECK2-LABEL: define {{[^@]+}}@.omp_outlined..3
4759 ; CHECK2-SAME: (ptr noalias nocapture nofree readnone [[DOTGLOBAL_TID_:%.*]], ptr noalias nocapture nofree readnone [[DOTBOUND_TID_:%.*]], ptr nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[A:%.*]]) {
4760 ; CHECK2-NEXT: entry:
4761 ; CHECK2-NEXT: [[TMP0:%.*]] = load i32, ptr [[A]], align 4
4762 ; CHECK2-NEXT: call void @use(i32 [[TMP0]])
4763 ; CHECK2-NEXT: ret void
4766 ; CHECK2-LABEL: define {{[^@]+}}@unmergable_num_threads
4767 ; CHECK2-SAME: (i32 [[A:%.*]]) local_unnamed_addr {
4768 ; CHECK2-NEXT: entry:
4769 ; CHECK2-NEXT: [[A_ADDR:%.*]] = alloca i32, align 4
4770 ; CHECK2-NEXT: [[TMP0:%.*]] = call i32 @__kmpc_global_thread_num(ptr noundef nonnull align 8 dereferenceable(24) @[[GLOB1]])
4771 ; CHECK2-NEXT: store i32 [[A]], ptr [[A_ADDR]], align 4
4772 ; CHECK2-NEXT: call void @__kmpc_push_num_threads(ptr noundef nonnull align 8 dereferenceable(24) @[[GLOB1]], i32 [[TMP0]], i32 [[A]])
4773 ; CHECK2-NEXT: call void (ptr, i32, ptr, ...) @__kmpc_fork_call(ptr noundef nonnull align 8 dereferenceable(24) @[[GLOB1]], i32 noundef 1, ptr noundef nonnull @.omp_outlined..4, ptr nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[A_ADDR]])
4774 ; CHECK2-NEXT: call void (ptr, i32, ptr, ...) @__kmpc_fork_call(ptr noundef nonnull align 8 dereferenceable(24) @[[GLOB1]], i32 noundef 1, ptr noundef nonnull @.omp_outlined..5, ptr nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[A_ADDR]])
4775 ; CHECK2-NEXT: ret void
4778 ; CHECK2-LABEL: define {{[^@]+}}@.omp_outlined..4
4779 ; CHECK2-SAME: (ptr noalias nocapture nofree readnone [[DOTGLOBAL_TID_:%.*]], ptr noalias nocapture nofree readnone [[DOTBOUND_TID_:%.*]], ptr nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[A:%.*]]) {
4780 ; CHECK2-NEXT: entry:
4781 ; CHECK2-NEXT: [[TMP0:%.*]] = load i32, ptr [[A]], align 4
4782 ; CHECK2-NEXT: call void @use(i32 [[TMP0]])
4783 ; CHECK2-NEXT: ret void
4786 ; CHECK2-LABEL: define {{[^@]+}}@.omp_outlined..5
4787 ; CHECK2-SAME: (ptr noalias nocapture nofree readnone [[DOTGLOBAL_TID_:%.*]], ptr noalias nocapture nofree readnone [[DOTBOUND_TID_:%.*]], ptr nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[A:%.*]]) {
4788 ; CHECK2-NEXT: entry:
4789 ; CHECK2-NEXT: [[TMP0:%.*]] = load i32, ptr [[A]], align 4
4790 ; CHECK2-NEXT: call void @use(i32 [[TMP0]])
4791 ; CHECK2-NEXT: ret void
4794 ; CHECK2-LABEL: define {{[^@]+}}@unmergable_seq_call
4795 ; CHECK2-SAME: (i32 [[A:%.*]]) local_unnamed_addr {
4796 ; CHECK2-NEXT: entry:
4797 ; CHECK2-NEXT: [[A_ADDR:%.*]] = alloca i32, align 4
4798 ; CHECK2-NEXT: store i32 [[A]], ptr [[A_ADDR]], align 4
4799 ; CHECK2-NEXT: call void (ptr, i32, ptr, ...) @__kmpc_fork_call(ptr noundef nonnull align 8 dereferenceable(24) @[[GLOB1]], i32 noundef 1, ptr noundef nonnull @.omp_outlined..6, ptr nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[A_ADDR]])
4800 ; CHECK2-NEXT: call void (...) @foo()
4801 ; CHECK2-NEXT: call void (ptr, i32, ptr, ...) @__kmpc_fork_call(ptr noundef nonnull align 8 dereferenceable(24) @[[GLOB1]], i32 noundef 1, ptr noundef nonnull @.omp_outlined..7, ptr nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[A_ADDR]])
4802 ; CHECK2-NEXT: ret void
4805 ; CHECK2-LABEL: define {{[^@]+}}@.omp_outlined..6
4806 ; CHECK2-SAME: (ptr noalias nocapture nofree readnone [[DOTGLOBAL_TID_:%.*]], ptr noalias nocapture nofree readnone [[DOTBOUND_TID_:%.*]], ptr nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[A:%.*]]) {
4807 ; CHECK2-NEXT: entry:
4808 ; CHECK2-NEXT: [[TMP0:%.*]] = load i32, ptr [[A]], align 4
4809 ; CHECK2-NEXT: call void @use(i32 [[TMP0]])
4810 ; CHECK2-NEXT: ret void
4813 ; CHECK2-LABEL: define {{[^@]+}}@.omp_outlined..7
4814 ; CHECK2-SAME: (ptr noalias nocapture nofree readnone [[DOTGLOBAL_TID_:%.*]], ptr noalias nocapture nofree readnone [[DOTBOUND_TID_:%.*]], ptr nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[A:%.*]]) {
4815 ; CHECK2-NEXT: entry:
4816 ; CHECK2-NEXT: [[TMP0:%.*]] = load i32, ptr [[A]], align 4
4817 ; CHECK2-NEXT: call void @use(i32 [[TMP0]])
4818 ; CHECK2-NEXT: ret void
4821 ; CHECK2-LABEL: define {{[^@]+}}@merge_seq
4822 ; CHECK2-SAME: (i32 [[A:%.*]]) local_unnamed_addr {
4823 ; CHECK2-NEXT: entry:
4824 ; CHECK2-NEXT: [[STRUCTARG:%.*]] = alloca { ptr }, align 8
4825 ; CHECK2-NEXT: [[A_ADDR:%.*]] = alloca i32, align 4
4826 ; CHECK2-NEXT: store i32 [[A]], ptr [[A_ADDR]], align 4
4827 ; CHECK2-NEXT: [[OMP_GLOBAL_THREAD_NUM2:%.*]] = call i32 @__kmpc_global_thread_num(ptr @[[GLOB2]])
4828 ; CHECK2-NEXT: br label [[OMP_PARALLEL:%.*]]
4829 ; CHECK2: omp_parallel:
4830 ; CHECK2-NEXT: [[GEP_A_ADDR:%.*]] = getelementptr { ptr }, ptr [[STRUCTARG]], i32 0, i32 0
4831 ; CHECK2-NEXT: store ptr [[A_ADDR]], ptr [[GEP_A_ADDR]], align 8
4832 ; CHECK2-NEXT: call void (ptr, i32, ptr, ...) @__kmpc_fork_call(ptr @[[GLOB2]], i32 1, ptr @merge_seq..omp_par, ptr [[STRUCTARG]])
4833 ; CHECK2-NEXT: br label [[OMP_PAR_OUTLINED_EXIT:%.*]]
4834 ; CHECK2: omp.par.outlined.exit:
4835 ; CHECK2-NEXT: br label [[OMP_PAR_EXIT_SPLIT:%.*]]
4836 ; CHECK2: omp.par.exit.split:
4837 ; CHECK2-NEXT: br label [[ENTRY_SPLIT_SPLIT:%.*]]
4838 ; CHECK2: entry.split.split:
4839 ; CHECK2-NEXT: [[TMP0:%.*]] = load i32, ptr [[A_ADDR]], align 4
4840 ; CHECK2-NEXT: call void @use(i32 [[TMP0]])
4841 ; CHECK2-NEXT: ret void
4844 ; CHECK2-LABEL: define {{[^@]+}}@merge_seq..omp_par
4845 ; CHECK2-SAME: (ptr noalias [[TID_ADDR:%.*]], ptr noalias [[ZERO_ADDR:%.*]], ptr [[TMP0:%.*]]) #[[ATTR0]] {
4846 ; CHECK2-NEXT: omp.par.entry:
4847 ; CHECK2-NEXT: [[GEP_A_ADDR:%.*]] = getelementptr { ptr }, ptr [[TMP0]], i32 0, i32 0
4848 ; CHECK2-NEXT: [[LOADGEP_A_ADDR:%.*]] = load ptr, ptr [[GEP_A_ADDR]], align 8
4849 ; CHECK2-NEXT: [[TID_ADDR_LOCAL:%.*]] = alloca i32, align 4
4850 ; CHECK2-NEXT: [[TMP1:%.*]] = load i32, ptr [[TID_ADDR]], align 4
4851 ; CHECK2-NEXT: store i32 [[TMP1]], ptr [[TID_ADDR_LOCAL]], align 4
4852 ; CHECK2-NEXT: [[TID:%.*]] = load i32, ptr [[TID_ADDR_LOCAL]], align 4
4853 ; CHECK2-NEXT: br label [[OMP_PAR_REGION:%.*]]
4854 ; CHECK2: omp.par.region:
4855 ; CHECK2-NEXT: br label [[OMP_PAR_MERGED:%.*]]
4856 ; CHECK2: omp.par.merged:
4857 ; CHECK2-NEXT: call void (ptr, ptr, ...) @.omp_outlined..8(ptr [[TID_ADDR]], ptr [[ZERO_ADDR]], ptr nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[LOADGEP_A_ADDR]])
4858 ; CHECK2-NEXT: [[OMP_GLOBAL_THREAD_NUM2:%.*]] = call i32 @__kmpc_global_thread_num(ptr @[[GLOB2]])
4859 ; CHECK2-NEXT: call void @__kmpc_barrier(ptr @[[GLOB3]], i32 [[OMP_GLOBAL_THREAD_NUM2]])
4860 ; CHECK2-NEXT: [[OMP_GLOBAL_THREAD_NUM:%.*]] = call i32 @__kmpc_global_thread_num(ptr @[[GLOB2]])
4861 ; CHECK2-NEXT: [[TMP2:%.*]] = call i32 @__kmpc_master(ptr @[[GLOB2]], i32 [[OMP_GLOBAL_THREAD_NUM]])
4862 ; CHECK2-NEXT: [[TMP3:%.*]] = icmp ne i32 [[TMP2]], 0
4863 ; CHECK2-NEXT: br i1 [[TMP3]], label [[OMP_REGION_BODY:%.*]], label [[OMP_REGION_END:%.*]]
4864 ; CHECK2: omp_region.end:
4865 ; CHECK2-NEXT: [[OMP_GLOBAL_THREAD_NUM1:%.*]] = call i32 @__kmpc_global_thread_num(ptr @[[GLOB2]])
4866 ; CHECK2-NEXT: call void @__kmpc_barrier(ptr @[[GLOB3]], i32 [[OMP_GLOBAL_THREAD_NUM1]])
4867 ; CHECK2-NEXT: br label [[OMP_PAR_MERGED_SPLIT_SPLIT:%.*]]
4868 ; CHECK2: omp.par.merged.split.split:
4869 ; CHECK2-NEXT: call void (ptr, ptr, ...) @.omp_outlined..9(ptr [[TID_ADDR]], ptr [[ZERO_ADDR]], ptr nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[LOADGEP_A_ADDR]])
4870 ; CHECK2-NEXT: br label [[ENTRY_SPLIT:%.*]]
4871 ; CHECK2: entry.split:
4872 ; CHECK2-NEXT: br label [[OMP_PAR_REGION_SPLIT:%.*]]
4873 ; CHECK2: omp.par.region.split:
4874 ; CHECK2-NEXT: br label [[OMP_PAR_PRE_FINALIZE:%.*]]
4875 ; CHECK2: omp.par.pre_finalize:
4876 ; CHECK2-NEXT: br label [[OMP_PAR_OUTLINED_EXIT_EXITSTUB:%.*]]
4877 ; CHECK2: omp_region.body:
4878 ; CHECK2-NEXT: br label [[SEQ_PAR_MERGED:%.*]]
4879 ; CHECK2: seq.par.merged:
4880 ; CHECK2-NEXT: [[TMP4:%.*]] = load i32, ptr [[LOADGEP_A_ADDR]], align 4
4881 ; CHECK2-NEXT: [[ADD:%.*]] = add nsw i32 [[TMP4]], 1
4882 ; CHECK2-NEXT: store i32 [[ADD]], ptr [[LOADGEP_A_ADDR]], align 4
4883 ; CHECK2-NEXT: br label [[OMP_PAR_MERGED_SPLIT:%.*]]
4884 ; CHECK2: omp.par.merged.split:
4885 ; CHECK2-NEXT: br label [[OMP_REGION_BODY_SPLIT:%.*]]
4886 ; CHECK2: omp_region.body.split:
4887 ; CHECK2-NEXT: call void @__kmpc_end_master(ptr @[[GLOB2]], i32 [[OMP_GLOBAL_THREAD_NUM]])
4888 ; CHECK2-NEXT: br label [[OMP_REGION_END]]
4889 ; CHECK2: omp.par.outlined.exit.exitStub:
4890 ; CHECK2-NEXT: ret void
4893 ; CHECK2-LABEL: define {{[^@]+}}@.omp_outlined..8
4894 ; CHECK2-SAME: (ptr noalias nocapture nofree readnone [[DOTGLOBAL_TID_:%.*]], ptr noalias nocapture nofree readnone [[DOTBOUND_TID_:%.*]], ptr nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[A:%.*]]) {
4895 ; CHECK2-NEXT: entry:
4896 ; CHECK2-NEXT: [[TMP0:%.*]] = load i32, ptr [[A]], align 4
4897 ; CHECK2-NEXT: call void @use(i32 [[TMP0]])
4898 ; CHECK2-NEXT: ret void
4901 ; CHECK2-LABEL: define {{[^@]+}}@.omp_outlined..9
4902 ; CHECK2-SAME: (ptr noalias nocapture nofree readnone [[DOTGLOBAL_TID_:%.*]], ptr noalias nocapture nofree readnone [[DOTBOUND_TID_:%.*]], ptr nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[A:%.*]]) {
4903 ; CHECK2-NEXT: entry:
4904 ; CHECK2-NEXT: [[TMP0:%.*]] = load i32, ptr [[A]], align 4
4905 ; CHECK2-NEXT: call void @use(i32 [[TMP0]])
4906 ; CHECK2-NEXT: ret void
4909 ; CHECK2-LABEL: define {{[^@]+}}@merge_seq_float
4910 ; CHECK2-SAME: (float [[F:%.*]], ptr nocapture nofree writeonly [[P:%.*]]) local_unnamed_addr {
4911 ; CHECK2-NEXT: entry:
4912 ; CHECK2-NEXT: [[STRUCTARG:%.*]] = alloca { ptr, ptr, ptr }, align 8
4913 ; CHECK2-NEXT: [[F_RELOADED:%.*]] = alloca float, align 4
4914 ; CHECK2-NEXT: [[F_ADDR:%.*]] = alloca float, align 4
4915 ; CHECK2-NEXT: store float [[F]], ptr [[F_ADDR]], align 4
4916 ; CHECK2-NEXT: [[OMP_GLOBAL_THREAD_NUM2:%.*]] = call i32 @__kmpc_global_thread_num(ptr @[[GLOB2]])
4917 ; CHECK2-NEXT: store float [[F]], ptr [[F_RELOADED]], align 4
4918 ; CHECK2-NEXT: br label [[OMP_PARALLEL:%.*]]
4919 ; CHECK2: omp_parallel:
4920 ; CHECK2-NEXT: [[GEP_F_RELOADED:%.*]] = getelementptr { ptr, ptr, ptr }, ptr [[STRUCTARG]], i32 0, i32 0
4921 ; CHECK2-NEXT: store ptr [[F_RELOADED]], ptr [[GEP_F_RELOADED]], align 8
4922 ; CHECK2-NEXT: [[GEP_F_ADDR:%.*]] = getelementptr { ptr, ptr, ptr }, ptr [[STRUCTARG]], i32 0, i32 1
4923 ; CHECK2-NEXT: store ptr [[F_ADDR]], ptr [[GEP_F_ADDR]], align 8
4924 ; CHECK2-NEXT: [[GEP_P:%.*]] = getelementptr { ptr, ptr, ptr }, ptr [[STRUCTARG]], i32 0, i32 2
4925 ; CHECK2-NEXT: store ptr [[P]], ptr [[GEP_P]], align 8
4926 ; CHECK2-NEXT: call void (ptr, i32, ptr, ...) @__kmpc_fork_call(ptr @[[GLOB2]], i32 1, ptr @merge_seq_float..omp_par, ptr [[STRUCTARG]])
4927 ; CHECK2-NEXT: br label [[OMP_PAR_OUTLINED_EXIT:%.*]]
4928 ; CHECK2: omp.par.outlined.exit:
4929 ; CHECK2-NEXT: br label [[OMP_PAR_EXIT_SPLIT:%.*]]
4930 ; CHECK2: omp.par.exit.split:
4931 ; CHECK2-NEXT: br label [[ENTRY_SPLIT_SPLIT:%.*]]
4932 ; CHECK2: entry.split.split:
4933 ; CHECK2-NEXT: ret void
4936 ; CHECK2-LABEL: define {{[^@]+}}@merge_seq_float..omp_par
4937 ; CHECK2-SAME: (ptr noalias [[TID_ADDR:%.*]], ptr noalias [[ZERO_ADDR:%.*]], ptr [[TMP0:%.*]]) #[[ATTR0]] {
4938 ; CHECK2-NEXT: omp.par.entry:
4939 ; CHECK2-NEXT: [[GEP_F_RELOADED:%.*]] = getelementptr { ptr, ptr, ptr }, ptr [[TMP0]], i32 0, i32 0
4940 ; CHECK2-NEXT: [[LOADGEP_F_RELOADED:%.*]] = load ptr, ptr [[GEP_F_RELOADED]], align 8
4941 ; CHECK2-NEXT: [[GEP_F_ADDR:%.*]] = getelementptr { ptr, ptr, ptr }, ptr [[TMP0]], i32 0, i32 1
4942 ; CHECK2-NEXT: [[LOADGEP_F_ADDR:%.*]] = load ptr, ptr [[GEP_F_ADDR]], align 8
4943 ; CHECK2-NEXT: [[GEP_P:%.*]] = getelementptr { ptr, ptr, ptr }, ptr [[TMP0]], i32 0, i32 2
4944 ; CHECK2-NEXT: [[LOADGEP_P:%.*]] = load ptr, ptr [[GEP_P]], align 8
4945 ; CHECK2-NEXT: [[TID_ADDR_LOCAL:%.*]] = alloca i32, align 4
4946 ; CHECK2-NEXT: [[TMP1:%.*]] = load i32, ptr [[TID_ADDR]], align 4
4947 ; CHECK2-NEXT: store i32 [[TMP1]], ptr [[TID_ADDR_LOCAL]], align 4
4948 ; CHECK2-NEXT: [[TID:%.*]] = load i32, ptr [[TID_ADDR_LOCAL]], align 4
4949 ; CHECK2-NEXT: [[TMP2:%.*]] = load float, ptr [[LOADGEP_F_RELOADED]], align 4
4950 ; CHECK2-NEXT: br label [[OMP_PAR_REGION:%.*]]
4951 ; CHECK2: omp.par.region:
4952 ; CHECK2-NEXT: br label [[OMP_PAR_MERGED:%.*]]
4953 ; CHECK2: omp.par.merged:
4954 ; CHECK2-NEXT: call void (ptr, ptr, ...) @.omp_outlined..10(ptr [[TID_ADDR]], ptr [[ZERO_ADDR]], ptr nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[LOADGEP_F_ADDR]])
4955 ; CHECK2-NEXT: [[OMP_GLOBAL_THREAD_NUM2:%.*]] = call i32 @__kmpc_global_thread_num(ptr @[[GLOB2]])
4956 ; CHECK2-NEXT: call void @__kmpc_barrier(ptr @[[GLOB3]], i32 [[OMP_GLOBAL_THREAD_NUM2]])
4957 ; CHECK2-NEXT: [[OMP_GLOBAL_THREAD_NUM:%.*]] = call i32 @__kmpc_global_thread_num(ptr @[[GLOB2]])
4958 ; CHECK2-NEXT: [[TMP3:%.*]] = call i32 @__kmpc_master(ptr @[[GLOB2]], i32 [[OMP_GLOBAL_THREAD_NUM]])
4959 ; CHECK2-NEXT: [[TMP4:%.*]] = icmp ne i32 [[TMP3]], 0
4960 ; CHECK2-NEXT: br i1 [[TMP4]], label [[OMP_REGION_BODY:%.*]], label [[OMP_REGION_END:%.*]]
4961 ; CHECK2: omp_region.end:
4962 ; CHECK2-NEXT: [[OMP_GLOBAL_THREAD_NUM1:%.*]] = call i32 @__kmpc_global_thread_num(ptr @[[GLOB2]])
4963 ; CHECK2-NEXT: call void @__kmpc_barrier(ptr @[[GLOB3]], i32 [[OMP_GLOBAL_THREAD_NUM1]])
4964 ; CHECK2-NEXT: br label [[OMP_PAR_MERGED_SPLIT_SPLIT:%.*]]
4965 ; CHECK2: omp.par.merged.split.split:
4966 ; CHECK2-NEXT: call void (ptr, ptr, ...) @.omp_outlined..11(ptr [[TID_ADDR]], ptr [[ZERO_ADDR]], ptr nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[LOADGEP_F_ADDR]])
4967 ; CHECK2-NEXT: br label [[ENTRY_SPLIT:%.*]]
4968 ; CHECK2: entry.split:
4969 ; CHECK2-NEXT: br label [[OMP_PAR_REGION_SPLIT:%.*]]
4970 ; CHECK2: omp.par.region.split:
4971 ; CHECK2-NEXT: br label [[OMP_PAR_PRE_FINALIZE:%.*]]
4972 ; CHECK2: omp.par.pre_finalize:
4973 ; CHECK2-NEXT: br label [[OMP_PAR_OUTLINED_EXIT_EXITSTUB:%.*]]
4974 ; CHECK2: omp_region.body:
4975 ; CHECK2-NEXT: br label [[SEQ_PAR_MERGED:%.*]]
4976 ; CHECK2: seq.par.merged:
4977 ; CHECK2-NEXT: [[ADD:%.*]] = fadd float [[TMP2]], 0x40091EB860000000
4978 ; CHECK2-NEXT: store float [[ADD]], ptr [[LOADGEP_P]], align 4
4979 ; CHECK2-NEXT: br label [[OMP_PAR_MERGED_SPLIT:%.*]]
4980 ; CHECK2: omp.par.merged.split:
4981 ; CHECK2-NEXT: br label [[OMP_REGION_BODY_SPLIT:%.*]]
4982 ; CHECK2: omp_region.body.split:
4983 ; CHECK2-NEXT: call void @__kmpc_end_master(ptr @[[GLOB2]], i32 [[OMP_GLOBAL_THREAD_NUM]])
4984 ; CHECK2-NEXT: br label [[OMP_REGION_END]]
4985 ; CHECK2: omp.par.outlined.exit.exitStub:
4986 ; CHECK2-NEXT: ret void
4989 ; CHECK2-LABEL: define {{[^@]+}}@.omp_outlined..10
4990 ; CHECK2-SAME: (ptr noalias nocapture nofree readnone [[DOTGLOBAL_TID_:%.*]], ptr noalias nocapture nofree readnone [[DOTBOUND_TID_:%.*]], ptr nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[F:%.*]]) {
4991 ; CHECK2-NEXT: entry:
4992 ; CHECK2-NEXT: [[TMP0:%.*]] = load float, ptr [[F]], align 4
4993 ; CHECK2-NEXT: [[CONV:%.*]] = fptosi float [[TMP0]] to i32
4994 ; CHECK2-NEXT: call void @use(i32 [[CONV]])
4995 ; CHECK2-NEXT: ret void
4998 ; CHECK2-LABEL: define {{[^@]+}}@.omp_outlined..11
4999 ; CHECK2-SAME: (ptr noalias nocapture nofree readnone [[DOTGLOBAL_TID_:%.*]], ptr noalias nocapture nofree readnone [[DOTBOUND_TID_:%.*]], ptr nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[F:%.*]]) {
5000 ; CHECK2-NEXT: entry:
5001 ; CHECK2-NEXT: [[TMP0:%.*]] = load float, ptr [[F]], align 4
5002 ; CHECK2-NEXT: [[CONV:%.*]] = fptosi float [[TMP0]] to i32
5003 ; CHECK2-NEXT: call void @use(i32 [[CONV]])
5004 ; CHECK2-NEXT: ret void
5007 ; CHECK2-LABEL: define {{[^@]+}}@merge_seq_firstprivate
5008 ; CHECK2-SAME: (i32 [[A:%.*]]) local_unnamed_addr {
5009 ; CHECK2-NEXT: entry:
5010 ; CHECK2-NEXT: [[STRUCTARG:%.*]] = alloca { ptr, ptr }, align 8
5011 ; CHECK2-NEXT: [[A_CASTED_SROA_0_0_INSERT_EXT_SEQ_OUTPUT_ALLOC:%.*]] = alloca i64, align 8
5012 ; CHECK2-NEXT: [[A_ADDR:%.*]] = alloca i32, align 4
5013 ; CHECK2-NEXT: store i32 [[A]], ptr [[A_ADDR]], align 4
5014 ; CHECK2-NEXT: [[OMP_GLOBAL_THREAD_NUM2:%.*]] = call i32 @__kmpc_global_thread_num(ptr @[[GLOB2]])
5015 ; CHECK2-NEXT: br label [[OMP_PARALLEL:%.*]]
5016 ; CHECK2: omp_parallel:
5017 ; CHECK2-NEXT: [[GEP_A_ADDR:%.*]] = getelementptr { ptr, ptr }, ptr [[STRUCTARG]], i32 0, i32 0
5018 ; CHECK2-NEXT: store ptr [[A_ADDR]], ptr [[GEP_A_ADDR]], align 8
5019 ; CHECK2-NEXT: [[GEP_A_CASTED_SROA_0_0_INSERT_EXT_SEQ_OUTPUT_ALLOC:%.*]] = getelementptr { ptr, ptr }, ptr [[STRUCTARG]], i32 0, i32 1
5020 ; CHECK2-NEXT: store ptr [[A_CASTED_SROA_0_0_INSERT_EXT_SEQ_OUTPUT_ALLOC]], ptr [[GEP_A_CASTED_SROA_0_0_INSERT_EXT_SEQ_OUTPUT_ALLOC]], align 8
5021 ; CHECK2-NEXT: call void (ptr, i32, ptr, ...) @__kmpc_fork_call(ptr @[[GLOB2]], i32 1, ptr @merge_seq_firstprivate..omp_par, ptr [[STRUCTARG]])
5022 ; CHECK2-NEXT: br label [[OMP_PAR_OUTLINED_EXIT:%.*]]
5023 ; CHECK2: omp.par.outlined.exit:
5024 ; CHECK2-NEXT: br label [[OMP_PAR_EXIT_SPLIT:%.*]]
5025 ; CHECK2: omp.par.exit.split:
5026 ; CHECK2-NEXT: br label [[ENTRY_SPLIT_SPLIT:%.*]]
5027 ; CHECK2: entry.split.split:
5028 ; CHECK2-NEXT: [[TMP0:%.*]] = load i32, ptr [[A_ADDR]], align 4
5029 ; CHECK2-NEXT: call void @use(i32 [[TMP0]])
5030 ; CHECK2-NEXT: ret void
5033 ; CHECK2-LABEL: define {{[^@]+}}@merge_seq_firstprivate..omp_par
5034 ; CHECK2-SAME: (ptr noalias [[TID_ADDR:%.*]], ptr noalias [[ZERO_ADDR:%.*]], ptr [[TMP0:%.*]]) #[[ATTR0]] {
5035 ; CHECK2-NEXT: omp.par.entry:
5036 ; CHECK2-NEXT: [[GEP_A_ADDR:%.*]] = getelementptr { ptr, ptr }, ptr [[TMP0]], i32 0, i32 0
5037 ; CHECK2-NEXT: [[LOADGEP_A_ADDR:%.*]] = load ptr, ptr [[GEP_A_ADDR]], align 8
5038 ; CHECK2-NEXT: [[GEP_A_CASTED_SROA_0_0_INSERT_EXT_SEQ_OUTPUT_ALLOC:%.*]] = getelementptr { ptr, ptr }, ptr [[TMP0]], i32 0, i32 1
5039 ; CHECK2-NEXT: [[LOADGEP_A_CASTED_SROA_0_0_INSERT_EXT_SEQ_OUTPUT_ALLOC:%.*]] = load ptr, ptr [[GEP_A_CASTED_SROA_0_0_INSERT_EXT_SEQ_OUTPUT_ALLOC]], align 8
5040 ; CHECK2-NEXT: [[TID_ADDR_LOCAL:%.*]] = alloca i32, align 4
5041 ; CHECK2-NEXT: [[TMP1:%.*]] = load i32, ptr [[TID_ADDR]], align 4
5042 ; CHECK2-NEXT: store i32 [[TMP1]], ptr [[TID_ADDR_LOCAL]], align 4
5043 ; CHECK2-NEXT: [[TID:%.*]] = load i32, ptr [[TID_ADDR_LOCAL]], align 4
5044 ; CHECK2-NEXT: br label [[OMP_PAR_REGION:%.*]]
5045 ; CHECK2: omp.par.region:
5046 ; CHECK2-NEXT: br label [[OMP_PAR_MERGED:%.*]]
5047 ; CHECK2: omp.par.merged:
5048 ; CHECK2-NEXT: call void (ptr, ptr, ...) @.omp_outlined..12(ptr [[TID_ADDR]], ptr [[ZERO_ADDR]], ptr nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[LOADGEP_A_ADDR]])
5049 ; CHECK2-NEXT: [[OMP_GLOBAL_THREAD_NUM2:%.*]] = call i32 @__kmpc_global_thread_num(ptr @[[GLOB2]])
5050 ; CHECK2-NEXT: call void @__kmpc_barrier(ptr @[[GLOB3]], i32 [[OMP_GLOBAL_THREAD_NUM2]])
5051 ; CHECK2-NEXT: [[OMP_GLOBAL_THREAD_NUM:%.*]] = call i32 @__kmpc_global_thread_num(ptr @[[GLOB2]])
5052 ; CHECK2-NEXT: [[TMP2:%.*]] = call i32 @__kmpc_master(ptr @[[GLOB2]], i32 [[OMP_GLOBAL_THREAD_NUM]])
5053 ; CHECK2-NEXT: [[TMP3:%.*]] = icmp ne i32 [[TMP2]], 0
5054 ; CHECK2-NEXT: br i1 [[TMP3]], label [[OMP_REGION_BODY:%.*]], label [[OMP_REGION_END:%.*]]
5055 ; CHECK2: omp_region.end:
5056 ; CHECK2-NEXT: [[OMP_GLOBAL_THREAD_NUM1:%.*]] = call i32 @__kmpc_global_thread_num(ptr @[[GLOB2]])
5057 ; CHECK2-NEXT: call void @__kmpc_barrier(ptr @[[GLOB3]], i32 [[OMP_GLOBAL_THREAD_NUM1]])
5058 ; CHECK2-NEXT: br label [[OMP_PAR_MERGED_SPLIT_SPLIT:%.*]]
5059 ; CHECK2: omp.par.merged.split.split:
5060 ; CHECK2-NEXT: [[A_CASTED_SROA_0_0_INSERT_EXT_SEQ_OUTPUT_LOAD:%.*]] = load i64, ptr [[LOADGEP_A_CASTED_SROA_0_0_INSERT_EXT_SEQ_OUTPUT_ALLOC]], align 8
5061 ; CHECK2-NEXT: call void (ptr, ptr, ...) @.omp_outlined..13(ptr [[TID_ADDR]], ptr [[ZERO_ADDR]], i64 [[A_CASTED_SROA_0_0_INSERT_EXT_SEQ_OUTPUT_LOAD]])
5062 ; CHECK2-NEXT: br label [[ENTRY_SPLIT:%.*]]
5063 ; CHECK2: entry.split:
5064 ; CHECK2-NEXT: br label [[OMP_PAR_REGION_SPLIT:%.*]]
5065 ; CHECK2: omp.par.region.split:
5066 ; CHECK2-NEXT: br label [[OMP_PAR_PRE_FINALIZE:%.*]]
5067 ; CHECK2: omp.par.pre_finalize:
5068 ; CHECK2-NEXT: br label [[OMP_PAR_OUTLINED_EXIT_EXITSTUB:%.*]]
5069 ; CHECK2: omp_region.body:
5070 ; CHECK2-NEXT: br label [[SEQ_PAR_MERGED:%.*]]
5071 ; CHECK2: seq.par.merged:
5072 ; CHECK2-NEXT: [[TMP4:%.*]] = load i32, ptr [[LOADGEP_A_ADDR]], align 4
5073 ; CHECK2-NEXT: [[ADD:%.*]] = add nsw i32 [[TMP4]], 1
5074 ; CHECK2-NEXT: store i32 [[ADD]], ptr [[LOADGEP_A_ADDR]], align 4
5075 ; CHECK2-NEXT: [[A_CASTED_SROA_0_0_INSERT_EXT:%.*]] = zext i32 [[ADD]] to i64
5076 ; CHECK2-NEXT: store i64 [[A_CASTED_SROA_0_0_INSERT_EXT]], ptr [[LOADGEP_A_CASTED_SROA_0_0_INSERT_EXT_SEQ_OUTPUT_ALLOC]], align 8
5077 ; CHECK2-NEXT: br label [[OMP_PAR_MERGED_SPLIT:%.*]]
5078 ; CHECK2: omp.par.merged.split:
5079 ; CHECK2-NEXT: br label [[OMP_REGION_BODY_SPLIT:%.*]]
5080 ; CHECK2: omp_region.body.split:
5081 ; CHECK2-NEXT: call void @__kmpc_end_master(ptr @[[GLOB2]], i32 [[OMP_GLOBAL_THREAD_NUM]])
5082 ; CHECK2-NEXT: br label [[OMP_REGION_END]]
5083 ; CHECK2: omp.par.outlined.exit.exitStub:
5084 ; CHECK2-NEXT: ret void
5087 ; CHECK2-LABEL: define {{[^@]+}}@.omp_outlined..12
5088 ; CHECK2-SAME: (ptr noalias nocapture nofree readnone [[DOTGLOBAL_TID_:%.*]], ptr noalias nocapture nofree readnone [[DOTBOUND_TID_:%.*]], ptr nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[A:%.*]]) {
5089 ; CHECK2-NEXT: entry:
5090 ; CHECK2-NEXT: [[TMP0:%.*]] = load i32, ptr [[A]], align 4
5091 ; CHECK2-NEXT: call void @use(i32 [[TMP0]])
5092 ; CHECK2-NEXT: ret void
5095 ; CHECK2-LABEL: define {{[^@]+}}@.omp_outlined..13
5096 ; CHECK2-SAME: (ptr noalias nocapture nofree readnone [[DOTGLOBAL_TID_:%.*]], ptr noalias nocapture nofree readnone [[DOTBOUND_TID_:%.*]], i64 [[A:%.*]]) {
5097 ; CHECK2-NEXT: entry:
5098 ; CHECK2-NEXT: [[A_ADDR_SROA_0_0_EXTRACT_TRUNC:%.*]] = trunc i64 [[A]] to i32
5099 ; CHECK2-NEXT: call void @use(i32 [[A_ADDR_SROA_0_0_EXTRACT_TRUNC]])
5100 ; CHECK2-NEXT: ret void
5103 ; CHECK2-LABEL: define {{[^@]+}}@merge_seq_sink_lt
5104 ; CHECK2-SAME: (i32 [[A:%.*]]) local_unnamed_addr {
5105 ; CHECK2-NEXT: entry:
5106 ; CHECK2-NEXT: [[STRUCTARG:%.*]] = alloca { ptr }, align 8
5107 ; CHECK2-NEXT: [[A_ADDR:%.*]] = alloca i32, align 4
5108 ; CHECK2-NEXT: store i32 [[A]], ptr [[A_ADDR]], align 4
5109 ; CHECK2-NEXT: [[OMP_GLOBAL_THREAD_NUM2:%.*]] = call i32 @__kmpc_global_thread_num(ptr @[[GLOB2]])
5110 ; CHECK2-NEXT: br label [[OMP_PARALLEL:%.*]]
5111 ; CHECK2: omp_parallel:
5112 ; CHECK2-NEXT: [[GEP_A_ADDR:%.*]] = getelementptr { ptr }, ptr [[STRUCTARG]], i32 0, i32 0
5113 ; CHECK2-NEXT: store ptr [[A_ADDR]], ptr [[GEP_A_ADDR]], align 8
5114 ; CHECK2-NEXT: call void (ptr, i32, ptr, ...) @__kmpc_fork_call(ptr @[[GLOB2]], i32 1, ptr @merge_seq_sink_lt..omp_par, ptr [[STRUCTARG]])
5115 ; CHECK2-NEXT: br label [[OMP_PAR_OUTLINED_EXIT:%.*]]
5116 ; CHECK2: omp.par.outlined.exit:
5117 ; CHECK2-NEXT: br label [[OMP_PAR_EXIT_SPLIT:%.*]]
5118 ; CHECK2: omp.par.exit.split:
5119 ; CHECK2-NEXT: br label [[ENTRY_SPLIT_SPLIT:%.*]]
5120 ; CHECK2: entry.split.split:
5121 ; CHECK2-NEXT: ret void
5124 ; CHECK2-LABEL: define {{[^@]+}}@merge_seq_sink_lt..omp_par
5125 ; CHECK2-SAME: (ptr noalias [[TID_ADDR:%.*]], ptr noalias [[ZERO_ADDR:%.*]], ptr [[TMP0:%.*]]) #[[ATTR0]] {
5126 ; CHECK2-NEXT: omp.par.entry:
5127 ; CHECK2-NEXT: [[B:%.*]] = alloca i32, align 4
5128 ; CHECK2-NEXT: [[GEP_A_ADDR:%.*]] = getelementptr { ptr }, ptr [[TMP0]], i32 0, i32 0
5129 ; CHECK2-NEXT: [[LOADGEP_A_ADDR:%.*]] = load ptr, ptr [[GEP_A_ADDR]], align 8
5130 ; CHECK2-NEXT: [[TID_ADDR_LOCAL:%.*]] = alloca i32, align 4
5131 ; CHECK2-NEXT: [[TMP1:%.*]] = load i32, ptr [[TID_ADDR]], align 4
5132 ; CHECK2-NEXT: store i32 [[TMP1]], ptr [[TID_ADDR_LOCAL]], align 4
5133 ; CHECK2-NEXT: [[TID:%.*]] = load i32, ptr [[TID_ADDR_LOCAL]], align 4
5134 ; CHECK2-NEXT: br label [[OMP_PAR_REGION:%.*]]
5135 ; CHECK2: omp.par.region:
5136 ; CHECK2-NEXT: br label [[OMP_PAR_MERGED:%.*]]
5137 ; CHECK2: omp.par.merged:
5138 ; CHECK2-NEXT: call void (ptr, ptr, ...) @.omp_outlined..14(ptr [[TID_ADDR]], ptr [[ZERO_ADDR]], ptr nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[LOADGEP_A_ADDR]])
5139 ; CHECK2-NEXT: [[OMP_GLOBAL_THREAD_NUM2:%.*]] = call i32 @__kmpc_global_thread_num(ptr @[[GLOB2]])
5140 ; CHECK2-NEXT: call void @__kmpc_barrier(ptr @[[GLOB3]], i32 [[OMP_GLOBAL_THREAD_NUM2]])
5141 ; CHECK2-NEXT: [[OMP_GLOBAL_THREAD_NUM:%.*]] = call i32 @__kmpc_global_thread_num(ptr @[[GLOB2]])
5142 ; CHECK2-NEXT: [[TMP2:%.*]] = call i32 @__kmpc_master(ptr @[[GLOB2]], i32 [[OMP_GLOBAL_THREAD_NUM]])
5143 ; CHECK2-NEXT: [[TMP3:%.*]] = icmp ne i32 [[TMP2]], 0
5144 ; CHECK2-NEXT: br i1 [[TMP3]], label [[OMP_REGION_BODY:%.*]], label [[OMP_REGION_END:%.*]]
5145 ; CHECK2: omp_region.end:
5146 ; CHECK2-NEXT: [[OMP_GLOBAL_THREAD_NUM1:%.*]] = call i32 @__kmpc_global_thread_num(ptr @[[GLOB2]])
5147 ; CHECK2-NEXT: call void @__kmpc_barrier(ptr @[[GLOB3]], i32 [[OMP_GLOBAL_THREAD_NUM1]])
5148 ; CHECK2-NEXT: br label [[OMP_PAR_MERGED_SPLIT_SPLIT:%.*]]
5149 ; CHECK2: omp.par.merged.split.split:
5150 ; CHECK2-NEXT: call void (ptr, ptr, ...) @.omp_outlined..15(ptr [[TID_ADDR]], ptr [[ZERO_ADDR]], ptr nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[LOADGEP_A_ADDR]])
5151 ; CHECK2-NEXT: br label [[ENTRY_SPLIT:%.*]]
5152 ; CHECK2: entry.split:
5153 ; CHECK2-NEXT: br label [[OMP_PAR_REGION_SPLIT:%.*]]
5154 ; CHECK2: omp.par.region.split:
5155 ; CHECK2-NEXT: br label [[OMP_PAR_PRE_FINALIZE:%.*]]
5156 ; CHECK2: omp.par.pre_finalize:
5157 ; CHECK2-NEXT: br label [[OMP_PAR_OUTLINED_EXIT_EXITSTUB:%.*]]
5158 ; CHECK2: omp_region.body:
5159 ; CHECK2-NEXT: br label [[SEQ_PAR_MERGED:%.*]]
5160 ; CHECK2: seq.par.merged:
5161 ; CHECK2-NEXT: call void @llvm.lifetime.start.p0(i64 noundef 4, ptr noundef nonnull [[B]])
5162 ; CHECK2-NEXT: [[TMP4:%.*]] = ptrtoint ptr [[B]] to i64
5163 ; CHECK2-NEXT: [[TMP5:%.*]] = trunc i64 [[TMP4]] to i32
5164 ; CHECK2-NEXT: store i32 [[TMP5]], ptr [[B]], align 4
5165 ; CHECK2-NEXT: call void @llvm.lifetime.end.p0(i64 noundef 4, ptr noundef nonnull [[B]])
5166 ; CHECK2-NEXT: br label [[OMP_PAR_MERGED_SPLIT:%.*]]
5167 ; CHECK2: omp.par.merged.split:
5168 ; CHECK2-NEXT: br label [[OMP_REGION_BODY_SPLIT:%.*]]
5169 ; CHECK2: omp_region.body.split:
5170 ; CHECK2-NEXT: call void @__kmpc_end_master(ptr @[[GLOB2]], i32 [[OMP_GLOBAL_THREAD_NUM]])
5171 ; CHECK2-NEXT: br label [[OMP_REGION_END]]
5172 ; CHECK2: omp.par.outlined.exit.exitStub:
5173 ; CHECK2-NEXT: ret void
5176 ; CHECK2-LABEL: define {{[^@]+}}@.omp_outlined..14
5177 ; CHECK2-SAME: (ptr noalias nocapture nofree readnone [[DOTGLOBAL_TID_:%.*]], ptr noalias nocapture nofree readnone [[DOTBOUND_TID_:%.*]], ptr nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[A:%.*]]) {
5178 ; CHECK2-NEXT: entry:
5179 ; CHECK2-NEXT: [[TMP0:%.*]] = load i32, ptr [[A]], align 4
5180 ; CHECK2-NEXT: call void @use(i32 [[TMP0]])
5181 ; CHECK2-NEXT: ret void
5184 ; CHECK2-LABEL: define {{[^@]+}}@.omp_outlined..15
5185 ; CHECK2-SAME: (ptr noalias nocapture nofree readnone [[DOTGLOBAL_TID_:%.*]], ptr noalias nocapture nofree readnone [[DOTBOUND_TID_:%.*]], ptr nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[A:%.*]]) {
5186 ; CHECK2-NEXT: entry:
5187 ; CHECK2-NEXT: [[TMP0:%.*]] = load i32, ptr [[A]], align 4
5188 ; CHECK2-NEXT: call void @use(i32 [[TMP0]])
5189 ; CHECK2-NEXT: ret void
5192 ; CHECK2-LABEL: define {{[^@]+}}@merge_seq_par_use
5193 ; CHECK2-SAME: (i32 [[A:%.*]]) local_unnamed_addr {
5194 ; CHECK2-NEXT: entry:
5195 ; CHECK2-NEXT: [[STRUCTARG:%.*]] = alloca { ptr, ptr, ptr }, align 8
5196 ; CHECK2-NEXT: [[A_RELOADED:%.*]] = alloca i32, align 4
5197 ; CHECK2-NEXT: [[A_ADDR:%.*]] = alloca i32, align 4
5198 ; CHECK2-NEXT: [[B:%.*]] = alloca i32, align 4
5199 ; CHECK2-NEXT: store i32 [[A]], ptr [[A_ADDR]], align 4
5200 ; CHECK2-NEXT: [[OMP_GLOBAL_THREAD_NUM2:%.*]] = call i32 @__kmpc_global_thread_num(ptr @[[GLOB2]])
5201 ; CHECK2-NEXT: store i32 [[A]], ptr [[A_RELOADED]], align 4
5202 ; CHECK2-NEXT: br label [[OMP_PARALLEL:%.*]]
5203 ; CHECK2: omp_parallel:
5204 ; CHECK2-NEXT: [[GEP_A_RELOADED:%.*]] = getelementptr { ptr, ptr, ptr }, ptr [[STRUCTARG]], i32 0, i32 0
5205 ; CHECK2-NEXT: store ptr [[A_RELOADED]], ptr [[GEP_A_RELOADED]], align 8
5206 ; CHECK2-NEXT: [[GEP_A_ADDR:%.*]] = getelementptr { ptr, ptr, ptr }, ptr [[STRUCTARG]], i32 0, i32 1
5207 ; CHECK2-NEXT: store ptr [[A_ADDR]], ptr [[GEP_A_ADDR]], align 8
5208 ; CHECK2-NEXT: [[GEP_B:%.*]] = getelementptr { ptr, ptr, ptr }, ptr [[STRUCTARG]], i32 0, i32 2
5209 ; CHECK2-NEXT: store ptr [[B]], ptr [[GEP_B]], align 8
5210 ; CHECK2-NEXT: call void @llvm.lifetime.start.p0(i64 -1, ptr [[B]])
5211 ; CHECK2-NEXT: call void (ptr, i32, ptr, ...) @__kmpc_fork_call(ptr @[[GLOB2]], i32 1, ptr @merge_seq_par_use..omp_par, ptr [[STRUCTARG]])
5212 ; CHECK2-NEXT: br label [[OMP_PAR_OUTLINED_EXIT:%.*]]
5213 ; CHECK2: omp.par.outlined.exit:
5214 ; CHECK2-NEXT: br label [[OMP_PAR_EXIT_SPLIT:%.*]]
5215 ; CHECK2: omp.par.exit.split:
5216 ; CHECK2-NEXT: br label [[ENTRY_SPLIT_SPLIT:%.*]]
5217 ; CHECK2: entry.split.split:
5218 ; CHECK2-NEXT: call void @llvm.lifetime.end.p0(i64 noundef 4, ptr noundef nonnull [[B]])
5219 ; CHECK2-NEXT: ret void
5222 ; CHECK2-LABEL: define {{[^@]+}}@merge_seq_par_use..omp_par
5223 ; CHECK2-SAME: (ptr noalias [[TID_ADDR:%.*]], ptr noalias [[ZERO_ADDR:%.*]], ptr [[TMP0:%.*]]) #[[ATTR0]] {
5224 ; CHECK2-NEXT: omp.par.entry:
5225 ; CHECK2-NEXT: [[GEP_A_RELOADED:%.*]] = getelementptr { ptr, ptr, ptr }, ptr [[TMP0]], i32 0, i32 0
5226 ; CHECK2-NEXT: [[LOADGEP_A_RELOADED:%.*]] = load ptr, ptr [[GEP_A_RELOADED]], align 8
5227 ; CHECK2-NEXT: [[GEP_A_ADDR:%.*]] = getelementptr { ptr, ptr, ptr }, ptr [[TMP0]], i32 0, i32 1
5228 ; CHECK2-NEXT: [[LOADGEP_A_ADDR:%.*]] = load ptr, ptr [[GEP_A_ADDR]], align 8
5229 ; CHECK2-NEXT: [[GEP_B:%.*]] = getelementptr { ptr, ptr, ptr }, ptr [[TMP0]], i32 0, i32 2
5230 ; CHECK2-NEXT: [[LOADGEP_B:%.*]] = load ptr, ptr [[GEP_B]], align 8
5231 ; CHECK2-NEXT: [[TID_ADDR_LOCAL:%.*]] = alloca i32, align 4
5232 ; CHECK2-NEXT: [[TMP1:%.*]] = load i32, ptr [[TID_ADDR]], align 4
5233 ; CHECK2-NEXT: store i32 [[TMP1]], ptr [[TID_ADDR_LOCAL]], align 4
5234 ; CHECK2-NEXT: [[TID:%.*]] = load i32, ptr [[TID_ADDR_LOCAL]], align 4
5235 ; CHECK2-NEXT: [[TMP2:%.*]] = load i32, ptr [[LOADGEP_A_RELOADED]], align 4
5236 ; CHECK2-NEXT: br label [[OMP_PAR_REGION:%.*]]
5237 ; CHECK2: omp.par.region:
5238 ; CHECK2-NEXT: br label [[OMP_PAR_MERGED:%.*]]
5239 ; CHECK2: omp.par.merged:
5240 ; CHECK2-NEXT: call void (ptr, ptr, ...) @.omp_outlined..16(ptr [[TID_ADDR]], ptr [[ZERO_ADDR]], ptr nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[LOADGEP_A_ADDR]])
5241 ; CHECK2-NEXT: [[OMP_GLOBAL_THREAD_NUM2:%.*]] = call i32 @__kmpc_global_thread_num(ptr @[[GLOB2]])
5242 ; CHECK2-NEXT: call void @__kmpc_barrier(ptr @[[GLOB3]], i32 [[OMP_GLOBAL_THREAD_NUM2]])
5243 ; CHECK2-NEXT: [[OMP_GLOBAL_THREAD_NUM:%.*]] = call i32 @__kmpc_global_thread_num(ptr @[[GLOB2]])
5244 ; CHECK2-NEXT: [[TMP3:%.*]] = call i32 @__kmpc_master(ptr @[[GLOB2]], i32 [[OMP_GLOBAL_THREAD_NUM]])
5245 ; CHECK2-NEXT: [[TMP4:%.*]] = icmp ne i32 [[TMP3]], 0
5246 ; CHECK2-NEXT: br i1 [[TMP4]], label [[OMP_REGION_BODY:%.*]], label [[OMP_REGION_END:%.*]]
5247 ; CHECK2: omp_region.end:
5248 ; CHECK2-NEXT: [[OMP_GLOBAL_THREAD_NUM1:%.*]] = call i32 @__kmpc_global_thread_num(ptr @[[GLOB2]])
5249 ; CHECK2-NEXT: call void @__kmpc_barrier(ptr @[[GLOB3]], i32 [[OMP_GLOBAL_THREAD_NUM1]])
5250 ; CHECK2-NEXT: br label [[OMP_PAR_MERGED_SPLIT_SPLIT:%.*]]
5251 ; CHECK2: omp.par.merged.split.split:
5252 ; CHECK2-NEXT: call void (ptr, ptr, ...) @.omp_outlined..17(ptr [[TID_ADDR]], ptr [[ZERO_ADDR]], ptr nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[LOADGEP_A_ADDR]], ptr nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[LOADGEP_B]])
5253 ; CHECK2-NEXT: br label [[ENTRY_SPLIT:%.*]]
5254 ; CHECK2: entry.split:
5255 ; CHECK2-NEXT: br label [[OMP_PAR_REGION_SPLIT:%.*]]
5256 ; CHECK2: omp.par.region.split:
5257 ; CHECK2-NEXT: br label [[OMP_PAR_PRE_FINALIZE:%.*]]
5258 ; CHECK2: omp.par.pre_finalize:
5259 ; CHECK2-NEXT: br label [[OMP_PAR_OUTLINED_EXIT_EXITSTUB:%.*]]
5260 ; CHECK2: omp_region.body:
5261 ; CHECK2-NEXT: br label [[SEQ_PAR_MERGED:%.*]]
5262 ; CHECK2: seq.par.merged:
5263 ; CHECK2-NEXT: [[ADD:%.*]] = add nsw i32 [[TMP2]], 1
5264 ; CHECK2-NEXT: store i32 [[ADD]], ptr [[LOADGEP_B]], align 4
5265 ; CHECK2-NEXT: br label [[OMP_PAR_MERGED_SPLIT:%.*]]
5266 ; CHECK2: omp.par.merged.split:
5267 ; CHECK2-NEXT: br label [[OMP_REGION_BODY_SPLIT:%.*]]
5268 ; CHECK2: omp_region.body.split:
5269 ; CHECK2-NEXT: call void @__kmpc_end_master(ptr @[[GLOB2]], i32 [[OMP_GLOBAL_THREAD_NUM]])
5270 ; CHECK2-NEXT: br label [[OMP_REGION_END]]
5271 ; CHECK2: omp.par.outlined.exit.exitStub:
5272 ; CHECK2-NEXT: ret void
5275 ; CHECK2-LABEL: define {{[^@]+}}@.omp_outlined..16
5276 ; CHECK2-SAME: (ptr noalias nocapture nofree readnone [[DOTGLOBAL_TID_:%.*]], ptr noalias nocapture nofree readnone [[DOTBOUND_TID_:%.*]], ptr nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[A:%.*]]) {
5277 ; CHECK2-NEXT: entry:
5278 ; CHECK2-NEXT: [[TMP0:%.*]] = load i32, ptr [[A]], align 4
5279 ; CHECK2-NEXT: call void @use(i32 [[TMP0]])
5280 ; CHECK2-NEXT: ret void
5283 ; CHECK2-LABEL: define {{[^@]+}}@.omp_outlined..17
5284 ; CHECK2-SAME: (ptr noalias nocapture nofree readnone [[DOTGLOBAL_TID_:%.*]], ptr noalias nocapture nofree readnone [[DOTBOUND_TID_:%.*]], ptr nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[A:%.*]], ptr nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[B:%.*]]) {
5285 ; CHECK2-NEXT: entry:
5286 ; CHECK2-NEXT: [[TMP0:%.*]] = load i32, ptr [[A]], align 4
5287 ; CHECK2-NEXT: call void @use(i32 [[TMP0]])
5288 ; CHECK2-NEXT: [[TMP1:%.*]] = load i32, ptr [[B]], align 4
5289 ; CHECK2-NEXT: call void @use(i32 [[TMP1]])
5290 ; CHECK2-NEXT: ret void
5293 ; CHECK2-LABEL: define {{[^@]+}}@merge_cancellable_regions
5294 ; CHECK2-SAME: (i32 [[CANCEL1:%.*]], i32 [[CANCEL2:%.*]]) local_unnamed_addr {
5295 ; CHECK2-NEXT: entry:
5296 ; CHECK2-NEXT: [[STRUCTARG:%.*]] = alloca { ptr, ptr }, align 8
5297 ; CHECK2-NEXT: [[CANCEL1_ADDR:%.*]] = alloca i32, align 4
5298 ; CHECK2-NEXT: [[CANCEL2_ADDR:%.*]] = alloca i32, align 4
5299 ; CHECK2-NEXT: store i32 [[CANCEL1]], ptr [[CANCEL1_ADDR]], align 4
5300 ; CHECK2-NEXT: store i32 [[CANCEL2]], ptr [[CANCEL2_ADDR]], align 4
5301 ; CHECK2-NEXT: [[OMP_GLOBAL_THREAD_NUM:%.*]] = call i32 @__kmpc_global_thread_num(ptr @[[GLOB2]])
5302 ; CHECK2-NEXT: br label [[OMP_PARALLEL:%.*]]
5303 ; CHECK2: omp_parallel:
5304 ; CHECK2-NEXT: [[GEP_CANCEL1_ADDR:%.*]] = getelementptr { ptr, ptr }, ptr [[STRUCTARG]], i32 0, i32 0
5305 ; CHECK2-NEXT: store ptr [[CANCEL1_ADDR]], ptr [[GEP_CANCEL1_ADDR]], align 8
5306 ; CHECK2-NEXT: [[GEP_CANCEL2_ADDR:%.*]] = getelementptr { ptr, ptr }, ptr [[STRUCTARG]], i32 0, i32 1
5307 ; CHECK2-NEXT: store ptr [[CANCEL2_ADDR]], ptr [[GEP_CANCEL2_ADDR]], align 8
5308 ; CHECK2-NEXT: call void (ptr, i32, ptr, ...) @__kmpc_fork_call(ptr @[[GLOB2]], i32 1, ptr @merge_cancellable_regions..omp_par, ptr [[STRUCTARG]])
5309 ; CHECK2-NEXT: br label [[OMP_PAR_OUTLINED_EXIT:%.*]]
5310 ; CHECK2: omp.par.outlined.exit:
5311 ; CHECK2-NEXT: br label [[OMP_PAR_EXIT_SPLIT:%.*]]
5312 ; CHECK2: omp.par.exit.split:
5313 ; CHECK2-NEXT: br label [[ENTRY_SPLIT_SPLIT:%.*]]
5314 ; CHECK2: entry.split.split:
5315 ; CHECK2-NEXT: ret void
5318 ; CHECK2-LABEL: define {{[^@]+}}@merge_cancellable_regions..omp_par
5319 ; CHECK2-SAME: (ptr noalias [[TID_ADDR:%.*]], ptr noalias [[ZERO_ADDR:%.*]], ptr [[TMP0:%.*]]) #[[ATTR0]] {
5320 ; CHECK2-NEXT: omp.par.entry:
5321 ; CHECK2-NEXT: [[GEP_CANCEL1_ADDR:%.*]] = getelementptr { ptr, ptr }, ptr [[TMP0]], i32 0, i32 0
5322 ; CHECK2-NEXT: [[LOADGEP_CANCEL1_ADDR:%.*]] = load ptr, ptr [[GEP_CANCEL1_ADDR]], align 8
5323 ; CHECK2-NEXT: [[GEP_CANCEL2_ADDR:%.*]] = getelementptr { ptr, ptr }, ptr [[TMP0]], i32 0, i32 1
5324 ; CHECK2-NEXT: [[LOADGEP_CANCEL2_ADDR:%.*]] = load ptr, ptr [[GEP_CANCEL2_ADDR]], align 8
5325 ; CHECK2-NEXT: [[TID_ADDR_LOCAL:%.*]] = alloca i32, align 4
5326 ; CHECK2-NEXT: [[TMP1:%.*]] = load i32, ptr [[TID_ADDR]], align 4
5327 ; CHECK2-NEXT: store i32 [[TMP1]], ptr [[TID_ADDR_LOCAL]], align 4
5328 ; CHECK2-NEXT: [[TID:%.*]] = load i32, ptr [[TID_ADDR_LOCAL]], align 4
5329 ; CHECK2-NEXT: br label [[OMP_PAR_REGION:%.*]]
5330 ; CHECK2: omp.par.region:
5331 ; CHECK2-NEXT: br label [[OMP_PAR_MERGED:%.*]]
5332 ; CHECK2: omp.par.merged:
5333 ; CHECK2-NEXT: call void (ptr, ptr, ...) @.omp_outlined..18(ptr [[TID_ADDR]], ptr [[ZERO_ADDR]], ptr nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[LOADGEP_CANCEL1_ADDR]])
5334 ; CHECK2-NEXT: [[OMP_GLOBAL_THREAD_NUM:%.*]] = call i32 @__kmpc_global_thread_num(ptr @[[GLOB2]])
5335 ; CHECK2-NEXT: call void @__kmpc_barrier(ptr @[[GLOB3]], i32 [[OMP_GLOBAL_THREAD_NUM]])
5336 ; CHECK2-NEXT: call void (ptr, ptr, ...) @.omp_outlined..19(ptr [[TID_ADDR]], ptr [[ZERO_ADDR]], ptr nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[LOADGEP_CANCEL2_ADDR]])
5337 ; CHECK2-NEXT: br label [[ENTRY_SPLIT:%.*]]
5338 ; CHECK2: entry.split:
5339 ; CHECK2-NEXT: br label [[OMP_PAR_REGION_SPLIT:%.*]]
5340 ; CHECK2: omp.par.region.split:
5341 ; CHECK2-NEXT: br label [[OMP_PAR_PRE_FINALIZE:%.*]]
5342 ; CHECK2: omp.par.pre_finalize:
5343 ; CHECK2-NEXT: br label [[OMP_PAR_OUTLINED_EXIT_EXITSTUB:%.*]]
5344 ; CHECK2: omp.par.outlined.exit.exitStub:
5345 ; CHECK2-NEXT: ret void
5348 ; CHECK2-LABEL: define {{[^@]+}}@.omp_outlined..18
5349 ; CHECK2-SAME: (ptr noalias nocapture nofree readonly [[DOTGLOBAL_TID_:%.*]], ptr noalias nocapture nofree readnone [[DOTBOUND_TID_:%.*]], ptr nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[CANCEL1:%.*]]) {
5350 ; CHECK2-NEXT: entry:
5351 ; CHECK2-NEXT: [[TMP0:%.*]] = load i32, ptr [[CANCEL1]], align 4
5352 ; CHECK2-NEXT: [[TOBOOL_NOT:%.*]] = icmp eq i32 [[TMP0]], 0
5353 ; CHECK2-NEXT: br i1 [[TOBOOL_NOT]], label [[IF_END:%.*]], label [[IF_THEN:%.*]]
5355 ; CHECK2-NEXT: [[TMP1:%.*]] = load i32, ptr [[DOTGLOBAL_TID_]], align 4
5356 ; CHECK2-NEXT: [[TMP2:%.*]] = call i32 @__kmpc_cancel(ptr noundef nonnull @[[GLOB1]], i32 [[TMP1]], i32 noundef 1)
5357 ; CHECK2-NEXT: ret void
5359 ; CHECK2-NEXT: ret void
5362 ; CHECK2-LABEL: define {{[^@]+}}@.omp_outlined..19
5363 ; CHECK2-SAME: (ptr noalias nocapture nofree readonly [[DOTGLOBAL_TID_:%.*]], ptr noalias nocapture nofree readnone [[DOTBOUND_TID_:%.*]], ptr nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[CANCEL2:%.*]]) {
5364 ; CHECK2-NEXT: entry:
5365 ; CHECK2-NEXT: [[TMP0:%.*]] = load i32, ptr [[CANCEL2]], align 4
5366 ; CHECK2-NEXT: [[TOBOOL_NOT:%.*]] = icmp eq i32 [[TMP0]], 0
5367 ; CHECK2-NEXT: br i1 [[TOBOOL_NOT]], label [[IF_END:%.*]], label [[IF_THEN:%.*]]
5369 ; CHECK2-NEXT: [[TMP1:%.*]] = load i32, ptr [[DOTGLOBAL_TID_]], align 4
5370 ; CHECK2-NEXT: [[TMP2:%.*]] = call i32 @__kmpc_cancel(ptr noundef nonnull @[[GLOB1]], i32 [[TMP1]], i32 noundef 1)
5371 ; CHECK2-NEXT: ret void
5373 ; CHECK2-NEXT: ret void
5376 ; CHECK2-LABEL: define {{[^@]+}}@merge_cancellable_regions_seq
5377 ; CHECK2-SAME: (i32 [[CANCEL1:%.*]], i32 [[CANCEL2:%.*]]) local_unnamed_addr {
5378 ; CHECK2-NEXT: entry:
5379 ; CHECK2-NEXT: [[STRUCTARG:%.*]] = alloca { ptr, ptr, ptr }, align 8
5380 ; CHECK2-NEXT: [[CANCEL1_RELOADED:%.*]] = alloca i32, align 4
5381 ; CHECK2-NEXT: [[CANCEL1_ADDR:%.*]] = alloca i32, align 4
5382 ; CHECK2-NEXT: [[CANCEL2_ADDR:%.*]] = alloca i32, align 4
5383 ; CHECK2-NEXT: store i32 [[CANCEL1]], ptr [[CANCEL1_ADDR]], align 4
5384 ; CHECK2-NEXT: store i32 [[CANCEL2]], ptr [[CANCEL2_ADDR]], align 4
5385 ; CHECK2-NEXT: [[OMP_GLOBAL_THREAD_NUM2:%.*]] = call i32 @__kmpc_global_thread_num(ptr @[[GLOB2]])
5386 ; CHECK2-NEXT: store i32 [[CANCEL1]], ptr [[CANCEL1_RELOADED]], align 4
5387 ; CHECK2-NEXT: br label [[OMP_PARALLEL:%.*]]
5388 ; CHECK2: omp_parallel:
5389 ; CHECK2-NEXT: [[GEP_CANCEL1_RELOADED:%.*]] = getelementptr { ptr, ptr, ptr }, ptr [[STRUCTARG]], i32 0, i32 0
5390 ; CHECK2-NEXT: store ptr [[CANCEL1_RELOADED]], ptr [[GEP_CANCEL1_RELOADED]], align 8
5391 ; CHECK2-NEXT: [[GEP_CANCEL1_ADDR:%.*]] = getelementptr { ptr, ptr, ptr }, ptr [[STRUCTARG]], i32 0, i32 1
5392 ; CHECK2-NEXT: store ptr [[CANCEL1_ADDR]], ptr [[GEP_CANCEL1_ADDR]], align 8
5393 ; CHECK2-NEXT: [[GEP_CANCEL2_ADDR:%.*]] = getelementptr { ptr, ptr, ptr }, ptr [[STRUCTARG]], i32 0, i32 2
5394 ; CHECK2-NEXT: store ptr [[CANCEL2_ADDR]], ptr [[GEP_CANCEL2_ADDR]], align 8
5395 ; CHECK2-NEXT: call void (ptr, i32, ptr, ...) @__kmpc_fork_call(ptr @[[GLOB2]], i32 1, ptr @merge_cancellable_regions_seq..omp_par, ptr [[STRUCTARG]])
5396 ; CHECK2-NEXT: br label [[OMP_PAR_OUTLINED_EXIT:%.*]]
5397 ; CHECK2: omp.par.outlined.exit:
5398 ; CHECK2-NEXT: br label [[OMP_PAR_EXIT_SPLIT:%.*]]
5399 ; CHECK2: omp.par.exit.split:
5400 ; CHECK2-NEXT: br label [[ENTRY_SPLIT_SPLIT:%.*]]
5401 ; CHECK2: entry.split.split:
5402 ; CHECK2-NEXT: ret void
5405 ; CHECK2-LABEL: define {{[^@]+}}@merge_cancellable_regions_seq..omp_par
5406 ; CHECK2-SAME: (ptr noalias [[TID_ADDR:%.*]], ptr noalias [[ZERO_ADDR:%.*]], ptr [[TMP0:%.*]]) #[[ATTR0]] {
5407 ; CHECK2-NEXT: omp.par.entry:
5408 ; CHECK2-NEXT: [[GEP_CANCEL1_RELOADED:%.*]] = getelementptr { ptr, ptr, ptr }, ptr [[TMP0]], i32 0, i32 0
5409 ; CHECK2-NEXT: [[LOADGEP_CANCEL1_RELOADED:%.*]] = load ptr, ptr [[GEP_CANCEL1_RELOADED]], align 8
5410 ; CHECK2-NEXT: [[GEP_CANCEL1_ADDR:%.*]] = getelementptr { ptr, ptr, ptr }, ptr [[TMP0]], i32 0, i32 1
5411 ; CHECK2-NEXT: [[LOADGEP_CANCEL1_ADDR:%.*]] = load ptr, ptr [[GEP_CANCEL1_ADDR]], align 8
5412 ; CHECK2-NEXT: [[GEP_CANCEL2_ADDR:%.*]] = getelementptr { ptr, ptr, ptr }, ptr [[TMP0]], i32 0, i32 2
5413 ; CHECK2-NEXT: [[LOADGEP_CANCEL2_ADDR:%.*]] = load ptr, ptr [[GEP_CANCEL2_ADDR]], align 8
5414 ; CHECK2-NEXT: [[TID_ADDR_LOCAL:%.*]] = alloca i32, align 4
5415 ; CHECK2-NEXT: [[TMP1:%.*]] = load i32, ptr [[TID_ADDR]], align 4
5416 ; CHECK2-NEXT: store i32 [[TMP1]], ptr [[TID_ADDR_LOCAL]], align 4
5417 ; CHECK2-NEXT: [[TID:%.*]] = load i32, ptr [[TID_ADDR_LOCAL]], align 4
5418 ; CHECK2-NEXT: [[TMP2:%.*]] = load i32, ptr [[LOADGEP_CANCEL1_RELOADED]], align 4
5419 ; CHECK2-NEXT: br label [[OMP_PAR_REGION:%.*]]
5420 ; CHECK2: omp.par.region:
5421 ; CHECK2-NEXT: br label [[OMP_PAR_MERGED:%.*]]
5422 ; CHECK2: omp.par.merged:
5423 ; CHECK2-NEXT: call void (ptr, ptr, ...) @.omp_outlined..20(ptr [[TID_ADDR]], ptr [[ZERO_ADDR]], ptr nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[LOADGEP_CANCEL1_ADDR]])
5424 ; CHECK2-NEXT: [[OMP_GLOBAL_THREAD_NUM2:%.*]] = call i32 @__kmpc_global_thread_num(ptr @[[GLOB2]])
5425 ; CHECK2-NEXT: call void @__kmpc_barrier(ptr @[[GLOB3]], i32 [[OMP_GLOBAL_THREAD_NUM2]])
5426 ; CHECK2-NEXT: [[OMP_GLOBAL_THREAD_NUM:%.*]] = call i32 @__kmpc_global_thread_num(ptr @[[GLOB2]])
5427 ; CHECK2-NEXT: [[TMP3:%.*]] = call i32 @__kmpc_master(ptr @[[GLOB2]], i32 [[OMP_GLOBAL_THREAD_NUM]])
5428 ; CHECK2-NEXT: [[TMP4:%.*]] = icmp ne i32 [[TMP3]], 0
5429 ; CHECK2-NEXT: br i1 [[TMP4]], label [[OMP_REGION_BODY:%.*]], label [[OMP_REGION_END:%.*]]
5430 ; CHECK2: omp_region.end:
5431 ; CHECK2-NEXT: [[OMP_GLOBAL_THREAD_NUM1:%.*]] = call i32 @__kmpc_global_thread_num(ptr @[[GLOB2]])
5432 ; CHECK2-NEXT: call void @__kmpc_barrier(ptr @[[GLOB3]], i32 [[OMP_GLOBAL_THREAD_NUM1]])
5433 ; CHECK2-NEXT: br label [[OMP_PAR_MERGED_SPLIT_SPLIT:%.*]]
5434 ; CHECK2: omp.par.merged.split.split:
5435 ; CHECK2-NEXT: call void (ptr, ptr, ...) @.omp_outlined..21(ptr [[TID_ADDR]], ptr [[ZERO_ADDR]], ptr nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[LOADGEP_CANCEL2_ADDR]])
5436 ; CHECK2-NEXT: br label [[ENTRY_SPLIT:%.*]]
5437 ; CHECK2: entry.split:
5438 ; CHECK2-NEXT: br label [[OMP_PAR_REGION_SPLIT:%.*]]
5439 ; CHECK2: omp.par.region.split:
5440 ; CHECK2-NEXT: br label [[OMP_PAR_PRE_FINALIZE:%.*]]
5441 ; CHECK2: omp.par.pre_finalize:
5442 ; CHECK2-NEXT: br label [[OMP_PAR_OUTLINED_EXIT_EXITSTUB:%.*]]
5443 ; CHECK2: omp_region.body:
5444 ; CHECK2-NEXT: br label [[SEQ_PAR_MERGED:%.*]]
5445 ; CHECK2: seq.par.merged:
5446 ; CHECK2-NEXT: [[TOBOOL_NOT:%.*]] = icmp eq i32 [[TMP2]], 0
5447 ; CHECK2-NEXT: [[LNOT_EXT:%.*]] = zext i1 [[TOBOOL_NOT]] to i32
5448 ; CHECK2-NEXT: store i32 [[LNOT_EXT]], ptr [[LOADGEP_CANCEL2_ADDR]], align 4
5449 ; CHECK2-NEXT: br label [[OMP_PAR_MERGED_SPLIT:%.*]]
5450 ; CHECK2: omp.par.merged.split:
5451 ; CHECK2-NEXT: br label [[OMP_REGION_BODY_SPLIT:%.*]]
5452 ; CHECK2: omp_region.body.split:
5453 ; CHECK2-NEXT: call void @__kmpc_end_master(ptr @[[GLOB2]], i32 [[OMP_GLOBAL_THREAD_NUM]])
5454 ; CHECK2-NEXT: br label [[OMP_REGION_END]]
5455 ; CHECK2: omp.par.outlined.exit.exitStub:
5456 ; CHECK2-NEXT: ret void
5459 ; CHECK2-LABEL: define {{[^@]+}}@.omp_outlined..20
5460 ; CHECK2-SAME: (ptr noalias nocapture nofree readonly [[DOTGLOBAL_TID_:%.*]], ptr noalias nocapture nofree readnone [[DOTBOUND_TID_:%.*]], ptr nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[CANCEL1:%.*]]) {
5461 ; CHECK2-NEXT: entry:
5462 ; CHECK2-NEXT: [[TMP0:%.*]] = load i32, ptr [[CANCEL1]], align 4
5463 ; CHECK2-NEXT: [[TOBOOL_NOT:%.*]] = icmp eq i32 [[TMP0]], 0
5464 ; CHECK2-NEXT: br i1 [[TOBOOL_NOT]], label [[IF_END:%.*]], label [[IF_THEN:%.*]]
5466 ; CHECK2-NEXT: [[TMP1:%.*]] = load i32, ptr [[DOTGLOBAL_TID_]], align 4
5467 ; CHECK2-NEXT: [[TMP2:%.*]] = call i32 @__kmpc_cancel(ptr noundef nonnull @[[GLOB1]], i32 [[TMP1]], i32 noundef 1)
5468 ; CHECK2-NEXT: ret void
5470 ; CHECK2-NEXT: ret void
5473 ; CHECK2-LABEL: define {{[^@]+}}@.omp_outlined..21
5474 ; CHECK2-SAME: (ptr noalias nocapture nofree readonly [[DOTGLOBAL_TID_:%.*]], ptr noalias nocapture nofree readnone [[DOTBOUND_TID_:%.*]], ptr nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[CANCEL2:%.*]]) {
5475 ; CHECK2-NEXT: entry:
5476 ; CHECK2-NEXT: [[TMP0:%.*]] = load i32, ptr [[CANCEL2]], align 4
5477 ; CHECK2-NEXT: [[TOBOOL_NOT:%.*]] = icmp eq i32 [[TMP0]], 0
5478 ; CHECK2-NEXT: br i1 [[TOBOOL_NOT]], label [[IF_END:%.*]], label [[IF_THEN:%.*]]
5480 ; CHECK2-NEXT: [[TMP1:%.*]] = load i32, ptr [[DOTGLOBAL_TID_]], align 4
5481 ; CHECK2-NEXT: [[TMP2:%.*]] = call i32 @__kmpc_cancel(ptr noundef nonnull @[[GLOB1]], i32 [[TMP1]], i32 noundef 1)
5482 ; CHECK2-NEXT: ret void
5484 ; CHECK2-NEXT: ret void
5487 ; CHECK2-LABEL: define {{[^@]+}}@merge_3
5488 ; CHECK2-SAME: (i32 [[A:%.*]]) local_unnamed_addr {
5489 ; CHECK2-NEXT: entry:
5490 ; CHECK2-NEXT: [[STRUCTARG:%.*]] = alloca { ptr }, align 8
5491 ; CHECK2-NEXT: [[A_ADDR:%.*]] = alloca i32, align 4
5492 ; CHECK2-NEXT: store i32 [[A]], ptr [[A_ADDR]], align 4
5493 ; CHECK2-NEXT: [[OMP_GLOBAL_THREAD_NUM:%.*]] = call i32 @__kmpc_global_thread_num(ptr @[[GLOB2]])
5494 ; CHECK2-NEXT: br label [[OMP_PARALLEL:%.*]]
5495 ; CHECK2: omp_parallel:
5496 ; CHECK2-NEXT: [[GEP_A_ADDR:%.*]] = getelementptr { ptr }, ptr [[STRUCTARG]], i32 0, i32 0
5497 ; CHECK2-NEXT: store ptr [[A_ADDR]], ptr [[GEP_A_ADDR]], align 8
5498 ; CHECK2-NEXT: call void (ptr, i32, ptr, ...) @__kmpc_fork_call(ptr @[[GLOB2]], i32 1, ptr @merge_3..omp_par, ptr [[STRUCTARG]])
5499 ; CHECK2-NEXT: br label [[OMP_PAR_OUTLINED_EXIT:%.*]]
5500 ; CHECK2: omp.par.outlined.exit:
5501 ; CHECK2-NEXT: br label [[OMP_PAR_EXIT_SPLIT:%.*]]
5502 ; CHECK2: omp.par.exit.split:
5503 ; CHECK2-NEXT: br label [[ENTRY_SPLIT_SPLIT:%.*]]
5504 ; CHECK2: entry.split.split:
5505 ; CHECK2-NEXT: ret void
5508 ; CHECK2-LABEL: define {{[^@]+}}@merge_3..omp_par
5509 ; CHECK2-SAME: (ptr noalias [[TID_ADDR:%.*]], ptr noalias [[ZERO_ADDR:%.*]], ptr [[TMP0:%.*]]) #[[ATTR0]] {
5510 ; CHECK2-NEXT: omp.par.entry:
5511 ; CHECK2-NEXT: [[GEP_A_ADDR:%.*]] = getelementptr { ptr }, ptr [[TMP0]], i32 0, i32 0
5512 ; CHECK2-NEXT: [[LOADGEP_A_ADDR:%.*]] = load ptr, ptr [[GEP_A_ADDR]], align 8
5513 ; CHECK2-NEXT: [[TID_ADDR_LOCAL:%.*]] = alloca i32, align 4
5514 ; CHECK2-NEXT: [[TMP1:%.*]] = load i32, ptr [[TID_ADDR]], align 4
5515 ; CHECK2-NEXT: store i32 [[TMP1]], ptr [[TID_ADDR_LOCAL]], align 4
5516 ; CHECK2-NEXT: [[TID:%.*]] = load i32, ptr [[TID_ADDR_LOCAL]], align 4
5517 ; CHECK2-NEXT: br label [[OMP_PAR_REGION:%.*]]
5518 ; CHECK2: omp.par.region:
5519 ; CHECK2-NEXT: br label [[OMP_PAR_MERGED:%.*]]
5520 ; CHECK2: omp.par.merged:
5521 ; CHECK2-NEXT: call void (ptr, ptr, ...) @.omp_outlined..22(ptr [[TID_ADDR]], ptr [[ZERO_ADDR]], ptr nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[LOADGEP_A_ADDR]])
5522 ; CHECK2-NEXT: [[OMP_GLOBAL_THREAD_NUM:%.*]] = call i32 @__kmpc_global_thread_num(ptr @[[GLOB2]])
5523 ; CHECK2-NEXT: call void @__kmpc_barrier(ptr @[[GLOB3]], i32 [[OMP_GLOBAL_THREAD_NUM]])
5524 ; CHECK2-NEXT: call void (ptr, ptr, ...) @.omp_outlined..23(ptr [[TID_ADDR]], ptr [[ZERO_ADDR]], ptr nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[LOADGEP_A_ADDR]])
5525 ; CHECK2-NEXT: [[OMP_GLOBAL_THREAD_NUM1:%.*]] = call i32 @__kmpc_global_thread_num(ptr @[[GLOB2]])
5526 ; CHECK2-NEXT: call void @__kmpc_barrier(ptr @[[GLOB3]], i32 [[OMP_GLOBAL_THREAD_NUM1]])
5527 ; CHECK2-NEXT: call void (ptr, ptr, ...) @.omp_outlined..24(ptr [[TID_ADDR]], ptr [[ZERO_ADDR]], ptr nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[LOADGEP_A_ADDR]])
5528 ; CHECK2-NEXT: br label [[ENTRY_SPLIT:%.*]]
5529 ; CHECK2: entry.split:
5530 ; CHECK2-NEXT: br label [[OMP_PAR_REGION_SPLIT:%.*]]
5531 ; CHECK2: omp.par.region.split:
5532 ; CHECK2-NEXT: br label [[OMP_PAR_PRE_FINALIZE:%.*]]
5533 ; CHECK2: omp.par.pre_finalize:
5534 ; CHECK2-NEXT: br label [[OMP_PAR_OUTLINED_EXIT_EXITSTUB:%.*]]
5535 ; CHECK2: omp.par.outlined.exit.exitStub:
5536 ; CHECK2-NEXT: ret void
5539 ; CHECK2-LABEL: define {{[^@]+}}@.omp_outlined..22
5540 ; CHECK2-SAME: (ptr noalias nocapture nofree readnone [[DOTGLOBAL_TID_:%.*]], ptr noalias nocapture nofree readnone [[DOTBOUND_TID_:%.*]], ptr nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[A:%.*]]) {
5541 ; CHECK2-NEXT: entry:
5542 ; CHECK2-NEXT: [[TMP0:%.*]] = load i32, ptr [[A]], align 4
5543 ; CHECK2-NEXT: call void @use(i32 [[TMP0]])
5544 ; CHECK2-NEXT: ret void
5547 ; CHECK2-LABEL: define {{[^@]+}}@.omp_outlined..23
5548 ; CHECK2-SAME: (ptr noalias nocapture nofree readnone [[DOTGLOBAL_TID_:%.*]], ptr noalias nocapture nofree readnone [[DOTBOUND_TID_:%.*]], ptr nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[A:%.*]]) {
5549 ; CHECK2-NEXT: entry:
5550 ; CHECK2-NEXT: [[TMP0:%.*]] = load i32, ptr [[A]], align 4
5551 ; CHECK2-NEXT: call void @use(i32 [[TMP0]])
5552 ; CHECK2-NEXT: ret void
5555 ; CHECK2-LABEL: define {{[^@]+}}@.omp_outlined..24
5556 ; CHECK2-SAME: (ptr noalias nocapture nofree readnone [[DOTGLOBAL_TID_:%.*]], ptr noalias nocapture nofree readnone [[DOTBOUND_TID_:%.*]], ptr nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[A:%.*]]) {
5557 ; CHECK2-NEXT: entry:
5558 ; CHECK2-NEXT: [[TMP0:%.*]] = load i32, ptr [[A]], align 4
5559 ; CHECK2-NEXT: call void @use(i32 [[TMP0]])
5560 ; CHECK2-NEXT: ret void
5563 ; CHECK2-LABEL: define {{[^@]+}}@merge_3_seq
5564 ; CHECK2-SAME: (i32 [[A:%.*]], i32 [[B:%.*]]) local_unnamed_addr {
5565 ; CHECK2-NEXT: entry:
5566 ; CHECK2-NEXT: [[STRUCTARG:%.*]] = alloca { ptr, ptr, ptr, ptr }, align 8
5567 ; CHECK2-NEXT: [[A_RELOADED:%.*]] = alloca i32, align 4
5568 ; CHECK2-NEXT: [[ADD1_SEQ_OUTPUT_ALLOC:%.*]] = alloca i32, align 4
5569 ; CHECK2-NEXT: [[ADD_SEQ_OUTPUT_ALLOC:%.*]] = alloca i32, align 4
5570 ; CHECK2-NEXT: [[A_ADDR:%.*]] = alloca i32, align 4
5571 ; CHECK2-NEXT: store i32 [[A]], ptr [[A_ADDR]], align 4
5572 ; CHECK2-NEXT: [[OMP_GLOBAL_THREAD_NUM7:%.*]] = call i32 @__kmpc_global_thread_num(ptr @[[GLOB2]])
5573 ; CHECK2-NEXT: store i32 [[A]], ptr [[A_RELOADED]], align 4
5574 ; CHECK2-NEXT: br label [[OMP_PARALLEL:%.*]]
5575 ; CHECK2: omp_parallel:
5576 ; CHECK2-NEXT: [[GEP_A_RELOADED:%.*]] = getelementptr { ptr, ptr, ptr, ptr }, ptr [[STRUCTARG]], i32 0, i32 0
5577 ; CHECK2-NEXT: store ptr [[A_RELOADED]], ptr [[GEP_A_RELOADED]], align 8
5578 ; CHECK2-NEXT: [[GEP_A_ADDR:%.*]] = getelementptr { ptr, ptr, ptr, ptr }, ptr [[STRUCTARG]], i32 0, i32 1
5579 ; CHECK2-NEXT: store ptr [[A_ADDR]], ptr [[GEP_A_ADDR]], align 8
5580 ; CHECK2-NEXT: [[GEP_ADD_SEQ_OUTPUT_ALLOC:%.*]] = getelementptr { ptr, ptr, ptr, ptr }, ptr [[STRUCTARG]], i32 0, i32 2
5581 ; CHECK2-NEXT: store ptr [[ADD_SEQ_OUTPUT_ALLOC]], ptr [[GEP_ADD_SEQ_OUTPUT_ALLOC]], align 8
5582 ; CHECK2-NEXT: [[GEP_ADD1_SEQ_OUTPUT_ALLOC:%.*]] = getelementptr { ptr, ptr, ptr, ptr }, ptr [[STRUCTARG]], i32 0, i32 3
5583 ; CHECK2-NEXT: store ptr [[ADD1_SEQ_OUTPUT_ALLOC]], ptr [[GEP_ADD1_SEQ_OUTPUT_ALLOC]], align 8
5584 ; CHECK2-NEXT: call void (ptr, i32, ptr, ...) @__kmpc_fork_call(ptr @[[GLOB2]], i32 1, ptr @merge_3_seq..omp_par, ptr [[STRUCTARG]])
5585 ; CHECK2-NEXT: br label [[OMP_PAR_OUTLINED_EXIT:%.*]]
5586 ; CHECK2: omp.par.outlined.exit:
5587 ; CHECK2-NEXT: br label [[OMP_PAR_EXIT_SPLIT:%.*]]
5588 ; CHECK2: omp.par.exit.split:
5589 ; CHECK2-NEXT: br label [[ENTRY_SPLIT_SPLIT:%.*]]
5590 ; CHECK2: entry.split.split:
5591 ; CHECK2-NEXT: [[ADD1_SEQ_OUTPUT_LOAD:%.*]] = load i32, ptr [[ADD1_SEQ_OUTPUT_ALLOC]], align 4
5592 ; CHECK2-NEXT: call void @use(i32 [[ADD1_SEQ_OUTPUT_LOAD]])
5593 ; CHECK2-NEXT: ret void
5596 ; CHECK2-LABEL: define {{[^@]+}}@merge_3_seq..omp_par
5597 ; CHECK2-SAME: (ptr noalias [[TID_ADDR:%.*]], ptr noalias [[ZERO_ADDR:%.*]], ptr [[TMP0:%.*]]) #[[ATTR0]] {
5598 ; CHECK2-NEXT: omp.par.entry:
5599 ; CHECK2-NEXT: [[GEP_A_RELOADED:%.*]] = getelementptr { ptr, ptr, ptr, ptr }, ptr [[TMP0]], i32 0, i32 0
5600 ; CHECK2-NEXT: [[LOADGEP_A_RELOADED:%.*]] = load ptr, ptr [[GEP_A_RELOADED]], align 8
5601 ; CHECK2-NEXT: [[GEP_A_ADDR:%.*]] = getelementptr { ptr, ptr, ptr, ptr }, ptr [[TMP0]], i32 0, i32 1
5602 ; CHECK2-NEXT: [[LOADGEP_A_ADDR:%.*]] = load ptr, ptr [[GEP_A_ADDR]], align 8
5603 ; CHECK2-NEXT: [[GEP_ADD_SEQ_OUTPUT_ALLOC:%.*]] = getelementptr { ptr, ptr, ptr, ptr }, ptr [[TMP0]], i32 0, i32 2
5604 ; CHECK2-NEXT: [[LOADGEP_ADD_SEQ_OUTPUT_ALLOC:%.*]] = load ptr, ptr [[GEP_ADD_SEQ_OUTPUT_ALLOC]], align 8
5605 ; CHECK2-NEXT: [[GEP_ADD1_SEQ_OUTPUT_ALLOC:%.*]] = getelementptr { ptr, ptr, ptr, ptr }, ptr [[TMP0]], i32 0, i32 3
5606 ; CHECK2-NEXT: [[LOADGEP_ADD1_SEQ_OUTPUT_ALLOC:%.*]] = load ptr, ptr [[GEP_ADD1_SEQ_OUTPUT_ALLOC]], align 8
5607 ; CHECK2-NEXT: [[TID_ADDR_LOCAL:%.*]] = alloca i32, align 4
5608 ; CHECK2-NEXT: [[TMP1:%.*]] = load i32, ptr [[TID_ADDR]], align 4
5609 ; CHECK2-NEXT: store i32 [[TMP1]], ptr [[TID_ADDR_LOCAL]], align 4
5610 ; CHECK2-NEXT: [[TID:%.*]] = load i32, ptr [[TID_ADDR_LOCAL]], align 4
5611 ; CHECK2-NEXT: [[TMP2:%.*]] = load i32, ptr [[LOADGEP_A_RELOADED]], align 4
5612 ; CHECK2-NEXT: br label [[OMP_PAR_REGION:%.*]]
5613 ; CHECK2: omp.par.region:
5614 ; CHECK2-NEXT: br label [[OMP_PAR_MERGED:%.*]]
5615 ; CHECK2: omp.par.merged:
5616 ; CHECK2-NEXT: call void (ptr, ptr, ...) @.omp_outlined..25(ptr [[TID_ADDR]], ptr [[ZERO_ADDR]], ptr nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[LOADGEP_A_ADDR]])
5617 ; CHECK2-NEXT: [[OMP_GLOBAL_THREAD_NUM2:%.*]] = call i32 @__kmpc_global_thread_num(ptr @[[GLOB2]])
5618 ; CHECK2-NEXT: call void @__kmpc_barrier(ptr @[[GLOB3]], i32 [[OMP_GLOBAL_THREAD_NUM2]])
5619 ; CHECK2-NEXT: [[OMP_GLOBAL_THREAD_NUM:%.*]] = call i32 @__kmpc_global_thread_num(ptr @[[GLOB2]])
5620 ; CHECK2-NEXT: [[TMP3:%.*]] = call i32 @__kmpc_master(ptr @[[GLOB2]], i32 [[OMP_GLOBAL_THREAD_NUM]])
5621 ; CHECK2-NEXT: [[TMP4:%.*]] = icmp ne i32 [[TMP3]], 0
5622 ; CHECK2-NEXT: br i1 [[TMP4]], label [[OMP_REGION_BODY:%.*]], label [[OMP_REGION_END:%.*]]
5623 ; CHECK2: omp_region.end:
5624 ; CHECK2-NEXT: [[OMP_GLOBAL_THREAD_NUM1:%.*]] = call i32 @__kmpc_global_thread_num(ptr @[[GLOB2]])
5625 ; CHECK2-NEXT: call void @__kmpc_barrier(ptr @[[GLOB3]], i32 [[OMP_GLOBAL_THREAD_NUM1]])
5626 ; CHECK2-NEXT: br label [[OMP_PAR_MERGED_SPLIT_SPLIT:%.*]]
5627 ; CHECK2: omp.par.merged.split.split:
5628 ; CHECK2-NEXT: call void (ptr, ptr, ...) @.omp_outlined..26(ptr [[TID_ADDR]], ptr [[ZERO_ADDR]], ptr nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[LOADGEP_A_ADDR]])
5629 ; CHECK2-NEXT: [[OMP_GLOBAL_THREAD_NUM4:%.*]] = call i32 @__kmpc_global_thread_num(ptr @[[GLOB2]])
5630 ; CHECK2-NEXT: call void @__kmpc_barrier(ptr @[[GLOB3]], i32 [[OMP_GLOBAL_THREAD_NUM4]])
5631 ; CHECK2-NEXT: [[OMP_GLOBAL_THREAD_NUM3:%.*]] = call i32 @__kmpc_global_thread_num(ptr @[[GLOB2]])
5632 ; CHECK2-NEXT: [[TMP5:%.*]] = call i32 @__kmpc_master(ptr @[[GLOB2]], i32 [[OMP_GLOBAL_THREAD_NUM3]])
5633 ; CHECK2-NEXT: [[TMP6:%.*]] = icmp ne i32 [[TMP5]], 0
5634 ; CHECK2-NEXT: br i1 [[TMP6]], label [[OMP_REGION_BODY5:%.*]], label [[OMP_REGION_END4:%.*]]
5635 ; CHECK2: omp_region.end4:
5636 ; CHECK2-NEXT: [[OMP_GLOBAL_THREAD_NUM6:%.*]] = call i32 @__kmpc_global_thread_num(ptr @[[GLOB2]])
5637 ; CHECK2-NEXT: call void @__kmpc_barrier(ptr @[[GLOB3]], i32 [[OMP_GLOBAL_THREAD_NUM6]])
5638 ; CHECK2-NEXT: br label [[OMP_PAR_MERGED_SPLIT_SPLIT_SPLIT_SPLIT:%.*]]
5639 ; CHECK2: omp.par.merged.split.split.split.split:
5640 ; CHECK2-NEXT: call void (ptr, ptr, ...) @.omp_outlined..27(ptr [[TID_ADDR]], ptr [[ZERO_ADDR]], ptr nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[LOADGEP_A_ADDR]])
5641 ; CHECK2-NEXT: br label [[ENTRY_SPLIT:%.*]]
5642 ; CHECK2: entry.split:
5643 ; CHECK2-NEXT: br label [[OMP_PAR_REGION_SPLIT:%.*]]
5644 ; CHECK2: omp.par.region.split:
5645 ; CHECK2-NEXT: br label [[OMP_PAR_PRE_FINALIZE:%.*]]
5646 ; CHECK2: omp.par.pre_finalize:
5647 ; CHECK2-NEXT: br label [[OMP_PAR_OUTLINED_EXIT_EXITSTUB:%.*]]
5648 ; CHECK2: omp_region.body5:
5649 ; CHECK2-NEXT: br label [[SEQ_PAR_MERGED2:%.*]]
5650 ; CHECK2: seq.par.merged2:
5651 ; CHECK2-NEXT: [[ADD_SEQ_OUTPUT_LOAD:%.*]] = load i32, ptr [[LOADGEP_ADD_SEQ_OUTPUT_ALLOC]], align 4
5652 ; CHECK2-NEXT: [[ADD1:%.*]] = add nsw i32 [[ADD_SEQ_OUTPUT_LOAD]], [[TMP2]]
5653 ; CHECK2-NEXT: store i32 [[ADD1]], ptr [[LOADGEP_ADD1_SEQ_OUTPUT_ALLOC]], align 4
5654 ; CHECK2-NEXT: br label [[OMP_PAR_MERGED_SPLIT_SPLIT_SPLIT:%.*]]
5655 ; CHECK2: omp.par.merged.split.split.split:
5656 ; CHECK2-NEXT: br label [[OMP_REGION_BODY5_SPLIT:%.*]]
5657 ; CHECK2: omp_region.body5.split:
5658 ; CHECK2-NEXT: call void @__kmpc_end_master(ptr @[[GLOB2]], i32 [[OMP_GLOBAL_THREAD_NUM3]])
5659 ; CHECK2-NEXT: br label [[OMP_REGION_END4]]
5660 ; CHECK2: omp_region.body:
5661 ; CHECK2-NEXT: br label [[SEQ_PAR_MERGED:%.*]]
5662 ; CHECK2: seq.par.merged:
5663 ; CHECK2-NEXT: [[ADD:%.*]] = add nsw i32 [[TMP2]], 1
5664 ; CHECK2-NEXT: store i32 [[ADD]], ptr [[LOADGEP_ADD_SEQ_OUTPUT_ALLOC]], align 4
5665 ; CHECK2-NEXT: br label [[OMP_PAR_MERGED_SPLIT:%.*]]
5666 ; CHECK2: omp.par.merged.split:
5667 ; CHECK2-NEXT: br label [[OMP_REGION_BODY_SPLIT:%.*]]
5668 ; CHECK2: omp_region.body.split:
5669 ; CHECK2-NEXT: call void @__kmpc_end_master(ptr @[[GLOB2]], i32 [[OMP_GLOBAL_THREAD_NUM]])
5670 ; CHECK2-NEXT: br label [[OMP_REGION_END]]
5671 ; CHECK2: omp.par.outlined.exit.exitStub:
5672 ; CHECK2-NEXT: ret void
5675 ; CHECK2-LABEL: define {{[^@]+}}@.omp_outlined..25
5676 ; CHECK2-SAME: (ptr noalias nocapture nofree readnone [[DOTGLOBAL_TID_:%.*]], ptr noalias nocapture nofree readnone [[DOTBOUND_TID_:%.*]], ptr nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[A:%.*]]) {
5677 ; CHECK2-NEXT: entry:
5678 ; CHECK2-NEXT: [[TMP0:%.*]] = load i32, ptr [[A]], align 4
5679 ; CHECK2-NEXT: call void @use(i32 [[TMP0]])
5680 ; CHECK2-NEXT: ret void
5683 ; CHECK2-LABEL: define {{[^@]+}}@.omp_outlined..26
5684 ; CHECK2-SAME: (ptr noalias nocapture nofree readnone [[DOTGLOBAL_TID_:%.*]], ptr noalias nocapture nofree readnone [[DOTBOUND_TID_:%.*]], ptr nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[A:%.*]]) {
5685 ; CHECK2-NEXT: entry:
5686 ; CHECK2-NEXT: [[TMP0:%.*]] = load i32, ptr [[A]], align 4
5687 ; CHECK2-NEXT: call void @use(i32 [[TMP0]])
5688 ; CHECK2-NEXT: ret void
5691 ; CHECK2-LABEL: define {{[^@]+}}@.omp_outlined..27
5692 ; CHECK2-SAME: (ptr noalias nocapture nofree readnone [[DOTGLOBAL_TID_:%.*]], ptr noalias nocapture nofree readnone [[DOTBOUND_TID_:%.*]], ptr nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[A:%.*]]) {
5693 ; CHECK2-NEXT: entry:
5694 ; CHECK2-NEXT: [[TMP0:%.*]] = load i32, ptr [[A]], align 4
5695 ; CHECK2-NEXT: call void @use(i32 [[TMP0]])
5696 ; CHECK2-NEXT: ret void
5699 ; CHECK2-LABEL: define {{[^@]+}}@unmergable_3_seq_call
5700 ; CHECK2-SAME: (i32 [[A:%.*]]) local_unnamed_addr {
5701 ; CHECK2-NEXT: entry:
5702 ; CHECK2-NEXT: [[A_ADDR:%.*]] = alloca i32, align 4
5703 ; CHECK2-NEXT: store i32 [[A]], ptr [[A_ADDR]], align 4
5704 ; CHECK2-NEXT: call void (ptr, i32, ptr, ...) @__kmpc_fork_call(ptr noundef nonnull align 8 dereferenceable(24) @[[GLOB1]], i32 noundef 1, ptr noundef nonnull @.omp_outlined..28, ptr nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[A_ADDR]])
5705 ; CHECK2-NEXT: call void (...) @foo()
5706 ; CHECK2-NEXT: call void (ptr, i32, ptr, ...) @__kmpc_fork_call(ptr noundef nonnull align 8 dereferenceable(24) @[[GLOB1]], i32 noundef 1, ptr noundef nonnull @.omp_outlined..29, ptr nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[A_ADDR]])
5707 ; CHECK2-NEXT: call void (...) @foo()
5708 ; CHECK2-NEXT: call void (ptr, i32, ptr, ...) @__kmpc_fork_call(ptr noundef nonnull align 8 dereferenceable(24) @[[GLOB1]], i32 noundef 1, ptr noundef nonnull @.omp_outlined..30, ptr nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[A_ADDR]])
5709 ; CHECK2-NEXT: ret void
5712 ; CHECK2-LABEL: define {{[^@]+}}@.omp_outlined..28
5713 ; CHECK2-SAME: (ptr noalias nocapture nofree readnone [[DOTGLOBAL_TID_:%.*]], ptr noalias nocapture nofree readnone [[DOTBOUND_TID_:%.*]], ptr nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[A:%.*]]) {
5714 ; CHECK2-NEXT: entry:
5715 ; CHECK2-NEXT: [[TMP0:%.*]] = load i32, ptr [[A]], align 4
5716 ; CHECK2-NEXT: call void @use(i32 [[TMP0]])
5717 ; CHECK2-NEXT: ret void
5720 ; CHECK2-LABEL: define {{[^@]+}}@.omp_outlined..29
5721 ; CHECK2-SAME: (ptr noalias nocapture nofree readnone [[DOTGLOBAL_TID_:%.*]], ptr noalias nocapture nofree readnone [[DOTBOUND_TID_:%.*]], ptr nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[A:%.*]]) {
5722 ; CHECK2-NEXT: entry:
5723 ; CHECK2-NEXT: [[TMP0:%.*]] = load i32, ptr [[A]], align 4
5724 ; CHECK2-NEXT: call void @use(i32 [[TMP0]])
5725 ; CHECK2-NEXT: ret void
5728 ; CHECK2-LABEL: define {{[^@]+}}@.omp_outlined..30
5729 ; CHECK2-SAME: (ptr noalias nocapture nofree readnone [[DOTGLOBAL_TID_:%.*]], ptr noalias nocapture nofree readnone [[DOTBOUND_TID_:%.*]], ptr nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[A:%.*]]) {
5730 ; CHECK2-NEXT: entry:
5731 ; CHECK2-NEXT: [[TMP0:%.*]] = load i32, ptr [[A]], align 4
5732 ; CHECK2-NEXT: call void @use(i32 [[TMP0]])
5733 ; CHECK2-NEXT: ret void
5736 ; CHECK2-LABEL: define {{[^@]+}}@unmergable_3_proc_bind
5737 ; CHECK2-SAME: (i32 [[A:%.*]]) local_unnamed_addr {
5738 ; CHECK2-NEXT: entry:
5739 ; CHECK2-NEXT: [[A_ADDR:%.*]] = alloca i32, align 4
5740 ; CHECK2-NEXT: [[TMP0:%.*]] = call i32 @__kmpc_global_thread_num(ptr noundef nonnull align 8 dereferenceable(24) @[[GLOB1]])
5741 ; CHECK2-NEXT: store i32 [[A]], ptr [[A_ADDR]], align 4
5742 ; CHECK2-NEXT: call void (ptr, i32, ptr, ...) @__kmpc_fork_call(ptr noundef nonnull align 8 dereferenceable(24) @[[GLOB1]], i32 noundef 1, ptr noundef nonnull @.omp_outlined..31, ptr nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[A_ADDR]])
5743 ; CHECK2-NEXT: call void @__kmpc_push_proc_bind(ptr noundef nonnull align 8 dereferenceable(24) @[[GLOB1]], i32 [[TMP0]], i32 noundef 3)
5744 ; CHECK2-NEXT: call void (ptr, i32, ptr, ...) @__kmpc_fork_call(ptr noundef nonnull align 8 dereferenceable(24) @[[GLOB1]], i32 noundef 1, ptr noundef nonnull @.omp_outlined..32, ptr nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[A_ADDR]])
5745 ; CHECK2-NEXT: call void (ptr, i32, ptr, ...) @__kmpc_fork_call(ptr noundef nonnull align 8 dereferenceable(24) @[[GLOB1]], i32 noundef 1, ptr noundef nonnull @.omp_outlined..33, ptr nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[A_ADDR]])
5746 ; CHECK2-NEXT: ret void
5749 ; CHECK2-LABEL: define {{[^@]+}}@.omp_outlined..31
5750 ; CHECK2-SAME: (ptr noalias nocapture nofree readnone [[DOTGLOBAL_TID_:%.*]], ptr noalias nocapture nofree readnone [[DOTBOUND_TID_:%.*]], ptr nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[A:%.*]]) {
5751 ; CHECK2-NEXT: entry:
5752 ; CHECK2-NEXT: [[TMP0:%.*]] = load i32, ptr [[A]], align 4
5753 ; CHECK2-NEXT: call void @use(i32 [[TMP0]])
5754 ; CHECK2-NEXT: ret void
5757 ; CHECK2-LABEL: define {{[^@]+}}@.omp_outlined..32
5758 ; CHECK2-SAME: (ptr noalias nocapture nofree readnone [[DOTGLOBAL_TID_:%.*]], ptr noalias nocapture nofree readnone [[DOTBOUND_TID_:%.*]], ptr nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[A:%.*]]) {
5759 ; CHECK2-NEXT: entry:
5760 ; CHECK2-NEXT: [[TMP0:%.*]] = load i32, ptr [[A]], align 4
5761 ; CHECK2-NEXT: call void @use(i32 [[TMP0]])
5762 ; CHECK2-NEXT: ret void
5765 ; CHECK2-LABEL: define {{[^@]+}}@.omp_outlined..33
5766 ; CHECK2-SAME: (ptr noalias nocapture nofree readnone [[DOTGLOBAL_TID_:%.*]], ptr noalias nocapture nofree readnone [[DOTBOUND_TID_:%.*]], ptr nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[A:%.*]]) {
5767 ; CHECK2-NEXT: entry:
5768 ; CHECK2-NEXT: [[TMP0:%.*]] = load i32, ptr [[A]], align 4
5769 ; CHECK2-NEXT: call void @use(i32 [[TMP0]])
5770 ; CHECK2-NEXT: ret void
5773 ; CHECK2-LABEL: define {{[^@]+}}@unmergable_3_num_threads
5774 ; CHECK2-SAME: (i32 [[A:%.*]]) local_unnamed_addr {
5775 ; CHECK2-NEXT: entry:
5776 ; CHECK2-NEXT: [[A_ADDR:%.*]] = alloca i32, align 4
5777 ; CHECK2-NEXT: [[TMP0:%.*]] = call i32 @__kmpc_global_thread_num(ptr noundef nonnull align 8 dereferenceable(24) @[[GLOB1]])
5778 ; CHECK2-NEXT: store i32 [[A]], ptr [[A_ADDR]], align 4
5779 ; CHECK2-NEXT: call void (ptr, i32, ptr, ...) @__kmpc_fork_call(ptr noundef nonnull align 8 dereferenceable(24) @[[GLOB1]], i32 noundef 1, ptr noundef nonnull @.omp_outlined..34, ptr nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[A_ADDR]])
5780 ; CHECK2-NEXT: call void @__kmpc_push_num_threads(ptr noundef nonnull align 8 dereferenceable(24) @[[GLOB1]], i32 [[TMP0]], i32 [[A]])
5781 ; CHECK2-NEXT: call void (ptr, i32, ptr, ...) @__kmpc_fork_call(ptr noundef nonnull align 8 dereferenceable(24) @[[GLOB1]], i32 noundef 1, ptr noundef nonnull @.omp_outlined..35, ptr nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[A_ADDR]])
5782 ; CHECK2-NEXT: call void (ptr, i32, ptr, ...) @__kmpc_fork_call(ptr noundef nonnull align 8 dereferenceable(24) @[[GLOB1]], i32 noundef 1, ptr noundef nonnull @.omp_outlined..36, ptr nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[A_ADDR]])
5783 ; CHECK2-NEXT: ret void
5786 ; CHECK2-LABEL: define {{[^@]+}}@.omp_outlined..34
5787 ; CHECK2-SAME: (ptr noalias nocapture nofree readnone [[DOTGLOBAL_TID_:%.*]], ptr noalias nocapture nofree readnone [[DOTBOUND_TID_:%.*]], ptr nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[A:%.*]]) {
5788 ; CHECK2-NEXT: entry:
5789 ; CHECK2-NEXT: [[TMP0:%.*]] = load i32, ptr [[A]], align 4
5790 ; CHECK2-NEXT: call void @use(i32 [[TMP0]])
5791 ; CHECK2-NEXT: ret void
5794 ; CHECK2-LABEL: define {{[^@]+}}@.omp_outlined..35
5795 ; CHECK2-SAME: (ptr noalias nocapture nofree readnone [[DOTGLOBAL_TID_:%.*]], ptr noalias nocapture nofree readnone [[DOTBOUND_TID_:%.*]], ptr nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[A:%.*]]) {
5796 ; CHECK2-NEXT: entry:
5797 ; CHECK2-NEXT: [[TMP0:%.*]] = load i32, ptr [[A]], align 4
5798 ; CHECK2-NEXT: call void @use(i32 [[TMP0]])
5799 ; CHECK2-NEXT: ret void
5802 ; CHECK2-LABEL: define {{[^@]+}}@.omp_outlined..36
5803 ; CHECK2-SAME: (ptr noalias nocapture nofree readnone [[DOTGLOBAL_TID_:%.*]], ptr noalias nocapture nofree readnone [[DOTBOUND_TID_:%.*]], ptr nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[A:%.*]]) {
5804 ; CHECK2-NEXT: entry:
5805 ; CHECK2-NEXT: [[TMP0:%.*]] = load i32, ptr [[A]], align 4
5806 ; CHECK2-NEXT: call void @use(i32 [[TMP0]])
5807 ; CHECK2-NEXT: ret void
5810 ; CHECK2-LABEL: define {{[^@]+}}@merge_2_unmergable_1
5811 ; CHECK2-SAME: (i32 [[A:%.*]]) local_unnamed_addr {
5812 ; CHECK2-NEXT: entry:
5813 ; CHECK2-NEXT: [[STRUCTARG:%.*]] = alloca { ptr }, align 8
5814 ; CHECK2-NEXT: [[A_ADDR:%.*]] = alloca i32, align 4
5815 ; CHECK2-NEXT: store i32 [[A]], ptr [[A_ADDR]], align 4
5816 ; CHECK2-NEXT: [[OMP_GLOBAL_THREAD_NUM:%.*]] = call i32 @__kmpc_global_thread_num(ptr @[[GLOB2]])
5817 ; CHECK2-NEXT: br label [[OMP_PARALLEL:%.*]]
5818 ; CHECK2: omp_parallel:
5819 ; CHECK2-NEXT: [[GEP_A_ADDR:%.*]] = getelementptr { ptr }, ptr [[STRUCTARG]], i32 0, i32 0
5820 ; CHECK2-NEXT: store ptr [[A_ADDR]], ptr [[GEP_A_ADDR]], align 8
5821 ; CHECK2-NEXT: call void (ptr, i32, ptr, ...) @__kmpc_fork_call(ptr @[[GLOB2]], i32 1, ptr @merge_2_unmergable_1..omp_par, ptr [[STRUCTARG]])
5822 ; CHECK2-NEXT: br label [[OMP_PAR_OUTLINED_EXIT:%.*]]
5823 ; CHECK2: omp.par.outlined.exit:
5824 ; CHECK2-NEXT: br label [[OMP_PAR_EXIT_SPLIT:%.*]]
5825 ; CHECK2: omp.par.exit.split:
5826 ; CHECK2-NEXT: br label [[ENTRY_SPLIT_SPLIT:%.*]]
5827 ; CHECK2: entry.split.split:
5828 ; CHECK2-NEXT: call void (...) @foo()
5829 ; CHECK2-NEXT: call void (ptr, i32, ptr, ...) @__kmpc_fork_call(ptr noundef nonnull align 8 dereferenceable(24) @[[GLOB1]], i32 noundef 1, ptr noundef nonnull @.omp_outlined..39, ptr nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[A_ADDR]])
5830 ; CHECK2-NEXT: ret void
5833 ; CHECK2-LABEL: define {{[^@]+}}@merge_2_unmergable_1..omp_par
5834 ; CHECK2-SAME: (ptr noalias [[TID_ADDR:%.*]], ptr noalias [[ZERO_ADDR:%.*]], ptr [[TMP0:%.*]]) #[[ATTR0]] {
5835 ; CHECK2-NEXT: omp.par.entry:
5836 ; CHECK2-NEXT: [[GEP_A_ADDR:%.*]] = getelementptr { ptr }, ptr [[TMP0]], i32 0, i32 0
5837 ; CHECK2-NEXT: [[LOADGEP_A_ADDR:%.*]] = load ptr, ptr [[GEP_A_ADDR]], align 8
5838 ; CHECK2-NEXT: [[TID_ADDR_LOCAL:%.*]] = alloca i32, align 4
5839 ; CHECK2-NEXT: [[TMP1:%.*]] = load i32, ptr [[TID_ADDR]], align 4
5840 ; CHECK2-NEXT: store i32 [[TMP1]], ptr [[TID_ADDR_LOCAL]], align 4
5841 ; CHECK2-NEXT: [[TID:%.*]] = load i32, ptr [[TID_ADDR_LOCAL]], align 4
5842 ; CHECK2-NEXT: br label [[OMP_PAR_REGION:%.*]]
5843 ; CHECK2: omp.par.region:
5844 ; CHECK2-NEXT: br label [[OMP_PAR_MERGED:%.*]]
5845 ; CHECK2: omp.par.merged:
5846 ; CHECK2-NEXT: call void (ptr, ptr, ...) @.omp_outlined..37(ptr [[TID_ADDR]], ptr [[ZERO_ADDR]], ptr nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[LOADGEP_A_ADDR]])
5847 ; CHECK2-NEXT: [[OMP_GLOBAL_THREAD_NUM:%.*]] = call i32 @__kmpc_global_thread_num(ptr @[[GLOB2]])
5848 ; CHECK2-NEXT: call void @__kmpc_barrier(ptr @[[GLOB3]], i32 [[OMP_GLOBAL_THREAD_NUM]])
5849 ; CHECK2-NEXT: call void (ptr, ptr, ...) @.omp_outlined..38(ptr [[TID_ADDR]], ptr [[ZERO_ADDR]], ptr nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[LOADGEP_A_ADDR]])
5850 ; CHECK2-NEXT: br label [[ENTRY_SPLIT:%.*]]
5851 ; CHECK2: entry.split:
5852 ; CHECK2-NEXT: br label [[OMP_PAR_REGION_SPLIT:%.*]]
5853 ; CHECK2: omp.par.region.split:
5854 ; CHECK2-NEXT: br label [[OMP_PAR_PRE_FINALIZE:%.*]]
5855 ; CHECK2: omp.par.pre_finalize:
5856 ; CHECK2-NEXT: br label [[OMP_PAR_OUTLINED_EXIT_EXITSTUB:%.*]]
5857 ; CHECK2: omp.par.outlined.exit.exitStub:
5858 ; CHECK2-NEXT: ret void
5861 ; CHECK2-LABEL: define {{[^@]+}}@.omp_outlined..37
5862 ; CHECK2-SAME: (ptr noalias nocapture nofree readnone [[DOTGLOBAL_TID_:%.*]], ptr noalias nocapture nofree readnone [[DOTBOUND_TID_:%.*]], ptr nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[A:%.*]]) {
5863 ; CHECK2-NEXT: entry:
5864 ; CHECK2-NEXT: [[TMP0:%.*]] = load i32, ptr [[A]], align 4
5865 ; CHECK2-NEXT: call void @use(i32 [[TMP0]])
5866 ; CHECK2-NEXT: ret void
5869 ; CHECK2-LABEL: define {{[^@]+}}@.omp_outlined..38
5870 ; CHECK2-SAME: (ptr noalias nocapture nofree readnone [[DOTGLOBAL_TID_:%.*]], ptr noalias nocapture nofree readnone [[DOTBOUND_TID_:%.*]], ptr nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[A:%.*]]) {
5871 ; CHECK2-NEXT: entry:
5872 ; CHECK2-NEXT: [[TMP0:%.*]] = load i32, ptr [[A]], align 4
5873 ; CHECK2-NEXT: call void @use(i32 [[TMP0]])
5874 ; CHECK2-NEXT: ret void
5877 ; CHECK2-LABEL: define {{[^@]+}}@.omp_outlined..39
5878 ; CHECK2-SAME: (ptr noalias nocapture nofree readnone [[DOTGLOBAL_TID_:%.*]], ptr noalias nocapture nofree readnone [[DOTBOUND_TID_:%.*]], ptr nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[A:%.*]]) {
5879 ; CHECK2-NEXT: entry:
5880 ; CHECK2-NEXT: [[TMP0:%.*]] = load i32, ptr [[A]], align 4
5881 ; CHECK2-NEXT: call void @use(i32 [[TMP0]])
5882 ; CHECK2-NEXT: ret void