[all-commits] [llvm/llvm-project] c955ae: [mlir][OpenMP] Change the definition of omp.private
Tom Eccles via All-commits
all-commits at lists.llvm.org
Thu Jan 30 05:50:49 PST 2025
Branch: refs/heads/users/tblah/delayed-task-exec-1
Home: https://github.com/llvm/llvm-project
Commit: c955ae401adf6628db69f5200ce282998195bc18
https://github.com/llvm/llvm-project/commit/c955ae401adf6628db69f5200ce282998195bc18
Author: Tom Eccles <tom.eccles at arm.com>
Date: 2025-01-30 (Thu, 30 Jan 2025)
Changed paths:
M flang/lib/Lower/OpenMP/DataSharingProcessor.cpp
M flang/lib/Optimizer/CodeGen/CodeGenOpenMP.cpp
M flang/test/Analysis/AliasAnalysis/alias-analysis-omp-private-allocatable.mlir
M flang/test/Analysis/AliasAnalysis/alias-analysis-omp-teams-distribute-private-ptr.mlir
M flang/test/Analysis/AliasAnalysis/alias-analysis-omp-teams-distribute-private.mlir
M flang/test/Fir/boxproc-openmp.fir
M flang/test/HLFIR/opt-variable-assign-omp.fir
M flang/test/Integration/OpenMP/parallel-private-reduction-worstcase.f90
M flang/test/Integration/OpenMP/private-global.f90
M flang/test/Lower/OpenMP/DelayedPrivatization/distribute-standalone-private.f90
M flang/test/Lower/OpenMP/DelayedPrivatization/target-private-allocatable.f90
M flang/test/Lower/OpenMP/DelayedPrivatization/target-private-simple.f90
M flang/test/Lower/OpenMP/DelayedPrivatization/wsloop.f90
M flang/test/Lower/OpenMP/cfg-conversion-omp.private.f90
M flang/test/Lower/OpenMP/delayed-privatization-allocatable-array.f90
M flang/test/Lower/OpenMP/delayed-privatization-allocatable-firstprivate.f90
M flang/test/Lower/OpenMP/delayed-privatization-allocatable-private.f90
M flang/test/Lower/OpenMP/delayed-privatization-array.f90
M flang/test/Lower/OpenMP/delayed-privatization-character-array.f90
M flang/test/Lower/OpenMP/delayed-privatization-firstprivate.f90
M flang/test/Lower/OpenMP/delayed-privatization-private-firstprivate.f90
M flang/test/Lower/OpenMP/delayed-privatization-private.f90
M flang/test/Lower/OpenMP/delayed-privatization-reduction-byref.f90
M flang/test/Lower/OpenMP/delayed-privatization-reduction.f90
M flang/test/Lower/OpenMP/implicit-dsa.f90
M flang/test/Lower/OpenMP/loop-directive.f90
M flang/test/Lower/OpenMP/parallel-firstprivate-clause-scalar.f90
M flang/test/Lower/OpenMP/same_var_first_lastprivate.f90
M flang/test/Lower/OpenMP/simd.f90
M flang/test/Lower/OpenMP/task2.f90
M flang/test/Transforms/generic-loop-rewriting.mlir
M flang/test/Transforms/omp-maps-for-privatized-symbols.fir
M mlir/include/mlir/Dialect/OpenMP/OpenMPOps.td
M mlir/lib/Conversion/OpenMPToLLVM/OpenMPToLLVM.cpp
M mlir/lib/Dialect/OpenMP/IR/OpenMPDialect.cpp
M mlir/lib/Target/LLVMIR/Dialect/OpenMP/OpenMPToLLVMIRTranslation.cpp
M mlir/test/Conversion/OpenMPToLLVM/convert-to-llvmir.mlir
M mlir/test/Dialect/OpenMP/invalid.mlir
M mlir/test/Dialect/OpenMP/ops.mlir
M mlir/test/Target/LLVMIR/openmp-firstprivate.mlir
M mlir/test/Target/LLVMIR/openmp-llvm.mlir
M mlir/test/Target/LLVMIR/openmp-omp.private-dealloc.mlir
M mlir/test/Target/LLVMIR/openmp-private.mlir
M mlir/test/Target/LLVMIR/openmp-simd-private.mlir
M mlir/test/Target/LLVMIR/openmp-target-multiple-private.mlir
M mlir/test/Target/LLVMIR/openmp-target-private-allocatable.mlir
M mlir/test/Target/LLVMIR/openmp-target-private.mlir
M mlir/test/Target/LLVMIR/openmp-target-simd-on_device.mlir
M mlir/test/Target/LLVMIR/openmp-todo.mlir
M mlir/test/Target/LLVMIR/openmp-wsloop-private-cond_br.mlir
M mlir/test/Target/LLVMIR/openmp-wsloop-private.mlir
Log Message:
-----------
[mlir][OpenMP] Change the definition of omp.private
The intention of this work is to give MLIR->LLVMIR conversion freedom to
control how the private variable is allocated so that it can be
allocated on the stack in ordinary cases or as part of a structure used
to give closure context for tasks which might outlive the current stack
frame. See RFC:
https://discourse.llvm.org/t/rfc-openmp-supporting-delayed-task-execution-with-firstprivate-variables/83084
In flang, before this patch we hit a TODO with the same wording when
generating the copy region for firstprivate polymorphic variables. After
this patch the box-like fir.class is passed by reference into the copy
region, leading to a different path that didn't hit that old TODO but
the generated code still didn't work so I added a new TODO in
DataSharingProcessor.
---
Please read mlir changes first and then flang changes.
In flang lowering I box up all arrays and pass the boxes by reference so
that the existing code for reduction init and dealloc regions can be
shared.
The TODOs for pointers, derived types, characters etc will be resolved
in later patches in this same series (to be squashed into this one). I
separated it to make it easier to review.
Assumed rank was already broken before this patch.
I can't find any mention of "assumed rank" in the openmp standard so
I guess it is not prohibited.
Other than the omp.private operation definition changes, the test changes
are mostly down to slightly different codegen from re-using the reduction
init region. That code is already well tested so I didn't want to change it.
Commit: 444e16fe2333ff42bfe263fc24be28732a5d40f3
https://github.com/llvm/llvm-project/commit/444e16fe2333ff42bfe263fc24be28732a5d40f3
Author: Tom Eccles <tom.eccles at arm.com>
Date: 2025-01-30 (Thu, 30 Jan 2025)
Changed paths:
M flang/lib/Lower/OpenMP/DataSharingProcessor.cpp
A flang/test/Lower/OpenMP/delayed-privatization-lastprivate-of-private.f90
Log Message:
-----------
Fix bug when used with lastprivate
Arrays are boxed and those boxed arrays are passed by reference. This
can cause problems if we try to perform eager privatization (e.g.
lastprivate) on a variable already privatized using delayed
privatization. Work around this by loading the reference to the box.
Commit: 4b3c1dc5142b577143fc675e4a25ca6f9a200bb2
https://github.com/llvm/llvm-project/commit/4b3c1dc5142b577143fc675e4a25ca6f9a200bb2
Author: Tom Eccles <tom.eccles at arm.com>
Date: 2025-01-30 (Thu, 30 Jan 2025)
Changed paths:
M flang/lib/Lower/OpenMP/DataSharingProcessor.cpp
M flang/lib/Lower/OpenMP/PrivateReductionUtils.cpp
M flang/test/Lower/OpenMP/delayed-privatization-character.f90
M flang/test/Lower/OpenMP/parallel-private-clause-fixes.f90
M flang/test/Lower/OpenMP/parallel-private-clause-str.f90
M flang/test/Lower/OpenMP/private-commonblock.f90
Log Message:
-----------
Support char types
The way boxchars are handled isn't ideal, but !fir.ref<!fir.boxchar<>>
seems to violate a lot of assumptions in the wider ecosystem of (hl)fir
helpers making it difficult to generate a copy region. I suspect
!fir.ref<!fir.boxchar<>> is not supposed to work (it looks like a
mutable character box, which isn't possible because a boxchar should be
an SSA value). Fixing this would be a big change beyond the scope of
this already too large PR.
Commit: 3385b3edc7229fb13b0e4c7cfe8f1a82dce276fc
https://github.com/llvm/llvm-project/commit/3385b3edc7229fb13b0e4c7cfe8f1a82dce276fc
Author: Tom Eccles <tom.eccles at arm.com>
Date: 2025-01-30 (Thu, 30 Jan 2025)
Changed paths:
M flang/lib/Optimizer/OpenMP/MapsForPrivatizedSymbols.cpp
M flang/test/Lower/OpenMP/DelayedPrivatization/target-private-multiple-variables.f90
Log Message:
-----------
Fix omp target maps for privatized symbols
Commit: 50c6e3a67bb2e85b169db869733b8266a0fc597c
https://github.com/llvm/llvm-project/commit/50c6e3a67bb2e85b169db869733b8266a0fc597c
Author: Tom Eccles <tom.eccles at arm.com>
Date: 2025-01-30 (Thu, 30 Jan 2025)
Changed paths:
M flang/lib/Lower/OpenMP/DataSharingProcessor.cpp
M flang/lib/Lower/OpenMP/PrivateReductionUtils.cpp
M flang/lib/Lower/OpenMP/PrivateReductionUtils.h
M flang/test/Lower/OpenMP/DelayedPrivatization/equivalence.f90
M flang/test/Lower/OpenMP/delayed-privatization-pointer.f90
Log Message:
-----------
Support pointers
The copy region codegen hasn't changed as a result of this patch series.
However I think there is a bug in the copy region generated in
equivalence.f90. This patch series is already too big so I won't change
the copy region here.
Commit: 15e59a729bda40ef9d8ef982a2a7c66ea0f6b2c0
https://github.com/llvm/llvm-project/commit/15e59a729bda40ef9d8ef982a2a7c66ea0f6b2c0
Author: Tom Eccles <tom.eccles at arm.com>
Date: 2025-01-30 (Thu, 30 Jan 2025)
Changed paths:
M flang/lib/Lower/OpenMP/PrivateReductionUtils.cpp
M flang/test/Lower/OpenMP/delayed-privatization-allocatable-array.f90
M flang/test/Lower/OpenMP/parallel-reduction-allocatable-array.f90
M flang/test/Lower/OpenMP/parallel-reduction-pointer-array.f90
A flang/test/Lower/OpenMP/pointer-to-array.f90
M flang/test/Lower/OpenMP/wsloop-reduction-allocatable-array-minmax.f90
Log Message:
-----------
Fix crash lowering fir::EmboxOp whithout shape
This only affects POINTERs (which should not be initialized) and NULL
allocatables so the actual contents of the shape doesn't matter. This is
just so the embox operation is converted to LLVMIR correctly.
Commit: f4c129a6cf83bf6ed75ac58b671df458476489aa
https://github.com/llvm/llvm-project/commit/f4c129a6cf83bf6ed75ac58b671df458476489aa
Author: Tom Eccles <tom.eccles at arm.com>
Date: 2025-01-30 (Thu, 30 Jan 2025)
Changed paths:
M flang/lib/Lower/OpenMP/DataSharingProcessor.cpp
M flang/lib/Lower/OpenMP/PrivateReductionUtils.cpp
M flang/lib/Lower/OpenMP/PrivateReductionUtils.h
M flang/test/Integration/OpenMP/copyprivate.f90
M flang/test/Lower/OpenMP/default-clause-byref.f90
M flang/test/Lower/OpenMP/delayed-privatization-default-init.f90
M flang/test/Lower/OpenMP/firstprivate-alloc-comp.f90
M flang/test/Lower/OpenMP/parallel-private-clause.f90
Log Message:
-----------
Support derived types
There are three cases handled:
- Boxed (maybe allocatable or pointer) scalar derived types
- Boxed (maybe allocatable or pointer) arrays of derived types
- Unboxed scalar derived types
Currently I support both boxed and unboxed derived types because unboxed
derived types aren't hlfir::Entities so I worry there could be cases
where they are in fact boxed.
The changes to parallel-private-clause.f90 are because of the arrays
becoming boxed. I re-organised the test a bit because the CHECK-DAGs
were matching completely the wrong lines outside of the parallel region.
Commit: 0d8b42d7b8717be4c9a21c07c182dcf5f35f37f6
https://github.com/llvm/llvm-project/commit/0d8b42d7b8717be4c9a21c07c182dcf5f35f37f6
Author: Tom Eccles <tom.eccles at arm.com>
Date: 2025-01-30 (Thu, 30 Jan 2025)
Changed paths:
M flang/lib/Lower/OpenMP/DataSharingProcessor.cpp
M flang/lib/Lower/OpenMP/DataSharingProcessor.h
M flang/lib/Lower/OpenMP/PrivateReductionUtils.cpp
M flang/lib/Lower/OpenMP/PrivateReductionUtils.h
M flang/lib/Lower/OpenMP/ReductionProcessor.cpp
M flang/test/Lower/OpenMP/derived-type-allocatable.f90
M flang/test/Lower/OpenMP/private-derived-type.f90
Log Message:
-----------
Implement lupori's derive type initialization patch
For reference see both
https://github.com/llvm/llvm-project/pull/120295 and
https://github.com/llvm/llvm-project/pull/121808
This changes the barrier logic.
See discussion here: https://github.com/llvm/llvm-project/pull/120295/files#r1910663473
Commit: eebf59c434bd5f9fc8939a2c3d9b2b4c468adb27
https://github.com/llvm/llvm-project/commit/eebf59c434bd5f9fc8939a2c3d9b2b4c468adb27
Author: Tom Eccles <tom.eccles at arm.com>
Date: 2025-01-30 (Thu, 30 Jan 2025)
Changed paths:
M flang/lib/Lower/OpenMP/DataSharingProcessor.cpp
M flang/lib/Lower/OpenMP/PrivateReductionUtils.cpp
M flang/lib/Lower/OpenMP/PrivateReductionUtils.h
M flang/lib/Lower/OpenMP/ReductionProcessor.cpp
M flang/lib/Lower/OpenMP/ReductionProcessor.h
Log Message:
-----------
Deallocate derived types
This will deallocate in exactly the same cases as the old implementation
before this series. I expect some cases are missed but I want to avoid
functional changes wherever possible in this (already too big) patch
series.
Commit: 6953f3f19025e4da992af44988055775e6e9cd3a
https://github.com/llvm/llvm-project/commit/6953f3f19025e4da992af44988055775e6e9cd3a
Author: Tom Eccles <tom.eccles at arm.com>
Date: 2025-01-30 (Thu, 30 Jan 2025)
Changed paths:
M flang/lib/Lower/OpenMP/PrivateReductionUtils.cpp
M flang/test/Lower/OpenMP/derived-type-allocatable.f90
Log Message:
-----------
Support arrays of polymorphic types
Commit: 81a6b26172c0c6c7058b72dfcc55cbf625affce5
https://github.com/llvm/llvm-project/commit/81a6b26172c0c6c7058b72dfcc55cbf625affce5
Author: Tom Eccles <tom.eccles at arm.com>
Date: 2025-01-30 (Thu, 30 Jan 2025)
Changed paths:
M flang/lib/Lower/OpenMP/PrivateReductionUtils.cpp
M flang/test/Lower/OpenMP/copyprivate.f90
M flang/test/Lower/OpenMP/delayed-privatization-pointer.f90
Log Message:
-----------
Fix compiler crash for unnesecarry len params
Commit: 61c0d3b3ef512d7ab474833516428a7958ca94bf
https://github.com/llvm/llvm-project/commit/61c0d3b3ef512d7ab474833516428a7958ca94bf
Author: Tom Eccles <tom.eccles at arm.com>
Date: 2025-01-30 (Thu, 30 Jan 2025)
Changed paths:
M flang/lib/Lower/OpenMP/DataSharingProcessor.cpp
M flang/lib/Lower/OpenMP/DataSharingProcessor.h
M flang/lib/Lower/OpenMP/PrivateReductionUtils.cpp
M flang/lib/Lower/OpenMP/PrivateReductionUtils.h
M flang/lib/Optimizer/OpenMP/MapsForPrivatizedSymbols.cpp
M mlir/include/mlir/Dialect/OpenMP/OpenMPOps.td
Log Message:
-----------
Readability improvments
Commit: 729ae4c25b454ae6f0061d88db72fefb07be0aa4
https://github.com/llvm/llvm-project/commit/729ae4c25b454ae6f0061d88db72fefb07be0aa4
Author: Tom Eccles <tom.eccles at arm.com>
Date: 2025-01-30 (Thu, 30 Jan 2025)
Changed paths:
M mlir/test/Target/LLVMIR/openmp-private.mlir
Log Message:
-----------
Fix MLIR test
I made a mistake when rewriting the privatizer, which led to the test
reading incorrectly.
Commit: 3d6141dc86f121ef71e5a54c034551fe8671f8ce
https://github.com/llvm/llvm-project/commit/3d6141dc86f121ef71e5a54c034551fe8671f8ce
Author: Tom Eccles <tom.eccles at arm.com>
Date: 2025-01-30 (Thu, 30 Jan 2025)
Changed paths:
M flang/lib/Lower/OpenMP/DataSharingProcessor.cpp
M flang/lib/Lower/OpenMP/PrivateReductionUtils.cpp
M mlir/lib/Target/LLVMIR/Dialect/OpenMP/OpenMPToLLVMIRTranslation.cpp
Log Message:
-----------
More readability improvments
Commit: e67683ec83fb72a2307ee998c74ddebe9481e39e
https://github.com/llvm/llvm-project/commit/e67683ec83fb72a2307ee998c74ddebe9481e39e
Author: Tom Eccles <tom.eccles at arm.com>
Date: 2025-01-30 (Thu, 30 Jan 2025)
Changed paths:
M flang/lib/Optimizer/OpenMP/MapsForPrivatizedSymbols.cpp
Log Message:
-----------
Allow block arguments in MapsForPrivatizedSymbols
Commit: 9c222936e3968df94662a29fce1f4f955f48f27b
https://github.com/llvm/llvm-project/commit/9c222936e3968df94662a29fce1f4f955f48f27b
Author: Tom Eccles <tom.eccles at arm.com>
Date: 2025-01-30 (Thu, 30 Jan 2025)
Changed paths:
M flang/test/Lower/OpenMP/derived-type-allocatable.f90
Log Message:
-----------
Add negative tests for barriers
Commit: 9284bb37d48d8c1eb17ad5a54a84e89eab50d80e
https://github.com/llvm/llvm-project/commit/9284bb37d48d8c1eb17ad5a54a84e89eab50d80e
Author: Tom Eccles <tom.eccles at arm.com>
Date: 2025-01-30 (Thu, 30 Jan 2025)
Changed paths:
M flang/test/Lower/OpenMP/loop-directive.f90
Log Message:
-----------
Fix test broken after rebase
Compare: https://github.com/llvm/llvm-project/compare/ce451030c7df...9284bb37d48d
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