[Mlir-commits] [mlir] d37056c - [MLIR][TOSA] Remove failed test cases (#68664)

llvmlistbot at llvm.org llvmlistbot at llvm.org
Mon Oct 9 23:50:42 PDT 2023


Author: LiqinWeng
Date: 2023-10-10T14:50:38+08:00
New Revision: d37056c6a596c176acf0f7042e6d8ade78f31793

URL: https://github.com/llvm/llvm-project/commit/d37056c6a596c176acf0f7042e6d8ade78f31793
DIFF: https://github.com/llvm/llvm-project/commit/d37056c6a596c176acf0f7042e6d8ade78f31793.diff

LOG: [MLIR][TOSA] Remove failed test cases (#68664)

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

Added: 
    

Modified: 
    mlir/lib/Conversion/TosaToTensor/TosaToTensor.cpp
    mlir/test/Conversion/TosaToTensor/tosa-to-tensor-invalid.mlir

Removed: 
    


################################################################################
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 at +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>
-}


        


More information about the Mlir-commits mailing list