[Mlir-commits] [mlir] [MLIR][Tensor, MemRef] Fold expand_shape and collapse_shape if identity (PR #80658)

James Newling llvmlistbot at llvm.org
Sat Feb 24 13:50:23 PST 2024


================
@@ -462,6 +448,34 @@ func.func @collapse_shape_invalid_reassociation(%arg0: memref<?x?x?xf32>) {
 
 // -----
 
+// An (invalid) attempt at using collapse_shape to increase the rank might look
+// like this. Verify that a sensible error is emitted in this case.
+func.func @collapse_shape_invalid_reassociation_expansion(%arg0: memref<?xf32>) {
+  // expected-error @+1 {{reassociation indices must be contiguous}}
----------------
newling wrote:

Makes sense, I've changed it so the message is more informative. 

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


More information about the Mlir-commits mailing list