[all-commits] [llvm/llvm-project] 6780d5: [LIBOMPTARGET]Fix order of mapper data for targetD...

Alexey Bataev via All-commits all-commits at lists.llvm.org
Wed Aug 5 10:49:23 PDT 2020


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: 6780d5675b7cd75279d8fc13ee1a1cc272087613
      https://github.com/llvm/llvm-project/commit/6780d5675b7cd75279d8fc13ee1a1cc272087613
  Author: Alexey Bataev <a.bataev at hotmail.com>
  Date:   2020-08-05 (Wed, 05 Aug 2020)

  Changed paths:
    M openmp/libomptarget/src/omptarget.cpp

  Log Message:
  -----------
  [LIBOMPTARGET]Fix order of mapper data for targetDataEnd function.

targetDataMapper function fills arrays with the mapping data in the
direct order. When this function is called by targetDataBegin or
tgt_target_update functions, it works as expected. But targetDataEnd
function processes mapped data in reverse order. In this case, the base
pointer might be deleted before the associated data is deleted. Need to
reverse data, mapped by mapper, too, since it always adds data that must
be deleted at the end of the buffer.
Fixes the test declare_mapper_target_update.cpp.
Also, reduces the memry fragmentation by preallocation the memory
buffers.

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




More information about the All-commits mailing list