[Mlir-commits] [mlir] [mlir][linalg] Fix Linalg runtime verification pass to handle tensors with dimensions of size 0 (PR #163791)
Matthias Springer
llvmlistbot at llvm.org
Sun Oct 19 03:24:02 PDT 2025
================
@@ -103,6 +103,11 @@ func.func @main() {
// CHECK: unexpected negative result on dimension #0 of input/output operand #0
func.call @reverse_from_3(%d5x) : (tensor<?xf32>) -> (tensor<?xf32>)
+ %c0x = arith.constant dense<1.0> : tensor<0xf32>
+ %d0x = tensor.cast %c0x : tensor<0xf32> to tensor<?xf32>
+ // CHECK-NOT: ERROR: Runtime op verification failed
+ func.call @fill_empty_1d(%d0x) : (tensor<?xf32>) -> (tensor<?xf32>)
----------------
matthias-springer wrote:
This makes sense.
But I'm wondering why we check startIndex/endIndex separately. Wouldn't it be sufficient to check that the number of loop iterations match the dimension of the tensor? Can Linalg loops ever start from a value different than zero? Also, can they actually run in reverse order, as the comments suggest. (This is not an issue with your fix here.)
https://github.com/llvm/llvm-project/pull/163791
More information about the Mlir-commits
mailing list