[Mlir-commits] [mlir] [mlir][linalg] Avoid asserts in IndexingMapOpInterface (PR #179072)
Samarth Narang
llvmlistbot at llvm.org
Sat Jan 31 16:54:39 PST 2026
================
@@ -217,6 +217,25 @@ func.func @generic_indexing_map_with_symbol(%arg0: tensor<8xf32>) -> tensor<8xf3
return %0 : tensor<8xf32>
}
+// -----
+
+// Unranked tensor inputs must be diagnosed.
+func.func @generic_unranked_input_tensor(%in: tensor<*xf32>) {
+ %out = tensor.empty() : tensor<16x16xf32>
+ // expected-error @+1 {{expected operand #0 rank (0) to match the result rank of indexing_map (2)}}
----------------
snarang181 wrote:
That is a fair point, I agree. I think some work could be done here https://github.com/llvm/llvm-project/blame/33cef35bfb8bb7077ba19296fd99ba5cc4c4b0cf/mlir/lib/Interfaces/IndexingMapOpInterface.cpp#L39 but like you linked above, the `InterfaceMethod` does return a `rank = 0` when conditions are not satisfied.
https://github.com/llvm/llvm-project/pull/179072
More information about the Mlir-commits
mailing list