[Mlir-commits] [mlir] 6300845 - [mlir][tosa] Relax tosa.apply_scale operations

Rob Suderman llvmlistbot at llvm.org
Tue Jan 11 09:58:52 PST 2022


Author: Rob Suderman
Date: 2022-01-11T09:57:36-08:00
New Revision: 630084549b33f297fdc4cab78190c783688603ea

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

LOG: [mlir][tosa] Relax tosa.apply_scale operations

Apply scale may operate on vectors, scalars, or tensors during
tiling. Relax the requirements to avoid failures.

Reviewed By: NatashaKnk

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

Added: 
    

Modified: 
    mlir/include/mlir/Dialect/Tosa/IR/TosaTypesBase.td
    mlir/include/mlir/Dialect/Tosa/IR/TosaUtilOps.td

Removed: 
    


################################################################################
diff  --git a/mlir/include/mlir/Dialect/Tosa/IR/TosaTypesBase.td b/mlir/include/mlir/Dialect/Tosa/IR/TosaTypesBase.td
index 46a4cbc0623cd..7d66b6fb455f1 100644
--- a/mlir/include/mlir/Dialect/Tosa/IR/TosaTypesBase.td
+++ b/mlir/include/mlir/Dialect/Tosa/IR/TosaTypesBase.td
@@ -154,6 +154,7 @@ class Tosa_TypeLike<list<Type> types, string description = ""> : TypeConstraint<
      TensorOf<types>.predicate]>,
      description>;
 
+def Tosa_IntLike : Tosa_TypeLike<[Tosa_Int], "signless-integer-like">;
 def Tosa_Int8Like : Tosa_TypeLike<[Tosa_Int8], "signless-integer-8-bit-like">;
 def Tosa_Int16Like : Tosa_TypeLike<[Tosa_Int16], "signless-integer-16-bit-like">;
 def Tosa_Int32Like : Tosa_TypeLike<[Tosa_Int32], "signless-integer-32-bit-like">;

diff  --git a/mlir/include/mlir/Dialect/Tosa/IR/TosaUtilOps.td b/mlir/include/mlir/Dialect/Tosa/IR/TosaUtilOps.td
index af98bd55d0b47..9afe29e174a05 100644
--- a/mlir/include/mlir/Dialect/Tosa/IR/TosaUtilOps.td
+++ b/mlir/include/mlir/Dialect/Tosa/IR/TosaUtilOps.td
@@ -37,14 +37,14 @@ def Tosa_ApplyScaleOp: Tosa_Op<"apply_scale", [NoSideEffect] # ElementwiseMappab
   }];
 
   let arguments = (ins
-    Tosa_Int:$value,
-    Tosa_Int:$multiplier,
+    Tosa_IntLike:$value,
+    Tosa_IntLike:$multiplier,
     Tosa_Int8Like:$shift,
     BoolAttr:$double_round
   );
 
   let results = (outs
-    Tosa_Int:$output
+    Tosa_IntLike:$output
   );
 }
 


        


More information about the Mlir-commits mailing list