[PATCH] D140748: [MLIR][Tosa] Make Tosa_IntArrayAttr2 use DenseI64ArrayAttr

Jacques Pienaar via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Dec 29 06:56:22 PST 2022


jpienaar added inline comments.


================
Comment at: mlir/include/mlir/Dialect/Tosa/IR/TosaOpBase.td:127
   (ins "Type":$outputType, "Value":$input, "Value":$weight, "Value":$bias,
-       "ArrayAttr":$pad, "ArrayAttr":$stride, "ArrayAttr":$dilation),
+       "ArrayAttr":$pad, "DenseI64ArrayAttr":$stride, "DenseI64ArrayAttr":$dilation),
   [{
----------------
While we are here, fully qualify the types here. I ran into that recently. It could also be a pure mechanical change before this one.


================
Comment at: mlir/lib/Conversion/TosaToLinalg/TosaToLinalgNamed.cpp:190
     auto padAttr = op->getAttr("pad").cast<ArrayAttr>();
-    auto strideTosaAttr = op->getAttr("stride").cast<ArrayAttr>();
-    auto dilationTosaAttr = op->getAttr("dilation").cast<ArrayAttr>();
+    auto strideTosaAttr = op->getAttr("stride").cast<DenseI64ArrayAttr>();
+    auto dilationTosaAttr = op->getAttr("dilation").cast<DenseI64ArrayAttr>();
----------------
op.getStride() or op.getStrideAttr() (if you really want the attribute) would be better.


================
Comment at: mlir/test/lib/Dialect/Tosa/TosaTestPasses.cpp:151
       tosaConv2DOp.getWeight(), tosaConv2DOp.getBias(), tosaConv2DOp.getPad(),
-      tosaConv2DOp.getStride(), tosaConv2DOp.getDilation());
+      rewriter.getDenseI64ArrayAttr(tosaConv2DOp.getStride()),
+      rewriter.getDenseI64ArrayAttr(tosaConv2DOp.getDilation()));
----------------
Does getStrideAttr() not provide a dense i64 array attr?


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D140748/new/

https://reviews.llvm.org/D140748



More information about the llvm-commits mailing list