Break circular dependency between FIR dialect and utilities
[llvm-project.git] / flang / test / Lower / OpenACC / acc-parallel-loop.f90
blob1a04b84a689fa4bf0d61fcca9627967d6ba8b155
1 ! This test checks lowering of OpenACC parallel loop combined directive.
3 ! RUN: bbc -fopenacc -emit-fir %s -o - | FileCheck %s
5 subroutine acc_parallel_loop
6 integer :: i, j
8 integer :: async = 1
9 integer :: wait1 = 1
10 integer :: wait2 = 2
11 integer :: numGangs = 1
12 integer :: numWorkers = 10
13 integer :: vectorLength = 128
14 logical :: ifCondition = .TRUE.
15 integer, parameter :: n = 10
16 real, dimension(n) :: a, b, c
17 real, dimension(n, n) :: d, e
18 real, pointer :: f, g
20 integer :: gangNum = 8
21 integer :: gangStatic = 8
22 integer :: vectorNum = 128
23 integer, parameter :: tileSize = 2
25 !CHECK: [[A:%.*]] = fir.alloca !fir.array<10xf32> {{{.*}}uniq_name = "{{.*}}Ea"}
26 !CHECK: [[B:%.*]] = fir.alloca !fir.array<10xf32> {{{.*}}uniq_name = "{{.*}}Eb"}
27 !CHECK: [[C:%.*]] = fir.alloca !fir.array<10xf32> {{{.*}}uniq_name = "{{.*}}Ec"}
28 !CHECK: [[F:%.*]] = fir.alloca !fir.box<!fir.ptr<f32>> {bindc_name = "f", uniq_name = "{{.*}}Ef"}
29 !CHECK: [[G:%.*]] = fir.alloca !fir.box<!fir.ptr<f32>> {bindc_name = "g", uniq_name = "{{.*}}Eg"}
30 !CHECK: [[IFCONDITION:%.*]] = fir.address_of(@{{.*}}ifcondition) : !fir.ref<!fir.logical<4>>
32 !$acc parallel loop
33 DO i = 1, n
34 a(i) = b(i)
35 END DO
37 !CHECK: acc.parallel {
38 !CHECK: acc.loop {
39 !CHECK: fir.do_loop
40 !CHECK: acc.yield
41 !CHECK-NEXT: }{{$}}
42 !CHECK: acc.yield
43 !CHECK-NEXT: }{{$}}
45 !$acc parallel loop async
46 DO i = 1, n
47 a(i) = b(i)
48 END DO
49 !$acc end parallel loop
51 !CHECK: acc.parallel {
52 !CHECK: acc.loop {
53 !CHECK: fir.do_loop
54 !CHECK: acc.yield
55 !CHECK-NEXT: }{{$}}
56 !CHECK: acc.yield
57 !CHECK-NEXT: } attributes {asyncAttr}
59 !$acc parallel loop async(1)
60 DO i = 1, n
61 a(i) = b(i)
62 END DO
64 !CHECK: [[ASYNC1:%.*]] = arith.constant 1 : i32
65 !CHECK: acc.parallel async([[ASYNC1]]: i32) {
66 !CHECK: acc.loop {
67 !CHECK: fir.do_loop
68 !CHECK: acc.yield
69 !CHECK-NEXT: }{{$}}
70 !CHECK: acc.yield
71 !CHECK-NEXT: }{{$}}
73 !$acc parallel loop async(async)
74 DO i = 1, n
75 a(i) = b(i)
76 END DO
78 !CHECK: [[ASYNC2:%.*]] = fir.load %{{.*}} : !fir.ref<i32>
79 !CHECK: acc.parallel async([[ASYNC2]]: i32) {
80 !CHECK: acc.loop {
81 !CHECK: fir.do_loop
82 !CHECK: acc.yield
83 !CHECK-NEXT: }{{$}}
84 !CHECK: acc.yield
85 !CHECK-NEXT: }{{$}}
87 !$acc parallel loop wait
88 DO i = 1, n
89 a(i) = b(i)
90 END DO
92 !CHECK: acc.parallel {
93 !CHECK: acc.loop {
94 !CHECK: fir.do_loop
95 !CHECK: acc.yield
96 !CHECK-NEXT: }{{$}}
97 !CHECK: acc.yield
98 !CHECK-NEXT: } attributes {waitAttr}
100 !$acc parallel loop wait(1)
101 DO i = 1, n
102 a(i) = b(i)
103 END DO
105 !CHECK: [[WAIT1:%.*]] = arith.constant 1 : i32
106 !CHECK: acc.parallel wait([[WAIT1]]: i32) {
107 !CHECK: acc.loop {
108 !CHECK: fir.do_loop
109 !CHECK: acc.yield
110 !CHECK-NEXT: }{{$}}
111 !CHECK: acc.yield
112 !CHECK-NEXT: }{{$}}
114 !$acc parallel loop wait(1, 2)
115 DO i = 1, n
116 a(i) = b(i)
117 END DO
119 !CHECK: [[WAIT2:%.*]] = arith.constant 1 : i32
120 !CHECK: [[WAIT3:%.*]] = arith.constant 2 : i32
121 !CHECK: acc.parallel wait([[WAIT2]]: i32, [[WAIT3]]: i32) {
122 !CHECK: acc.loop {
123 !CHECK: fir.do_loop
124 !CHECK: acc.yield
125 !CHECK-NEXT: }{{$}}
126 !CHECK: acc.yield
127 !CHECK-NEXT: }{{$}}
129 !$acc parallel loop wait(wait1, wait2)
130 DO i = 1, n
131 a(i) = b(i)
132 END DO
134 !CHECK: [[WAIT4:%.*]] = fir.load %{{.*}} : !fir.ref<i32>
135 !CHECK: [[WAIT5:%.*]] = fir.load %{{.*}} : !fir.ref<i32>
136 !CHECK: acc.parallel wait([[WAIT4]]: i32, [[WAIT5]]: i32) {
137 !CHECK: acc.loop {
138 !CHECK: fir.do_loop
139 !CHECK: acc.yield
140 !CHECK-NEXT: }{{$}}
141 !CHECK: acc.yield
142 !CHECK-NEXT: }{{$}}
144 !$acc parallel loop num_gangs(1)
145 DO i = 1, n
146 a(i) = b(i)
147 END DO
149 !CHECK: [[NUMGANGS1:%.*]] = arith.constant 1 : i32
150 !CHECK: acc.parallel num_gangs([[NUMGANGS1]]: i32) {
151 !CHECK: acc.loop {
152 !CHECK: fir.do_loop
153 !CHECK: acc.yield
154 !CHECK-NEXT: }{{$}}
155 !CHECK: acc.yield
156 !CHECK-NEXT: }{{$}}
158 !$acc parallel loop num_gangs(numGangs)
159 DO i = 1, n
160 a(i) = b(i)
161 END DO
163 !CHECK: [[NUMGANGS2:%.*]] = fir.load %{{.*}} : !fir.ref<i32>
164 !CHECK: acc.parallel num_gangs([[NUMGANGS2]]: i32) {
165 !CHECK: acc.loop {
166 !CHECK: fir.do_loop
167 !CHECK: acc.yield
168 !CHECK-NEXT: }{{$}}
169 !CHECK: acc.yield
170 !CHECK-NEXT: }{{$}}
172 !$acc parallel loop num_workers(10)
173 DO i = 1, n
174 a(i) = b(i)
175 END DO
177 !CHECK: [[NUMWORKERS1:%.*]] = arith.constant 10 : i32
178 !CHECK: acc.parallel num_workers([[NUMWORKERS1]]: i32) {
179 !CHECK: acc.loop {
180 !CHECK: fir.do_loop
181 !CHECK: acc.yield
182 !CHECK-NEXT: }{{$}}
183 !CHECK: acc.yield
184 !CHECK-NEXT: }{{$}}
186 !$acc parallel loop num_workers(numWorkers)
187 DO i = 1, n
188 a(i) = b(i)
189 END DO
191 !CHECK: [[NUMWORKERS2:%.*]] = fir.load %{{.*}} : !fir.ref<i32>
192 !CHECK: acc.parallel num_workers([[NUMWORKERS2]]: i32) {
193 !CHECK: acc.loop {
194 !CHECK: fir.do_loop
195 !CHECK: acc.yield
196 !CHECK-NEXT: }{{$}}
197 !CHECK: acc.yield
198 !CHECK-NEXT: }{{$}}
200 !$acc parallel loop vector_length(128)
201 DO i = 1, n
202 a(i) = b(i)
203 END DO
205 !CHECK: [[VECTORLENGTH1:%.*]] = arith.constant 128 : i32
206 !CHECK: acc.parallel vector_length([[VECTORLENGTH1]]: i32) {
207 !CHECK: acc.loop {
208 !CHECK: fir.do_loop
209 !CHECK: acc.yield
210 !CHECK-NEXT: }{{$}}
211 !CHECK: acc.yield
212 !CHECK-NEXT: }{{$}}
214 !$acc parallel loop vector_length(vectorLength)
215 DO i = 1, n
216 a(i) = b(i)
217 END DO
219 !CHECK: [[VECTORLENGTH2:%.*]] = fir.load %{{.*}} : !fir.ref<i32>
220 !CHECK: acc.parallel vector_length([[VECTORLENGTH2]]: i32) {
221 !CHECK: acc.loop {
222 !CHECK: fir.do_loop
223 !CHECK: acc.yield
224 !CHECK-NEXT: }{{$}}
225 !CHECK: acc.yield
226 !CHECK-NEXT: }{{$}}
228 !$acc parallel loop if(.TRUE.)
229 DO i = 1, n
230 a(i) = b(i)
231 END DO
233 !CHECK: [[IF1:%.*]] = arith.constant true
234 !CHECK: acc.parallel if([[IF1]]) {
235 !CHECK: acc.loop {
236 !CHECK: fir.do_loop
237 !CHECK: acc.yield
238 !CHECK-NEXT: }{{$}}
239 !CHECK: acc.yield
240 !CHECK-NEXT: }{{$}}
242 !$acc parallel loop if(ifCondition)
243 DO i = 1, n
244 a(i) = b(i)
245 END DO
247 !CHECK: [[IFCOND:%.*]] = fir.load %{{.*}} : !fir.ref<!fir.logical<4>>
248 !CHECK: [[IF2:%.*]] = fir.convert [[IFCOND]] : (!fir.logical<4>) -> i1
249 !CHECK: acc.parallel if([[IF2]]) {
250 !CHECK: acc.loop {
251 !CHECK: fir.do_loop
252 !CHECK: acc.yield
253 !CHECK-NEXT: }{{$}}
254 !CHECK: acc.yield
255 !CHECK-NEXT: }{{$}}
257 !$acc parallel loop self(.TRUE.)
258 DO i = 1, n
259 a(i) = b(i)
260 END DO
262 !CHECK: [[SELF1:%.*]] = arith.constant true
263 !CHECK: acc.parallel self([[SELF1]]) {
264 !CHECK: acc.loop {
265 !CHECK: fir.do_loop
266 !CHECK: acc.yield
267 !CHECK-NEXT: }{{$}}
268 !CHECK: acc.yield
269 !CHECK-NEXT: }{{$}}
271 !$acc parallel loop self
272 DO i = 1, n
273 a(i) = b(i)
274 END DO
276 !CHECK: acc.parallel {
277 !CHECK: acc.loop {
278 !CHECK: fir.do_loop
279 !CHECK: acc.yield
280 !CHECK-NEXT: }{{$}}
281 !CHECK: acc.yield
282 !CHECK-NEXT: } attributes {selfAttr}
284 !$acc parallel loop self(ifCondition)
285 DO i = 1, n
286 a(i) = b(i)
287 END DO
289 !CHECK: [[SELF2:%.*]] = fir.convert [[IFCONDITION]] : (!fir.ref<!fir.logical<4>>) -> i1
290 !CHECK: acc.parallel self([[SELF2]]) {
291 !CHECK: acc.loop {
292 !CHECK: fir.do_loop
293 !CHECK: acc.yield
294 !CHECK-NEXT: }{{$}}
295 !CHECK: acc.yield
296 !CHECK-NEXT: }{{$}}
298 !$acc parallel loop copy(a, b)
299 DO i = 1, n
300 a(i) = b(i)
301 END DO
303 !CHECK: acc.parallel copy([[A]]: !fir.ref<!fir.array<10xf32>>, [[B]]: !fir.ref<!fir.array<10xf32>>) {
304 !CHECK: acc.loop {
305 !CHECK: fir.do_loop
306 !CHECK: acc.yield
307 !CHECK-NEXT: }{{$}}
308 !CHECK: acc.yield
309 !CHECK-NEXT: }{{$}}
311 !$acc parallel loop copy(a) copy(b)
312 DO i = 1, n
313 a(i) = b(i)
314 END DO
316 !CHECK: acc.parallel copy([[A]]: !fir.ref<!fir.array<10xf32>>, [[B]]: !fir.ref<!fir.array<10xf32>>) {
317 !CHECK: acc.loop {
318 !CHECK: fir.do_loop
319 !CHECK: acc.yield
320 !CHECK-NEXT: }{{$}}
321 !CHECK: acc.yield
322 !CHECK-NEXT: }{{$}}
324 !$acc parallel loop copyin(a) copyin(readonly: b)
325 DO i = 1, n
326 a(i) = b(i)
327 END DO
329 !CHECK: acc.parallel copyin([[A]]: !fir.ref<!fir.array<10xf32>>) copyin_readonly([[B]]: !fir.ref<!fir.array<10xf32>>) {
330 !CHECK: acc.loop {
331 !CHECK: fir.do_loop
332 !CHECK: acc.yield
333 !CHECK-NEXT: }{{$}}
334 !CHECK: acc.yield
335 !CHECK-NEXT: }{{$}}
337 !$acc parallel loop copyout(a) copyout(zero: b)
338 DO i = 1, n
339 a(i) = b(i)
340 END DO
342 !CHECK: acc.parallel copyout([[A]]: !fir.ref<!fir.array<10xf32>>) copyout_zero([[B]]: !fir.ref<!fir.array<10xf32>>) {
343 !CHECK: acc.loop {
344 !CHECK: fir.do_loop
345 !CHECK: acc.yield
346 !CHECK-NEXT: }{{$}}
347 !CHECK: acc.yield
348 !CHECK-NEXT: }{{$}}
350 !$acc parallel loop create(b) create(zero: a)
351 DO i = 1, n
352 a(i) = b(i)
353 END DO
355 !CHECK: acc.parallel create([[B]]: !fir.ref<!fir.array<10xf32>>) create_zero([[A]]: !fir.ref<!fir.array<10xf32>>) {
356 !CHECK: acc.loop {
357 !CHECK: fir.do_loop
358 !CHECK: acc.yield
359 !CHECK-NEXT: }{{$}}
360 !CHECK: acc.yield
361 !CHECK-NEXT: }{{$}}
363 !$acc parallel loop no_create(a, b)
364 DO i = 1, n
365 a(i) = b(i)
366 END DO
368 !CHECK: acc.parallel no_create([[A]]: !fir.ref<!fir.array<10xf32>>, [[B]]: !fir.ref<!fir.array<10xf32>>) {
369 !CHECK: acc.loop {
370 !CHECK: fir.do_loop
371 !CHECK: acc.yield
372 !CHECK-NEXT: }{{$}}
373 !CHECK: acc.yield
374 !CHECK-NEXT: }{{$}}
376 !$acc parallel loop present(a, b)
377 DO i = 1, n
378 a(i) = b(i)
379 END DO
381 !CHECK: acc.parallel present([[A]]: !fir.ref<!fir.array<10xf32>>, [[B]]: !fir.ref<!fir.array<10xf32>>) {
382 !CHECK: acc.loop {
383 !CHECK: fir.do_loop
384 !CHECK: acc.yield
385 !CHECK-NEXT: }{{$}}
386 !CHECK: acc.yield
387 !CHECK-NEXT: }{{$}}
389 !$acc parallel loop deviceptr(a) deviceptr(b)
390 DO i = 1, n
391 a(i) = b(i)
392 END DO
394 !CHECK: acc.parallel deviceptr([[A]]: !fir.ref<!fir.array<10xf32>>, [[B]]: !fir.ref<!fir.array<10xf32>>) {
395 !CHECK: acc.loop {
396 !CHECK: fir.do_loop
397 !CHECK: acc.yield
398 !CHECK-NEXT: }{{$}}
399 !CHECK: acc.yield
400 !CHECK-NEXT: }{{$}}
402 !$acc parallel loop attach(f, g)
403 DO i = 1, n
404 a(i) = b(i)
405 END DO
407 !CHECK: acc.parallel attach([[F]]: !fir.ref<!fir.box<!fir.ptr<f32>>>, [[G]]: !fir.ref<!fir.box<!fir.ptr<f32>>>) {
408 !CHECK: acc.loop {
409 !CHECK: fir.do_loop
410 !CHECK: acc.yield
411 !CHECK-NEXT: }{{$}}
412 !CHECK: acc.yield
413 !CHECK-NEXT: }{{$}}
415 !$acc parallel loop private(a) firstprivate(b)
416 DO i = 1, n
417 a(i) = b(i)
418 END DO
420 !CHECK: acc.parallel private([[A]]: !fir.ref<!fir.array<10xf32>>) firstprivate([[B]]: !fir.ref<!fir.array<10xf32>>) {
421 !CHECK: acc.loop private([[A]]: !fir.ref<!fir.array<10xf32>>) {
422 !CHECK: fir.do_loop
423 !CHECK: acc.yield
424 !CHECK-NEXT: }{{$}}
425 !CHECK: acc.yield
426 !CHECK-NEXT: }{{$}}
428 !$acc parallel loop seq
429 DO i = 1, n
430 a(i) = b(i)
431 END DO
433 !CHECK: acc.parallel {
434 !CHECK: acc.loop {
435 !CHECK: fir.do_loop
436 !CHECK: acc.yield
437 !CHECK-NEXT: } attributes {seq}
438 !CHECK: acc.yield
439 !CHECK-NEXT: }{{$}}
441 !$acc parallel loop auto
442 DO i = 1, n
443 a(i) = b(i)
444 END DO
446 !CHECK: acc.parallel {
447 !CHECK: acc.loop {
448 !CHECK: fir.do_loop
449 !CHECK: acc.yield
450 !CHECK-NEXT: } attributes {auto}
451 !CHECK: acc.yield
452 !CHECK-NEXT: }{{$}}
454 !$acc parallel loop independent
455 DO i = 1, n
456 a(i) = b(i)
457 END DO
459 !CHECK: acc.parallel {
460 !CHECK: acc.loop {
461 !CHECK: fir.do_loop
462 !CHECK: acc.yield
463 !CHECK-NEXT: } attributes {independent}
464 !CHECK: acc.yield
465 !CHECK-NEXT: }{{$}}
467 !$acc parallel loop gang
468 DO i = 1, n
469 a(i) = b(i)
470 END DO
472 !CHECK: acc.parallel {
473 !CHECK: acc.loop gang {
474 !CHECK: fir.do_loop
475 !CHECK: acc.yield
476 !CHECK-NEXT: }{{$}}
477 !CHECK: acc.yield
478 !CHECK-NEXT: }{{$}}
480 !$acc parallel loop gang(num: 8)
481 DO i = 1, n
482 a(i) = b(i)
483 END DO
485 !CHECK: acc.parallel {
486 !CHECK: [[GANGNUM1:%.*]] = arith.constant 8 : i32
487 !CHECK-NEXT: acc.loop gang(num=[[GANGNUM1]]: i32) {
488 !CHECK: fir.do_loop
489 !CHECK: acc.yield
490 !CHECK-NEXT: }{{$}}
491 !CHECK: acc.yield
492 !CHECK-NEXT: }{{$}}
494 !$acc parallel loop gang(num: gangNum)
495 DO i = 1, n
496 a(i) = b(i)
497 END DO
499 !CHECK: acc.parallel {
500 !CHECK: [[GANGNUM2:%.*]] = fir.load %{{.*}} : !fir.ref<i32>
501 !CHECK-NEXT: acc.loop gang(num=[[GANGNUM2]]: i32) {
502 !CHECK: fir.do_loop
503 !CHECK: acc.yield
504 !CHECK-NEXT: }{{$}}
505 !CHECK: acc.yield
506 !CHECK-NEXT: }{{$}}
508 !$acc parallel loop gang(num: gangNum, static: gangStatic)
509 DO i = 1, n
510 a(i) = b(i)
511 END DO
513 !CHECK: acc.parallel {
514 !CHECK: acc.loop gang(num=%{{.*}}: i32, static=%{{.*}}: i32) {
515 !CHECK: fir.do_loop
516 !CHECK: acc.yield
517 !CHECK-NEXT: }{{$}}
518 !CHECK: acc.yield
519 !CHECK-NEXT: }{{$}}
521 !$acc parallel loop vector
522 DO i = 1, n
523 a(i) = b(i)
524 END DO
525 !CHECK: acc.parallel {
526 !CHECK: acc.loop vector {
527 !CHECK: fir.do_loop
528 !CHECK: acc.yield
529 !CHECK-NEXT: }{{$}}
530 !CHECK: acc.yield
531 !CHECK-NEXT: }{{$}}
533 !$acc parallel loop vector(128)
534 DO i = 1, n
535 a(i) = b(i)
536 END DO
538 !CHECK: acc.parallel {
539 !CHECK: [[CONSTANT128:%.*]] = arith.constant 128 : i32
540 !CHECK: acc.loop vector([[CONSTANT128]]: i32) {
541 !CHECK: fir.do_loop
542 !CHECK: acc.yield
543 !CHECK-NEXT: }{{$}}
544 !CHECK: acc.yield
545 !CHECK-NEXT: }{{$}}
547 !$acc parallel loop vector(vectorLength)
548 DO i = 1, n
549 a(i) = b(i)
550 END DO
552 !CHECK: acc.parallel {
553 !CHECK: [[VECTORLENGTH:%.*]] = fir.load %{{.*}} : !fir.ref<i32>
554 !CHECK: acc.loop vector([[VECTORLENGTH]]: i32) {
555 !CHECK: fir.do_loop
556 !CHECK: acc.yield
557 !CHECK-NEXT: }{{$}}
558 !CHECK: acc.yield
559 !CHECK-NEXT: }{{$}}
561 !$acc parallel loop worker
562 DO i = 1, n
563 a(i) = b(i)
564 END DO
566 !CHECK: acc.parallel {
567 !CHECK: acc.loop worker {
568 !CHECK: fir.do_loop
569 !CHECK: acc.yield
570 !CHECK-NEXT: }{{$}}
571 !CHECK: acc.yield
572 !CHECK-NEXT: }{{$}}
574 !$acc parallel loop worker(128)
575 DO i = 1, n
576 a(i) = b(i)
577 END DO
579 !CHECK: acc.parallel {
580 !CHECK: [[WORKER128:%.*]] = arith.constant 128 : i32
581 !CHECK: acc.loop worker([[WORKER128]]: i32) {
582 !CHECK: fir.do_loop
583 !CHECK: acc.yield
584 !CHECK-NEXT: }{{$}}
585 !CHECK: acc.yield
586 !CHECK-NEXT: }{{$}}
588 !$acc parallel loop collapse(2)
589 DO i = 1, n
590 DO j = 1, n
591 d(i, j) = e(i, j)
592 END DO
593 END DO
595 !CHECK: acc.parallel {
596 !CHECK: acc.loop {
597 !CHECK: fir.do_loop
598 !CHECK: fir.do_loop
599 !CHECK: acc.yield
600 !CHECK-NEXT: } attributes {collapse = 2 : i64}
601 !CHECK: acc.yield
602 !CHECK-NEXT: }{{$}}
604 !$acc parallel loop
605 DO i = 1, n
606 !$acc loop
607 DO j = 1, n
608 d(i, j) = e(i, j)
609 END DO
610 END DO
612 !CHECK: acc.parallel {
613 !CHECK: acc.loop {
614 !CHECK: fir.do_loop
615 !CHECK: acc.loop {
616 !CHECK: fir.do_loop
617 !CHECK: acc.yield
618 !CHECK-NEXT: }{{$}}
619 !CHECK: acc.yield
620 !CHECK-NEXT: }{{$}}
621 !CHECK: acc.yield
622 !CHECK-NEXT: }{{$}}
624 !$acc parallel loop tile(2)
625 DO i = 1, n
626 a(i) = b(i)
627 END DO
629 !CHECK: acc.parallel {
630 !CHECK: [[TILESIZE:%.*]] = arith.constant 2 : i32
631 !CHECK: acc.loop tile([[TILESIZE]]: i32) {
632 !CHECK: fir.do_loop
633 !CHECK: acc.yield
634 !CHECK-NEXT: }{{$}}
635 !CHECK: acc.yield
636 !CHECK-NEXT: }{{$}}
638 !$acc parallel loop tile(*)
639 DO i = 1, n
640 a(i) = b(i)
641 END DO
643 !CHECK: acc.parallel {
644 !CHECK: [[TILESIZEM1:%.*]] = arith.constant -1 : i32
645 !CHECK: acc.loop tile([[TILESIZEM1]]: i32) {
646 !CHECK: fir.do_loop
647 !CHECK: acc.yield
648 !CHECK-NEXT: }{{$}}
649 !CHECK: acc.yield
650 !CHECK-NEXT: }{{$}}
652 !$acc parallel loop tile(2, 2)
653 DO i = 1, n
654 DO j = 1, n
655 d(i, j) = e(i, j)
656 END DO
657 END DO
659 !CHECK: acc.parallel {
660 !CHECK: [[TILESIZE1:%.*]] = arith.constant 2 : i32
661 !CHECK: [[TILESIZE2:%.*]] = arith.constant 2 : i32
662 !CHECK: acc.loop tile([[TILESIZE1]]: i32, [[TILESIZE2]]: i32) {
663 !CHECK: fir.do_loop
664 !CHECK: acc.yield
665 !CHECK-NEXT: }{{$}}
666 !CHECK: acc.yield
667 !CHECK-NEXT: }{{$}}
669 !$acc parallel loop tile(tileSize)
670 DO i = 1, n
671 a(i) = b(i)
672 END DO
674 !CHECK: acc.parallel {
675 !CHECK: acc.loop tile(%{{.*}}: i32) {
676 !CHECK: fir.do_loop
677 !CHECK: acc.yield
678 !CHECK-NEXT: }{{$}}
679 !CHECK: acc.yield
680 !CHECK-NEXT: }{{$}}
682 !$acc parallel loop tile(tileSize, tileSize)
683 DO i = 1, n
684 DO j = 1, n
685 d(i, j) = e(i, j)
686 END DO
687 END DO
689 !CHECK: acc.parallel {
690 !CHECK: acc.loop tile(%{{.*}}: i32, %{{.*}}: i32) {
691 !CHECK: fir.do_loop
692 !CHECK: acc.yield
693 !CHECK-NEXT: }{{$}}
694 !CHECK: acc.yield
695 !CHECK-NEXT: }{{$}}
697 end subroutine acc_parallel_loop