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

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


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: 5adb3a6d86eecade2cb94b1a04d35e673d4e5866
      https://github.com/llvm/llvm-project/commit/5adb3a6d86eecade2cb94b1a04d35e673d4e5866
  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