[Mlir-commits] [mlir] [MLIR][Tensor][Trivial] Fix test for trivial folding of tensor.insert_slice (PR #92889)

llvmlistbot at llvm.org llvmlistbot at llvm.org
Tue May 21 02:55:00 PDT 2024


llvmbot wrote:


<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-mlir-tensor

Author: Andi Drebes (andidr)

<details>
<summary>Changes</summary>

The test in `@<!-- -->trivial_insert_slice` checks for the absence of `tensor.extract_slice`, although the test neither originally contains this operation before canonicalization, nor would this operation be produced. Instead, the check should ensure the absence of `tensor.insert_slice`, which should be elided by the folder.

This is likely to be a copy-and-paste error for the check above.

---
Full diff: https://github.com/llvm/llvm-project/pull/92889.diff


1 Files Affected:

- (modified) mlir/test/Dialect/Tensor/canonicalize.mlir (+1-1) 


``````````diff
diff --git a/mlir/test/Dialect/Tensor/canonicalize.mlir b/mlir/test/Dialect/Tensor/canonicalize.mlir
index 914e5e8b8c4b8..89259e4d47ad3 100644
--- a/mlir/test/Dialect/Tensor/canonicalize.mlir
+++ b/mlir/test/Dialect/Tensor/canonicalize.mlir
@@ -533,7 +533,7 @@ func.func @trivial_slice(%arg0 : tensor<4x6x16x32xi8>) -> tensor<4x6x16x32xi8> {
 
 // CHECK-LABEL: func @trivial_insert_slice
 //  CHECK-SAME:   %[[ARG0:.[a-z0-9A-Z_]+]]: tensor<4x6x16x32xi8>
-//   CHECK-NOT:   tensor.extract_slice
+//   CHECK-NOT:   tensor.insert_slice
 //       CHECK:   return %[[ARG0]] :  tensor<4x6x16x32xi8>
 func.func @trivial_insert_slice(%arg0 : tensor<4x6x16x32xi8>, %arg1 : tensor<4x6x16x32xi8>) -> tensor<4x6x16x32xi8> {
   %0 = tensor.insert_slice %arg0 into %arg1[0, 0, 0, 0] [4, 6, 16, 32] [1, 1, 1, 1] : tensor<4x6x16x32xi8> into tensor<4x6x16x32xi8>

``````````

</details>


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


More information about the Mlir-commits mailing list