Skip to content

[MLIR][Tensor][Trivial] Fix test for trivial folding of tensor.insert_slice #92889

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

andidr
Copy link
Contributor

@andidr andidr commented May 21, 2024

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.

…_slice

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.
@llvmbot
Copy link
Member

llvmbot commented May 21, 2024

@llvm/pr-subscribers-mlir

@llvm/pr-subscribers-mlir-tensor

Author: Andi Drebes (andidr)

Changes

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 --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>

@andidr
Copy link
Contributor Author

andidr commented May 21, 2024

Adding @matthias-springer to the discussion, who seems have adapted the test in commit 060208b.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants