mirror of
https://github.com/llvm/llvm-project.git
synced 2025-04-15 22:46:32 +00:00

This patch defines `fir::SafeTempArrayCopyAttrInterface` and the corresponding OpenACC/OpenMP related attributes in FIR dialect. The actual implementations are just placeholders right now, and array repacking becomes a no-op if `-fopenacc/-fopenmp` is used for the compilation.
18 lines
1.1 KiB
Fortran
18 lines
1.1 KiB
Fortran
! Test that fir.acc_safe_temp_array_copy and fir.omp_safe_temp_array_copy
|
|
! are properly attached to fir.[un]pack_array by the lowering.
|
|
|
|
! RUN: bbc -emit-hlfir -fopenacc -frepack-arrays %s -o - | FileCheck --check-prefixes=ALL,ACC %s
|
|
! RUN: bbc -emit-hlfir -fopenmp -frepack-arrays %s -o - | FileCheck --check-prefixes=ALL,OMP %s
|
|
! RUN: bbc -emit-hlfir -fopenacc -fopenmp -frepack-arrays %s -o - | FileCheck --check-prefixes=ALL,ACCOMP %s
|
|
|
|
subroutine test(x)
|
|
real :: x(:)
|
|
end subroutine test
|
|
! ALL-LABEL: func.func @_QPtest(
|
|
! ACC: %[[VAL_2:.*]] = fir.pack_array{{.*}}is_safe [#fir.acc_safe_temp_array_copy]
|
|
! ACC: fir.unpack_array{{.*}}is_safe [#fir.acc_safe_temp_array_copy]
|
|
! OMP: %[[VAL_2:.*]] = fir.pack_array{{.*}}is_safe [#fir.omp_safe_temp_array_copy]
|
|
! OMP: fir.unpack_array{{.*}}is_safe [#fir.omp_safe_temp_array_copy]
|
|
! ACCOMP: %[[VAL_2:.*]] = fir.pack_array{{.*}}is_safe [#fir.acc_safe_temp_array_copy, #fir.omp_safe_temp_array_copy]
|
|
! ACCOMP: fir.unpack_array{{.*}}is_safe [#fir.acc_safe_temp_array_copy, #fir.omp_safe_temp_array_copy]
|