[flang-commits] [flang] [OpenMP][Flang] Add "IsolatedFromAbove" trait to omp.target (PR #67164)

Akash Banerjee via flang-commits flang-commits at lists.llvm.org
Mon Oct 23 10:59:28 PDT 2023


================
@@ -0,0 +1,57 @@
+!RUN: %flang_fc1 -emit-llvm -fopenmp %s -o - | FileCheck %s
+
+!===============================================================================
+! Check MapTypes for target implicit captures
+!===============================================================================
+
+!CHECK: @.offload_sizes = private unnamed_addr constant [1 x i64] [i64 4]
+!CHECK: @.offload_maptypes = private unnamed_addr constant [1 x i64] [i64 800]
+!CHECK-LABEL: define void @maptype_scalar_
+subroutine mapType_scalar
+  integer :: a
+  !$omp target
+     a = 10
+  !$omp end target
+end subroutine mapType_scalar
+
+!CHECK: @.offload_sizes = private unnamed_addr constant [1 x i64] [i64 4096]
+!CHECK: @.offload_maptypes = private unnamed_addr constant [1 x i64] [i64 547]
+!CHECK-LABEL: define void @maptype_array_
+subroutine mapType_array
+  integer :: a(1024)
+  !$omp target
+     a(10) = 20
+  !$omp end target
+end subroutine mapType_array
+
+!CHECK: @.offload_sizes = private unnamed_addr constant [1 x i64] [i64 0]
+!CHECK: @.offload_maptypes = private unnamed_addr constant [1 x i64] [i64 547]
----------------
TIFitis wrote:

I am not sure what is the correct map_type here for Fortran pointers, i.e, should it have the `tofrom` flags set?

Clang doesn't set the `tofrom` flags for pointers, so I didn't set them for c_ptrs in Fortran. But not sure about Fortran pointers.

https://github.com/llvm/llvm-project/pull/67164


More information about the flang-commits mailing list