[Mlir-commits] [mlir] 7ff0ca1 - [mlir][tosa] Updates tosa.logical_not to use the SameOperandsAndResultType trait

Jacques Pienaar llvmlistbot at llvm.org
Thu Aug 11 15:53:13 PDT 2022


Author: not-jenni
Date: 2022-08-11T15:42:30-07:00
New Revision: 7ff0ca1a4df85155863dcb15c8f38337d73451e2

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

LOG: [mlir][tosa] Updates tosa.logical_not to use the SameOperandsAndResultType trait

Reviewed By: jpienaar

Differential Revision: https://reviews.llvm.org/D131496

Added: 
    

Modified: 
    mlir/include/mlir/Dialect/Tosa/IR/TosaOps.td
    mlir/test/Dialect/Tosa/tosa-infer-shapes.mlir

Removed: 
    


################################################################################
diff  --git a/mlir/include/mlir/Dialect/Tosa/IR/TosaOps.td b/mlir/include/mlir/Dialect/Tosa/IR/TosaOps.td
index 3f00587b342b3..bfc152b25a9c6 100644
--- a/mlir/include/mlir/Dialect/Tosa/IR/TosaOps.td
+++ b/mlir/include/mlir/Dialect/Tosa/IR/TosaOps.td
@@ -1013,7 +1013,7 @@ def Tosa_LogOp : Tosa_Op<"log", [
 def Tosa_LogicalNotOp : Tosa_Op<"logical_not", [
     DeclareOpInterfaceMethods<InferShapedTypeOpInterface,
                               ["inferReturnTypeComponents"]>,
-    NoSideEffect]> {
+    NoSideEffect, SameOperandsAndResultType]> {
   let summary = "Returns the truth value of NOT x element-wise.";
 
   let description = [{

diff  --git a/mlir/test/Dialect/Tosa/tosa-infer-shapes.mlir b/mlir/test/Dialect/Tosa/tosa-infer-shapes.mlir
index 2386b3fa8e6ad..62bd0841ed454 100644
--- a/mlir/test/Dialect/Tosa/tosa-infer-shapes.mlir
+++ b/mlir/test/Dialect/Tosa/tosa-infer-shapes.mlir
@@ -106,15 +106,6 @@ func.func @test_unary_i32(%arg0 : tensor<4xi32>) -> () {
 
 // -----
 
-// CHECK-LABEL: @test_unary_i1
-func.func @test_unary_i1(%arg0 : tensor<4xi1>) -> () {
-  // CHECK: "tosa.logical_not"(%arg0) : (tensor<4xi1>) -> tensor<4xi1>
-  %0 = "tosa.logical_not"(%arg0) : (tensor<4xi1>) -> tensor<*xi1>
-  return
-}
-
-// -----
-
 // CHECK-LABEL: @test_binary_scalar_f32
 func.func @test_binary_scalar_f32(%arg0 : tensor<4xf32>, %arg1 : tensor<f32>) -> () {
   // CHECK: "tosa.add"(%arg0, %arg1) : (tensor<4xf32>, tensor<f32>) -> tensor<4xf32>


        


More information about the Mlir-commits mailing list