[PATCH] D69204: [OpenMP 5.0] - Extend defaultmap

Chi Chun Chen via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Nov 14 10:34:10 PST 2019


cchen marked 2 inline comments as done.
cchen added inline comments.


================
Comment at: clang/lib/Sema/SemaOpenMP.cpp:2953-2954
+            (!(isOpenMPTargetExecutionDirective(DKind) && Res &&
+               (*Res == OMPDeclareTargetDeclAttr::MT_Link ||
+                *Res == OMPDeclareTargetDeclAttr::MT_To)))) {
+          // Only check for data-mapping attribute and is_device_ptr here
----------------
ABataev wrote:
> ABataev wrote:
> > Why comparing the value of `*Res` here if just comparing against all possible values? This condition is always `true` if `Res` is true. I don't think we need to map variables with `to` mapping.
> Do we need to map `declare target to` vars at all?
I don't understand this since spec says that 
```
each variable referenced in the construct that does not have a predetermined data-sharing attribute and does not appear in a to or link clause on a declare target directive must be listed in a data-mapping attribute clause, a data-sharing attribute clause (including a data-sharing attribute clause on a combined construct where target is one of the constituent constructs), or an is_device_ptr clause.
```
So, I think I should check both to and link.
Or are you saying that to clause is impossible to happen here since we have a "Skip internally declared static variables" check so that if there is a to clause, it will return before hitting Line 2952. Therefore, we should only check for link clause?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D69204





More information about the cfe-commits mailing list