[all-commits] [llvm/llvm-project] 53f0fa: [Flang][OpenMP] Add pass to replace allocas with d...
Sergio Afonso via All-commits
all-commits at lists.llvm.org
Thu Apr 16 05:08:17 PDT 2026
Branch: refs/heads/users/skatrak/flang-generic-10-shared-alloca-pass
Home: https://github.com/llvm/llvm-project
Commit: 53f0fad837929e3402cac8de01bcb398aabe8097
https://github.com/llvm/llvm-project/commit/53f0fad837929e3402cac8de01bcb398aabe8097
Author: Sergio Afonso <safonsof at amd.com>
Date: 2026-04-16 (Thu, 16 Apr 2026)
Changed paths:
M flang/include/flang/Optimizer/OpenMP/Passes.td
M flang/lib/Optimizer/OpenMP/CMakeLists.txt
A flang/lib/Optimizer/OpenMP/StackToShared.cpp
M flang/lib/Optimizer/Passes/Pipelines.cpp
A flang/test/Transforms/OpenMP/stack-to-shared.mlir
Log Message:
-----------
[Flang][OpenMP] Add pass to replace allocas with device shared memory
This patch introduces a new Flang OpenMP MLIR pass, only ran for target device
modules, that identifies `fir.alloca` operations that should use device shared
memory and replaces them with pairs of `omp.alloc_shared_mem` and
`omp.free_shared_mem` operations.
This works in conjunction to the MLIR to LLVM IR translation pass' handling of
privatization, mapping and reductions in the OpenMP dialect to properly select
the right memory space for allocations based on where they are made and where
they are used.
This pass, in particular, handles explicit stack allocations in MLIR, whereas
the aforementioned translation pass takes care of implicit ones represented by
entry block arguments.
Commit: 4d4214cf655e86e7ef49a3f449ea7d1ceb1d275b
https://github.com/llvm/llvm-project/commit/4d4214cf655e86e7ef49a3f449ea7d1ceb1d275b
Author: Sergio Afonso <Sergio.AfonsoFumero at amd.com>
Date: 2026-04-16 (Thu, 16 Apr 2026)
Changed paths:
M flang/include/flang/Optimizer/OpenMP/Passes.td
M flang/include/flang/Optimizer/Support/InitFIR.h
M flang/lib/Optimizer/OpenMP/CMakeLists.txt
R flang/lib/Optimizer/OpenMP/StackToShared.cpp
M flang/lib/Optimizer/Passes/Pipelines.cpp
M flang/test/Fir/basic-program.fir
R flang/test/Transforms/OpenMP/stack-to-shared.mlir
M mlir/docs/Passes.md
M mlir/include/mlir/Dialect/OpenMP/Transforms/Passes.h
M mlir/include/mlir/Dialect/OpenMP/Transforms/Passes.td
M mlir/lib/Dialect/OpenMP/CMakeLists.txt
A mlir/lib/Dialect/OpenMP/IR/CMakeLists.txt
M mlir/lib/Dialect/OpenMP/Transforms/CMakeLists.txt
A mlir/lib/Dialect/OpenMP/Transforms/StackToShared.cpp
A mlir/test/Dialect/OpenMP/stack-to-shared.mlir
Log Message:
-----------
move stack-to-shared pass to the omp dialect
Commit: fb47438d2719d6bd79c2a951286a43fd4dfdb752
https://github.com/llvm/llvm-project/commit/fb47438d2719d6bd79c2a951286a43fd4dfdb752
Author: Sergio Afonso <Sergio.AfonsoFumero at amd.com>
Date: 2026-04-16 (Thu, 16 Apr 2026)
Changed paths:
M mlir/include/mlir/Dialect/OpenMP/Transforms/Passes.td
M mlir/lib/Dialect/OpenMP/Transforms/StackToShared.cpp
M mlir/test/Dialect/OpenMP/stack-to-shared.mlir
Log Message:
-----------
update after rebase and address review comments
Compare: https://github.com/llvm/llvm-project/compare/0f1421ad37f5...fb47438d2719
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