| 1 |
! Test scheduling of WHERE in lower-hlfir-ordered-assignments pass |
| 2 |
! when fusing is enabled or disabled. |
| 3 |
|
| 4 |
!RUN: bbc -hlfir -o - -pass-pipeline="builtin.module(lower-hlfir-ordered-assignments{fuse-assignments=false})" --debug-only=flang-ordered-assignment -flang-dbg-order-assignment-schedule-only %s 2>&1 | FileCheck %s --check-prefix NOFUSE |
| 5 |
|
| 6 |
!RUN: bbc -hlfir -o - -pass-pipeline="builtin.module(lower-hlfir-ordered-assignments{fuse-assignments=true})" --debug-only=flang-ordered-assignment -flang-dbg-order-assignment-schedule-only %s 2>&1 | FileCheck %s --check-prefix FUSE |
| 7 |
|
| 8 |
!REQUIRES: asserts |
| 9 |
|
| 10 |
subroutine fusable(x, y, mask) |
| 11 |
real :: x(:), y(:) |
| 12 |
logical :: mask(:) |
| 13 |
where (mask) |
| 14 |
x = 41. |
| 15 |
y = 42. |
| 16 |
end where |
| 17 |
end subroutine |
| 18 |
|
| 19 |
subroutine unfusable(x, y, mask) |
| 20 |
real :: x(:), y(:) |
| 21 |
logical :: mask(:) |
| 22 |
where (mask) |
| 23 |
x(1:10) = y |
| 24 |
y = x(10:1:-1) |
| 25 |
end where |
| 26 |
end subroutine |
| 27 |
|
| 28 |
!NOFUSE-LABEL: ------------ scheduling where in _QPfusable ------------ |
| 29 |
!NOFUSE-NEXT: run 1 evaluate: where/region_assign1 |
| 30 |
!NOFUSE-NEXT: run 2 evaluate: where/region_assign2 |
| 31 |
!NOFUSE-LABEL: ------------ scheduling where in _QPunfusable ------------ |
| 32 |
!NOFUSE-NEXT: run 1 evaluate: where/region_assign1 |
| 33 |
!NOFUSE-NEXT: run 2 evaluate: where/region_assign2 |
| 34 |
|
| 35 |
!FUSE-LABEL: ------------ scheduling where in _QPfusable ------------ |
| 36 |
!FUSE-NEXT: run 1 evaluate: where/region_assign1 |
| 37 |
!FUSE-NEXT: run 1 evaluate: where/region_assign2 |
| 38 |
!FUSE-LABEL: ------------ scheduling where in _QPunfusable ------------ |
| 39 |
!FUSE-NEXT: run 1 evaluate: where/region_assign1 |
| 40 |
!FUSE-NEXT: conflict: R/W: <block argument> of type '!fir.box<!fir.array<?xf32>>' at index: 1 W:<block argument> of type '!fir.box<!fir.array<?xf32>>' at index: 1 |
| 41 |
!FUSE-NEXT: run 2 evaluate: where/region_assign2 |