[PATCH] D79972: [OpenMP5.0] map item can be non-contiguous for target update

Alexey Bataev via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Jun 25 13:05:26 PDT 2020


ABataev added inline comments.


================
Comment at: clang/lib/CodeGen/CGOpenMPRuntime.cpp:8781
                      MappableExprsHandler::MapFlagsArrayTy &MapTypes,
-                     CGOpenMPRuntime::TargetDataInfo &Info) {
+                     MappableExprsHandler::MapDimArrayTy &Dims,
+                     CGOpenMPRuntime::TargetDataInfo &Info,
----------------
Do you really need to pass `Dims` here if you have `Dims` data member in `Info` parameter? Why you can't use `Info.Dims` instead?


================
Comment at: clang/lib/CodeGen/CGOpenMPRuntime.cpp:8901-8929
+  // Build an array of struct descriptor_dim and then assign it to
+  // offload_args.
+  //
+  // struct descriptor_dim {
+  //  int64_t offset;
+  //  int64_t count;
+  //  int64_t stride
----------------
Maybe worth it to outline it into a separate function to reduce code size and the complexity of this function? And just call this new function here.


================
Comment at: clang/lib/Sema/SemaOpenMP.cpp:16624
+      if (IsPointer && !AllowAnotherPtr)
+        SemaRef.Diag(ELoc, diag::err_omp_section_length_undefined) << true;
+      else
----------------
Better to use integer value as selectors, not boolean.


================
Comment at: clang/lib/Sema/SemaOpenMP.cpp:18519-18522
+    MVLI.VarComponents.back().emplace_back(
+        OMPClauseMappableExprCommon::MappableComponent(
+            SimpleRefExpr, D,
+            /*IsNonContiguous=*/false));
----------------
`.emplace_back(SimpleRefExpr, D, /*IsNonContiguous=*/false);`


================
Comment at: clang/lib/Sema/SemaOpenMP.cpp:18588
     // against other clauses later on.
-    OMPClauseMappableExprCommon::MappableComponent MC(SimpleRefExpr, D);
+    OMPClauseMappableExprCommon::MappableComponent MC(SimpleRefExpr, D, false);
     DSAStack->addMappableExpressionComponents(
----------------
Add a comment for `false` argument with the name of parameter.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D79972/new/

https://reviews.llvm.org/D79972





More information about the cfe-commits mailing list