[flang-commits] [flang] [flang][OpenMP] Lower cross-module operator declare reduction (PR #207493)

via flang-commits flang-commits at lists.llvm.org
Wed Jul 8 04:42:58 PDT 2026


github-actions[bot] wrote:

<!--PREMERGE ADVISOR COMMENT: Windows-->
# :window: Windows x64 Test Results

* 4443 tests passed
* 250 tests skipped
* 2 tests failed

## Failed Tests
(click on a test name to see its output)

### Flang
<details>
<summary>Flang.Lower/OpenMP/declare-reduction-merge-hermetic.f90</summary>

```
Exit Code: 1

Command Output (stdout):
--
# RUN: at line 10
rm -rf C:\_work\llvm-project\llvm-project\build\tools\flang\test\Lower\OpenMP\Output\declare-reduction-merge-hermetic.f90.tmp && split-file C:\_work\llvm-project\llvm-project\flang\test\Lower\OpenMP\declare-reduction-merge-hermetic.f90 C:\_work\llvm-project\llvm-project\build\tools\flang\test\Lower\OpenMP\Output\declare-reduction-merge-hermetic.f90.tmp && cd C:\_work\llvm-project\llvm-project\build\tools\flang\test\Lower\OpenMP\Output\declare-reduction-merge-hermetic.f90.tmp
# executed command: rm -rf 'C:\_work\llvm-project\llvm-project\build\tools\flang\test\Lower\OpenMP\Output\declare-reduction-merge-hermetic.f90.tmp'
# note: command had no output on stdout or stderr
# executed command: split-file 'C:\_work\llvm-project\llvm-project\flang\test\Lower\OpenMP\declare-reduction-merge-hermetic.f90' 'C:\_work\llvm-project\llvm-project\build\tools\flang\test\Lower\OpenMP\Output\declare-reduction-merge-hermetic.f90.tmp'
# note: command had no output on stdout or stderr
# executed command: cd 'C:\_work\llvm-project\llvm-project\build\tools\flang\test\Lower\OpenMP\Output\declare-reduction-merge-hermetic.f90.tmp'
# note: command had no output on stdout or stderr
# RUN: at line 11
c:\_work\llvm-project\llvm-project\build\bin\flang.exe -fc1 -fintrinsic-modules-path=C:\_work\llvm-project\llvm-project\build\lib\clang\23\finclude\flang\x86_64-pc-windows-msvc -fsyntax-only -fopenmp hm_base.f90
# 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\23\finclude\flang\x86_64-pc-windows-msvc' -fsyntax-only -fopenmp hm_base.f90
# note: command had no output on stdout or stderr
# RUN: at line 12
c:\_work\llvm-project\llvm-project\build\bin\flang.exe -fc1 -fintrinsic-modules-path=C:\_work\llvm-project\llvm-project\build\lib\clang\23\finclude\flang\x86_64-pc-windows-msvc -fsyntax-only -fhermetic-module-files -fopenmp hm_facade.f90
# 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\23\finclude\flang\x86_64-pc-windows-msvc' -fsyntax-only -fhermetic-module-files -fopenmp hm_facade.f90
# note: command had no output on stdout or stderr
# RUN: at line 13
c:\_work\llvm-project\llvm-project\build\bin\flang.exe -fc1 -fintrinsic-modules-path=C:\_work\llvm-project\llvm-project\build\lib\clang\23\finclude\flang\x86_64-pc-windows-msvc -emit-hlfir -fopenmp hm_use.f90 -o - | c:\_work\llvm-project\llvm-project\build\bin\filecheck.exe hm_use.f90
# 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\23\finclude\flang\x86_64-pc-windows-msvc' -emit-hlfir -fopenmp hm_use.f90 -o -
# note: command had no output on stdout or stderr
# executed command: 'c:\_work\llvm-project\llvm-project\build\bin\filecheck.exe' hm_use.f90
# .---command stderr------------
# | hm_use.f90:3:10: error: CHECK: expected string not found in input
# | ! CHECK: omp.declare_reduction @[[RED:_QQMhm_baseop\.myop\._i32]] : i32
# |          ^
# | <stdin>:1:1: note: scanning from here
# | 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 23.0.0 (https://github.com/llvm/llvm-project a5a7c28e32371a2ef136f82ae75fc663bd814098)", llvm.target_triple = "x86_64-pc-windows-msvc", omp.flags = #omp.flags<openmp_device_version = 31>, omp.is_gpu = false, omp.is_target_device = false, omp.target_triples = [], omp.version = #omp.version<version = 31>} {
# | ^
# | <stdin>:1:1: note: pattern attempts to capture variables: "RED"
# | 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 23.0.0 (https://github.com/llvm/llvm-project a5a7c28e32371a2ef136f82ae75fc663bd814098)", llvm.target_triple = "x86_64-pc-windows-msvc", omp.flags = #omp.flags<openmp_device_version = 31>, omp.is_gpu = false, omp.is_target_device = false, omp.target_triples = [], omp.version = #omp.version<version = 31>} {
# | ^
# | <stdin>:3:2: note: possible intended match here
# |  omp.declare_reduction @_QQMhm_baseop.myop. : i32 init {
# |  ^
# | 
# | Input file: <stdin>
# | Check file: hm_use.f90
# | 
# | -dump-input=help explains the following input dump.
# | 
# | Input was:
# | <<<<<<
# |            1: 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 23.0.0 (https://github.com/llvm/llvm-project a5a7c28e32371a2ef136f82ae75fc663bd814098)", llvm.target_triple = "x86_64-pc-windows-msvc", omp.flags = #omp.flags<openmp_device_version = 31>, omp.is_gpu = false, omp.is_target_device = false, omp.target_triples = [], omp.version = #omp.version<version = 31>} { 
# | check:3'0    {                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     search range start (exclusive)
# | check:3'1                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          error: no match found in search range
# | check:3'2                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          pattern attempts to capture variables: "RED"
# |            2:  omp.private {type = private} @_QFEi_private_i32 : i32 
# |            3:  omp.declare_reduction @_QQMhm_baseop.myop. : i32 init { 
# | check:3'3      ?                                                         possible intended match
# |            4:  ^bb0(%arg0: i32): 
# |            5:  %0 = fir.alloca i32 
# |            6:  %1 = fir.alloca i32 
# |            7:  fir.store %arg0 to %1 : !fir.ref<i32> 
# |            8:  %2:2 = hlfir.declare %1 {uniq_name = "omp_orig"} : (!fir.ref<i32>) -> (!fir.ref<i32>, !fir.ref<i32>) 
# |            .
# |            .
# |            .
# |           73:  fir.call @_QQmain() fastmath<contract> : () -> () 
# |           74:  %c0_i32 = arith.constant 0 : i32 
# |           75:  fir.call @_FortranAProgramEndStatement() fastmath<contract> : () -> () 
# |           76:  return %c0_i32 : i32 
# |           77:  } 
# |           78: } 
# | check:3'4       } search range end (exclusive)
# | >>>>>>
# `-----------------------------
# error: command failed with exit status: 1

--

```
</details>
<details>
<summary>Flang.Lower/OpenMP/declare-reduction-special-separate-reexport.f90</summary>

```
Exit Code: 2

Command Output (stdout):
--
# RUN: at line 12
rm -rf C:\_work\llvm-project\llvm-project\build\tools\flang\test\Lower\OpenMP\Output\declare-reduction-special-separate-reexport.f90.tmp && split-file C:\_work\llvm-project\llvm-project\flang\test\Lower\OpenMP\declare-reduction-special-separate-reexport.f90 C:\_work\llvm-project\llvm-project\build\tools\flang\test\Lower\OpenMP\Output\declare-reduction-special-separate-reexport.f90.tmp && cd C:\_work\llvm-project\llvm-project\build\tools\flang\test\Lower\OpenMP\Output\declare-reduction-special-separate-reexport.f90.tmp
# executed command: rm -rf 'C:\_work\llvm-project\llvm-project\build\tools\flang\test\Lower\OpenMP\Output\declare-reduction-special-separate-reexport.f90.tmp'
# note: command had no output on stdout or stderr
# executed command: split-file 'C:\_work\llvm-project\llvm-project\flang\test\Lower\OpenMP\declare-reduction-special-separate-reexport.f90' 'C:\_work\llvm-project\llvm-project\build\tools\flang\test\Lower\OpenMP\Output\declare-reduction-special-separate-reexport.f90.tmp'
# note: command had no output on stdout or stderr
# executed command: cd 'C:\_work\llvm-project\llvm-project\build\tools\flang\test\Lower\OpenMP\Output\declare-reduction-special-separate-reexport.f90.tmp'
# note: command had no output on stdout or stderr
# RUN: at line 13
c:\_work\llvm-project\llvm-project\build\bin\flang.exe -fc1 -fintrinsic-modules-path=C:\_work\llvm-project\llvm-project\build\lib\clang\23\finclude\flang\x86_64-pc-windows-msvc -fsyntax-only -fopenmp sp_base.f90
# 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\23\finclude\flang\x86_64-pc-windows-msvc' -fsyntax-only -fopenmp sp_base.f90
# note: command had no output on stdout or stderr
# RUN: at line 14
c:\_work\llvm-project\llvm-project\build\bin\flang.exe -fc1 -fintrinsic-modules-path=C:\_work\llvm-project\llvm-project\build\lib\clang\23\finclude\flang\x86_64-pc-windows-msvc -fsyntax-only -fopenmp sp_wrap.f90
# 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\23\finclude\flang\x86_64-pc-windows-msvc' -fsyntax-only -fopenmp sp_wrap.f90
# note: command had no output on stdout or stderr
# RUN: at line 17
c:\_work\llvm-project\llvm-project\build\bin\filecheck.exe --check-prefix=MODFILE --input-file=sp_wrap.mod sp_wrap.f90
# executed command: 'c:\_work\llvm-project\llvm-project\build\bin\filecheck.exe' --check-prefix=MODFILE --input-file=sp_wrap.mod sp_wrap.f90
# note: command had no output on stdout or stderr
# RUN: at line 18
c:\_work\llvm-project\llvm-project\build\bin\flang.exe -fc1 -fintrinsic-modules-path=C:\_work\llvm-project\llvm-project\build\lib\clang\23\finclude\flang\x86_64-pc-windows-msvc -emit-hlfir -fopenmp sp_use.f90 -o - | c:\_work\llvm-project\llvm-project\build\bin\filecheck.exe sp_use.f90
# 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\23\finclude\flang\x86_64-pc-windows-msvc' -emit-hlfir -fopenmp sp_use.f90 -o -
# .---command stderr------------
# | error: loc("C:\\_work\\llvm-project\\llvm-project\\build\\tools\\flang\\test\\Lower\\OpenMP\\Output\\declare-reduction-special-separate-reexport.f90.tmp\\sp_use.f90":12:9): C:\_work\llvm-project\llvm-project\flang\lib\Lower\Support\ReductionProcessor.cpp:963: not yet implemented: OpenMP user-defined reduction shadowing an intrinsic reduction is not yet supported for imported, renamed, or multiple-declaration/type reductions.
# | LLVM ERROR: aborting
# | PLEASE submit a bug report to https://github.com/llvm/llvm-project/issues/ and include the crash backtrace and instructions to reproduce the bug.
# | Stack dump:
# | 0.	Program arguments: c:\\_work\\llvm-project\\llvm-project\\build\\bin\\flang.exe -fc1 -fintrinsic-modules-path=C:\\_work\\llvm-project\\llvm-project\\build\\lib\\clang\\23\\finclude\\flang\\x86_64-pc-windows-msvc -emit-hlfir -fopenmp sp_use.f90 -o -
# `-----------------------------
# error: command failed with exit status: 1
# executed command: 'c:\_work\llvm-project\llvm-project\build\bin\filecheck.exe' sp_use.f90
# .---command stderr------------
# | FileCheck error: '<stdin>' is empty.
# | FileCheck command line:  c:\_work\llvm-project\llvm-project\build\bin\filecheck.exe sp_use.f90
# `-----------------------------
# error: command failed with exit status: 2

--

```
</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/207493


More information about the flang-commits mailing list