[all-commits] [llvm/llvm-project] 212d61: [mlir][llvm][OpenMP] Support iterator modifier in ...

Chi-Chun, Chen via All-commits all-commits at lists.llvm.org
Mon Apr 13 08:40:28 PDT 2026


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 212d612bae9542cc404491336ef79d7ea27f470f
      https://github.com/llvm/llvm-project/commit/212d612bae9542cc404491336ef79d7ea27f470f
  Author: Chi-Chun, Chen <chichun.chen at hpe.com>
  Date:   2026-04-13 (Mon, 13 Apr 2026)

  Changed paths:
    M llvm/include/llvm/Frontend/OpenMP/OMPIRBuilder.h
    M llvm/lib/Frontend/OpenMP/OMPIRBuilder.cpp
    M llvm/unittests/Frontend/OpenMPIRBuilderTest.cpp
    M mlir/lib/Target/LLVMIR/Dialect/OpenMP/OpenMPToLLVMIRTranslation.cpp
    M mlir/test/Target/LLVMIR/openmp-iterator.mlir
    M mlir/test/Target/LLVMIR/openmp-todo.mlir

  Log Message:
  -----------
  [mlir][llvm][OpenMP] Support iterator modifier in depend clause (#190026)

Add translation from the MLIR OpenMP depend clause with iterator
modifier to LLVM IR. `buildDependData` (in OpenMPToLLVMIRTranslation)
allocates a single `kmp_depend_info` array sized to hold both locator
(non-iterated) and iterated entries. Locator dependencies use the
existing static path (a vector of `DependData`), while iterated
dependencies use a dynamically-sized path (`DepArray`, `NumDeps`).

The reason both paths are not unified under the dynamic allocation is
that the existing locator path emits actual `kmp_depend_info` entries
inside OMPIRBuilder methods (`createTask`, `createTarget`), whereas the
iterator path must emit the iterator loop in OpenMPToLLVMIRTranslation
(since the convention is to not pass MLIR ops into the OMPIRBuilder).
Unifying them would require modifying existing depend clause tests.

The `OMPIRBuilder::DependenciesInfo` struct is extended to hold either a
`SmallVector<DependData>` (locator path) or a pre-built `{DepArray,
NumDeps}` pair (iterator path). The single-entry `emitTaskDependency`
helper is made public so the translation layer can fill individual
`kmp_depend_info` entries inside the iterator loop body.

This patch is part of the feature work for #188061.

Assisted with copilot.



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