Skip to content
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

[MLIR][TOSA] Remove failed test cases #68664

Merged
merged 1 commit into from
Oct 10, 2023
Merged

Conversation

LiqinWeng
Copy link
Contributor

I would put this into the implementation of verify for tosa.slice

@llvmbot
Copy link
Collaborator

llvmbot commented Oct 10, 2023

@llvm/pr-subscribers-mlir

Author: LiqinWeng (LiqinWeng)

Changes

I would put this into the implementation of verify for tosa.slice


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

2 Files Affected:

  • (modified) mlir/lib/Conversion/TosaToTensor/TosaToTensor.cpp (+1-2)
  • (modified) mlir/test/Conversion/TosaToTensor/tosa-to-tensor-invalid.mlir (-7)
diff --git a/mlir/lib/Conversion/TosaToTensor/TosaToTensor.cpp b/mlir/lib/Conversion/TosaToTensor/TosaToTensor.cpp
index 7a62429d3700443..06ec53d19b1e956 100644
--- a/mlir/lib/Conversion/TosaToTensor/TosaToTensor.cpp
+++ b/mlir/lib/Conversion/TosaToTensor/TosaToTensor.cpp
@@ -244,8 +244,7 @@ class SliceConverter : public OpConversionPattern<tosa::SliceOp> {
     Location loc = sliceOp.getLoc();
     Value input = adaptor.getInput();
     ShapedType resultType = cast<ShapedType>(sliceOp.getType());
-    if (llvm::isa<UnrankedTensorType>(resultType) ||
-        resultType.getRank() != static_cast<int64_t>(sliceOp.getSize().size()))
+    if (llvm::isa<UnrankedTensorType>(resultType))
       return failure();
     SmallVector<int64_t> strides, sizes;
     ArrayRef<int64_t> starts = sliceOp.getStart();
diff --git a/mlir/test/Conversion/TosaToTensor/tosa-to-tensor-invalid.mlir b/mlir/test/Conversion/TosaToTensor/tosa-to-tensor-invalid.mlir
index cfa1c41f2467985..36eb4d4669b07ae 100644
--- a/mlir/test/Conversion/TosaToTensor/tosa-to-tensor-invalid.mlir
+++ b/mlir/test/Conversion/TosaToTensor/tosa-to-tensor-invalid.mlir
@@ -6,10 +6,3 @@ func.func @slice_resultType_unranked(%arg0: tensor<?xf32>) -> (tensor<*xf32>) {
   %0 = "tosa.slice"(%arg0) {start = array<i64: 2>, size = array<i64: 0>} : (tensor<?xf32>)  -> (tensor<*xf32>)
   return %0 : tensor<*xf32>
 }
-
-// CHECK-LABEL:  @slice_resultRank_neq_opSize
-func.func @slice_resultRank_neq_opSize(%arg0: tensor<12xf32>) -> (tensor<2xf32>) {
-  // expected-error@+1 {{failed to legalize operation 'tosa.slice'}}
-  %0 = "tosa.slice"(%arg0) {start = array<i64: 2>, size = array<i64: 2, 3>} : (tensor<12xf32>)  -> (tensor<2xf32>)
-  return %0 : tensor<2xf32>
-}

@benshi001
Copy link
Member

LGTM !

@LiqinWeng LiqinWeng merged commit d37056c into llvm:main Oct 10, 2023
4 checks passed
@joker-eph
Copy link
Collaborator

This brings the bots back to green, thanks!

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

Successfully merging this pull request may close these issues.

4 participants