[all-commits] [llvm/llvm-project] aec735: [Flang][OpenMP][MLIR] Fix common block mapping for...
agozillon via All-commits
all-commits at lists.llvm.org
Tue Jun 25 11:54:26 PDT 2024
Branch: refs/heads/main
Home: https://github.com/llvm/llvm-project
Commit: aec735cf476c3975b026aa79fa40dda06a27fac3
https://github.com/llvm/llvm-project/commit/aec735cf476c3975b026aa79fa40dda06a27fac3
Author: agozillon <Andrew.Gozillon at amd.com>
Date: 2024-06-25 (Tue, 25 Jun 2024)
Changed paths:
M flang/lib/Lower/OpenMP/OpenMP.cpp
M flang/test/Fir/convert-to-llvm-openmp-and-fir.fir
M flang/test/Integration/OpenMP/map-types-and-sizes.f90
A flang/test/Lower/OpenMP/common-block-map.f90
M llvm/lib/Frontend/OpenMP/OMPIRBuilder.cpp
M mlir/lib/Target/LLVMIR/Dialect/OpenMP/OpenMPToLLVMIRTranslation.cpp
A mlir/test/Target/LLVMIR/omptarget-fortran-common-block-host.mlir
A offload/test/offloading/fortran/target-map-all-common-block-members.f90
A offload/test/offloading/fortran/target-map-common-block.f90
A offload/test/offloading/fortran/target-map-declare-target-link-common-block.f90
A offload/test/offloading/fortran/target-map-first-common-block-member.f90
A offload/test/offloading/fortran/target-map-mix-imp-exp-common-block-members.f90
A offload/test/offloading/fortran/target-map-second-common-block-member.f90
Log Message:
-----------
[Flang][OpenMP][MLIR] Fix common block mapping for regular and declare target link (#91829)
This PR attempts to fix common block mapping for regular mapping of
these types as well as when they have been marked as "declare target
link". This PR should allow correct mapping of both the members of a
common block and the full common block via its block symbol.
The main changes were some adjustments to the Fortran OpenMP lowering to
HLFIR/FIR, the lowering of the LLVM+OpenMP dialect to LLVM-IR and
adjustments to the way the we handle target kernel map argument
rebinding inside of the OMPIRBuilder.
For the Fortran OpenMP lowering were two changes, one to prevent the
implicit capture of common block members when the common block symbol
itself has been marked and the other creates intermediate member access
inside of the target region to be used in-place of those external to the
target region, this prevents external usages breaking the
IsolatedFromAbove pact.
In the latter case, there was an adjustment to the size calculation for
types to better handle cases where we pass an array as the type of a map
(as opposed to the bounds and the type of the element), which occurs in
the case of common blocks. There is also some adjustment to how
handleDeclareTargetMapVar handles renaming of declare target symbols in
the module to the reference pointer, now it will only apply to those
within the kernel that is currently being generated and we also perform
a modification to replace constants with instructions as necessary as we
cannot replace these with our reference pointer (non-constant and
constants do not mix nicely).
In the case of the OpenMPIRBuilder some changes were made to defer
global symbol rebinding to kernel arguments until all other arguments
have been rebound. This makes sure we do not replace uses that may refer
to the global (e.g. a GEP) but are themselves actually a separate
argument that needs bound.
Currently "declare target to" still needs some work, but this may be the
case for all types in conjunction with "declare target to" at the
moment.
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