[all-commits] [llvm/llvm-project] c274b1: Add implicit map for a list item appears in a redu...

jyu2-git via All-commits all-commits at lists.llvm.org
Thu Aug 19 13:04:04 PDT 2021


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: c274b198668040acc239b349ef1f7820c91a95c8
      https://github.com/llvm/llvm-project/commit/c274b198668040acc239b349ef1f7820c91a95c8
  Author: Jennifer Yu <jennifer.yu at intel.com>
  Date:   2021-08-19 (Thu, 19 Aug 2021)

  Changed paths:
    M clang/include/clang/Sema/Sema.h
    M clang/lib/Sema/SemaOpenMP.cpp
    M clang/lib/Sema/TreeTransform.h
    A clang/test/OpenMP/reduction_implicit_map.cpp
    A openmp/libomptarget/test/mapping/reduction_implicit_map.cpp

  Log Message:
  -----------
  Add implicit map for a list item appears in a reduction clause.

A new rule is added in 5.0:
If a list item appears in a reduction, lastprivate or linear clause
on a combined target construct then it is treated as if it also appears
in a map clause with a map-type of tofrom.

Currently map clauses for all capture variables are added implicitly.
But missing for list item of expression for array elements or array
sections.

The change is to add implicit map clause for array of elements used in
reduction clause. Skip adding map clause if the expression is not
mappable.
Noted: For linear and lastprivate, since only variable name is
accepted, the map has been added though capture variables.

To do so:
During the mappable checking, if error, ignore diagnose and skip
adding implicit map clause.

The changes:
1> Add code to generate implicit map in ActOnOpenMPExecutableDirective,
   for omp 5.0 and up.
2> Add extra default parameter NoDiagnose in ActOnOpenMPMapClause:
Use that to skip error as well as skip adding implicit map during the
mappable checking.

Note: there are only tow places need to be check for NoDiagnose. Rest
of them either the check is for < omp 5.0 or the error already generated for
reduction clause.

Differential Revision: https://reviews.llvm.org/D108132




More information about the All-commits mailing list