[all-commits] [llvm/llvm-project] d6281a: [MLIR][OpenMP][OMPIRBuilder] Improve shared memory...

Sergio Afonso via All-commits all-commits at lists.llvm.org
Wed Apr 15 05:34:43 PDT 2026


  Branch: refs/heads/users/skatrak/flang-generic-11-shared-mem-checks
  Home:   https://github.com/llvm/llvm-project
  Commit: d6281a9802f8ff0a771893b6333f5f7a4eaa4e39
      https://github.com/llvm/llvm-project/commit/d6281a9802f8ff0a771893b6333f5f7a4eaa4e39
  Author: Sergio Afonso <safonsof at amd.com>
  Date:   2026-04-15 (Wed, 15 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/omptarget-parallel-llvm.mlir
    A offload/test/offloading/fortran/target-generic-outlined-loops.f90

  Log Message:
  -----------
  [MLIR][OpenMP][OMPIRBuilder] Improve shared memory checks

This patch refines checks to decide whether to use device shared memory or
regular stack allocations. In particular, it adds support for parallel regions
residing on standalone target device functions.

The changes are:
- Shared memory is introduced for `omp.target` implicit allocations, such as
those related to privatization and mapping, as long as they are shared across
threads in a nested parallel region.
- Standalone target device functions are interpreted as being part of a Generic
kernel, since the fact that they are present in the module after filtering
means they must be reachable from a target region.
- Prevent allocations whose only shared uses inside of an `omp.parallel` region
are as part of a `private` clause from being moved to device shared memory.


  Commit: f0cead6e6b7cc9612560a1e8946fbefbddd0a86f
      https://github.com/llvm/llvm-project/commit/f0cead6e6b7cc9612560a1e8946fbefbddd0a86f
  Author: Sergio Afonso <Sergio.AfonsoFumero at amd.com>
  Date:   2026-04-15 (Wed, 15 Apr 2026)

  Changed paths:
    M flang/test/Integration/OpenMP/target-use-device-nested.f90
    M flang/test/Integration/OpenMP/threadprivate-target-device.f90
    M mlir/lib/Target/LLVMIR/Dialect/OpenMP/OpenMPToLLVMIRTranslation.cpp
    M mlir/test/Target/LLVMIR/omptarget-constant-alloca-raise.mlir
    A mlir/test/Target/LLVMIR/openmp-target-private-shared-mem.mlir

  Log Message:
  -----------
  add missing check


  Commit: fed9e5df9de4d5e8eac86c92aadd1956a28ac73e
      https://github.com/llvm/llvm-project/commit/fed9e5df9de4d5e8eac86c92aadd1956a28ac73e
  Author: Sergio Afonso <Sergio.AfonsoFumero at amd.com>
  Date:   2026-04-15 (Wed, 15 Apr 2026)

  Changed paths:
    M mlir/lib/Target/LLVMIR/Dialect/OpenMP/OpenMPToLLVMIRTranslation.cpp

  Log Message:
  -----------
  support other map-like clauses


  Commit: fea419ec89c76de72176582318d4513debd7e452
      https://github.com/llvm/llvm-project/commit/fea419ec89c76de72176582318d4513debd7e452
  Author: Sergio Afonso <Sergio.AfonsoFumero at amd.com>
  Date:   2026-04-15 (Wed, 15 Apr 2026)

  Changed paths:
    M mlir/test/Target/LLVMIR/openmp-target-private-shared-mem.mlir

  Log Message:
  -----------
  update after rebase


  Commit: 8f69741bf0efe4198e6425b84baf5776ca138d80
      https://github.com/llvm/llvm-project/commit/8f69741bf0efe4198e6425b84baf5776ca138d80
  Author: Sergio Afonso <Sergio.AfonsoFumero at amd.com>
  Date:   2026-04-15 (Wed, 15 Apr 2026)

  Changed paths:
    M flang/lib/Optimizer/OpenMP/FunctionFiltering.cpp
    M flang/test/Lower/OpenMP/declare-target-func-and-subr.f90
    M flang/test/Lower/OpenMP/declare-target-implicit-func-and-subr-cap-enter.f90
    M flang/test/Lower/OpenMP/declare-target-implicit-func-and-subr-cap.f90
    M flang/test/Lower/OpenMP/declare-target-implicit-tarop-cap.f90
    M flang/test/Lower/OpenMP/function-filtering-2.f90

  Log Message:
  -----------
  add internal linkage to target device functions


  Commit: 32222e90a1f6fe0a39ead7ca7a64fdf2c9eba179
      https://github.com/llvm/llvm-project/commit/32222e90a1f6fe0a39ead7ca7a64fdf2c9eba179
  Author: Sergio Afonso <Sergio.AfonsoFumero at amd.com>
  Date:   2026-04-15 (Wed, 15 Apr 2026)

  Changed paths:
    M flang/test/Integration/OpenMP/threadprivate-target-device.f90

  Log Message:
  -----------
  fix test after rebase


  Commit: b3e7222847f13809b6102a7790f4d180de9a163b
      https://github.com/llvm/llvm-project/commit/b3e7222847f13809b6102a7790f4d180de9a163b
  Author: Sergio Afonso <Sergio.AfonsoFumero at amd.com>
  Date:   2026-04-15 (Wed, 15 Apr 2026)

  Changed paths:
    M flang/lib/Optimizer/OpenMP/FunctionFiltering.cpp
    M flang/test/Lower/OpenMP/declare-target-func-and-subr.f90
    M flang/test/Lower/OpenMP/declare-target-implicit-func-and-subr-cap-enter.f90
    M flang/test/Lower/OpenMP/declare-target-implicit-func-and-subr-cap.f90
    M flang/test/Lower/OpenMP/declare-target-implicit-tarop-cap.f90
    M flang/test/Lower/OpenMP/function-filtering-2.f90

  Log Message:
  -----------
  Revert "add internal linkage to target device functions"

This reverts commit 7dca66e67ed7f9309812790110543e07e5dde0e8.


Compare: https://github.com/llvm/llvm-project/compare/242cd9638478...b3e7222847f1

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