[flang-commits] [flang] [flang][OpenMP] Diagnose privatized array section reductions (PR #215997)
via flang-commits
flang-commits at lists.llvm.org
Tue Aug 18 05:01:40 PDT 2026
github-actions[bot] wrote:
<!--PREMERGE ADVISOR COMMENT: Windows-->
# :window: Windows x64 Test Results
* 4658 tests passed
* 262 tests skipped
* 1 test failed
## Failed Tests
(click on a test name to see its output)
### Flang
<details>
<summary>Flang.Lower/OpenMP/reduction-array-full-section-task-privatization.f90</summary>
```
Exit Code: 1
Command Output (stdout):
--
# RUN: at line 1
split-file C:\_work\llvm-project\llvm-project\flang\test\Lower\OpenMP\reduction-array-full-section-task-privatization.f90 C:\_work\llvm-project\llvm-project\build\tools\flang\test\Lower\OpenMP\Output\reduction-array-full-section-task-privatization.f90.tmp
# executed command: split-file 'C:\_work\llvm-project\llvm-project\flang\test\Lower\OpenMP\reduction-array-full-section-task-privatization.f90' 'C:\_work\llvm-project\llvm-project\build\tools\flang\test\Lower\OpenMP\Output\reduction-array-full-section-task-privatization.f90.tmp'
# note: command had no output on stdout or stderr
# RUN: at line 2
c:\_work\llvm-project\llvm-project\build\bin\flang.exe -fc1 -fintrinsic-modules-path=C:\_work\llvm-project\llvm-project\build\lib\clang\24\finclude\flang\x86_64-pc-windows-msvc -emit-hlfir -fopenmp -fopenmp-version=50 -o - C:\_work\llvm-project\llvm-project\build\tools\flang\test\Lower\OpenMP\Output\reduction-array-full-section-task-privatization.f90.tmp/task.f90 | c:\_work\llvm-project\llvm-project\build\bin\filecheck.exe C:\_work\llvm-project\llvm-project\flang\test\Lower\OpenMP\reduction-array-full-section-task-privatization.f90 --check-prefix=TASK --implicit-check-not=not\ yet\ implemented --implicit-check-not=Ea_firstprivate
# executed command: 'c:\_work\llvm-project\llvm-project\build\bin\flang.exe' -fc1 '-fintrinsic-modules-path=C:\_work\llvm-project\llvm-project\build\lib\clang\24\finclude\flang\x86_64-pc-windows-msvc' -emit-hlfir -fopenmp -fopenmp-version=50 -o - 'C:\_work\llvm-project\llvm-project\build\tools\flang\test\Lower\OpenMP\Output\reduction-array-full-section-task-privatization.f90.tmp/task.f90'
# .---command stdout------------
# | module attributes {dlti.dl_spec = #dlti.dl_spec<!llvm.ptr<270> = dense<32> : vector<4xi64>, !llvm.ptr<271> = dense<32> : vector<4xi64>, !llvm.ptr<272> = dense<64> : vector<4xi64>, i64 = dense<64> : vector<2xi64>, i128 = dense<128> : vector<2xi64>, f80 = dense<128> : vector<2xi64>, !llvm.ptr = dense<64> : vector<4xi64>, i1 = dense<8> : vector<2xi64>, i8 = dense<8> : vector<2xi64>, i16 = dense<16> : vector<2xi64>, i32 = dense<32> : vector<2xi64>, f16 = dense<16> : vector<2xi64>, f64 = dense<64> : vector<2xi64>, f128 = dense<128> : vector<2xi64>, "dlti.endianness" = "little", "dlti.mangling_mode" = "w", "dlti.legal_int_widths" = array<i32: 8, 16, 32, 64>, "dlti.stack_alignment" = 128 : i64>, fir.defaultkind = "a1c4d8i4l4r4", fir.kindmap = "", fir.relocation_model = 1 : i32, llvm.data_layout = "e-m:w-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128", llvm.ident = "flang version 24.0.0 (https://github.com/llvm/llvm-project f1ed247f14fc6e42e4afd4feae6a441e0c67d175)", llvm.target_triple = "x86_64-pc-windows-msvc", omp.flags = #omp.flags<>, omp.integer_wrap_around = #omp.integer_wrap_around<integer_wrap_around = false>, omp.is_gpu = false, omp.is_target_device = false, omp.target_triples = [], omp.version = #omp.version<version = 50>} {
# | omp.declare_reduction @add_reduction_byref_box_4x4xi32 : !fir.ref<!fir.box<!fir.array<4x4xi32>>> attributes {byref_element_type = !fir.array<4x4xi32>} alloc {
# | %0 = fir.alloca !fir.box<!fir.array<4x4xi32>>
# | omp.yield(%0 : !fir.ref<!fir.box<!fir.array<4x4xi32>>>)
# | } init {
# | ^bb0(%arg0: !fir.ref<!fir.box<!fir.array<4x4xi32>>>, %arg1: !fir.ref<!fir.box<!fir.array<4x4xi32>>>):
# | %c0_i32 = arith.constant 0 : i32
# | %0 = fir.load %arg0 : !fir.ref<!fir.box<!fir.array<4x4xi32>>>
# | %c4 = arith.constant 4 : index
# | %c4_0 = arith.constant 4 : index
# | %1 = fir.shape %c4, %c4_0 : (index, index) -> !fir.shape<2>
# | %2 = fir.allocmem !fir.array<4x4xi32> {bindc_name = ".tmp", uniq_name = ""}
# | %3:2 = hlfir.declare %2(%1) {uniq_name = ".tmp"} : (!fir.heap<!fir.array<4x4xi32>>, !fir.shape<2>) -> (!fir.heap<!fir.array<4x4xi32>>, !fir.heap<!fir.array<4x4xi32>>)
# | %c0 = arith.constant 0 : index
# | %4:3 = fir.box_dims %0, %c0 : (!fir.box<!fir.array<4x4xi32>>, index) -> (index, index, index)
# | %c1 = arith.constant 1 : index
# | %5:3 = fir.box_dims %0, %c1 : (!fir.box<!fir.array<4x4xi32>>, index) -> (index, index, index)
# | %6 = fir.shape_shift %4#0, %4#1, %5#0, %5#1 : (index, index, index, index) -> !fir.shapeshift<2>
# | %7 = fir.embox %3#0(%6) : (!fir.heap<!fir.array<4x4xi32>>, !fir.shapeshift<2>) -> !fir.box<!fir.array<4x4xi32>>
# | hlfir.assign %c0_i32 to %7 : i32, !fir.box<!fir.array<4x4xi32>>
# | fir.store %7 to %arg1 : !fir.ref<!fir.box<!fir.array<4x4xi32>>>
# | omp.yield(%arg1 : !fir.ref<!fir.box<!fir.array<4x4xi32>>>)
# | } combiner {
# | ^bb0(%arg0: !fir.ref<!fir.box<!fir.array<4x4xi32>>>, %arg1: !fir.ref<!fir.box<!fir.array<4x4xi32>>>):
# | %0 = fir.load %arg0 : !fir.ref<!fir.box<!fir.array<4x4xi32>>>
# | %1 = fir.load %arg1 : !fir.ref<!fir.box<!fir.array<4x4xi32>>>
# | %c1 = arith.constant 1 : index
# | %c4 = arith.constant 4 : index
# | %c4_0 = arith.constant 4 : index
# | %2 = fir.shape_shift %c1, %c4, %c1, %c4_0 : (index, index, index, index) -> !fir.shapeshift<2>
# | %c1_1 = arith.constant 1 : index
# | fir.do_loop %arg2 = %c1_1 to %c4_0 step %c1_1 unordered {
# | fir.do_loop %arg3 = %c1_1 to %c4 step %c1_1 unordered {
# | %3 = fir.array_coor %0(%2) %arg3, %arg2 : (!fir.box<!fir.array<4x4xi32>>, !fir.shapeshift<2>, index, index) -> !fir.ref<i32>
# | %4 = fir.array_coor %1(%2) %arg3, %arg2 : (!fir.box<!fir.array<4x4xi32>>, !fir.shapeshift<2>, index, index) -> !fir.ref<i32>
# | %5 = fir.load %3 : !fir.ref<i32>
# | %6 = fir.load %4 : !fir.ref<i32>
# | %7 = arith.addi %5, %6 : i32
# | fir.store %7 to %3 : !fir.ref<i32>
# | }
# | }
# | omp.yield(%arg0 : !fir.ref<!fir.box<!fir.array<4x4xi32>>>)
# | } cleanup {
# | ^bb0(%arg0: !fir.ref<!fir.box<!fir.array<4x4xi32>>>):
# | %0 = fir.load %arg0 : !fir.ref<!fir.box<!fir.array<4x4xi32>>>
# | %1 = fir.box_addr %0 : (!fir.box<!fir.array<4x4xi32>>) -> !fir.ref<!fir.array<4x4xi32>>
# | %2 = fir.convert %1 : (!fir.ref<!fir.array<4x4xi32>>) -> i64
# | %c0_i64 = arith.constant 0 : i64
# | %3 = arith.cmpi ne, %2, %c0_i64 : i64
# | fir.if %3 {
# | %4 = fir.convert %1 : (!fir.ref<!fir.array<4x4xi32>>) -> !fir.heap<!fir.array<4x4xi32>>
# | fir.freemem %4 : !fir.heap<!fir.array<4x4xi32>>
# | }
# | omp.yield
# | } data_ptr_ptr {
# | ^bb0(%arg0: !fir.ref<!fir.box<!fir.array<4x4xi32>>>):
# | %0 = fir.box_offset %arg0 base_addr : (!fir.ref<!fir.box<!fir.array<4x4xi32>>>) -> !fir.llvm_ptr<!fir.ref<!fir.array<4x4xi32>>>
# | omp.yield(%0 : !fir.llvm_ptr<!fir.ref<!fir.array<4x4xi32>>>)
# | }
# | omp.declare_reduction @add_reduction_byref_box_4xi32 : !fir.ref<!fir.box<!fir.array<4xi32>>> attributes {byref_element_type = !fir.array<4xi32>} alloc {
# | %0 = fir.alloca !fir.box<!fir.array<4xi32>>
# | omp.yield(%0 : !fir.ref<!fir.box<!fir.array<4xi32>>>)
# | } init {
# | ^bb0(%arg0: !fir.ref<!fir.box<!fir.array<4xi32>>>, %arg1: !fir.ref<!fir.box<!fir.array<4xi32>>>):
# | %c0_i32 = arith.constant 0 : i32
# | %0 = fir.load %arg0 : !fir.ref<!fir.box<!fir.array<4xi32>>>
# | %c4 = arith.constant 4 : index
# | %1 = fir.shape %c4 : (index) -> !fir.shape<1>
# | %2 = fir.allocmem !fir.array<4xi32> {bindc_name = ".tmp", uniq_name = ""}
# | %3:2 = hlfir.declare %2(%1) {uniq_name = ".tmp"} : (!fir.heap<!fir.array<4xi32>>, !fir.shape<1>) -> (!fir.heap<!fir.array<4xi32>>, !fir.heap<!fir.array<4xi32>>)
# | %c0 = arith.constant 0 : index
# | %4:3 = fir.box_dims %0, %c0 : (!fir.box<!fir.array<4xi32>>, index) -> (index, index, index)
# | %5 = fir.shape_shift %4#0, %4#1 : (index, index) -> !fir.shapeshift<1>
# | %6 = fir.embox %3#0(%5) : (!fir.heap<!fir.array<4xi32>>, !fir.shapeshift<1>) -> !fir.box<!fir.array<4xi32>>
# | hlfir.assign %c0_i32 to %6 : i32, !fir.box<!fir.array<4xi32>>
# | fir.store %6 to %arg1 : !fir.ref<!fir.box<!fir.array<4xi32>>>
# | omp.yield(%arg1 : !fir.ref<!fir.box<!fir.array<4xi32>>>)
# | } combiner {
# | ^bb0(%arg0: !fir.ref<!fir.box<!fir.array<4xi32>>>, %arg1: !fir.ref<!fir.box<!fir.array<4xi32>>>):
# | %0 = fir.load %arg0 : !fir.ref<!fir.box<!fir.array<4xi32>>>
# | %1 = fir.load %arg1 : !fir.ref<!fir.box<!fir.array<4xi32>>>
# | %c1 = arith.constant 1 : index
# | %c4 = arith.constant 4 : index
# | %2 = fir.shape_shift %c1, %c4 : (index, index) -> !fir.shapeshift<1>
# | %c1_0 = arith.constant 1 : index
# | fir.do_loop %arg2 = %c1_0 to %c4 step %c1_0 unordered {
# | %3 = fir.array_coor %0(%2) %arg2 : (!fir.box<!fir.array<4xi32>>, !fir.shapeshift<1>, index) -> !fir.ref<i32>
# | %4 = fir.array_coor %1(%2) %arg2 : (!fir.box<!fir.array<4xi32>>, !fir.shapeshift<1>, index) -> !fir.ref<i32>
# | %5 = fir.load %3 : !fir.ref<i32>
# | %6 = fir.load %4 : !fir.ref<i32>
# | %7 = arith.addi %5, %6 : i32
# | fir.store %7 to %3 : !fir.ref<i32>
# | }
# | omp.yield(%arg0 : !fir.ref<!fir.box<!fir.array<4xi32>>>)
# | } cleanup {
# | ^bb0(%arg0: !fir.ref<!fir.box<!fir.array<4xi32>>>):
# | %0 = fir.load %arg0 : !fir.ref<!fir.box<!fir.array<4xi32>>>
# | %1 = fir.box_addr %0 : (!fir.box<!fir.array<4xi32>>) -> !fir.ref<!fir.array<4xi32>>
# | %2 = fir.convert %1 : (!fir.ref<!fir.array<4xi32>>) -> i64
# | %c0_i64 = arith.constant 0 : i64
# | %3 = arith.cmpi ne, %2, %c0_i64 : i64
# | fir.if %3 {
# | %4 = fir.convert %1 : (!fir.ref<!fir.array<4xi32>>) -> !fir.heap<!fir.array<4xi32>>
# | fir.freemem %4 : !fir.heap<!fir.array<4xi32>>
# | }
# | omp.yield
# | } data_ptr_ptr {
# | ^bb0(%arg0: !fir.ref<!fir.box<!fir.array<4xi32>>>):
# | %0 = fir.box_offset %arg0 base_addr : (!fir.ref<!fir.box<!fir.array<4xi32>>>) -> !fir.llvm_ptr<!fir.ref<!fir.array<4xi32>>>
# | omp.yield(%0 : !fir.llvm_ptr<!fir.ref<!fir.array<4xi32>>>)
# | }
# | func.func @_QPtask_full_section(%arg0: !fir.ref<!fir.array<4xi32>> {fir.bindc_name = "a"}) {
# | %0 = fir.alloca !fir.box<!fir.array<4xi32>>
# | %1 = fir.dummy_scope : !fir.dscope
# | %c-2 = arith.constant -2 : index
# | %c4 = arith.constant 4 : index
# | %2 = fir.shape_shift %c-2, %c4 : (index, index) -> !fir.shapeshift<1>
# | %3:2 = hlfir.declare %arg0(%2) dummy_scope %1 arg 1 {uniq_name = "_QFtask_full_sectionEa"} : (!fir.ref<!fir.array<4xi32>>, !fir.shapeshift<1>, !fir.dscope) -> (!fir.box<!fir.array<4xi32>>, !fir.ref<!fir.array<4xi32>>)
# | fir.store %3#0 to %0 : !fir.ref<!fir.box<!fir.array<4xi32>>>
# | omp.taskgroup task_reduction(byref @add_reduction_byref_box_4xi32 %0 -> %arg1 : !fir.ref<!fir.box<!fir.array<4xi32>>>) {
# | %4:2 = hlfir.declare %arg1 {uniq_name = "_QFtask_full_sectionEa"} : (!fir.ref<!fir.box<!fir.array<4xi32>>>) -> (!fir.ref<!fir.box<!fir.array<4xi32>>>, !fir.ref<!fir.box<!fir.array<4xi32>>>)
# | omp.task in_reduction(byref @add_reduction_byref_box_4xi32 %4#0 -> %arg2 : !fir.ref<!fir.box<!fir.array<4xi32>>>) {
# | %5:2 = hlfir.declare %arg2 {uniq_name = "_QFtask_full_sectionEa"} : (!fir.ref<!fir.box<!fir.array<4xi32>>>) -> (!fir.ref<!fir.box<!fir.array<4xi32>>>, !fir.ref<!fir.box<!fir.array<4xi32>>>)
# | %6 = fir.load %5#0 : !fir.ref<!fir.box<!fir.array<4xi32>>>
# | %c0 = arith.constant 0 : index
# | %7:3 = fir.box_dims %6, %c0 : (!fir.box<!fir.array<4xi32>>, index) -> (index, index, index)
# | %c1 = arith.constant 1 : index
# | %c0_0 = arith.constant 0 : index
# | %8:3 = fir.box_dims %6, %c0_0 : (!fir.box<!fir.array<4xi32>>, index) -> (index, index, index)
# | %9 = arith.addi %7#0, %8#1 : index
# | %10 = arith.subi %9, %c1 : index
# | %c1_1 = arith.constant 1 : index
# | %c4_2 = arith.constant 4 : index
# | %11 = fir.shape %c4_2 : (index) -> !fir.shape<1>
# | %12 = hlfir.designate %6 (%7#0:%10:%c1_1) shape %11 : (!fir.box<!fir.array<4xi32>>, index, index, index, !fir.shape<1>) -> !fir.ref<!fir.array<4xi32>>
# | %c1_i32 = arith.constant 1 : i32
# | %13 = hlfir.elemental %11 unordered : (!fir.shape<1>) -> !hlfir.expr<4xi32> {
# | ^bb0(%arg3: index):
# | %21 = hlfir.designate %12 (%arg3) : (!fir.ref<!fir.array<4xi32>>, index) -> !fir.ref<i32>
# | %22 = fir.load %21 : !fir.ref<i32>
# | %23 = arith.addi %22, %c1_i32 : i32
# | hlfir.yield_ele
# | ...
# `---data was truncated (10240/15950) (change limit with -D output_limit=N)
# .---command stderr------------
# | warning: OpenMP support for version 50 in flang is still incomplete [-Wexperimental-option]
# `-----------------------------
# executed command: 'c:\_work\llvm-project\llvm-project\build\bin\filecheck.exe' 'C:\_work\llvm-project\llvm-project\flang\test\Lower\OpenMP\reduction-array-full-section-task-privatization.f90' --check-prefix=TASK '--implicit-check-not=not\' 'yet\' implemented --implicit-check-not=Ea_firstprivate
# .---command stderr------------
# | filecheck.exe: Too many positional arguments specified!
# | Can specify at most 1 positional arguments: See: c:\_work\llvm-project\llvm-project\build\bin\filecheck.exe --help
# `-----------------------------
# error: command failed with exit status: 1
--
```
</details>
If these failures are unrelated to your changes (for example tests are broken or flaky at HEAD), please open an issue at https://github.com/llvm/llvm-project/issues and add the `infrastructure` label.
https://github.com/llvm/llvm-project/pull/215997
More information about the flang-commits
mailing list