[all-commits] [llvm/llvm-project] 4a3bf2: [OpenMP] Introduce omp.target_allocmem and omp.tar...

Chaitanya via All-commits all-commits at lists.llvm.org
Mon Aug 18 05:45:33 PDT 2025


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 4a3bf27c69473e65a9176858ff57c8b55dfb184c
      https://github.com/llvm/llvm-project/commit/4a3bf27c69473e65a9176858ff57c8b55dfb184c
  Author: Chaitanya <Krishna.Sankisa at amd.com>
  Date:   2025-08-18 (Mon, 18 Aug 2025)

  Changed paths:
    M flang/include/flang/Optimizer/Support/Utils.h
    M flang/lib/Optimizer/CodeGen/CodeGen.cpp
    M flang/lib/Optimizer/CodeGen/CodeGenOpenMP.cpp
    M flang/lib/Optimizer/Dialect/FIROps.cpp
    M flang/lib/Optimizer/Support/Utils.cpp
    A flang/test/Fir/omp_target_allocmem_freemem.fir
    M mlir/include/mlir/Dialect/OpenMP/OpenMPOps.td
    M mlir/lib/Dialect/OpenMP/IR/OpenMPDialect.cpp
    M mlir/lib/Target/LLVMIR/Dialect/OpenMP/OpenMPToLLVMIRTranslation.cpp
    A mlir/test/Target/LLVMIR/ompenmp-target-allocmem-freemem.mlir

  Log Message:
  -----------
  [OpenMP] Introduce omp.target_allocmem and omp.target_freemem omp dialect ops. (#145464)

This PR introduces two new ops in omp dialect, omp.target_allocmem and
omp.target_freemem.
omp.target_allocmem: Allocates heap memory on device. Will be lowered to
omp_target_alloc call in llvm.
omp.target_freemem: Deallocates heap memory on device. Will be lowered
to omp+target_free call in llvm.


Example:
  %1 = omp.target_allocmem %device : i32, i64
  omp.target_freemem %device, %1 : i32, i64

The work in this PR is C-P/inspired from @ivanradanov commit from
coexecute implementation:
[Add fir omp target alloc and free
ops](https://github.com/ivanradanov/llvm-project/commit/be860ac8baf24b8405e6f396c75d7f0d26375de5)
[Lower omp_target_{alloc,free} to
llvm](https://github.com/ivanradanov/llvm-project/commit/6e2d584dc93ff99bb89adc28c7afbc2b21c46d39)



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