[Mlir-commits] [mlir] [mlir][Vector] Update patterns for flattening vector.xfer Ops (1/N) (PR #73522)

Andrzej WarzyƄski llvmlistbot at llvm.org
Thu Nov 30 12:17:24 PST 2023


================
@@ -54,11 +121,8 @@ func.func @transfer_read_0d(%arg : memref<i8>) -> vector<i8> {
       return %0 : vector<i8>
 }
 
-// CHECK-LABEL: func @transfer_read_0d
-// CHECK-SAME:       %[[ARG:.+]]: memref<i8>
-// CHECK:            %[[CST:.+]] = arith.constant 0 : i8
-// CHECK:            %[[READ:.+]] = vector.transfer_read %[[ARG]][], %[[CST]] : memref<i8>
-// CHECK:            return %[[READ]]
+// CHECK-NOT: memref.collapse_shape
----------------
banach-space wrote:

> I think we still expect some operations in the func op?

We do expect _some_ ops, but we only really need to verify that the patterns tested here are **not run**. And that can be recognised by verifying that **neither** `memref.collpase_shape` **nor** `vector.shape_cast` **are inserted**. Does checking anything else help here?

I feel that this is more in line with https://mlir.llvm.org/getting_started/TestingGuide/#filecheck-best-practices
> Tests should be minimal, and only check what is absolutely necessary.

This is not something I feel strongly about. I'm happy to restore the original content. Adding `CHECK-NOT` is very beneficial, so I would like to keep that. WDYT?

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


More information about the Mlir-commits mailing list