[Mlir-commits] [mlir] [MLIR][Interface]: Verify index map ranks before composing loop bounds (PR #173434)

llvmlistbot at llvm.org llvmlistbot at llvm.org
Sat Dec 27 09:02:31 PST 2025


github-actions[bot] wrote:

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

* 3379 tests passed
* 411 tests skipped
* 2 tests failed

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

### MLIR
<details>
<summary>MLIR.Dialect/Linalg/invalid.mlir</summary>

```
Exit Code: 1

Command Output (stdout):
--
# RUN: at line 1
c:\_work\llvm-project\llvm-project\build\bin\mlir-opt.exe C:\_work\llvm-project\llvm-project\mlir\test\Dialect\Linalg\invalid.mlir -split-input-file -verify-diagnostics
# executed command: 'c:\_work\llvm-project\llvm-project\build\bin\mlir-opt.exe' 'C:\_work\llvm-project\llvm-project\mlir\test\Dialect\Linalg\invalid.mlir' -split-input-file -verify-diagnostics
# .---command stdout------------
# | // -----
# | // -----
# | // -----
# | // -----
# | // -----
# | // -----
# | // -----
# | // -----
# | // -----
# | // -----
# | // -----
# | // -----
# | // -----
# | // -----
# | // -----
# | // -----
# | // -----
# | // -----
# | // -----
# | // -----
# | // -----
# | // -----
# | // -----
# | // -----
# | // -----
# | module {
# | }
# | 
# | // -----
# | // -----
# | // -----
# | // -----
# | // -----
# | // -----
# | // -----
# | // -----
# | // -----
# | // -----
# | // -----
# | // -----
# | // -----
# | // -----
# | // -----
# | // -----
# | // -----
# | // -----
# | // -----
# | // -----
# | // -----
# | // -----
# | // -----
# | // -----
# | // -----
# | // -----
# | // -----
# | // -----
# | // -----
# | // -----
# | // -----
# | // -----
# | // -----
# | // -----
# | // -----
# | // -----
# | // -----
# | // -----
# | // -----
# | // -----
# | // -----
# | // -----
# | // -----
# | // -----
# | // -----
# | // -----
# | // -----
# | // -----
# | // -----
# | // -----
# | // -----
# | // -----
# | // -----
# | // -----
# | // -----
# | // -----
# | // -----
# | // -----
# | // -----
# | // -----
# | // -----
# | // -----
# | // -----
# | // -----
# | // -----
# | // -----
# | // -----
# | // -----
# | // -----
# | // -----
# | // -----
# | // -----
# | // -----
# | // -----
# | // -----
# | // -----
# | // -----
# | // -----
# | // -----
# | // -----
# | // -----
# | // -----
# | // -----
# | // -----
# | // -----
# | // -----
# | // -----
# | // -----
# | // -----
# | // -----
# | // -----
# | // -----
# | // -----
# | // -----
# | // -----
# | // -----
# | // -----
# | // -----
# | // -----
# | // -----
# | // -----
# | // -----
# | // -----
# | // -----
# | // -----
# | // -----
# | // -----
# | // -----
# | // -----
# | // -----
# | // -----
# | // -----
# | // -----
# | // -----
# | // -----
# | // -----
# | // -----
# | // -----
# | // -----
# | // -----
# | // -----
# | // -----
# | // -----
# | // -----
# | // -----
# | // -----
# | // -----
# | // -----
# | // -----
# | // -----
# | // -----
# | // -----
# | // -----
# | // -----
# | // -----
# | // -----
# | // -----
# | // -----
# | // -----
# | // -----
# | // -----
# | // -----
# | // -----
# `-----------------------------
# .---command stderr------------
# | C:\_work\llvm-project\llvm-project\mlir\test\Dialect\Linalg\invalid.mlir:113:3: error: unexpected error: 'linalg.generic' op expected operand #0 rank (1) to match the result rank of indexing_map #0 (2)
# |   linalg.generic {
# |   ^
# | C:\_work\llvm-project\llvm-project\mlir\test\Dialect\Linalg\invalid.mlir:127:3: error: unexpected error: 'linalg.generic' op expected operand #0 rank (0) to match the result rank of indexing_map #0 (1)
# |   linalg.generic {
# |   ^
# | C:\_work\llvm-project\llvm-project\mlir\test\Dialect\Linalg\invalid.mlir:172:8: error: unexpected error: 'linalg.generic' op expected operand #0 rank (0) to match the result rank of indexing_map #0 (1)
# |   %0 = linalg.generic {
# |        ^
# | C:\_work\llvm-project\llvm-project\mlir\test\Dialect\Linalg\invalid.mlir:190:8: error: unexpected error: 'linalg.generic' op expected operand #1 rank (1) to match the result rank of indexing_map #1 (2)
# |   %0 = linalg.generic {
# |        ^
# | C:\_work\llvm-project\llvm-project\mlir\test\Dialect\Linalg\invalid.mlir:352:3: error: unexpected error: 'linalg.batch_matmul' op expected operand #1 rank (2) to match the result rank of indexing_map #1 (3)
# |   linalg.batch_matmul ins(%a3, %b3: memref<?x?x?xf32>, memref<?x?xf32>)
# |   ^
# | C:\_work\llvm-project\llvm-project\mlir\test\Dialect\Linalg\invalid.mlir:445:3: error: unexpected error: 'linalg.matmul' op expected operand #0 rank (0) to match the result rank of indexing_map #0 (2)
# |   linalg.matmul ins(%arg0, %arg1 : f32, memref<3x4xf32>)
# |   ^
# | C:\_work\llvm-project\llvm-project\mlir\test\Dialect\Linalg\invalid.mlir:557:3: error: unexpected error: 'linalg.matmul' op expected operand #0 rank (2) to match the result rank of indexing_map #0 (1)
# |   linalg.matmul indexing_maps = [
# |   ^
# | C:\_work\llvm-project\llvm-project\mlir\test\Dialect\Linalg\invalid.mlir:570:3: error: unexpected error: 'linalg.matmul' op expected operand #1 rank (2) to match the result rank of indexing_map #1 (1)
# |   linalg.matmul indexing_maps = [
# |   ^
# | C:\_work\llvm-project\llvm-project\mlir\test\Dialect\Linalg\invalid.mlir:1218:12: error: unexpected error: 'linalg.mmt4d' op expected operand #2 rank (2) to match the result rank of indexing_map #2 (4)
# |     %res = linalg.mmt4d
# |            ^
# | C:\_work\llvm-project\llvm-project\mlir\test\Dialect\Linalg\invalid.mlir:112:6: error: expected error "expected operand rank (1) to match the result rank of indexing_map #0 (2)" was not produced
# |   // expected-error @+1 {{expected operand rank (1) to match the result rank of indexing_map #0 (2)}}
# |      ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# | C:\_work\llvm-project\llvm-project\mlir\test\Dialect\Linalg\invalid.mlir:126:6: error: expected error "expected operand rank (0) to match the result rank of indexing_map #0 (1)" was not produced
# |   // expected-error @+1 {{expected operand rank (0) to match the result rank of indexing_map #0 (1)}}
# |      ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# | C:\_work\llvm-project\llvm-project\mlir\test\Dialect\Linalg\invalid.mlir:171:4: error: expected error "op expected operand rank (0) to match the result rank of indexing_map #0 (1)" was not produced
# | // expected-error @+1 {{op expected operand rank (0) to match the result rank of indexing_map #0 (1)}}
# |    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# | C:\_work\llvm-project\llvm-project\mlir\test\Dialect\Linalg\invalid.mlir:189:4: error: expected error "op expected operand rank (1) to match the result rank of indexing_map #1 (2)" was not produced
# | // expected-error @+1 {{op expected operand rank (1) to match the result rank of indexing_map #1 (2)}}
# |    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# | C:\_work\llvm-project\llvm-project\mlir\test\Dialect\Linalg\invalid.mlir:351:6: error: expected error "expected operand rank (2) to match the result rank of indexing_map #1 (3)" was not produced
# |   // expected-error @+1 {{expected operand rank (2) to match the result rank of indexing_map #1 (3)}}
# |      ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# | C:\_work\llvm-project\llvm-project\mlir\test\Dialect\Linalg\invalid.mlir:444:6: error: expected error "'linalg.matmul' op expected operand rank (0) to match the result rank of indexing_map #0 (2)" was not produced
# |   // expected-error @+1 {{'linalg.matmul' op expected operand rank (0) to match the result rank of indexing_map #0 (2)}}
# |      ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# | C:\_work\llvm-project\llvm-project\mlir\test\Dialect\Linalg\invalid.mlir:556:6: error: expected error "'linalg.matmul' op expected operand rank (2) to match the result rank of indexing_map #0 (1)" was not produced
# |   // expected-error @+1 {{'linalg.matmul' op expected operand rank (2) to match the result rank of indexing_map #0 (1)}}
# |      ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# | C:\_work\llvm-project\llvm-project\mlir\test\Dialect\Linalg\invalid.mlir:569:6: error: expected error "'linalg.matmul' op expected operand rank (2) to match the result rank of indexing_map #1 (1)" was not produced
# |   // expected-error @+1 {{'linalg.matmul' op expected operand rank (2) to match the result rank of indexing_map #1 (1)}}
# |      ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# | C:\_work\llvm-project\llvm-project\mlir\test\Dialect\Linalg\invalid.mlir:1217:8: error: expected error "expected operand rank (2) to match the result rank of indexing_map #2 (4)" was not produced
# |     // expected-error @+1 {{expected operand rank (2) to match the result rank of indexing_map #2 (4)}}
# |        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# `-----------------------------
# error: command failed with exit status: 1

--

```
</details>
<details>
<summary>MLIR.Dialect/Linalg/named-ops-fail.mlir</summary>

```
Exit Code: 1

Command Output (stdout):
--
# RUN: at line 1
c:\_work\llvm-project\llvm-project\build\bin\not.exe c:\_work\llvm-project\llvm-project\build\bin\mlir-opt.exe -split-input-file -verify-diagnostics C:\_work\llvm-project\llvm-project\mlir\test\Dialect\Linalg\named-ops-fail.mlir 2>&1 | c:\_work\llvm-project\llvm-project\build\bin\filecheck.exe C:\_work\llvm-project\llvm-project\mlir\test\Dialect\Linalg\named-ops-fail.mlir
# executed command: 'c:\_work\llvm-project\llvm-project\build\bin\not.exe' 'c:\_work\llvm-project\llvm-project\build\bin\mlir-opt.exe' -split-input-file -verify-diagnostics 'C:\_work\llvm-project\llvm-project\mlir\test\Dialect\Linalg\named-ops-fail.mlir'
# note: command had no output on stdout or stderr
# executed command: 'c:\_work\llvm-project\llvm-project\build\bin\filecheck.exe' 'C:\_work\llvm-project\llvm-project\mlir\test\Dialect\Linalg\named-ops-fail.mlir'
# .---command stderr------------
# | C:\_work\llvm-project\llvm-project\mlir\test\Dialect\Linalg\named-ops-fail.mlir:12:12: error: CHECK: expected string not found in input
# |  // CHECK: op expected operand rank (2) to match the result rank of indexing_map #0 (3)
# |            ^
# | <stdin>:1:106: note: scanning from here
# | <unknown>:0: error: unexpected error: 'arith.addf' op requires the same type for all operands and results
# |                                                                                                          ^
# | <stdin>:2:125: note: possible intended match here
# | C:\_work\llvm-project\llvm-project\mlir\test\Dialect\Linalg\named-ops-fail.mlir:13:3: error: unexpected error: 'linalg.add' op expected operand #0 rank (2) to match the result rank of indexing_map #0 (3)
# |                                                                                                                             ^
# | 
# | Input file: <stdin>
# | Check file: C:\_work\llvm-project\llvm-project\mlir\test\Dialect\Linalg\named-ops-fail.mlir
# | 
# | -dump-input=help explains the following input dump.
# | 
# | Input was:
# | <<<<<<
# |             1: <unknown>:0: error: unexpected error: 'arith.addf' op requires the same type for all operands and results 
# | check:12'0                                                                                                              X error: no match found
# |             2: C:\_work\llvm-project\llvm-project\mlir\test\Dialect\Linalg\named-ops-fail.mlir:13:3: error: unexpected error: 'linalg.add' op expected operand #0 rank (2) to match the result rank of indexing_map #0 (3) 
# | check:12'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# | check:12'1                                                                                                                                 ?                                                                                possible intended match
# |             3:  linalg.add ins(%arg0, %arg1 : memref<8x16xf32>, memref<4x8x16xf32>) outs(%arg2: memref<4x8x16xf32>) 
# | check:12'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# |             4:  ^ 
# | check:12'0     ~~~
# |             5: <unknown>:0: error: unexpected error: 'arith.subf' op requires the same type for all operands and results 
# | check:12'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# |             6: C:\_work\llvm-project\llvm-project\mlir\test\Dialect\Linalg\named-ops-fail.mlir:29:3: error: unexpected error: 'linalg.sub' op expected operand #0 rank (2) to match the result rank of indexing_map #0 (3) 
# | check:12'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# |             7:  linalg.sub ins(%arg0, %arg1 : memref<8x16xf32>, memref<4x8x16xf32>) outs(%arg2: memref<4x8x16xf32>) 
# | check:12'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/173434


More information about the Mlir-commits mailing list