[Mlir-commits] [mlir] [MLIR][Arith] Fix index_cast/index_castui chain folding to check intermediate width (PR #189042)

llvmlistbot at llvm.org llvmlistbot at llvm.org
Fri Mar 27 09:30:58 PDT 2026


github-actions[bot] wrote:

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

* 7733 tests passed
* 604 tests skipped
* 3 tests failed

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

### MLIR
<details>
<summary>MLIR.Conversion/ArithToEmitC/arith-to-emitc.mlir</summary>

```
Exit Code: 1

Command Output (stdout):
--
# RUN: at line 1
/home/gha/actions-runner/_work/llvm-project/llvm-project/build/bin/mlir-opt -split-input-file -convert-arith-to-emitc /home/gha/actions-runner/_work/llvm-project/llvm-project/mlir/test/Conversion/ArithToEmitC/arith-to-emitc.mlir | /home/gha/actions-runner/_work/llvm-project/llvm-project/build/bin/FileCheck /home/gha/actions-runner/_work/llvm-project/llvm-project/mlir/test/Conversion/ArithToEmitC/arith-to-emitc.mlir
# executed command: /home/gha/actions-runner/_work/llvm-project/llvm-project/build/bin/mlir-opt -split-input-file -convert-arith-to-emitc /home/gha/actions-runner/_work/llvm-project/llvm-project/mlir/test/Conversion/ArithToEmitC/arith-to-emitc.mlir
# 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/mlir/test/Conversion/ArithToEmitC/arith-to-emitc.mlir
# .---command stderr------------
# | /home/gha/actions-runner/_work/llvm-project/llvm-project/mlir/test/Conversion/ArithToEmitC/arith-to-emitc.mlir:696:12: error: CHECK: expected string not found in input
# |  // CHECK: %[[Conv2:.*]] = emitc.cast %[[Conv1]] : !emitc.size_t to !emitc.ptrdiff_t
# |            ^
# | <stdin>:520:56: note: scanning from here
# |  %1 = emitc.cast %0 : !emitc.ptrdiff_t to !emitc.size_t
# |                                                        ^
# | <stdin>:520:56: note: with "Conv1" equal to "1"
# |  %1 = emitc.cast %0 : !emitc.ptrdiff_t to !emitc.size_t
# |                                                        ^
# | <stdin>:523:2: note: possible intended match here
# |  %4 = emitc.cast %3 : !emitc.size_t to i1
# |  ^
# | /home/gha/actions-runner/_work/llvm-project/llvm-project/mlir/test/Conversion/ArithToEmitC/arith-to-emitc.mlir:718:12: error: CHECK: expected string not found in input
# |  // CHECK: %[[Conv2:.*]] = emitc.cast %[[Conv1]] : !emitc.size_t to ui32
# |            ^
# | <stdin>:532:44: note: scanning from here
# |  %1 = emitc.cast %0 : ui32 to !emitc.size_t
# |                                            ^
# | <stdin>:532:44: note: with "Conv1" equal to "1"
# |  %1 = emitc.cast %0 : ui32 to !emitc.size_t
# |                                            ^
# | <stdin>:535:2: note: possible intended match here
# |  %4 = emitc.cast %3 : !emitc.size_t to i1
# |  ^
# | 
# | Input file: <stdin>
# | Check file: /home/gha/actions-runner/_work/llvm-project/llvm-project/mlir/test/Conversion/ArithToEmitC/arith-to-emitc.mlir
# | 
# | -dump-input=help explains the following input dump.
# | 
# | Input was:
# | <<<<<<
# |              .
# |              .
# |              .
# |            515:  
# |            516: // ----- 
# |            517: module { 
# |            518:  func.func @arith_index_cast(%arg0: i32) -> i32 { 
# |            519:  %0 = emitc.cast %arg0 : i32 to !emitc.ptrdiff_t 
# |            520:  %1 = emitc.cast %0 : !emitc.ptrdiff_t to !emitc.size_t 
# | check:696'0                                                            X error: no match found
# | check:696'1                                                              with "Conv1" equal to "1"
# |            521:  %2 = "emitc.constant"() <{value = 1 : index}> : () -> !emitc.size_t 
# | check:696'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# |            522:  %3 = emitc.bitwise_and %1, %2 : (!emitc.size_t, !emitc.size_t) -> !emitc.size_t 
# | check:696'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# |            523:  %4 = emitc.cast %3 : !emitc.size_t to i1 
# | check:696'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# | check:696'2      ?                                         possible intended match
# |            524:  return %arg0 : i32 
# | check:696'0     ~~~~~~~~~~~~~~~~~~~~
# |            525:  } 
# | check:696'0     ~~~
# |            526: } 
# | check:696'0     ~~
# |            527:  
# | check:696'0     ~
# |            528: // ----- 
# | check:696'0     ~~~~~~~~~
# |            529: module { 
# | check:696'0     ~~~~~~~~~
# |            530:  func.func @arith_index_castui(%arg0: i32) -> i32 { 
# | check:696'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# |            531:  %0 = emitc.cast %arg0 : i32 to ui32 
# |            532:  %1 = emitc.cast %0 : ui32 to !emitc.size_t 
# | check:718'0                                                X error: no match found
# | check:718'1                                                  with "Conv1" equal to "1"
# |            533:  %2 = "emitc.constant"() <{value = 1 : index}> : () -> !emitc.size_t 
# | check:718'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# |            534:  %3 = emitc.bitwise_and %1, %2 : (!emitc.size_t, !emitc.size_t) -> !emitc.size_t 
# | check:718'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# |            535:  %4 = emitc.cast %3 : !emitc.size_t to i1 
# | check:718'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# | check:718'2      ?                                         possible intended match
# |            536:  return %arg0 : i32 
# | check:718'0     ~~~~~~~~~~~~~~~~~~~~
# |            537:  } 
# | check:718'0     ~~~
# |            538: } 
# | check:718'0     ~~
# |            539:  
# | check:718'0     ~
# |            540: // ----- 
# | check:718'0     ~~~~~~~~~
# |              .
# |              .
# |              .
# | >>>>>>
# `-----------------------------
# error: command failed with exit status: 1

--

```
</details>
<details>
<summary>MLIR.Conversion/ArithToLLVM/convert-nd-vector-to-llvmir.mlir</summary>

```
Exit Code: 1

Command Output (stdout):
--
# RUN: at line 1
/home/gha/actions-runner/_work/llvm-project/llvm-project/build/bin/mlir-opt -pass-pipeline="builtin.module(func.func(convert-arith-to-llvm))" /home/gha/actions-runner/_work/llvm-project/llvm-project/mlir/test/Conversion/ArithToLLVM/convert-nd-vector-to-llvmir.mlir -split-input-file | /home/gha/actions-runner/_work/llvm-project/llvm-project/build/bin/FileCheck /home/gha/actions-runner/_work/llvm-project/llvm-project/mlir/test/Conversion/ArithToLLVM/convert-nd-vector-to-llvmir.mlir
# executed command: /home/gha/actions-runner/_work/llvm-project/llvm-project/build/bin/mlir-opt '-pass-pipeline=builtin.module(func.func(convert-arith-to-llvm))' /home/gha/actions-runner/_work/llvm-project/llvm-project/mlir/test/Conversion/ArithToLLVM/convert-nd-vector-to-llvmir.mlir -split-input-file
# 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/mlir/test/Conversion/ArithToLLVM/convert-nd-vector-to-llvmir.mlir
# .---command stderr------------
# | /home/gha/actions-runner/_work/llvm-project/llvm-project/mlir/test/Conversion/ArithToLLVM/convert-nd-vector-to-llvmir.mlir:240:12: error: CHECK: expected string not found in input
# |  // CHECK: %[[EXTRACT3:.*]] = llvm.extractvalue %[[INSERT2]][0, 0] : !llvm.array<1 x array<2 x vector<3xi{{.*}}>>>
# |            ^
# | <stdin>:243:80: note: scanning from here
# |  %7 = llvm.insertvalue %6, %4[0, 1] : !llvm.array<1 x array<2 x vector<3xi64>>> 
# |                                                                                ^
# | <stdin>:243:80: note: with "INSERT2" equal to "7"
# |  %7 = llvm.insertvalue %6, %4[0, 1] : !llvm.array<1 x array<2 x vector<3xi64>>> 
# |                                                                                ^
# | 
# | Input file: <stdin>
# | Check file: /home/gha/actions-runner/_work/llvm-project/llvm-project/mlir/test/Conversion/ArithToLLVM/convert-nd-vector-to-llvmir.mlir
# | 
# | -dump-input=help explains the following input dump.
# | 
# | Input was:
# | <<<<<<
# |              .
# |              .
# |              .
# |            238:  %2 = llvm.extractvalue %0[0, 0] : !llvm.array<1 x array<2 x vector<3xi1>>>  
# |            239:  %3 = llvm.sext %2 : vector<3xi1> to vector<3xi64> 
# |            240:  %4 = llvm.insertvalue %3, %1[0, 0] : !llvm.array<1 x array<2 x vector<3xi64>>>  
# |            241:  %5 = llvm.extractvalue %0[0, 1] : !llvm.array<1 x array<2 x vector<3xi1>>>  
# |            242:  %6 = llvm.sext %5 : vector<3xi1> to vector<3xi64> 
# |            243:  %7 = llvm.insertvalue %6, %4[0, 1] : !llvm.array<1 x array<2 x vector<3xi64>>>  
# | check:240'0                                                                                    X~ error: no match found
# | check:240'1                                                                                       with "INSERT2" equal to "7"
# |            244:  return 
# | check:240'0     ~~~~~~~~
# |            245:  } 
# | check:240'0     ~~~
# |            246: } 
# | check:240'0     ~~
# |            247:  
# | check:240'0     ~
# | >>>>>>
# `-----------------------------
# error: command failed with exit status: 1

--

```
</details>
<details>
<summary>MLIR.Dialect/Linalg/fusion-elementwise-ops.mlir</summary>

```
Exit Code: 1

Command Output (stdout):
--
# RUN: at line 1
/home/gha/actions-runner/_work/llvm-project/llvm-project/build/bin/mlir-opt /home/gha/actions-runner/_work/llvm-project/llvm-project/mlir/test/Dialect/Linalg/fusion-elementwise-ops.mlir -linalg-fuse-elementwise-ops -split-input-file | /home/gha/actions-runner/_work/llvm-project/llvm-project/build/bin/FileCheck /home/gha/actions-runner/_work/llvm-project/llvm-project/mlir/test/Dialect/Linalg/fusion-elementwise-ops.mlir
# executed command: /home/gha/actions-runner/_work/llvm-project/llvm-project/build/bin/mlir-opt /home/gha/actions-runner/_work/llvm-project/llvm-project/mlir/test/Dialect/Linalg/fusion-elementwise-ops.mlir -linalg-fuse-elementwise-ops -split-input-file
# 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/mlir/test/Dialect/Linalg/fusion-elementwise-ops.mlir
# .---command stderr------------
# | /home/gha/actions-runner/_work/llvm-project/llvm-project/mlir/test/Dialect/Linalg/fusion-elementwise-ops.mlir:856:15: error: CHECK-DAG: expected string not found in input
# | // CHECK-DAG: %[[CAST2:.+]] = arith.index_cast %[[CAST1]] : i64 to index
# |               ^
# | <stdin>:426:29: note: scanning from here
# |  ^bb0(%out: i64, %out_0: i32):
# |                             ^
# | <stdin>:426:29: note: with "CAST1" equal to "4"
# |  ^bb0(%out: i64, %out_0: i32):
# |                             ^
# | <stdin>:428:2: note: possible intended match here
# |  %4 = arith.index_cast %3 : index to i64
# |  ^
# | 
# | Input file: <stdin>
# | Check file: /home/gha/actions-runner/_work/llvm-project/llvm-project/mlir/test/Dialect/Linalg/fusion-elementwise-ops.mlir
# | 
# | -dump-input=help explains the following input dump.
# | 
# | Input was:
# | <<<<<<
# |            .
# |            .
# |            .
# |          421: module { 
# |          422:  func.func @fusion_different_axes(%arg0: tensor<5000xi64>, %arg1: tensor<5000xi32>) -> tensor<5000xi32> { 
# |          423:  %0 = tensor.empty() : tensor<5000xi64> 
# |          424:  %1 = tensor.empty() : tensor<5000xi32> 
# |          425:  %2:2 = linalg.generic {indexing_maps = [#map, #map1], iterator_types = ["parallel", "parallel"]} outs(%0, %1 : tensor<5000xi64>, tensor<5000xi32>) { 
# |          426:  ^bb0(%out: i64, %out_0: i32): 
# | dag:856'0                                 X~~ error: no match found
# | dag:856'1                                     with "CAST1" equal to "4"
# |          427:  %3 = linalg.index 0 : index 
# | dag:856'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# |          428:  %4 = arith.index_cast %3 : index to i64 
# | dag:856'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# | dag:856'2      ?                                        possible intended match
# |          429:  %extracted = tensor.extract %arg1[%3] : tensor<5000xi32> 
# | dag:856'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# |          430:  linalg.yield %4, %extracted : i64, i32 
# | dag:856'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# |          431:  } -> (tensor<5000xi64>, tensor<5000xi32>) 
# | dag:856'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# |          432:  return %2#1 : tensor<5000xi32> 
# | dag:856'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# |          433:  } 
# | dag:856'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/189042


More information about the Mlir-commits mailing list