[Mlir-commits] [mlir] [TOSA] Use attributes for unsigned rescale (PR #118075)

Thomas Preud'homme llvmlistbot at llvm.org
Tue Dec 3 06:27:44 PST 2024


================
@@ -1895,13 +1896,33 @@ def Tosa_RescaleOp: Tosa_Op<"rescale", [Pure,
     DenseI8ArrayAttr:$shift,
     BoolAttr:$scale32,
     BoolAttr:$double_round,
-    BoolAttr:$per_channel
+    BoolAttr:$per_channel,
+    DefaultValuedOptionalAttr<BoolAttr, "false">:$input_unsigned,
+    DefaultValuedOptionalAttr<BoolAttr, "false">:$output_unsigned
   );
 
   let results = (outs
     Tosa_Tensor:$output
   );
 
+  // Custom builder that does not require optional input_unsigned and
+  // output_unsigned.
+  let builders = [
----------------
RoboTux wrote:

To not break any existing code because mlir-tblgen will currently force the first default valued attribute to be specified (i.e. it has no default value in the constructor that takes an attribute). This is fixed by https://github.com/llvm/llvm-project/pull/118075

https://github.com/llvm/llvm-project/pull/118075


More information about the Mlir-commits mailing list