[Mlir-commits] [mlir] [mlir][arith] Fix crash when narrowing or truncating to i0 (PR #179894)

Akimasa Watanuki llvmlistbot at llvm.org
Thu Feb 5 05:25:10 PST 2026


================
@@ -148,3 +148,14 @@ func.func @analysis_crash(%arg0: i32, %arg1: tensor<128xi1>) -> tensor<128xi64>
   %2 = arith.extsi %1 : tensor<128xi32> to tensor<128xi64>
   return %2 : tensor<128xi64>
 }
+
+// -----
+
+// CHECK-LABEL: func @test_i0_trunc_crash
+func.func @test_i0_trunc_crash() {
+  %c1_i1 = arith.constant true
+  // Shoaib's Fix: Ensure trunci to i0 doesn't crash during range inference.
+  // The test passes if mlir-opt processes this without an assertion failure.
----------------
Men-cotton wrote:

`// The test passes if mlir-opt processes this without an assertion failure.`

Future contributors will not get any additional information from this comment (the existence of the test is sufficient). So, drop it.

For details, please see [Testing Guide](https://mlir.llvm.org/getting_started/TestingGuide/#contributor-guidelines).

https://github.com/llvm/llvm-project/pull/179894


More information about the Mlir-commits mailing list