[all-commits] [llvm/llvm-project] d82278: [libomptarget] Fix copy-to motion for PTR_AND_OBJ ...

George Rokos via All-commits all-commits at lists.llvm.org
Fri Oct 16 16:12:32 PDT 2020


  Branch: refs/heads/ptr_and_obj_motion
  Home:   https://github.com/llvm/llvm-project
  Commit: d82278f353bebf232d97f686c687510ad4f39528
      https://github.com/llvm/llvm-project/commit/d82278f353bebf232d97f686c687510ad4f39528
  Author: George Rokos <georgios.rokos at intel.com>
  Date:   2020-10-16 (Fri, 16 Oct 2020)

  Changed paths:
    M openmp/libomptarget/src/omptarget.cpp
    A openmp/libomptarget/test/mapping/ptr_and_obj_motion.c

  Log Message:
  -----------
  [libomptarget] Fix copy-to motion for PTR_AND_OBJ entries where PTR is a struct member.

This patch fixes a problem whereby the pointee object of a PTR_AND_OBJ entry with a `map(to)` motion clause can be overwritten on the device even if its reference counter is >=1.

Currently, we check the reference counter of the parent struct in order to determine whether the motion clause should be respected, but since the pointee object is not part of the struct, it's got its own reference counter which should be used to enqueue the copy or discard it.

The same behavior has already been implemented in targetDataEnd (omptarget.cpp:539-540), but we somehow missed doing the same in targetDataBegin.

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




More information about the All-commits mailing list