[all-commits] [llvm/llvm-project] ae5348: [openmp][amdgpu] Make plugin robust to presence of...

Jon Chesterfield via All-commits all-commits at lists.llvm.org
Mon Nov 22 15:00:58 PST 2021


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: ae5348a38eb1668cd9042d9a5207dc32bc4edb87
      https://github.com/llvm/llvm-project/commit/ae5348a38eb1668cd9042d9a5207dc32bc4edb87
  Author: Jon Chesterfield <jonathanchesterfield at gmail.com>
  Date:   2021-11-22 (Mon, 22 Nov 2021)

  Changed paths:
    M openmp/libomptarget/plugins/amdgpu/impl/internal.h
    M openmp/libomptarget/plugins/amdgpu/impl/system.cpp
    M openmp/libomptarget/plugins/amdgpu/src/rtl.cpp

  Log Message:
  -----------
  [openmp][amdgpu] Make plugin robust to presence of explicit implicit arguments

OpenMP (compiler) does not currently request any implicit kernel
arguments. OpenMP (runtime) allocates and initialises a reasonable guess at
the implicit kernel arguments anyway.

This change makes the plugin check the number of explicit arguments, instead
of all arguments, and puts the pointer to hostcall buffer in both the current
location and at the offset expected when implicit arguments are added to the
metadata by D113538.

This is intended to keep things running while fixing the oversight in the
compiler (in D113538). Once that patch lands, and a following one marks
openmp kernels that use printf such that the backend emits an args element
with the right type (instead of hidden_node), the over-allocation can be
removed and the hardcoded 8*e+3 offset replaced with one read from the
.offset of the corresponding metadata element.

Reviewed By: estewart08

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




More information about the All-commits mailing list