diff options
author | Tom Eccles <tom.eccles@arm.com> | 2024-03-13 14:51:09 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-03-13 14:51:09 +0000 |
commit | f46f5a01f4d5a7dcaf4a8fde5fc44eafdd9dbf27 (patch) | |
tree | 09ce6108138bd7042a4a82e23d36702f04a823ed /clang/lib/Basic/Module.cpp | |
parent | f18d78b477c76bc09dc580cdaedd55e121f5ebf5 (diff) | |
download | llvm-f46f5a01f4d5a7dcaf4a8fde5fc44eafdd9dbf27.zip llvm-f46f5a01f4d5a7dcaf4a8fde5fc44eafdd9dbf27.tar.gz llvm-f46f5a01f4d5a7dcaf4a8fde5fc44eafdd9dbf27.tar.bz2 |
[flang][OpenMP][OMPIRBuilder][mlir] Optionally pass reduction vars by ref (#84304)
Previously reduction variables were always passed by value into and out
of the initialization and combiner regions of the OpenMP reduction
declare operation.
This worked well for reductions of primitive types (and might perform
better than passing by reference). But passing by reference will be
useful for array and derived type reductions (e.g. to move allocation
inside of the init region).
Passing reductions by reference requires different LLVM-IR generation
when lowering from MLIR because some of the loads/stores/allocations
will now be moved inside of the init and combiner regions. This
alternate code generation is requested using a new attribute to
omp.wsloop and omp.parallel.
Existing lowerings from mlir are unaffected (these will continue to use
the by-value argument passing.
Flang will continue to pass by-value argument passing for trivial types
unless a (hidden) command line argument is supplied. Non-trivial types
will always use the by-ref lowering.
Array reductions are not ready yet (but are coming very soon). In the
meantime, this is tested by forcing existing reductions to use by-ref.
Commit series for by-ref OpenMP reductions 3/3
---------
Co-authored-by: Mats Petersson <mats.petersson@arm.com>
Diffstat (limited to 'clang/lib/Basic/Module.cpp')
0 files changed, 0 insertions, 0 deletions