[PATCH] D66247: [OpenMP] Fix target map for unused variables

Alexey Bataev via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Aug 14 14:26:31 PDT 2019


ABataev added a comment.

In D66247#1630287 <https://reviews.llvm.org/D66247#1630287>, @jdenny wrote:

> In D66247#1630262 <https://reviews.llvm.org/D66247#1630262>, @ABataev wrote:
>
> > In D66247#1630245 <https://reviews.llvm.org/D66247#1630245>, @jdenny wrote:
> >
> > > In D66247#1630196 <https://reviews.llvm.org/D66247#1630196>, @ABataev wrote:
> > >
> > > > Do we really need to map such variables? According to standard, "The map clause specifies how an original list item is mapped from the current task’s data environment to a corresponding list item in the device data environment of the device identified by the construct.", i.e. it does not map the variable, but "specifies" how to map it.
> > >
> > >
> > > What you're asking for now contradicts what you asked for at https://reviews.llvm.org/D65835#1624659 when I asked about the same example of `target map(a)` enclosing `teams private(a)`.
> >
> >
> > Seems to me I did not expressed my idea absolutely correctly. I meant that if the variable is really mapped, then the maptype must be generated in all cases. If we do not need to map the variable,  just like in these case, there definitely should not be maptype.
>
>
> Then I still need an example where D65835 <https://reviews.llvm.org/D65835> doesn't behave correctly.


Try `map(a) firstprivate(a) defaultmap(scalar:tofrom)`, where `a` is `int`, for example. The variable must be mapped as `tofrom` in this case but, most probably, will be mapped as `to`.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D66247





More information about the cfe-commits mailing list