[flang-commits] [flang] [flang][OpenMP] Diagnose privatized array section reductions (PR #215997)
via flang-commits
flang-commits at lists.llvm.org
Sun Aug 16 13:47:59 PDT 2026
================
@@ -4922,14 +4919,16 @@ static mlir::omp::TaskloopContextOp genStandaloneTaskloop(
enableDelayedPrivatization, symTable);
dsp.processStep1(&taskloopClauseOps);
- if (hasPrivatizedArrayElementReduction(inReductionObjects,
- dsp.getAllSymbolsToPrivatize()))
- TODO(loc, "TASKLOOP construct with IN_REDUCTION of an array element whose "
- "base array is privatized");
- if (hasPrivatizedArrayElementReduction(reductionObjects,
- dsp.getAllSymbolsToPrivatize()))
- TODO(loc, "TASKLOOP construct with REDUCTION of an array element whose "
- "base array is privatized");
+ if (hasPrivatizedArrayReductionObject(inReductionObjects,
+ dsp.getDelayedPrivSymbols()))
+ TODO(loc,
+ "TASKLOOP construct with IN_REDUCTION of an array element or section "
+ "whose base array is privatized");
+ if (hasPrivatizedArrayReductionObject(reductionObjects,
+ dsp.getDelayedPrivSymbols()))
----------------
MattPD wrote:
The eager array-element diagnostic now covers the original regression.
Eager array sections retain a pre-existing storage-binding problem. With `reduction(+: a(2:3))` and a loop-body read of `a(1)`, the firstprivate clone is dead, and `a(1)` reads the zero-initialized reduction box.
Could eager array sections remain under the TODO until lowering distinguishes section references from other base-array references?
https://github.com/llvm/llvm-project/pull/215997
More information about the flang-commits
mailing list