[all-commits] [llvm/llvm-project] 769166: [MLIR][OpenMP] Initial Lowering of Declare Target ...

agozillon via All-commits all-commits at lists.llvm.org
Wed Sep 20 11:32:11 PDT 2023

  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 76916669b96f6411ecc276ffdf77d305093178dc
  Author: Andrew Gozillon <Andrew.Gozillon at amd.com>
  Date:   2023-09-20 (Wed, 20 Sep 2023)

  Changed paths:
    M flang/lib/Optimizer/Transforms/OMPEarlyOutlining.cpp
    M mlir/lib/Target/LLVMIR/Dialect/OpenMP/OpenMPToLLVMIRTranslation.cpp
    A mlir/test/Target/LLVMIR/omptarget-declare-target-llvm-device.mlir
    A mlir/test/Target/LLVMIR/omptarget-declare-target-llvm-host.mlir
    A openmp/libomptarget/test/offloading/fortran/declare-target-array-in-target-region.f90

  Log Message:
  [MLIR][OpenMP] Initial Lowering of Declare Target for Data

This patch adds initial lowering for DeclareTargetAttr on
GlobalOp's utilising registerTargetGlobalVariable
and getAddrOfDeclareTargetVar from the

It also adds initial processing of declare target map
operands, populating the combinedInfo that the
OMPIRBuilder requires to generate kernels and
it's kernel argument structure.

The combination of these additions allows simple mapping
of declare target globals to Target regions, as such a simple
runtime test showcasing this and testing it has been added.

The patch currently does not factor in filtering
based on device_type clauses (e.g. no emission of
globals for device if host specified), this will come in
a future iteration. And for the moment it's only been
tested with 1-D arrays and basic fortran data types,
more complex types (such as user defined derived
types from Fortran, allocatables or Fortran pointers)
may need further work.

reviewers: kiranchandramohan, skatrak

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

More information about the All-commits mailing list