[flang-commits] [flang] [flang] add simplification for ProductOp intrinsic (PR #169575)

via flang-commits flang-commits at lists.llvm.org
Tue Dec 2 13:57:57 PST 2025


github-actions[bot] wrote:

<!--PREMERGE ADVISOR COMMENT: Linux-->
# :penguin: Linux x64 Test Results

* 3835 tests passed
* 201 tests skipped
* 1 test failed

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

### Flang
<details>
<summary>Flang.HLFIR/simplify-hlfir-intrinsics-product.fir</summary>

```
Exit Code: 1

Command Output (stdout):
--
# RUN: at line 1
fir-opt --simplify-hlfir-intrinsics /home/gha/actions-runner/_work/llvm-project/llvm-project/flang/test/HLFIR/simplify-hlfir-intrinsics-product.fir | /home/gha/actions-runner/_work/llvm-project/llvm-project/build/bin/FileCheck /home/gha/actions-runner/_work/llvm-project/llvm-project/flang/test/HLFIR/simplify-hlfir-intrinsics-product.fir
# executed command: fir-opt --simplify-hlfir-intrinsics /home/gha/actions-runner/_work/llvm-project/llvm-project/flang/test/HLFIR/simplify-hlfir-intrinsics-product.fir
# note: command had no output on stdout or stderr
# executed command: /home/gha/actions-runner/_work/llvm-project/llvm-project/build/bin/FileCheck /home/gha/actions-runner/_work/llvm-project/llvm-project/flang/test/HLFIR/simplify-hlfir-intrinsics-product.fir
# .---command stderr------------
# | /home/gha/actions-runner/_work/llvm-project/llvm-project/flang/test/HLFIR/simplify-hlfir-intrinsics-product.fir:13:11: error: CHECK: expected string not found in input
# | // CHECK: %[[CONSTANT_2:.*]] = arith.constant 0 : i32
# |           ^
# | <stdin>:4:32: note: scanning from here
# |  %c1 = arith.constant 1 : index
# |                                ^
# | <stdin>:5:4: note: possible intended match here
# |  %c1_i32 = arith.constant 1 : i32
# |    ^
# | /home/gha/actions-runner/_work/llvm-project/llvm-project/flang/test/HLFIR/simplify-hlfir-intrinsics-product.fir:45:11: error: CHECK: expected string not found in input
# | // CHECK: %[[CONSTANT_1:.*]] = arith.constant 0 : i32
# |           ^
# | <stdin>:28:32: note: scanning from here
# |  %c1 = arith.constant 1 : index
# |                                ^
# | <stdin>:29:4: note: possible intended match here
# |  %c1_i32 = arith.constant 1 : i32
# |    ^
# | /home/gha/actions-runner/_work/llvm-project/llvm-project/flang/test/HLFIR/simplify-hlfir-intrinsics-product.fir:381:11: error: CHECK: expected string not found in input
# | // CHECK: %[[CONSTANT_2:.*]] = arith.constant 0 : i32
# |           ^
# | <stdin>:282:32: note: scanning from here
# |  %c3 = arith.constant 3 : index
# |                                ^
# | <stdin>:283:4: note: possible intended match here
# |  %c1_i32 = arith.constant 1 : i32
# |    ^
# | /home/gha/actions-runner/_work/llvm-project/llvm-project/flang/test/HLFIR/simplify-hlfir-intrinsics-product.fir:403:11: error: CHECK: expected string not found in input
# | // CHECK: %[[CONSTANT_1:.*]] = arith.constant 0 : i32
# |           ^
# | <stdin>:297:32: note: scanning from here
# |  %c1 = arith.constant 1 : index
# |                                ^
# | <stdin>:298:4: note: possible intended match here
# |  %c1_i32 = arith.constant 1 : i32
# |    ^
# | 
# | Input file: <stdin>
# | Check file: /home/gha/actions-runner/_work/llvm-project/llvm-project/flang/test/HLFIR/simplify-hlfir-intrinsics-product.fir
# | 
# | -dump-input=help explains the following input dump.
# | 
# | Input was:
# | <<<<<<
# |              1: module { 
# |              2:  func.func @product_box_known_extents(%arg0: !fir.box<!fir.array<2x3xi32>>) -> !hlfir.expr<2xi32> { 
# |              3:  %c0 = arith.constant 0 : index 
# |              4:  %c1 = arith.constant 1 : index 
# | check:13'0                                     X error: no match found
# |              5:  %c1_i32 = arith.constant 1 : i32 
# | check:13'0      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# | check:13'1         ?                               possible intended match
# |              6:  %c2 = arith.constant 2 : index 
# | check:13'0      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# |              7:  %c3 = arith.constant 3 : index 
# | check:13'0      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# |              8:  %0 = fir.shape %c2 : (index) -> !fir.shape<1> 
# | check:13'0      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# |              9:  %1 = hlfir.elemental %0 unordered : (!fir.shape<1>) -> !hlfir.expr<2xi32> { 
# | check:13'0      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# |             10:  ^bb0(%arg1: index): 
# | check:13'0      ~~~~~~~~~~~~~~~~~~~~~
# |              .
# |              .
# |              .
# |             23:  hlfir.yield_element %2 : i32 
# | check:13'0      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# |             24:  } 
# | check:13'0      ~~~
# |             25:  return %1 : !hlfir.expr<2xi32> 
# | check:13'0      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# |             26:  } 
# | check:13'0      ~~~
# |             27:  func.func @product_expr_known_extents(%arg0: !hlfir.expr<2x3xi32>) -> !hlfir.expr<3xi32> { 
# | check:13'0      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# |             28:  %c1 = arith.constant 1 : index 
# | check:45'0                                     X error: no match found
# |             29:  %c1_i32 = arith.constant 1 : i32 
# | check:45'0      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# | check:45'1         ?                               possible intended match
# |             30:  %c2 = arith.constant 2 : index 
# | check:45'0      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# |             31:  %c3 = arith.constant 3 : index 
# | check:45'0      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# |             32:  %0 = fir.shape %c3 : (index) -> !fir.shape<1> 
# | check:45'0      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# |             33:  %1 = hlfir.elemental %0 unordered : (!fir.shape<1>) -> !hlfir.expr<3xi32> { 
# | check:45'0      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# |             34:  ^bb0(%arg1: index): 
# | check:45'0      ~~~~~~~~~~~~~~~~~~~~~
# |              .
# |              .
# |              .
# |            277:  } 
# |            278:  return %1 : !hlfir.expr<3xf32> 
# |            279:  } 
# |            280:  func.func @product_total_1d_reduction(%arg0: !fir.box<!fir.array<3xi32>>) -> i32 { 
# |            281:  %c0 = arith.constant 0 : index 
# |            282:  %c3 = arith.constant 3 : index 
# | check:381'0                                    X error: no match found
# |            283:  %c1_i32 = arith.constant 1 : i32 
# | check:381'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# | check:381'1        ?                               possible intended match
# |            284:  %c1 = arith.constant 1 : index 
# | check:381'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# |            285:  %0 = fir.do_loop %arg1 = %c1 to %c3 step %c1 unordered iter_args(%arg2 = %c1_i32) -> (i32) { 
# | check:381'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# |            286:  %1:3 = fir.box_dims %arg0, %c0 : (!fir.box<!fir.array<3xi32>>, index) -> (index, index, index) 
# | check:381'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# |            287:  %2 = arith.subi %1#0, %c1 : index 
# | check:381'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# |            288:  %3 = arith.addi %arg1, %2 : index 
# | check:381'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# |              .
# |              .
# |              .
# |            292:  fir.result %6 : i32 
# | check:381'0     ~~~~~~~~~~~~~~~~~~~~~
# |            293:  } 
# | check:381'0     ~~~
# |            294:  return %0 : i32 
# | check:381'0     ~~~~~~~~~~~~~~~~~
# |            295:  } 
# | check:381'0     ~~~
# |            296:  func.func @product_total_2d_reduction(%arg0: !fir.box<!fir.array<?x3xi32>>) -> i32 { 
# | check:381'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# |            297:  %c1 = arith.constant 1 : index 
# | check:403'0                                    X error: no match found
# |            298:  %c1_i32 = arith.constant 1 : i32 
# | check:403'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# | check:403'1        ?                               possible intended match
# |            299:  %c3 = arith.constant 3 : index 
# | check:403'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# |            300:  %c0 = arith.constant 0 : index 
# | check:403'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# |            301:  %0:3 = fir.box_dims %arg0, %c0 : (!fir.box<!fir.array<?x3xi32>>, index) -> (index, index, index) 
# | check:403'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# |            302:  %1 = fir.do_loop %arg1 = %c1 to %c3 step %c1 unordered iter_args(%arg2 = %c1_i32) -> (i32) { 
# | check:403'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# |            303:  %2 = fir.do_loop %arg3 = %c1 to %0#1 step %c1 unordered iter_args(%arg4 = %arg2) -> (i32) { 
# | check:403'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# |              .
# |              .
# |              .
# | >>>>>>
# `-----------------------------
# 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/169575


More information about the flang-commits mailing list