[all-commits] [llvm/llvm-project] d2d4c3: [MLIR][OpenMP] LLVM IR translation of host_eval (#...

Sergio Afonso via All-commits all-commits at lists.llvm.org
Tue Jan 14 05:08:01 PST 2025


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: d2d4c3bd598453a1d871096466953ec25483034f
      https://github.com/llvm/llvm-project/commit/d2d4c3bd598453a1d871096466953ec25483034f
  Author: Sergio Afonso <safonsof at amd.com>
  Date:   2025-01-14 (Tue, 14 Jan 2025)

  Changed paths:
    M flang/test/Integration/OpenMP/target-filtering.f90
    M flang/test/Lower/OpenMP/function-filtering-2.f90
    M flang/test/Lower/OpenMP/function-filtering-3.f90
    M flang/test/Lower/OpenMP/function-filtering.f90
    M mlir/lib/Target/LLVMIR/Dialect/OpenMP/OpenMPToLLVMIRTranslation.cpp
    M mlir/test/Target/LLVMIR/omptarget-byref-bycopy-generation-device.mlir
    M mlir/test/Target/LLVMIR/omptarget-constant-alloca-raise.mlir
    M mlir/test/Target/LLVMIR/omptarget-constant-indexing-device-region.mlir
    M mlir/test/Target/LLVMIR/omptarget-debug.mlir
    M mlir/test/Target/LLVMIR/omptarget-declare-target-llvm-device.mlir
    M mlir/test/Target/LLVMIR/omptarget-parallel-llvm.mlir
    M mlir/test/Target/LLVMIR/omptarget-region-device-llvm.mlir
    M mlir/test/Target/LLVMIR/omptarget-target-inside-task.mlir
    M mlir/test/Target/LLVMIR/omptarget-threadprivate-device-lowering.mlir
    A mlir/test/Target/LLVMIR/openmp-target-launch-device.mlir
    A mlir/test/Target/LLVMIR/openmp-target-launch-host.mlir
    M mlir/test/Target/LLVMIR/openmp-target-use-device-nested.mlir
    M mlir/test/Target/LLVMIR/openmp-task-target-device.mlir
    M mlir/test/Target/LLVMIR/openmp-todo.mlir

  Log Message:
  -----------
  [MLIR][OpenMP] LLVM IR translation of host_eval (#116052)

This patch adds support for processing the `host_eval` clause of
`omp.target` to populate default and runtime kernel launch attributes.
Specifically, these related to the `num_teams`, `thread_limit` and
`num_threads` clauses attached to operations nested inside of
`omp.target`. As a result, the `thread_limit` clause of `omp.target` is
also supported.

The implementation of `initTargetDefaultAttrs()` is intended to reflect
clang's own processing of multiple constructs and clauses in order to
define a default number of teams and threads to be used as kernel
attributes and to populate global variables in the target device module.

One side effect of this change is that it is no longer possible to
translate to LLVM IR target device MLIR modules unless they have a
supported target triple. This is because the local `getGridValue()`
function in the `OpenMPIRBuilder` only works for certain architectures,
and it is called whenever the maximum number of threads has not been
explicitly defined. This limitation also matches clang.

Evaluating the collapsed loop trip count of SPMD and Generic-SPMD
kernels remains unsupported.



To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list